From c5feb03896cc37cb41758a3461e8aacb1b6f6176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 11 Nov 2021 10:34:45 +0800 Subject: [PATCH 1/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 | 15 ++++++++++++--- .../fr/design/designer/creator/XCreator.java | 12 ++++++++++-- .../designer/creator/XCreatorUtils.java | 19 +++++++++++++++++++ .../design/designer/creator/XElementCase.java | 5 +++++ .../designer/creator/XLayoutContainer.java | 5 +++++ .../widget/ui/FormSingleWidgetCardPane.java | 13 +++---------- .../component/WidgetAbsoluteBoundPane.java | 2 +- .../designer/component/WidgetBoundPane.java | 15 ++++++++++++++- 9 files changed, 72 insertions(+), 20 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 ae3dfc255..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_Basic_Component_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 1ab6d1a31..b808a935d 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 @@ -20,7 +20,6 @@ import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; import com.fr.design.module.DesignModuleFactory; import com.fr.form.ui.BaseChartEditor; -import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.Widget; import com.fr.stable.Constants; import com.fr.stable.core.PropertyChangeAdapter; @@ -29,9 +28,15 @@ import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.SwingUtilities; -import java.awt.*; -import java.beans.IntrospectionException; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Insets; +import java.awt.Rectangle; import java.awt.event.MouseEvent; +import java.beans.IntrospectionException; /** * form中的图表按钮弹出的控件, 创建初始化图表内容. @@ -367,4 +372,8 @@ 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 1c45fc2b6..14fc9ea24 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 @@ -9,8 +9,8 @@ import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; import com.fr.design.designer.beans.events.DesignerEditor; import com.fr.design.designer.beans.models.SelectionModel; -import com.fr.design.designer.creator.operate.XCreatorBaseOperate; import com.fr.design.designer.creator.operate.DefaultXCreatorBaseOperate; +import com.fr.design.designer.creator.operate.XCreatorBaseOperate; import com.fr.design.designer.treeview.DefaultXCreatorTreeCellRender; import com.fr.design.designer.treeview.XCreatorTreeCellRender; import com.fr.design.designer.ui.PopupDialogContext; @@ -36,7 +36,6 @@ import com.fr.stable.Constants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; -import java.awt.event.MouseListener; import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JFrame; @@ -50,6 +49,7 @@ import java.awt.Dimension; import java.awt.Graphics; import java.awt.Rectangle; import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; import java.beans.IntrospectionException; import java.util.ArrayList; import java.util.List; @@ -935,4 +935,12 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo return new DefaultXCreatorBaseOperate(); } + /** + * 是否是组件(控件还是组件) + * @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 30f9ab307..deaa22967 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 @@ -427,4 +427,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 42a14aee3..bdaf40d22 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 @@ -366,4 +366,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 801f18969..01d09fe4c 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 @@ -612,4 +612,9 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme public void replaceXcreator(XCreator newCreator, XCreator oldCreator){ } + + @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..6fed5262f 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 @@ -10,8 +10,6 @@ import com.fr.design.designer.creator.XWAbsoluteBodyLayout; import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWParameterLayout; -import com.fr.design.designer.creator.XWScaleLayout; -import com.fr.design.designer.creator.XWTitleLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.foldablepane.UIExpandablePane; @@ -113,7 +111,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 +164,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 +188,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 +276,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(); } From efc33deea7a5cce5fb58abe8beb6d46ce69ccc9b Mon Sep 17 00:00:00 2001 From: Lanlan Date: Tue, 9 Nov 2021 10:15:35 +0800 Subject: [PATCH 2/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 0dd0eef5b546137bdf46cf8648fd254da46bef9e Mon Sep 17 00:00:00 2001 From: Lanlan Date: Thu, 11 Nov 2021 14:29:27 +0800 Subject: [PATCH 3/4] =?UTF-8?q?REPORT-61844=20=E3=80=90=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A811.0=E3=80=91=E9=AB=98=E5=88=86=E5=B1=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9dpi=EF=BC=8C=E5=88=87=E6=8D=A2=E5=B8=86=E8=BD=AF?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=EF=BC=8C=E5=BC=B9=E7=AA=97=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=EF=BC=8C=E9=BC=A0=E6=A0=87=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E4=B8=B2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/file/PreferencePane.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 2e32eb88c..303d9fd81 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -167,6 +167,7 @@ public class PreferencePane extends BasicPane { private UICheckBox oracleSpace; private UISpinner cachingTemplateSpinner; private UICheckBox useOptimizedUPMCheckbox; + private UICheckBox useNewVersionLoginCheckbox; private UICheckBox useUniverseDBMCheckbox; private UICheckBox joinProductImproveCheckBox; private UICheckBox autoPushUpdateCheckBox; @@ -233,6 +234,13 @@ public class PreferencePane extends BasicPane { advancePane.add(upmSelectorPane); } + if (SupportOSImpl.DESIGNER_LOGIN.support()) { + JPanel loginSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Login_Manager")); + useNewVersionLoginCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Login_Manager")); + loginSelectorPane.add(useNewVersionLoginCheckbox); + advancePane.add(loginSelectorPane); + } + JPanel dbmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Database_Manager")); useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager")); //dbmSelectorPane.add(useUniverseDBMCheckbox); @@ -726,6 +734,10 @@ public class PreferencePane extends BasicPane { useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM()); } + if (useNewVersionLoginCheckbox != null) { + useNewVersionLoginCheckbox.setSelected(!DesignerEnvManager.getEnvManager().isUseOldVersionLogin()); + } + useUniverseDBMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseUniverseDBM()); this.oracleSpace.setSelected(designerEnvManager.isOracleSystemSpace()); @@ -820,6 +832,10 @@ public class PreferencePane extends BasicPane { designerEnvManager.setAutoPushUpdateEnabled(this.autoPushUpdateCheckBox.isSelected()); } + if (useNewVersionLoginCheckbox != null) { + designerEnvManager.setUseOldVersionLogin(!this.useNewVersionLoginCheckbox.isSelected()); + } + designerEnvManager.setUndoLimit(maxUndoLimit.getSelectedIndex() * SELECTED_INDEX_5); if (maxUndoLimit.getSelectedIndex() == SELECTED_INDEX_5) { designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50); From e86dd190a6158cdf9ea8471e8e387ad3f58ff4aa Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 11 Nov 2021 14:46:58 +0800 Subject: [PATCH 4/4] =?UTF-8?q?REPORT-60789=E3=80=90=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E8=80=85=E9=A2=84=E8=A7=88=E6=94=AF=E6=8C=81=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=B8=83=E5=B1=80=E3=80=91=E6=96=B0=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94-=E6=9C=AC=E5=9C=B0=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E8=BF=9B=E5=85=A5=E5=BC=80=E5=8F=91=E8=80=85?= =?UTF-8?q?=E8=B0=83=E8=AF=95=EF=BC=8C=E8=B7=AF=E5=BE=84=E5=A4=84=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=B7=B2=E9=94=81=E5=AE=9A=E4=BD=86=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E4=B8=8A=E6=B2=A1=E6=9C=89=E9=94=81=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=EF=BC=8C=E8=BF=9C=E7=A8=8B=E4=B8=8B=E6=98=AF=E6=9C=89?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/itree/filetree/FileTreeIcon.java | 11 +++-- .../com/fr/design/icon/LocalFileIcon.java | 42 ++++++++++++++++++ .../java/com/fr/design/icon/LockIcon.java | 5 ++- .../com/fr/design/images/gui/file_lock.png | Bin 0 -> 225 bytes 4 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/icon/LocalFileIcon.java create mode 100644 designer-base/src/main/resources/com/fr/design/images/gui/file_lock.png diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java index e0515fe81..b2956b70f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java @@ -2,6 +2,7 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.BaseUtils; import com.fr.design.ExtraDesignClassManager; +import com.fr.design.icon.LocalFileIcon; import com.fr.design.icon.LockIcon; import com.fr.design.fun.ReportSupportedFileUIProvider; import com.fr.file.filetree.FileNode; @@ -19,6 +20,8 @@ public class FileTreeIcon { private FileTreeIcon() { } + public static final String FILE_LOCKED_ICON_PATH = "/com/fr/design/images/gui/file_lock.png"; + public static final Icon BLANK_IMAGE_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/blank.gif"); public static final Icon FOLDER_IMAGE_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/folder.png"); @@ -153,7 +156,7 @@ public class FileTreeIcon { if (node.isDirectory()) { return FileTreeIcon.FOLDER_IMAGE_ICON; } - return getLocalFileIcon(path); + return getLocalFileIcon(path, isShowLock); } } if (node.isDirectory()) { @@ -163,12 +166,12 @@ public class FileTreeIcon { } } - private static Icon getLocalFileIcon(String path) { - Icon icon = getExtraIcon(path, false); + private static Icon getLocalFileIcon(String path, boolean isShowLock) { + Icon icon = getExtraIcon(path, isShowLock); if (icon != null) { return icon; } - return FileSystemView.getFileSystemView().getSystemIcon(new File(path)); + return new LocalFileIcon(FileSystemView.getFileSystemView().getSystemIcon(new File(path)), isShowLock); } private static Icon getRemoteFileIcon(FileNode node, boolean isShowLock) { diff --git a/designer-base/src/main/java/com/fr/design/icon/LocalFileIcon.java b/designer-base/src/main/java/com/fr/design/icon/LocalFileIcon.java new file mode 100644 index 000000000..e80af21c6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/icon/LocalFileIcon.java @@ -0,0 +1,42 @@ +package com.fr.design.icon; + +import com.fr.base.BaseUtils; +import com.fr.design.gui.itree.filetree.FileTreeIcon; + +import javax.swing.Icon; +import java.awt.Component; +import java.awt.Graphics; + +/** + * Created by kerry on 2021/11/11 + */ +public class LocalFileIcon implements Icon { + private static final Icon FILE_LOCKED_ICON = BaseUtils.readIcon(FileTreeIcon.FILE_LOCKED_ICON_PATH); + private static final int OFFSET_X = 9; + private static final int OFFSET_Y = 8; + private final Icon mainIcon; + private final boolean showLock; + + public LocalFileIcon(Icon mainIcon, boolean showLock) { + this.mainIcon = mainIcon; + this.showLock = showLock; + } + + @Override + public void paintIcon(Component c, Graphics g, int x, int y) { + mainIcon.paintIcon(c, g, x, y); + if (showLock) { + FILE_LOCKED_ICON.paintIcon(c, g, OFFSET_X, OFFSET_Y); + } + } + + @Override + public int getIconWidth() { + return mainIcon.getIconWidth(); + } + + @Override + public int getIconHeight() { + return mainIcon.getIconHeight(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/icon/LockIcon.java b/designer-base/src/main/java/com/fr/design/icon/LockIcon.java index 7ebffbdb7..e7c400020 100644 --- a/designer-base/src/main/java/com/fr/design/icon/LockIcon.java +++ b/designer-base/src/main/java/com/fr/design/icon/LockIcon.java @@ -1,6 +1,7 @@ package com.fr.design.icon; import com.fr.base.BaseUtils; +import com.fr.design.gui.itree.filetree.FileTreeIcon; import com.fr.log.FineLoggerFactory; import javax.swing.GrayFilter; @@ -12,7 +13,7 @@ import java.awt.MediaTracker; import java.awt.image.ImageObserver; public class LockIcon extends ImageIcon { - private final static Image lockImage = BaseUtils.readImage("/com/fr/design/images/gui/locked.gif"); + private final static Image lockImage = BaseUtils.readImage(FileTreeIcon.FILE_LOCKED_ICON_PATH); private Image mainImage = null; @@ -107,4 +108,4 @@ public class LockIcon extends ImageIcon { { loadImage(lockImage); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/resources/com/fr/design/images/gui/file_lock.png b/designer-base/src/main/resources/com/fr/design/images/gui/file_lock.png new file mode 100644 index 0000000000000000000000000000000000000000..a0b08e6e27b150fb4c8ebbb3624d9a6abf6b2a13 GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)H!3HEvS)PI@#^NA%Cx&(BWL^R}E~ycoX}-P; zS|C*njP02WEFdL7ECs|249p7{8JK}IBS>rk6I_;k0W+M<0a6&u=FtwMyggkULpWrU zfBgTypGzQ_flVQSQBdJSM4aHEhDi!nc?@*>pNJ%!`EOvR?7