From c286c649b911ad0e9b8d619b90143d1e165a140b Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 5 Nov 2020 11:23:40 +0800 Subject: [PATCH 01/12] =?UTF-8?q?REPORT-42550=20=E9=A2=84=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96=E5=8F=8A=E4=B8=8E?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E7=BB=9F=E4=B8=80=E8=BF=AD=E4=BB=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 1 + .../com/fr/design/mainframe/JTemplate.java | 4 +- .../java/com/fr/design/utils/DesignUtils.java | 38 +++++++++++++++---- .../ServerPredefinedStyleAction.java | 2 +- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 15fc6f1d32..a7ee2526a5 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -126,6 +126,7 @@ public class EnvChangeEntrance { public void done() { DesignerEnvManager.getEnvManager().setCurEnvName(envName); DesignUtils.refreshDesignerFrame(); + DesignUtils.checkDesignerEnvMatch(); DesignTableDataManager.fireDSChanged(new HashMap()); if (WorkContext.getCurrent().isLocal()) { //初始化一下serverTray diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 406ab878e9..b0628efb44 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -163,7 +163,7 @@ public abstract class JTemplate> private void setPredefinedInfo(boolean isNewFile){ if (this.template.getAttrMark(PredefinedStyleAttrMark.XML_TAG) == null) { PredefinedStyleAttrMark attrMark = PredefinedStyleAttrMark.createDefaultStyleMark(); - if (!isNewFile || !DesignUtils.checkDesignerRemoteVersion()) { + if (!isNewFile || !DesignUtils.isDesignerEnvMatch()) { attrMark.setPreferenceStyleName(InterProviderFactory.getProvider().getLocText("Fine-Engine_Predefined_Style_Compatibility")); } this.template.addAttrMark(attrMark); @@ -1362,7 +1362,7 @@ public abstract class JTemplate> } }); - preferenceButton.setEnabled(DesignUtils.checkDesignerRemoteVersion()); + preferenceButton.setEnabled(DesignUtils.isDesignerEnvMatch()); return preferenceButton; } diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index d3d2c59c6c..59f4048f58 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -5,12 +5,17 @@ import com.fr.base.ServerConfig; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; +import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.fun.DesignerEnvProcessor; import com.fr.design.gui.UILookAndFeel; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; +import com.fr.event.Event; +import com.fr.event.EventDispatcher; +import com.fr.event.Listener; +import com.fr.event.Null; import com.fr.exit.DesignerExiter; import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; @@ -61,12 +66,27 @@ import java.util.concurrent.TimeoutException; public class DesignUtils { private static int port = DesignerPort.getInstance().getMessagePort(); + + static { + EventDispatcher.listen(DesignerLaunchStatus.WORKSPACE_INIT_COMPLETE, new Listener() { + @Override + public void on(Event event, Null aNull) { + checkDesignerEnvMatch(); + } + }); + } + private static boolean started = false; + /** + * 设计器和工作目录环境版本是否匹配标志 + */ + private static boolean designerEnvMatch = true; + + private DesignUtils() { } - public synchronized static void setPort(int port) { DesignUtils.port = port; } @@ -75,6 +95,10 @@ public class DesignUtils { return port; } + public static boolean isDesignerEnvMatch() { + return designerEnvMatch; + } + /** * 判断设计器有没有启动 * @@ -250,7 +274,6 @@ public class DesignUtils { } public static void refreshDesignerFrame() { - // 刷新DesignerFrame里面的面板 SwingUtilities.invokeLater(new Runnable() { @@ -421,10 +444,10 @@ public class DesignUtils { return true; } - - public static boolean checkDesignerRemoteVersion() { + public static void checkDesignerEnvMatch(){ if (WorkContext.getCurrent().isLocal()){ - return true; + designerEnvMatch = true; + return; } String envName = DesignerEnvManager.getEnvManager().getCurEnvName(); DesignerWorkspaceInfo selectedEnv = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName); @@ -435,8 +458,9 @@ public class DesignUtils { try { remoteBranch = new FunctionalHttpRequest(connectionInfo).getServerBranch(); } catch (Exception e) { - return false; + designerEnvMatch = false; + return; } - return localBranch.contains("#") && localBranch.equals(remoteBranch); + designerEnvMatch = localBranch.contains("#") && localBranch.equals(remoteBranch); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/server/predefined/ServerPredefinedStyleAction.java b/designer-realize/src/main/java/com/fr/design/actions/server/predefined/ServerPredefinedStyleAction.java index 547bae3ddb..e0d4b06d17 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/server/predefined/ServerPredefinedStyleAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/server/predefined/ServerPredefinedStyleAction.java @@ -21,7 +21,7 @@ public class ServerPredefinedStyleAction extends SnapChatUpdateAction { public ServerPredefinedStyleAction(SnapChatKey uniqueKey) { super(uniqueKey); - this.setEnabled(DesignUtils.checkDesignerRemoteVersion()); + this.setEnabled(DesignUtils.isDesignerEnvMatch()); this.setMenuKeySet(PREDEFINED_STYLES); this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); From b0710669bce8f6e60476c2512e9749f6045d3a7e Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 5 Nov 2020 16:20:18 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/utils/DesignUtils.java | 18 +++--------------- .../module/DesignerWorkspaceProvider.java | 2 ++ 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 59f4048f58..49dbb03c3a 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -5,17 +5,12 @@ import com.fr.base.ServerConfig; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; -import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.fun.DesignerEnvProcessor; import com.fr.design.gui.UILookAndFeel; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; -import com.fr.event.Event; -import com.fr.event.EventDispatcher; -import com.fr.event.Listener; -import com.fr.event.Null; import com.fr.exit.DesignerExiter; import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; @@ -66,16 +61,6 @@ import java.util.concurrent.TimeoutException; public class DesignUtils { private static int port = DesignerPort.getInstance().getMessagePort(); - - static { - EventDispatcher.listen(DesignerLaunchStatus.WORKSPACE_INIT_COMPLETE, new Listener() { - @Override - public void on(Event event, Null aNull) { - checkDesignerEnvMatch(); - } - }); - } - private static boolean started = false; /** @@ -444,6 +429,9 @@ public class DesignUtils { return true; } + /** + * check下设计器jar包版本和当前envjar包版本是否匹配,设计器启动后和环境切换成功后调用 + */ public static void checkDesignerEnvMatch(){ if (WorkContext.getCurrent().isLocal()){ designerEnvMatch = true; diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java index 43ae6ddcdf..ddfaafacd7 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java @@ -6,6 +6,7 @@ import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.env.DesignerWorkspaceGenerator; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.LocalDesignerWorkspaceInfo; +import com.fr.design.utils.DesignUtils; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; @@ -59,6 +60,7 @@ public class DesignerWorkspaceProvider extends Activator { EnvChangeEntrance.getInstance().dealEvnExceptionWhenStartDesigner(); } else { WorkContext.switchTo(workspace); + DesignUtils.checkDesignerEnvMatch(); //在设计器完全启动完成后,对初始环境进行一次服务检测,对主要功能无影响,异常仅做日志提示即可 final DesignerWorkspaceInfo selectEnv = workspaceInfo; EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener() { From d00625eee6104612b19f57d1770722365fa03ebc Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 6 Nov 2020 10:55:50 +0800 Subject: [PATCH 03/12] =?UTF-8?q?REPORT-42550=20=20=E6=B3=A8=E5=86=8CRPC?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 1 - .../java/com/fr/design/utils/DesignUtils.java | 49 ++++++++++--------- .../module/DesignerWorkspaceProvider.java | 2 - 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index a7ee2526a5..15fc6f1d32 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -126,7 +126,6 @@ public class EnvChangeEntrance { public void done() { DesignerEnvManager.getEnvManager().setCurEnvName(envName); DesignUtils.refreshDesignerFrame(); - DesignUtils.checkDesignerEnvMatch(); DesignTableDataManager.fireDSChanged(new HashMap()); if (WorkContext.getCurrent().isLocal()) { //初始化一下serverTray diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 49dbb03c3a..ca87bb336d 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -6,7 +6,6 @@ import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.dialog.FineJOptionPane; -import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.fun.DesignerEnvProcessor; import com.fr.design.gui.UILookAndFeel; import com.fr.design.i18n.Toolkit; @@ -16,19 +15,20 @@ import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.general.GeneralContext; -import com.fr.general.GeneralUtils; import com.fr.log.FineLoggerFactory; +import com.fr.rpc.ExceptionHandler; +import com.fr.rpc.RPCInvokerExceptionInfo; import com.fr.stable.ArrayUtils; import com.fr.stable.CommonCodeUtils; +import com.fr.stable.EnvChangedListener; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.os.OperatingSystem; import com.fr.start.ServerStarter; import com.fr.value.NotNullLazyValue; import com.fr.workspace.WorkContext; +import com.fr.workspace.server.predefined.PredefinedStyleOperator; import org.jetbrains.annotations.NotNull; -import com.fr.workspace.connect.WorkspaceConnectionInfo; -import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; import javax.swing.SwingUtilities; import javax.swing.UIManager; import java.awt.Desktop; @@ -69,6 +69,16 @@ public class DesignUtils { private static boolean designerEnvMatch = true; + static { + GeneralContext.addEnvChangedListener(new EnvChangedListener() { + @Override + public void envChanged() { + designerEnvMatch = checkDesignerEnvMatch(); + } + }); + } + + private DesignUtils() { } @@ -429,26 +439,17 @@ public class DesignUtils { return true; } - /** - * check下设计器jar包版本和当前envjar包版本是否匹配,设计器启动后和环境切换成功后调用 - */ - public static void checkDesignerEnvMatch(){ - if (WorkContext.getCurrent().isLocal()){ - designerEnvMatch = true; - return; - } - String envName = DesignerEnvManager.getEnvManager().getCurEnvName(); - DesignerWorkspaceInfo selectedEnv = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName); - String localBranch; - String remoteBranch; - WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection(); - localBranch = GeneralUtils.readFullBuildNO(); - try { - remoteBranch = new FunctionalHttpRequest(connectionInfo).getServerBranch(); - } catch (Exception e) { - designerEnvMatch = false; - return; + + public static boolean checkDesignerEnvMatch() { + if (WorkContext.getCurrent().isLocal()) { + return true; } - designerEnvMatch = localBranch.contains("#") && localBranch.equals(remoteBranch); + return WorkContext.getCurrent().get(PredefinedStyleOperator.class, new ExceptionHandler() { + @Override + public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) { + FineLoggerFactory.getLogger().error(exceptionInfo.getException().getMessage(), exceptionInfo.getException()); + return false; + } + }).allowPredefinedSetting(); } } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java index ddfaafacd7..43ae6ddcdf 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java @@ -6,7 +6,6 @@ import com.fr.design.constants.DesignerLaunchStatus; import com.fr.design.env.DesignerWorkspaceGenerator; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.LocalDesignerWorkspaceInfo; -import com.fr.design.utils.DesignUtils; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; @@ -60,7 +59,6 @@ public class DesignerWorkspaceProvider extends Activator { EnvChangeEntrance.getInstance().dealEvnExceptionWhenStartDesigner(); } else { WorkContext.switchTo(workspace); - DesignUtils.checkDesignerEnvMatch(); //在设计器完全启动完成后,对初始环境进行一次服务检测,对主要功能无影响,异常仅做日志提示即可 final DesignerWorkspaceInfo selectEnv = workspaceInfo; EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener() { From d7f62063d6f69f59d0fa58dfcff78065124cfdf4 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 6 Nov 2020 14:01:30 +0800 Subject: [PATCH 04/12] =?UTF-8?q?REPORT-42887=20&&=20REPORT-42450=20?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=A4=9Asheet=E8=83=8C=E6=99=AF=E4=B8=8D?= =?UTF-8?q?=E7=94=9F=E6=95=88=EF=BC=9B=20=20=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A2=84=E5=AE=9A=E4=B9=89=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E4=BD=BF=E7=94=A8=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=A0=8F=E8=AE=BE=E7=BD=AE=E8=BE=B9=E6=A1=86=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 10 ++-- .../java/com/fr/design/utils/DesignUtils.java | 32 ----------- .../fr/design/utils/PredefinedStyleUtils.java | 56 +++++++++++++++++++ .../ServerPredefinedStyleAction.java | 4 +- .../cell/settingpane/CellStylePane.java | 6 +- .../java/com/fr/design/style/BorderUtils.java | 3 - .../main/java/com/fr/poly/PolyDesignUI.java | 6 ++ 7 files changed, 73 insertions(+), 44 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/utils/PredefinedStyleUtils.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index b0628efb44..d27407e625 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -52,7 +52,7 @@ import com.fr.design.menu.NameSeparator; import com.fr.design.menu.ShortCut; import com.fr.design.preview.PagePreview; import com.fr.design.ui.util.UIUtil; -import com.fr.design.utils.DesignUtils; +import com.fr.design.utils.PredefinedStyleUtils; import com.fr.design.write.submit.DBManipulationInWidgetEventPane; import com.fr.design.write.submit.DBManipulationPane; import com.fr.file.FILE; @@ -160,10 +160,10 @@ public abstract class JTemplate> setPredefinedInfo(isNewFile); } - private void setPredefinedInfo(boolean isNewFile){ + private void setPredefinedInfo(boolean isNewFile) { if (this.template.getAttrMark(PredefinedStyleAttrMark.XML_TAG) == null) { - PredefinedStyleAttrMark attrMark = PredefinedStyleAttrMark.createDefaultStyleMark(); - if (!isNewFile || !DesignUtils.isDesignerEnvMatch()) { + PredefinedStyleAttrMark attrMark = PredefinedStyleAttrMark.createDefaultStyleMark(); + if (!isNewFile || !PredefinedStyleUtils.isAllowPredefinedSetting()) { attrMark.setPreferenceStyleName(InterProviderFactory.getProvider().getLocText("Fine-Engine_Predefined_Style_Compatibility")); } this.template.addAttrMark(attrMark); @@ -1362,7 +1362,7 @@ public abstract class JTemplate> } }); - preferenceButton.setEnabled(DesignUtils.isDesignerEnvMatch()); + preferenceButton.setEnabled(PredefinedStyleUtils.isAllowPredefinedSetting()); return preferenceButton; } diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index ca87bb336d..3eba512a47 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -63,21 +63,6 @@ public class DesignUtils { private static boolean started = false; - /** - * 设计器和工作目录环境版本是否匹配标志 - */ - private static boolean designerEnvMatch = true; - - - static { - GeneralContext.addEnvChangedListener(new EnvChangedListener() { - @Override - public void envChanged() { - designerEnvMatch = checkDesignerEnvMatch(); - } - }); - } - private DesignUtils() { } @@ -90,10 +75,6 @@ public class DesignUtils { return port; } - public static boolean isDesignerEnvMatch() { - return designerEnvMatch; - } - /** * 判断设计器有没有启动 * @@ -439,17 +420,4 @@ public class DesignUtils { return true; } - - public static boolean checkDesignerEnvMatch() { - if (WorkContext.getCurrent().isLocal()) { - return true; - } - return WorkContext.getCurrent().get(PredefinedStyleOperator.class, new ExceptionHandler() { - @Override - public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) { - FineLoggerFactory.getLogger().error(exceptionInfo.getException().getMessage(), exceptionInfo.getException()); - return false; - } - }).allowPredefinedSetting(); - } } diff --git a/designer-base/src/main/java/com/fr/design/utils/PredefinedStyleUtils.java b/designer-base/src/main/java/com/fr/design/utils/PredefinedStyleUtils.java new file mode 100644 index 0000000000..7d3429d01c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/utils/PredefinedStyleUtils.java @@ -0,0 +1,56 @@ +package com.fr.design.utils; + +import com.fr.general.GeneralContext; +import com.fr.log.FineLoggerFactory; +import com.fr.rpc.ExceptionHandler; +import com.fr.rpc.RPCInvokerExceptionInfo; +import com.fr.stable.EnvChangedListener; +import com.fr.workspace.WorkContext; +import com.fr.workspace.server.predefined.PredefinedStyleOperator; + +/** + * Created by kerry on 2020-11-06 + */ +public class PredefinedStyleUtils { + /** + * 判断当前环境是否支持预定义样式的设置 + */ + private static Boolean allowPredefinedSetting = null; + + static { + GeneralContext.addEnvChangedListener(new EnvChangedListener() { + @Override + public void envChanged() { + allowPredefinedSetting = checkAllowPredefinedSetting(); + } + }); + } + + /** + * 判断当前环境是否支持预定义样式的设置 + * @return boolean + */ + public synchronized static boolean isAllowPredefinedSetting() { + if (allowPredefinedSetting == null) { + allowPredefinedSetting = checkAllowPredefinedSetting(); + } + return allowPredefinedSetting; + } + + private PredefinedStyleUtils() { + + } + + private static boolean checkAllowPredefinedSetting() { + if (WorkContext.getCurrent().isLocal()) { + return true; + } + return WorkContext.getCurrent().get(PredefinedStyleOperator.class, new ExceptionHandler() { + @Override + public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) { + FineLoggerFactory.getLogger().error(exceptionInfo.getException().getMessage(), exceptionInfo.getException()); + return false; + } + }).allowPredefinedSetting(); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/server/predefined/ServerPredefinedStyleAction.java b/designer-realize/src/main/java/com/fr/design/actions/server/predefined/ServerPredefinedStyleAction.java index e0d4b06d17..246b194b7c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/server/predefined/ServerPredefinedStyleAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/server/predefined/ServerPredefinedStyleAction.java @@ -7,7 +7,7 @@ import com.fr.design.mainframe.DesignerFrame; import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.SnapChatUpdateAction; import com.fr.design.notification.SnapChatKey; -import com.fr.design.utils.DesignUtils; +import com.fr.design.utils.PredefinedStyleUtils; import com.fr.general.IOUtils; import javax.swing.KeyStroke; @@ -21,7 +21,7 @@ public class ServerPredefinedStyleAction extends SnapChatUpdateAction { public ServerPredefinedStyleAction(SnapChatKey uniqueKey) { super(uniqueKey); - this.setEnabled(DesignUtils.isDesignerEnvMatch()); + this.setEnabled(PredefinedStyleUtils.isAllowPredefinedSetting()); this.setMenuKeySet(PREDEFINED_STYLES); this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java index 98311cd993..95645acafb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java @@ -54,7 +54,7 @@ public class CellStylePane extends AbstractCellAttrPane { @Override public void updateBeans() { - Style s = stylePane.updateStyle(); + Style style = stylePane.updateStyle(); TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); int cellRectangleCount = cs.getCellRectangleCount(); for (int rect = 0; rect < cellRectangleCount; rect++) { @@ -68,11 +68,13 @@ public class CellStylePane extends AbstractCellAttrPane { cellElement = new DefaultPredefinedTemplateCellElement(column, row); elementCase.addCellElement(cellElement); } - cellElement.setStyle(s); + cellElement.setStyle(style); } } } + if (!(style instanceof NameStyle)) { stylePane.updateBorder();// border必须特别处理 + } } @Override diff --git a/designer-realize/src/main/java/com/fr/design/style/BorderUtils.java b/designer-realize/src/main/java/com/fr/design/style/BorderUtils.java index 3a7142b4e3..1764219994 100644 --- a/designer-realize/src/main/java/com/fr/design/style/BorderUtils.java +++ b/designer-realize/src/main/java/com/fr/design/style/BorderUtils.java @@ -517,9 +517,6 @@ public abstract class BorderUtils { report.addCellElement(tmpCellElement); } Style style = tmpCellElement.getStyle(); - if (style instanceof NameStyle && ((NameStyle) style).usePredefinedStyle()) { - continue; - } style = inspectStyle(row, column, rowSpan, columnSpan, cellBorderStyle, newCellBorderStyle, tmpCellElement, style); tmpCellElement.setStyle(style); } diff --git a/designer-realize/src/main/java/com/fr/poly/PolyDesignUI.java b/designer-realize/src/main/java/com/fr/poly/PolyDesignUI.java index d12920bfdc..cf5d877080 100644 --- a/designer-realize/src/main/java/com/fr/poly/PolyDesignUI.java +++ b/designer-realize/src/main/java/com/fr/poly/PolyDesignUI.java @@ -8,6 +8,7 @@ import com.fr.base.Margin; import com.fr.base.PaperSize; import com.fr.base.ScreenResolution; import com.fr.base.iofile.attr.WatermarkAttr; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.utils.ComponentUtils; import com.fr.general.Background; @@ -82,6 +83,7 @@ public class PolyDesignUI extends ComponentUI { g2d.setPaint(Color.WHITE); GraphHelper.fillRect(g, 0, 0, d.width, d.height); ReportSettingsProvider rs = report.getReportSettings(); + rs.getNameBackground().resetPreferenceStyle(getGlobalPredefinedStyleName()); if (rs != null) { Background bg = rs.getBackground(); if (bg != null) { @@ -91,6 +93,10 @@ public class PolyDesignUI extends ComponentUI { } } + private String getGlobalPredefinedStyleName() { + return HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle(); + } + @Override public void paint(Graphics g, JComponent c) { this.resolution = ((PolyArea)c).getResolution(); From 8871c72285f5d7d7180cb6d848604845c678d787 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 6 Nov 2020 16:34:20 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/utils/PredefinedStyleUtils.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/PredefinedStyleUtils.java b/designer-base/src/main/java/com/fr/design/utils/PredefinedStyleUtils.java index 7d3429d01c..9b9ae335b9 100644 --- a/designer-base/src/main/java/com/fr/design/utils/PredefinedStyleUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/PredefinedStyleUtils.java @@ -1,11 +1,14 @@ package com.fr.design.utils; -import com.fr.general.GeneralContext; +import com.fr.event.Event; +import com.fr.event.EventDispatcher; +import com.fr.event.Listener; import com.fr.log.FineLoggerFactory; import com.fr.rpc.ExceptionHandler; import com.fr.rpc.RPCInvokerExceptionInfo; -import com.fr.stable.EnvChangedListener; import com.fr.workspace.WorkContext; +import com.fr.workspace.Workspace; +import com.fr.workspace.WorkspaceEvent; import com.fr.workspace.server.predefined.PredefinedStyleOperator; /** @@ -18,9 +21,9 @@ public class PredefinedStyleUtils { private static Boolean allowPredefinedSetting = null; static { - GeneralContext.addEnvChangedListener(new EnvChangedListener() { + EventDispatcher.listen(WorkspaceEvent.AfterSwitch, new Listener() { @Override - public void envChanged() { + public void on(Event event, Workspace param) { allowPredefinedSetting = checkAllowPredefinedSetting(); } }); From 184c97428d753a76f54076b15dc202bd26d3b9fd Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 10 Nov 2020 14:16:14 +0800 Subject: [PATCH 06/12] =?UTF-8?q?REPORT-43198=20=E9=A2=84=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=A0=B7=E5=BC=8F=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/style/AlignmentPane.java | 2 +- .../gui/style/BackgroundNoImagePane.java | 6 +- .../fr/design/gui/style/BackgroundPane.java | 8 +- .../gui/style/BackgroundSpecialPane.java | 6 +- .../com/fr/design/mainframe/JTemplate.java | 104 +--------- .../burying/point/AbstractPointCollector.java | 40 +++- .../point/AbstractTemplateInfoCollector.java | 56 ----- .../burying/point/BasePointCollector.java | 5 + .../chart/info/ChartInfoCollector.java | 4 +- .../info/PredefinedStyleInfoCollector.java | 140 ------------- .../ui/ReportPredefinedStylePane.java | 2 +- .../ui/detail/background/ColorDetailPane.java | 6 +- .../component/ComponentFrameStylePane.java | 7 +- .../component/ComponentTitleStylePane.java | 7 +- .../mainframe/template/info/SendHelper.java | 2 +- .../template/info/TemplateInfoCollector.java | 4 +- .../mainframe/toolbar/ToolBarMenuDock.java | 7 +- .../design/notification/SnapChatAllTypes.java | 36 +--- .../impl/TextureBackgroundPane.java | 192 +++++++++++++++--- .../design/style/color/ColorSelectPane.java | 29 +-- .../java/com/fr/design/utils/DesignUtils.java | 6 +- .../fr/design/utils/PredefinedStyleUtils.java | 59 ------ .../PredefinedStyleInfoCollectorTest.java | 97 --------- .../predefined/info/predefinedStyle.info | 2 - .../design/designer/creator/XChartEditor.java | 13 -- .../fr/design/designer/creator/XCreator.java | 11 +- .../design/designer/creator/XElementCase.java | 17 +- .../creator/XWAbsoluteBodyLayout.java | 6 - .../design/designer/creator/XWFitLayout.java | 6 - .../creator/cardlayout/XWTabFitLayout.java | 17 +- .../com/fr/design/mainframe/FormDesigner.java | 4 +- .../java/com/fr/design/mainframe/JForm.java | 1 - .../fr/design/mainframe/ToolBarButton.java | 3 - .../layout/BorderStyleWidgetDefinePane.java | 13 +- .../layout/ElementEditorDefinePane.java | 13 +- .../FRAbsoluteBodyLayoutDefinePane.java | 35 +--- .../layout/FRFitLayoutDefinePane.java | 32 +-- .../layout/WTitleLayoutDefinePane.java | 17 +- .../actions/cell/GlobalStyleMenuDef.java | 17 +- .../report/ReportBackgroundAction.java | 9 +- .../ServerPredefinedStyleAction.java | 4 +- .../mainframe/CellWidgetPropertyPane.java | 6 +- .../mainframe/InformationCollector.java | 2 - .../com/fr/design/mainframe/JWorkBook.java | 14 +- .../fr/design/mainframe/SheetNameTabPane.java | 16 +- .../mainframe/cell/CellElementEditPane.java | 4 +- .../cell/settingpane/CellStylePane.java | 92 ++++++--- .../present/ConditionAttributesGroupPane.java | 4 +- .../ReportPredefinedBackgroundPane.java | 2 +- .../java/com/fr/design/style/BorderUtils.java | 4 +- .../src/main/java/com/fr/grid/Grid.java | 6 +- .../src/main/java/com/fr/grid/GridUI.java | 28 +-- .../com/fr/grid/selection/CellSelection.java | 14 +- .../main/java/com/fr/start/MainDesigner.java | 5 +- 54 files changed, 399 insertions(+), 843 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractTemplateInfoCollector.java delete mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java delete mode 100644 designer-base/src/main/java/com/fr/design/utils/PredefinedStyleUtils.java delete mode 100644 designer-base/src/test/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollectorTest.java delete mode 100644 designer-base/src/test/resources/com/fr/design/mainframe/predefined/info/predefinedStyle.info diff --git a/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java b/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java index 50d6448b8d..b188cb5aa8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java @@ -55,7 +55,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO private static final int ANGEL = 90; private static final int GAP = 23; private static final int VERGAP = 3; - private static final Dimension SPINNER_DIMENSION = new Dimension(70, 20); + private static final Dimension SPINNER_DIMENSION = new Dimension(75, 20); private static final String[] TEXT = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Wrap_Text"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Single_Line"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Single_Line(Adjust_Font)"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Multi_Line(Adjust_Font)")}; diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundNoImagePane.java b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundNoImagePane.java index 556b27c21f..d3ed4f1af1 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundNoImagePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundNoImagePane.java @@ -28,7 +28,7 @@ public class BackgroundNoImagePane extends BackgroundPane{ fireStateChanged(); } }); - GradientBackgroundQuickPane gradientPane = createGradientBackgroundQuickPane(); + GradientBackgroundQuickPane gradientPane = new GradientBackgroundQuickPane(); gradientPane.registerChangeListener(new UIObserverListener() { @Override @@ -42,8 +42,4 @@ public class BackgroundNoImagePane extends BackgroundPane{ gradientPane }; } - - protected GradientBackgroundQuickPane createGradientBackgroundQuickPane(){ - return new GradientBackgroundQuickPane(); - } } diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java index 407c522ceb..13dd9e3c9d 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java @@ -71,7 +71,7 @@ public class BackgroundPane extends AbstractBasicStylePane { double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ new Component[]{null, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fill"), SwingConstants.LEFT),typeComboBox}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fill") + " ", SwingConstants.LEFT),typeComboBox}, new Component[]{null, centerPane} }; double[] rowSize = {p, p, p}; @@ -89,7 +89,7 @@ public class BackgroundPane extends AbstractBasicStylePane { kinds.add(new TextureBackgroundQuickPane()); kinds.add(new PatternBackgroundQuickPane()); kinds.add(new ImageBackgroundQuickPane()); - kinds.add(createGradientBackgroundQuickPane()); + kinds.add(new GradientBackgroundQuickPane()); Set providers = ExtraDesignClassManager.getInstance().getArray(BackgroundQuickUIProvider.MARK_STRING); for (BackgroundQuickUIProvider provider : providers) { kinds.add(provider.appearanceForBackground()); @@ -98,10 +98,6 @@ public class BackgroundPane extends AbstractBasicStylePane { return kinds.toArray(new BackgroundQuickPane[kinds.size()]); } - protected GradientBackgroundQuickPane createGradientBackgroundQuickPane(){ - return new GradientBackgroundQuickPane(); - } - /** * 事件监听 diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundSpecialPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundSpecialPane.java index 3713fca7bc..7fa2664235 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundSpecialPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundSpecialPane.java @@ -39,7 +39,7 @@ public class BackgroundSpecialPane extends BackgroundPane{ fireStateChanged(); } }); - GradientBackgroundQuickPane gradientPane = createGradientBackgroundQuickPane(); + GradientBackgroundQuickPane gradientPane = new GradientBackgroundQuickPane(); gradientPane.registerChangeListener(new UIObserverListener() { @Override public void doChange() { @@ -68,8 +68,4 @@ public class BackgroundSpecialPane extends BackgroundPane{ return kinds.toArray(new BackgroundQuickPane[kinds.size()]); } - - protected GradientBackgroundQuickPane createGradientBackgroundQuickPane(){ - return new GradientBackgroundQuickPane(); - } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index d27407e625..73d5d0bb1f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -6,7 +6,6 @@ import com.fr.base.Parameter; import com.fr.base.ScreenResolution; import com.fr.base.io.BaseBook; import com.fr.base.iofile.attr.DesignBanCopyAttrMark; -import com.fr.base.iofile.attr.PredefinedStyleAttrMark; import com.fr.base.iofile.attr.TemplateIdAttrMark; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignModelAdapter; @@ -39,9 +38,6 @@ import com.fr.design.gui.itree.filetree.TemplateFileTree; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.chart.info.ChartInfoCollector; -import com.fr.design.mainframe.predefined.info.PredefinedStyleInfoCollector; -import com.fr.design.mainframe.predefined.ui.ReportPredefinedStylePane; -import com.fr.design.mainframe.predefined.ui.dialog.ReportPredefinedStyleDialog; import com.fr.design.mainframe.template.info.TemplateInfoCollector; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.template.info.TimeConsumeTimer; @@ -51,8 +47,6 @@ import com.fr.design.menu.MenuDef; import com.fr.design.menu.NameSeparator; import com.fr.design.menu.ShortCut; import com.fr.design.preview.PagePreview; -import com.fr.design.ui.util.UIUtil; -import com.fr.design.utils.PredefinedStyleUtils; import com.fr.design.write.submit.DBManipulationInWidgetEventPane; import com.fr.design.write.submit.DBManipulationPane; import com.fr.file.FILE; @@ -61,7 +55,6 @@ import com.fr.file.MemFILE; import com.fr.form.ui.NoneWidget; import com.fr.form.ui.Widget; import com.fr.general.ComparatorUtils; -import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginRuntime; @@ -80,17 +73,13 @@ import com.fr.stable.StringUtils; import com.fr.stable.core.UUID; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; + import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JOptionPane; -import javax.swing.SwingConstants; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.undo.UndoManager; -import java.awt.Dimension; -import java.awt.FontMetrics; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Arrays; import java.util.Set; @@ -101,8 +90,6 @@ import java.awt.BorderLayout; * 报表设计和表单设计的编辑区域(设计器编辑的IO文件) */ public abstract class JTemplate> extends TargetComponent implements ToolBarMenuDockPlus, DesignerProxy { - - private static final int PREDEFINED_ICON_WIDTH = 27; // TODO ALEX_SEP editingFILE这个属性一定要吗?如果非要不可,有没有可能保证不为null private static final int PREFIX_NUM = 3000; private FILE editingFILE = null; @@ -121,7 +108,6 @@ public abstract class JTemplate> private PreviewProvider previewType; protected TimeConsumeTimer consumeTimer = new TimeConsumeTimer(); public int resolution = ScreenResolution.getScreenResolution(); - private UIButton predefinedBtn; private PluginEventListener pluginListener; @@ -156,21 +142,8 @@ public abstract class JTemplate> consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile)); initAndStartPlugin(); - - setPredefinedInfo(isNewFile); - } - - private void setPredefinedInfo(boolean isNewFile) { - if (this.template.getAttrMark(PredefinedStyleAttrMark.XML_TAG) == null) { - PredefinedStyleAttrMark attrMark = PredefinedStyleAttrMark.createDefaultStyleMark(); - if (!isNewFile || !PredefinedStyleUtils.isAllowPredefinedSetting()) { - attrMark.setPreferenceStyleName(InterProviderFactory.getProvider().getLocText("Fine-Engine_Predefined_Style_Compatibility")); - } - this.template.addAttrMark(attrMark); - } } - private void initAndStartPlugin() { initPluginPane(); startListenPlugin(); @@ -572,18 +545,6 @@ public abstract class JTemplate> protected abstract void applyUndoState(U u); - protected void refreshPredefinedState() { - UIUtil.invokeLaterIfNeeded(new Runnable() { - @Override - public void run() { - if(predefinedBtn != null){ - JTemplate.this.predefinedBtn.setText(getTemplatePredefinedStyle()); - setPredefinedButtonSize(predefinedBtn); - } - } - }); - } - /** * 停止编辑, 判断保存属性 * */ @@ -835,9 +796,7 @@ public abstract class JTemplate> if (editingFILE == null || editingFILE instanceof MemFILE) { return false; } - PredefinedStyleInfoCollector.getInstance().collectUseNumber(this.getTemplatePredefinedStyle()); try { - this.getTarget().setPredefinedStyleName(this.getTemplatePredefinedStyle(), false); this.getTarget().export(editingFILE.asOutputStream()); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); @@ -1337,65 +1296,10 @@ public abstract class JTemplate> for (DesignerFrameUpButtonProvider provider : providers) { uiButtons = ArrayUtils.addAll(uiButtons, provider.getUpButtons(getMenuState())); } - predefinedBtn = createPreDefinedButton(); - if (predefinedBtn != null) { - uiButtons = ArrayUtils.addAll(uiButtons, new UIButton[]{predefinedBtn}); - } - return uiButtons; - } - - private UIButton createPreDefinedButton() { - UIButton preferenceButton = new UIButton(BaseUtils.readIcon("/com/fr/design/icon/icon_predefined_style.png")); - preferenceButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Template_Style")); - preferenceButton.setText(getTemplatePredefinedStyle()); - preferenceButton.setAlignmentX(SwingConstants.LEFT); - setPredefinedButtonSize(preferenceButton); - preferenceButton.set4ToolbarButton(); - preferenceButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); - ReportPredefinedStylePane stylePane = new ReportPredefinedStylePane(JTemplate.this); - ReportPredefinedStyleDialog dialog = new ReportPredefinedStyleDialog(designerFrame, stylePane); - PredefinedStyleInfoCollector.getInstance().collectClickNumber(); - dialog.setVisible(true); - - } - }); - preferenceButton.setEnabled(PredefinedStyleUtils.isAllowPredefinedSetting()); - return preferenceButton; - } - - - - private void setPredefinedButtonSize(UIButton predefinedBtn) { - String text = predefinedBtn.getText(); - FontMetrics metrics = predefinedBtn.getFontMetrics(predefinedBtn.getFont()); - predefinedBtn.setPreferredSize(new Dimension(Math.min(metrics.stringWidth(text) + PREDEFINED_ICON_WIDTH, 100), 20)); - } - - public void resetPredefinedStyle(String styleName) { - this.getTarget().setPredefinedStyleName(styleName, true); - refreshPredefinedState(); - UIUtil.invokeLaterIfNeeded(new Runnable() { - @Override - public void run() { - JTemplate.this.fireTargetModified(); - JTemplate.this.repaint(); - } - }); - - } - public String getTemplatePredefinedStyle(){ - PredefinedStyleAttrMark attrMark = this.getTarget().getAttrMark(PredefinedStyleAttrMark.XML_TAG); - if (attrMark == null){ - attrMark = PredefinedStyleAttrMark.createDefaultStyleMark(); - } - return attrMark.getPreferenceStyleName(); + return uiButtons; } - /** * 由于老版本的模板没有模板ID,当勾选使用参数模板时候,就加一个模板ID attr * @@ -1419,4 +1323,8 @@ public abstract class JTemplate> return getEditingFILE().getName(); } + public String getTemplatePredefinedStyle(){ + return StringUtils.EMPTY; + } + } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java index 6ac14505a6..15291211cb 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.burying.point; import com.fr.base.FRContext; import com.fr.base.io.XMLReadHelper; import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.template.info.SendHelper; import com.fr.log.FineLoggerFactory; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; @@ -19,20 +20,25 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; /** * @author Bjorn * @version 10.0 * Created by Bjorn on 2020-02-21 */ -public abstract class AbstractPointCollector implements BasePointCollector { - +public abstract class AbstractPointCollector implements BasePointCollector { + protected Map pointInfoMap; private static final int MAX_SIZE = 512 * 1024 * 1024; public AbstractPointCollector() { - + pointInfoMap = new ConcurrentHashMap<>(); + loadFromFile(); } /** @@ -42,6 +48,34 @@ public abstract class AbstractPointCollector implements BasePointCollector { return FileUtils.sizeOf(getInfoFile()) <= MAX_SIZE && DesignerEnvManager.getEnvManager().isJoinProductImprove() && FRContext.isChineseEnv(); } + @Override + public void sendPointInfo() { + + addIdleDayCount(); + + List removeList = new ArrayList<>(); + List sendList = new ArrayList<>(); + + for (String key : pointInfoMap.keySet()) { + AbstractPointInfo pointInfo = pointInfoMap.get(key); + pointInfo.selectPoint(removeList, sendList); + } + + // 发送记录 + for (String key : sendList) { + if(SendHelper.sendPointInfo(pointInfoMap.get(key))){ + removeList.add(key); + } + } + + // 清空记录 + for (String key : removeList) { + pointInfoMap.remove(key); + } + + saveInfo(); + } + /** * 从文件中读取埋点信息 */ diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractTemplateInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractTemplateInfoCollector.java deleted file mode 100644 index 34dc5ea2a4..0000000000 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractTemplateInfoCollector.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.fr.design.mainframe.burying.point; - -import com.fr.design.mainframe.template.info.SendHelper; -import com.fr.design.mainframe.template.info.TemplateProcessInfo; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * Created by kerry on 2020-09-04 - */ -public abstract class AbstractTemplateInfoCollector extends AbstractPointCollector { - protected Map pointInfoMap; - - public AbstractTemplateInfoCollector() { - pointInfoMap = new ConcurrentHashMap<>(); - loadFromFile(); - - } - - - /** - * 保存埋点的信息到本地 - */ - public abstract void collectInfo(String templateID, String originID, TemplateProcessInfo processInfo, int timeConsume); - - @Override - public void sendPointInfo() { - - addIdleDayCount(); - - List removeList = new ArrayList<>(); - List sendList = new ArrayList<>(); - - for (String key : pointInfoMap.keySet()) { - BasePointInfo pointInfo = pointInfoMap.get(key); - pointInfo.selectPoint(removeList, sendList); - } - - // 发送记录 - for (String key : sendList) { - if(SendHelper.sendPointInfo(pointInfoMap.get(key))){ - removeList.add(key); - } - } - - // 清空记录 - for (String key : removeList) { - pointInfoMap.remove(key); - } - - saveInfo(); - } - -} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java index e2a3c778c9..f10f1682e0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.burying.point; +import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.stable.xml.XMLReadable; import com.fr.stable.xml.XMLWriter; @@ -15,4 +16,8 @@ public interface BasePointCollector extends XMLReadable, XMLWriter { */ public void sendPointInfo(); + /** + * 保存埋点的信息到本地 + */ + public void collectInfo(String templateID, String originID, TemplateProcessInfo processInfo, int timeConsume); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java index 428e5625c6..cd651fc6b3 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java @@ -4,7 +4,7 @@ import com.fr.base.io.BaseBook; import com.fr.chartx.attr.ChartProvider; import com.fr.chartx.config.info.AbstractConfig; import com.fr.chartx.config.info.constant.ConfigType; -import com.fr.design.mainframe.burying.point.AbstractTemplateInfoCollector; +import com.fr.design.mainframe.burying.point.AbstractPointCollector; import com.fr.design.mainframe.template.info.TemplateInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.general.ComparatorUtils; @@ -21,7 +21,7 @@ import java.util.Map; * @version 10.0 * Created by Bjorn on 2020-02-18 */ -public class ChartInfoCollector extends AbstractTemplateInfoCollector { +public class ChartInfoCollector extends AbstractPointCollector { private static final String XML_TAG = "ChartInfoCollector"; private static final String XML_LAST_EDIT_DAY = "lastEditDay"; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java deleted file mode 100644 index 9dfe2e9dbf..0000000000 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.fr.design.mainframe.predefined.info; - -import com.fr.config.MarketConfig; -import com.fr.design.DesignerEnvManager; -import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.burying.point.AbstractPointCollector; -import com.fr.design.mainframe.template.info.SendHelper; -import com.fr.general.CloudCenter; -import com.fr.general.ComparatorUtils; -import com.fr.general.GeneralUtils; -import com.fr.json.JSONObject; -import com.fr.stable.xml.XMLPrintWriter; -import com.fr.stable.xml.XMLableReader; -import com.fr.third.joda.time.DateTime; - -/** - * Created by kerry on 2020-09-04 - */ -public class PredefinedStyleInfoCollector extends AbstractPointCollector { - //每三天上传一次 - private static final long DELTA = 3 * 24 * 3600 * 1000L; - - private static final String SIMPLE_DATE_PATTERN = "yyyy-MM-dd"; - private static final String XML_TAG = "PredefinedStyleInfo"; - private static final String XML_FILE_NAME = "predefinedStyle.info"; - private static final String CLOUD_URL = CloudCenter.getInstance().acquireUrlByKind("design.collector") + "/single"; - - private static final String FUNCTION_NAME = "predefinedStyle"; - private static final String FUNCTION_ID = "FR-F7003"; - - private static final String ATTR_FUNCTION_NAME = "functionName"; - private static final String ATTR_FUNCTION_ID = "functionId"; - private static final String ATTR_UUID = "uuid"; - private static final String ATTR_UID = "uid"; - private static final String ATTR_JAR_TIME = "jatTime"; - private static final String ATTR_CLICK_NUMBER = "clickNumber"; - private static final String ATTR_USE_NUMBER = "useNumber"; - private static final String ATTR_TIME = "time"; - private static final String XML_LAST_TIME = "lastSendTime"; - - /** - * 上一次的发送时间 - */ - private long lastSendTime; - - private int clickNumber = 0; - - private int useNumber = 0; - - public int getClickNumber() { - return clickNumber; - } - - public int getUseNumber() { - return useNumber; - } - - private static class Holder { - private static PredefinedStyleInfoCollector collector = new PredefinedStyleInfoCollector(); - } - - private PredefinedStyleInfoCollector() { - loadFromFile(); - } - - public static PredefinedStyleInfoCollector getInstance() { - return Holder.collector; - } - - public void collectClickNumber() { - clickNumber++; - saveInfo(); - } - - public void collectUseNumber(String predefinedName) { - if (!ComparatorUtils.equals(Toolkit.i18nText("Fine-Engine_Predefined_Style_Compatibility"), predefinedName) && - !ComparatorUtils.equals(Toolkit.i18nText("Fine-Engine_Report_DEFAULT"), predefinedName)) { - useNumber++; - } - saveInfo(); - } - - @Override - protected String getInfoFilePath() { - return XML_FILE_NAME; - } - - @Override - protected void addIdleDayCount() { - - } - - @Override - public void sendPointInfo() { - if (System.currentTimeMillis() - lastSendTime < DELTA) { - return; - } - String content = generateTotalInfo(); - SendHelper.sendSinglePointInfo(CLOUD_URL, content); - this.lastSendTime = System.currentTimeMillis(); - this.clickNumber = 0; - this.useNumber = 0; - saveInfo(); - } - - public String generateTotalInfo() { - - JSONObject jo = JSONObject.create(); - jo.put(ATTR_FUNCTION_NAME, FUNCTION_NAME); - jo.put(ATTR_FUNCTION_ID, FUNCTION_ID); - jo.put(ATTR_UUID, DesignerEnvManager.getEnvManager().getUUID()); - jo.put(ATTR_UID, MarketConfig.getInstance().getBBSAttr().getBbsUid()); - jo.put(ATTR_JAR_TIME, GeneralUtils.readFullVersionNO()); - jo.put(ATTR_CLICK_NUMBER, this.clickNumber); - jo.put(ATTR_USE_NUMBER, this.useNumber); - jo.put(ATTR_TIME, DateTime.now().toString(SIMPLE_DATE_PATTERN)); - return jo.toString(); - } - - - @Override - public void readXML(XMLableReader reader) { - if (reader.isAttr()) { - String name = reader.getTagName(); - if (XML_TAG.equals(name)) { - this.clickNumber = reader.getAttrAsInt(ATTR_CLICK_NUMBER, 0); - this.useNumber = reader.getAttrAsInt(ATTR_USE_NUMBER, 0); - this.lastSendTime = reader.getAttrAsLong(XML_LAST_TIME, System.currentTimeMillis()); - } - } - } - - @Override - public void writeXML(XMLPrintWriter writer) { - writer.startTAG(XML_TAG); - writer.attr(ATTR_CLICK_NUMBER, this.clickNumber).attr(ATTR_USE_NUMBER, this.useNumber) - .attr(XML_LAST_TIME, this.lastSendTime); - writer.end(); - } -} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java index 45d2ca9fe9..b29e7ffdf9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java @@ -36,7 +36,7 @@ public class ReportPredefinedStylePane extends BasicPane { public void update() { PredefinedStyle style = selectPane.update(); if (style != null) { - currentTemplate.resetPredefinedStyle(style.getStyleName()); +// currentTemplate.resetPredefinedStyle(style.getStyleName()); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ColorDetailPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ColorDetailPane.java index ce4f923cbc..b7034fd669 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ColorDetailPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ColorDetailPane.java @@ -72,7 +72,8 @@ public class ColorDetailPane extends AbstractBackgroundDetailPane para = new HashMap<>(); para.put("token", SiteCenterToken.generateToken()); para.put("content", content); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfoCollector.java index e41759d24a..23c07ea3a5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfoCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfoCollector.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.template.info; +import com.fr.design.mainframe.burying.point.AbstractPointCollector; import com.fr.design.mainframe.burying.point.AbstractPointInfo; -import com.fr.design.mainframe.burying.point.AbstractTemplateInfoCollector; import com.fr.json.JSON; import com.fr.json.JSONFactory; import com.fr.json.JSONObject; @@ -18,7 +18,7 @@ import java.util.concurrent.ConcurrentHashMap; * 做模板的过程和耗时收集,辅助类 * Created by plough on 2017/2/21. */ -public class TemplateInfoCollector extends AbstractTemplateInfoCollector { +public class TemplateInfoCollector extends AbstractPointCollector { private static final String XML_TAG = "TplInfo"; private static final String XML_TEMPLATE_INFO_LIST = "TemplateInfoList"; private static final String XML_FILE_NAME = "tpl.info"; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 894ebe1c17..d1abb908bb 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -54,9 +54,7 @@ import com.fr.design.mainframe.ToolBarNewTemplatePane; import com.fr.design.menu.MenuDef; import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ShortCut; -import com.fr.design.menu.SnapChatMenuDef; import com.fr.design.menu.ToolBarDef; -import com.fr.design.notification.SnapChatAllTypes; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.remote.action.RemoteDesignAuthManagerAction; import com.fr.design.update.actions.SoftwareUpdateAction; @@ -74,6 +72,7 @@ import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventType; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; +import com.fr.stable.os.support.OSBasedAction; import com.fr.stable.os.support.OSSupportCenter; import com.fr.start.OemHandler; import com.fr.workspace.WorkContext; @@ -469,9 +468,7 @@ public abstract class ToolBarMenuDock { } protected MenuDef createServerMenuDef(ToolBarMenuDockPlus plus) { - - MenuDef menuDef = new SnapChatMenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic__M_Server"), 'S', - SnapChatAllTypes.Menu.SERVER); + MenuDef menuDef = new MenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic__M_Server"), 'S'); if (!DesignerMode.isAuthorityEditing()) { menuDef.addShortCut( diff --git a/designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java b/designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java index 94779d9d74..d94da0c887 100644 --- a/designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java @@ -12,13 +12,7 @@ public abstract class SnapChatAllTypes { /** * 社区按钮 */ - BBS("BBS"), - - /** - * 服务器按钮 - */ - SERVER("SERVER"); - + BBS("BBS"); private static final String SIGN = "0001"; @@ -41,32 +35,4 @@ public abstract class SnapChatAllTypes { } } - public enum UpdateAction implements SnapChatKey { - - /** - * 服务器预定义样式 - */ - PREDEFINED_STYLE("PREDEFINED_STYLE"); - - private static final String SIGN = "0002"; - - private String key; - - UpdateAction(String key) { - this.key = key; - } - - public String getKey() { - return key; - } - - @Override - public String calc() { - - return CommonUtils.join( - new String[]{SIGN, getKey()}, "-" - ); - } - } - } diff --git a/designer-base/src/main/java/com/fr/design/style/background/impl/TextureBackgroundPane.java b/designer-base/src/main/java/com/fr/design/style/background/impl/TextureBackgroundPane.java index 9d1cb168c6..3dd59bd5b4 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/impl/TextureBackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/impl/TextureBackgroundPane.java @@ -1,59 +1,197 @@ package com.fr.design.style.background.impl; +import com.fr.base.GraphHelper; +import com.fr.base.background.TextureBackground; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.style.background.BackgroundDetailPane; -import com.fr.design.style.background.texture.TextureDetailPane; import com.fr.general.Background; +import com.fr.general.ComparatorUtils; -import javax.swing.BorderFactory; -import javax.swing.JPanel; +import javax.swing.*; +import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.BorderLayout; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.geom.Rectangle2D; /** * Texture background pane. TODO kunsnat: 拆出去. 真特么的长.. */ -public class TextureBackgroundPane extends BackgroundDetailPane { - - - private TextureDetailPane detailPane; +public class TextureBackgroundPane extends BPane { + + private static final TexturePaint[] EMBED_TEXTURE_PAINT_ARRAY = new TexturePaint[]{ + TextureBackground.NEWSPRINT_TEXTURE_PAINT, + TextureBackground.RECYCLED_PAPER_TEXTURE_PAINT, + TextureBackground.PARCHMENT_TEXTURE_PAINT, + TextureBackground.STATIONERY_TEXTURE_PAINT, + TextureBackground.GREEN_MARBLE_TEXTURE_PAINT, + TextureBackground.WHITE_MARBLE_TEXTURE_PAINT, + TextureBackground.BROWN_MARBLE_TEXTURE_PAINT, + TextureBackground.GRANITE_TEXTURE_PAINT, + TextureBackground.BLUE_TISSUE_PAPER_TEXTURE_PAINT, + TextureBackground.PINK_TISSUE_PAPER_TEXTURE_PAINT, + TextureBackground.PURPLE_MESH_TEXTURE_PAINT, + TextureBackground.BOUQUET_TEXTURE_PAINT, + TextureBackground.PAPYRUS_TEXTURE_PAINT, + TextureBackground.CANVAS_TEXTURE_PAINT, + TextureBackground.DENIM_TEXTURE_PAINT, + TextureBackground.WOVEN_MAT_TEXTURE_PAINT, + TextureBackground.WATER_DROPLETS_TEXTURE_PAINT, + TextureBackground.PAPER_BAG_TEXTURE_PAINT, + TextureBackground.FISH_FOSSIL_TEXTURE_PAINT, + TextureBackground.SAND_TEXTURE_PAINT, + TextureBackground.CORK_TEXTURE_PAINT, + TextureBackground.WALNUT_TEXTURE_PAINT, + TextureBackground.OAK_TEXTURE_PAINT, + TextureBackground.MEDIUM_WOOD_TEXTURE_PAINT}; + + private static final String[] EMBED_TEXTURE_PAINT_DES_ARRAY = new String[]{ + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Newsprint"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Recycled_Paper"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Parchment"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Stationery"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Green_Marble"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_White_Marble"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Brown_Marble"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Granite"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Blue_Tissue_Paper"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Pink_Tissue_Paper"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Purple_Mesh"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Bouquet"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Papyrus"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Canvas"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Denim"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Woven_Mat"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Water_Droplets"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_PaperBag"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_FishFossil"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Sand"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Cork"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Walnut"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Oak"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture_Medium_Wood") + }; + + private TexturePaint texturePaint; + private TextureButton[] textureButtonArray; public TextureBackgroundPane() { - this(8);// 默认的. + super(8);// 默认的. } - public TextureBackgroundPane(int column) { - this.detailPane = TextureDetailPane.createNormalTextureDetailPane(column); - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); - - JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); - this.add(contentPane, BorderLayout.NORTH); - - JPanel typePane = FRGUIPaneFactory.createTitledBorderPane(titleOfTypePane()); - contentPane.add(typePane); - typePane.add(this.detailPane); + public TextureBackgroundPane(int colum) { + super(colum);// 自定义的. } - + protected LayoutManager layoutOfTypePane(int nColumn) { + return FRGUIPaneFactory.createNColumnGridLayout(nColumn); + } protected String titleOfTypePane() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture"); } - + protected void setChildrenOfTypePane(JPanel typePane2) { + ButtonGroup patternButtonGroup = new ButtonGroup(); + textureButtonArray = new TextureButton[EMBED_TEXTURE_PAINT_ARRAY.length]; + for (int i = 0; i < EMBED_TEXTURE_PAINT_ARRAY.length; i++) { + textureButtonArray[i] = new TextureButton( + EMBED_TEXTURE_PAINT_ARRAY[i], EMBED_TEXTURE_PAINT_DES_ARRAY[i]); + patternButtonGroup.add(textureButtonArray[i]); + typePane2.add(textureButtonArray[i]); + } + } public void populate(Background background) { - this.detailPane.populate(background); + if (background instanceof TextureBackground) { + TextureBackground textureBackground = (TextureBackground) background; + + this.texturePaint = textureBackground.getTexturePaint(); + + for (int i = 0; i < textureButtonArray.length; i++) { + if (ComparatorUtils.equals(textureButtonArray[i].getTexturePaint(), this.texturePaint)) { + textureButtonArray[i].setSelected(true); + break; + } + } + } else { + this.textureButtonArray[0].setSelected(true); + this.texturePaint = textureButtonArray[0].getTexturePaint(); + } } public Background update() throws Exception { - return this.detailPane.update(); + return new TextureBackground(this.texturePaint); } - @Override public void addChangeListener(ChangeListener changeListener) { - this.detailPane.addChangeListener(changeListener); + for (int i = 0; i < this.textureButtonArray.length; i++) { + this.textureButtonArray[i].addChangeListener(changeListener); + } } + /** + * Texture type button. + */ + class TextureButton extends JToggleButton implements ActionListener { + + private TexturePaint buttonTexturePaint; + + public TextureButton(TexturePaint buttonTexturePaint, String tooltip) { + this.buttonTexturePaint = buttonTexturePaint; + this.setToolTipText(tooltip); + + this.setCursor(new Cursor(Cursor.HAND_CURSOR)); + this.addActionListener(this); + this.setBorder(null); + } + + public void paintComponent(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + + Dimension d = getSize(); + + g2d.setPaint(this.buttonTexturePaint); + GraphHelper.fill(g2d, new Rectangle2D.Double(0, 0, d.width - 1d, + d.height - 1d)); + + if (ComparatorUtils.equals(texturePaint, this.buttonTexturePaint)) {// it's + // selected. + g2d.setPaint(Color.black); + } else { + g2d.setPaint(Color.gray); + } + GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1d, + d.height - 1d)); + } + + public Dimension getPreferredSize() { + return new Dimension(36, 32); + } + + public TexturePaint getTexturePaint() { + return this.buttonTexturePaint; + } + + /** + * set Pattern setIndex. + */ + public void actionPerformed(ActionEvent evt) { + TextureBackgroundPane.this.texturePaint = this.getTexturePaint(); + + fireChagneListener(); + TextureBackgroundPane.this.repaint(); // repaint. + } + + public void addChangeListener(ChangeListener changeListener) { + this.changeListener = changeListener; + } + + private void fireChagneListener() { + if (this.changeListener != null) { + ChangeEvent evt = new ChangeEvent(this); + this.changeListener.stateChanged(evt); + } + } + } } diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectPane.java index 437b3c8c4e..c82eac0c0d 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectPane.java @@ -53,19 +53,25 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable initialCompents(isSupportTransparent); } - protected void initialCompents(boolean isSupportTransparent) { + private void initialCompents(boolean isSupportTransparent) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5)); if (isSupportTransparent) { - this.add(createTranspanrentButton(), BorderLayout.NORTH); + UIButton transpanrentButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ChartF_Transparency")); + this.add(transpanrentButton, BorderLayout.NORTH); + transpanrentButton.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + doTransparent(); + } + }); } - this.add(createCenterPane(), BorderLayout.CENTER); - } - protected JPanel createCenterPane(){ // center JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); + this.add(centerPane, BorderLayout.CENTER); centerPane.add(getRow1Pane()); @@ -92,19 +98,6 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable centerPane1.setBorder(BorderFactory.createEmptyBorder(2, 8, 8, 8)); centerPane1.add(customButton, BorderLayout.NORTH); centerPane.add(centerPane1); - return centerPane; - } - - protected UIButton createTranspanrentButton(){ - UIButton transpanrentButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ChartF_Transparency")); - transpanrentButton.addActionListener(new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - doTransparent(); - } - }); - return transpanrentButton; } protected JPanel getMenuColorPane() { diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 3eba512a47..58f5d2a5f6 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -16,18 +16,14 @@ import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.general.GeneralContext; import com.fr.log.FineLoggerFactory; -import com.fr.rpc.ExceptionHandler; -import com.fr.rpc.RPCInvokerExceptionInfo; import com.fr.stable.ArrayUtils; import com.fr.stable.CommonCodeUtils; -import com.fr.stable.EnvChangedListener; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.os.OperatingSystem; import com.fr.start.ServerStarter; import com.fr.value.NotNullLazyValue; import com.fr.workspace.WorkContext; -import com.fr.workspace.server.predefined.PredefinedStyleOperator; import org.jetbrains.annotations.NotNull; import javax.swing.SwingUtilities; import javax.swing.UIManager; @@ -61,6 +57,7 @@ import java.util.concurrent.TimeoutException; public class DesignUtils { private static int port = DesignerPort.getInstance().getMessagePort(); + private static boolean started = false; @@ -75,6 +72,7 @@ public class DesignUtils { return port; } + /** * 判断设计器有没有启动 * diff --git a/designer-base/src/main/java/com/fr/design/utils/PredefinedStyleUtils.java b/designer-base/src/main/java/com/fr/design/utils/PredefinedStyleUtils.java deleted file mode 100644 index 9b9ae335b9..0000000000 --- a/designer-base/src/main/java/com/fr/design/utils/PredefinedStyleUtils.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.fr.design.utils; - -import com.fr.event.Event; -import com.fr.event.EventDispatcher; -import com.fr.event.Listener; -import com.fr.log.FineLoggerFactory; -import com.fr.rpc.ExceptionHandler; -import com.fr.rpc.RPCInvokerExceptionInfo; -import com.fr.workspace.WorkContext; -import com.fr.workspace.Workspace; -import com.fr.workspace.WorkspaceEvent; -import com.fr.workspace.server.predefined.PredefinedStyleOperator; - -/** - * Created by kerry on 2020-11-06 - */ -public class PredefinedStyleUtils { - /** - * 判断当前环境是否支持预定义样式的设置 - */ - private static Boolean allowPredefinedSetting = null; - - static { - EventDispatcher.listen(WorkspaceEvent.AfterSwitch, new Listener() { - @Override - public void on(Event event, Workspace param) { - allowPredefinedSetting = checkAllowPredefinedSetting(); - } - }); - } - - /** - * 判断当前环境是否支持预定义样式的设置 - * @return boolean - */ - public synchronized static boolean isAllowPredefinedSetting() { - if (allowPredefinedSetting == null) { - allowPredefinedSetting = checkAllowPredefinedSetting(); - } - return allowPredefinedSetting; - } - - private PredefinedStyleUtils() { - - } - - private static boolean checkAllowPredefinedSetting() { - if (WorkContext.getCurrent().isLocal()) { - return true; - } - return WorkContext.getCurrent().get(PredefinedStyleOperator.class, new ExceptionHandler() { - @Override - public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) { - FineLoggerFactory.getLogger().error(exceptionInfo.getException().getMessage(), exceptionInfo.getException()); - return false; - } - }).allowPredefinedSetting(); - } -} diff --git a/designer-base/src/test/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollectorTest.java b/designer-base/src/test/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollectorTest.java deleted file mode 100644 index c3c3242bd8..0000000000 --- a/designer-base/src/test/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollectorTest.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.fr.design.mainframe.predefined.info; - -import com.fr.config.BBSAttr; -import com.fr.config.MarketConfig; -import com.fr.design.DesignerEnvManager; -import com.fr.general.GeneralUtils; -import com.fr.json.JSON; -import com.fr.json.JSONFactory; -import com.fr.json.JSONObject; -import com.fr.stable.ProductConstants; -import com.fr.third.org.apache.commons.io.FileUtils; -import org.easymock.EasyMock; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.api.easymock.PowerMock; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor; -import org.powermock.modules.junit4.PowerMockRunner; -import java.io.File; -import java.io.IOException; - -/** - * Created by kerry on 2020-09-05 - */ -@RunWith(PowerMockRunner.class) -@PrepareForTest({ProductConstants.class, MarketConfig.class, DesignerEnvManager.class, GeneralUtils.class}) -@SuppressStaticInitializationFor({"com.fr.jvm.assist.FineAssist"}) -public class PredefinedStyleInfoCollectorTest { - private String filePath; - private String initialFileContent; - - - @Before - public void setUp() throws IOException { - PowerMock.mockStatic(ProductConstants.class); - - filePath = getClass().getResource("predefinedStyle.info").getPath(); - String dirPath = filePath.substring(0, filePath.indexOf("predefinedStyle.info")); - EasyMock.expect(ProductConstants.getEnvHome()).andReturn(dirPath).anyTimes(); - - EasyMock.replay(); - PowerMock.replayAll(); - initialFileContent = FileUtils.readFileToString(new File(filePath), "utf-8"); - } - - @After - public void tearDown() throws IOException { - FileUtils.writeStringToFile(new File(filePath), initialFileContent, "utf-8"); - } - - @Test - public void testCollectClickNumber() { - PredefinedStyleInfoCollector.getInstance().collectClickNumber(); - Assert.assertEquals(1, PredefinedStyleInfoCollector.getInstance().getClickNumber()); - } - - @Test - public void testCollectUseNumber() { - PredefinedStyleInfoCollector.getInstance().collectUseNumber("test"); - Assert.assertEquals(1, PredefinedStyleInfoCollector.getInstance().getUseNumber()); - } - - @Test - public void testGenerateTotalInfo() { - PowerMock.mockStatic(DesignerEnvManager.class); - PowerMock.mockStatic(MarketConfig.class); - PowerMock.mockStatic(GeneralUtils.class); - - DesignerEnvManager envManager = EasyMock.mock(DesignerEnvManager.class); - EasyMock.expect(envManager.getUUID()).andReturn("xxxxx-12345-xxxxx").once(); - EasyMock.expect(DesignerEnvManager.getEnvManager()).andReturn(envManager).once(); - - - MarketConfig marketConfig = EasyMock.mock(MarketConfig.class); - BBSAttr bbsAttr = new BBSAttr(); - bbsAttr.setBbsUid(12345); - EasyMock.expect(marketConfig.getBBSAttr()).andReturn(bbsAttr).once(); - EasyMock.expect(MarketConfig.getInstance()).andReturn(marketConfig).once(); - - EasyMock.expect(GeneralUtils.readFullVersionNO()).andReturn("10.0.9.2020.0817.final"); - - EasyMock.replay(envManager, marketConfig); - - PowerMock.replayAll(); - String content = PredefinedStyleInfoCollector.getInstance().generateTotalInfo(); - JSONObject jsonObject = JSONFactory.createJSON(JSON.OBJECT, content); - Assert.assertEquals("predefinedStyle", jsonObject.getString("functionName")); - Assert.assertEquals("FR-F7003", jsonObject.getString("functionId")); - Assert.assertEquals("xxxxx-12345-xxxxx", jsonObject.getString("uuid")); - Assert.assertEquals(12345, jsonObject.getInt("uid")); - Assert.assertEquals("10.0.9.2020.0817.final", jsonObject.getString("jatTime")); - } - -} diff --git a/designer-base/src/test/resources/com/fr/design/mainframe/predefined/info/predefinedStyle.info b/designer-base/src/test/resources/com/fr/design/mainframe/predefined/info/predefinedStyle.info deleted file mode 100644 index 1d66b61077..0000000000 --- a/designer-base/src/test/resources/com/fr/design/mainframe/predefined/info/predefinedStyle.info +++ /dev/null @@ -1,2 +0,0 @@ - - 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 a565f4bf47..c002bceb38 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,8 +20,6 @@ import com.fr.design.mainframe.HelpDialogManager; 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.NameComponentBackground; -import com.fr.form.ui.NameLayoutBorderStyle; import com.fr.form.ui.Widget; import com.fr.stable.Constants; import com.fr.stable.core.PropertyChangeAdapter; @@ -230,7 +228,6 @@ public class XChartEditor extends XBorderStyleWidgetCreator { * 渲染Painter */ public void paint(Graphics g) { - initBorderStyle(); designerEditor.paintEditor(g, this.getSize()); if (coverPanel != null) { coverPanel.setSize(this.getSize()); @@ -365,14 +362,4 @@ public class XChartEditor extends XBorderStyleWidgetCreator { return false; } - /** - * 初始化组件的预定义信息 - */ - public void initWidgetPredefinedInfo(String styleName){ - this.toData().setNameBorderStyle(NameLayoutBorderStyle.createPredefinedStyle(styleName)); - this.toData().setNameBackground(NameComponentBackground.createPredefinedStyle(styleName)); - initBorderStyle(); - } - - } 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 f3218e9a56..ba049aee82 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 @@ -816,13 +816,12 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo return true; } - /** - * 初始化组件的预定义信息 - */ - public void initWidgetPredefinedInfo(String styleName){ - - } + /** + * 初始化组件的预定义信息 + */ + public void initWidgetPredefinedInfo(){ + } } 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 a0f902112c..a315b71177 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 @@ -19,11 +19,12 @@ import com.fr.form.FormProvider; import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.ElementCaseEditorProvider; -import com.fr.form.ui.NameComponentBackground; import com.fr.form.ui.NameLayoutBorderStyle; +import com.fr.form.ui.NamePaddingMargin; import com.fr.report.fit.ReportFitAttr; import com.fr.stable.ArrayUtils; import com.fr.stable.CoreGraphHelper; +import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; import com.fr.report.fit.FitProvider; @@ -374,20 +375,6 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme return true; } - /** - * 初始化组件的预定义信息 - */ - public void initWidgetPredefinedInfo(String styleName){ - this.toData().setNameBorderStyle(NameLayoutBorderStyle.createPredefinedStyle(styleName)); - this.toData().setNameBackground(NameComponentBackground.createPredefinedStyle(styleName)); - initBorderStyle(); - } - - @Override - public void paint(Graphics g) { - super.paint(g); - initBorderStyle(); - } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java index 917b73434b..db0b0618a3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java @@ -138,10 +138,4 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout { return false; } - /** - * 初始化组件的预定义信息 - */ - public void initWidgetPredefinedInfo(String styleName){ - this.toData().setNameBackground(NameFormBackground.createPredefinedStyle(styleName)); - } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java index 7379b83107..5b271a7cfb 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java @@ -1344,11 +1344,5 @@ public class XWFitLayout extends XLayoutContainer { } } } - /** - * 初始化组件的预定义信息 - */ - public void initWidgetPredefinedInfo(String styleName){ - this.toData().setNameBackground(NameFormBackground.createPredefinedStyle(styleName)); - } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java index 076bd24d90..c925b3a5c2 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java @@ -8,22 +8,27 @@ import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWFitLayout; +import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI; +import com.fr.design.designer.properties.mobile.MobileBookMarkPropertyUI; +import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormHierarchyTreePane; +import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.widget.editors.ButtonTypeEditor; import com.fr.design.mainframe.widget.editors.ImgBackgroundEditor; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.CardSwitchButton; -import com.fr.form.ui.NameComponentBackground; +import com.fr.form.ui.NameFormBackground; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout; import com.fr.general.Background; import com.fr.stable.ArrayUtils; +import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; import javax.swing.border.Border; @@ -640,14 +645,4 @@ public class XWTabFitLayout extends XWFitLayout { public boolean isTopable() { return true; } - - - - /** - * 初始化组件的预定义信息 - */ - public void initWidgetPredefinedInfo(String styleName){ - this.toData().setNameBackground(NameComponentBackground.createPredefinedStyle(styleName)); - } - } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 7923c3fa21..62c89b9cae 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -37,10 +37,10 @@ import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWBorderLayout; import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; +import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.event.DesignerOpenedListener; -import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.RightSelectionHandlerProvider; @@ -969,9 +969,7 @@ public class FormDesigner extends TargetComponent
implements TreeSelection private void refreshCenter(Widget centerWidget, XLayoutContainer formLayoutContainer) { // 不存在center块, 说明是新建的模板 if (centerWidget == null) { - String styleName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle(); XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(new WFitLayout("body")); - layoutContainer.initWidgetPredefinedInfo(styleName); layoutContainer.setSize(LARGE_PREFERRED_SIZE); setRootComponent(layoutContainer); formLayoutContainer.add(rootComponent, WBorderLayout.CENTER); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 7f1aef52b1..b7fb90fcb8 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -644,7 +644,6 @@ public class JForm extends JTemplate implements BaseJForm { - private AccessibleBorderStyleEditor borderStyleEditor; + private AccessibleWLayoutBorderStyleEditor borderStyleEditor; public BorderStyleWidgetDefinePane(XCreator xCreator) { super(xCreator); @@ -29,7 +29,7 @@ public class BorderStyleWidgetDefinePane extends AbstractDataModify 0) { - extraPropertyGroupPane = new PropertyGroupPane(extraTableEditor, creator); - centerPane.add(extraPropertyGroupPane, BorderLayout.CENTER); - } + centerPane.add(extraPropertyGroupPane, BorderLayout.CENTER); return centerPane; } @@ -61,9 +60,7 @@ public class ElementEditorDefinePane extends WTitleLayoutDefinePane extends AbstractDataModify { - private AccessibleBorderStyleEditor borderStyleEditor; + private AccessibleWLayoutBorderStyleEditor borderStyleEditor; public WTitleLayoutDefinePane(XCreator xCreator) { super(xCreator); @@ -32,7 +34,7 @@ public abstract class WTitleLayoutDefinePane { private int resolution = ScreenResolution.getScreenResolution(); public JWorkBook() { - super(new WorkBook(createPredefinedWorkSheet()), DEFAULT_WB_FILE_PREFIX); + super(new WorkBook(new WorkSheet()), DEFAULT_WB_FILE_PREFIX); populateReportParameterAttr(); } - private static WorkSheet createPredefinedWorkSheet() { - WorkSheet sheet = new WorkSheet(); - NameBackground initBackground = NameBackground.createPredefinedStyle(StringUtils.EMPTY); - ((ReportSettings) sheet.getReportSettings()).setNameBackground(initBackground); - return sheet; - } - - public JWorkBook(WorkBookX workBookX) { super(new WorkBookAdapter(workBookX), DEFAULT_WBX_FILE_PREFIX); populateReportParameterAttr(); @@ -161,7 +151,6 @@ public class JWorkBook extends JTemplate { populateReportParameterAttr(); } - @Override protected void addPane(PropertyItemPaneProvider provider) { PaneHolder holder = provider.getPaneHolder(JWorkBook.class); @@ -787,7 +776,6 @@ public class JWorkBook extends JTemplate { } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } - refreshPredefinedState(); } private void applyAll(WorkBookUndoState u) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java index bfe525eb7d..ead1cf2f1e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java @@ -38,7 +38,6 @@ import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; -import com.fr.form.ui.NameBackground; import com.fr.general.ComparatorUtils; import com.fr.general.IOUtils; @@ -46,9 +45,7 @@ import com.fr.main.impl.WorkBook; import com.fr.poly.PolyDesigner; import com.fr.report.poly.PolyWorkSheet; import com.fr.report.report.TemplateReport; -import com.fr.report.stable.ReportSettings; import com.fr.report.worksheet.WorkSheet; -import com.fr.stable.StringUtils; /** * NameTabPane of sheets @@ -850,18 +847,11 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse protected abstract String getTemplateReportType(); } - private void initPredefinedInfo(TemplateReport report){ - NameBackground initBackground = NameBackground.createPredefinedStyle(StringUtils.EMPTY); - ((ReportSettings) report.getReportSettings()).setNameBackground(initBackground); - } - protected class GridReportInsertAction extends SheetInsertAction { @Override protected TemplateReport newTemplateReport() { - WorkSheet workSheet = new WorkSheet(); - initPredefinedInfo(workSheet); - return workSheet; + return new WorkSheet(); } @Override @@ -873,9 +863,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse protected class PolyReportInsertAction extends SheetInsertAction { @Override protected TemplateReport newTemplateReport() { - PolyWorkSheet polyWorkSheet = new PolyWorkSheet(); - initPredefinedInfo(polyWorkSheet); - return polyWorkSheet; + return new PolyWorkSheet(); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java index 108cad8150..487214a80e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java @@ -14,7 +14,7 @@ import com.fr.general.ComparatorUtils; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.Selection; import com.fr.report.cell.CellElement; -import com.fr.report.cell.DefaultPredefinedTemplateCellElement; +import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; @@ -112,7 +112,7 @@ public class CellElementEditPane extends BasicPane { CellElement cellElement = elementCase.getCellElement(cs.getColumn(), cs.getRow()); if (cellElement == null) { - cellElement = new DefaultPredefinedTemplateCellElement(cs.getColumn(), cs.getRow()); + cellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow()); //默认选中的是A1单元格,所以若是A1单元格没有加到列表时要加上,否则在聚合报表时会出错 if (cs.isSelectedOneCell(elementCasePane) && (cs.getColumn() + cs.getRow() == 0)) { elementCase.addCellElement((TemplateCellElement) cellElement); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java index 95645acafb..3706778609 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java @@ -1,16 +1,17 @@ package com.fr.design.mainframe.cell.settingpane; -import com.fr.base.NameStyle; import com.fr.base.Style; import com.fr.design.constants.UIConstants; -import com.fr.design.mainframe.cell.settingpane.style.CellPredefinedStyleSettingPane; +import com.fr.design.mainframe.cell.settingpane.style.StylePane; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.report.cell.DefaultPredefinedTemplateCellElement; +import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.awt.*; /** @@ -18,15 +19,26 @@ import java.awt.*; * @since 2012-5-11下午3:59:39 */ public class CellStylePane extends AbstractCellAttrPane { - private CellPredefinedStyleSettingPane stylePane; + private StylePane stylePane; @Override public JPanel createContentPane() { JPanel content = new JPanel(new BorderLayout()); - content.setBorder(BorderFactory.createEmptyBorder()); - stylePane = new CellPredefinedStyleSettingPane(); + stylePane = new StylePane(); content.add(stylePane, BorderLayout.CENTER); stylePane.setBorder(UIConstants.CELL_ATTR_PRESENTBORDER); + stylePane.addPredefinedChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + attributeChanged(); + } + }); + stylePane.addCustomTabChangeListener(new ChangeListener() { + + @Override + public void stateChanged(ChangeEvent e) { + adjustValues();// 里面的Tab切换后要及时调整滚动条,因为一些界面可能不需要滚动条 + } + }); return content; } @@ -43,49 +55,68 @@ public class CellStylePane extends AbstractCellAttrPane { @Override public String getIconPath() { +// return "com/fr/design/images/m_format/cell.png"; return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Style"); } @Override public void updateBean(TemplateCellElement cellElement) { - cellElement.setStyle(stylePane.updateStyle()); + cellElement.setStyle(stylePane.updateBean()); } @Override public void updateBeans() { - Style style = stylePane.updateStyle(); - TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); - int cellRectangleCount = cs.getCellRectangleCount(); - for (int rect = 0; rect < cellRectangleCount; rect++) { - Rectangle cellRectangle = cs.getCellRectangle(rect); - for (int j = 0; j < cellRectangle.height; j++) { - for (int i = 0; i < cellRectangle.width; i++) { - int column = i + cellRectangle.x; - int row = j + cellRectangle.y; - TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); - if (cellElement == null) { - cellElement = new DefaultPredefinedTemplateCellElement(column, row); - elementCase.addCellElement(cellElement); + if (stylePane.getSelectedIndex() == 1) { + Style s = stylePane.updateBean(); + TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); + int cellRectangleCount = cs.getCellRectangleCount(); + for (int rect = 0; rect < cellRectangleCount; rect++) { + Rectangle cellRectangle = cs.getCellRectangle(rect); + for (int j = 0; j < cellRectangle.height; j++) { + for (int i = 0; i < cellRectangle.width; i++) { + int column = i + cellRectangle.x; + int row = j + cellRectangle.y; + TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); + if (cellElement == null) { + cellElement = new DefaultTemplateCellElement(column, row); + elementCase.addCellElement(cellElement); + } + cellElement.setStyle(s); + } + } + } + } else { + TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); + int cellRectangleCount = cs.getCellRectangleCount(); + for (int rect = 0; rect < cellRectangleCount; rect++) { + Rectangle cellRectangle = cs.getCellRectangle(rect); + for (int j = 0; j < cellRectangle.height; j++) { + for (int i = 0; i < cellRectangle.width; i++) { + int column = i + cellRectangle.x; + int row = j + cellRectangle.y; + TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); + if (cellElement == null) { + cellElement = new DefaultTemplateCellElement(column, row); + elementCase.addCellElement(cellElement); + } + Style style = cellElement.getStyle(); + if (style == null) { + style = Style.DEFAULT_STYLE; + + } + style = stylePane.updateStyle(style); + cellElement.setStyle(style); } - cellElement.setStyle(style); } } - } - if (!(style instanceof NameStyle)) { stylePane.updateBorder();// border必须特别处理 } } @Override protected void populateBean() { - Style style = cellElement.getStyle(); - if (style instanceof NameStyle) { - stylePane.populateBean((NameStyle) style); - } else { - //说明是未经过转换的 - stylePane.populateBean(NameStyle.createCustomStyle(cellElement.getStyle())); - } + stylePane.populateBean(cellElement.getStyle()); stylePane.dealWithBorder(elementCasePane); } @@ -95,6 +126,7 @@ public class CellStylePane extends AbstractCellAttrPane { } public void setSelectedByIds(int level, String... id) { + stylePane.setSelctedByName(id[level]); } } diff --git a/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java b/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java index cb5acdf860..ad0c57b51e 100644 --- a/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java +++ b/designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java @@ -12,7 +12,7 @@ import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.Selection; import com.fr.log.FineLoggerFactory; import com.fr.report.cell.CellElement; -import com.fr.report.cell.DefaultPredefinedTemplateCellElement; +import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.cellattr.highlight.DefaultHighlight; import com.fr.report.cell.cellattr.highlight.Highlight; @@ -82,7 +82,7 @@ public class ConditionAttributesGroupPane extends UIListControlPane { final TemplateElementCase tplEC = ePane.getEditingElementCase(); editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow()); if (editCellElement == null) { - editCellElement = new DefaultPredefinedTemplateCellElement(cs.getColumn(), cs.getRow()); + editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow()); } SheetUtils.calculateDefaultParent(tplEC); // 不知道这行代码的作用,怕去掉之后会出问题,先放在这里 diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java b/designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java index 5df13c2424..5fcee4ba94 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java @@ -84,7 +84,7 @@ public class ReportPredefinedBackgroundPane extends PredefinedStyleSettingPane Date: Tue, 10 Nov 2020 14:25:24 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=B1=8F=E8=94=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/designer/creator/XCreator.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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 ba049aee82..c7c91d9aaf 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 @@ -815,13 +815,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo public boolean isTopable() { return true; } - - /** - * 初始化组件的预定义信息 - */ - public void initWidgetPredefinedInfo(){ - - } + } From f25c4e7d587c710dce13afe34363eafda45aa4fd Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 10 Nov 2020 14:38:15 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=B1=8F=E8=94=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/designer/creator/XElementCase.java | 4 ---- .../fr/design/designer/creator/XWAbsoluteBodyLayout.java | 3 --- .../java/com/fr/design/designer/creator/XWFitLayout.java | 3 --- .../design/designer/creator/cardlayout/XWTabFitLayout.java | 6 ------ 4 files changed, 16 deletions(-) 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 a315b71177..14e0a65113 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 @@ -18,13 +18,9 @@ import com.fr.form.FormElementCaseProvider; import com.fr.form.FormProvider; import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.ElementCaseEditorProvider; - -import com.fr.form.ui.NameLayoutBorderStyle; -import com.fr.form.ui.NamePaddingMargin; import com.fr.report.fit.ReportFitAttr; import com.fr.stable.ArrayUtils; import com.fr.stable.CoreGraphHelper; -import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; import com.fr.report.fit.FitProvider; diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java index db0b0618a3..a43ed01251 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java @@ -7,10 +7,7 @@ import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; -import com.fr.form.ui.NameFormBackground; import com.fr.form.ui.container.WAbsoluteBodyLayout; - -import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; import java.awt.Component; diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java index 5b271a7cfb..6d55c658f2 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java @@ -12,7 +12,6 @@ import com.fr.design.mainframe.FormArea; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.utils.gui.LayoutUtils; -import com.fr.form.ui.NameFormBackground; import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; @@ -24,8 +23,6 @@ import com.fr.general.FRLogger; import com.fr.general.FRScreen; import com.fr.stable.ArrayUtils; import com.fr.stable.AssistUtils; -import com.fr.stable.StringUtils; - import javax.swing.JOptionPane; import java.awt.Component; import java.awt.Dimension; diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java index c925b3a5c2..d72a8f4fe3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java @@ -8,27 +8,21 @@ import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWFitLayout; -import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI; -import com.fr.design.designer.properties.mobile.MobileBookMarkPropertyUI; -import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormHierarchyTreePane; -import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.widget.editors.ButtonTypeEditor; import com.fr.design.mainframe.widget.editors.ImgBackgroundEditor; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.CardSwitchButton; -import com.fr.form.ui.NameFormBackground; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout; import com.fr.general.Background; import com.fr.stable.ArrayUtils; -import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; import javax.swing.border.Border; From 4a0d90e57c01b19683537a01b336f936f93e3321 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 10 Nov 2020 15:01:06 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/PredefinedStyleEditPane.java | 12 +++++----- .../ui/ServerPredefinedStylePane.java | 24 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java index 6556fb9047..33698d7c1e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java @@ -312,12 +312,12 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane { } config.add(previewObject); PredefinedStyleConfig sortedConfig = resortConfigStyles(previewObject, config); - Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { - @Override - public void run() { - ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(sortedConfig); - } - }); +// Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { +// @Override +// public void run() { +// ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(sortedConfig); +// } +// }); selectPane.refreshPane(); return true; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java index 739c927b8e..cc0cbf15fd 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java @@ -140,12 +140,12 @@ public class ServerPredefinedStylePane extends BasicPane { if (style != null) { PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig(); config.setDefaultPredefinedStyle(style.getStyleName()); - Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { - @Override - public void run() { - ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config); - } - }); +// Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { +// @Override +// public void run() { +// ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config); +// } +// }); } } @@ -207,12 +207,12 @@ public class ServerPredefinedStylePane extends BasicPane { private void removeStyle(String name) { PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig(); config.removeStyle(name); - Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { - @Override - public void run() { - ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config); - } - }); +// Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { +// @Override +// public void run() { +// ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config); +// } +// }); } } From aa971a8b2816f9d83c319689dfa6bdf6a0f447bb Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 11 Nov 2020 11:39:10 +0800 Subject: [PATCH 10/12] =?UTF-8?q?REPORT-43198=20=E9=A2=84=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=A0=B7=E5=BC=8F=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9B=9E=E9=80=80=E9=81=97=E6=BC=8F=E9=83=A8?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../settingpane/style/CellPredefinedStyleSettingPane.java | 7 ++++--- .../fr/design/report/ReportPredefinedBackgroundPane.java | 4 ++-- .../src/main/java/com/fr/poly/PolyDesignUI.java | 6 ------ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java index 6a111b781d..86de92d748 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java @@ -84,7 +84,7 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane allStyle = config.getAllStyles(); @@ -122,7 +122,7 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane { diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java b/designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java index 5fcee4ba94..4582983b62 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java @@ -67,8 +67,8 @@ public class ReportPredefinedBackgroundPane extends PredefinedStyleSettingPane Date: Wed, 11 Nov 2020 14:11:47 +0800 Subject: [PATCH 11/12] =?UTF-8?q?REPORT-43198=20=E9=A2=84=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=A0=B7=E5=BC=8F=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9B=9E=E9=80=80=E9=81=97=E6=BC=8F=E9=83=A8?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/predefined/PatternStyle.java | 8 +++-- .../style/CellPredefinedStyleSettingPane.java | 30 +++++++++---------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/PatternStyle.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/PatternStyle.java index 94892f75ec..c4ebcf225f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/PatternStyle.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/PatternStyle.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.predefined; import com.fr.config.predefined.PredefinedStyle; -import com.fr.predefined.PredefinedPatternStyleManager; +//import com.fr.predefined.PredefinedPatternStyleManager; /** @@ -11,13 +11,15 @@ public enum PatternStyle { DARK_STYLE(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Dark_Pattern")) { @Override public PredefinedStyle getPredefinedStyle() { - return PredefinedPatternStyleManager.INSTANCE.getDarkMode(); +// return PredefinedPatternStyleManager.INSTANCE.getDarkMode(); + return new PredefinedStyle(); } }, LIGHT_STYLE(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Light_Pattern")) { @Override public PredefinedStyle getPredefinedStyle() { - return PredefinedPatternStyleManager.INSTANCE.getLightMode(); +// return PredefinedPatternStyleManager.INSTANCE.getLightMode(); + return new PredefinedStyle(); } }; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java index 86de92d748..4f38c8baa5 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java @@ -25,7 +25,7 @@ import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.predefined.ui.PredefinedStyleSettingPane; import com.fr.design.mainframe.predefined.ui.preview.StyleSettingPreviewPane; import com.fr.design.style.BorderUtils; -import com.fr.predefined.PredefinedPatternStyleManager; +//import com.fr.predefined.PredefinedPatternStyleManager; import com.fr.stable.Constants; import com.fr.stable.StringUtils; import com.fr.third.javax.annotation.Nonnull; @@ -85,20 +85,20 @@ public class CellPredefinedStyleSettingPane extends PredefinedStyleSettingPane allStyle = config.getAllStyles(); - this.applicationFormat.clearBoxItems(); - for (String name : allStyle.keySet()) { - this.applicationFormat.addItem(name); - } - if (allStyle.containsKey(ob.getName())) { - this.applicationFormat.setSelectedItem(ob.getName()); - }else { - this.applicationFormat.setSelectedItem(config.getDefaultStyleName()); - } - this.customPredefinedStylePane.populateBean(ob); - this.setPopulating(false); +// PredefinedStyle currentStyle = PredefinedPatternStyleManager.INSTANCE.getStyleFromName(getPredefinedStyleName()); +// PredefinedCellStyleConfig config = currentStyle.getCellStyleConfig(); +// Map allStyle = config.getAllStyles(); +// this.applicationFormat.clearBoxItems(); +// for (String name : allStyle.keySet()) { +// this.applicationFormat.addItem(name); +// } +// if (allStyle.containsKey(ob.getName())) { +// this.applicationFormat.setSelectedItem(ob.getName()); +// }else { +// this.applicationFormat.setSelectedItem(config.getDefaultStyleName()); +// } +// this.customPredefinedStylePane.populateBean(ob); +// this.setPopulating(false); } From 70a489ac1ce9c644d1a130ab102fbff25bd75aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 11 Nov 2020 15:50:34 +0800 Subject: [PATCH 12/12] =?UTF-8?q?CHART-16721=20=E9=A2=84=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BB=A3=E7=A0=81=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../column/VanChartColumnSeriesPane.java | 4 +- .../component/VanChartFillStylePane.java | 17 +++++--- .../component/VanChartLabelContentPane.java | 7 ++-- .../designer/style/MapRangeLegendPane.java | 6 ++- .../style/VanChartPlotLegendPane.java | 5 ++- .../designer/style/VanChartTitlePane.java | 8 ++-- .../VanChartTitleWithAutoBackground.java | 4 +- .../style/axis/VanChartBaseAxisPane.java | 40 +++++++++++++++---- .../gauge/VanChartGaugeDetailAxisPane.java | 5 ++- .../axis/radar/VanChartRadarXAxisPane.java | 4 +- .../axis/radar/VanChartRadarYAxisPane.java | 4 +- .../VanChartAreaBackgroundPane.java | 8 ++-- .../background/VanChartAxisAreaPane.java | 36 ++++++++++++----- .../datasheet/VanChartDataSheetPane.java | 9 +++-- ...hartGaugeCateOrPercentLabelDetailPane.java | 5 +++ .../label/VanChartGaugeLabelDetailPane.java | 4 +- .../VanChartAbstractPlotSeriesPane.java | 4 +- .../VanChartDrillMapInteractivePane.java | 7 ++-- .../chart/gauge/VanChartGaugeSeriesPane.java | 34 +++++++++++----- .../van/chart/map/VanChartMapSeriesPane.java | 23 +++++++---- .../type/VanChartMapSourceChoosePane.java | 9 ++++- .../VanChartScatterLabelContentPane.java | 8 ++-- 22 files changed, 171 insertions(+), 80 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java index c92cfd857f..eb2c3914ac 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java @@ -69,7 +69,9 @@ public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane { //边框(有圆角) protected VanChartBorderPane createDiffBorderPane() { - return new VanChartBorderWithRadiusPane(true); + return new VanChartBorderWithRadiusPane(); + //TODO Bjorn 边框自动回退 + //return new VanChartBorderWithRadiusPane(true); } private JPanel createSeriesStylePane(double[] row, double[] col) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java index 2299c3585e..057675a0a7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java @@ -27,12 +27,15 @@ public class VanChartFillStylePane extends ColorFillStylePane implements Designe } protected void styleSelectBoxChange() { - getCustomPane().setVisible(getStyleSelectBox().getSelectedIndex() != 0); + //TODO Bjorn 配色预定义回退 + //getCustomPane().setVisible(getStyleSelectBox().getSelectedIndex() != 0); super.styleSelectBoxChange(); } protected ColorSchemeComboBox createColorSchemeComboBox() { - return new ColorSchemeComboBox(null, true); + return new ColorSchemeComboBox(); + //TODO Bjorn 配色预定义回退 + //return new ColorSchemeComboBox(null, true); } protected void initLayout() { @@ -60,19 +63,21 @@ public class VanChartFillStylePane extends ColorFillStylePane implements Designe } public void populateBean(AttrFillStyle condition) { - if (condition.isPredefinedStyle()) { + /* if (condition.isPredefinedStyle()) { getStyleSelectBox().setSelectType(ColorSchemeComboBox.SelectType.DEFAULT); return; - } + }*/ + //TODO Bjorn 配色预定义回退 populateBean(condition.getColorFillStyle()); } public void updateBean(AttrFillStyle attrFillStyle) { - if (getStyleSelectBox().getSelectedIndex() == 0) { + /* if (getStyleSelectBox().getSelectedIndex() == 0) { attrFillStyle.setPredefinedStyle(true); return; } - attrFillStyle.setPredefinedStyle(false); + attrFillStyle.setPredefinedStyle(false);*/ + //TODO Bjorn 配色预定义回退 attrFillStyle.setColorFillStyle(updateBean()); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java index 18745f915c..e3bd8248f3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java @@ -1,12 +1,10 @@ package com.fr.van.chart.designer.component; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.type.TextAlign; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; -import java.awt.BorderLayout; public class VanChartLabelContentPane extends VanChartTooltipContentPane { @@ -24,7 +22,8 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane { return new AttrTooltipContent(TextAlign.CENTER); } - public JPanel createCommonStylePane() { + //TODO Bjorn 标签面板回退 + /* public JPanel createCommonStylePane() { if (isInCondition()) { return super.createCommonStylePane(); } @@ -47,5 +46,5 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane { attrTooltipContent.setCustom(true); } } - } + }*/ } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/MapRangeLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/MapRangeLegendPane.java index c2b1620b4c..7e68f99423 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/MapRangeLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/MapRangeLegendPane.java @@ -19,7 +19,9 @@ public class MapRangeLegendPane extends VanChartRangeLegendPane { } @Override - protected VanChartBackgroundPane creatBackgroundPane(){ - return new VanChartBackgroundWithOutImagePane(true); + protected VanChartBackgroundPane creatBackgroundPane() { + //TODO Bjorn 地图图例背景自动逻辑 + return new VanChartBackgroundWithOutImagePane(); + //return new VanChartBackgroundWithOutImagePane(true); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java index ef1e8573a5..8a0a62f62d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java @@ -14,7 +14,6 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.attr.VanChartLegend; import com.fr.plugin.chart.type.LayoutType; @@ -287,7 +286,9 @@ public class VanChartPlotLegendPane extends BasicPane { } private JPanel createTitleStylePane() { - textAttrPane = new ChartTextAttrPaneWithPreStyle(); + //TODO Bjorn 图例预定义逻辑 + //textAttrPane = new ChartTextAttrPaneWithPreStyle(); + textAttrPane = new ChartTextAttrPane(); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java index cfcb0debba..1c02f342ca 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java @@ -15,7 +15,7 @@ import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; +import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.attr.VanChartTitle; @@ -54,7 +54,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { private JPanel titlePane; private TinyFormulaPane titleContent; - private ChartTextAttrPaneWithPreStyle textAttrPane; + private ChartTextAttrPane textAttrPane; private UIButtonGroup alignmentPane; private VanChartBackgroundWithOutShadowWithRadiusPane backgroundPane; private UIToggleButton useHtml; @@ -175,7 +175,9 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { } private JPanel createTitleStylePane() { - textAttrPane = new ChartTextAttrPaneWithPreStyle(); + //TODO Bjorn 标题预定义逻辑 + //textAttrPane = new ChartTextAttrPaneWithPreStyle(); + textAttrPane = new ChartTextAttrPane(); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitleWithAutoBackground.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitleWithAutoBackground.java index eb87f4363a..e126c53598 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitleWithAutoBackground.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitleWithAutoBackground.java @@ -14,6 +14,8 @@ public class VanChartTitleWithAutoBackground extends VanChartTitlePane { } protected VanChartBackgroundWithOutShadowWithRadiusPane createBackgroundPane() { - return new VanChartBackgroundWithOutShadowWithRadiusPane(true); + //TODO Bjorn 地图标题背景自动逻辑 + //return new VanChartBackgroundWithOutShadowWithRadiusPane(true); + return new VanChartBackgroundWithOutShadowWithRadiusPane(); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java index fd122f40b5..955be0a8c4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -20,8 +20,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; -import com.fr.design.mainframe.chart.gui.style.ColorSelectBoxWithPreStyle; +import com.fr.design.style.color.ColorSelectBox; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.plugin.chart.attr.axis.VanChartAxis; @@ -85,7 +84,11 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { private JPanel labelDisplayPane; protected LineComboBox axisLineStyle; - protected ColorSelectBoxWithPreStyle axisLineColor; + + //TODO Bjorn 坐标轴面板回退 + protected ColorSelectBox axisLineColor; + //protected ColorSelectBoxWithPreStyle axisLineColor; + protected UIButtonGroup mainTick; protected UIButtonGroup secondTick; @@ -378,16 +381,31 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } protected ChartTextAttrPane getChartTextAttrPane() { - return new ChartTextAttrPaneWithPreStyle() { + //TODO Bjorn 坐标轴面板回退 + /* return new ChartTextAttrPaneWithPreStyle() { protected double getEdithAreaWidth() { return TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; } + };*/ + return new ChartTextAttrPane() { + @Override + protected JPanel getContentPane(JPanel buttonPane) { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; + double[] columnSize = {f, e}; + double[] rowSize = {p, p, p}; + + return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize); + } }; } protected JPanel createLineStylePane(double[] row, double[] col) { axisLineStyle = createLineComboBox(); - axisLineColor = new ColorSelectBoxWithPreStyle(100); + //TODO Bjorn 坐标轴面板回退 + //axisLineColor = new ColorSelectBoxWithPreStyle(100); + axisLineColor = new ColorSelectBox(100); String[] strings = new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")}; AxisTickLineType[] values = new AxisTickLineType[]{AxisTickLineType.TICK_LINE_OUTSIDE, AxisTickLineType.TICK_LINE_NONE}; mainTick = new UIButtonGroup(strings, values); @@ -405,7 +423,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { return new Component[][]{ new Component[]{null, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle}, - new Component[]{axisLineColor, null}, + //TODO Bjorn 坐标轴面板回退 + //new Component[]{axisLineColor, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Main_Graduation_Line")), mainTick}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Second_Graduation_Line")), secondTick}, }; @@ -715,7 +735,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { axisLineStyle.setSelectedLineStyle(axis.getAxisStyle()); } if (axisLineColor != null) { - axisLineColor.populate(axis.getLineColorWithPreStyle()); + axisLineColor.setSelectObject(axis.getAxisColor()); + //TODO Bjorn 坐标轴面板回退 + //axisLineColor.populate(axis.getLineColorWithPreStyle()); } if (mainTick != null) { mainTick.setSelectedItem(axis.getMainTickLine()); @@ -858,7 +880,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { axis.setAxisStyle(axisLineStyle.getSelectedLineStyle()); } if (axisLineColor != null) { - axis.setLineColorWithPreStyle(axisLineColor.update()); + axis.setAxisColor(axisLineColor.getSelectObject()); + //TODO Bjorn 坐标轴面板回退 + //axis.setLineColorWithPreStyle(axisLineColor.update()); } if (mainTick != null) { axis.setMainTickLine(mainTick.getSelectedItem()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java index 60c77734c1..1a4fccf585 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java @@ -8,7 +8,6 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; import com.fr.design.style.color.ColorSelectBox; import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartGaugeAxis; @@ -103,7 +102,9 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { if (isMulti(gaugeStyle)) { return new ChartTextAttrPaneWithAuto(FontAutoType.SIZE_AND_COLOR); } else { - return new ChartTextAttrPaneWithPreStyle(); + return new ChartTextAttrPane(); + //TODO Bjorn 坐标轴面板回退 + //return new ChartTextAttrPaneWithPreStyle(); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java index 3558443c4f..309a7daa66 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java @@ -46,7 +46,9 @@ public class VanChartRadarXAxisPane extends VanChartBaseAxisPane { return new Component[][]{ new Component[]{null,null} , new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle}, - new Component[]{axisLineColor, null}, + //TODO Bjorn 坐标轴面板回退 + //new Component[]{axisLineColor, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor}, }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java index 0015676882..cf4ffb3864 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java @@ -90,7 +90,9 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane { return new Component[][]{ new Component[]{null, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle}, - new Component[]{axisLineColor, null}, + //TODO Bjorn 坐标轴面板回退 + //new Component[]{axisLineColor, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor}, }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java index d53a7ebc64..6cef622ebe 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java @@ -6,11 +6,9 @@ import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; - import com.fr.van.chart.designer.AbstractVanChartScrollPane; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.background.VanChartBackgroundPane; -import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWithPreStyle; import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; import com.fr.van.chart.designer.style.background.radar.VanChartRadarAxisAreaPane; @@ -42,11 +40,13 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane { private LineTypeComboBox horizonLineType; private LineTypeComboBox verticalLineType; - private ColorSelectBoxWithPreStyle horizontalColorBox; - private ColorSelectBoxWithPreStyle verticalColorBox; + private ColorSelectBox horizontalColorBox; + private ColorSelectBox verticalColorBox; + //TODO Bjorn 背景坐标轴面板回退 + /* private ColorSelectBoxWithPreStyle horizontalColorBox; + private ColorSelectBoxWithPreStyle verticalColorBox;*/ private JPanel horizontalColorPane; private JPanel verticalColorPane; @@ -54,8 +56,11 @@ public class VanChartAxisAreaPane extends BasicBeanPane { } private void initComponents() { - horizontalColorBox = new ColorSelectBoxWithPreStyle(PREFERRED_WIDTH); - verticalColorBox = new ColorSelectBoxWithPreStyle(PREFERRED_WIDTH); + horizontalColorBox = new ColorSelectBox(PREFERRED_WIDTH); + verticalColorBox = new ColorSelectBox(PREFERRED_WIDTH); + //TODO Bjorn 背景坐标轴面板回退 + /* horizontalColorBox = new ColorSelectBoxWithPreStyle(PREFERRED_WIDTH); + verticalColorBox = new ColorSelectBoxWithPreStyle(PREFERRED_WIDTH);*/ horizonLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); verticalLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); @@ -88,15 +93,18 @@ public class VanChartAxisAreaPane extends BasicBeanPane { } protected void initGridLineComponents() { + //TODO Bjorn 背景坐标轴面板回退 Component[][] upComponent = new Component[][]{ new Component[]{null, null}, - new Component[]{horizontalColorBox, null} + new Component[]{null, horizontalColorBox} + //new Component[]{horizontalColorBox, null} }; horizontalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(upComponent); Component[][] downComponent = new Component[][]{ new Component[]{null, null}, - new Component[]{verticalColorBox, null} + new Component[]{null, verticalColorBox} + //new Component[]{verticalColorBox, null} }; verticalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(downComponent); @@ -220,13 +228,16 @@ public class VanChartAxisAreaPane extends BasicBeanPane { VanChartAxis defaultXAxis = rectanglePlot.getDefaultXAxis(); VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis(); + //TODO Bjorn 背景坐标轴面板回退 if (defaultXAxis != null) { - verticalColorBox.populate(defaultXAxis.getMainGridColorWithPreStyle()); + //verticalColorBox.populate(defaultXAxis.getMainGridColorWithPreStyle()); + verticalColorBox.setSelectObject(defaultXAxis.getMainGridColor()); verticalLineType.setSelectedItem(defaultXAxis.getGridLineType()); } if (defaultYAxis != null) { - horizontalColorBox.populate(defaultYAxis.getMainGridColorWithPreStyle()); + //horizontalColorBox.populate(defaultYAxis.getMainGridColorWithPreStyle()); + horizontalColorBox.setSelectObject(defaultYAxis.getMainGridColor()); horizonLineType.setSelectedItem(defaultYAxis.getGridLineType()); } } @@ -253,13 +264,16 @@ public class VanChartAxisAreaPane extends BasicBeanPane { VanChartAxis defaultXAxis = rectanglePlot.getDefaultXAxis(); VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis(); + //TODO Bjorn 背景坐标轴面板回退 if (defaultXAxis != null) { - defaultXAxis.setMainGridColorWithPreStyle(verticalColorBox.update()); + //defaultXAxis.setMainGridColorWithPreStyle(verticalColorBox.update()); + defaultXAxis.setMainGridColor(verticalColorBox.getSelectObject()); defaultXAxis.setGridLineType((LineType) verticalLineType.getSelectedItem()); } if (defaultYAxis != null) { - defaultYAxis.setMainGridColorWithPreStyle(horizontalColorBox.update()); + //defaultYAxis.setMainGridColorWithPreStyle(horizontalColorBox.update()); + defaultYAxis.setMainGridColor(horizontalColorBox.getSelectObject()); defaultYAxis.setGridLineType((LineType) horizonLineType.getSelectedItem()); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanChartDataSheetPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanChartDataSheetPane.java index 724fb64267..d6fa66bfb5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanChartDataSheetPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanChartDataSheetPane.java @@ -10,7 +10,6 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.VanChartAttrHelper; @@ -20,7 +19,6 @@ import com.fr.plugin.chart.type.AxisType; import com.fr.van.chart.designer.AbstractVanChartScrollPane; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.border.VanChartBorderPane; -import com.fr.van.chart.designer.component.border.VanChartBorderPaneWithPreStyle; import com.fr.van.chart.designer.component.format.FormatPaneWithNormalType; import javax.swing.JPanel; @@ -105,12 +103,15 @@ public class VanChartDataSheetPane extends AbstractVanChartScrollPane { return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); } + //TODO Bjorn 数据表面板回退 protected VanChartBorderPane createBorderPanePane() { - return new VanChartBorderPaneWithPreStyle(); + return new VanChartBorderPane(); + //return new VanChartBorderPaneWithPreStyle(); } protected ChartTextAttrPane createChartTextAttrPane() { - return new ChartTextAttrPaneWithPreStyle(); + return new ChartTextAttrPane(); + //return new ChartTextAttrPaneWithPreStyle(); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java index d8c3217380..3d6ad86e88 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java @@ -49,6 +49,11 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe return getGaugeStyle() == GaugeStyle.RING || getGaugeStyle() == GaugeStyle.SLOT; } + //TODO Bjorn 仪表盘自动逻辑 + protected boolean isFontColorAuto() { + return getGaugeStyle() == GaugeStyle.RING || getGaugeStyle() == GaugeStyle.SLOT; + } + protected boolean hasLabelPosition(Plot plot) { switch (getGaugeStyle()) { case RING: diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java index 09481a9290..17910d38a0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java @@ -80,8 +80,10 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { return false; } + //TODO Bjorn 仪表盘自动逻辑 protected boolean isFontColorAuto() { - return true; + return false; + //return true; } private FontAutoType getFontAutoType() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java index 0a6a7a39e2..1ffb8fc2f5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java @@ -270,7 +270,9 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP } protected VanChartBorderPane createDiffBorderPane() { - return new VanChartBorderPane(true); + return new VanChartBorderPane(); + //TODO Bjorn 边框自动回退 + //return new VanChartBorderPane(true); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java index 6886bae4d7..a5d441a750 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java @@ -6,7 +6,6 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; @@ -76,13 +75,15 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith } }; - backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(true) { + //TODO Bjorn 钻取地图钻取目录背景自动逻辑 + /*backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(true) { @Override protected void initList() { paneList.add(new ColorBackgroundQuickPane()); } - }; + };*/ + backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(); selectBackgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(); catalogSuperLink = new VanChartCatalogHyperLinkPane(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java index ab0019f741..8a48837cb3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java @@ -68,7 +68,8 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double[] columnSize = {f}; - double[] rowSize = {p,p,p,p,p,p,p,p,p,p}; + //TODO Bjorn + double[] rowSize = {p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ new Component[]{createGaugeLayoutPane()}, new Component[]{createGaugeStylePane(rowSize, new double[]{f,e})}, @@ -140,12 +141,14 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { private Component[][] getDiffComponentsWithGaugeStyle() { GaugeStyle style = plot == null ? GaugeStyle.POINTER : ((VanChartGaugePlot)plot).getGaugeStyle(); switch (style) { + //TODO Bjorn 仪表盘样式自动逻辑 case RING: initRotate(); return new Component[][]{ new Component[]{null, null}, - getPaneBackgroundColorAuto(), - new Component[]{null, paneBackgroundColor}, + getPaneBackgroundColor(), + /* getPaneBackgroundColorAuto(), + new Component[]{null, paneBackgroundColor},*/ getInnerPaneBackgroundColor(), new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null}, getChutePercent() @@ -154,8 +157,9 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { return new Component[][]{ new Component[]{null, null}, getNeedleColor(), - getSlotBackgroundColorAuto(), - new Component[]{null, slotBackgroundColor}, + getSlotBackgroundColor(), + /* getSlotBackgroundColorAuto(), + new Component[]{null, slotBackgroundColor},*/ new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null}, getChutePercent() }; @@ -163,25 +167,33 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { return new Component[][]{ new Component[]{null, null}, getNeedleColor(), - getSlotBackgroundColorAuto(), - new Component[]{null, slotBackgroundColor}, + getSlotBackgroundColor(), + /*getSlotBackgroundColorAuto(), + new Component[]{null, slotBackgroundColor},*/ new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Length_Set")), null}, getThermometerWidth() }; default: return new Component[][]{ new Component[]{null, null}, - getHingeColorAuto(), - new Component[]{null, hingeColor}, + getHingeColor(), + /* getHingeColorAuto(), + new Component[]{null, hingeColor},*/ getHingeBackgroundColor(), getNeedleColor(), - getPaneBackgroundColorAuto(), - new Component[]{null, paneBackgroundColor}, + getPaneBackgroundColor(), + /* getPaneBackgroundColorAuto(), + new Component[]{null, paneBackgroundColor},*/ new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null} }; } } + private Component[] getHingeColor() { + hingeColor = new ColorSelectBox(120); + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Hinge")), hingeColor}; + } + private Component[] getHingeColorAuto() { hingeColor = new ColorSelectBox(120); hingeColorAuto = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java index 714afadc2c..00a847e2ec 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java @@ -261,7 +261,9 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { } protected JPanel createAreaPane() { - borderWithAlphaPane = new VanChartBorderWithAlphaPane(true); + //TODO Bjorn 地图背景自动 + //borderWithAlphaPane = new VanChartBorderWithAlphaPane(true); + borderWithAlphaPane = new VanChartBorderWithAlphaPane(); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -277,10 +279,11 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { } protected JPanel createNullValueColorPane() { - nullValueAuto = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), + //TODO Bjorn 地图空值背景自动 + /* nullValueAuto = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), Toolkit.i18nText("Fine-Design_Chart_Custom")}); - nullValueColorBox = new ColorSelectBox(80); initNullValueListener(); + nullValueColorBox = new ColorSelectBox(80); double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; @@ -294,7 +297,10 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { new Component[]{text, nullValueAuto}, new Component[]{null, nullValueColorBox}, }; - return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);*/ + + nullValueColorBox = new ColorSelectBox(80); + return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_NULL_Value_Color"), nullValueColorBox); } @@ -499,13 +505,15 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { markerTypeCom.setSelectedItem(((VanChartMapPlot) plot).getMapMarkerType().toLocalString()); } if (nullValueColorBox != null) { - if (((VanChartMapPlot) plot).isAutoNullValue()) { + //TODO Bjorn 地图空值背景自动 + /* if (((VanChartMapPlot) plot).isAutoNullValue()) { nullValueAuto.setSelectedIndex(0); } else { nullValueAuto.setSelectedIndex(1); } nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor()); - checkNullValueButton(); + checkNullValueButton();*/ + nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor()); } //大数据模式 恢复用注释。下面3行删除。 if (lineMapLargeDataModelGroup != null) { @@ -521,7 +529,8 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { ((VanChartMapPlot) plot).setMapMarkerType(MapMarkerType.parseInt(markerTypeCom.getSelectedIndex())); } if (nullValueColorBox != null) { - ((VanChartMapPlot) plot).setAutoNullValue(nullValueAuto.getSelectedIndex() == 0); + //TODO Bjorn 地图空值背景自动 + //((VanChartMapPlot) plot).setAutoNullValue(nullValueAuto.getSelectedIndex() == 0); ((VanChartMapPlot) plot).setNullValueColor(nullValueColorBox.getSelectObject()); } //大数据模式 恢复用注释。下面3行删除。 diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java index 17b275e30b..bbe9d7dd44 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -645,9 +645,14 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { } private void resetGisLayer(VanChartMapPlot mapPlot) { + //TODO Bjorn 地图gis图层自动逻辑 + /* mapPlot.getGisLayer().setGisLayerType(GISLayerType.AUTO); + mapPlot.getGisLayer().setLayerName(GISLayerType.getLocString(GISLayerType.AUTO));*/ - mapPlot.getGisLayer().setGisLayerType(GISLayerType.AUTO); - mapPlot.getGisLayer().setLayerName(GISLayerType.getLocString(GISLayerType.AUTO)); + String layerName = mapPlot.getDefaultGisLayerName(); + + mapPlot.getGisLayer().setGisLayerType(GISLayerType.PREDEFINED_LAYER); + mapPlot.getGisLayer().setLayerName(layerName); gisLayer.setSelectedItem(mapPlot.getGisLayer().getShowItemName()); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java index 9a48756cce..9c79f9b8cd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java @@ -1,13 +1,10 @@ package com.fr.van.chart.scatter; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; -import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.van.chart.designer.component.VanChartHtmlLabelPane; import com.fr.van.chart.designer.component.VanChartHtmlLabelPaneWithBackGroundLabel; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; -import java.awt.BorderLayout; /** * 散点图标签界面 @@ -24,7 +21,8 @@ public class VanChartScatterLabelContentPane extends VanChartScatterTooltipCont return new VanChartHtmlLabelPaneWithBackGroundLabel(); } - public JPanel createCommonStylePane() { + //TODO Bjorn 散点图标签预定义样式 + /* public JPanel createCommonStylePane() { if (isInCondition()) { return super.createCommonStylePane(); } @@ -47,5 +45,5 @@ public class VanChartScatterLabelContentPane extends VanChartScatterTooltipCont attrTooltipContent.setCustom(true); } } - } + }*/ }