From efc33deea7a5cce5fb58abe8beb6d46ce69ccc9b Mon Sep 17 00:00:00 2001 From: Lanlan Date: Tue, 9 Nov 2021 10:15:35 +0800 Subject: [PATCH 1/4] =?UTF-8?q?REPORT-62133=20mac=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=AE=89=E8=A3=85=E5=8C=85=E8=B5=B7=E4=B8=8D=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/DesignerEnvManager.java | 8 ++++++++ .../com/fr/design/login/DesignerLoginHelper.java | 2 +- .../login/config/DesignerLoginConfigManager.java | 14 ++++++++++++++ .../design/login/guide/DesignerGuideHelper.java | 16 +++++++++++----- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 9c23dcc51..b8d63ca7a 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -867,6 +867,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { designerLoginConfigManager.setPluginRemindOnFirstLaunch(pluginRemindOnFirstLaunch); } + public boolean isUseOldVersionLogin() { + return designerLoginConfigManager.isUseOldVersionLogin(); + } + + public void setUseOldVersionLogin(boolean useOldVersionLogin) { + designerLoginConfigManager.setUseOldVersionLogin(useOldVersionLogin); + } + /** * 内置服务器是否使用时启动 * diff --git a/designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java b/designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java index 2d2dd935d..8976a0734 100644 --- a/designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java +++ b/designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java @@ -47,7 +47,7 @@ public class DesignerLoginHelper { } public static void showLoginDialog(DesignerLoginSource source, Map params, Window window) { - if (!SupportOSImpl.DESIGNER_LOGIN.support()) { + if (!SupportOSImpl.DESIGNER_LOGIN.support() || DesignerEnvManager.getEnvManager().isUseOldVersionLogin()) { WebViewDlgHelper.createLoginDialog(window); return; } diff --git a/designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java b/designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java index a0ab68109..b0fb0e292 100644 --- a/designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java +++ b/designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java @@ -70,6 +70,10 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter { * 插件管理第一次启动时的提醒 */ private boolean pluginRemindOnFirstLaunch = true; + /** + * 使用旧版登录 + */ + private boolean useOldVersionLogin = false; private DesignerLoginConfigManager() { @@ -98,6 +102,7 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter { this.setLastLoginAccount(reader.getAttrAsString("lastLoginAccount", StringUtils.EMPTY)); this.setLoginRemindBeforeJumpBBS(reader.getAttrAsBoolean("loginRemindBeforeJumpBBS", true)); this.setPluginRemindOnFirstLaunch(reader.getAttrAsBoolean("pluginRemindOnFirstLaunch", true)); + this.setUseOldVersionLogin(reader.getAttrAsBoolean("useOldVersionLogin", false)); } } @@ -117,6 +122,7 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter { writer.attr("lastLoginAccount", lastLoginAccount); writer.attr("loginRemindBeforeJumpBBS", loginRemindBeforeJumpBBS); writer.attr("pluginRemindOnFirstLaunch", pluginRemindOnFirstLaunch); + writer.attr("useOldVersionLogin", useOldVersionLogin); writer.end(); } @@ -223,4 +229,12 @@ public class DesignerLoginConfigManager implements XMLReadable, XMLWriter { public void setPluginRemindOnFirstLaunch(boolean pluginRemindOnFirstLaunch) { this.pluginRemindOnFirstLaunch = pluginRemindOnFirstLaunch; } + + public boolean isUseOldVersionLogin() { + return useOldVersionLogin; + } + + public void setUseOldVersionLogin(boolean useOldVersionLogin) { + this.useOldVersionLogin = useOldVersionLogin; + } } diff --git a/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java index b3513bb6d..3e4c0dae5 100644 --- a/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java +++ b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java @@ -8,9 +8,7 @@ import com.fr.design.login.utils.DesignerLoginUtils; import com.fr.design.mainframe.DesignerContext; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.update.push.DesignerPushUpdateManager; -import com.fr.general.CloudCenter; -import com.fr.general.CloudCenterConfig; -import com.fr.general.http.HttpToolbox; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import javax.swing.WindowConstants; @@ -39,7 +37,11 @@ public class DesignerGuideHelper { public static void prepareShowGuideDialog() { // 如果存在更新升级的弹窗,则不显示引导页面 - if (!DesignerLoginUtils.isOnline() || !SupportOSImpl.DESIGNER_LOGIN.support() || !FRContext.isChineseEnv() || DesignerPushUpdateManager.getInstance().isShouldPopUp()) { + if (!DesignerLoginUtils.isOnline() + || !SupportOSImpl.DESIGNER_LOGIN.support() + || !FRContext.isChineseEnv() + || DesignerPushUpdateManager.getInstance().isShouldPopUp() + || DesignerEnvManager.getEnvManager().isUseOldVersionLogin()) { return; } if (isActivatedForOneWeek()) { @@ -52,7 +54,11 @@ public class DesignerGuideHelper { DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() { @Override public void designerOpened() { - showGuideDialog(); + try { + showGuideDialog(); + } catch (Throwable t) { + FineLoggerFactory.getLogger().warn(t.getMessage(), t); + } } }); } From 90505e143d01bd40b02d58c16eb960a087b48365 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Fri, 12 Nov 2021 14:54:57 +0800 Subject: [PATCH 2/4] =?UTF-8?q?REPORT-62088=20=E6=9D=A5=E5=9B=9E=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E4=B8=A4=E4=B8=AA=E5=8D=95=E5=85=83=E6=A0=BC=E5=8F=8A?= =?UTF-8?q?=E5=85=B6=E7=9A=84=E6=8E=92=E5=BA=8F=E6=8C=89=E9=92=AE=EF=BC=8C?= =?UTF-8?q?=E5=87=A0=E5=8D=81=E6=AC=A1=E5=90=8E=EF=BC=8C=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/gui/ibutton/UIButtonGroup.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java index 624e2e8ee..5ca303fd5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java @@ -379,7 +379,10 @@ public class UIButtonGroup extends JPanel implements GlobalNameObserver { * @param l */ public void removeChangeListener(ChangeListener l) { - this.listenerList.remove(ChangeListener.class, l); + for (int i = 0; i < labelButtonList.size(); i++) { + labelButtonList.get(i).removeChangeListener(l); + listenerList.remove(ChangeListener.class, l); + } } From d2c39de9d3229333e467f81c844a3b4886a89eef Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 16 Nov 2021 13:44:24 +0800 Subject: [PATCH 3/4] =?UTF-8?q?CHART-21951=20=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E6=8F=92=E4=BB=B6=E6=97=A0=E6=B3=95=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E5=A4=8D=E7=94=A8=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/share/effect/EffectItemGroup.java | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java b/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java index c04932d0d..622f5cc99 100644 --- a/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java +++ b/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java @@ -109,15 +109,7 @@ public class EffectItemGroup { Object value = cellElement.getValue(); if (value instanceof ChartCollection) { ChartCollection chartCollection = (ChartCollection) value; - for (int index = 0; index < chartCollection.getChartCount(); index++) { - Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class); - Plot plot = chart.getPlot(); - if (plot == null) { - continue; - } - SourceNode chartSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), cellSourceNode); - initChartPlot(plot, chartSourceNode, false); - } + initChartEditorByChartCollection(chartCollection, cellSourceNode); } } @@ -127,16 +119,23 @@ public class EffectItemGroup { private void initChartEditor() { ChartEditor editor = (ChartEditor) this.widget; ChartCollection chartCollection = (ChartCollection) editor.getChartCollection(); + initChartEditorByChartCollection(chartCollection, null); + + } + + private void initChartEditorByChartCollection(ChartCollection chartCollection, SourceNode sourceNode) { for (int index = 0; index < chartCollection.getChartCount(); index++) { - Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class); - Plot plot = chart.getPlot(); - if (plot == null) { - continue; + ChartProvider chartProvider = chartCollection.getChart(index, ChartProvider.class); + if (chartProvider instanceof Chart) { + Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class); + Plot plot = chart.getPlot(); + if (plot == null) { + continue; + } + SourceNode plotSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), sourceNode); + initChartPlot(plot, plotSourceNode, false); } - SourceNode plotSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), null); - initChartPlot(plot, plotSourceNode, false); } - } private void initChartPlot(Plot plot, SourceNode sourceNode, boolean isSubChart) { From 3430b56fae9b86e58e059a4d2ec87c7af6f86a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Tue, 16 Nov 2021 21:43:44 +0800 Subject: [PATCH 4/4] =?UTF-8?q?REPORT-60748=20=E5=86=B3=E7=AD=96=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8-=E5=B1=9E=E6=80=A7-=E5=9D=90=E6=A0=87=E5=B0=BA?= =?UTF-8?q?=E5=AF=B8=E4=BA=A4=E4=BA=92=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/WidgetBoundsPaneFactory.java | 6 +++--- .../design/designer/creator/XChartEditor.java | 5 +++++ .../fr/design/designer/creator/XCreator.java | 8 ++++++++ .../designer/creator/XCreatorUtils.java | 19 +++++++++++++++++++ .../design/designer/creator/XElementCase.java | 5 +++++ .../designer/creator/XLayoutContainer.java | 5 +++++ .../widget/ui/FormSingleWidgetCardPane.java | 11 +++-------- .../component/WidgetAbsoluteBoundPane.java | 2 +- .../designer/component/WidgetBoundPane.java | 15 ++++++++++++++- 9 files changed, 63 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java b/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java index 99b1ddaa0..2b2dcc532 100644 --- a/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java @@ -46,12 +46,12 @@ public class WidgetBoundsPaneFactory { private static final int RIGHT_PANE_WIDTH = 145; - public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height, JComponent ratioLocked) { + public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height, JComponent ratioLocked, NameAttribute nameAttribute) { JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ - new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Form_Widget_Size")), + new Component[]{FRWidgetFactory.createLineWrapLabel(nameAttribute.getSizeName()), ratioLocked != null ? createRightPane(width, ratioLocked, height) : createRightPane(width, height)}, new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))}, }; @@ -65,7 +65,7 @@ public class WidgetBoundsPaneFactory { } public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) { - return createBoundsPane(width, height, null); + return createBoundsPane(width, height, null, NameAttribute.DEFAULT); } public static JPanel createRightPane(Component com1, Component com2) { diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java index 3d1550af6..b70754c11 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java @@ -363,4 +363,9 @@ public class XChartEditor extends XBorderStyleWidgetCreator { return false; } + @Override + public boolean isComponent() { + return true; + } + } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index 87a1926cb..1fafe839c 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -894,4 +894,12 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo } return ((XCreator) this.getParent()).getLevel() + 1; } + + /** + * 是否是组件(控件还是组件) + * @return 是否是组件 + */ + public boolean isComponent() { + return false; + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index 945d3bfdd..2f797efa4 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -356,4 +356,23 @@ public class XCreatorUtils { } return null; } + + /** + * 把控件例如textEditor外层的容器剥掉 + * @param xCreator 控件 + * @return 内层控件 + */ + public static XCreator getXCreatorInnerWidget(XCreator xCreator) { + if (xCreator.acceptType(XWScaleLayout.class)) { + if (xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator()) { + return (XCreator) xCreator.getComponent(0); + } + } + + if (xCreator.acceptType(XWTitleLayout.class)) { + return (XCreator) xCreator.getComponent(0); + } + + return xCreator; + } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java index cf8b7a766..f1a4f1716 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java @@ -365,4 +365,9 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public void releaseResources() { imageLable.setIcon(null); } + + @Override + public boolean isComponent() { + return true; + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java b/designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java index f1d4c4f6d..92c5dd654 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java @@ -586,4 +586,9 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme public void setDragInAble(boolean dragInAble) { this.dragInAble = dragInAble; } + + @Override + public boolean isComponent() { + return true; + } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java index 9f0c44ded..1fd1a3527 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java @@ -113,7 +113,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane { } private void initComponents() { - XCreator innerCreator = getXCreatorDedicated(); + XCreator innerCreator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator); attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); content.add(attriCardPane, BorderLayout.CENTER); @@ -166,7 +166,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane { private void initDefinePane() { currentEditorDefinePane = null; - XCreator creator = getXCreatorDedicated(); + XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator); FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, designer, creator.toData(), new Operator() { @Override public void did(DataCreatorUI ui, String cardName) { @@ -190,11 +190,6 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane { currentEditorDefinePane = definePane; } - private XCreator getXCreatorDedicated() { - boolean dedicateLayout = xCreator.acceptType(XWScaleLayout.class) && xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator() || xCreator.acceptType(XWTitleLayout.class); - return dedicateLayout ? (XCreator) xCreator.getComponent(0) : xCreator; - } - @Override public String title4PopupWindow() { return "Widget"; @@ -283,7 +278,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane { } public void fireValueChanged() { - XCreator creator = getXCreatorDedicated(); + XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator); creator.firePropertyChange(); } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java index e8aeb994d..f6d52a2d6 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java @@ -35,7 +35,7 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { width.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size")); height.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size")); ratioLockedButton.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size")); - this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height, ratioLockedButton, WidgetBoundsPaneFactory.NameAttribute.WIDGET)); + this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height, ratioLockedButton, getNameAttribute())); } @Override 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 a462a8aed..aee83889e 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 @@ -89,7 +89,20 @@ public class WidgetBoundPane extends BasicPane { ratioLockedButton.setLockEnabled(false); } - this.add(WidgetBoundsPaneFactory.createBoundsPane(width, height, ratioLockedButton)); + this.add(WidgetBoundsPaneFactory.createBoundsPane(width, height, ratioLockedButton, getNameAttribute())); + } + + protected WidgetBoundsPaneFactory.NameAttribute getNameAttribute() { + WidgetBoundsPaneFactory.NameAttribute nameAttribute = WidgetBoundsPaneFactory.NameAttribute.DEFAULT; + if (!isComponent()) { + nameAttribute = WidgetBoundsPaneFactory.NameAttribute.WIDGET; + } + return nameAttribute; + } + + protected boolean isComponent() { + XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.creator); + return creator.isComponent(); }