From 835474ffb35d9155ff47d6f39f5f920e2d8dfbcc Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 10 May 2022 15:53:09 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-71158=20=E6=89=93=E5=BC=80fvs=EF=BC=8C?= =?UTF-8?q?=E4=BB=8E=E8=BF=9C=E7=A8=8B=E5=88=87=E6=8D=A2=E5=88=B0=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=EF=BC=8C=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E7=A9=BA=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 检测JTemplate类型,避免类型转换失败 【改动思路】 同上 【review建议】 --- .../main/java/com/fr/design/gui/xpane/LayoutBorderPane.java | 4 ++-- .../main/java/com/fr/design/gui/xpane/LayoutStylePane.java | 6 ++++-- .../widget/ui/designer/component/WidgetBoundPane.java | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutBorderPane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutBorderPane.java index cf460f9ceb..7a00075d61 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutBorderPane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutBorderPane.java @@ -333,8 +333,8 @@ public class LayoutBorderPane extends BasicPane { JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); defaultPane.add(rightPane, BorderLayout.EAST); rightPane.add(initRightBottomPane(), BorderLayout.CENTER); - JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); - if (!jTemplate.isJWorkBook() && ((JForm)jTemplate).isSelectRootPane()){ + JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + if (!jTemplate.isJWorkBook() && jTemplate instanceof JForm && ((JForm)jTemplate).isSelectRootPane()){ //界面上表单主体只有背景和透明度可以设置 rightPane.add(initBodyRightTopPane(), BorderLayout.NORTH); } else { diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java index 4a034e9be5..5cbddadb4d 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java @@ -66,8 +66,10 @@ public class LayoutStylePane extends BasicBeanPane { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - JTemplate currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - boolean isRootLayout = currentEditingTemplate != null && !currentEditingTemplate.isJWorkBook() && ((JForm)currentEditingTemplate).isSelectRootPane(); + JTemplate currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + boolean isRootLayout = currentEditingTemplate != null && + !currentEditingTemplate.isJWorkBook() && + currentEditingTemplate instanceof JForm && ((JForm)currentEditingTemplate).isSelectRootPane(); namedTitleStylePane = createNamedTitleStylePane(isRootLayout); namedBodyStylePane = createNamedBodyStylePane(isRootLayout); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java index 85265fa6ec..1c77bdaf1e 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java @@ -76,8 +76,8 @@ public class WidgetBoundPane extends BasicPane { height.setEnabled(false); } - JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (jTemplate.isJWorkBook() || !((JForm)jTemplate).isSelectRootPane()) { + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (jTemplate.isJWorkBook() || !((jTemplate instanceof JForm) && ((JForm)jTemplate).isSelectRootPane())) { ratioLockedButton = new AspectRatioLockedButton(width, height); ratioLockedButton.setGlobalName(i18nText("Fine-Design_Form_Coords_And_Size")); ratioLockedButton.setLockEnabled(false);