From ce9b3c71b0cdaf6f004417d957f3b3160c4fd2ef Mon Sep 17 00:00:00 2001 From: Maksim Date: Mon, 9 Dec 2019 15:49:45 +0800 Subject: [PATCH 001/375] =?UTF-8?q?=E5=BB=BA=E7=AB=8Bsocket=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=87=8D=E8=AF=95=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/socketio/DesignerSocketIO.java | 167 +++++++++++------- 1 file changed, 104 insertions(+), 63 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index e2b13b1ad..8ce0bdcec 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -13,7 +13,6 @@ import com.fr.report.RemoteDesignConstants; import com.fr.serialization.SerializerHelper; import com.fr.stable.ArrayUtils; import com.fr.third.apache.log4j.spi.LoggingEvent; -import com.fr.third.guava.base.Optional; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.base.WorkspaceConstants; @@ -36,28 +35,19 @@ public class DesignerSocketIO { Disconnecting } - private static Optional socketIO = Optional.absent(); + private static Socket socket = null; private static Status status = Status.Disconnected; + //维护一个当前工作环境的uri列表 + private static String[] uri; + //维护一个关于uri列表的计数器 + private static int count; - private static final Emitter.Listener printLog = new Emitter.Listener() { - @Override - public void call(Object... objects) { - if (ArrayUtils.isNotEmpty(objects)) { - try { - LoggingEvent event = SerializerHelper.deserialize((byte[]) objects[0]); - DesignerLogger.log(event); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - } - }; public static void close() { - if (socketIO.isPresent()) { + if (socket != null) { status = Status.Disconnecting; - socketIO.get().close(); - socketIO = Optional.absent(); + socket.close(); + socket = null; } } @@ -66,57 +56,42 @@ public class DesignerSocketIO { if (current.isLocal()) { return; } + //每当更换工作环境,更新uri列表,同时更新计数器count try { - String[] uri = getSocketUri(current); - socketIO = Optional.of(IO.socket(new URI(uri[0]))); - socketIO.get().on(WorkspaceConstants.WS_LOGRECORD, printLog); - socketIO.get().on(WorkspaceConstants.CONFIG_MODIFY, new Emitter.Listener() { - @Override - public void call(Object... objects) { - assert objects != null && objects.length == 1; - String param = (String) objects[0]; - EventDispatcher.fire(RemoteConfigEvent.EDIT, param); - } - }); - socketIO.get().on(Socket.EVENT_DISCONNECT, new Emitter.Listener() { - @Override - public void call(Object... objects) { - /* - * todo 远程心跳断开不一定 socketio 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, - * socketio 只用推日志和通知配置变更 - */ - if (status != Status.Disconnecting) { - try { - UIUtil.invokeAndWaitIfNeeded(new Runnable() { - @Override - public void run() { - JOptionPane.showMessageDialog( - DesignerContext.getDesignerFrame(), - Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), - UIManager.getString("OptionPane.messageDialogTitle"), - JOptionPane.ERROR_MESSAGE, - UIManager.getIcon("OptionPane.errorIcon")); - EnvChangeEntrance.getInstance().chooseEnv(); - } - }); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - status = Status.Disconnected; - } - }); - socketIO.get().connect(); - status = Status.Connected; + uri = getSocketUri(); + } catch (IOException e) { + e.printStackTrace(); + } + count = 0; + //建立socket并注册监听 + CreateSocket(); + } + + private static void CreateSocket(){ + //根据uri和计数器建立连接,并注册监听 + try { + if(count Date: Mon, 9 Dec 2019 16:39:15 +0800 Subject: [PATCH 002/375] return --- .../fr/design/mainframe/socketio/DesignerSocketIO.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 8ce0bdcec..92f7e9771 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -60,14 +60,14 @@ public class DesignerSocketIO { try { uri = getSocketUri(); } catch (IOException e) { - e.printStackTrace(); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } count = 0; //建立socket并注册监听 - CreateSocket(); + createSocket(); } - private static void CreateSocket(){ + private static void createSocket(){ //根据uri和计数器建立连接,并注册监听 try { if(count Date: Mon, 9 Dec 2019 16:40:25 +0800 Subject: [PATCH 003/375] =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/socketio/DesignerSocketIO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 92f7e9771..057eb6de9 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -138,7 +138,7 @@ public class DesignerSocketIO { @Override public void call(Object... objects) { /* - * todo 远程心跳断开不一定 socketio 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, + * todo 远程心跳断开不一定 socket 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, * socket 只用推日志和通知配置变更 */ if (status != Status.Disconnecting) { From 6ef9b8cdaf4d4614ba7ece787d02c660afafefa3 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 10 Jan 2020 14:09:05 +0800 Subject: [PATCH 004/375] =?UTF-8?q?MOBILE-24962=20&&=20MOBILE-24940=20?= =?UTF-8?q?=E5=90=88=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/FormMobileAttrAction.java | 6 ++++-- .../widget/ui/designer/mobile/BodyMobileDefinePane.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java index d77078fad..c6f64c498 100644 --- a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java @@ -77,8 +77,10 @@ public class FormMobileAttrAction extends JTemplateAction { formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后 ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent()); - //改变布局为自适应布局,只在移动端属性设置保存后改变一次 - doChangeBodyLayout(); + //当自适应属性自动匹配处于勾选状态 进行切换 + if (formMobileAttr.isMobileOnly() && formMobileAttr.isAdaptivePropertyAutoMatch()) { + doChangeBodyLayout(); + } WidgetPropertyPane.getInstance().refreshDockingView(); jf.fireTargetModified(); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/BodyMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/BodyMobileDefinePane.java index 3b8367b15..8327fc1ab 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/BodyMobileDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/BodyMobileDefinePane.java @@ -115,8 +115,9 @@ public class BodyMobileDefinePane extends MobileWidgetDefinePane { boolean flag = !shouldHidePadding(designer); advancePane.setVisible(flag); layoutPane.setVisible(flag); - frozenPane.setVisible(appRelayoutCheck.isSelected()); - bookMarkSettingPane.setVisible(appRelayoutCheck.isSelected()); + boolean appRelayout = FormDesignerUtils.isAppRelayout(designer); + frozenPane.setVisible(appRelayout); + bookMarkSettingPane.setVisible(appRelayout); return holder; } @@ -172,6 +173,7 @@ public class BodyMobileDefinePane extends MobileWidgetDefinePane { advancePane.setVisible(appPaddingVisible); layoutPane.setVisible(appPaddingVisible); frozenPane.setVisible(appRelayout); + bookMarkSettingPane.setVisible(appRelayout); mobileWidgetListPane.updateToDesigner(); designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED); From e5fd1dc1d1d3aaa5da43b434edcc55845f2153c2 Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 13 Jan 2020 14:20:58 +0800 Subject: [PATCH 005/375] =?UTF-8?q?REPORT-26263=20=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E7=9B=AE=E5=BD=95=E5=88=B0tomcat=EF=BC=8C?= =?UTF-8?q?=E6=94=BE=E7=BD=AE=E4=B8=80=E6=AE=B5=E6=97=B6=E9=97=B4=E5=88=87?= =?UTF-8?q?=E5=9B=9E=E6=9C=AC=E5=9C=B0=EF=BC=8C=E5=87=BA=E7=8E=B0=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=A4=B1=E8=B4=A5=E7=9A=84=E5=BC=B9=E7=AA=97=EF=BC=8C?= =?UTF-8?q?=E5=AE=9E=E9=99=85=E5=88=87=E6=8D=A2=E6=88=90=E5=8A=9F=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20npe=20=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/JForm.java | 8 ++++++-- .../com/fr/design/mainframe/JFormTest.java | 20 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 designer-form/src/test/java/com/fr/design/mainframe/JFormTest.java 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 a5b76e1fc..ab19002c1 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 @@ -543,8 +543,12 @@ public class JForm extends JTemplate implements BaseJForm Date: Tue, 14 Jan 2020 13:42:43 +0800 Subject: [PATCH 006/375] =?UTF-8?q?REPORT-26085=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/parameter/ParameterDefinitePane.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java index 168f65ece..7cf83e34e 100644 --- a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.base.Parameter; import com.fr.base.parameter.ParameterUI; import com.fr.base.vcs.DesignerMode; +import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; import com.fr.design.actions.AllowAuthorityEditAction; import com.fr.design.actions.ExitAuthorityEditAction; @@ -326,8 +327,8 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus } private boolean isWithoutParaXCreator() { - return paraDesignEditor.isWithoutParaXCreator(allParameters); - } + // allParameters只包含全部的模板参数 + return paraDesignEditor.isWithoutParaXCreator(DesignModelAdapter.getCurrentModelAdapter().getParameters()); } /** * get allParameters From 95200e200aeb9b54c5beb81d64e3a8198600fa4d Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 14 Jan 2020 13:44:16 +0800 Subject: [PATCH 007/375] fix --- .../java/com/fr/design/parameter/ParameterDefinitePane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java index 7cf83e34e..ea78f568f 100644 --- a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java @@ -328,7 +328,8 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus private boolean isWithoutParaXCreator() { // allParameters只包含全部的模板参数 - return paraDesignEditor.isWithoutParaXCreator(DesignModelAdapter.getCurrentModelAdapter().getParameters()); } + return paraDesignEditor.isWithoutParaXCreator(DesignModelAdapter.getCurrentModelAdapter().getParameters()); + } /** * get allParameters From 4d56944006ef9e650d568c69e1671b7eed5822a9 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 14 Jan 2020 15:10:43 +0800 Subject: [PATCH 008/375] =?UTF-8?q?MOBILE-24587=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/mobile/MobileAdvanceDefinePane.java | 3 +++ .../component/MobileComponentFrozenPane.java | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java index c74e7c7d0..9533e552c 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java @@ -139,6 +139,9 @@ public class MobileAdvanceDefinePane extends MobileWidgetDefinePane { MobileBookMark bookMark = xCreator.toData().getMobileBookMark(); bookMark.setUseBookMark(this.useBookMarkCheck.isSelected()); String newBookMarkName = this.bookMarkNameField.getText(); + if (ComparatorUtils.equals(newBookMarkName, bookMark.getBookMarkName())) { + return; + } if (!isExist(newBookMarkName)) { bookMark.setBookMarkName(newBookMarkName); } else { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java index da6c617c1..249265097 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java @@ -64,18 +64,26 @@ public class MobileComponentFrozenPane extends BasicPane { public void update(XCreator xCreator) { List selected = new ArrayList<>(); WSortLayout wSortLayout = ((WSortLayout) xCreator.toData()); + List all = wSortLayout.getNonContainerWidgetList(); + for (String widgetName : all) { + updateMobileBookMark(wSortLayout, widgetName, false); + } Object[] values = uiComboCheckBox.getSelectedValues(); for (Object value : values) { String widgetName = (String) value; selected.add(widgetName); - Widget widget = FormWidgetHelper.findWidgetWithBound(wSortLayout, widgetName); - if (widget != null) { - widget.getMobileBookMark().setFrozen(true); - } + updateMobileBookMark(wSortLayout, widgetName, true); } wSortLayout.updateFrozenWidgets(selected); } + private void updateMobileBookMark(WSortLayout wSortLayout, String widgetName, boolean frozen) { + Widget widget = FormWidgetHelper.findWidgetWithBound(wSortLayout, widgetName); + if (widget != null) { + widget.getMobileBookMark().setFrozen(frozen); + } + } + public void populate(XCreator xCreator) { WSortLayout wSortLayout = ((WSortLayout) xCreator.toData()); List all = wSortLayout.getNonContainerWidgetList(); From 03a8dd09dd24eb727912110c9d1b357a56641673 Mon Sep 17 00:00:00 2001 From: Harrison Date: Wed, 15 Jan 2020 12:56:19 +0800 Subject: [PATCH 009/375] =?UTF-8?q?REPORT-25778=20json=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=EF=BC=8C=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=E6=B6=88=E5=A4=B1=20=E6=8D=A2=E4=B8=80?= =?UTF-8?q?=E7=A7=8D=E5=A4=84=E7=90=86=E6=96=B9=E5=BC=8F=EF=BC=8C=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E9=9D=A2=E6=9D=BF=E4=BC=9A=E5=AF=BC=E8=87=B4=E5=90=84?= =?UTF-8?q?=E7=A7=8D=E8=AF=A1=E5=BC=82=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/TableDataTreePane.java | 13 +++++------ .../com/fr/design/mainframe/JTemplate.java | 13 +++++++++++ .../fr/design/mainframe/JTemplateFactory.java | 23 +++++++++++++++++++ 3 files changed, 42 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java index 7c8b1f46b..531e12848 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java @@ -16,9 +16,9 @@ import com.fr.design.data.tabledata.wrapper.AbstractTableDataWrapper; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.fun.TableDataDefineProvider; -import com.fr.design.dialog.FineJOptionPane; import com.fr.design.fun.TableDataPaneProcessor; import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.icontainer.UIScrollPane; @@ -168,23 +168,22 @@ public class TableDataTreePane extends BasicTableDataTreePane { //如果数据集插件禁用或启用。需要清空当前模板中的缓存 reloadCurrTemplate(); } - + private void reloadCurrTemplate() { JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (accept(jt)) { - HistoryTemplateListCache.getInstance().closeSelectedReport(jt); - DesignerContext.getDesignerFrame().openTemplate(jt.getEditingFILE()); + jt.refreshResource(); } } - + private boolean accept(JTemplate jt) { - + return jt != null && jt.getEditingFILE() != null && jt.getEditingFILE().exists(); } }, new PluginFilter() { @Override public boolean accept(PluginContext pluginContext) { - + return pluginContext.contain(TableDataDefineProvider.XML_TAG); } }); 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 c6da049bd..97df45c4a 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 @@ -243,6 +243,19 @@ public abstract class JTemplate> public void judgeSheetAuthority(String roles) { } + + /** + * 刷新内部资源 + */ + public void refreshResource() { + + try { + this.template = JTemplateFactory.asIOFile(this.editingFILE); + setTarget(this.template); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } /** * 刷新容器 diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java index c6a6f4a0d..8019cc178 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe; +import com.fr.base.io.BaseBook; import com.fr.file.FILE; import com.fr.stable.CoreConstants; import com.fr.third.javax.annotation.Nonnull; @@ -42,6 +43,28 @@ public final class JTemplateFactory { } return null; } + + public static T asIOFile(@Nonnull FILE file) { + + String fileName = file.getName(); + int indexOfLastDot = fileName.lastIndexOf(CoreConstants.DOT); + if (indexOfLastDot < 0) { + return null; + } + String fileExtension = fileName.substring(indexOfLastDot + 1); + for (App app : ALL_APP) { + String[] defaultAppExtensions = app.defaultExtensions(); + for (String defaultAppExtension : defaultAppExtensions) { + if (defaultAppExtension.equalsIgnoreCase(fileExtension)) { + BaseBook bb = app.asIOFile(file); + if (bb != null) { + return (T) bb; + } + } + } + } + return null; + } /** From 95c13712d7a3f3ef0268d3cee4f88152b841bfea Mon Sep 17 00:00:00 2001 From: ju Date: Fri, 21 Feb 2020 22:24:03 +0800 Subject: [PATCH 010/375] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20merge?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/JTemplate.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) 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 cadc71833..d9b8ab891 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 @@ -256,20 +256,7 @@ public abstract class JTemplate> FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - - /** - * 刷新内部资源 - */ - public void refreshResource() { - - try { - this.template = JTemplateFactory.asIOFile(this.editingFILE); - setTarget(this.template); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - + /** * 刷新容器 */ From a0995d1ddc84c15fe69e7db427800a4dcfdeb4a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 25 Feb 2020 18:57:40 +0800 Subject: [PATCH 011/375] =?UTF-8?q?CHART-12746=20=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 12 +- .../burying/point/AbstractPointCollector.java | 130 +++++++++ .../burying/point/AbstractPointInfo.java | 55 ++++ .../burying/point/BasePointCollector.java | 23 ++ .../burying/point/BasePointInfo.java | 35 +++ .../mainframe/chart/info/ChartInfo.java | 250 ++++++++++++++++++ .../chart/info/ChartInfoCollector.java | 248 +++++++++++++++++ .../mainframe/template/info/SendHelper.java | 29 +- .../mainframe/template/info/TemplateInfo.java | 65 ++--- .../template/info/TemplateInfoCollector.java | 158 ++--------- .../template/info/SendHelperTest.java | 9 +- .../info/TemplateInfoCollectorTest.java | 23 +- .../template/info/TemplateInfoTest.java | 22 +- .../java/com/fr/design/chart/ChartDialog.java | 23 +- .../com/fr/design/chart/ChartTypePane.java | 7 + .../design/mainframe/chart/ChartEditPane.java | 41 +-- .../chart/gui/ChartTypeButtonPane.java | 8 +- .../type/AbstractVanChartTypePane.java | 3 + .../mainframe/FormCreatorDropTarget.java | 32 ++- .../actions/insert/flot/ChartFloatAction.java | 69 +++-- .../mainframe/InformationCollector.java | 4 +- .../poly/hanlder/PolyDesignerDropTarget.java | 65 +++-- 22 files changed, 1003 insertions(+), 308 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointInfo.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.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 d9b8ab891..482b0d337 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 @@ -36,6 +36,7 @@ import com.fr.design.gui.imenu.UIMenuItem; 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.template.info.TemplateInfoCollector; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.template.info.TimeConsumeTimer; @@ -70,11 +71,11 @@ import javax.swing.JComponent; import javax.swing.JOptionPane; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.undo.UndoManager; -import java.awt.BorderLayout; import java.util.ArrayList; import java.util.Arrays; import java.util.Set; import java.util.regex.Pattern; +import java.awt.BorderLayout; /** * 报表设计和表单设计的编辑区域(设计器编辑的IO文件) @@ -164,6 +165,7 @@ public abstract class JTemplate> } private void collectInfo(String originID) { // 执行收集操作 + ChartInfoCollector.getInstance().collectInfo(template.getTemplateID(), originID, getProcessInfo(), 0); if (!consumeTimer.isEnabled()) { return; } @@ -243,12 +245,12 @@ public abstract class JTemplate> public void judgeSheetAuthority(String roles) { } - + /** * 刷新内部资源 */ public void refreshResource() { - + try { this.template = JTemplateFactory.asIOFile(this.editingFILE); setTarget(this.template); @@ -256,7 +258,7 @@ public abstract class JTemplate> FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - + /** * 刷新容器 */ @@ -1233,7 +1235,7 @@ public abstract class JTemplate> public abstract String route(); - public String getTemplateName(){ + public String getTemplateName() { return getEditingFILE().getName(); } 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 new file mode 100644 index 000000000..a3665b77b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java @@ -0,0 +1,130 @@ +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.xml.XMLPrintWriter; +import com.fr.stable.xml.XMLTools; +import com.fr.stable.xml.XMLableReader; +import com.fr.third.javax.xml.stream.XMLStreamException; +import com.fr.third.org.apache.commons.io.FileUtils; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +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 { + + protected Map pointInfoMap; + + private static final int MAX_SIZE = 512 * 1024 * 1024; + + public AbstractPointCollector() { + pointInfoMap = new ConcurrentHashMap<>(); + loadFromFile(); + } + + /** + * 获取是否满足触发埋点的要求 + */ + protected boolean shouldCollectInfo() { + 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(); + } + + /** + * 从文件中读取埋点信息 + */ + protected void loadFromFile() { + if (!getInfoFile().exists()) { + return; + } + + XMLableReader reader = null; + try (InputStream in = new FileInputStream(getInfoFile())) { + // XMLableReader 还是应该考虑实现 Closable 接口的,这样就能使用 try-with 语句了 + reader = XMLReadHelper.createXMLableReader(in, XMLPrintWriter.XML_ENCODER); + if (reader == null) { + return; + } + reader.readXMLObject(this); + } catch (FileNotFoundException e) { + // do nothing + } catch (XMLStreamException | IOException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } finally { + try { + if (reader != null) { + reader.close(); + } + } catch (XMLStreamException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } + + /** + * 保存埋点信息到文件中 + */ + protected void saveInfo() { + try { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + XMLTools.writeOutputStreamXML(this, out); + out.flush(); + out.close(); + String fileContent = new String(out.toByteArray(), StandardCharsets.UTF_8); + FileUtils.writeStringToFile(getInfoFile(), fileContent, StandardCharsets.UTF_8); + } catch (Exception ex) { + FineLoggerFactory.getLogger().error(ex.getMessage()); + } + } + + /** + * 获取缓存文件存放路径 + */ + protected abstract File getInfoFile(); + + protected abstract void addIdleDayCount(); +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java new file mode 100644 index 000000000..6646bfd09 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java @@ -0,0 +1,55 @@ +package com.fr.design.mainframe.burying.point; + +import java.util.List; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-02-21 + */ +public abstract class AbstractPointInfo implements BasePointInfo { + + protected int idleDayCount; // 到现在为止,埋点闲置的天数 + + @Override + public void resetIdleDayCount() { + this.idleDayCount = 0; + } + + @Override + public void addIdleDayCountByOne() { + this.idleDayCount += 1; + } + + /** + * 上传前判断该埋点,是否需要被上传,或者删除,或者什么都不做。 + */ + @Override + public void selectPoint(List removeList, List sendList) { + //埋点还未完成,直接返回 + if (!isComplete()) { + return; + } + //属于测试模板,直接删除,否则发送信息 + if (isTestTemplate()) { + removeList.add(key()); + } else { + sendList.add(key()); + } + } + + /** + * 是否为测试模板 + */ + protected abstract boolean isTestTemplate(); + + /** + * 是否已经制作完成 + */ + protected abstract boolean isComplete(); + + /** + * 埋点记录的主键 + */ + protected abstract String key(); +} 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 new file mode 100644 index 000000000..f10f1682e --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java @@ -0,0 +1,23 @@ +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; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-02-21 + */ +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/burying/point/BasePointInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointInfo.java new file mode 100644 index 000000000..b45f1cb6a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointInfo.java @@ -0,0 +1,35 @@ +package com.fr.design.mainframe.burying.point; + +import com.fr.stable.xml.XMLReadable; +import com.fr.stable.xml.XMLWriter; + +import java.util.List; +import java.util.Map; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-02-21 + */ +public interface BasePointInfo extends XMLReadable, XMLWriter { + + /** + * 重置埋点的未编辑天数 + */ + void resetIdleDayCount(); + + /** + * 增加一天埋点的未编辑天数 + */ + void addIdleDayCountByOne(); + + /** + * 上传前判断该埋点,是否需要被上传,或者删除,或者什么都不做。 + */ + void selectPoint(List removeList, List sendList); + + /** + * 获取要上传的内容,key→上传路径,value→上传内容 + */ + Map getSendInfo(); +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java new file mode 100644 index 000000000..9d305ef1d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java @@ -0,0 +1,250 @@ +package com.fr.design.mainframe.chart.info; + +import com.fr.base.io.BaseBook; +import com.fr.config.MarketConfig; +import com.fr.design.DesignModelAdapter; +import com.fr.design.DesignerEnvManager; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.mainframe.burying.point.AbstractPointInfo; +import com.fr.general.CloudCenter; +import com.fr.general.GeneralUtils; +import com.fr.json.JSONObject; +import com.fr.stable.ProductConstants; +import com.fr.stable.StringUtils; +import com.fr.stable.xml.XMLPrintWriter; +import com.fr.stable.xml.XMLableReader; +import com.fr.third.joda.time.DateTime; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-02-17 + */ +public class ChartInfo extends AbstractPointInfo { + public static final String XML_TAG = "ChartInfo"; + private static final String CHART_CONSUMING_URL = CloudCenter.getInstance().acquireUrlByKind("chartinfo.consuming") + "/single"; + + + private static final String XML_CHART_CONSUMING_MAP = "chartConsumingMap"; + private static final String ATTR_TEST_TEMPLATE = "testTemplate"; + private static final String ATTR_DAY_COUNT = "day_count"; + private static final String ATTR_USERNAME = "username"; + private static final String ATTR_UUID = "uuid"; + private static final String ATTR_ACTIVITYKEY = "activityKey"; + private static final String ATTR_TEMPLATE_ID = "templateID"; + private static final String ATTR_REPORT_TYPE = "type"; + private static final String ATTR_CHART_ID = "chartId"; + private static final String ATTR_CHART_TYPE = "chartType"; + private static final String ATTR_CHART_CREATE_TIME = "chartCreateTime"; + private static final String ATTR_CHART_TYPE_TIME = "chartTypeTime"; + private static final String ATTR_CHART_PROPERTY_FIRST_TIME = "chartPropertyFirstTime"; + private static final String ATTR_CHART_PROPERTY_END_TIME = "chartPropertyEndTime"; + private static final String ATTR_JAR_TIME = "jarTime"; + private static final String ATTR_VERSION = "version"; + + private static final int COMPLETE_DAY_COUNT = 3; // 判断图表是否可以上传的天数 + + private String chartId = StringUtils.EMPTY; + + private String templateId = StringUtils.EMPTY; + + private Map chartConsumingMap = new HashMap<>(); + + private BaseBook book; + + private boolean testTemplate; + + private ChartInfo() { + } + + private ChartInfo(String chartId, String templateId, BaseBook book) { + this.chartId = chartId; + this.templateId = templateId; + this.book = book; + } + + public String getChartId() { + return chartId; + } + + @Override + protected String key() { + return chartId; + } + + public String getTemplateId() { + return templateId; + } + + public void setTemplateId(String templateId) { + this.templateId = templateId; + this.chartConsumingMap.put(ATTR_TEMPLATE_ID, templateId); + } + + + public BaseBook getBook() { + return book; + } + + @Override + public boolean isTestTemplate() { + return testTemplate; + } + + public void setTestTemplate(boolean testTemplate) { + this.testTemplate = testTemplate; + } + + static ChartInfo newInstanceByRead(XMLableReader reader) { + ChartInfo chartInfo = new ChartInfo(); + reader.readXMLObject(chartInfo); + return chartInfo; + } + + public static ChartInfo newInstance(String chartId, String chartType) { + return newInstance(chartId, chartType, null); + } + + public static ChartInfo newInstance(String chartId, String chartType, String createTime) { + HashMap chartConsumingMap = new HashMap<>(); + + String username = MarketConfig.getInstance().getBbsUsername(); + String uuid = DesignerEnvManager.getEnvManager().getUUID(); + String activityKey = DesignerEnvManager.getEnvManager().getActivationKey(); + + BaseBook book = DesignModelAdapter.getCurrentModelAdapter().getBook(); + String templateId = book.getTemplateID(); + int reportType = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getProcessInfo().getReportType(); + + String typeTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); + + createTime = createTime == null ? typeTime : createTime; + + String jarTime = GeneralUtils.readBuildNO(); + String version = ProductConstants.VERSION; + chartConsumingMap.put(ATTR_USERNAME, username); + chartConsumingMap.put(ATTR_UUID, uuid); + chartConsumingMap.put(ATTR_ACTIVITYKEY, activityKey); + chartConsumingMap.put(ATTR_TEMPLATE_ID, templateId); + chartConsumingMap.put(ATTR_REPORT_TYPE, String.valueOf(reportType)); + chartConsumingMap.put(ATTR_CHART_ID, chartId); + chartConsumingMap.put(ATTR_CHART_TYPE, chartType); + chartConsumingMap.put(ATTR_CHART_CREATE_TIME, createTime); + chartConsumingMap.put(ATTR_CHART_TYPE_TIME, typeTime); + chartConsumingMap.put(ATTR_CHART_PROPERTY_FIRST_TIME, ""); + chartConsumingMap.put(ATTR_CHART_PROPERTY_END_TIME, ""); + chartConsumingMap.put(ATTR_JAR_TIME, jarTime); + chartConsumingMap.put(ATTR_VERSION, version); + + ChartInfo chartInfo = new ChartInfo(chartId, templateId, book); + chartInfo.chartConsumingMap = chartConsumingMap; + + return chartInfo; + } + + @Override + public void writeXML(XMLPrintWriter writer) { + writer.startTAG(XML_TAG); + if (StringUtils.isNotEmpty(chartId)) { + writer.attr(ATTR_CHART_ID, this.chartId); + } + if (StringUtils.isNotEmpty(templateId)) { + writer.attr(ATTR_TEMPLATE_ID, this.templateId); + } + if (idleDayCount >= 0) { + writer.attr(ATTR_DAY_COUNT, this.idleDayCount); + } + writer.attr(ATTR_TEST_TEMPLATE, this.testTemplate); + writer.startTAG(XML_CHART_CONSUMING_MAP); + writer.attr(ATTR_USERNAME, chartConsumingMap.get(ATTR_USERNAME)); + writer.attr(ATTR_UUID, chartConsumingMap.get(ATTR_UUID)); + writer.attr(ATTR_ACTIVITYKEY, chartConsumingMap.get(ATTR_ACTIVITYKEY)); + writer.attr(ATTR_REPORT_TYPE, chartConsumingMap.get(ATTR_REPORT_TYPE)); + writer.attr(ATTR_CHART_TYPE, chartConsumingMap.get(ATTR_CHART_TYPE)); + writer.attr(ATTR_CHART_CREATE_TIME, chartConsumingMap.get(ATTR_CHART_CREATE_TIME)); + writer.attr(ATTR_CHART_TYPE_TIME, chartConsumingMap.get(ATTR_CHART_TYPE_TIME)); + writer.attr(ATTR_CHART_PROPERTY_FIRST_TIME, chartConsumingMap.get(ATTR_CHART_PROPERTY_FIRST_TIME)); + writer.attr(ATTR_CHART_PROPERTY_END_TIME, chartConsumingMap.get(ATTR_CHART_PROPERTY_END_TIME)); + writer.attr(ATTR_JAR_TIME, chartConsumingMap.get(ATTR_JAR_TIME)); + writer.attr(ATTR_VERSION, chartConsumingMap.get(ATTR_VERSION)); + writer.end(); + writer.end(); + } + + @Override + public void readXML(XMLableReader reader) { + + if (!reader.isChildNode()) { + idleDayCount = reader.getAttrAsInt(ATTR_DAY_COUNT, 0); + chartId = reader.getAttrAsString(ATTR_CHART_ID, StringUtils.EMPTY); + templateId = reader.getAttrAsString(ATTR_TEMPLATE_ID, StringUtils.EMPTY); + testTemplate = reader.getAttrAsBoolean(ATTR_TEST_TEMPLATE, true); + } else { + String name = reader.getTagName(); + if (XML_CHART_CONSUMING_MAP.equals(name)) { + chartConsumingMap.put(ATTR_USERNAME, reader.getAttrAsString(ATTR_USERNAME, StringUtils.EMPTY)); + chartConsumingMap.put(ATTR_UUID, reader.getAttrAsString(ATTR_UUID, StringUtils.EMPTY)); + chartConsumingMap.put(ATTR_ACTIVITYKEY, reader.getAttrAsString(ATTR_ACTIVITYKEY, StringUtils.EMPTY)); + chartConsumingMap.put(ATTR_TEMPLATE_ID, templateId); + chartConsumingMap.put(ATTR_REPORT_TYPE, reader.getAttrAsString(ATTR_REPORT_TYPE, "0")); + chartConsumingMap.put(ATTR_CHART_ID, chartId); + chartConsumingMap.put(ATTR_CHART_TYPE, reader.getAttrAsString(ATTR_CHART_TYPE, StringUtils.EMPTY)); + chartConsumingMap.put(ATTR_CHART_CREATE_TIME, reader.getAttrAsString(ATTR_CHART_CREATE_TIME, StringUtils.EMPTY)); + chartConsumingMap.put(ATTR_CHART_TYPE_TIME, reader.getAttrAsString(ATTR_CHART_TYPE_TIME, StringUtils.EMPTY)); + chartConsumingMap.put(ATTR_CHART_PROPERTY_FIRST_TIME, reader.getAttrAsString(ATTR_CHART_PROPERTY_FIRST_TIME, StringUtils.EMPTY)); + chartConsumingMap.put(ATTR_CHART_PROPERTY_END_TIME, reader.getAttrAsString(ATTR_CHART_PROPERTY_END_TIME, StringUtils.EMPTY)); + chartConsumingMap.put(ATTR_JAR_TIME, reader.getAttrAsString(ATTR_JAR_TIME, StringUtils.EMPTY)); + chartConsumingMap.put(ATTR_VERSION, reader.getAttrAsString(ATTR_VERSION, "8.0")); + } + } + } + + @Override + public boolean isComplete() { + // 连续3天打开了设计器但是没有编辑 + return idleDayCount > COMPLETE_DAY_COUNT; + } + + @Override + public Map getSendInfo() { + Map sendMap = new HashMap<>(); + sendMap.put(CHART_CONSUMING_URL, new JSONObject(chartConsumingMap).toString()); + return sendMap; + } + + public void updatePropertyTime() { + String propertyTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); + + if (StringUtils.isEmpty(chartConsumingMap.get(ATTR_CHART_PROPERTY_FIRST_TIME))) { + chartConsumingMap.put(ATTR_CHART_PROPERTY_FIRST_TIME, propertyTime); + } + chartConsumingMap.put(ATTR_CHART_PROPERTY_END_TIME, propertyTime); + } + + public void updateChartType(String chartType) { + String typeTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); + + chartConsumingMap.put(ATTR_CHART_TYPE_TIME, typeTime); + chartConsumingMap.put(ATTR_CHART_TYPE, chartType); + chartConsumingMap.put(ATTR_CHART_PROPERTY_FIRST_TIME, ""); + chartConsumingMap.put(ATTR_CHART_PROPERTY_END_TIME, ""); + } + + @Override + public ChartInfo clone() { + ChartInfo chartInfo = new ChartInfo(); + chartInfo.chartId = this.chartId; + chartInfo.idleDayCount = this.idleDayCount; + chartInfo.templateId = this.templateId; + chartInfo.testTemplate = this.testTemplate; + Map chartConsumingMap = new HashMap<>(); + for (Map.Entry entry : this.chartConsumingMap.entrySet()) { + chartConsumingMap.put(entry.getKey(), entry.getValue()); + } + chartInfo.chartConsumingMap = chartConsumingMap; + return chartInfo; + } +} 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 new file mode 100644 index 000000000..d622c688a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java @@ -0,0 +1,248 @@ +package com.fr.design.mainframe.chart.info; + +import com.fr.base.io.BaseBook; +import com.fr.chartx.attr.ChartProvider; +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; +import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.vanchart.VanChart; +import com.fr.stable.ProductConstants; +import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; +import com.fr.stable.xml.XMLPrintWriter; +import com.fr.stable.xml.XMLableReader; +import com.fr.third.joda.time.DateTime; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-02-18 + */ +public class ChartInfoCollector extends AbstractPointCollector { + private static final String XML_TAG = "ChartInfoCollector"; + private static final String XML_LAST_EDIT_DAY = "lastEditDay"; + + private static final String XML_CHART_INFO_LIST = "ChartInfoList"; + private static final String XML_FILE_NAME = "chart.info"; + + private static ChartInfoCollector instance; + + private Map chartInfoCacheMap; + + private String lastEditDay; + + private ChartInfoCollector() { + init(); + } + + private void init() { + chartInfoCacheMap = new HashMap<>(); + } + + public static ChartInfoCollector getInstance() { + if (instance == null) { + instance = new ChartInfoCollector(); + } + return instance; + } + + public void collection(ChartProvider chartProvider, String createTime) { + if (chartProvider instanceof VanChart) { + VanChart vanChart = (VanChart) chartProvider; + collection(vanChart.getUuid(), vanChart.getID(), createTime); + } + } + + /** + * 新建图表,保存状态 + */ + public void collection(String chartId, String chartType, String createTime) { + if (!shouldCollectInfo()) { + return; + } + + ChartInfo chartInfo = ChartInfo.newInstance(chartId, chartType, createTime); + chartInfoCacheMap.put(chartId, chartInfo); + } + + public void updateChartPropertyTime(ChartProvider chartProvider) { + if (chartProvider instanceof VanChart) { + VanChart vanChart = (VanChart) chartProvider; + updateChartPropertyTime(vanChart.getUuid(), vanChart.getID()); + } + } + + /** + * 图表编辑,更新编辑时间 + */ + public void updateChartPropertyTime(String chartId, String chartType) { + if (!shouldCollectInfo()) { + return; + } + ChartInfo chartInfo = getOrCreateChartInfo(chartId, chartType); + + //更新编辑时间 + chartInfo.updatePropertyTime(); + + //重置计数 + chartInfo.resetIdleDayCount(); + } + + public void updateChartTypeTime(ChartProvider chartProvider) { + if (chartProvider instanceof VanChart) { + VanChart vanChart = (VanChart) chartProvider; + updateChartTypeTime(vanChart.getUuid(), vanChart.getID()); + } + } + + /** + * 图表类型变化,更新类型和类型确认时间 + */ + public void updateChartTypeTime(String chartId, String chartType) { + if (!shouldCollectInfo()) { + return; + } + + ChartInfo chartInfo = getOrCreateChartInfo(chartId, chartType); + + //更新类型确认时间和类型 + chartInfo.updateChartType(chartType); + + //重置计数 + chartInfo.resetIdleDayCount(); + } + + private ChartInfo getOrCreateChartInfo(String chartId, String chartType) { + //缓存中有从缓存中拿 + if (chartInfoCacheMap.containsKey(chartId)) { + return chartInfoCacheMap.get(chartId); + } + //缓存中没有从文件中读取的信息中拷贝到缓存 + if (pointInfoMap.containsKey(chartId)) { + ChartInfo chartInfo = pointInfoMap.get(chartId).clone(); + chartInfoCacheMap.put(chartId, chartInfo); + return chartInfo; + } + //都有的话创建一个并加入到缓存中 + ChartInfo chartInfo = ChartInfo.newInstance(chartId, chartType); + chartInfoCacheMap.put(chartId, chartInfo); + return chartInfo; + } + + /** + * 保存模板的时候将该模板中的图表埋点信息保存 + */ + @Override + public void collectInfo(String templateId, String originID, TemplateProcessInfo processInfo, int timeConsume) { + if (!shouldCollectInfo()) { + return; + } + if (StringUtils.isEmpty(originID)) { + originID = templateId; + } + boolean testTemplate = isTestTemplate(processInfo); + + for (ChartInfo chartInfo : pointInfoMap.values()) { + if (originID.equals(chartInfo.getTemplateId())) { + chartInfo.setTemplateId(templateId); + chartInfo.setTestTemplate(testTemplate); + } + } + + for (ChartInfo chartInfo : chartInfoCacheMap.values()) { + BaseBook book = chartInfo.getBook(); + if ((book != null && templateId.equals(book.getTemplateID())) || + originID.equals(chartInfo.getTemplateId())) { + chartInfo.setTemplateId(templateId); + chartInfo.setTestTemplate(testTemplate); + pointInfoMap.put(chartInfo.getChartId(), chartInfo); + } + } + + // 每次更新之后,都同步到暂存文件中 + saveInfo(); + } + + private boolean isTestTemplate(TemplateProcessInfo processInfo) { + int reportType = processInfo.getReportType(); + int cellCount = processInfo.getCellCount(); + int floatCount = processInfo.getFloatCount(); + int blockCount = processInfo.getBlockCount(); + int widgetCount = processInfo.getWidgetCount(); + + return TemplateInfo.isTestTemplate(reportType, cellCount, floatCount, blockCount, widgetCount); + } + + /** + * 更新 day_count:打开设计器却未编辑图表的连续日子 + */ + @Override + protected void addIdleDayCount() { + // 判断今天是否第一次打开设计器,为了防止同一天内,多次 addIdleDayCount + String today = DateTime.now().toString("yyyy-MM-dd"); + if (ComparatorUtils.equals(today, lastEditDay)) { + return; + } + for (ChartInfo chartInfo : pointInfoMap.values()) { + chartInfo.addIdleDayCountByOne(); + } + lastEditDay = today; + } + + + /** + * 获取缓存文件存放路径 + */ + @Override + protected File getInfoFile() { + File file = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), XML_FILE_NAME)); + try { + if (!file.exists()) { + file.createNewFile(); + } + } catch (Exception ex) { + FineLoggerFactory.getLogger().error(ex.getMessage(), ex); + } + return file; + } + + @Override + public void readXML(XMLableReader reader) { + if (reader.isChildNode()) { + try { + String name = reader.getTagName(); + if (ChartInfo.XML_TAG.equals(name)) { + ChartInfo chartInfo = ChartInfo.newInstanceByRead(reader); + pointInfoMap.put(chartInfo.getChartId(), chartInfo); + } else if (XML_LAST_EDIT_DAY.equals(name)) { + lastEditDay = reader.getElementValue(); + } + } catch (Exception ex) { + // 什么也不做,使用默认值 + } + } + } + + @Override + public void writeXML(XMLPrintWriter writer) { + writer.startTAG(XML_TAG); + + writer.startTAG(XML_LAST_EDIT_DAY); + writer.textNode(lastEditDay); + writer.end(); + + writer.startTAG(XML_CHART_INFO_LIST); + for (ChartInfo chartInfo : pointInfoMap.values()) { + chartInfo.writeXML(writer); + } + writer.end(); + + writer.end(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/SendHelper.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/SendHelper.java index db489fb3c..694389f30 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/SendHelper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/SendHelper.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.template.info; import com.fr.design.mainframe.SiteCenterToken; -import com.fr.general.CloudCenter; +import com.fr.design.mainframe.burying.point.BasePointInfo; import com.fr.general.ComparatorUtils; import com.fr.general.http.HttpToolbox; import com.fr.json.JSONObject; @@ -14,23 +14,20 @@ import java.util.Map; * 负责向服务器发送信息 * Created by plough on 2019/4/18. */ -class SendHelper { - private static final String CONSUMING_URL = CloudCenter.getInstance().acquireUrlByKind("tempinfo.consuming") + "/single"; - private static final String PROCESS_URL = CloudCenter.getInstance().acquireUrlByKind("tempinfo.process") + "/single"; - - private static boolean sendConsumingInfo(String content) { - return sendSingleTemplateInfo(CONSUMING_URL, content); - } - - private static boolean sendProcessInfo(String content) { - return sendSingleTemplateInfo(PROCESS_URL, content); - } - - static boolean sendTemplateInfo(TemplateInfo templateInfo) { - return SendHelper.sendConsumingInfo(templateInfo.getConsumingMapJsonString()) && SendHelper.sendProcessInfo(templateInfo.getProcessMapJsonString()); +public class SendHelper { + + public static boolean sendPointInfo(BasePointInfo pointInfo) { + boolean success = true; + Map sendInfo = pointInfo.getSendInfo(); + for (Map.Entry entry : sendInfo.entrySet()) { + if (!sendSinglePointInfo(entry.getKey(), entry.getValue())) { + success = false; + } + } + return success; } - private static boolean sendSingleTemplateInfo(String url, String content) { + private static boolean sendSinglePointInfo(String url, String content) { Map 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/TemplateInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java index 900210bd0..e233bc6e5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java @@ -2,13 +2,13 @@ package com.fr.design.mainframe.template.info; import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.burying.point.AbstractPointInfo; +import com.fr.general.CloudCenter; import com.fr.general.GeneralUtils; import com.fr.json.JSONObject; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; -import com.fr.stable.xml.XMLReadable; -import com.fr.stable.xml.XMLWriter; import com.fr.stable.xml.XMLableReader; import java.text.SimpleDateFormat; @@ -20,9 +20,12 @@ import java.util.Map; * 对应一张模版的记录 * Created by plough on 2019/4/18. */ -class TemplateInfo implements XMLReadable, XMLWriter { +public class TemplateInfo extends AbstractPointInfo { static final String XML_TAG = "TemplateInfo"; + private static final String CONSUMING_URL = CloudCenter.getInstance().acquireUrlByKind("tempinfo.consuming") + "/single"; + private static final String PROCESS_URL = CloudCenter.getInstance().acquireUrlByKind("tempinfo.process") + "/single"; + private static final String XML_PROCESS_MAP = "processMap"; private static final String XML_CONSUMING_MAP = "consumingMap"; private static final String ATTR_DAY_COUNT = "day_count"; @@ -47,7 +50,6 @@ class TemplateInfo implements XMLReadable, XMLWriter { private static final int VALID_WIDGET_COUNT = 5; // 有效报表模板的控件数 private static final int COMPLETE_DAY_COUNT = 15; // 判断模板是否完成的天数 - private int idleDayCount; // 到现在为止,模版闲置(上次保存后没有再编辑过)的天数 private String templateID = StringUtils.EMPTY; private String originID = StringUtils.EMPTY; // todo: processMap 和 consumingMap 还可以再拆解为小类,以后继续重构 @@ -62,17 +64,22 @@ class TemplateInfo implements XMLReadable, XMLWriter { this.originID = originID; } - static TemplateInfo newInstanceByRead(XMLableReader reader) { + @Override + protected String key() { + return templateID; + } + + public static TemplateInfo newInstanceByRead(XMLableReader reader) { TemplateInfo templateInfo = new TemplateInfo(); reader.readXMLObject(templateInfo); return templateInfo; } - static TemplateInfo newInstance(String templateID) { + public static TemplateInfo newInstance(String templateID) { return newInstance(templateID, StringUtils.EMPTY, 0); } - static TemplateInfo newInstance(String templateID, String originID, int originTime) { + public static TemplateInfo newInstance(String templateID, String originID, int originTime) { HashMap consumingMap = new HashMap<>(); String username = MarketConfig.getInstance().getBbsUsername(); @@ -107,9 +114,10 @@ class TemplateInfo implements XMLReadable, XMLWriter { } int getTimeConsume() { - return (int)consumingMap.get(ATTR_TIME_CONSUME); + return (int) consumingMap.get(ATTR_TIME_CONSUME); } + @Override public void writeXML(XMLPrintWriter writer) { writer.startTAG(XML_TAG); if (StringUtils.isNotEmpty(templateID)) { @@ -144,13 +152,14 @@ class TemplateInfo implements XMLReadable, XMLWriter { writer.attr(ATTR_JAR_TIME, (String) consumingMap.get(ATTR_JAR_TIME)); writer.attr(ATTR_CREATE_TIME, (String) consumingMap.get(ATTR_CREATE_TIME)); writer.attr(ATTR_UUID, (String) consumingMap.get(ATTR_UUID)); - writer.attr(ATTR_TIME_CONSUME, (int)consumingMap.get(ATTR_TIME_CONSUME)); - writer.attr(ATTR_ORIGIN_TIME, (int)consumingMap.get(ATTR_ORIGIN_TIME)); + writer.attr(ATTR_TIME_CONSUME, (int) consumingMap.get(ATTR_TIME_CONSUME)); + writer.attr(ATTR_ORIGIN_TIME, (int) consumingMap.get(ATTR_ORIGIN_TIME)); writer.attr(ATTR_VERSION, (String) consumingMap.get(ATTR_VERSION)); writer.attr(ATTR_USERNAME, (String) consumingMap.get(ATTR_USERNAME)); writer.end(); } + @Override public void readXML(XMLableReader reader) { if (!reader.isChildNode()) { idleDayCount = reader.getAttrAsInt(ATTR_DAY_COUNT, 0); @@ -185,7 +194,8 @@ class TemplateInfo implements XMLReadable, XMLWriter { } } - boolean isTestTemplate() { + @Override + protected boolean isTestTemplate() { if (!isComplete()) { return false; } @@ -195,6 +205,10 @@ class TemplateInfo implements XMLReadable, XMLWriter { int floatCount = (int) processMap.get(ATTR_FLOAT_COUNT); int blockCount = (int) processMap.get(ATTR_BLOCK_COUNT); int widgetCount = (int) processMap.get(ATTR_WIDGET_COUNT); + return isTestTemplate(reportType, cellCount, floatCount, blockCount, widgetCount); + } + + public static boolean isTestTemplate(int reportType, int cellCount, int floatCount, int blockCount, int widgetCount) { boolean isTestTemplate; if (reportType == 0) { // 普通报表 isTestTemplate = cellCount <= VALID_CELL_COUNT && floatCount <= 1 && widgetCount <= VALID_WIDGET_COUNT; @@ -206,7 +220,8 @@ class TemplateInfo implements XMLReadable, XMLWriter { return isTestTemplate; } - boolean isComplete() { + @Override + protected boolean isComplete() { // 条件 1. 超过15天未编辑 // 条件 2. 设计器在这段未编辑的时间内启动超过 X 次(目前定的 X = 3)。即"设计器最近 X 次启动的时间跨度" < "未编辑时间"; @@ -214,20 +229,16 @@ class TemplateInfo implements XMLReadable, XMLWriter { && DesignerOpenHistory.getInstance().isOpenEnoughTimesInPeriod(idleDayCount); } - String getConsumingMapJsonString() { - return new JSONObject(consumingMap).toString(); - } - - String getProcessMapJsonString() { - return new JSONObject(processMap).toString(); - } - - boolean isReadyForSend() { - return isComplete() && !isTestTemplate(); + @Override + public Map getSendInfo() { + Map sendMap = new HashMap<>(); + sendMap.put(CONSUMING_URL, new JSONObject(consumingMap).toString()); + sendMap.put(PROCESS_URL, new JSONObject(processMap).toString()); + return sendMap; } void addTimeConsume(int timeConsume) { - timeConsume += (int)consumingMap.get(ATTR_TIME_CONSUME); // 加上之前的累计编辑时间 + timeConsume += (int) consumingMap.get(ATTR_TIME_CONSUME); // 加上之前的累计编辑时间 consumingMap.put(ATTR_TIME_CONSUME, timeConsume); } @@ -246,14 +257,6 @@ class TemplateInfo implements XMLReadable, XMLWriter { this.processMap = processMap; } - void resetIdleDayCount() { - this.idleDayCount = 0; - } - - void addIdleDayCountByOne() { - this.idleDayCount += 1; - } - int getIdleDayCount() { return this.idleDayCount; } 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 9a13ed9d7..8c4e7f18d 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,54 +1,26 @@ package com.fr.design.mainframe.template.info; -import com.fr.base.FRContext; -import com.fr.base.io.XMLReadHelper; -import com.fr.design.DesignerEnvManager; -import com.fr.log.FineLoggerFactory; +import com.fr.design.mainframe.burying.point.AbstractPointCollector; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; -import com.fr.stable.xml.XMLReadable; -import com.fr.stable.xml.XMLTools; -import com.fr.stable.xml.XMLWriter; import com.fr.stable.xml.XMLableReader; -import com.fr.third.javax.xml.stream.XMLStreamException; -import com.fr.third.org.apache.commons.io.FileUtils; -import java.io.ByteArrayOutputStream; import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** * 做模板的过程和耗时收集,辅助类 * Created by plough on 2017/2/21. */ -public class TemplateInfoCollector implements XMLReadable, XMLWriter { +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"; private static TemplateInfoCollector instance; - private static final int MAX_SIZE = 512 * 1024 * 1024; - private Map templateInfoMap; private DesignerOpenHistory designerOpenHistory; private TemplateInfoCollector() { - init(); - } - - private void init() { - templateInfoMap = new HashMap<>(); - designerOpenHistory = DesignerOpenHistory.getInstance(); - - loadFromFile(); } public static TemplateInfoCollector getInstance() { @@ -62,17 +34,19 @@ public class TemplateInfoCollector implements XMLReadable, XMLWriter { * 根据模板ID是否在收集列表中,判断是否需要收集当前模板的信息 */ public boolean contains(String templateID) { - return StringUtils.isNotEmpty(templateID) && templateInfoMap.containsKey(templateID); + return StringUtils.isNotEmpty(templateID) && pointInfoMap.containsKey(templateID); } /** * 收集模板信息。如果之前没有记录,则新增;如果已有记录,则更新。 * 同时将最新数据保存到文件中。 - * @param templateID 模版id - * @param originID 模版的原始id,仅对另存为的模版有效,对于非另存为的模版,值总是为空 + * + * @param templateID 模版id + * @param originID 模版的原始id,仅对另存为的模版有效,对于非另存为的模版,值总是为空 * @param processInfo 包含模版的一些基本信息(如模版类型、包含控件数量等) * @param timeConsume 本次制作耗时,单位为 s */ + @Override public void collectInfo(String templateID, String originID, TemplateProcessInfo processInfo, int timeConsume) { if (!shouldCollectInfo()) { return; @@ -80,11 +54,11 @@ public class TemplateInfoCollector implements XMLReadable, XMLWriter { TemplateInfo templateInfo; if (this.contains(templateID)) { - templateInfo = templateInfoMap.get(templateID); + templateInfo = pointInfoMap.get(templateID); } else { - int originTime = this.contains(originID) ? templateInfoMap.get(originID).getTimeConsume() : 0; + int originTime = this.contains(originID) ? pointInfoMap.get(originID).getTimeConsume() : 0; templateInfo = TemplateInfo.newInstance(templateID, originID, originTime); - templateInfoMap.put(templateID, templateInfo); + pointInfoMap.put(templateID, templateInfo); } // 收集制作耗时 @@ -98,137 +72,51 @@ public class TemplateInfoCollector implements XMLReadable, XMLWriter { saveInfo(); } - /** - * 发送本地模板信息到服务器,并清空已发送模版的本地记录 - */ - public void sendTemplateInfo() { - // 每次启动设计器后,都会执行这个函数(被 InformationCollector 的 collectStartTime 调用) - addIdleDayCount(); - - removeTestTemplates(); - - List removeLaterList = new ArrayList<>(); - - for (String key : templateInfoMap.keySet()) { - TemplateInfo templateInfo = templateInfoMap.get(key); - if (templateInfo.isReadyForSend()) { - if (SendHelper.sendTemplateInfo(templateInfo)) { - removeLaterList.add(key); - } - } - } - - // 清空记录 - for (String key : removeLaterList) { - removeFromTemplateInfoList(key); - } - - saveInfo(); - } - /** * 获取缓存文件存放路径 */ - private static File getInfoFile() { + @Override + protected File getInfoFile() { return new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), XML_FILE_NAME)); } - void loadFromFile() { - if (!getInfoFile().exists()) { - return; - } - - XMLableReader reader = null; - try (InputStream in = new FileInputStream(getInfoFile())) { - // XMLableReader 还是应该考虑实现 Closable 接口的,这样就能使用 try-with 语句了 - reader = XMLReadHelper.createXMLableReader(in, XMLPrintWriter.XML_ENCODER); - reader.readXMLObject(this); - } catch (FileNotFoundException e) { - // do nothing - } catch (XMLStreamException | IOException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } finally { - try { - if (reader != null) { - reader.close(); - } - } catch (XMLStreamException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - } - TemplateInfo getOrCreateTemplateInfoByID(String templateID) { - if (templateInfoMap.containsKey(templateID)) { - return templateInfoMap.get(templateID); + if (pointInfoMap.containsKey(templateID)) { + return pointInfoMap.get(templateID); } TemplateInfo templateInfo = TemplateInfo.newInstance(templateID); - templateInfoMap.put(templateID, templateInfo); + pointInfoMap.put(templateID, templateInfo); return templateInfo; } - private boolean shouldCollectInfo() { - return FileUtils.sizeOf(getInfoFile()) <= MAX_SIZE && DesignerEnvManager.getEnvManager().isJoinProductImprove() && FRContext.isChineseEnv(); - } - - /** - * 将包含所有信息的对象保存到文件 - */ - private void saveInfo() { - try { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - XMLTools.writeOutputStreamXML(this, out); - out.flush(); - out.close(); - String fileContent = new String(out.toByteArray(), StandardCharsets.UTF_8); - FileUtils.writeStringToFile(getInfoFile(), fileContent, StandardCharsets.UTF_8); - } catch (Exception ex) { - FineLoggerFactory.getLogger().error(ex.getMessage()); - } - } - /** * 更新 day_count:打开设计器却未编辑模板的连续日子 */ - private void addIdleDayCount() { + @Override + protected void addIdleDayCount() { // 判断今天是否第一次打开设计器,为了防止同一天内,多次 addIdleDayCount if (designerOpenHistory.hasOpenedToday()) { return; } - for (TemplateInfo templateInfo : templateInfoMap.values()) { + for (TemplateInfo templateInfo : pointInfoMap.values()) { templateInfo.addIdleDayCountByOne(); } designerOpenHistory.update(); } - // 删除所有已完成的测试模版 - private void removeTestTemplates() { - ArrayList testTemplateKeys = new ArrayList<>(); // 保存测试模板的key - for (String key : templateInfoMap.keySet()) { - if (templateInfoMap.get(key).isTestTemplate()) { - testTemplateKeys.add(key); - } - } - // 删除测试模板 - for (String key : testTemplateKeys) { - removeFromTemplateInfoList(key); - } - } - - private void removeFromTemplateInfoList(String key) { - templateInfoMap.remove(key); - } - @Override public void readXML(XMLableReader reader) { if (reader.isChildNode()) { try { String name = reader.getTagName(); if (DesignerOpenHistory.XML_TAG.equals(name)) { + if (designerOpenHistory == null) { + designerOpenHistory = DesignerOpenHistory.getInstance(); + } reader.readXMLObject(designerOpenHistory); } else if (TemplateInfo.XML_TAG.equals(name)) { TemplateInfo templateInfo = TemplateInfo.newInstanceByRead(reader); - templateInfoMap.put(templateInfo.getTemplateID(), templateInfo); + pointInfoMap.put(templateInfo.getTemplateID(), templateInfo); } } catch (Exception ex) { // 什么也不做,使用默认值 @@ -243,7 +131,7 @@ public class TemplateInfoCollector implements XMLReadable, XMLWriter { designerOpenHistory.writeXML(writer); writer.startTAG(XML_TEMPLATE_INFO_LIST); - for (TemplateInfo templateInfo : templateInfoMap.values()) { + for (TemplateInfo templateInfo : pointInfoMap.values()) { templateInfo.writeXML(writer); } writer.end(); diff --git a/designer-base/src/test/java/com/fr/design/mainframe/template/info/SendHelperTest.java b/designer-base/src/test/java/com/fr/design/mainframe/template/info/SendHelperTest.java index fb89143d8..8da46557c 100644 --- a/designer-base/src/test/java/com/fr/design/mainframe/template/info/SendHelperTest.java +++ b/designer-base/src/test/java/com/fr/design/mainframe/template/info/SendHelperTest.java @@ -1,10 +1,12 @@ package com.fr.design.mainframe.template.info; import com.fr.invoke.Reflect; +import com.fr.json.JSONObject; import com.fr.stable.xml.XMLableReader; import com.fr.third.javax.xml.stream.XMLStreamException; import java.io.StringReader; +import java.util.Map; import static org.junit.Assert.assertTrue; @@ -25,11 +27,12 @@ public class SendHelperTest { StringReader sr = new StringReader(NORMAL_INFO); XMLableReader xmlReader = XMLableReader.createXMLableReader(sr); TemplateInfo templateInfo = TemplateInfo.newInstanceByRead(xmlReader); - - boolean res = Reflect.on(SendHelper.class).call("sendSingleTemplateInfo", CONSUMING_URL, templateInfo.getConsumingMapJsonString()).get(); + Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); + Map processMap = Reflect.on(templateInfo).field("processMap").get(); + boolean res = Reflect.on(SendHelper.class).call("sendSinglePointInfo", CONSUMING_URL, new JSONObject(consumingMap).toString()).get(); assertTrue(res); - boolean res2 = Reflect.on(SendHelper.class).call("sendSingleTemplateInfo", PROCESS_URL, templateInfo.getProcessMapJsonString()).get(); + boolean res2 = Reflect.on(SendHelper.class).call("sendSinglePointInfo", PROCESS_URL, new JSONObject(processMap).toString()).get(); assertTrue(res2); } } diff --git a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java index d93a7476a..3235473c6 100644 --- a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java +++ b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.template.info; import com.fr.config.MarketConfig; import com.fr.general.GeneralUtils; import com.fr.invoke.Reflect; +import com.fr.json.JSONObject; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.third.org.apache.commons.io.FileUtils; @@ -71,7 +72,7 @@ public class TemplateInfoCollectorTest { assertEquals(",,", DesignerOpenHistory.getInstance().toString()); TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); - assertEquals(7, ((Map) Reflect.on(collector).field("templateInfoMap").get()).size()); + assertEquals(7, ((Map) Reflect.on(collector).field("pointInfoMap").get()).size()); assertEquals("2019-04-08,2019-04-03,2019-03-29", DesignerOpenHistory.getInstance().toString()); } @@ -86,18 +87,21 @@ public class TemplateInfoCollectorTest { collector.collectInfo(templateID, StringUtils.EMPTY, mockProcessInfo, timeConsume); // 检查是否写入成功 - collector.loadFromFile(); + Reflect.on(collector).call("loadFromFile"); TemplateInfo templateInfo = collector.getOrCreateTemplateInfoByID(templateID); + Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); + Map processMap = Reflect.on(templateInfo).field("processMap").get(); + assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + "\"cell_count\":13,\"block_count\":3,\"report_type\":0," + - "\"templateID\":\"16a988ce-8529-42f5-b17c-2ee849355071\"}", templateInfo.getProcessMapJsonString()); + "\"templateID\":\"16a988ce-8529-42f5-b17c-2ee849355071\"}", new JSONObject(processMap).toString()); assertJsonStringEquals("{\"activitykey\":\"2e0ea413-fa9c241e0-9723-4354fce51e81\"," + "\"jar_time\":\"不是安装版本\",\"create_time\":\"2019-03-26 16:13\"," + "\"templateID\":\"16a988ce-8529-42f5-b17c-2ee849355071\",\"originID\":\"\"," + "\"uuid\":\"476ca2cc-f789-4c5d-8e89-ef146580775c\",\"time_consume\":329,\"originTime\":0," + - "\"version\":\"10.0\",\"username\":\"plough\"}", templateInfo.getConsumingMapJsonString()); + "\"version\":\"10.0\",\"username\":\"plough\"}", new JSONObject(consumingMap).toString()); } @Test @@ -112,15 +116,17 @@ public class TemplateInfoCollectorTest { collector.collectInfo(templateID, StringUtils.EMPTY, mockProcessInfo, timeConsume); // 检查是否写入成功 - collector.loadFromFile(); + Reflect.on(collector).call("loadFromFile"); assertTrue(collector.contains(templateID)); TemplateInfo templateInfo = collector.getOrCreateTemplateInfoByID(templateID); + Map processMap = Reflect.on(templateInfo).field("processMap").get(); + assertEquals(templateID, templateInfo.getTemplateID()); assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + "\"cell_count\":13,\"block_count\":3,\"report_type\":0," + - "\"templateID\":\"73a97777-8jnk-47cd-b57c-2ee89991279796\"}", templateInfo.getProcessMapJsonString()); + "\"templateID\":\"73a97777-8jnk-47cd-b57c-2ee89991279796\"}", new JSONObject(processMap).toString()); Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); assertEquals(templateID, consumingMap.get("templateID")); @@ -142,12 +148,13 @@ public class TemplateInfoCollectorTest { collector.collectInfo(templateID, originID, mockProcessInfo, timeConsume); // 检查是否写入成功 - collector.loadFromFile(); + Reflect.on(collector).call("loadFromFile"); TemplateInfo templateInfo = collector.getOrCreateTemplateInfoByID(templateID); + Map processMap = Reflect.on(templateInfo).field("processMap").get(); assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + "\"cell_count\":13,\"block_count\":3,\"report_type\":0," + - "\"templateID\":\"423238d4-5223-22vj-vlsj-42jc49245iw3\"}", templateInfo.getProcessMapJsonString()); + "\"templateID\":\"423238d4-5223-22vj-vlsj-42jc49245iw3\"}", new JSONObject(processMap).toString()); Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); assertEquals(templateID, consumingMap.get("templateID")); diff --git a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java index 426dba3b1..7f0ddd0bc 100644 --- a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java +++ b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.template.info; import com.fr.config.MarketConfig; import com.fr.general.GeneralUtils; import com.fr.invoke.Reflect; +import com.fr.json.JSONObject; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLableReader; @@ -55,7 +56,6 @@ public class TemplateInfoTest { assertEquals(templateID, templateInfo.getTemplateID()); assertEquals(StringUtils.EMPTY, Reflect.on(templateInfo).field("originID").get()); assertEquals(0, (int) Reflect.on(templateInfo).field("idleDayCount").get()); - assertEquals("{}", templateInfo.getProcessMapJsonString()); Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); assertEquals(templateID, consumingMap.get("templateID")); @@ -78,7 +78,6 @@ public class TemplateInfoTest { assertEquals(templateID, templateInfo.getTemplateID()); assertEquals(originID, Reflect.on(templateInfo).field("originID").get()); assertEquals(0, (int) Reflect.on(templateInfo).field("idleDayCount").get()); - assertEquals("{}", templateInfo.getProcessMapJsonString()); Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); assertEquals(templateID, consumingMap.get("templateID")); @@ -97,24 +96,25 @@ public class TemplateInfoTest { } @Test - public void testGetConsumingMapJsonString() { + public void testGetSendInfo() { + + Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); + Map processMap = Reflect.on(templateInfo).field("processMap").get(); + Map consumingMap1 = Reflect.on(templateInfoSaveAs).field("consumingMap").get(); + Map processMap1 = Reflect.on(templateInfoSaveAs).field("processMap").get(); assertJsonStringEquals("{\"activitykey\":\"2e0ea413-fa9c241e0-9723-4354fce51e81\",\"jar_time\":\"不是安装版本\"," + "\"create_time\":\"2019-03-26 16:13\",\"templateID\":\"16a988ce-8529-42f5-b17c-2ee849355071\",\"originID\":\"\"," + "\"uuid\":\"476ca2cc-f789-4c5d-8e89-ef146580775c\",\"time_consume\":129,\"originTime\":0,\"version\":\"10.0\"," + - "\"username\":\"plough\"}", templateInfo.getConsumingMapJsonString()); + "\"username\":\"plough\"}", new JSONObject(consumingMap).toString()); assertJsonStringEquals("{\"activitykey\":\"2e0ea413-fa9c241e0-9723-4354fce51e81\",\"jar_time\":\"不是安装版本\"," + "\"create_time\":\"2019-03-26 16:13\",\"templateID\":\"49avd2c4-1104-92j2-wx24-3dd0k2136080\",\"originID\":\"16a988ce-8529-42f5-b17c-2ee849355071\"," + "\"uuid\":\"476ca2cc-f789-4c5d-8e89-ef146580775c\",\"time_consume\":429,\"originTime\":129,\"version\":\"10.0\"," + - "\"username\":\"plough\"}", templateInfoSaveAs.getConsumingMapJsonString()); - } - - @Test - public void testGetProcessMapJsonString() { + "\"username\":\"plough\"}", new JSONObject(consumingMap1).toString()); assertJsonStringEquals("{\"process\":\"\",\"float_count\":0,\"widget_count\":0,\"cell_count\":1," + - "\"block_count\":0,\"report_type\":0,\"templateID\":\"16a988ce-8529-42f5-b17c-2ee849355071\"}", templateInfo.getProcessMapJsonString()); + "\"block_count\":0,\"report_type\":0,\"templateID\":\"16a988ce-8529-42f5-b17c-2ee849355071\"}", new JSONObject(processMap).toString()); assertJsonStringEquals("{\"process\":\"\",\"float_count\":0,\"widget_count\":0,\"cell_count\":1," + - "\"block_count\":0,\"report_type\":0,\"templateID\":\"49avd2c4-1104-92j2-wx24-3dd0k2136080\"}", templateInfoSaveAs.getProcessMapJsonString()); + "\"block_count\":0,\"report_type\":0,\"templateID\":\"49avd2c4-1104-92j2-wx24-3dd0k2136080\"}", new JSONObject(processMap1).toString()); } private TemplateInfo createTemplateInfo(String xmlContent) throws XMLStreamException { diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java index a7dd9f564..623271873 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java @@ -1,5 +1,14 @@ package com.fr.design.chart; +import com.fr.base.chart.BaseChartCollection; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.gui.chart.MiddleChartDialog; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.third.joda.time.DateTime; + +import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Dialog; import java.awt.FlowLayout; @@ -7,16 +16,6 @@ import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.JPanel; - -import com.fr.base.chart.BaseChartCollection; -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.gui.chart.MiddleChartDialog; -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.dialog.BasicDialog; - -import com.fr.design.utils.gui.GUICoreUtils; - /** * 封装一层 图表新建的对话框, 配合属性表确定: 先单独只要一种图表类型的对话框. * @author kunsnat E-mail:kunsnat@gmail.com @@ -40,6 +39,8 @@ public class ChartDialog extends MiddleChartDialog { } private void initComponent() { + final String createTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); + this.setModal(true); this.setLayout(new BorderLayout()); final ChartTypePane chartTypePane = new ChartTypePane(); @@ -63,7 +64,7 @@ public class ChartDialog extends MiddleChartDialog { ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - chartTypePane.update((ChartCollection)cc); + chartTypePane.update((ChartCollection)cc, createTime); doOK(); } }); diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java index 19c613785..2bb9a99f2 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java @@ -9,6 +9,7 @@ import com.fr.chartx.attr.ChartProvider; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -119,6 +120,10 @@ public class ChartTypePane extends ChartCommonWizardPane { } public void update(ChartCollection cc) { + update(cc, null); + } + + public void update(ChartCollection cc, String createTime) { if (cc == null) { return; } @@ -130,6 +135,8 @@ public class ChartTypePane extends ChartCommonWizardPane { try { chart4Update = (ChartProvider) chart.clone(); cc.addChart(chart4Update); + //记录埋点 + ChartInfoCollector.getInstance().collection(chart4Update, createTime); } catch (CloneNotSupportedException ex) { FineLoggerFactory.getLogger().error(ex.getMessage(), ex); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java index a2d824f51..ecdb1212e 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java @@ -19,6 +19,7 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartOtherPane; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartTypePane; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.vanchart.VanChart; @@ -26,13 +27,13 @@ import com.fr.plugin.chart.vanchart.VanChart; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.BorderLayout; -import java.awt.CardLayout; import java.util.ArrayList; import java.util.Calendar; import java.util.List; +import java.awt.BorderLayout; +import java.awt.CardLayout; -public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4DataSourceChange, ChartEditPaneProvider { +public class ChartEditPane extends BasicPane implements AttributeChange, Prepare4DataSourceChange, ChartEditPaneProvider { private final static int CHANGE_MIN_TIME = 80; @@ -107,6 +108,9 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 return; } AbstractChartAttrPane selectedPane = paneList.get(tabsHeaderIconPane.getSelectedIndex()); + //图表配置变化,埋点记录 + ChartInfoCollector.getInstance().updateChartPropertyTime(collection.getSelectedChartProvider(ChartProvider.class)); + selectedPane.update(collection); if (!ComparatorUtils.equals(collection, lastCollection)) { @@ -122,7 +126,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error("error in clone ChartEditPane"); } - if(ComparatorUtils.equals(selectedPane.title4PopupWindow(),PaneTitleConstants.CHART_STYLE_TITLE)){ + if (ComparatorUtils.equals(selectedPane.title4PopupWindow(), PaneTitleConstants.CHART_STYLE_TITLE)) { dealWithStyleChange(); } @@ -138,10 +142,11 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 /** * 重新构造面板 + * * @param currentChart 图表 */ public void reLayout(ChartProvider currentChart) { - if(currentChart != null){ + if (currentChart != null) { int chartIndex = getSelectedChartIndex(currentChart); this.removeAll(); this.setLayout(new BorderLayout()); @@ -151,18 +156,18 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 String chartID = currentChart.getID(); boolean isDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(chartID); - if(isDefault){ + if (isDefault) { paneList.add(dataPane4SupportCell); paneList.add(stylePane); paneList.add(otherPane); this.isDefaultPane = true; - }else{ + } else { ChartDataPane chartDataPane = createChartDataPane(chartID); if (chartDataPane != null) { paneList.add(chartDataPane); } AbstractChartAttrPane[] otherPaneList = ChartTypeInterfaceManager.getInstance().getAttrPaneArray(chartID, listener); - for(int i = 0; i < otherPaneList.length; i++){ + for (int i = 0; i < otherPaneList.length; i++) { otherPaneList[i].addAttributeChangeListener(listener); paneList.add(otherPaneList[i]); } @@ -235,7 +240,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 if (checkNeedsReLayout(chartProvider)) { String chartID = chartProvider.getID(); if ("WaferChipChart".equals(chartID) || "BoxPlotChart".equals(chartID)) { - reLayout((Chart)chartProvider); + reLayout((Chart) chartProvider); } else { reLayout(chartProvider); } @@ -266,10 +271,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 public int getSelectedChartIndex(ChartProvider chart) { int index = 0; - if(typePane != null){ + if (typePane != null) { FurtherBasicBeanPane[] paneList = typePane.getPaneList(); - for(; index < paneList.length; index++){ - if(paneList[index].accept(chart)){ + for (; index < paneList.length; index++) { + if (paneList[index].accept(chart)) { return index; } } @@ -279,7 +284,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 //populate的时候看看要不要重构面板 private boolean checkNeedsReLayout(ChartProvider chart) { - if(chart != null){ + if (chart != null) { int lastIndex = typePane.getSelectedIndex(); int currentIndex = getSelectedChartIndex(chart); String chartID = chart.getID(); @@ -292,9 +297,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 /** * 当前界面是否是默认的界面 + * * @return 是否是默认的界面 */ - public boolean isDefaultPane(){ + public boolean isDefaultPane() { return this.isDefaultPane; } @@ -326,15 +332,16 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 } } - protected void dealWithStyleChange(){ + protected void dealWithStyleChange() { } /** - *主要用于图表设计器,判断样式改变是否来自工具栏的全局样式按钮 + * 主要用于图表设计器,判断样式改变是否来自工具栏的全局样式按钮 + * * @param isFromToolBar 是否来自工具栏 */ - public void styleChange(boolean isFromToolBar){ + public void styleChange(boolean isFromToolBar) { } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 8877ed9da..766b13397 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -6,6 +6,7 @@ import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chartx.attr.ChartProvider; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.dialog.DialogActionListener; import com.fr.design.dialog.UIDialog; import com.fr.design.event.UIObserver; @@ -25,6 +26,9 @@ import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JPanel; import javax.swing.SwingUtilities; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Set; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; @@ -41,9 +45,6 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Set; /** * 图表 类型 增删 控制按钮界面. @@ -151,6 +152,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen try { ChartProvider newChart = (ChartProvider) chart.clone(); editingCollection.addNamedChart(name, newChart); + ChartInfoCollector.getInstance().collection(newChart, null); } catch (CloneNotSupportedException e1) { FineLoggerFactory.getLogger().error("Error in Clone"); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index b8550e0d4..1a0953266 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -12,6 +12,7 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.MultilineLabel; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.ChartImagePane; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.general.Background; import com.fr.js.NameJavaScriptGroup; import com.fr.log.FineLoggerFactory; @@ -105,6 +106,8 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane 0 ? (grid.getWidth() - floatWdith) : 0; - int topDifference = (grid.getHeight() - floatHeight) > 0 ? (grid.getHeight() - floatHeight) : 0; - FU evtX_fu = FU.valueOfPix((leftDifference) / 2, resolution); - FU evtY_fu = FU.valueOfPix((topDifference) / 2, resolution); - - FU leftDistance = FU.getInstance(evtX_fu.toFU() + columnWidthList.getRangeValue(0, horizentalScrollValue).toFU()); - FU topDistance = FU.getInstance(evtY_fu.toFU() + rowHeightList.getRangeValue(0, verticalScrollValue).toFU()); - - newFloatElement.setLeftDistance(leftDistance); - newFloatElement.setTopDistance(topDistance); - - Style style = newFloatElement.getStyle(); - if (style != null) { - newFloatElement.setStyle(style.deriveBorder(Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black)); - } - reportPane.getEditingElementCase().addFloatElement(newFloatElement); - reportPane.setSelection(new FloatSelection(newFloatElement.getName())); - reportPane.fireSelectionChangeListener(); - } catch (CloneNotSupportedException e) { - FineLoggerFactory.getLogger().error("Error in Float"); + newFloatElement = new FloatElement(chartDialog.getChartCollection()); + newFloatElement.setWidth(new OLDPIX(BaseChartCollection.CHART_DEFAULT_WIDTH)); + newFloatElement.setHeight(new OLDPIX(BaseChartCollection.CHART_DEFAULT_HEIGHT)); + + Grid grid = reportPane.getGrid(); + TemplateElementCase report = reportPane.getEditingElementCase(); + DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report); + DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report); + int horizentalScrollValue = grid.getHorizontalValue(); + int verticalScrollValue = grid.getVerticalValue(); + + int resolution = grid.getResolution(); + int floatWdith = newFloatElement.getWidth().toPixI(resolution); + int floatHeight = newFloatElement.getWidth().toPixI(resolution); + + int leftDifference = (grid.getWidth() - floatWdith) > 0 ? (grid.getWidth() - floatWdith) : 0; + int topDifference = (grid.getHeight() - floatHeight) > 0 ? (grid.getHeight() - floatHeight) : 0; + FU evtX_fu = FU.valueOfPix((leftDifference) / 2, resolution); + FU evtY_fu = FU.valueOfPix((topDifference) / 2, resolution); + + FU leftDistance = FU.getInstance(evtX_fu.toFU() + columnWidthList.getRangeValue(0, horizentalScrollValue).toFU()); + FU topDistance = FU.getInstance(evtY_fu.toFU() + rowHeightList.getRangeValue(0, verticalScrollValue).toFU()); + + newFloatElement.setLeftDistance(leftDistance); + newFloatElement.setTopDistance(topDistance); + + Style style = newFloatElement.getStyle(); + if (style != null) { + newFloatElement.setStyle(style.deriveBorder(Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black)); } + reportPane.getEditingElementCase().addFloatElement(newFloatElement); + reportPane.setSelection(new FloatSelection(newFloatElement.getName())); + reportPane.fireSelectionChangeListener(); } }); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java index 62d1d4a3e..b4b43cafd 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java @@ -7,6 +7,7 @@ import com.fr.base.FRContext; import com.fr.concurrent.NamedThreadFactory; import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.mainframe.errorinfo.ErrorInfoUploader; import com.fr.design.mainframe.messagecollect.impl.FocusPointMessageUploader; import com.fr.design.mainframe.messagecollect.solid.SolidCollector; @@ -234,7 +235,8 @@ public class InformationCollector implements XMLReadable, XMLWriter { SolidCollector.getInstance().sendToCloudCenterAndDeleteFile(); sendUserInfo(); FocusPointMessageUploader.getInstance().sendToCloudCenter(); - TemplateInfoCollector.getInstance().sendTemplateInfo(); + TemplateInfoCollector.getInstance().sendPointInfo(); + ChartInfoCollector.getInstance().sendPointInfo(); ErrorInfoUploader.getInstance().sendErrorInfo(); } }, SEND_DELAY, TimeUnit.MILLISECONDS); diff --git a/designer-realize/src/main/java/com/fr/poly/hanlder/PolyDesignerDropTarget.java b/designer-realize/src/main/java/com/fr/poly/hanlder/PolyDesignerDropTarget.java index c92142960..c87523720 100644 --- a/designer-realize/src/main/java/com/fr/poly/hanlder/PolyDesignerDropTarget.java +++ b/designer-realize/src/main/java/com/fr/poly/hanlder/PolyDesignerDropTarget.java @@ -6,13 +6,18 @@ package com.fr.poly.hanlder; import com.fr.base.ScreenResolution; import com.fr.base.chart.BaseChartCollection; import com.fr.base.vcs.DesignerMode; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.chartx.attr.ChartProvider; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.grid.Grid; import com.fr.log.FineLoggerFactory; import com.fr.poly.PolyDesigner; import com.fr.poly.PolyUtils; import com.fr.poly.creator.BlockCreator; +import com.fr.poly.creator.ChartBlockCreator; import com.fr.poly.model.AddingData; +import com.fr.report.poly.PolyChartBlock; import com.fr.stable.unit.UnitRectangle; import javax.swing.JScrollBar; @@ -31,10 +36,10 @@ import java.awt.dnd.DropTargetEvent; * @since 6.5.4 创建于2011-4-1 */ public class PolyDesignerDropTarget extends DropTargetAdapter { - + private static final double SCROLL_POINT = 100; private static final int SCROLL_DISTANCE = 15; - + private PolyDesigner designer; private AddingData addingData; private int resolution = ScreenResolution.getScreenResolution(); @@ -48,9 +53,9 @@ public class PolyDesignerDropTarget extends DropTargetAdapter { /** * 拖拽进入事件 - * + * * @param dtde 鼠标事件 - * + * */ public void dragEnter(DropTargetDragEvent dtde) { @@ -93,9 +98,9 @@ public class PolyDesignerDropTarget extends DropTargetAdapter { /** * 拖拽悬浮事件 - * + * * @param dtde 鼠标事件 - * + * */ public void dragOver(DropTargetDragEvent dtde) { if (addingData != null) { @@ -105,14 +110,14 @@ public class PolyDesignerDropTarget extends DropTargetAdapter { setForbiddenWindowVisibility(loc); //检测是否到达角落 scrollWhileDropCorner(dtde); - + designer.repaint(); } } - + private void scrollWhileDropCorner(final DropTargetDragEvent dtde){ Thread tt = new Thread(new Runnable() { - + @Override public void run() { Point location = dtde.getLocation(); @@ -121,23 +126,23 @@ public class PolyDesignerDropTarget extends DropTargetAdapter { JScrollBar horizonBar = designer.getHorizontalScrollBar(); horizonBar.setValue(horizonBar.getValue() + SCROLL_DISTANCE); } - + if(location.y> designer.getHeight() - SCROLL_POINT){ JScrollBar verticalBar = designer.getVerticalScrollBar(); verticalBar.setValue(verticalBar.getValue() + SCROLL_DISTANCE); } - + } }); tt.start(); } - + //设置是否显示 禁止组件重叠 窗口 private void setForbiddenWindowVisibility(Point loc){ BlockCreator creator = addingData.getCreator(); Rectangle pixRec = getCreatorPixRectangle(creator, loc); UnitRectangle rec = new UnitRectangle(pixRec, resolution); - + if(designer.intersectsAllBlock(rec, creator.getValue().getBlockName())){ int x = (int) (designer.getAreaLocationX() + pixRec.getCenterX() - designer.getHorizontalValue()); int y = (int) (designer.getAreaLocationY() + pixRec.getCenterY() - designer.getVerticalValue()); @@ -149,9 +154,9 @@ public class PolyDesignerDropTarget extends DropTargetAdapter { /** * 放下事件 - * + * * @param dtde 鼠标事件 - * + * */ public void drop(DropTargetDropEvent dtde) { if (addingData != null) { @@ -162,8 +167,10 @@ public class PolyDesignerDropTarget extends DropTargetAdapter { if(!intersectLocation(pixRec, creator)){ return; } - + designer.addBlockCreator(creator); + //图表埋点 + dealChartBuryingPoint(creator); designer.stopEditing(); designer.setSelection(creator); //在重新设置了选择之后,要对菜单和工具进行target的重新设置 @@ -174,7 +181,7 @@ public class PolyDesignerDropTarget extends DropTargetAdapter { addingData = null; } } - + //聚焦选中块 private void focusOnSelection(){ if (designer.getSelection().getEditingElementCasePane() == null) { @@ -185,7 +192,7 @@ public class PolyDesignerDropTarget extends DropTargetAdapter { grid.requestFocus(); } } - + //检测新加入的creator位置是否与老的重叠, 重叠返回false private boolean intersectLocation(Rectangle pixRec, BlockCreator creator){ if (pixRec.getX() < 0 || pixRec.getY() < 0) { @@ -200,12 +207,12 @@ public class PolyDesignerDropTarget extends DropTargetAdapter { designer.repaint(); return false; } - + creator.getValue().setBounds(rec); - + return true; } - + private Rectangle getCreatorPixRectangle(BlockCreator creator, Point location){ int width = creator.getWidth(); int height = creator.getHeight(); @@ -216,17 +223,25 @@ public class PolyDesignerDropTarget extends DropTargetAdapter { /** * 拖拽移出去事件 - * + * * @param dte 拖拽事件 - * + * */ public void dragExit(DropTargetEvent dte) { if (addingData != null) { addingData.reset(); designer.repaint(); } - + forbiddenWindow.hideWindow(); } - + + private void dealChartBuryingPoint(BlockCreator creator) { + if (creator instanceof ChartBlockCreator) { + PolyChartBlock value = ((ChartBlockCreator) creator).getValue(); + ChartCollection chartCollection = (ChartCollection) value.getChartCollection(); + ChartInfoCollector.getInstance().collection(chartCollection.getSelectedChartProvider(ChartProvider.class), null); + } + } + } \ No newline at end of file From 633dd6dbdafc4c45e34126e3ee46055fc6c27662 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 26 Feb 2020 11:24:21 +0800 Subject: [PATCH 012/375] =?UTF-8?q?MOBILE-25615=20=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/FormMobileAttrAction.java | 18 +++++++++++++++--- .../mobile/FormMobileTemplateSettingsPane.java | 4 +--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java index d77078fad..63cb6a606 100644 --- a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java @@ -56,6 +56,9 @@ public class FormMobileAttrAction extends JTemplateAction { final FormMobileAttrPane mobileAttrPane = new FormMobileAttrPane(); mobileAttrPane.populateBean(mobileAttr); + + final boolean oldMobileOnly = mobileAttr.isMobileOnly(); + final boolean oldAdaptive = mobileAttr.isAdaptivePropertyAutoMatch(); BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { @@ -75,11 +78,16 @@ public class FormMobileAttrAction extends JTemplateAction { recordFunction(); // 设置移动端属性并刷新界面 formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后 - ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); + boolean changeSize = (!oldMobileOnly && formMobileAttr.isMobileOnly()) || (oldMobileOnly && !formMobileAttr.isMobileOnly()); + if (changeSize) { + ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); + } jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent()); //改变布局为自适应布局,只在移动端属性设置保存后改变一次 - doChangeBodyLayout(); - + boolean changeLayout = !oldAdaptive && formMobileAttr.isAdaptivePropertyAutoMatch(); + if (changeLayout) { + doChangeBodyLayout(); + } WidgetPropertyPane.getInstance().refreshDockingView(); jf.fireTargetModified(); } @@ -87,6 +95,10 @@ public class FormMobileAttrAction extends JTemplateAction { dialog.setVisible(true); } + private boolean isAttrChange(boolean oldValue, boolean newValue) { + return !oldValue && newValue; + } + private void doChangeBodyLayout(){ FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); XLayoutContainer rootLayout = formDesigner.getRootComponent(); diff --git a/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java b/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java index 21f6d3b09..2eac9c586 100644 --- a/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java +++ b/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java @@ -47,9 +47,7 @@ public class FormMobileTemplateSettingsPane extends BasicBeanPane Date: Wed, 26 Feb 2020 11:25:39 +0800 Subject: [PATCH 013/375] fix --- .../main/java/com/fr/design/actions/FormMobileAttrAction.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java index 63cb6a606..b387cbc70 100644 --- a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java @@ -95,10 +95,6 @@ public class FormMobileAttrAction extends JTemplateAction { dialog.setVisible(true); } - private boolean isAttrChange(boolean oldValue, boolean newValue) { - return !oldValue && newValue; - } - private void doChangeBodyLayout(){ FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); XLayoutContainer rootLayout = formDesigner.getRootComponent(); From 8d6934d504d37e96813f3b3c0a549dd1738e310f Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 26 Feb 2020 15:31:02 +0800 Subject: [PATCH 014/375] =?UTF-8?q?CHART-12805=20=E7=B3=BB=E5=88=97?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=A0=B9=E6=8D=AE=E5=A4=A7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E5=A4=A7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/series/VanChartAbstractPlotSeriesPane.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 3d8fef03f..47b205f85 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 @@ -221,7 +221,10 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP protected boolean largeModel(Plot plot) { - return PlotFactory.largeDataModel(plot); + //大数据模式 恢复用注释。下面1行删除。 + return largeDataModelGroup != null && largeDataModelGroup.getSelectedIndex() == 0; + //大数据模式 恢复用注释。取消注释。 + //return PlotFactory.largeDataModel(plot); } From a8bc37b0355d895263374b3c98dc895dae4d594b Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 26 Feb 2020 15:47:27 +0800 Subject: [PATCH 015/375] =?UTF-8?q?CHART-12801=20=E5=A4=9A=E5=B1=82?= =?UTF-8?q?=E9=A5=BC=E5=9B=BE=E6=95=B0=E6=8D=AE=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MultiPieIndependentVanChartInterface.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java index 2a0d4ed5a..1cc66a2bf 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java @@ -4,8 +4,13 @@ import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; +import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; +import com.fr.van.chart.multilayer.data.MultiPiePlotReportDataContentPane; +import com.fr.van.chart.multilayer.data.MultiPiePlotTableDataContentPane; import com.fr.van.chart.multilayer.other.VanChartMultiPieConditionPane; import com.fr.van.chart.multilayer.style.VanChartMultiPieSeriesPane; import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI; @@ -47,6 +52,17 @@ public class MultiPieIndependentVanChartInterface extends AbstractIndependentVan // }; // } + //图表数据结构 恢复用注释。删除下面两个方法 getTableDataSourcePane getReportDataSourcePane。 + @Override + public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent){ + return new MultiPiePlotTableDataContentPane(parent); + } + + @Override + public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent){ + return new MultiPiePlotReportDataContentPane(parent); + } + public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot){ return new VanChartMultiPieSeriesPane(parent, plot); } From 0f42ae623f97146a0376b59f88eee8795c2df7aa Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 26 Feb 2020 17:25:21 +0800 Subject: [PATCH 016/375] fix --- .../src/main/java/com/fr/start/DesignerLauncher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java b/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java index 38f28346a..fa1cd969f 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java @@ -26,7 +26,7 @@ public class DesignerLauncher { public void start(String[] args) { this.args = args; FineJavaProcessFactory.create(). - entry("com.fr.start.MainDesigner"). + entry(MainDesigner.class). javaRuntime(DesignerJavaRuntime.getInstance().getJavaExec()). classPath(DesignerJavaRuntime.getInstance().getClassPath()). inheritJvmSettings(). From 280a6dc426f5d7b970b72b3e014e0e334ceb6bb4 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 26 Feb 2020 18:16:46 +0800 Subject: [PATCH 017/375] =?UTF-8?q?fix=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/main/java/com/fr/exit/DesignerExiter.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/exit/DesignerExiter.java b/designer-base/src/main/java/com/fr/exit/DesignerExiter.java index c7319f4c6..06260894e 100644 --- a/designer-base/src/main/java/com/fr/exit/DesignerExiter.java +++ b/designer-base/src/main/java/com/fr/exit/DesignerExiter.java @@ -14,14 +14,12 @@ public class DesignerExiter { public static final DesignerExiter INSTANCE = new DesignerExiter(); - private static final String DOT = "."; - public static DesignerExiter getInstance() { return INSTANCE; } public void execute() { - if (FineProcessContext.getParentPipe() != null || !DOT.equals(StableUtils.getInstallHome())) { + if (FineProcessContext.getParentPipe() != null) { FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY); } System.exit(0); From 18058f3964b0cb067f64db71f4f1af918b955acf Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 27 Feb 2020 09:44:43 +0800 Subject: [PATCH 018/375] =?UTF-8?q?MOBILE-25615=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=88=B0release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/FormMobileAttrAction.java | 14 ++++++++++---- .../mobile/FormMobileTemplateSettingsPane.java | 4 +--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java index c6f64c498..b387cbc70 100644 --- a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java @@ -56,6 +56,9 @@ public class FormMobileAttrAction extends JTemplateAction { final FormMobileAttrPane mobileAttrPane = new FormMobileAttrPane(); mobileAttrPane.populateBean(mobileAttr); + + final boolean oldMobileOnly = mobileAttr.isMobileOnly(); + final boolean oldAdaptive = mobileAttr.isAdaptivePropertyAutoMatch(); BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { @@ -75,13 +78,16 @@ public class FormMobileAttrAction extends JTemplateAction { recordFunction(); // 设置移动端属性并刷新界面 formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后 - ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); + boolean changeSize = (!oldMobileOnly && formMobileAttr.isMobileOnly()) || (oldMobileOnly && !formMobileAttr.isMobileOnly()); + if (changeSize) { + ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); + } jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent()); - //当自适应属性自动匹配处于勾选状态 进行切换 - if (formMobileAttr.isMobileOnly() && formMobileAttr.isAdaptivePropertyAutoMatch()) { + //改变布局为自适应布局,只在移动端属性设置保存后改变一次 + boolean changeLayout = !oldAdaptive && formMobileAttr.isAdaptivePropertyAutoMatch(); + if (changeLayout) { doChangeBodyLayout(); } - WidgetPropertyPane.getInstance().refreshDockingView(); jf.fireTargetModified(); } diff --git a/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java b/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java index 21f6d3b09..2eac9c586 100644 --- a/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java +++ b/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java @@ -47,9 +47,7 @@ public class FormMobileTemplateSettingsPane extends BasicBeanPane Date: Thu, 27 Feb 2020 13:33:29 +0800 Subject: [PATCH 019/375] =?UTF-8?q?MOBILE-25493=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/ui/MobileCollapsedStylePane.java | 38 ++++++++++++++----- .../mobile/ElementCaseDefinePane.java | 25 ++++++++++-- 2 files changed, 51 insertions(+), 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStylePane.java index 5459b8f2a..74538e77c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStylePane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.mobile.ui; import com.fr.design.beans.BasicBeanPane; import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.IntervalConstants; import com.fr.design.gui.ibutton.ModeButtonGroup; import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.icheckbox.UICheckBox; @@ -19,8 +20,10 @@ import com.fr.form.ui.mobile.CollapseState; import com.fr.form.ui.mobile.MobileChartCollapsedStyle; import com.fr.form.ui.mobile.MobileCollapsedStyle; -import javax.swing.JPanel; +import javax.swing.*; import javax.swing.border.TitledBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; @@ -51,11 +54,12 @@ public class MobileCollapsedStylePane extends BasicBeanPane Date: Thu, 27 Feb 2020 13:42:23 +0800 Subject: [PATCH 020/375] =?UTF-8?q?MOBILE-25615=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/FormMobileAttrAction.java | 14 ++++++++++---- .../mobile/FormMobileTemplateSettingsPane.java | 4 +--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java index c6f64c498..b387cbc70 100644 --- a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java @@ -56,6 +56,9 @@ public class FormMobileAttrAction extends JTemplateAction { final FormMobileAttrPane mobileAttrPane = new FormMobileAttrPane(); mobileAttrPane.populateBean(mobileAttr); + + final boolean oldMobileOnly = mobileAttr.isMobileOnly(); + final boolean oldAdaptive = mobileAttr.isAdaptivePropertyAutoMatch(); BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { @@ -75,13 +78,16 @@ public class FormMobileAttrAction extends JTemplateAction { recordFunction(); // 设置移动端属性并刷新界面 formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后 - ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); + boolean changeSize = (!oldMobileOnly && formMobileAttr.isMobileOnly()) || (oldMobileOnly && !formMobileAttr.isMobileOnly()); + if (changeSize) { + ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); + } jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent()); - //当自适应属性自动匹配处于勾选状态 进行切换 - if (formMobileAttr.isMobileOnly() && formMobileAttr.isAdaptivePropertyAutoMatch()) { + //改变布局为自适应布局,只在移动端属性设置保存后改变一次 + boolean changeLayout = !oldAdaptive && formMobileAttr.isAdaptivePropertyAutoMatch(); + if (changeLayout) { doChangeBodyLayout(); } - WidgetPropertyPane.getInstance().refreshDockingView(); jf.fireTargetModified(); } diff --git a/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java b/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java index 21f6d3b09..2eac9c586 100644 --- a/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java +++ b/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileTemplateSettingsPane.java @@ -47,9 +47,7 @@ public class FormMobileTemplateSettingsPane extends BasicBeanPane Date: Thu, 27 Feb 2020 21:01:15 +0800 Subject: [PATCH 021/375] =?UTF-8?q?CHART-12794=20=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/chart/gui/ChartTypePane.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java index 3740e3e12..6c7edc2d2 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -294,13 +294,14 @@ public class ChartTypePane extends AbstractChartAttrPane{ * @param collection */ public void reLayoutEditPane(String lastPlotID, ChartCollection collection){ + if (editPane == null) { + return; + } ChartProvider chart = collection.getSelectedChartProvider(ChartProvider.class); String plotID = chart.getID(); boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID); - if (editPane != null && editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, plotID))){ + if (editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, plotID))) { editPane.reLayout(chart); - }else { - throw new IllegalArgumentException("editPane can not be null."); } } From cf639760ed30490bace6aaa724be10a5bf7c4087 Mon Sep 17 00:00:00 2001 From: Maksim Date: Fri, 28 Feb 2020 16:41:48 +0800 Subject: [PATCH 022/375] =?UTF-8?q?=E6=8A=BD=E5=8F=96=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=B9=B6=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 78 ++++++++++++------- 1 file changed, 48 insertions(+), 30 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 a60791c6b..124ace0b0 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -132,36 +132,7 @@ public class EnvChangeEntrance { if (template != null) { template.refreshToolArea(); } - - //是否需要做服务校验 - if(needCheckBranch(selectedEnv)) { - String localBranch; - String remoteBranch; - localBranch = GeneralUtils.readFullBuildNO(); - try { - remoteBranch = new FunctionalHttpRequest(connectionInfo).getServerBranch(); - } catch (WorkspaceConnectionException e) { - remoteBranch = Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Is_Old") + formatBranch(localBranch); - } - //通过是否包含#来避免当前版本为非安装版本(主要是内部开发版本) - if (localBranch.contains("#") && localBranch.equals(remoteBranch)) { - //说明版本一致,仅做日志记录 - FineLoggerFactory.getLogger().info("Remote Designer version consistency"); - } else { - localBranch = formatBranch(localBranch); - remoteBranch = formatBranch(remoteBranch); - Set noExistServiceSet = getNoExistServiceSet(connectionInfo); - StringBuilder textBuilder = new StringBuilder(); - for (Class clazz : noExistServiceSet) { - WorkspaceAPI workspaceAPI = (WorkspaceAPI) clazz.getAnnotation(WorkspaceAPI.class); - String descriptionOfCN = InterProviderFactory.getProvider().getLocText(workspaceAPI.description()); - textBuilder.append(descriptionOfCN).append("\n"); - } - String areaText = textBuilder.toString(); - CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), areaText, localBranch, remoteBranch); - dialog.setVisible(true); - } - } + showServiceDialog(selectedEnv); } catch (WorkspaceAuthException | RegistEditionException e) { // String title = Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Auth_Failed"); // String title = Toolkit.i18nText("Fine-Design_Basic_Lic_Does_Not_Support_Remote"); @@ -238,6 +209,43 @@ public class EnvChangeEntrance { return true; } + /** + * 对选择的环境做服务检测 + * @param selectedEnv 选择的工作环境 + */ + public void showServiceDialog(DesignerWorkspaceInfo selectedEnv) throws Exception { + //是否需要做服务校验 + if(needCheckBranch(selectedEnv)) { + String localBranch; + String remoteBranch; + WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection(); + localBranch = GeneralUtils.readFullBuildNO(); + try { + remoteBranch = new FunctionalHttpRequest(connectionInfo).getServerBranch(); + } catch (WorkspaceConnectionException e) { + remoteBranch = Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Is_Old") + formatBranch(localBranch); + } + //通过是否包含#来避免当前版本为非安装版本(主要是内部开发版本) + if (localBranch.contains("#") && localBranch.equals(remoteBranch)) { + //说明版本一致,仅做日志记录 + FineLoggerFactory.getLogger().info("Remote Designer version consistency"); + } else { + localBranch = formatBranch(localBranch); + remoteBranch = formatBranch(remoteBranch); + Set noExistServiceSet = getNoExistServiceSet(connectionInfo); + StringBuilder textBuilder = new StringBuilder(); + for (Class clazz : noExistServiceSet) { + WorkspaceAPI workspaceAPI = (WorkspaceAPI) clazz.getAnnotation(WorkspaceAPI.class); + String descriptionOfCN = InterProviderFactory.getProvider().getLocText(workspaceAPI.description()); + textBuilder.append(descriptionOfCN).append("\n"); + } + String areaText = textBuilder.toString(); + CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), areaText, localBranch, remoteBranch); + dialog.setVisible(true); + } + } + } + /** * 判断是否需要做版本验证,判断依据为 * 1、选择的环境为远程环境 @@ -249,6 +257,11 @@ public class EnvChangeEntrance { return selectedEnv.getType() == DesignerWorkspaceType.Remote; } + /** + * 获取不存在的服务列表 + * @param info 环境连接信息 + * @return 以Set形式返回不存在的服务 + */ public Set getNoExistServiceSet(WorkspaceConnectionInfo info){ Set noExistServiceSet = new HashSet(); Set remoteServiceSet = new HashSet(); @@ -295,6 +308,11 @@ public class EnvChangeEntrance { } } + /** + * 格式化分支版本号 + * @param branch 初始的分支版本号 + * @return 格式化后的版本号 + */ private String formatBranch(String branch){ if(branch.contains("#")){ return branch.substring(branch.lastIndexOf("#") + 1, branch.length() - 13); From a11aa4822d5f4ca5e753ce021e52455721ae6c35 Mon Sep 17 00:00:00 2001 From: Maksim Date: Fri, 28 Feb 2020 16:43:45 +0800 Subject: [PATCH 023/375] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E6=97=B6=EF=BC=8C=E5=81=9A=E4=B8=80=E6=AC=A1=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../start/module/DesignerWorkspaceProvider.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 7d63571ad..e0fc4dfe9 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,10 @@ 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.event.Event; +import com.fr.event.EventDispatcher; +import com.fr.event.Listener; +import com.fr.event.Null; import com.fr.log.FineLoggerFactory; import com.fr.module.Activator; import com.fr.stable.StringUtils; @@ -54,6 +58,18 @@ public class DesignerWorkspaceProvider extends Activator { EnvChangeEntrance.getInstance().dealEvnExceptionWhenStartDesigner(); } else { WorkContext.switchTo(workspace); + //在设计器完全启动完成后,对初始环境进行一次服务检测,对主要功能无影响,异常仅做日志提示即可 + final DesignerWorkspaceInfo selectEnv = workspaceInfo; + EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener() { + @Override + public void on(Event event, Null aNull) { + try { + EnvChangeEntrance.getInstance().showServiceDialog(selectEnv); + } catch (Exception e) { + FineLoggerFactory.getLogger().warn("Check Service Failed"); + } + } + }); } } catch (Throwable e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); From e35e8f5e6dc4c1a8083ec7b6131a5fb453419ca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 2 Mar 2020 09:49:49 +0800 Subject: [PATCH 024/375] =?UTF-8?q?CHART-11090=20=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E6=A8=A1=E7=B3=8A=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chartx/component/MapAreaMatchPane.java | 2 +- .../chart/gui/data/NormalChartDataPane.java | 13 ++- .../chart/gui/data/TableDataPane.java | 9 ++ .../table/AbstractTableDataContentPane.java | 12 ++- .../designer/data/comp/DrillMapDataPane.java | 10 ++- .../designer/data/comp/DrillMapLayerPane.java | 13 ++- .../comp/EachLayerDataDefinitionPane.java | 7 +- .../comp/SingleLayerDataDefinitionPane.java | 5 ++ .../type/VanChartDrillMapPlotPane.java | 23 +++++ .../fr/van/chart/map/VanMapChartTypeUI.java | 6 +- .../designer/data/VanChartMapDataPane.java | 32 +++++-- .../VanAreaMapPlotTableDataContentPane.java | 7 +- .../VanLineMapPlotTableDataContentPane.java | 60 ++++++++++++- .../table/VanMapTableDataContentPane.java | 90 +++++++++++++++++++ .../VanPointMapPlotTableDataContentPane.java | 31 ++++++- .../designer/type/VanChartMapPlotPane.java | 16 ++++ 16 files changed, 305 insertions(+), 31 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index 708b99365..f37a01c22 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -196,7 +196,7 @@ public class MapAreaMatchPane extends BasicBeanPane { //先取保存的数据集名称和区域名,若不存在,就取数据集面板配置的数据集名称和区域名 matchResultTable.populateBean(matchResult); - if (matchResult != null && matchResult.getTableName() != null) { + if (matchResult != null && StringUtils.isNotEmpty(matchResult.getTableName())) { tableName = matchResult.getTableName(); areaName = matchResult.getColumnName(); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java index 1277ae463..42cf782c3 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java @@ -8,16 +8,15 @@ import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.utils.gui.GUICoreUtils; - import com.fr.van.chart.designer.AbstractVanChartScrollPane; import javax.swing.BorderFactory; import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; -import java.util.ArrayList; -import java.util.List; /** * 一般数据界面 @@ -133,6 +132,14 @@ public class NormalChartDataPane extends DataContentsPane { tableDataPane.checkBoxUse(); } + /** + * 钻取地图需要同时更新层级 + */ + public void populate(ChartCollection collection, int level) { + populate(collection); + tableDataPane.refreshLevel(level); + } + /** * 保存 数据界面内容 */ diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index 7f22a03a6..f8092b859 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -15,6 +15,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.utils.gui.UIComponentUtils; +import com.fr.van.chart.map.designer.data.contentpane.table.VanMapTableDataContentPane; import javax.swing.BorderFactory; import java.awt.BorderLayout; @@ -75,6 +76,7 @@ public class TableDataPane extends FurtherBasicBeanPane{ } if(dataContentPane != null) { dataContentPane.onSelectTableData(dataWrap); + dataContentPane.setTableName(dataWrap.getTableDataName()); } } @@ -124,6 +126,13 @@ public class TableDataPane extends FurtherBasicBeanPane{ add(dataContentPane, BorderLayout.CENTER); } } + + public void refreshLevel(int level){ + if(dataContentPane instanceof VanMapTableDataContentPane) { + ((VanMapTableDataContentPane) dataContentPane).setLevel(level); + } + } + /** * 更新界面属性 */ diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java index df5d99fbd..1bfb9657c 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java @@ -6,16 +6,26 @@ import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.gui.icombobox.UIComboBox; import javax.swing.JSeparator; +import java.util.List; import java.awt.Dimension; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import java.util.List; public abstract class AbstractTableDataContentPane extends BasicBeanPane{ protected static final double COMPONENT_WIDTH = 124; private boolean isNeedSummaryCaculateMethod = true; + + public String tableName; + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } public abstract void updateBean(ChartCollection ob); diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java index 5b441f7db..4ac2b2528 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java @@ -8,12 +8,15 @@ import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.plugin.chart.drillmap.data.DrillMapDefinition; +import com.fr.plugin.chart.map.MapMatchResult; +import com.fr.plugin.chart.map.VanChartMapPlot; +import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import com.fr.plugin.chart.type.MapType; import com.fr.van.chart.map.designer.data.MapDataPaneHelper; -import java.awt.BorderLayout; import java.util.ArrayList; import java.util.List; +import java.awt.BorderLayout; /** * Created by Mitisky on 16/6/20. @@ -76,8 +79,11 @@ public class DrillMapDataPane extends BasicBeanPane { dataDefinitionType.setSelectedIndex(MapDataPaneHelper.isFromBottomData(ob) ? 0 : 1); + MapMatchResult matchResult = ((VanChartMapPlot) ob.getSelectedChartProvider(Chart.class).getPlot()).getMatchResult(); ChartCollection bottomDataChartCollection = MapDataPaneHelper.getBottomDataDrillMapChartCollection(ob); - bottomDataDefinitionPane.populateBean(bottomDataChartCollection); + ((VanChartMapPlot)bottomDataChartCollection.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult); + + bottomDataDefinitionPane.populateBean(bottomDataChartCollection, ChartGEOJSONHelper.BOTTOM_LEVEL); eachLayerDataDefinitionPane.populateBean(ob); parent.initAllListeners(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java index 6fd6ecabb..a01aed4cd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java @@ -7,9 +7,9 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.ComparatorUtils; - import com.fr.plugin.chart.drillmap.DrillMapHelper; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; +import com.fr.plugin.chart.map.MapMatchResult; import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper; import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.ZoomLevel; @@ -19,10 +19,11 @@ import com.fr.van.chart.map.designer.type.VanChartMapSourceChoosePane; import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.tree.DefaultMutableTreeNode; -import java.awt.BorderLayout; -import java.awt.Component; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; +import java.awt.BorderLayout; +import java.awt.Component; /** * Created by Mitisky on 16/6/20. @@ -125,6 +126,7 @@ public class DrillMapLayerPane extends BasicScrollPane { if (drillMapPlot != null) { java.util.List levelList = drillMapPlot.getLayerLevelList(); java.util.List mapTypeList = drillMapPlot.getLayerMapTypeList(); + List matchResultList = drillMapPlot.getMatchResultList(); if (detailComps == null || drillMapPlot.getMapType() != oldMapType || !ComparatorUtils.equals(drillMapPlot.getGeoUrl(), oldGeoUrl)) { oldMapType = drillMapPlot.getMapType(); @@ -151,6 +153,11 @@ public class DrillMapLayerPane extends BasicScrollPane { mapTypeList.add(mapType); } + int matchSize = matchResultList.size(); + for (int k = matchSize; k < depth; k++) { + matchResultList.add(new MapMatchResult()); + } + for (int i = 0; i < depth; i++) { Component[] components = detailComps[i + 1]; if (components != null) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java index 26f8c42c3..16d989829 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java @@ -11,14 +11,15 @@ import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.drillmap.DrillMapHelper; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.drillmap.data.DrillMapDefinition; +import com.fr.plugin.chart.map.MapMatchResult; import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper; import com.fr.plugin.chart.type.MapType; import com.fr.van.chart.map.designer.data.MapDataPaneHelper; import javax.swing.tree.DefaultMutableTreeNode; -import java.awt.CardLayout; import java.util.ArrayList; import java.util.List; +import java.awt.CardLayout; /** * Created by Mitisky on 16/6/20. @@ -90,12 +91,14 @@ public class EachLayerDataDefinitionPane extends MultiTabPane { } private void populatePaneList(ChartCollection chartCollection) { + List matchResultList = ((VanChartDrillMapPlot) chartCollection.getSelectedChartProvider(Chart.class).getPlot()).getMatchResultList(); for (int i = 0, len = paneList.size(); i < len; i++) { BasicPane basicPane = paneList.get(i); MapType mapType = oldMapList.get(i); if (basicPane instanceof SingleLayerDataDefinitionPane) { ChartCollection clone = MapDataPaneHelper.getLayerChartCollection(chartCollection, i, mapType); - ((SingleLayerDataDefinitionPane) basicPane).populateBean(clone); + ((VanChartDrillMapPlot)clone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResultList(matchResultList); + ((SingleLayerDataDefinitionPane) basicPane).populateBean(clone, i); } } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java index 1aca1a32d..16906845e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java @@ -78,6 +78,11 @@ public class SingleLayerDataDefinitionPane extends FurtherBasicBeanPane newMatchResultList = new ArrayList<>(); + List matchResultList = ((VanChartDrillMapPlot) oldPlot).getMatchResultList(); + if (matchResultList != null) { + for (MapMatchResult matchResult : matchResultList) { + newMatchResultList.add((MapMatchResult) matchResult.clone()); + } + } + ((VanChartDrillMapPlot) newPlot).setMatchResultList(newMatchResultList); + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error("Error in change plot"); + } + } protected Chart[] getDefaultCharts() { return DrillMapIndependentVanChart.DrillMapVanCharts; diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java b/designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java index 07cb2cbd6..50636ad28 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java @@ -21,6 +21,7 @@ import com.fr.van.chart.map.designer.data.contentpane.report.VanLineMapPlotRepor import com.fr.van.chart.map.designer.data.contentpane.report.VanPointMapPlotReportDataContentPane; import com.fr.van.chart.map.designer.data.contentpane.table.VanAreaMapPlotTableDataContentPane; import com.fr.van.chart.map.designer.data.contentpane.table.VanLineMapPlotTableDataContentPane; +import com.fr.van.chart.map.designer.data.contentpane.table.VanMapTableDataContentPane; import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane; import com.fr.van.chart.map.designer.other.VanChartMapOtherPane; import com.fr.van.chart.map.designer.other.condition.pane.VanChartMapConditionPane; @@ -77,9 +78,12 @@ public class VanMapChartTypeUI extends AbstractIndependentVanChartUI { //图表数据结构 恢复用注释。删除下面5个方法 getTableDataSourcePane getReportDataSourcePane getChartDataPane areaPlot linePlot。 public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { - return areaPlot(plot) ? new VanAreaMapPlotTableDataContentPane(parent) + VanMapTableDataContentPane vanMapTableDataContentPane = areaPlot(plot) ? new VanAreaMapPlotTableDataContentPane(parent) : linePlot(plot) ? new VanLineMapPlotTableDataContentPane(parent) : new VanPointMapPlotTableDataContentPane(parent); + + vanMapTableDataContentPane.setPlot((VanChartMapPlot)plot); + return vanMapTableDataContentPane; } public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java index a6fdd49ce..e7a222bf9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java @@ -1,9 +1,12 @@ package com.fr.van.chart.map.designer.data; +import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.NormalChartDataPane; +import com.fr.plugin.chart.map.MapMatchResult; +import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.data.VanMapDefinition; import com.fr.plugin.chart.type.MapType; @@ -54,26 +57,37 @@ public class VanChartMapDataPane extends ChartDataPane { repeatLayout(collection); + MapMatchResult matchResult = ((VanChartMapPlot) collection.getSelectedChartProvider(Chart.class).getPlot()).getMatchResult(); + + ChartCollection areaClone; + ChartCollection pointClone; + ChartCollection lineClone; switch (mapType) { case AREA: - ChartCollection areaClone = MapDataPaneHelper.getAreaMapChartCollection(collection); + areaClone = MapDataPaneHelper.getAreaMapChartCollection(collection); + ((VanChartMapPlot)areaClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult); contentsPane.populate(areaClone); break; case POINT: - ChartCollection pointClone = MapDataPaneHelper.getPointMapChartCollection(collection); + pointClone = MapDataPaneHelper.getPointMapChartCollection(collection); + ((VanChartMapPlot)pointClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult); contentsPane.populate(pointClone); break; case LINE: - ChartCollection lineClone = MapDataPaneHelper.getLineMapChartCollection(collection); + lineClone = MapDataPaneHelper.getLineMapChartCollection(collection); + ((VanChartMapPlot)lineClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult); contentsPane.populate(lineClone); break; case CUSTOM: - ChartCollection areaClone1 = MapDataPaneHelper.getAreaMapChartCollection(collection); - ChartCollection pointClone1 = MapDataPaneHelper.getPointMapChartCollection(collection); - ChartCollection lineClone1 = MapDataPaneHelper.getLineMapChartCollection(collection); - ((CustomMapChartDataContentsPane) contentsPane).populateAreaMap(areaClone1); - ((CustomMapChartDataContentsPane) contentsPane).populatePointMap(pointClone1); - ((CustomMapChartDataContentsPane) contentsPane).populateLineMap(lineClone1); + areaClone = MapDataPaneHelper.getAreaMapChartCollection(collection); + pointClone = MapDataPaneHelper.getPointMapChartCollection(collection); + lineClone = MapDataPaneHelper.getLineMapChartCollection(collection); + ((VanChartMapPlot)areaClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult); + ((VanChartMapPlot)pointClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult); + ((VanChartMapPlot)lineClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult); + ((CustomMapChartDataContentsPane) contentsPane).populateAreaMap(areaClone); + ((CustomMapChartDataContentsPane) contentsPane).populatePointMap(pointClone); + ((CustomMapChartDataContentsPane) contentsPane).populateLineMap(lineClone); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java index b8c1d3a75..86bc0c6d0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java @@ -8,7 +8,6 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; import com.fr.van.chart.map.designer.data.component.SeriesTypeUseComboxPaneWithOutFilter; @@ -16,17 +15,17 @@ import com.fr.van.chart.map.designer.data.component.SeriesTypeUseComboxPaneWithO import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.JSeparator; +import java.util.List; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import java.util.List; /** * Created by Mitisky on 16/5/16. */ -public class VanAreaMapPlotTableDataContentPane extends AbstractTableDataContentPane { +public class VanAreaMapPlotTableDataContentPane extends VanMapTableDataContentPane { private UIComboBox areaNameCom; protected SeriesTypeUseComboxPaneWithOutFilter seriesTypeUseComboxPane; @@ -72,7 +71,7 @@ public class VanAreaMapPlotTableDataContentPane extends AbstractTableDataContent double[] rowSize = {p}; Component[][] components = new Component[][]{ - new Component[]{label, areaNameCom}, + new Component[]{label, createAreaPanel(areaNameCom)}, }; return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java index abbddc732..dd50492f2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java @@ -1,10 +1,15 @@ package com.fr.van.chart.map.designer.data.contentpane.table; +import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.van.chart.map.designer.data.component.table.AbstractLongLatAreaPane; +import com.fr.van.chart.map.designer.data.component.table.AreaPane; import com.fr.van.chart.map.designer.data.component.table.LineMapAreaPane; import com.fr.van.chart.map.designer.data.component.table.LineMapLongLatAreaPane; +import com.fr.van.chart.map.designer.data.component.table.LongLatAreaPane; + +import java.awt.Component; /** @@ -16,10 +21,61 @@ public class VanLineMapPlotTableDataContentPane extends VanPointMapPlotTableData } protected AbstractLongLatAreaPane createAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) { - return new LineMapAreaPane(longLatAreaTableComboPane); + return new LineMapAreaPane(longLatAreaTableComboPane) { + @Override + protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { + areaPane = new AreaPane(parentPane) { + @Override + protected Component[][] getComponent () { + return new Component[][]{ + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name")), VanLineMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)} + }; + } + }; + } + @Override + protected void initEndAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { + endAreaPane = new AreaPane(parentPane) { + @Override + protected Component[][] getComponent () { + return new Component[][]{ + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")), VanLineMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)} + }; + } + }; + } + }; } protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) { - return new LineMapLongLatAreaPane(longLatAreaTableComboPane); + return new LineMapLongLatAreaPane(longLatAreaTableComboPane){ + @Override + protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { + areaPane = new LongLatAreaPane(parentPane) { + @Override + protected Component[][] getComponent () { + return new Component[][]{ + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Longitude")), longitudeCom}, + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Latitude")), latitudeCom}, + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name")), VanLineMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)} + }; + } + }; + } + + @Override + protected void initEndAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { + endAreaPane = new LongLatAreaPane(parentPane){ + @Override + protected Component[][] getComponent () { + return new Component[][]{ + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Longitude")), longitudeCom}, + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Latitude")), latitudeCom}, + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")), VanLineMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)} + }; + } + }; + } + }; } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java new file mode 100644 index 000000000..a8cae03c9 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java @@ -0,0 +1,90 @@ +package com.fr.van.chart.map.designer.data.contentpane.table; + +import com.fr.base.BaseUtils; +import com.fr.base.Utils; +import com.fr.chartx.TwoTuple; +import com.fr.design.chartx.component.MapAreaMatchPane; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionListener; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; +import com.fr.plugin.chart.map.MapMatchResult; +import com.fr.plugin.chart.map.VanChartMapPlot; +import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.tree.DefaultMutableTreeNode; +import java.util.Set; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2019-12-25 + */ +public abstract class VanMapTableDataContentPane extends AbstractTableDataContentPane { + + private VanChartMapPlot plot; + + //钻取地图有层级,默认-1代表无层级关系 + private int level = ChartGEOJSONHelper.DEFAULT_LEVEL; + + public int getLevel() { + return level; + } + + public void setLevel(int level) { + this.level = level; + } + + public VanChartMapPlot getPlot() { + return plot; + } + + public void setPlot(VanChartMapPlot plot) { + this.plot = plot; + } + + public JPanel createAreaPanel(final UIComboBox areaBox) { + JPanel areaPanel = new JPanel(new BorderLayout(4, 0)); + areaBox.setPreferredSize(new Dimension(70, 20)); + areaPanel.add(areaBox, BorderLayout.CENTER); + UIButton uiButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/config.png")); + uiButton.addActionListener(new ActionListener() { + private TwoTuple> treeNodeAndItems; + + @Override + public void actionPerformed(ActionEvent e) { + if (treeNodeAndItems == null) { + treeNodeAndItems = ChartGEOJSONHelper.getTreeNodeAndItems(plot.getGeoUrl(), level); + } + final MapAreaMatchPane pane = new MapAreaMatchPane(treeNodeAndItems); + + String nameTable = getTableName(); + final MapMatchResult matchResult = plot.getMatchResult(level); + + pane.populateBean(matchResult, nameTable, Utils.objectToString(areaBox.getSelectedItem())); + BasicDialog dialog = pane.showWindow(new JFrame()); + dialog.addDialogActionListener(new DialogActionListener() { + @Override + public void doOk() { + pane.updateBean(matchResult); + } + + @Override + public void doCancel() { + + } + }); + dialog.setVisible(true); + } + }); + areaPanel.add(uiButton, BorderLayout.EAST); + return areaPanel; + } +} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java index 724da2675..cbb418b8d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java @@ -2,12 +2,15 @@ package com.fr.van.chart.map.designer.data.contentpane.table; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; import com.fr.van.chart.map.designer.data.component.table.AbstractLongLatAreaPane; +import com.fr.van.chart.map.designer.data.component.table.AreaPane; +import com.fr.van.chart.map.designer.data.component.table.LongLatAreaPane; import com.fr.van.chart.map.designer.data.component.table.PointMapAreaPane; import com.fr.van.chart.map.designer.data.component.table.PointMapLongLatAreaPane; @@ -15,11 +18,11 @@ import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import java.util.List; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; import java.awt.Dimension; -import java.util.List; /** * Created by Mitisky on 16/5/17. @@ -214,11 +217,33 @@ public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableData } protected AbstractLongLatAreaPane createAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) { - return new PointMapAreaPane(longLatAreaTableComboPane); + return new PointMapAreaPane(longLatAreaTableComboPane) { + protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { + areaPane = new AreaPane(parentPane) { + protected Component[][] getComponent () { + return new Component[][]{ + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name")), VanPointMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)} + }; + } + }; + } + }; } protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) { - return new PointMapLongLatAreaPane(longLatAreaTableComboPane); + return new PointMapLongLatAreaPane(longLatAreaTableComboPane) { + protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { + areaPane = new LongLatAreaPane(parentPane) { + protected Component[][] getComponent () { + return new Component[][]{ + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Longitude")), longitudeCom}, + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Latitude")), latitudeCom}, + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")), VanPointMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)} + }; + } + }; + } + }; } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java index 8f44c0a9b..b9cdaad46 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java @@ -10,6 +10,7 @@ import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.map.MapIndependentVanChart; +import com.fr.plugin.chart.map.MapMatchResult; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.data.VanMapDefinition; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; @@ -90,6 +91,21 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane { } } + /** + * 同一个地图, 类型之间切换 + */ + @Override + protected void cloneOldPlot2New(Plot oldPlot, Plot newPlot) { + super.cloneOldPlot2New(oldPlot, newPlot); + try { + if (((VanChartMapPlot) oldPlot).getMatchResult() != null) { + ((VanChartMapPlot) newPlot).setMatchResult((MapMatchResult) ((VanChartMapPlot) oldPlot).getMatchResult().clone()); + } + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error("Error in change plot"); + } + } + /** * 不同地图类型的超链不需要复制 * From 8b7302459583ab5acd89ff2b0d346e4d65b268dd Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 2 Mar 2020 14:35:31 +0800 Subject: [PATCH 025/375] =?UTF-8?q?CHART-12810=20//=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=9A=84tab=E9=9D=9E=E9=80=89=E4=B8=AD=E7=8A=B6=E6=80=81,=20?= =?UTF-8?q?=E5=8E=9F=E4=B8=BA=E9=80=89=E4=B8=AD=E7=8A=B6=E6=80=81=E7=9A=84?= =?UTF-8?q?tab=E4=BF=9D=E6=8C=81=E9=80=89=E4=B8=AD=E4=B8=8D=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/chart/gui/ChartTypeButtonPane.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 1fbb87c42..4d7673b3e 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -503,6 +503,13 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen if (this.isSelected()) { indexList.get(0).setSelected(true); changeCollectionSelected(indexList.get(0).getButtonName()); + } else {//删除的tab非选中状态, 原为选中状态的tab保持选中不变 + for (ChartChangeButton button : indexList) { + if (button.isSelected()) { + changeCollectionSelected(button.getButtonName()); + break; + } + } } } From 1838a00cd0012b9c391c35e16b16c6b8bdc53cc3 Mon Sep 17 00:00:00 2001 From: Maksim Date: Mon, 2 Mar 2020 21:21:32 +0800 Subject: [PATCH 026/375] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9C=AC=E6=9C=88=E4=B8=8D=E5=86=8D=E6=8F=90?= =?UTF-8?q?=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 27 ++++++++- .../fr/design/env/DesignerWorkspaceInfo.java | 3 + .../env/LocalDesignerWorkspaceInfo.java | 5 ++ .../env/RemoteDesignerWorkspaceInfo.java | 13 +++++ .../write/submit/CheckServiceDialog.java | 54 ++++++++++++++---- .../fr/design/images/warnings/warning5.png | Bin 0 -> 3095 bytes 6 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/warnings/warning5.png 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 124ace0b0..9a368f342 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -43,7 +43,11 @@ import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; import java.lang.reflect.Method; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Set; @@ -240,7 +244,7 @@ public class EnvChangeEntrance { textBuilder.append(descriptionOfCN).append("\n"); } String areaText = textBuilder.toString(); - CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), areaText, localBranch, remoteBranch); + CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), selectedEnv, areaText, localBranch, remoteBranch); dialog.setVisible(true); } } @@ -249,12 +253,29 @@ public class EnvChangeEntrance { /** * 判断是否需要做版本验证,判断依据为 * 1、选择的环境为远程环境 - * 2、一个月内不弹出是否勾选(这里预留,还未实际增加) + * 2、一个月内不弹出是否勾选 * @param selectedEnv 选择的环境 * @return */ private boolean needCheckBranch(DesignerWorkspaceInfo selectedEnv){ - return selectedEnv.getType() == DesignerWorkspaceType.Remote; + if(selectedEnv.getType() == DesignerWorkspaceType.Remote){ + try { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + Calendar calendar = Calendar.getInstance(); + //获取记录的时间 + Date remindTime = format.parse(selectedEnv.getRemindTime()); + calendar.setTime(remindTime); + //获取一个月后的时间 + calendar.add(Calendar.MONTH,1); + //与当前时间作对比,然后判断是否提示 + if(new Date().after(calendar.getTime())){ + return true; + } + } catch (ParseException e) { + return true; + } + } + return false; } /** diff --git a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java index 2e5cc9f8c..ccc98bfe3 100644 --- a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java @@ -10,6 +10,9 @@ public interface DesignerWorkspaceInfo extends XMLable { String getPath(); + //获取提醒时间,用于判断是否做服务检测 + String getRemindTime(); + WorkspaceConnectionInfo getConnection(); boolean checkValid(); diff --git a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java index 19b085781..ef1f420d6 100644 --- a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java @@ -43,6 +43,11 @@ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo { return path; } + @Override + public String getRemindTime() { + return null; + } + @Override public WorkspaceConnectionInfo getConnection() { return null; diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java index 9d2af66cf..af0b8a01c 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java @@ -13,6 +13,8 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { private String name; + private String remindTime; + private WorkspaceConnectionInfo connection; public static RemoteDesignerWorkspaceInfo create(WorkspaceConnectionInfo connection) { @@ -45,11 +47,21 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { return connection; } + public void setRemindTime(String remindTime){ + this.remindTime = remindTime; + } + + @Override + public String getRemindTime(){ + return remindTime; + } + @Override public void readXML(XMLableReader reader) { if (reader.isAttr()) { this.name = reader.getAttrAsString("name", StringUtils.EMPTY); + this.remindTime = reader.getAttrAsString("remindTime", StringUtils.EMPTY); } if (reader.isChildNode()) { String tagName = reader.getTagName(); @@ -69,6 +81,7 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { public void writeXML(XMLPrintWriter writer) { writer.attr("name", name); + writer.attr("remindTime", remindTime); if (this.connection != null) { writer.startTAG("Connection"); writer.attr("url", connection.getUrl()); diff --git a/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java b/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java index 3797c0f8a..c88fa1fd9 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java @@ -1,10 +1,14 @@ package com.fr.design.write.submit; +import com.fr.design.env.DesignerWorkspaceInfo; +import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; +import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import javax.swing.BorderFactory; @@ -18,6 +22,9 @@ import java.awt.Dimension; import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; /** * @author: Maksim @@ -28,30 +35,33 @@ public class CheckServiceDialog extends JDialog implements ActionListener { private JPanel topPanel; private JPanel centerPanel; private JPanel bottomPanel; + private UICheckBox remindBox; + private DesignerWorkspaceInfo selectEnv; - public CheckServiceDialog(Frame parent, String areaText, String localBranch, String remoteBranch){ + public CheckServiceDialog(Frame parent, DesignerWorkspaceInfo selectEnv, String areaText, String localBranch, String remoteBranch){ super(parent,true); + this.selectEnv = selectEnv; //上面的标签面板 topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel imagePanel = new JPanel(); - Icon icon = IOUtils.readIcon("com/fr/design/images/warnings/warning4.png"); + Icon icon = IOUtils.readIcon("com/fr/design/images/warnings/warning5.png"); JLabel imageLabel = new JLabel(); imageLabel.setIcon(icon); imagePanel.add(imageLabel); - imagePanel.setPreferredSize(new Dimension(100,80)); + imagePanel.setPreferredSize(new Dimension(110,80)); JPanel verticalPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); FRFont font = FRFont.getInstance(); font = font.applySize(15).applyStyle(1); JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Inconsistency")); label.setFont(font); - label.setPreferredSize(new Dimension(500,30)); - JLabel label2 = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Local_Designer") - + localBranch + "/" + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + remoteBranch); - label2.setPreferredSize(new Dimension(500,20)); + label.setPreferredSize(new Dimension(600,30)); + JLabel label2 = new JLabel(""+Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Local_Designer") + + localBranch + "/" + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + remoteBranch+""); + label2.setPreferredSize(new Dimension(600,30)); JLabel label3 = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Need_Update")); - label3.setPreferredSize(new Dimension(500,20)); + label3.setPreferredSize(new Dimension(500,30)); verticalPanel.add(label); verticalPanel.add(label2); @@ -73,9 +83,13 @@ public class CheckServiceDialog extends JDialog implements ActionListener { centerPanel.add(checkArea,BorderLayout.CENTER); //下面的按钮面板 + remindBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remind_Show")); + remindBox.addActionListener(remindCheckboxListener); UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Button_Confirm")); - JPanel buttonPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); - buttonPanel.add(okButton); + JPanel buttonPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + buttonPanel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10)); + buttonPanel.add(remindBox, BorderLayout.WEST); + buttonPanel.add(okButton,BorderLayout.EAST); okButton.addActionListener(this ); bottomPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); bottomPanel.add(buttonPanel); @@ -86,7 +100,7 @@ public class CheckServiceDialog extends JDialog implements ActionListener { this.add(topPanel,BorderLayout.NORTH); this.add(centerPanel, BorderLayout.CENTER); this.add(buttonPanel,BorderLayout.SOUTH); - this.setSize(new Dimension(600, 500)); + this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US)? 700:600, 500)); GUICoreUtils.centerWindow(this); } @@ -94,4 +108,22 @@ public class CheckServiceDialog extends JDialog implements ActionListener { public void actionPerformed(ActionEvent e) { this.dispose(); } + + + private ActionListener remindCheckboxListener = new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + boolean needRemind = remindBox.isSelected(); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + String remindTime = format.format(new Date()); + if(needRemind){ + //前面做过验证,一定是远程环境,直接强转 + ((RemoteDesignerWorkspaceInfo)selectEnv).setRemindTime(remindTime); + }else { + ((RemoteDesignerWorkspaceInfo)selectEnv).setRemindTime(""); + } + } + }; + } diff --git a/designer-base/src/main/resources/com/fr/design/images/warnings/warning5.png b/designer-base/src/main/resources/com/fr/design/images/warnings/warning5.png new file mode 100644 index 0000000000000000000000000000000000000000..059206e0cc3393c10dd4a29ff1933df00be28ad2 GIT binary patch literal 3095 zcmV+y4CwQTP)e=Q(U3A#84tcQK&>g4naXE zh;j)E1p*2diV~EgxIz_Cj-8$*93hCf)4dVc>E49wZogJt^x*W*?dN&l z=Y603X1+eYZwRd;Q5~Q}scDHp%aDZq6SNFz8IrILBuq|ggtQDvSO*d&r|Cz?K%aKF z1fETV4Un)#&XoR~upax8)3k5(C%em z{^UL6<%(K5C?S0omeF*ERLa^?A}kTC@KiqX!jHFjUWvo;C@-vJthG`B1g|@3PUP}HlKid!<5g!F=h%Hc9k5-o#t*EvL?Uuwax}-?)2?@SNSEzflrJfwwb??na_%&NUxa8v@D%1 zp6!LJ$N5AUQZc*sCzhV5N5QpnFgf$mncgQGslm;i2t#aBdw>~7G_o1YcrcySk8Grd zL>Mw?=8toj?{0J>-26;*d^%ISr;%D3IzpB%g>?Q|n)^lmg+?}EEH~kKxkE1yfg7c# zp@vvx?K}{E7OHqckr_HM-UiX`0PhYU8#pG>c}k{uO<;aVV#5p>?B8`e$7y>GzzzXx zFo~Q~K{2&D|P?Crj z$eGeVYVmDDyNrQg&pjAdD_Q-5Alkxm8e)iTcJIw_o&%#TNCD*F2)R@LqZhYQ)*d9n z;a<2Z=ZA@;f}H7jApkcNr6Gn`rgkS7-wdXlu2t0HcSN|Bq0M3N69n2?1iu-EahH-L>i(aj?(Uo%-{lbz6q^I{?Rs;>Y8N=rB1`d?*MvD5vg* zScdi(fG-CXoSNdyo;IWREm6MRpTCqH{-G#-!YFx6$?69L;szwu)sRYAJA(+n45)RK zCJ#@OY1Ya?(HIpYcPxPdU+fX#3^}9UB$_WQu5O0B_uiasrVMRxr@38WL=V|p&6qL! z#rH*H3>x{P9dPhB773*xYpc0_a*ArJhO3()wy7;;7GBp;vnB%elzqH062&tXX8b6f z)t828v?#YOhE)2ybHt<5T>rD336(I@(dlgQ_o4+_W$i8yP7uXc!!h^+45td|Sv{pN zaYVRvF~l~tUoqo!5ka09!Ual3zuFVG31Au8N&tI`;%niUaZ@_0pAj~W7e97GtUm1k zNcfwV5Yh8Qv`o&3KTNU>&1RroH2!2bmgs?2;psz<(0pk%RtA9-- z-n##4JB|!vjR;l{^N^zIhY4Z>!D2PUDr*Zs_-!C%wMnZKRsWnwOskwf2*iIC!3tvt z3zUq0moVNZFg8P&_nKmx>)dJXgmvUT6>bS1R#bh8NEFM+oeR*lB3NMz@e93c+UM@Q z_sSt*jt^jLhFE6q0x-Ro2#ku%j0)(0S%-lx)e}+9T2QA9n7>Ooh?rKh9mR* zlx-H>&-ut}{OI38l2B;x5Wn**(vZl-R*d{T1U^#$R-Yv8Df`nXEV_au{Xf|QXmYs zcWh9IUjMLGKFiEs3FgK1(8J8%N@q(qMv*HLLk0%AW=iWN_lta&C`5_GXany$RV}?% z(-0$nH^9e<#0raH;5FXh6sB+AyEbgBNDQ(2^Ovy07ljq$i|^noN~iw!S{&QZo?>7> zUok^~8FXn{EnXZV#3(hiAy!}4ZlKY19dcMPKKZ98s($+B*4&Q!k^;rHfjV-IaGfne`_1=mHlDr)hx;QWvyq+V0Y z>IK#=-Zpc4GL!pYs{Tic4^(EB9u1l})CjQ*&0XhxaM0x8c(hzmi&ZzdwEJ^MutN`o ziyw?lz{9et9~z7uVuV;m{v?2Feuf7XB+6r8Rl3G=k&2<6<8JLI8Y_Anovf(EJA%Xw zG(wnnnrfTv?lgB!kff1t7#})A&UV$NnpQlU*7%YAqG=BnX3u_Wy&qEGS=NA|T_^#U z`ArrBeh)>}Uz`{>+`Ge(sk~58^(*{F^F2b|FYmT<8%Eq|uIe{g^mwkZP?X%d_K!ZF zuZZQ8Gg6q=`RZyvEZ>Gy4DC7szU?Q;|1tJDMb*#sQ@<}m2Fm$;CE}*oZq-i{;>1cR zY2WslJz3keF>&33x*SPM$Vl$7*-cr)}nM26)mZiXzR43d6uNX;l}x z(J5p|#n2W}L|e5+ROCyFs!w_iH2Om?5+Zw&7gjd|i_)s@d9mtgh*j>+!d;+Am>pJB zRD7b5?c~g>?|Q|v4DI^>F89LK<2(az!f7j{J6|>?%ja!~p}7UQg(c(g@se7xsBQI` z3|0WxBN^gxxuWVn2yBSEiWPu+i)3m-3UXysy*jU@&o;DMgKi=abC%WmUgzV*OhfVi=mzzH!g>?f}h-pVHj3tnvMMMRwW> z)cLYK!Klr9XdAhU7<5VeoeiF$8LvaCe_!xLvRe8{O+z-lpzKa_X9jOqU6@UGrCy^e z{cWJaRJHi}N9Q;D$g++64Gd1icBx*rHq*VV$!a0+4YFDq`zgRNLpJU3_KsI05_i4{ z?)FaFGsapat9NWMLTpo8!i>6XACWjy8!Tx261}kz;`29V8(hLCEB*LiX&5ua>d!5P zLsx#XN^O#Ah!-oFjjMXcjgYRRh$P`nU7DoSrjY3{A2mH&8hz99<1h8KyKnD|412Eq zZi)(1Fz!aK}Z%?|ENcUIq6)7QhE;8I#l(GIi>5$#l+a4kdX)M(K(Eki^*RVQ4_ lkUBM5G)>D8(N5I~_dk=2+mgy|Mo<6%002ovPDHLkV1f_i&Wiv5 literal 0 HcmV?d00001 From ae73305f84e4dde3b2cc85c565fccb831fb2d4b4 Mon Sep 17 00:00:00 2001 From: Maksim Date: Mon, 2 Mar 2020 21:25:04 +0800 Subject: [PATCH 027/375] =?UTF-8?q?=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/socketio/DesignerSocketIO.java | 167 +++++++----------- 1 file changed, 63 insertions(+), 104 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 63bc3d999..e2b13b1ad 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -13,6 +13,7 @@ import com.fr.report.RemoteDesignConstants; import com.fr.serialization.SerializerHelper; import com.fr.stable.ArrayUtils; import com.fr.third.apache.log4j.spi.LoggingEvent; +import com.fr.third.guava.base.Optional; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.base.WorkspaceConstants; @@ -35,19 +36,28 @@ public class DesignerSocketIO { Disconnecting } - private static Socket socket = null; + private static Optional socketIO = Optional.absent(); private static Status status = Status.Disconnected; - //维护一个当前工作环境的uri列表 - private static String[] uri; - //维护一个关于uri列表的计数器 - private static int count; + private static final Emitter.Listener printLog = new Emitter.Listener() { + @Override + public void call(Object... objects) { + if (ArrayUtils.isNotEmpty(objects)) { + try { + LoggingEvent event = SerializerHelper.deserialize((byte[]) objects[0]); + DesignerLogger.log(event); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } + }; public static void close() { - if (socket != null) { + if (socketIO.isPresent()) { status = Status.Disconnecting; - socket.close(); - socket = null; + socketIO.get().close(); + socketIO = Optional.absent(); } } @@ -56,42 +66,57 @@ public class DesignerSocketIO { if (current.isLocal()) { return; } - //每当更换工作环境,更新uri列表,同时更新计数器count - try { - uri = getSocketUri(); - } catch (IOException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - count = 0; - //建立socket并注册监听 - createSocket(); - } - - private static void createSocket(){ - //根据uri和计数器建立连接,并注册监听 try { - if(count Date: Mon, 2 Mar 2020 21:27:45 +0800 Subject: [PATCH 028/375] =?UTF-8?q?=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/socketio/DesignerSocketIO.java | 167 +++++++++++------- 1 file changed, 104 insertions(+), 63 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index e2b13b1ad..63bc3d999 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -13,7 +13,6 @@ import com.fr.report.RemoteDesignConstants; import com.fr.serialization.SerializerHelper; import com.fr.stable.ArrayUtils; import com.fr.third.apache.log4j.spi.LoggingEvent; -import com.fr.third.guava.base.Optional; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.base.WorkspaceConstants; @@ -36,28 +35,19 @@ public class DesignerSocketIO { Disconnecting } - private static Optional socketIO = Optional.absent(); + private static Socket socket = null; private static Status status = Status.Disconnected; + //维护一个当前工作环境的uri列表 + private static String[] uri; + //维护一个关于uri列表的计数器 + private static int count; - private static final Emitter.Listener printLog = new Emitter.Listener() { - @Override - public void call(Object... objects) { - if (ArrayUtils.isNotEmpty(objects)) { - try { - LoggingEvent event = SerializerHelper.deserialize((byte[]) objects[0]); - DesignerLogger.log(event); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - } - }; public static void close() { - if (socketIO.isPresent()) { + if (socket != null) { status = Status.Disconnecting; - socketIO.get().close(); - socketIO = Optional.absent(); + socket.close(); + socket = null; } } @@ -66,57 +56,42 @@ public class DesignerSocketIO { if (current.isLocal()) { return; } + //每当更换工作环境,更新uri列表,同时更新计数器count try { - String[] uri = getSocketUri(current); - socketIO = Optional.of(IO.socket(new URI(uri[0]))); - socketIO.get().on(WorkspaceConstants.WS_LOGRECORD, printLog); - socketIO.get().on(WorkspaceConstants.CONFIG_MODIFY, new Emitter.Listener() { - @Override - public void call(Object... objects) { - assert objects != null && objects.length == 1; - String param = (String) objects[0]; - EventDispatcher.fire(RemoteConfigEvent.EDIT, param); - } - }); - socketIO.get().on(Socket.EVENT_DISCONNECT, new Emitter.Listener() { - @Override - public void call(Object... objects) { - /* - * todo 远程心跳断开不一定 socketio 断开 和远程紧密相关的业务都绑定在心跳上,切换成心跳断开之后进行提醒, - * socketio 只用推日志和通知配置变更 - */ - if (status != Status.Disconnecting) { - try { - UIUtil.invokeAndWaitIfNeeded(new Runnable() { - @Override - public void run() { - JOptionPane.showMessageDialog( - DesignerContext.getDesignerFrame(), - Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), - UIManager.getString("OptionPane.messageDialogTitle"), - JOptionPane.ERROR_MESSAGE, - UIManager.getIcon("OptionPane.errorIcon")); - EnvChangeEntrance.getInstance().chooseEnv(); - } - }); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - status = Status.Disconnected; - } - }); - socketIO.get().connect(); - status = Status.Connected; + uri = getSocketUri(); + } catch (IOException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + count = 0; + //建立socket并注册监听 + createSocket(); + } + + private static void createSocket(){ + //根据uri和计数器建立连接,并注册监听 + try { + if(count Date: Tue, 3 Mar 2020 10:43:52 +0800 Subject: [PATCH 029/375] =?UTF-8?q?=E9=80=9A=E8=BF=87=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E6=9D=A5=E5=A4=84=E7=90=86=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E4=BA=8E=E4=BC=A0=E5=85=A5=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 2 +- .../design/write/submit/CheckServiceDialog.java | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 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 9a368f342..eca98c8be 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -244,7 +244,7 @@ public class EnvChangeEntrance { textBuilder.append(descriptionOfCN).append("\n"); } String areaText = textBuilder.toString(); - CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), selectedEnv, areaText, localBranch, remoteBranch); + CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), areaText, localBranch, remoteBranch); dialog.setVisible(true); } } diff --git a/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java b/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java index c88fa1fd9..a5f5d752b 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java @@ -1,6 +1,6 @@ package com.fr.design.write.submit; -import com.fr.design.env.DesignerWorkspaceInfo; +import com.fr.design.DesignerEnvManager; import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; @@ -36,11 +36,9 @@ public class CheckServiceDialog extends JDialog implements ActionListener { private JPanel centerPanel; private JPanel bottomPanel; private UICheckBox remindBox; - private DesignerWorkspaceInfo selectEnv; - public CheckServiceDialog(Frame parent, DesignerWorkspaceInfo selectEnv, String areaText, String localBranch, String remoteBranch){ + public CheckServiceDialog(Frame parent, String areaText, String localBranch, String remoteBranch){ super(parent,true); - this.selectEnv = selectEnv; //上面的标签面板 topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel imagePanel = new JPanel(); @@ -114,15 +112,12 @@ public class CheckServiceDialog extends JDialog implements ActionListener { @Override public void actionPerformed(ActionEvent e) { - boolean needRemind = remindBox.isSelected(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); String remindTime = format.format(new Date()); - if(needRemind){ - //前面做过验证,一定是远程环境,直接强转 - ((RemoteDesignerWorkspaceInfo)selectEnv).setRemindTime(remindTime); - }else { - ((RemoteDesignerWorkspaceInfo)selectEnv).setRemindTime(""); - } + //环境已切换,通过当前环境获取,一定是远程环境 + String currentEnvName = DesignerEnvManager.getEnvManager().getCurEnvName(); + RemoteDesignerWorkspaceInfo currentEnv = (RemoteDesignerWorkspaceInfo)DesignerEnvManager.getEnvManager().getWorkspaceInfo(currentEnvName); + currentEnv.setRemindTime(remindBox.isSelected()? remindTime : ""); } }; From ff7e4b8cc2dcda07f27d2a8c20390d81872bb3b2 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 3 Mar 2020 15:53:06 +0800 Subject: [PATCH 030/375] =?UTF-8?q?MOBILE-25437=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=BF=AB=E9=80=9F=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E5=8A=9F=E8=83=BD=E4=BE=A7=E8=BE=B9=E6=A0=8F?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/MobileBookMarkStyleDefinePane.java | 6 +- .../mobile/ui/MobileBookMarkStylePane.java | 16 +- ...arMobileBookMarkStyleCustomDefinePane.java | 387 ++++++++++++++++++ .../SidebarMobileBookMarkStyleProvider.java | 30 ++ 4 files changed, 436 insertions(+), 3 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleProvider.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileBookMarkStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileBookMarkStyleDefinePane.java index 0a480d99a..7812e8f32 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileBookMarkStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileBookMarkStyleDefinePane.java @@ -30,11 +30,15 @@ public class MobileBookMarkStyleDefinePane extends BasicBeanPane { + public static final int LEFT_PANEL_WIDTH = 140; + public static final int LEFT_PANEL_HEIGHT = 565; + public static final int RIGHT_PANEL_WIDTH = 510; + public static final int RIGHT_PANEL_HEIGHT = 565; + public static ListCellRenderer renderer = new DefaultListCellRenderer() { @Override @@ -48,6 +55,7 @@ public class MobileBookMarkStylePane extends BasicBeanPane private void initComponent() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); this.listModel = new DefaultListModel<>(); this.card = new CardLayout(); this.rightPane = FRGUIPaneFactory.createCardLayout_S_Pane(); @@ -79,14 +87,16 @@ public class MobileBookMarkStylePane extends BasicBeanPane } }); JPanel leftPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + leftPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); leftPanel.add(bookMarkList, BorderLayout.CENTER); - leftPanel.setPreferredSize(new Dimension(100, 500)); + leftPanel.setPreferredSize(new Dimension(LEFT_PANEL_WIDTH, LEFT_PANEL_HEIGHT)); this.add(leftPanel, BorderLayout.WEST); } private void initRightPanel() { JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - centerPane.setPreferredSize(new Dimension(500, 500)); + centerPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + centerPane.setPreferredSize(new Dimension(RIGHT_PANEL_WIDTH, RIGHT_PANEL_HEIGHT)); centerPane.add(rightPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER); } @@ -94,10 +104,12 @@ public class MobileBookMarkStylePane extends BasicBeanPane private List getMobileBookMarkStyleProvider() { DefaultMobileBookMarkStyleProvider defaultMobileBookMarkStyleProvider = new DefaultMobileBookMarkStyleProvider(); + SidebarMobileBookMarkStyleProvider sidebarMobileBookMarkStyleProvider = new SidebarMobileBookMarkStyleProvider(); Set mobileBookMarkStyleProviders = ExtraDesignClassManager.getInstance().getArray( MobileBookMarkStyleProvider.XML_TAG); List list = new ArrayList<>(); list.add(defaultMobileBookMarkStyleProvider); + list.add(sidebarMobileBookMarkStyleProvider); list.addAll(mobileBookMarkStyleProviders); return Collections.unmodifiableList(list); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java new file mode 100644 index 000000000..79bab33df --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java @@ -0,0 +1,387 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.base.BaseUtils; +import com.fr.base.Utils; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.ibutton.UIColorButton; +import com.fr.design.gui.ibutton.UIToggleButton; +import com.fr.design.gui.icombobox.LineComboBox; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UnsignedIntUISpinner; +import com.fr.design.gui.style.FRFontPane; +import com.fr.design.gui.style.NumberDragBar; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.style.color.ColorSelectBox; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.form.ui.mobile.MobileBookMarkStyle; +import com.fr.form.ui.mobile.impl.SidebarMobileBookMarkStyle; +import com.fr.stable.CoreConstants; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.*; + +/** + * @author Starryi + * @version 10.0 + * Created by Starryi on 2020/02/28 + */ +public class SidebarMobileBookMarkStyleCustomDefinePane extends BasicBeanPane { + private static final long serialVersionUID = 1L; + + private static final int COLUMN_WIDTH = 160; + + private UnsignedIntUISpinner buttonWidthSpinner; + private UnsignedIntUISpinner buttonHeightSpinner; + private UnsignedIntUISpinner buttonGapSpinner; + private UnsignedIntUISpinner buttonBorderRadiusSpinner; + + private ColorSelectBox normalBackgroundColorBox; + private NumberDragBar normalOpacityDragBar; + private UnsignedIntUISpinner normalOpacitySpinner; + private LineComboBox normalBorderWidthComBox; + private ColorSelectBox normalBorderColorBox; + private UIComboBox normalFontNameComboBox; + private UIComboBox normalFontSizeComboBox; + private UIColorButton normalFontColorButton; + private UIToggleButton normalFontItalicButton; + private UIToggleButton normalFontBoldButton; + + private ColorSelectBox selectedBackgroundColorBox; + private NumberDragBar selectedOpacityDragBar; + private UnsignedIntUISpinner selectedOpacitySpinner; + private LineComboBox selectedBorderWidthComBox; + private ColorSelectBox selectedBorderColorBox; + private UIComboBox selectedFontNameComboBox; + private UIComboBox selectedFontSizeComboBox; + private UIColorButton selectedFontColorButton; + private UIToggleButton selectedFontItalicButton; + private UIToggleButton selectedFontBoldButton; + + private SidebarMobileBookMarkStyle DEFAULT_STYLE = new SidebarMobileBookMarkStyle(); + + public SidebarMobileBookMarkStyleCustomDefinePane() { + this.initComponent(); + } + + private void initComponent() { + this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + this.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); + + this.add(this.createNavButtonStylePanel()); + this.add(this.createNormalStateStylePanel()); + this.add(this.createSelectedStateStylePanel()); + } + + private JPanel createNavButtonStylePanel() { + + buttonWidthSpinner = new UnsignedIntUISpinner(20, 150, 1, DEFAULT_STYLE.getWidth()); + buttonHeightSpinner = new UnsignedIntUISpinner(20, 100, 1, DEFAULT_STYLE.getHeight()); + buttonGapSpinner = new UnsignedIntUISpinner(0, Integer.MAX_VALUE, 1, DEFAULT_STYLE.getGap()); + buttonBorderRadiusSpinner = new UnsignedIntUISpinner(0, Integer.MAX_VALUE, 1, DEFAULT_STYLE.getBorderRadius()); + + UILabel sizeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Button_Size") + ":", + SwingConstants.RIGHT); + JPanel sizePane = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 5, 0); + sizePane.add(buttonWidthSpinner); + sizePane.add(buttonHeightSpinner); + + JPanel sizeTipsPane = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 5, 0); + sizeTipsPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Button_Width"), + SwingConstants.CENTER)); + sizeTipsPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Button_Height"), + SwingConstants.CENTER)); + + UILabel gapLabel = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Button_Gap") + ":", + SwingConstants.RIGHT); + UILabel borderRadiusLabel = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Button_Border_Radius") + ":", + SwingConstants.RIGHT); + + double p = TableLayout.PREFERRED; + double[] rowSize = {p, p, p, p}; + double[] columnSize = {p, COLUMN_WIDTH}; + double[] verticalGaps = {0, 10, 10}; + + JPanel navButtonSettingsPanel = TableLayoutHelper.createDiffVGapTableLayoutPane(new JComponent[][]{ + {sizeLabel, sizePane}, + {null, sizeTipsPane}, + {gapLabel, buttonGapSpinner}, + {borderRadiusLabel, buttonBorderRadiusSpinner}, + }, rowSize, columnSize, 5, verticalGaps); + + navButtonSettingsPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); + + JPanel containerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + containerPane.setBorder(GUICoreUtils.createTitledBorder(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Button_Style"), + Color.decode("#2F8EF1"))); + containerPane.add(navButtonSettingsPanel); + + return containerPane; + } + + private JPanel createNormalStateStylePanel() { + double p = TableLayout.PREFERRED; + + normalBackgroundColorBox = new ColorSelectBox(COLUMN_WIDTH); + normalBackgroundColorBox.setSelectObject(DEFAULT_STYLE.getBackgroundColor()); + normalOpacityDragBar = new NumberDragBar(0, 100); + normalOpacityDragBar.setValue(DEFAULT_STYLE.getOpacity()); + normalOpacityDragBar.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + normalOpacitySpinner.setValue(normalOpacityDragBar.getValue()); + } + }); + normalOpacitySpinner = new UnsignedIntUISpinner(0, 100, 1, DEFAULT_STYLE.getOpacity()); + normalOpacitySpinner.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + normalOpacityDragBar.setValue((int) normalOpacitySpinner.getValue()); + } + }); + normalBorderWidthComBox = new LineComboBox(CoreConstants.UNDERLINE_STYLE_ARRAY); + normalBorderWidthComBox.setSelectedLineStyle(DEFAULT_STYLE.getBorderWidth()); + normalBorderColorBox = new ColorSelectBox(COLUMN_WIDTH); + normalBorderColorBox.setSelectObject(DEFAULT_STYLE.getBorderColor()); + normalFontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + normalFontNameComboBox.setSelectedItem(DEFAULT_STYLE.getSelectedFontFamily()); + normalFontSizeComboBox = new UIComboBox(FRFontPane.FONT_SIZES); + normalFontSizeComboBox.setSelectedItem(DEFAULT_STYLE.getFontSize()); + normalFontColorButton = new UIColorButton(); + normalFontColorButton.setColor(DEFAULT_STYLE.getFontColor()); + normalFontItalicButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); + normalFontItalicButton.setSelected(DEFAULT_STYLE.isFontItalic()); + normalFontBoldButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); + normalFontBoldButton.setSelected(DEFAULT_STYLE.isFontBold()); + + JPanel opacityPane = new JPanel(new BorderLayout(0, 0)); + JPanel jp = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 5, 0); + jp.add(normalOpacityDragBar); + jp.add(normalOpacitySpinner); + opacityPane.add(jp, BorderLayout.CENTER); + + JPanel fontExtraPane = TableLayoutHelper.createGapTableLayoutPane( + new JComponent[][]{{normalFontSizeComboBox, normalFontColorButton, normalFontItalicButton, normalFontBoldButton}}, + new double[]{p}, + new double[]{p, p, p, p}, + 0, 5 + ); + + double[] rowSize = {p, p, p, p, p}; + double[] columnSize = {p, COLUMN_WIDTH, p}; + + JPanel normalStateStyleSettingsPanel = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{ + { + new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Background_Color") + ":", SwingConstants.RIGHT), + normalBackgroundColorBox + }, + { + new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Opacity") + ":", SwingConstants.RIGHT), + opacityPane, + new UILabel("%") + }, + { + new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Border_Width") + ":", SwingConstants.RIGHT), + normalBorderWidthComBox + }, + { + new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Border_Color") + ":", SwingConstants.RIGHT), + normalBorderColorBox + }, + { + new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Font") + ":", SwingConstants.RIGHT), + normalFontNameComboBox, + fontExtraPane + } + }, rowSize, columnSize, 5, 10); + normalStateStyleSettingsPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); + + JPanel containerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + containerPane.setBorder( + GUICoreUtils.createTitledBorder(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Normal_Style"), + Color.decode("#2F8EF1")) + ); + containerPane.add(normalStateStyleSettingsPanel); + + return containerPane; + } + + private JPanel createSelectedStateStylePanel() { + double p = TableLayout.PREFERRED; + + selectedBackgroundColorBox = new ColorSelectBox(COLUMN_WIDTH); + selectedBackgroundColorBox.setSelectObject(DEFAULT_STYLE.getSelectedBackgroundColor()); + selectedOpacityDragBar = new NumberDragBar(0, 100); + selectedOpacityDragBar.setValue(DEFAULT_STYLE.getSelectedOpacity()); + selectedOpacityDragBar.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + selectedOpacitySpinner.setValue(selectedOpacityDragBar.getValue()); + } + }); + selectedOpacitySpinner = new UnsignedIntUISpinner(0, 100, 1, DEFAULT_STYLE.getSelectedOpacity()); + selectedOpacitySpinner.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + selectedOpacityDragBar.setValue((int) selectedOpacitySpinner.getValue()); + } + }); + selectedBorderWidthComBox = new LineComboBox(CoreConstants.UNDERLINE_STYLE_ARRAY); + selectedBorderWidthComBox.setSelectedLineStyle(DEFAULT_STYLE.getSelectedBorderWidth()); + selectedBorderColorBox = new ColorSelectBox(COLUMN_WIDTH); + selectedBorderColorBox.setSelectObject(DEFAULT_STYLE.getSelectedBorderColor()); + selectedFontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + selectedFontNameComboBox.setSelectedItem(DEFAULT_STYLE.getSelectedFontFamily()); + selectedFontSizeComboBox = new UIComboBox(FRFontPane.FONT_SIZES); + selectedFontSizeComboBox.setSelectedItem(DEFAULT_STYLE.getSelectedFontSize()); + selectedFontColorButton = new UIColorButton(); + selectedFontColorButton.setColor(DEFAULT_STYLE.getSelectedFontColor()); + selectedFontItalicButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); + selectedFontItalicButton.setSelected(DEFAULT_STYLE.isSelectedFontItalic()); + selectedFontBoldButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); + selectedFontBoldButton.setSelected(DEFAULT_STYLE.isSelectedFontBold()); + + JPanel opacityPane = new JPanel(new BorderLayout(0, 0)); + JPanel jp = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 5, 0); + jp.add(selectedOpacityDragBar); + jp.add(selectedOpacitySpinner); + opacityPane.add(jp, BorderLayout.CENTER); + + JPanel fontExtraPane = TableLayoutHelper.createGapTableLayoutPane( + new JComponent[][]{{selectedFontSizeComboBox, selectedFontColorButton, selectedFontItalicButton, selectedFontBoldButton}}, + new double[]{p}, + new double[]{p, p, p, p}, + 0, 5 + ); + + double[] rowSize = {p, p, p, p, p}; + double[] columnSize = {p, COLUMN_WIDTH, p}; + + JPanel selectedStateStyleSettingsPanel = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{ + { + new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Background_Color") + ":", SwingConstants.RIGHT), + selectedBackgroundColorBox + }, + { + new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Opacity") + ":", SwingConstants.RIGHT), + opacityPane, + new UILabel("%") + }, + { + new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Border_Width") + ":", SwingConstants.RIGHT), + selectedBorderWidthComBox + }, + { + new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Border_Color") + ":", SwingConstants.RIGHT), + selectedBorderColorBox + }, + { + new UILabel(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Font") + ":", SwingConstants.RIGHT), + selectedFontNameComboBox, + fontExtraPane + } + }, rowSize, columnSize, 5, 10); + selectedStateStyleSettingsPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); + + JPanel containerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + containerPane.setBorder( + GUICoreUtils.createTitledBorder(Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar_Selected_Style"), + Color.decode("#2F8EF1")) + ); + containerPane.add(selectedStateStyleSettingsPanel); + + return containerPane; + } + + @Override + public void populateBean(MobileBookMarkStyle ob) { + SidebarMobileBookMarkStyle style = null; + if (ob instanceof SidebarMobileBookMarkStyle) { + style = (SidebarMobileBookMarkStyle) ob; + } + if (style == null) { + return; + } + + buttonWidthSpinner.setValue(style.getWidth()); + buttonHeightSpinner.setValue(style.getHeight()); + buttonGapSpinner.setValue(style.getGap()); + buttonBorderRadiusSpinner.setValue(style.getBorderRadius()); + + normalBackgroundColorBox.setSelectObject(style.getBackgroundColor()); + normalOpacityDragBar.setValue(style.getOpacity()); + normalOpacitySpinner.setValue(style.getOpacity()); + normalBorderWidthComBox.setSelectedLineStyle(style.getBorderWidth()); + normalBorderColorBox.setSelectObject(style.getBorderColor()); + normalFontNameComboBox.setSelectedItem(style.getFontFamily()); + normalFontSizeComboBox.setSelectedItem(style.getFontSize()); + normalFontColorButton.setColor(style.getFontColor()); + normalFontItalicButton.setSelected(style.isFontItalic()); + normalFontBoldButton.setSelected(style.isFontBold()); + + selectedBackgroundColorBox.setSelectObject(style.getSelectedBackgroundColor()); + selectedOpacityDragBar.setValue(style.getSelectedOpacity()); + selectedOpacitySpinner.setValue(style.getSelectedOpacity()); + selectedBorderWidthComBox.setSelectedLineStyle(style.getSelectedBorderWidth()); + selectedBorderColorBox.setSelectObject(style.getSelectedBorderColor()); + selectedFontNameComboBox.setSelectedItem(style.getSelectedFontFamily()); + selectedFontSizeComboBox.setSelectedItem(style.getSelectedFontSize()); + selectedFontColorButton.setColor(style.getSelectedFontColor()); + selectedFontItalicButton.setSelected(style.isSelectedFontItalic()); + selectedFontBoldButton.setSelected(style.isSelectedFontBold()); + } + + @Override + public MobileBookMarkStyle updateBean() { + SidebarMobileBookMarkStyle style = new SidebarMobileBookMarkStyle(); + + style.setWidth((int) buttonWidthSpinner.getValue()); + style.setHeight((int) buttonHeightSpinner.getValue()); + style.setGap((int) buttonGapSpinner.getValue()); + style.setBorderRadius((int) buttonBorderRadiusSpinner.getValue()); + + if (normalBackgroundColorBox.getSelectObject() != null) { + style.setBackgroundColor(normalBackgroundColorBox.getSelectObject()); + } + style.setOpacity((int) normalOpacitySpinner.getValue()); + style.setBorderWidth(normalBorderWidthComBox.getSelectedLineStyle()); + style.setBorderColor(normalBorderColorBox.getSelectObject()); + if (normalFontNameComboBox.getSelectedItem() != null) { + style.setFontFamily((String) normalFontNameComboBox.getSelectedItem()); + } + if (normalFontSizeComboBox.getSelectedItem() != null) { + style.setFontSize((Integer) normalFontSizeComboBox.getSelectedItem()); + } + style.setFontColor(normalFontColorButton.getColor()); + style.setFontItalic(normalFontItalicButton.isSelected()); + style.setFontBold(normalFontBoldButton.isSelected()); + + if (selectedBackgroundColorBox.getSelectObject() != null) { + style.setSelectedBackgroundColor(selectedBackgroundColorBox.getSelectObject()); + } + style.setSelectedOpacity((int) selectedOpacitySpinner.getValue()); + style.setSelectedBorderWidth(selectedBorderWidthComBox.getSelectedLineStyle()); + style.setSelectedBorderColor(selectedBorderColorBox.getSelectObject()); + if (selectedFontNameComboBox.getSelectedItem() != null) { + style.setSelectedFontFamily((String) selectedFontNameComboBox.getSelectedItem()); + } + if (selectedFontSizeComboBox.getSelectedItem() != null) { + style.setSelectedFontSize((Integer) selectedFontSizeComboBox.getSelectedItem()); + } + style.setSelectedFontColor(selectedFontColorButton.getColor()); + style.setSelectedFontItalic(selectedFontItalicButton.isSelected()); + style.setSelectedFontBold(selectedFontBoldButton.isSelected()); + + return style; + } + + @Override + protected String title4PopupWindow() { + return null; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleProvider.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleProvider.java new file mode 100644 index 000000000..7c9202f3f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleProvider.java @@ -0,0 +1,30 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.fun.impl.AbstractMobileBookMarkStyleProvider; +import com.fr.design.i18n.Toolkit; +import com.fr.form.ui.mobile.MobileBookMarkStyle; +import com.fr.form.ui.mobile.impl.SidebarMobileBookMarkStyle; + +/** + * @author Starryi + * @version 10.0 + * Created by Starryi on 2020/02/28 + */ +public class SidebarMobileBookMarkStyleProvider extends AbstractMobileBookMarkStyleProvider { + + @Override + public Class classForMobileBookMarkStyle() { + return SidebarMobileBookMarkStyle.class; + } + + @Override + public Class> classForMobileBookMarkStyleAppearance() { + return SidebarMobileBookMarkStyleCustomDefinePane.class; + } + + @Override + public String displayName() { + return Toolkit.i18nText("Fine-Design_Mobile_BookMark_Style_Sidebar"); + } +} From 4d8f4b2f5c5fa36f470b6c0e52af3ceaf12c05fe Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Tue, 3 Mar 2020 16:44:43 +0800 Subject: [PATCH 031/375] =?UTF-8?q?REPORT-26915=20=E7=96=AB=E6=83=85?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=A8=A1=E6=9D=BF=E5=AF=BC=E5=87=BA=E5=86=85?= =?UTF-8?q?=E7=BD=AE=E6=A8=A1=E6=9D=BF=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/file/export/AbstractExportAction.java | 4 ++-- .../src/main/java/com/fr/file/RenameExportFILE.java | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java b/designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java index 17d19aab7..4f8424c41 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java @@ -177,9 +177,9 @@ public abstract class AbstractExportAction> extends JT } catch (RemoteDesignPermissionDeniedException exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); this.setProgress(100); target.closeTemplate(); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); JOptionPane.showMessageDialog( DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Engine_Remote_Design_Permission_Denied"), @@ -188,9 +188,9 @@ public abstract class AbstractExportAction> extends JT UIManager.getIcon("OptionPane.errorIcon") ); } catch (Exception exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); this.setProgress(100); target.closeTemplate(); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); JOptionPane.showMessageDialog( DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Report_Export_Failed") + "\n" + path, diff --git a/designer-base/src/main/java/com/fr/file/RenameExportFILE.java b/designer-base/src/main/java/com/fr/file/RenameExportFILE.java index 8b03e943f..75583051d 100644 --- a/designer-base/src/main/java/com/fr/file/RenameExportFILE.java +++ b/designer-base/src/main/java/com/fr/file/RenameExportFILE.java @@ -99,4 +99,9 @@ public class RenameExportFILE extends AbstractFILE { } return out; } + + @Override + public void closeTemplate() throws Exception { + //do nothing + } } \ No newline at end of file From d325410286cbe8b3de5ae33fc7eb129105afbacc Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 3 Mar 2020 23:01:36 +0800 Subject: [PATCH 032/375] =?UTF-8?q?CHART-9435=20=E8=AF=95=E7=AE=A1?= =?UTF-8?q?=E5=9E=8B=E4=BB=AA=E8=A1=A8=E7=9B=98=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../series/VanChartAbstractPlotSeriesPane.java | 7 +++++++ .../chart/gauge/VanChartGaugeSeriesPane.java | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) 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 47b205f85..cea370897 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 @@ -166,6 +166,13 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP return ((VanChartPlot) plot).isInCustom() ? null : radiusPaneWithTitle; } + //沿用半径界面,使用不同的title和radius + protected JPanel createRadiusPane(String title) { + radiusPane = initRadiusPane(); + radiusPaneWithTitle = TableLayout4VanChartHelper.createGapTableLayoutPane(title, radiusPane); + return ((VanChartPlot) plot).isInCustom() ? null : radiusPaneWithTitle; + } + //大数据模式 恢复用注释。删除下面4个方法 createLargeDataModelPane checkLarge createLargeDataModelPane createLargeDataModelGroup。 protected JPanel createLargeDataModelPane() { largeDataModelGroup = createLargeDataModelGroup(); 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 79509aee2..6fc02b40e 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 @@ -4,6 +4,7 @@ import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; +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.gui.ChartStylePane; @@ -46,6 +47,8 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { private UIColorPickerPane colorPickerPane; + private UISpinner thermometerWidth; + public VanChartGaugeSeriesPane(ChartStylePane parent, Plot plot) { super(parent, plot); } @@ -133,7 +136,8 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { new Component[]{null, null}, getNeedleColor(), getSlotBackgroundColor(), - new Component[]{createRadiusPane(), null} + new Component[]{createRadiusPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Length_Set")), null}, + getThermometerWidth() }; default: return new Component[][]{ @@ -172,6 +176,11 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { return new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Slot_Background")),slotBackgroundColor}; } + private Component[] getThermometerWidth() { + thermometerWidth = new UISpinner(0, Double.MAX_VALUE, 0.1, 10); + return new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Thermometer_Width")),thermometerWidth}; + } + private void initRotate() { rotate = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_AntiClockWise"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ClockWise")}); } @@ -218,6 +227,9 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { if(innerPaneBackgroundColor != null){ innerPaneBackgroundColor.setSelectObject(detailStyle.getInnerPaneBackgroundColor()); } + if(thermometerWidth != null){ + thermometerWidth.setValue(detailStyle.getThermometerWidth()); + } colorPickerPane.populateBean(detailStyle.getHotAreaColor()); } @@ -256,6 +268,9 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { if(innerPaneBackgroundColor != null){ detailStyle.setInnerPaneBackgroundColor(innerPaneBackgroundColor.getSelectObject()); } + if(thermometerWidth != null){ + detailStyle.setThermometerWidth(thermometerWidth.getValue()); + } colorPickerPane.updateBean(detailStyle.getHotAreaColor()); } From 0fbd73b454d0f86cc07493a7ad9cec66e9eb1229 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 4 Mar 2020 09:48:12 +0800 Subject: [PATCH 033/375] =?UTF-8?q?CHART-9435=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=8D=8A=E5=BE=84=E8=AE=BE=E7=BD=AE=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/series/VanChartAbstractPlotSeriesPane.java | 7 ------- .../com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java | 6 +++--- .../java/com/fr/van/chart/pie/VanChartPieSeriesPane.java | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) 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 cea370897..eec3cf9a1 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 @@ -160,13 +160,6 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP } //半径界面 - protected JPanel createRadiusPane() { - radiusPane = initRadiusPane(); - radiusPaneWithTitle = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set"), radiusPane); - return ((VanChartPlot) plot).isInCustom() ? null : radiusPaneWithTitle; - } - - //沿用半径界面,使用不同的title和radius protected JPanel createRadiusPane(String title) { radiusPane = initRadiusPane(); radiusPaneWithTitle = TableLayout4VanChartHelper.createGapTableLayoutPane(title, radiusPane); 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 6fc02b40e..e553306a2 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 @@ -122,14 +122,14 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { new Component[]{null, null}, getPaneBackgroundColor(), getInnerPaneBackgroundColor(), - new Component[]{createRadiusPane(), null} + new Component[]{createRadiusPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null} }; case SLOT: return new Component[][]{ new Component[]{null, null}, getNeedleColor(), getSlotBackgroundColor(), - new Component[]{createRadiusPane(), null} + new Component[]{createRadiusPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null} }; case THERMOMETER: return new Component[][]{ @@ -146,7 +146,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { getHingeBackgroundColor(), getNeedleColor(), getPaneBackgroundColor(), - new Component[]{createRadiusPane(), null} + new Component[]{createRadiusPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null} }; } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java index 0ec79c3b8..752d7c309 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java @@ -61,7 +61,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane { new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Angle")),startAngle}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Angle")),endAngle}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Inner_Radius")),innerRadius}, - new Component[]{createRadiusPane(),null}, + new Component[]{createRadiusPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set")),null}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Rotation")),supportRotation} }; From 138114a6644091542708b044b3eeeaf8788bfd9b Mon Sep 17 00:00:00 2001 From: lucian Date: Wed, 4 Mar 2020 10:38:29 +0800 Subject: [PATCH 034/375] =?UTF-8?q?REPORT-25688=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5war=E5=8C=85=E9=83=A8=E7=BD=B2=E7=9A=84?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=EF=BC=8C=E8=BF=9E=E6=8E=A5=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E6=8F=90=E7=A4=BAwar=E5=8C=85=E9=83=A8?= =?UTF-8?q?=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 5 ++ .../com/fr/design/env/RemoteWorkspace.java | 10 +++- .../fr/design/env/RemoteWorkspaceTest.java | 54 +++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 designer-base/src/test/java/com/fr/design/env/RemoteWorkspaceTest.java 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 eca98c8be..3a0d66774 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -131,6 +131,11 @@ public class EnvChangeEntrance { } } }); + // REPORT-25688如果是war包部署的服务器,给与提示 + if (WorkContext.getCurrent().isWarDeploy()) { + FineJOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Basic_War_Deploy_Tip"), + Toolkit.i18nText("Fine-Design_Basic_Message"), JOptionPane.INFORMATION_MESSAGE); + } //REPORT-13810如果只是添加了工作目录,没有切换,这里ToolArea也是要显示新建的工作目录 JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (template != null) { diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java index cc7b02c7b..735c1a5bd 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java @@ -2,6 +2,9 @@ package com.fr.design.env; import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.design.i18n.Toolkit; +import com.fr.invoke.ReflectException; +import com.fr.log.FineLoggerFactory; +import com.fr.base.operator.common.CommonOperator; import com.fr.rpc.ExceptionHandler; import com.fr.stable.AssistUtils; import com.fr.workspace.WorkContext; @@ -49,7 +52,12 @@ public class RemoteWorkspace implements Workspace { @Override public boolean isWarDeploy() { - return false; + try { + return WorkContext.getCurrent().get(CommonOperator.class).isWarDeploy(); + } catch (ReflectException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return false; + } } @Override diff --git a/designer-base/src/test/java/com/fr/design/env/RemoteWorkspaceTest.java b/designer-base/src/test/java/com/fr/design/env/RemoteWorkspaceTest.java new file mode 100644 index 000000000..fe7f365e6 --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/env/RemoteWorkspaceTest.java @@ -0,0 +1,54 @@ +package com.fr.design.env; + +import com.fr.base.operator.common.CommonOperator; +import com.fr.invoke.ReflectException; +import com.fr.workspace.WorkContext; +import com.fr.workspace.Workspace; +import com.fr.workspace.connect.WorkspaceConnectionInfo; +import org.easymock.EasyMock; +import org.junit.Assert; +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.modules.junit4.PowerMockRunner; + +/** + * @author Lucian.Chen + * @version 10.0 + * Created by Lucian.Chen on 2020/1/2 + */ +@RunWith(PowerMockRunner.class) +@PrepareForTest({WorkContext.class}) +public class RemoteWorkspaceTest { + @Test + public void testIsWarDeploy() { + + Workspace workspace = EasyMock.mock(Workspace.class); + PowerMock.mockStatic(WorkContext.class); + EasyMock.expect(WorkContext.getCurrent()).andReturn(workspace).anyTimes(); + + CommonOperator operator = EasyMock.createMock(CommonOperator.class); + EasyMock.expect(workspace.get(CommonOperator.class)).andReturn(operator).anyTimes(); + + EasyMock.expect(operator.isWarDeploy()).andReturn(true).once(); + EasyMock.expect(operator.isWarDeploy()).andReturn(false).once(); + EasyMock.expect(operator.isWarDeploy()).andThrow(new ReflectException()).once(); + + EasyMock.replay(workspace, operator); + PowerMock.replayAll(); + + WorkspaceConnectionInfo info = new WorkspaceConnectionInfo("url", "username", "password", "certPath", "certSecretKey"); + + RemoteWorkspace remoteWorkspace= new RemoteWorkspace(null, info); + + Assert.assertTrue(remoteWorkspace.isWarDeploy()); + Assert.assertFalse(remoteWorkspace.isWarDeploy()); + Assert.assertFalse(remoteWorkspace.isWarDeploy()); + + EasyMock.verify(workspace, operator); + PowerMock.verifyAll(); + + + } +} \ No newline at end of file From 801c6b801545167010101808dd269199f9c4b0a0 Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Wed, 4 Mar 2020 11:57:59 +0800 Subject: [PATCH 035/375] =?UTF-8?q?REPORT-27411=20=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E7=BC=96=E8=BE=91=E5=99=A8=E4=B8=AD=E8=A2=AB=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=96=87=E6=9C=AC=E5=A4=B1=E5=8E=BB=E7=84=A6?= =?UTF-8?q?=E7=82=B9=E5=90=8E=E8=A2=AB=E6=A0=B7=E5=BC=8F=E4=B8=A2=E5=A4=B1?= =?UTF-8?q?=E4=BA=86=EF=BC=88=E8=A2=AB=E9=80=89=E4=B8=AD=E6=97=B6=E9=AB=98?= =?UTF-8?q?=E4=BA=AE=E6=98=BE=E7=A4=BA=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/report/RichTextEditingPane.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/report/RichTextEditingPane.java b/designer-realize/src/main/java/com/fr/design/report/RichTextEditingPane.java index 0406abffb..39061a4b6 100644 --- a/designer-realize/src/main/java/com/fr/design/report/RichTextEditingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/RichTextEditingPane.java @@ -14,9 +14,14 @@ import com.fr.log.FineLoggerFactory; import com.fr.report.cell.cellattr.core.RichText; import com.fr.report.cell.cellattr.core.RichTextConverter; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; +import javax.swing.text.DefaultHighlighter; import javax.swing.text.Element; +import javax.swing.text.Highlighter; import javax.swing.text.StyledDocument; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -44,6 +49,7 @@ public class RichTextEditingPane extends UITextPane{ */ public RichTextEditingPane() { this.addMouseListener(doubleClickFormulaListener); + this.addFocusListener(focusListener); } /** @@ -195,4 +201,34 @@ public class RichTextEditingPane extends UITextPane{ } } }; + + private FocusListener focusListener = new FocusAdapter() { + /** + * 移除高亮,重新选中文本 + * @param e + */ + public void focusGained(FocusEvent e) { + RichTextEditingPane richTextPane = RichTextEditingPane.this; + richTextPane.getHighlighter().removeAllHighlights(); + richTextPane.select(richTextPane.getSelectionStart(), richTextPane.getSelectionEnd()); + } + + /** + * 失去焦点时,被选中的文本保持着被选中时的样式 + * @param e + */ + public void focusLost(FocusEvent e) { + RichTextEditingPane richTextPane = RichTextEditingPane.this; + int start = richTextPane.getSelectionStart(); + int end = richTextPane.getSelectionEnd(); + richTextPane.select(start, end); + Highlighter highlighter = richTextPane.getHighlighter(); + richTextPane.getHighlighter().removeAllHighlights(); + try { + highlighter.addHighlight(start, end, DefaultHighlighter.DefaultPainter); + } catch (BadLocationException exception) { + FineLoggerFactory.getLogger().error(exception.getMessage(), exception); + } + } + }; } \ No newline at end of file From d51e251b926dbd7d993a846c39c6d099d22583f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 4 Mar 2020 16:24:31 +0800 Subject: [PATCH 036/375] =?UTF-8?q?=20CHART-11090=20=E6=A8=A1=E7=B3=8A?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chartx/component/MapAreaMatchPane.java | 2 +- .../chartx/component/MatchAreaTable.java | 4 +-- .../mainframe/chart/gui/ChartDataPane.java | 1 + .../chart/gui/data/TableDataPane.java | 5 +-- .../table/AbstractTableDataContentPane.java | 4 +++ .../designer/data/comp/DrillMapDataPane.java | 4 --- .../comp/EachLayerDataDefinitionPane.java | 3 -- .../type/VanChartDrillMapPlotPane.java | 24 -------------- .../designer/data/VanChartMapDataPane.java | 6 ---- .../VanAreaMapPlotTableDataContentPane.java | 3 ++ .../VanLineMapPlotTableDataContentPane.java | 31 +------------------ .../table/VanMapTableDataContentPane.java | 29 ++++++++++++----- .../VanPointMapPlotTableDataContentPane.java | 17 ++-------- .../designer/type/VanChartMapPlotPane.java | 17 ---------- 14 files changed, 37 insertions(+), 113 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index f37a01c22..f2c4d7bd2 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -261,7 +261,7 @@ public class MapAreaMatchPane extends BasicBeanPane { private void populateMatchData(Object[] columnData) { Set geoAreas = matchAreaTable.getItems(); - Map resultMap = ChartGEOJSONHelper.matchArea(columnData, geoAreas, matchResultTable.getCustomResult()); + Map resultMap = ChartGEOJSONHelper.matchAreaList(columnData, geoAreas, matchResultTable.getCustomResult()); Object[][] data = new Object[resultMap.size()][2]; diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java index e8f98f2a3..2d808e893 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java @@ -1,5 +1,6 @@ package com.fr.design.chartx.component; +import com.fr.base.Utils; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.general.GeneralUtils; @@ -80,8 +81,7 @@ public class MatchAreaTable extends JTable { return; } int index = areaNameIndex.get(areaName); - Map resultMap = ChartGEOJSONHelper.matchArea(new Object[]{areaName}, items); - String result = resultMap.get(areaName); + String result = ChartGEOJSONHelper.matchArea(Utils.objectToString(areaName), items); getColumnModel().getColumn(1).getCellEditor().stopCellEditing(); this.setValueAt(result, index, 1); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java index ad549c5af..aea7142b5 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java @@ -27,6 +27,7 @@ public class ChartDataPane extends AbstractChartAttrPane { public ChartDataPane(AttributeChangeListener listener) { super(); this.listener = listener; + this.addAttributeChangeListener(listener); } @Override diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index f8092b859..886397774 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -15,7 +15,6 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.utils.gui.UIComponentUtils; -import com.fr.van.chart.map.designer.data.contentpane.table.VanMapTableDataContentPane; import javax.swing.BorderFactory; import java.awt.BorderLayout; @@ -128,9 +127,7 @@ public class TableDataPane extends FurtherBasicBeanPane{ } public void refreshLevel(int level){ - if(dataContentPane instanceof VanMapTableDataContentPane) { - ((VanMapTableDataContentPane) dataContentPane).setLevel(level); - } + dataContentPane.refreshLevel(level); } /** diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java index 1bfb9657c..710b2a421 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java @@ -139,4 +139,8 @@ public abstract class AbstractTableDataContentPane extends BasicBeanPane { dataDefinitionType.setSelectedIndex(MapDataPaneHelper.isFromBottomData(ob) ? 0 : 1); - MapMatchResult matchResult = ((VanChartMapPlot) ob.getSelectedChartProvider(Chart.class).getPlot()).getMatchResult(); ChartCollection bottomDataChartCollection = MapDataPaneHelper.getBottomDataDrillMapChartCollection(ob); - ((VanChartMapPlot)bottomDataChartCollection.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult); bottomDataDefinitionPane.populateBean(bottomDataChartCollection, ChartGEOJSONHelper.BOTTOM_LEVEL); eachLayerDataDefinitionPane.populateBean(ob); diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java index 16d989829..37e7f823f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java @@ -11,7 +11,6 @@ import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.drillmap.DrillMapHelper; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.drillmap.data.DrillMapDefinition; -import com.fr.plugin.chart.map.MapMatchResult; import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper; import com.fr.plugin.chart.type.MapType; import com.fr.van.chart.map.designer.data.MapDataPaneHelper; @@ -91,13 +90,11 @@ public class EachLayerDataDefinitionPane extends MultiTabPane { } private void populatePaneList(ChartCollection chartCollection) { - List matchResultList = ((VanChartDrillMapPlot) chartCollection.getSelectedChartProvider(Chart.class).getPlot()).getMatchResultList(); for (int i = 0, len = paneList.size(); i < len; i++) { BasicPane basicPane = paneList.get(i); MapType mapType = oldMapList.get(i); if (basicPane instanceof SingleLayerDataDefinitionPane) { ChartCollection clone = MapDataPaneHelper.getLayerChartCollection(chartCollection, i, mapType); - ((VanChartDrillMapPlot)clone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResultList(matchResultList); ((SingleLayerDataDefinitionPane) basicPane).populateBean(clone, i); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java index 993b27758..c4a803134 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java @@ -3,20 +3,17 @@ package com.fr.van.chart.drillmap.designer.type; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chartx.data.ChartDataDefinitionProvider; -import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.drillmap.DrillMapIndependentVanChart; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.drillmap.data.DrillMapDefinition; -import com.fr.plugin.chart.map.MapMatchResult; import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.ZoomLevel; import com.fr.van.chart.map.designer.type.VanChartMapPlotPane; import com.fr.van.chart.map.designer.type.VanChartMapSourceChoosePane; import java.util.ArrayList; -import java.util.List; /** * Created by Mitisky on 16/6/20. @@ -52,27 +49,6 @@ public class VanChartDrillMapPlotPane extends VanChartMapPlotPane { return tools; } - /** - * 同一个钻取地图, 类型之间切换 - */ - @Override - protected void cloneOldPlot2New(Plot oldPlot, Plot newPlot) { - super.cloneOldPlot2New(oldPlot, newPlot); - - try { - List newMatchResultList = new ArrayList<>(); - List matchResultList = ((VanChartDrillMapPlot) oldPlot).getMatchResultList(); - if (matchResultList != null) { - for (MapMatchResult matchResult : matchResultList) { - newMatchResultList.add((MapMatchResult) matchResult.clone()); - } - } - ((VanChartDrillMapPlot) newPlot).setMatchResultList(newMatchResultList); - } catch (CloneNotSupportedException e) { - FineLoggerFactory.getLogger().error("Error in change plot"); - } - } - protected Chart[] getDefaultCharts() { return DrillMapIndependentVanChart.DrillMapVanCharts; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java index e7a222bf9..87143268f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java @@ -65,26 +65,20 @@ public class VanChartMapDataPane extends ChartDataPane { switch (mapType) { case AREA: areaClone = MapDataPaneHelper.getAreaMapChartCollection(collection); - ((VanChartMapPlot)areaClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult); contentsPane.populate(areaClone); break; case POINT: pointClone = MapDataPaneHelper.getPointMapChartCollection(collection); - ((VanChartMapPlot)pointClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult); contentsPane.populate(pointClone); break; case LINE: lineClone = MapDataPaneHelper.getLineMapChartCollection(collection); - ((VanChartMapPlot)lineClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult); contentsPane.populate(lineClone); break; case CUSTOM: areaClone = MapDataPaneHelper.getAreaMapChartCollection(collection); pointClone = MapDataPaneHelper.getPointMapChartCollection(collection); lineClone = MapDataPaneHelper.getLineMapChartCollection(collection); - ((VanChartMapPlot)areaClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult); - ((VanChartMapPlot)pointClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult); - ((VanChartMapPlot)lineClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult); ((CustomMapChartDataContentsPane) contentsPane).populateAreaMap(areaClone); ((CustomMapChartDataContentsPane) contentsPane).populatePointMap(pointClone); ((CustomMapChartDataContentsPane) contentsPane).populateLineMap(lineClone); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java index 86bc0c6d0..bd7e9e45a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java @@ -31,6 +31,7 @@ public class VanAreaMapPlotTableDataContentPane extends VanMapTableDataContentPa protected SeriesTypeUseComboxPaneWithOutFilter seriesTypeUseComboxPane; public VanAreaMapPlotTableDataContentPane(ChartDataPane parent) { + super(parent); this.setLayout(new BorderLayout(0, 4)); initAreaNameCom(); @@ -139,6 +140,7 @@ public class VanAreaMapPlotTableDataContentPane extends VanMapTableDataContentPa TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition(); if (topDefinitionProvider instanceof VanMapTableDefinitionProvider) { VanMapTableDefinitionProvider mapTableDefinitionProvider = (VanMapTableDefinitionProvider) topDefinitionProvider; + mapTableDefinitionProvider.setMatchResult(this.getMatchResult()); updateDefinition(mapTableDefinitionProvider); } } @@ -156,6 +158,7 @@ public class VanAreaMapPlotTableDataContentPane extends VanMapTableDataContentPa TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition(); if (topDefinitionProvider instanceof VanMapTableDefinitionProvider) { VanMapTableDefinitionProvider mapTableDefinitionProvider = (VanMapTableDefinitionProvider) topDefinitionProvider; + this.setMatchResult(mapTableDefinitionProvider.getMatchResult()); populateDefinition(mapTableDefinitionProvider); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java index dd50492f2..141b2eb2e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java @@ -7,7 +7,6 @@ import com.fr.van.chart.map.designer.data.component.table.AbstractLongLatAreaPan import com.fr.van.chart.map.designer.data.component.table.AreaPane; import com.fr.van.chart.map.designer.data.component.table.LineMapAreaPane; import com.fr.van.chart.map.designer.data.component.table.LineMapLongLatAreaPane; -import com.fr.van.chart.map.designer.data.component.table.LongLatAreaPane; import java.awt.Component; @@ -48,34 +47,6 @@ public class VanLineMapPlotTableDataContentPane extends VanPointMapPlotTableData } protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) { - return new LineMapLongLatAreaPane(longLatAreaTableComboPane){ - @Override - protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - areaPane = new LongLatAreaPane(parentPane) { - @Override - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Longitude")), longitudeCom}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Latitude")), latitudeCom}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name")), VanLineMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)} - }; - } - }; - } - - @Override - protected void initEndAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - endAreaPane = new LongLatAreaPane(parentPane){ - @Override - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Longitude")), longitudeCom}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Latitude")), latitudeCom}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")), VanLineMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)} - }; - } - }; - } - }; + return new LineMapLongLatAreaPane(longLatAreaTableComboPane); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java index a8cae03c9..d73b0b590 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java @@ -8,6 +8,7 @@ import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionListener; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.plugin.chart.map.MapMatchResult; import com.fr.plugin.chart.map.VanChartMapPlot; @@ -29,27 +30,36 @@ import java.awt.event.ActionListener; */ public abstract class VanMapTableDataContentPane extends AbstractTableDataContentPane { + private ChartDataPane parent; + private VanChartMapPlot plot; //钻取地图有层级,默认-1代表无层级关系 private int level = ChartGEOJSONHelper.DEFAULT_LEVEL; - public int getLevel() { - return level; + private MapMatchResult matchResult = new MapMatchResult(); + + + public VanMapTableDataContentPane(ChartDataPane parent){ + this.parent = parent; } public void setLevel(int level) { this.level = level; } - public VanChartMapPlot getPlot() { - return plot; - } - public void setPlot(VanChartMapPlot plot) { this.plot = plot; } + public MapMatchResult getMatchResult() { + return matchResult; + } + + public void setMatchResult(MapMatchResult matchResult) { + this.matchResult = matchResult; + } + public JPanel createAreaPanel(final UIComboBox areaBox) { JPanel areaPanel = new JPanel(new BorderLayout(4, 0)); areaBox.setPreferredSize(new Dimension(70, 20)); @@ -66,7 +76,6 @@ public abstract class VanMapTableDataContentPane extends AbstractTableDataConten final MapAreaMatchPane pane = new MapAreaMatchPane(treeNodeAndItems); String nameTable = getTableName(); - final MapMatchResult matchResult = plot.getMatchResult(level); pane.populateBean(matchResult, nameTable, Utils.objectToString(areaBox.getSelectedItem())); BasicDialog dialog = pane.showWindow(new JFrame()); @@ -74,6 +83,7 @@ public abstract class VanMapTableDataContentPane extends AbstractTableDataConten @Override public void doOk() { pane.updateBean(matchResult); + parent.attributeChanged(); } @Override @@ -87,4 +97,9 @@ public abstract class VanMapTableDataContentPane extends AbstractTableDataConten areaPanel.add(uiButton, BorderLayout.EAST); return areaPanel; } + + @Override + public void refreshLevel(int level) { + this.setLevel(level); + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java index cbb418b8d..2e25e1bc2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java @@ -10,7 +10,6 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; import com.fr.van.chart.map.designer.data.component.table.AbstractLongLatAreaPane; import com.fr.van.chart.map.designer.data.component.table.AreaPane; -import com.fr.van.chart.map.designer.data.component.table.LongLatAreaPane; import com.fr.van.chart.map.designer.data.component.table.PointMapAreaPane; import com.fr.van.chart.map.designer.data.component.table.PointMapLongLatAreaPane; @@ -222,7 +221,7 @@ public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableData areaPane = new AreaPane(parentPane) { protected Component[][] getComponent () { return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name")), VanPointMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)} + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")), VanPointMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)} }; } }; @@ -231,19 +230,7 @@ public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableData } protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) { - return new PointMapLongLatAreaPane(longLatAreaTableComboPane) { - protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - areaPane = new LongLatAreaPane(parentPane) { - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Longitude")), longitudeCom}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Latitude")), latitudeCom}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")), VanPointMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)} - }; - } - }; - } - }; + return new PointMapLongLatAreaPane(longLatAreaTableComboPane); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java index b9cdaad46..004ac81b3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java @@ -10,7 +10,6 @@ import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.map.MapIndependentVanChart; -import com.fr.plugin.chart.map.MapMatchResult; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.data.VanMapDefinition; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; @@ -90,22 +89,6 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane { } } } - - /** - * 同一个地图, 类型之间切换 - */ - @Override - protected void cloneOldPlot2New(Plot oldPlot, Plot newPlot) { - super.cloneOldPlot2New(oldPlot, newPlot); - try { - if (((VanChartMapPlot) oldPlot).getMatchResult() != null) { - ((VanChartMapPlot) newPlot).setMatchResult((MapMatchResult) ((VanChartMapPlot) oldPlot).getMatchResult().clone()); - } - } catch (CloneNotSupportedException e) { - FineLoggerFactory.getLogger().error("Error in change plot"); - } - } - /** * 不同地图类型的超链不需要复制 * From 8012b0afc4fa19a21dce1a108c23da03f1a998ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 4 Mar 2020 16:29:08 +0800 Subject: [PATCH 037/375] CHART-11090 --- .../designer/data/VanChartMapDataPane.java | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java index 87143268f..a6fdd49ce 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java @@ -1,12 +1,9 @@ package com.fr.van.chart.map.designer.data; -import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.NormalChartDataPane; -import com.fr.plugin.chart.map.MapMatchResult; -import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.data.VanMapDefinition; import com.fr.plugin.chart.type.MapType; @@ -57,31 +54,26 @@ public class VanChartMapDataPane extends ChartDataPane { repeatLayout(collection); - MapMatchResult matchResult = ((VanChartMapPlot) collection.getSelectedChartProvider(Chart.class).getPlot()).getMatchResult(); - - ChartCollection areaClone; - ChartCollection pointClone; - ChartCollection lineClone; switch (mapType) { case AREA: - areaClone = MapDataPaneHelper.getAreaMapChartCollection(collection); + ChartCollection areaClone = MapDataPaneHelper.getAreaMapChartCollection(collection); contentsPane.populate(areaClone); break; case POINT: - pointClone = MapDataPaneHelper.getPointMapChartCollection(collection); + ChartCollection pointClone = MapDataPaneHelper.getPointMapChartCollection(collection); contentsPane.populate(pointClone); break; case LINE: - lineClone = MapDataPaneHelper.getLineMapChartCollection(collection); + ChartCollection lineClone = MapDataPaneHelper.getLineMapChartCollection(collection); contentsPane.populate(lineClone); break; case CUSTOM: - areaClone = MapDataPaneHelper.getAreaMapChartCollection(collection); - pointClone = MapDataPaneHelper.getPointMapChartCollection(collection); - lineClone = MapDataPaneHelper.getLineMapChartCollection(collection); - ((CustomMapChartDataContentsPane) contentsPane).populateAreaMap(areaClone); - ((CustomMapChartDataContentsPane) contentsPane).populatePointMap(pointClone); - ((CustomMapChartDataContentsPane) contentsPane).populateLineMap(lineClone); + ChartCollection areaClone1 = MapDataPaneHelper.getAreaMapChartCollection(collection); + ChartCollection pointClone1 = MapDataPaneHelper.getPointMapChartCollection(collection); + ChartCollection lineClone1 = MapDataPaneHelper.getLineMapChartCollection(collection); + ((CustomMapChartDataContentsPane) contentsPane).populateAreaMap(areaClone1); + ((CustomMapChartDataContentsPane) contentsPane).populatePointMap(pointClone1); + ((CustomMapChartDataContentsPane) contentsPane).populateLineMap(lineClone1); } } From 072977d0e5288cd5a67f124cbda8b77b1108ca6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 4 Mar 2020 17:48:20 +0800 Subject: [PATCH 038/375] =?UTF-8?q?CHART-11090=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/chartx/component/MatchAreaTable.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java index 2d808e893..4dc6ad024 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java @@ -1,6 +1,5 @@ package com.fr.design.chartx.component; -import com.fr.base.Utils; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.general.GeneralUtils; @@ -81,7 +80,7 @@ public class MatchAreaTable extends JTable { return; } int index = areaNameIndex.get(areaName); - String result = ChartGEOJSONHelper.matchArea(Utils.objectToString(areaName), items); + String result = ChartGEOJSONHelper.matchArea(GeneralUtils.objectToString(areaName), items); getColumnModel().getColumn(1).getCellEditor().stopCellEditing(); this.setValueAt(result, index, 1); } From d8e3489f83ed24628646d2b10978107162fcd9c2 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 4 Mar 2020 17:50:09 +0800 Subject: [PATCH 039/375] =?UTF-8?q?CHART-9435=20=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E7=95=8C=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gauge/VanChartGaugeSeriesPane.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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 e553306a2..0dbb0289f 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 @@ -2,6 +2,7 @@ package com.fr.van.chart.gauge; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; +import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; @@ -48,6 +49,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { private UIColorPickerPane colorPickerPane; private UISpinner thermometerWidth; + private UINumberDragPane chutePercent; public VanChartGaugeSeriesPane(ChartStylePane parent, Plot plot) { super(parent, plot); @@ -122,14 +124,16 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { new Component[]{null, null}, getPaneBackgroundColor(), getInnerPaneBackgroundColor(), - new Component[]{createRadiusPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null} + new Component[]{createRadiusPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null}, + getChutePercent() }; case SLOT: return new Component[][]{ new Component[]{null, null}, getNeedleColor(), getSlotBackgroundColor(), - new Component[]{createRadiusPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null} + new Component[]{createRadiusPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null}, + getChutePercent() }; case THERMOMETER: return new Component[][]{ @@ -181,6 +185,11 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { return new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Thermometer_Width")),thermometerWidth}; } + private Component[] getChutePercent() { + chutePercent = new UINumberDragPane(0, 100, 1); + return new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Chute_Percent")),chutePercent}; + } + private void initRotate() { rotate = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_AntiClockWise"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ClockWise")}); } @@ -230,6 +239,9 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { if(thermometerWidth != null){ thermometerWidth.setValue(detailStyle.getThermometerWidth()); } + if(chutePercent != null){ + chutePercent.populateBean(detailStyle.getChutePercent()); + } colorPickerPane.populateBean(detailStyle.getHotAreaColor()); } @@ -271,6 +283,9 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { if(thermometerWidth != null){ detailStyle.setThermometerWidth(thermometerWidth.getValue()); } + if(chutePercent != null){ + detailStyle.setChutePercent(chutePercent.updateBean()); + } colorPickerPane.updateBean(detailStyle.getHotAreaColor()); } From fdab3f9d81e5e0d3a89977605ea660122dc063de Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 4 Mar 2020 18:46:30 +0800 Subject: [PATCH 040/375] REPORT-27510 && REPORT-27462 --- .../src/main/java/com/fr/start/DesignerLauncher.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java b/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java index fa1cd969f..8be938717 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java @@ -3,6 +3,7 @@ package com.fr.start; import com.fr.process.FineProcess; import com.fr.process.engine.FineJavaProcessFactory; import com.fr.process.engine.core.FineProcessContext; +import com.fr.stable.StableUtils; /** * @author hades @@ -32,6 +33,7 @@ public class DesignerLauncher { inheritJvmSettings(). jvmSettings(DesignerJavaRuntime.getInstance().getJvmOptions()). arguments(args). + directory(StableUtils.getInstallHome()). startProcess(DesignerProcessType.INSTANCE); DesignerSuperListener.getInstance().start(); } From 2da7596a921cacb43880c1495ed8a8b8836de90a Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 5 Mar 2020 00:25:00 +0800 Subject: [PATCH 041/375] =?UTF-8?q?CHART-9435=20=E8=AF=95=E7=AE=A1?= =?UTF-8?q?=E5=9E=8B=E4=BB=AA=E8=A1=A8=E7=9B=98=E7=BA=B5=E5=90=91=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...hartGaugeCateOrPercentLabelDetailPane.java | 10 -- .../label/VanChartGaugeLabelDetailPane.java | 134 +++++++++++++++++- .../VanChartGaugeValueLabelDetailPane.java | 10 -- .../label/VanChartPlotLabelDetailPane.java | 26 ++-- 4 files changed, 146 insertions(+), 34 deletions(-) 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 4199e8f7c..3b88a031a 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 @@ -4,8 +4,6 @@ import com.fr.chart.chartattr.Plot; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; - -import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.label.LabelContentPaneWithCate; @@ -24,8 +22,6 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe private static final long serialVersionUID = 5176535960949074945L; - private GaugeStyle gaugeStyle; - public VanChartGaugeCateOrPercentLabelDetailPane(Plot plot, VanChartStylePane parent) { super(plot, parent); } @@ -34,12 +30,6 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe return hasLabelPosition(plot) ? new double[]{p,p,p} : new double[]{p,p}; } - private void initGaugeStyle(Plot plot) { - if(gaugeStyle == null){ - gaugeStyle = ((VanChartGaugePlot)plot).getGaugeStyle(); - } - } - protected void initToolTipContentPane(Plot plot) { initGaugeStyle(plot); switch (gaugeStyle){ 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 3cf057df5..e26b771be 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 @@ -1,14 +1,25 @@ package com.fr.van.chart.designer.style.label; +import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.Plot; +import com.fr.chartx.TwoTuple; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; - +import com.fr.general.ComparatorUtils; +import com.fr.plugin.chart.base.AttrLabelDetail; +import com.fr.plugin.chart.gauge.VanChartGaugePlot; +import com.fr.plugin.chart.type.GaugeStyle; +import com.fr.stable.Constants; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; import java.awt.Component; /** @@ -16,10 +27,21 @@ import java.awt.Component; */ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { + protected GaugeStyle gaugeStyle; + protected UIButtonGroup align; + private JPanel alignPane; + protected Integer[] oldAlignValues; + public VanChartGaugeLabelDetailPane(Plot plot, VanChartStylePane parent) { super(plot, parent); } + protected void initGaugeStyle(Plot plot) { + if (gaugeStyle == null) { + gaugeStyle = ((VanChartGaugePlot) plot).getGaugeStyle(); + } + } + protected JPanel createLabelStylePane(double[] row, double[] col, Plot plot) { style = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")}); @@ -30,16 +52,118 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { return TableLayoutHelper.createTableLayoutPane(getLabelStyleComponents(plot), row, col); } - - protected ChartTextAttrPane initTextFontPane () { + protected ChartTextAttrPane initTextFontPane() { return new ChartTextAttrPane(); } - protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ - return TableLayoutHelper.createTableLayoutPane(comps,row,col); + protected JPanel getLabelPositionPane(Component[][] comps, double[] row, double[] col) { + return TableLayoutHelper.createTableLayoutPane(comps, row, col); } protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { return TableLayout4VanChartHelper.createGapTableLayoutPane(title, panel); } + + protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { + if (hasLabelAlign(plot)) { + + return new Component[][]{ + new Component[]{dataLabelContentPane, null}, + new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Vertical"), plot), null}, + new Component[]{createLabelAlignPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Horizontal")), null}, + new Component[]{createLabelStylePane(getLabelStyleRowSize(p), columnSize, plot), null}, + }; + } else { + return super.getLabelPaneComponents(plot, p, columnSize); + } + } + + private JPanel createLabelAlignPane(String title) { + JPanel panel = new JPanel(new BorderLayout()); + + alignPane = new JPanel(); + checkAlignPane(title); + panel.add(alignPane, BorderLayout.CENTER); + + return panel; + } + + protected void checkAlignPane(String title) { + if (alignPane == null && !hasLabelAlign(getPlot())) { + return; + } + if (alignPane != null && !hasLabelAlign(getPlot())) { + oldAlignValues = null; + alignPane.removeAll(); + return; + } + if (alignPane == null && hasLabelAlign(getPlot())) { + alignPane = new JPanel(); + } + TwoTuple result = getAlignNamesAndValues(); + + String[] names = result.getFirst(); + Integer[] values = result.getSecond(); + if (ComparatorUtils.equals(values, oldAlignValues)) { + return; + } + + oldAlignValues = values; + + align = new UIButtonGroup(names, values); + + Component[][] comps = new Component[2][2]; + + comps[0] = new Component[]{null, null}; + comps[1] = new Component[]{new UILabel(title, SwingConstants.LEFT), align}; + + double[] row = new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}; + double[] col = new double[]{TableLayout.FILL, TableLayout4VanChartHelper.EDIT_AREA_WIDTH}; + + alignPane.removeAll(); + alignPane.setLayout(new BorderLayout()); + alignPane.add(getLabelPositionPane(comps, row, col), BorderLayout.CENTER); + + if (parent != null) { + parent.initListener(alignPane); + } + } + + private TwoTuple getAlignNamesAndValues() { + String[] names = new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow"), Toolkit.i18nText("Fine-Design_Chart_Align_Left"), Toolkit.i18nText("Fine-Design_Chart_Align_Right")}; + Integer[] values = new Integer[]{ChartConstants.AUTO_LABEL_POSITION, Constants.LEFT, Constants.RIGHT}; + + return new TwoTuple<>(names, values); + } + + protected void checkPane() { + String verticalTitle = hasLabelAlign(getPlot()) + ? Toolkit.i18nText("Fine-Design_Chart_Layout_Vertical") + : Toolkit.i18nText("Fine-Design_Chart_Layout_Position"); + + checkPositionPane(verticalTitle); + checkAlignPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Horizontal")); + } + + private boolean hasLabelAlign(Plot plot) { + return ComparatorUtils.equals(gaugeStyle, GaugeStyle.THERMOMETER) && !((VanChartGaugePlot) plot).getGaugeDetailStyle().isHorizontalLayout(); + } + + public void populate(AttrLabelDetail detail) { + super.populate(detail); + + if (hasLabelAlign(this.getPlot()) && align != null) { + align.setSelectedItem(detail.getAlign()); + } + } + + public void update(AttrLabelDetail detail) { + super.update(detail); + + if (align != null && align.getSelectedItem() != null) { + detail.setAlign(align.getSelectedItem()); + } else if (align != null) { + align.setSelectedItem(detail.getAlign()); + } + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java index 1d6692555..3bb3a8a08 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java @@ -1,8 +1,6 @@ package com.fr.van.chart.designer.style.label; import com.fr.chart.chartattr.Plot; -import com.fr.plugin.chart.gauge.VanChartGaugePlot; -import com.fr.plugin.chart.type.GaugeStyle; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.label.LabelContentPaneWithCateValue; import com.fr.van.chart.designer.component.label.LabelContentPaneWithOutCate; @@ -17,18 +15,10 @@ import java.awt.Component; public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailPane { private static final long serialVersionUID = 2601073419430634281L; - private GaugeStyle gaugeStyle; - public VanChartGaugeValueLabelDetailPane(Plot plot, VanChartStylePane parent) { super(plot, parent); } - private void initGaugeStyle(Plot plot) { - if(gaugeStyle == null){ - gaugeStyle = ((VanChartGaugePlot)plot).getGaugeStyle(); - } - } - protected void initToolTipContentPane(Plot plot) { initGaugeStyle(plot); switch (gaugeStyle){ diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index b774de89e..fde315094 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -11,6 +11,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.style.color.ColorSelectBox; +import com.fr.design.i18n.Toolkit; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.attr.plot.VanChartLabelPositionPlot; @@ -65,6 +66,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { this.add(contentPane,BorderLayout.CENTER); } + public Plot getPlot() { + return plot; + } + //默认从factory中取 protected void initToolTipContentPane(Plot plot) { dataLabelContentPane = PlotFactory.createPlotLabelContentPane(plot, parent, VanChartPlotLabelDetailPane.this); @@ -85,7 +90,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if(hasLabelPosition(plot)){ return new Component[][]{ new Component[]{dataLabelContentPane,null}, - new Component[]{createLabelPositionPane(new double[]{p,p,p}, columnSize, plot),null}, + new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null}, new Component[]{createLabelStylePane(getLabelStyleRowSize(p), columnSize, plot),null}, }; } else { @@ -112,7 +117,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel); } - private TwoTuple getPositionNamesAndValues() { + protected TwoTuple getPositionNamesAndValues() { if (plot instanceof VanChartLabelPositionPlot) { String[] names = ((VanChartLabelPositionPlot) plot).getLabelLocationNameArray(); @@ -130,7 +135,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return null; } - private JPanel createLabelPositionPane(double[] row, double[] col, Plot plot) { + protected JPanel createLabelPositionPane(String title, Plot plot) { if (getPositionNamesAndValues() == null) { return new JPanel(); @@ -141,7 +146,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { JPanel panel = new JPanel(new BorderLayout()); positionPane = new JPanel(); - checkPositionPane(); + checkPositionPane(title); panel.add(positionPane, BorderLayout.CENTER); @@ -156,7 +161,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return panel; } - private void checkPositionPane() { + protected void checkPositionPane(String title) { if (positionPane == null) { return; } @@ -176,7 +181,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { Component[][] comps = new Component[2][2]; comps[0] = new Component[]{null, null}; - comps[1] = new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), SwingConstants.LEFT), position}; + comps[1] = new Component[]{new UILabel(title, SwingConstants.LEFT), position}; double[] row = new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}; double[] col = new double[]{TableLayout.FILL, TableLayout4VanChartHelper.EDIT_AREA_WIDTH}; @@ -277,9 +282,12 @@ public class VanChartPlotLabelDetailPane extends BasicPane { tractionLinePane.setVisible(position.getSelectedItem() == Constants.OUTSIDE); } - public void populate(AttrLabelDetail detail) { - checkPositionPane(); + protected void checkPane(){ + checkPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")); + } + public void populate(AttrLabelDetail detail) { + checkPane(); dataLabelContentPane.populateBean(detail.getContent()); if(position != null){ position.setSelectedItem(detail.getPosition()); @@ -306,7 +314,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if(position != null && position.getSelectedItem() != null){ detail.setPosition(position.getSelectedItem()); - + } else if(position != null){ position.setSelectedItem(detail.getPosition()); } From 7f09adc46dd1b3f1a1542d9a968784ea1e2b57cb Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 5 Mar 2020 00:35:03 +0800 Subject: [PATCH 042/375] =?UTF-8?q?CHART-9435=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E6=96=B9=E6=B3=95=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gauge/VanChartGaugeSeriesPane.java | 39 ++++++++++--------- .../van/chart/pie/VanChartPieSeriesPane.java | 15 +++---- 2 files changed, 28 insertions(+), 26 deletions(-) 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 0dbb0289f..564f45f9a 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 @@ -13,6 +13,7 @@ import com.fr.design.mainframe.chart.gui.style.series.ColorPickerPaneWithFormula import com.fr.design.mainframe.chart.gui.style.series.UIColorPickerPane; import com.fr.design.style.color.ColorSelectBox; import com.fr.general.ComparatorUtils; +import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.attr.GaugeDetailStyle; import com.fr.plugin.chart.base.AttrLabel; @@ -71,15 +72,15 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { } private JPanel createGaugeLayoutPane() { - gaugeLayout = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical")}); - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Page_Setup_Orientation"),gaugeLayout); + gaugeLayout = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical")}); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Report_Page_Setup_Orientation"),gaugeLayout); gaugeLayout.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { changeLabelPosition(); } }); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Layout"), panel); } private void changeLabelPosition() { @@ -109,10 +110,10 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { JPanel centerPanel = TableLayoutHelper.createTableLayoutPane(getDiffComponentsWithGaugeStyle(), row, col); panel.add(centerPanel, BorderLayout.CENTER); if(rotate != null){ - JPanel panel1 = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Rotation_Direction"), rotate); + JPanel panel1 = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Rotation_Direction"), rotate); panel.add(panel1, BorderLayout.NORTH); } - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel); } private Component[][] getDiffComponentsWithGaugeStyle() { @@ -124,7 +125,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { new Component[]{null, null}, getPaneBackgroundColor(), getInnerPaneBackgroundColor(), - new Component[]{createRadiusPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null}, + new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null}, getChutePercent() }; case SLOT: @@ -132,7 +133,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { new Component[]{null, null}, getNeedleColor(), getSlotBackgroundColor(), - new Component[]{createRadiusPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null}, + new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null}, getChutePercent() }; case THERMOMETER: @@ -140,7 +141,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { new Component[]{null, null}, getNeedleColor(), getSlotBackgroundColor(), - new Component[]{createRadiusPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Length_Set")), null}, + new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Length_Set")), null}, getThermometerWidth() }; default: @@ -150,58 +151,58 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { getHingeBackgroundColor(), getNeedleColor(), getPaneBackgroundColor(), - new Component[]{createRadiusPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null} + new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null} }; } } private Component[] getHingeColor() { hingeColor = new ColorSelectBox(120); - return new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hinge")),hingeColor}; + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Hinge")),hingeColor}; } private Component[] getHingeBackgroundColor() { hingeBackgroundColor = new ColorSelectBox(120); - return new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hinge_Background")),hingeBackgroundColor}; + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Hinge_Background")),hingeBackgroundColor}; } private Component[] getNeedleColor() { needleColor = new ColorSelectBox(120); - return new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Needle")),needleColor}; + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Needle")),needleColor}; } private Component[] getPaneBackgroundColor() { paneBackgroundColor = new ColorSelectBox(120); - return new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Pane_Background")),paneBackgroundColor}; + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Pane_Background")),paneBackgroundColor}; } private Component[] getSlotBackgroundColor() { slotBackgroundColor = new ColorSelectBox(120); - return new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Slot_Background")),slotBackgroundColor}; + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Slot_Background")),slotBackgroundColor}; } private Component[] getThermometerWidth() { thermometerWidth = new UISpinner(0, Double.MAX_VALUE, 0.1, 10); - return new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Thermometer_Width")),thermometerWidth}; + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Thermometer_Width")),thermometerWidth}; } private Component[] getChutePercent() { chutePercent = new UINumberDragPane(0, 100, 1); - return new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Chute_Percent")),chutePercent}; + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Chute_Percent")),chutePercent}; } private void initRotate() { - rotate = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_AntiClockWise"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ClockWise")}); + rotate = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_AntiClockWise"), Toolkit.i18nText("Fine-Design_Chart_ClockWise")}); } private Component[] getInnerPaneBackgroundColor() { innerPaneBackgroundColor = new ColorSelectBox(120); - return new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Inner_Pane_Background")),innerPaneBackgroundColor}; + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Inner_Pane_Background")),innerPaneBackgroundColor}; } private JPanel createGaugeBandsPane() { colorPickerPane = new ColorPickerPaneWithFormula(parentPane, "meterString"); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Range"), colorPickerPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Range"), colorPickerPane); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java index 752d7c309..2169c4a20 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java @@ -8,6 +8,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.gui.ChartStylePane; +import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -53,21 +54,21 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane { startAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0); endAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0); innerRadius = new UISpinner(0, 100, 1, 0); - supportRotation = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_On"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); + supportRotation = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); Component[][] components = new Component[][]{ new Component[]{null,null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Angle")),startAngle}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Angle")),endAngle}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Inner_Radius")),innerRadius}, - new Component[]{createRadiusPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set")),null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Rotation")),supportRotation} + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Start_Angle")),startAngle}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_End_Angle")),endAngle}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Inner_Radius")),innerRadius}, + new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")),null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Rotation")),supportRotation} }; JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel); } public void populateBean(Plot plot) { From 122fec07dce4e66d1befeac1c04f48c67ced12f9 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 5 Mar 2020 09:45:29 +0800 Subject: [PATCH 043/375] =?UTF-8?q?fix=20=E8=B0=83=E6=95=B4=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/DesignerLauncher.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java b/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java index 8be938717..0777d699f 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java @@ -5,6 +5,8 @@ import com.fr.process.engine.FineJavaProcessFactory; import com.fr.process.engine.core.FineProcessContext; import com.fr.stable.StableUtils; +import java.io.File; + /** * @author hades * @version 10.0 @@ -12,6 +14,9 @@ import com.fr.stable.StableUtils; */ public class DesignerLauncher { + private static final String BIN_HOME = ".".equals(StableUtils.getInstallHome()) ? + "." : StableUtils.getInstallHome() + File.separator + "bin"; + private static final DesignerLauncher INSTANCE = new DesignerLauncher(); private String[] args; @@ -33,7 +38,7 @@ public class DesignerLauncher { inheritJvmSettings(). jvmSettings(DesignerJavaRuntime.getInstance().getJvmOptions()). arguments(args). - directory(StableUtils.getInstallHome()). + directory(BIN_HOME). startProcess(DesignerProcessType.INSTANCE); DesignerSuperListener.getInstance().start(); } From bec9f421edb454ad286ea1596464ccb3cbfe069b Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 5 Mar 2020 09:57:48 +0800 Subject: [PATCH 044/375] =?UTF-8?q?fix=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/DesignerLauncher.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java b/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java index 0777d699f..d0633ac6a 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java @@ -14,8 +14,9 @@ import java.io.File; */ public class DesignerLauncher { - private static final String BIN_HOME = ".".equals(StableUtils.getInstallHome()) ? - "." : StableUtils.getInstallHome() + File.separator + "bin"; + private static final String BIN = "bin"; + private static final String DOT ="."; + private static final String BIN_HOME = generateBinHome(); private static final DesignerLauncher INSTANCE = new DesignerLauncher(); @@ -25,6 +26,11 @@ public class DesignerLauncher { } + private static String generateBinHome() { + return DOT.equals(StableUtils.getInstallHome()) ? + DOT : StableUtils.getInstallHome() + File.separator + BIN; + } + public static DesignerLauncher getInstance() { return INSTANCE; } From cd6655a4b827289f1cbd5f17cbd15129e7362a74 Mon Sep 17 00:00:00 2001 From: lucian Date: Thu, 5 Mar 2020 10:44:32 +0800 Subject: [PATCH 045/375] =?UTF-8?q?REPORT-27473=20Linux=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=97=A0=E6=B3=95=E5=90=AF=E7=94=A8=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/PreferencePane.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 207bdf36d..3fc03f438 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -38,6 +38,7 @@ import com.fr.general.log.Log4jConfig; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; +import com.fr.stable.os.OperatingSystem; import com.fr.third.apache.log4j.Level; import com.fr.transaction.Configurations; import com.fr.transaction.Worker; @@ -218,10 +219,12 @@ public class PreferencePane extends BasicPane { oracleSpace = new UICheckBox(i18nText("Fine-Design_Basic_Show_All_Oracle_Tables")); oraclePane.add(oracleSpace); - JPanel upmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Update_Plugin_Manager")); - useOptimizedUPMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Update_Plugin_Manager")); - upmSelectorPane.add(useOptimizedUPMCheckbox); - advancePane.add(upmSelectorPane); + if (!OperatingSystem.isLinux()) { + JPanel upmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Update_Plugin_Manager")); + useOptimizedUPMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Update_Plugin_Manager")); + upmSelectorPane.add(useOptimizedUPMCheckbox); + advancePane.add(upmSelectorPane); + } JPanel dbmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Database_Manager")); useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager")); @@ -711,7 +714,9 @@ public class PreferencePane extends BasicPane { this.portEditor.setValue(new Integer(designerEnvManager.getEmbedServerPort())); - useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM()); + if (useOptimizedUPMCheckbox != null) { + useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM()); + } useUniverseDBMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseUniverseDBM()); @@ -832,7 +837,9 @@ public class PreferencePane extends BasicPane { Configurations.update(new Worker() { @Override public void run() { - ServerPreferenceConfig.getInstance().setUseOptimizedUPM(useOptimizedUPMCheckbox.isSelected()); + if (useOptimizedUPMCheckbox != null) { + ServerPreferenceConfig.getInstance().setUseOptimizedUPM(useOptimizedUPMCheckbox.isSelected()); + } ServerPreferenceConfig.getInstance().setUseUniverseDBM(useUniverseDBMCheckbox.isSelected()); } From 8062954213369c301214555e39e1b26e049a93fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 5 Mar 2020 11:31:27 +0800 Subject: [PATCH 046/375] =?UTF-8?q?CHART-11090=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=BA=86=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/chartx/component/MapAreaMatchPane.java | 2 +- .../java/com/fr/design/chartx/component/MatchResultTable.java | 2 +- .../com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java | 2 +- .../com/fr/design/chartx/fields/diff/MapDataSetFieldsPane.java | 2 +- .../chart/drillmap/designer/data/comp/DrillMapLayerPane.java | 2 +- .../data/contentpane/table/VanMapTableDataContentPane.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index f2c4d7bd2..750abf97c 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -24,7 +24,7 @@ import com.fr.design.parameter.ParameterInputPane; import com.fr.general.GeneralUtils; import com.fr.general.data.DataModel; import com.fr.general.data.TableDataException; -import com.fr.plugin.chart.map.MapMatchResult; +import com.fr.plugin.chart.map.data.MapMatchResult; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import com.fr.script.Calculator; import com.fr.stable.ArrayUtils; diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchResultTable.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchResultTable.java index 55287f00a..8a85c84a4 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchResultTable.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchResultTable.java @@ -5,7 +5,7 @@ import com.fr.base.Utils; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.i18n.Toolkit; import com.fr.general.ComparatorUtils; -import com.fr.plugin.chart.map.MapMatchResult; +import com.fr.plugin.chart.map.data.MapMatchResult; import com.fr.stable.StringUtils; import javax.swing.AbstractCellEditor; diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java index 975faffca..1102f7a64 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java @@ -8,7 +8,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; -import com.fr.plugin.chart.map.MapMatchResult; +import com.fr.plugin.chart.map.data.MapMatchResult; import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper; import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.ZoomLevel; diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MapDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MapDataSetFieldsPane.java index bec4e78b7..e445a07ef 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MapDataSetFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MapDataSetFieldsPane.java @@ -9,7 +9,7 @@ import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionListener; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.plugin.chart.map.MapMatchResult; +import com.fr.plugin.chart.map.data.MapMatchResult; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import com.fr.plugin.chart.vanchart.VanChart; diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java index a01aed4cd..0c6fcc1e4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java @@ -9,7 +9,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.drillmap.DrillMapHelper; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; -import com.fr.plugin.chart.map.MapMatchResult; +import com.fr.plugin.chart.map.data.MapMatchResult; import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper; import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.ZoomLevel; diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java index d73b0b590..f39c69aeb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java @@ -10,7 +10,7 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; -import com.fr.plugin.chart.map.MapMatchResult; +import com.fr.plugin.chart.map.data.MapMatchResult; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; From 6e8a9aff02949d82ec35009706bdbb3bf418a71c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 5 Mar 2020 15:21:36 +0800 Subject: [PATCH 047/375] =?UTF-8?q?CHART-11090=20=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E4=BA=86=E6=89=8B=E5=8A=A8=E7=9A=84=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/chart/gui/ChartDataPane.java | 1 - .../table/VanAreaMapPlotTableDataContentPane.java | 1 - .../contentpane/table/VanMapTableDataContentPane.java | 11 +---------- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java index aea7142b5..ad549c5af 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java @@ -27,7 +27,6 @@ public class ChartDataPane extends AbstractChartAttrPane { public ChartDataPane(AttributeChangeListener listener) { super(); this.listener = listener; - this.addAttributeChangeListener(listener); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java index bd7e9e45a..26bdf911c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java @@ -31,7 +31,6 @@ public class VanAreaMapPlotTableDataContentPane extends VanMapTableDataContentPa protected SeriesTypeUseComboxPaneWithOutFilter seriesTypeUseComboxPane; public VanAreaMapPlotTableDataContentPane(ChartDataPane parent) { - super(parent); this.setLayout(new BorderLayout(0, 4)); initAreaNameCom(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java index f39c69aeb..5b66ff308 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java @@ -8,10 +8,9 @@ import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionListener; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; -import com.fr.plugin.chart.map.data.MapMatchResult; import com.fr.plugin.chart.map.VanChartMapPlot; +import com.fr.plugin.chart.map.data.MapMatchResult; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import javax.swing.JFrame; @@ -30,8 +29,6 @@ import java.awt.event.ActionListener; */ public abstract class VanMapTableDataContentPane extends AbstractTableDataContentPane { - private ChartDataPane parent; - private VanChartMapPlot plot; //钻取地图有层级,默认-1代表无层级关系 @@ -39,11 +36,6 @@ public abstract class VanMapTableDataContentPane extends AbstractTableDataConten private MapMatchResult matchResult = new MapMatchResult(); - - public VanMapTableDataContentPane(ChartDataPane parent){ - this.parent = parent; - } - public void setLevel(int level) { this.level = level; } @@ -83,7 +75,6 @@ public abstract class VanMapTableDataContentPane extends AbstractTableDataConten @Override public void doOk() { pane.updateBean(matchResult); - parent.attributeChanged(); } @Override From 625dcd8f58a00e9f8ee92f5bd0bf8a946a701310 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 5 Mar 2020 23:27:31 +0800 Subject: [PATCH 048/375] =?UTF-8?q?CHART-9435=20=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E5=AD=97=E7=AC=A6=E5=A4=A7=E5=B0=8F=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/style/ChartTextAttrNoColorPane.java | 3 +- .../style/ChartTextAttrNoFontSizePane.java | 7 +- .../chart/gui/style/ChartTextAttrPane.java | 66 +++++++++++--- ...hartGaugeCateOrPercentLabelDetailPane.java | 88 ++++--------------- .../label/VanChartGaugeLabelDetailPane.java | 58 ++++++++++-- .../VanChartGaugeValueLabelDetailPane.java | 44 ++++------ .../label/VanChartPlotLabelDetailPane.java | 5 +- 7 files changed, 143 insertions(+), 128 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java index 820f0c335..64d4526c8 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java @@ -32,9 +32,10 @@ public class ChartTextAttrNoColorPane extends ChartTextAttrPane{ } protected void initComponents() { + initFontSizes(); fontColor = new UIColorButton(); fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); - fontSizeComboBox = new UIComboBox(Font_Sizes); + fontSizeComboBox = new UIComboBox(getFontSizes()); bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoFontSizePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoFontSizePane.java index e1b17eb15..110b9d786 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoFontSizePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoFontSizePane.java @@ -23,17 +23,18 @@ import com.fr.design.utils.gui.GUICoreUtils; * @version 创建时间:2013-1-21 下午03:35:47 */ public class ChartTextAttrNoFontSizePane extends ChartTextAttrPane { - + private static final long serialVersionUID = 4890526255627852602L; public ChartTextAttrNoFontSizePane() { super(); } - + protected void initComponents() { + initFontSizes(); fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); fontColor = new UIColorButton(); - fontSizeComboBox = new UIComboBox(Font_Sizes); + fontSizeComboBox = new UIComboBox(getFontSizes()); bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index dea30d0c9..5ffbfde87 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.chart.gui.style; import com.fr.base.BaseUtils; import com.fr.base.Utils; import com.fr.chart.base.TextAttr; +import com.fr.design.i18n.Toolkit; import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.event.UIObserverListener; @@ -12,6 +13,7 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -27,23 +29,49 @@ public class ChartTextAttrPane extends BasicPane { private static final long serialVersionUID = 6731679928019436869L; private static final int FONT_START = 6; private static final int FONT_END = 72; + private static final String auto = Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto"); + private static final int autoSizeInt = 0; + private String[] fontSizes; + private boolean isFontSizeAuto; protected UIComboBox fontNameComboBox; protected UIComboBox fontSizeComboBox; protected UIToggleButton bold; protected UIToggleButton italic; protected UIColorButton fontColor; - public static Integer[] Font_Sizes = new Integer[FONT_END-FONT_START+1]; - static{ - for(int i = FONT_START; i <= FONT_END; i++){ - Font_Sizes [i - FONT_START] = new Integer(i); - } - } + public ChartTextAttrPane() { + this.isFontSizeAuto = false; initComponents(); } - /** - * 标题 + public ChartTextAttrPane(boolean isFontSizeAuto) { + this.isFontSizeAuto = isFontSizeAuto; + initComponents(); + } + + public String[] getFontSizes() { + return fontSizes; + } + + protected void initFontSizes() { + if (isFontSizeAuto) { + fontSizes = new String[FONT_END - FONT_START + 2]; + + fontSizes[0] = auto; + + for (int i = 1; i < fontSizes.length; i++) { + fontSizes[i] = Utils.objectToString(i + FONT_START); + } + } else { + fontSizes = new String[FONT_END - FONT_START + 1]; + + for (int i = 0; i < fontSizes.length; i++) { + fontSizes[i] = Utils.objectToString(i + FONT_START); + } + } + } + + /* 标题 * @return 标题 */ public String title4PopupWindow() { @@ -84,8 +112,12 @@ public class ChartTextAttrPane extends BasicPane { fontNameComboBox.setSelectedItem(frFont.getFamily()); bold.setSelected(frFont.isBold()); italic.setSelected(frFont.isItalic()); - if(fontSizeComboBox != null) { - fontSizeComboBox.setSelectedItem(frFont.getSize()); + if (fontSizeComboBox != null) { + if (frFont.getSize() == autoSizeInt) { + fontSizeComboBox.setSelectedItem(auto); + } else { + fontSizeComboBox.setSelectedItem(frFont.getSize() + ""); + } } if (fontColor != null) { fontColor.setColor(frFont.getForeground()); @@ -108,10 +140,12 @@ public class ChartTextAttrPane extends BasicPane { /** * 更新字 + * * @return 更新字 */ public FRFont updateFRFont() { int style = Font.PLAIN; + float size; if (bold.isSelected() && !italic.isSelected()) { style = Font.BOLD; } else if (!bold.isSelected() && italic.isSelected()) { @@ -119,8 +153,13 @@ public class ChartTextAttrPane extends BasicPane { } else if (bold.isSelected() && italic.isSelected()) { style = 3; } - return FRFont.getInstance(Utils.objectToString(fontNameComboBox.getSelectedItem()), style, - Float.valueOf(Utils.objectToString(fontSizeComboBox.getSelectedItem())), fontColor.getColor()); + if (ComparatorUtils.equals(fontSizeComboBox.getSelectedItem(), auto)) { + size = Float.parseFloat(Utils.objectToString(autoSizeInt)); + } else { + size = Float.parseFloat(Utils.objectToString(fontSizeComboBox.getSelectedItem())); + } + + return FRFont.getInstance(Utils.objectToString(fontNameComboBox.getSelectedItem()), style, size, fontColor.getColor()); } public void setEnabled(boolean enabled) { @@ -132,8 +171,9 @@ public class ChartTextAttrPane extends BasicPane { } protected void initComponents() { + initFontSizes(); fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); - fontSizeComboBox = new UIComboBox(Font_Sizes); + fontSizeComboBox = new UIComboBox(fontSizes); fontColor = new UIColorButton(); bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); 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 3b88a031a..d96140a8f 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 @@ -1,9 +1,7 @@ package com.fr.van.chart.designer.style.label; import com.fr.chart.chartattr.Plot; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; +import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.label.LabelContentPaneWithCate; @@ -11,14 +9,12 @@ import com.fr.van.chart.designer.component.label.LabelContentPaneWithPercent; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; -import javax.swing.SwingConstants; import java.awt.Component; /** * 仪表盘的分类(多指针时)或者百分比标签 */ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabelDetailPane { - //todo 重新整理这个面板 private static final long serialVersionUID = 5176535960949074945L; @@ -27,15 +23,20 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe } protected double[] getLabelPaneRowSize(Plot plot, double p) { - return hasLabelPosition(plot) ? new double[]{p,p,p} : new double[]{p,p}; + if (hasLabelAlign(plot)) { + return new double[]{p, p, p, p}; + } + + if (hasLabelPosition(plot)) { + return new double[]{p, p, p}; + } + + return new double[]{p, p}; } protected void initToolTipContentPane(Plot plot) { - initGaugeStyle(plot); - switch (gaugeStyle){ + switch (getGaugeStyle()) { case POINTER: - dataLabelContentPane = new LabelContentPaneWithCate(parent, VanChartGaugeCateOrPercentLabelDetailPane.this); - break; case POINTER_SEMI: dataLabelContentPane = new LabelContentPaneWithCate(parent, VanChartGaugeCateOrPercentLabelDetailPane.this); break; @@ -45,13 +46,13 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe } } - + protected boolean getFontSizeAuto() { + return ComparatorUtils.equals(getGaugeStyle(), GaugeStyle.RING) || ComparatorUtils.equals(getGaugeStyle(), GaugeStyle.SLOT); + } protected boolean hasLabelPosition(Plot plot) { - initGaugeStyle(plot); - switch (gaugeStyle){ + switch (getGaugeStyle()) { case RING: - return false; case SLOT: return false; default: @@ -60,67 +61,10 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe } protected double[] getLabelStyleRowSize(double p) { - switch (gaugeStyle){ - case RING: - return new double[] {p, p}; - case SLOT: - return new double[] {p, p}; - default: - return new double[] {p}; - } + return new double[]{p, p}; } protected JPanel createTableLayoutPaneWithTitle(String title, Component component) { return TableLayout4VanChartHelper.createTableLayoutPaneWithSmallTitle(title, component); } - - - protected Component[][] getLabelStyleComponents(Plot plot) { - initGaugeStyle(plot); - if (gaugeStyle == GaugeStyle.RING || gaugeStyle == GaugeStyle.SLOT) { - UILabel text = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); - return new Component[][]{ - new Component[]{text,style}, - new Component[]{textFontPane,null}, - }; - } else { - return new Component[][]{ - new Component[]{textFontPane, null}, - }; - } - } - - protected ChartTextAttrPane initTextFontPane () { - //todo 需要再整理下 - if (gaugeStyle == GaugeStyle.RING || gaugeStyle == GaugeStyle.SLOT){ - return new ChartTextAttrPane(){ - protected double[] getRowSize () { - double p = TableLayout.PREFERRED; - return new double[]{p, p}; - } - - protected Component[][] getComponents(JPanel buttonPane) { - return new Component[][]{ - new Component[]{null, fontNameComboBox}, - new Component[]{null, buttonPane} - }; - } - }; - } else { - return new ChartTextAttrPane(){ - protected double[] getRowSize () { - double p = TableLayout.PREFERRED; - return new double[]{p, p}; - } - - protected Component[][] getComponents(JPanel buttonPane) { - UILabel text = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); - return new Component[][]{ - new Component[]{text, fontNameComboBox}, - new Component[]{null, buttonPane} - }; - } - }; - } - } } \ No newline at end of file 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 e26b771be..b08a53e8d 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 @@ -21,25 +21,33 @@ import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Component; +import java.awt.Dimension; /** * Created by mengao on 2017/8/13. */ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { - protected GaugeStyle gaugeStyle; - protected UIButtonGroup align; + private GaugeStyle gaugeStyle; + private UIButtonGroup align; private JPanel alignPane; - protected Integer[] oldAlignValues; + private Integer[] oldAlignValues; public VanChartGaugeLabelDetailPane(Plot plot, VanChartStylePane parent) { super(plot, parent); } - protected void initGaugeStyle(Plot plot) { - if (gaugeStyle == null) { - gaugeStyle = ((VanChartGaugePlot) plot).getGaugeStyle(); - } + protected void initLabelDetailPane(Plot plot) { + setGaugeStyle(((VanChartGaugePlot) plot).getGaugeStyle()); + super.initLabelDetailPane(plot); + } + + public GaugeStyle getGaugeStyle() { + return gaugeStyle; + } + + public void setGaugeStyle(GaugeStyle gaugeStyle) { + this.gaugeStyle = gaugeStyle; } protected JPanel createLabelStylePane(double[] row, double[] col, Plot plot) { @@ -52,8 +60,26 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { return TableLayoutHelper.createTableLayoutPane(getLabelStyleComponents(plot), row, col); } + protected boolean getFontSizeAuto() { + return false; + } + protected ChartTextAttrPane initTextFontPane() { - return new ChartTextAttrPane(); + + return new ChartTextAttrPane(getFontSizeAuto()) { + protected double[] getRowSize() { + double p = TableLayout.PREFERRED; + return new double[]{p, p}; + } + + protected Component[][] getComponents(JPanel buttonPane) { + UILabel text = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); + return new Component[][]{ + new Component[]{text, fontNameComboBox}, + new Component[]{null, buttonPane} + }; + } + }; } protected JPanel getLabelPositionPane(Component[][] comps, double[] row, double[] col) { @@ -74,6 +100,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { new Component[]{createLabelStylePane(getLabelStyleRowSize(p), columnSize, plot), null}, }; } else { + return super.getLabelPaneComponents(plot, p, columnSize); } } @@ -136,6 +163,12 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { return new TwoTuple<>(names, values); } + protected Component[][] getLabelStyleComponents(Plot plot) { + return new Component[][]{ + new Component[]{textFontPane, null}, + }; + } + protected void checkPane() { String verticalTitle = hasLabelAlign(getPlot()) ? Toolkit.i18nText("Fine-Design_Chart_Layout_Vertical") @@ -145,13 +178,19 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { checkAlignPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Horizontal")); } - private boolean hasLabelAlign(Plot plot) { + protected void checkStyleUse() { + textFontPane.setVisible(true); + textFontPane.setPreferredSize(new Dimension(0, 60)); + } + + protected boolean hasLabelAlign(Plot plot) { return ComparatorUtils.equals(gaugeStyle, GaugeStyle.THERMOMETER) && !((VanChartGaugePlot) plot).getGaugeDetailStyle().isHorizontalLayout(); } public void populate(AttrLabelDetail detail) { super.populate(detail); + style.setSelectedIndex(1); if (hasLabelAlign(this.getPlot()) && align != null) { align.setSelectedItem(detail.getAlign()); } @@ -160,6 +199,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { public void update(AttrLabelDetail detail) { super.update(detail); + detail.setCustom(true); if (align != null && align.getSelectedItem() != null) { detail.setAlign(align.getSelectedItem()); } else if (align != null) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java index 3bb3a8a08..241a5fd76 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java @@ -1,6 +1,8 @@ package com.fr.van.chart.designer.style.label; import com.fr.chart.chartattr.Plot; +import com.fr.general.ComparatorUtils; +import com.fr.plugin.chart.type.GaugeStyle; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.label.LabelContentPaneWithCateValue; import com.fr.van.chart.designer.component.label.LabelContentPaneWithOutCate; @@ -20,11 +22,8 @@ public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailP } protected void initToolTipContentPane(Plot plot) { - initGaugeStyle(plot); - switch (gaugeStyle){ + switch (getGaugeStyle()) { case POINTER: - dataLabelContentPane = new LabelContentPaneWithOutCate(parent, VanChartGaugeValueLabelDetailPane.this); - break; case POINTER_SEMI: dataLabelContentPane = new LabelContentPaneWithOutCate(parent, VanChartGaugeValueLabelDetailPane.this); break; @@ -35,10 +34,8 @@ public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailP } protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { - initGaugeStyle(plot); - switch (gaugeStyle){ + switch (getGaugeStyle()) { case POINTER: - return getLabelPaneComponentsWithBackground(plot, p, columnSize); case POINTER_SEMI: return getLabelPaneComponentsWithBackground(plot, p, columnSize); default: @@ -47,43 +44,32 @@ public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailP } private Component[][] getLabelPaneComponentsWithBackground(Plot plot, double p, double[] columnSize) { - return new Component[][]{ - new Component[]{dataLabelContentPane,null}, - new Component[]{createLabelStylePane(new double[]{p}, columnSize, plot),null}, - new Component[]{createBackgroundColorPane(),null}, + return new Component[][]{ + new Component[]{dataLabelContentPane, null}, + new Component[]{createLabelStylePane(new double[]{p}, columnSize, plot), null}, + new Component[]{createBackgroundColorPane(), null}, }; } protected double[] getLabelPaneRowSize(Plot plot, double p) { - initGaugeStyle(plot); - switch (gaugeStyle){ + switch (getGaugeStyle()) { case POINTER: - return new double[]{p,p,p,p,p}; case POINTER_SEMI: - return new double[]{p,p,p,p,p}; + return new double[]{p, p, p, p, p}; default: return super.getLabelPaneRowSize(plot, p); } } + protected boolean getFontSizeAuto() { + return !ComparatorUtils.equals(getGaugeStyle(), GaugeStyle.THERMOMETER); + } + protected boolean hasLabelPosition(Plot plot) { - initGaugeStyle(plot); - switch (gaugeStyle){ - case THERMOMETER: - return true; - default: - return false; - } + return getGaugeStyle() == GaugeStyle.THERMOMETER; } protected JPanel createTableLayoutPaneWithTitle(String title, Component component) { return TableLayout4VanChartHelper.createTableLayoutPaneWithSmallTitle(title, component); } - - protected Component[][] getLabelStyleComponents(Plot plot) { - return new Component[][]{ - new Component[]{textFontPane,null}, - }; - } - } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index fde315094..adb36e4dd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -59,7 +59,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { public VanChartPlotLabelDetailPane(Plot plot, VanChartStylePane parent) { this.parent = parent; this.plot = plot; + initLabelDetailPane(plot); + } + protected void initLabelDetailPane (Plot plot) { this.setLayout(new BorderLayout()); initToolTipContentPane(plot); JPanel contentPane = createLabelPane(plot); @@ -269,7 +272,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { checkPositionEnabled(); } - private void checkStyleUse() { + protected void checkStyleUse() { textFontPane.setVisible(style.getSelectedIndex() == 1); textFontPane.setPreferredSize(style.getSelectedIndex() == 1 ? new Dimension(0, 60) : new Dimension(0, 0)); } From e544673a4d6fd911161095c4562a8f486512338b Mon Sep 17 00:00:00 2001 From: Maksim Date: Fri, 6 Mar 2020 10:55:27 +0800 Subject: [PATCH 049/375] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=EF=BC=8C=E9=98=B2=E6=AD=A2=E7=A9=BA=E6=8C=87?= =?UTF-8?q?=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 7 ++- .../com/fr/design/EnvChangeEntranceTest.java | 52 +++++++++++++++++++ .../write/submit/CheckServiceDialogTest.java | 19 +++++++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java create mode 100644 designer-base/src/test/java/com/fr/design/write/submit/CheckServiceDialogTest.java 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 eca98c8be..2efef818a 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -27,6 +27,7 @@ import com.fr.log.FineLoggerFactory; import com.fr.rpc.Result; import com.fr.stable.AssistUtils; import com.fr.stable.EnvChangedListener; +import com.fr.stable.StringUtils; import com.fr.start.server.ServerTray; import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContextCallback; @@ -38,6 +39,7 @@ import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; import com.fr.workspace.engine.exception.WorkspaceAuthException; import com.fr.workspace.engine.exception.WorkspaceConnectionException; import com.fr.workspace.engine.rpc.WorkspaceProxyPool; +import jdk.nashorn.internal.objects.annotations.Function; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; @@ -262,6 +264,9 @@ public class EnvChangeEntrance { try { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Calendar calendar = Calendar.getInstance(); + if(StringUtils.isEmpty(selectedEnv.getRemindTime())){ + return true; + } //获取记录的时间 Date remindTime = format.parse(selectedEnv.getRemindTime()); calendar.setTime(remindTime); @@ -325,7 +330,7 @@ public class EnvChangeEntrance { return noExistServiceSet; } catch (Exception e){ FineLoggerFactory.getLogger().error(e.getMessage(),e); - return null; + return noExistServiceSet; } } diff --git a/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java b/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java new file mode 100644 index 000000000..989b0fdbb --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java @@ -0,0 +1,52 @@ +package com.fr.design; + +import com.fr.design.env.DesignerWorkspaceInfo; +import com.fr.design.env.DesignerWorkspaceType; +import com.fr.design.write.submit.CheckServiceDialog; +import com.fr.workspace.connect.WorkspaceConnectionInfo; +import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; +import org.easymock.EasyMock; +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.modules.junit4.PowerMockRunner; + +/** + * @author: Maksim + * @Date: Created in 2020/3/5 + * @Description: + */ +@RunWith(PowerMockRunner.class) +@PrepareForTest({FunctionalHttpRequest.class,EnvChangeEntrance.class,CheckServiceDialog.class}) +public class EnvChangeEntranceTest { + + @Test + public void showServiceDialog() throws Exception { + EnvChangeEntrance entrance = EnvChangeEntrance.getInstance(); + DesignerWorkspaceInfo selectedEnv = EasyMock.mock(DesignerWorkspaceInfo.class); + WorkspaceConnectionInfo connectionInfo = EasyMock.mock(WorkspaceConnectionInfo.class); + + String remoteBranch = "Build#persist-2020.02.15.01.01.12.12"; + EasyMock.expect(selectedEnv.getConnection()).andReturn(connectionInfo); + EasyMock.expect(selectedEnv.getType()).andReturn(DesignerWorkspaceType.Remote); + EasyMock.expect(selectedEnv.getRemindTime()).andReturn(null); + + FunctionalHttpRequest request = EasyMock.mock(FunctionalHttpRequest.class); + EasyMock.expect(request.getServiceList()).andReturn(null); + + PowerMock.expectNew(FunctionalHttpRequest.class,connectionInfo).andReturn(request).anyTimes(); + EasyMock.expect(request.getServerBranch()).andReturn(remoteBranch); + + CheckServiceDialog dialog = EasyMock.mock(CheckServiceDialog.class); + PowerMock.expectNew(CheckServiceDialog.class,EasyMock.anyObject(),EasyMock.anyObject(),EasyMock.anyObject(),EasyMock.anyObject()).andReturn(dialog); + + EasyMock.replay(request); + EasyMock.replay(selectedEnv); + EasyMock.replay(connectionInfo); + PowerMock.replayAll(); + + entrance.showServiceDialog(selectedEnv); + } + +} \ No newline at end of file diff --git a/designer-base/src/test/java/com/fr/design/write/submit/CheckServiceDialogTest.java b/designer-base/src/test/java/com/fr/design/write/submit/CheckServiceDialogTest.java new file mode 100644 index 000000000..fc18eb607 --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/write/submit/CheckServiceDialogTest.java @@ -0,0 +1,19 @@ +package com.fr.design.write.submit; + +import com.fr.design.mainframe.DesignerContext; +import org.junit.Test; + +/** + * @author: Maksim + * @Date: Created in 2020/3/5 + * @Description: + */ +public class CheckServiceDialogTest { + + @Test + public void dialogTest(){ + CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), "无","2020-02-01","2020-03-01"); + dialog.setVisible(true); + } + +} \ No newline at end of file From 242bd24b04daddf52b6f3ff43adb38c45b02afce Mon Sep 17 00:00:00 2001 From: Maksim Date: Fri, 6 Mar 2020 10:58:27 +0800 Subject: [PATCH 050/375] =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java | 1 - 1 file changed, 1 deletion(-) 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 afdbeabd6..c793a82fc 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -39,7 +39,6 @@ import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; import com.fr.workspace.engine.exception.WorkspaceAuthException; import com.fr.workspace.engine.exception.WorkspaceConnectionException; import com.fr.workspace.engine.rpc.WorkspaceProxyPool; -import jdk.nashorn.internal.objects.annotations.Function; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; From 4c309d67b0205bf1c04971ca050186c49893d82e Mon Sep 17 00:00:00 2001 From: Maksim Date: Fri, 6 Mar 2020 11:23:50 +0800 Subject: [PATCH 051/375] =?UTF-8?q?=E5=8E=BB=E9=99=A4UI=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../write/submit/CheckServiceDialogTest.java | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 designer-base/src/test/java/com/fr/design/write/submit/CheckServiceDialogTest.java diff --git a/designer-base/src/test/java/com/fr/design/write/submit/CheckServiceDialogTest.java b/designer-base/src/test/java/com/fr/design/write/submit/CheckServiceDialogTest.java deleted file mode 100644 index fc18eb607..000000000 --- a/designer-base/src/test/java/com/fr/design/write/submit/CheckServiceDialogTest.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.fr.design.write.submit; - -import com.fr.design.mainframe.DesignerContext; -import org.junit.Test; - -/** - * @author: Maksim - * @Date: Created in 2020/3/5 - * @Description: - */ -public class CheckServiceDialogTest { - - @Test - public void dialogTest(){ - CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), "无","2020-02-01","2020-03-01"); - dialog.setVisible(true); - } - -} \ No newline at end of file From b9e13fbef351a6282f25c71e596c4f940cafc957 Mon Sep 17 00:00:00 2001 From: Maksim Date: Fri, 6 Mar 2020 11:31:52 +0800 Subject: [PATCH 052/375] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/EnvChangeEntranceTest.java | 54 ++++++++++--------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java b/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java index 989b0fdbb..360bdfd9f 100644 --- a/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java +++ b/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java @@ -6,6 +6,7 @@ import com.fr.design.write.submit.CheckServiceDialog; import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; import org.easymock.EasyMock; +import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.api.easymock.PowerMock; @@ -23,30 +24,35 @@ public class EnvChangeEntranceTest { @Test public void showServiceDialog() throws Exception { - EnvChangeEntrance entrance = EnvChangeEntrance.getInstance(); - DesignerWorkspaceInfo selectedEnv = EasyMock.mock(DesignerWorkspaceInfo.class); - WorkspaceConnectionInfo connectionInfo = EasyMock.mock(WorkspaceConnectionInfo.class); - - String remoteBranch = "Build#persist-2020.02.15.01.01.12.12"; - EasyMock.expect(selectedEnv.getConnection()).andReturn(connectionInfo); - EasyMock.expect(selectedEnv.getType()).andReturn(DesignerWorkspaceType.Remote); - EasyMock.expect(selectedEnv.getRemindTime()).andReturn(null); - - FunctionalHttpRequest request = EasyMock.mock(FunctionalHttpRequest.class); - EasyMock.expect(request.getServiceList()).andReturn(null); - - PowerMock.expectNew(FunctionalHttpRequest.class,connectionInfo).andReturn(request).anyTimes(); - EasyMock.expect(request.getServerBranch()).andReturn(remoteBranch); - - CheckServiceDialog dialog = EasyMock.mock(CheckServiceDialog.class); - PowerMock.expectNew(CheckServiceDialog.class,EasyMock.anyObject(),EasyMock.anyObject(),EasyMock.anyObject(),EasyMock.anyObject()).andReturn(dialog); - - EasyMock.replay(request); - EasyMock.replay(selectedEnv); - EasyMock.replay(connectionInfo); - PowerMock.replayAll(); - - entrance.showServiceDialog(selectedEnv); + try { + EnvChangeEntrance entrance = EnvChangeEntrance.getInstance(); + DesignerWorkspaceInfo selectedEnv = EasyMock.mock(DesignerWorkspaceInfo.class); + WorkspaceConnectionInfo connectionInfo = EasyMock.mock(WorkspaceConnectionInfo.class); + + String remoteBranch = "Build#persist-2020.02.15.01.01.12.12"; + EasyMock.expect(selectedEnv.getConnection()).andReturn(connectionInfo); + EasyMock.expect(selectedEnv.getType()).andReturn(DesignerWorkspaceType.Remote); + EasyMock.expect(selectedEnv.getRemindTime()).andReturn(null); + + FunctionalHttpRequest request = EasyMock.mock(FunctionalHttpRequest.class); + EasyMock.expect(request.getServiceList()).andReturn(null); + + PowerMock.expectNew(FunctionalHttpRequest.class, connectionInfo).andReturn(request).anyTimes(); + EasyMock.expect(request.getServerBranch()).andReturn(remoteBranch); + + CheckServiceDialog dialog = EasyMock.mock(CheckServiceDialog.class); + PowerMock.expectNew(CheckServiceDialog.class, EasyMock.anyObject(), EasyMock.anyObject(), EasyMock.anyObject(), EasyMock.anyObject()).andReturn(dialog); + + EasyMock.replay(request); + EasyMock.replay(selectedEnv); + EasyMock.replay(connectionInfo); + PowerMock.replayAll(); + + entrance.showServiceDialog(selectedEnv); + Assert.assertTrue(true); + }catch (Exception e){ + Assert.assertTrue(false); + } } } \ No newline at end of file From 9538343cc8b7de5b56a9c897ab60f56fca15e04a Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 6 Mar 2020 15:36:41 +0800 Subject: [PATCH 053/375] REPORT-27732 && REPORT-27743 REPORT-27457 --- .../mainframe/loghandler/LogDetailPane.java | 3 ++- .../main/java/com/fr/env/RemoteEnvPane.java | 25 ++++++++----------- .../java/com/fr/file/FILEChooserPane.java | 6 ++++- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogDetailPane.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogDetailPane.java index 5ea260f46..0ed638616 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogDetailPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogDetailPane.java @@ -6,6 +6,7 @@ import javax.swing.JFrame; import javax.swing.JPanel; import com.fr.base.BaseUtils; +import com.fr.design.i18n.Toolkit; import com.fr.design.utils.gui.GUICoreUtils; public class LogDetailPane extends JPanel{ @@ -20,7 +21,7 @@ public class LogDetailPane extends JPanel{ fr.setSize(600, 400); GUICoreUtils.centerWindow(fr); fr.setResizable(false); - fr.setTitle("日志"); + fr.setTitle(Toolkit.i18nText("Fine-Design_Basic_Log")); fr.setIconImage(BaseUtils.readImageWithCache("com/fr/design/images/buttonicon/history.png")); fr.getContentPane().setLayout(new BorderLayout()); fr.getContentPane().add(this, BorderLayout.CENTER); diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 4871bb769..2e0c65cb9 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -10,12 +10,14 @@ import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.fun.DesignerEnvProcessor; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ipasswordfield.UIPassWordField; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.scrollruler.ModLineBorder; import com.fr.license.exception.RegistEditionException; import com.fr.log.FineLoggerFactory; @@ -25,20 +27,12 @@ import com.fr.workspace.WorkContext; import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.engine.exception.WorkspaceAuthException; -import javax.swing.BorderFactory; -import javax.swing.BoxLayout; -import javax.swing.JDialog; -import javax.swing.JFileChooser; -import javax.swing.JPanel; -import javax.swing.JTextPane; -import javax.swing.SwingConstants; -import javax.swing.SwingUtilities; -import javax.swing.SwingWorker; -import javax.swing.ToolTipManager; -import javax.swing.UIManager; +import javax.swing.*; import javax.swing.border.EmptyBorder; +import javax.swing.border.MatteBorder; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; +import javax.swing.plaf.ColorUIResource; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -295,10 +289,13 @@ public class RemoteEnvPane extends BasicBeanPane { contentPanel.add(configPanel, BorderLayout.NORTH); contentPanel.add(accountPanel, BorderLayout.CENTER); - + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + panel.add(contentPanel, BorderLayout.NORTH); + panel.add(testPanel, BorderLayout.CENTER); + panel.setPreferredSize(new Dimension(440, 600)); + UIScrollPane scrollPane = new UIScrollPane(panel); this.setLayout(new BorderLayout()); - this.add(contentPanel, BorderLayout.NORTH); - this.add(testPanel, BorderLayout.CENTER); + this.add(scrollPane); } @Override diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index ac76405d9..01d0cf251 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -502,7 +502,11 @@ public class FILEChooserPane extends BasicPane { String fileNameWithOutExtension = fileName.substring(0, lastDotIndex); String fileNameExtension = fileName.substring(lastDotIndex); FileExtension fileExtension = FileExtension.parse(fileNameExtension); - if (StringUtils.isEmpty(fileName) || StringUtils.isEmpty(filterExtension) || fileFilter.containsExtension(fileExtension.getExtension())) { + boolean accept = StringUtils.isEmpty(fileName) + || StringUtils.isEmpty(filterExtension) + || fileFilter.containsExtension(fileExtension.getExtension()) + || !ComparatorUtils.equals(fileNameExtension, filterExtension); + if (accept) { return fileName; } return fileNameWithOutExtension + filterExtension; From cbe7bfe3dec9a6c8c348156a450ac6256409e8c2 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 6 Mar 2020 15:38:28 +0800 Subject: [PATCH 054/375] =?UTF-8?q?fix=20=E6=BC=8F=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/env/RemoteEnvPane.java | 3 --- .../src/test/java/com/fr/file/FILEChooserPaneTest.java | 9 +++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 2e0c65cb9..9ea2f7019 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -17,7 +17,6 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.scrollruler.ModLineBorder; import com.fr.license.exception.RegistEditionException; import com.fr.log.FineLoggerFactory; @@ -29,10 +28,8 @@ import com.fr.workspace.engine.exception.WorkspaceAuthException; import javax.swing.*; import javax.swing.border.EmptyBorder; -import javax.swing.border.MatteBorder; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import javax.swing.plaf.ColorUIResource; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; diff --git a/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java index c8431a862..12723fbd1 100644 --- a/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java +++ b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java @@ -25,15 +25,20 @@ public class FILEChooserPaneTest { ChooseFileFilter chooseFileFilter2 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY); String result3 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cpt", chooseFileFilter2).get(); - Assert.assertEquals("WorkBook1.cptx", result3); + Assert.assertEquals("WorkBook1.cpt", result3); ChooseFileFilter chooseFileFilter3 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY); String result4 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cptx", chooseFileFilter3).get(); - Assert.assertEquals("WorkBook1.cpt", result4); + Assert.assertEquals("WorkBook1.cptx", result4); ChooseFileFilter chooseFileFilter5 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY); String result5 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cptx", chooseFileFilter5).get(); Assert.assertEquals("WorkBook1.cptx", result5); + + ChooseFileFilter chooseFileFilter6 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY); + String result6 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.xls", chooseFileFilter6).get(); + Assert.assertEquals("WorkBook1.xls", result6); + } } From 37424403d95d370637db27427608b98e2d11ec16 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 6 Mar 2020 16:39:44 +0800 Subject: [PATCH 055/375] =?UTF-8?q?=E5=AD=97=E7=AC=A6=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=9C=A8=E5=AD=90=E7=B1=BB=E4=B8=AD=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/gui/ChangeConfigPane.java | 2 +- .../gui/style/ChartTextAttrNoColorPane.java | 49 +++----- .../style/ChartTextAttrNoFontSizePane.java | 38 +++---- .../chart/gui/style/ChartTextAttrPane.java | 105 ++++++++++-------- .../gui/style/ChartTextAttrPaneWithAuto.java | 68 ++++++++++++ ...hartGaugeCateOrPercentLabelDetailPane.java | 14 ++- .../label/VanChartGaugeLabelDetailPane.java | 25 ++--- .../VanChartGaugeValueLabelDetailPane.java | 18 ++- .../label/VanChartPlotLabelDetailPane.java | 2 +- .../tooltip/VanChartPlotTooltipPane.java | 2 +- .../VanChartDrillMapInteractivePane.java | 2 +- 11 files changed, 186 insertions(+), 139 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java index cc8a7db13..32db1eab5 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java @@ -132,7 +132,7 @@ public class ChangeConfigPane extends BasicBeanPane { protected Component[][] getComponents(JPanel buttonPane) { return new Component[][]{ - new Component[]{text, fontNameComboBox}, + new Component[]{text, getFontNameComboBox()}, new Component[]{null, buttonPane} }; } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java index 64d4526c8..6cc12da41 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java @@ -4,19 +4,17 @@ package com.fr.design.mainframe.chart.gui.style; -import com.fr.base.BaseUtils; import com.fr.base.Utils; import com.fr.design.constants.LayoutConstants; -import com.fr.design.gui.ibutton.UIColorButton; -import com.fr.design.gui.ibutton.UIToggleButton; -import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.general.FRFont; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.FRFont; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.FlowLayout; /** * Created by IntelliJ IDEA. @@ -25,35 +23,27 @@ import java.awt.*; * Date: 14-9-11 * Time: 上午11:27 */ -public class ChartTextAttrNoColorPane extends ChartTextAttrPane{ +public class ChartTextAttrNoColorPane extends ChartTextAttrPane { - public ChartTextAttrNoColorPane() { - super(); + public ChartTextAttrNoColorPane() { + super(); } protected void initComponents() { - initFontSizes(); - fontColor = new UIColorButton(); - fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); - fontSizeComboBox = new UIComboBox(getFontSizes()); - bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); - italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); - double p = TableLayout.PREFERRED; double f = TableLayout.FILL; Component[] components1 = new Component[]{ - italic, bold + getItalic(), getBold() }; JPanel buttonPane = new JPanel(new BorderLayout()); - buttonPane.add(fontSizeComboBox, BorderLayout.CENTER); + buttonPane.add(getFontSizeComboBox(), BorderLayout.CENTER); buttonPane.add(GUICoreUtils.createFlowPane(components1, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE), BorderLayout.EAST); - double[] columnSize = {f}; double[] rowSize = {p, p}; Component[][] components = new Component[][]{ - new Component[]{fontNameComboBox}, + new Component[]{getFontNameComboBox()}, new Component[]{buttonPane} }; @@ -63,20 +53,9 @@ public class ChartTextAttrNoColorPane extends ChartTextAttrPane{ populate(FRFont.getInstance()); } - /** - * 更新字体 - * @return 字体 - */ public FRFont updateFRFont() { - int style = Font.PLAIN; - if (bold.isSelected() && !italic.isSelected()) { - style = Font.BOLD; - } else if (!bold.isSelected() && italic.isSelected()) { - style = Font.ITALIC; - } else if (bold.isSelected() && italic.isSelected()) { - style = 3; - } - return FRFont.getInstance(Utils.objectToString(fontNameComboBox.getSelectedItem()), style, - Float.valueOf(Utils.objectToString(fontSizeComboBox.getSelectedItem()))); + String name = Utils.objectToString(getFontNameComboBox().getSelectedItem()); + + return FRFont.getInstance(name, getFontStyle(), getFontSize()); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoFontSizePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoFontSizePane.java index 110b9d786..d04df2f72 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoFontSizePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoFontSizePane.java @@ -1,48 +1,36 @@ package com.fr.design.mainframe.chart.gui.style; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.FlowLayout; - -import javax.swing.JPanel; - -import com.fr.base.BaseUtils; -import com.fr.base.Utils; import com.fr.design.constants.LayoutConstants; -import com.fr.design.gui.ibutton.UIColorButton; -import com.fr.design.gui.ibutton.UIToggleButton; -import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.general.FRFont; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.FRFont; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.FlowLayout; /** * 字体格式设置, 无字体大小设置. + * * @author kunsnat E-mail:kunsnat@gmail.com * @version 创建时间:2013-1-21 下午03:35:47 */ public class ChartTextAttrNoFontSizePane extends ChartTextAttrPane { - private static final long serialVersionUID = 4890526255627852602L; + private static final long serialVersionUID = 4890526255627852602L; - public ChartTextAttrNoFontSizePane() { - super(); - } + public ChartTextAttrNoFontSizePane() { + super(); + } protected void initComponents() { - initFontSizes(); - fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); - fontColor = new UIColorButton(); - fontSizeComboBox = new UIComboBox(getFontSizes()); - bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); - italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); - double p = TableLayout.PREFERRED; double f = TableLayout.FILL; Component[] components1 = new Component[]{ - fontColor, italic, bold + getFontColor(), getItalic(), getBold() }; JPanel buttonPane = new JPanel(new BorderLayout()); buttonPane.add(GUICoreUtils.createFlowPane(components1, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE), BorderLayout.CENTER); @@ -50,7 +38,7 @@ public class ChartTextAttrNoFontSizePane extends ChartTextAttrPane { double[] columnSize = {f}; double[] rowSize = {p, p}; Component[][] components = new Component[][]{ - new Component[]{fontNameComboBox}, + new Component[]{getFontNameComboBox()}, new Component[]{buttonPane} }; diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index 5ffbfde87..f3998be97 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -3,7 +3,6 @@ package com.fr.design.mainframe.chart.gui.style; import com.fr.base.BaseUtils; import com.fr.base.Utils; import com.fr.chart.base.TextAttr; -import com.fr.design.i18n.Toolkit; import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.event.UIObserverListener; @@ -13,7 +12,6 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -29,49 +27,51 @@ public class ChartTextAttrPane extends BasicPane { private static final long serialVersionUID = 6731679928019436869L; private static final int FONT_START = 6; private static final int FONT_END = 72; - private static final String auto = Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto"); - private static final int autoSizeInt = 0; - private String[] fontSizes; - private boolean isFontSizeAuto; - protected UIComboBox fontNameComboBox; - protected UIComboBox fontSizeComboBox; - protected UIToggleButton bold; - protected UIToggleButton italic; - protected UIColorButton fontColor; + private UIComboBox fontNameComboBox; + private UIComboBox fontSizeComboBox; + private UIToggleButton bold; + private UIToggleButton italic; + private UIColorButton fontColor; + public static Integer[] Font_Sizes = new Integer[FONT_END - FONT_START + 1]; + + static { + for (int i = FONT_START; i <= FONT_END; i++) { + Font_Sizes[i - FONT_START] = new Integer(i); + } + } public ChartTextAttrPane() { - this.isFontSizeAuto = false; + initState(); initComponents(); } - public ChartTextAttrPane(boolean isFontSizeAuto) { - this.isFontSizeAuto = isFontSizeAuto; - initComponents(); + public UIComboBox getFontNameComboBox() { + return fontNameComboBox; } - public String[] getFontSizes() { - return fontSizes; + public UIComboBox getFontSizeComboBox() { + return fontSizeComboBox; } - protected void initFontSizes() { - if (isFontSizeAuto) { - fontSizes = new String[FONT_END - FONT_START + 2]; + public UIToggleButton getBold() { + return bold; + } - fontSizes[0] = auto; + public void setBold(UIToggleButton bold) { + this.bold = bold; + } - for (int i = 1; i < fontSizes.length; i++) { - fontSizes[i] = Utils.objectToString(i + FONT_START); - } - } else { - fontSizes = new String[FONT_END - FONT_START + 1]; + public UIToggleButton getItalic() { + return italic; + } - for (int i = 0; i < fontSizes.length; i++) { - fontSizes[i] = Utils.objectToString(i + FONT_START); - } - } + public UIColorButton getFontColor() { + return fontColor; } - /* 标题 + /** + * 标题 + * * @return 标题 */ public String title4PopupWindow() { @@ -112,13 +112,7 @@ public class ChartTextAttrPane extends BasicPane { fontNameComboBox.setSelectedItem(frFont.getFamily()); bold.setSelected(frFont.isBold()); italic.setSelected(frFont.isItalic()); - if (fontSizeComboBox != null) { - if (frFont.getSize() == autoSizeInt) { - fontSizeComboBox.setSelectedItem(auto); - } else { - fontSizeComboBox.setSelectedItem(frFont.getSize() + ""); - } - } + setFontSize(frFont); if (fontColor != null) { fontColor.setColor(frFont.getForeground()); } @@ -128,6 +122,12 @@ public class ChartTextAttrPane extends BasicPane { registerAllComboBoxListener(listener); } + protected void setFontSize(FRFont frFont) { + if (fontSizeComboBox != null) { + fontSizeComboBox.setSelectedItem(frFont.getSize()); + } + } + private void removeAllComboBoxListener() { fontNameComboBox.removeChangeListener(); fontSizeComboBox.removeChangeListener(); @@ -144,8 +144,13 @@ public class ChartTextAttrPane extends BasicPane { * @return 更新字 */ public FRFont updateFRFont() { + String name = Utils.objectToString(fontNameComboBox.getSelectedItem()); + + return FRFont.getInstance(name, getFontStyle(), getFontSize(), fontColor.getColor()); + } + + protected int getFontStyle() { int style = Font.PLAIN; - float size; if (bold.isSelected() && !italic.isSelected()) { style = Font.BOLD; } else if (!bold.isSelected() && italic.isSelected()) { @@ -153,13 +158,12 @@ public class ChartTextAttrPane extends BasicPane { } else if (bold.isSelected() && italic.isSelected()) { style = 3; } - if (ComparatorUtils.equals(fontSizeComboBox.getSelectedItem(), auto)) { - size = Float.parseFloat(Utils.objectToString(autoSizeInt)); - } else { - size = Float.parseFloat(Utils.objectToString(fontSizeComboBox.getSelectedItem())); - } - return FRFont.getInstance(Utils.objectToString(fontNameComboBox.getSelectedItem()), style, size, fontColor.getColor()); + return style; + } + + protected float getFontSize() { + return Float.parseFloat(Utils.objectToString(fontSizeComboBox.getSelectedItem())); } public void setEnabled(boolean enabled) { @@ -170,14 +174,19 @@ public class ChartTextAttrPane extends BasicPane { this.italic.setEnabled(enabled); } - protected void initComponents() { - initFontSizes(); + protected Object[] getFontSizeComboBoxModel() { + return Font_Sizes; + } + + protected void initState() { fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); - fontSizeComboBox = new UIComboBox(fontSizes); + fontSizeComboBox = new UIComboBox(getFontSizeComboBoxModel()); fontColor = new UIColorButton(); bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); + } + protected void initComponents() { Component[] components1 = new Component[]{ fontColor, italic, bold }; diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java new file mode 100644 index 000000000..35681ab41 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java @@ -0,0 +1,68 @@ +package com.fr.design.mainframe.chart.gui.style; + +import com.fr.base.Utils; +import com.fr.design.i18n.Toolkit; +import com.fr.general.ComparatorUtils; +import com.fr.general.FRFont; + +public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { + + private static final String AUTO = Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto"); + private static final int AUTO_SIZE_INT = 0; + private boolean isFontSizeAuto; + private boolean isColorAuto; + + public ChartTextAttrPaneWithAuto() { + this.isFontSizeAuto = false; + this.isColorAuto = false; + + initState(); + initComponents(); + } + + public ChartTextAttrPaneWithAuto(boolean isFontSizeAuto, boolean isColorAuto) { + this.isFontSizeAuto = isFontSizeAuto; + this.isColorAuto = isColorAuto; + + initState(); + initComponents(); + } + + protected Object[] getFontSizeComboBoxModel() { + if (isFontSizeAuto) { + String[] fontSizes = new String[Font_Sizes.length + 1]; + + fontSizes[0] = AUTO; + + for (int i = 1; i <= Font_Sizes.length; i++) { + fontSizes[i] = i + ""; + } + + return fontSizes; + } else { + return super.getFontSizeComboBoxModel(); + } + } + + protected float getFontSize() { + if (isFontSizeAuto && ComparatorUtils.equals(getFontSizeComboBox().getSelectedItem(), AUTO)) { + return AUTO_SIZE_INT; + } + + return Float.parseFloat(Utils.objectToString(getFontSizeComboBox().getSelectedItem())); + } + + protected void setFontSize(FRFont frFont) { + if (getFontSizeComboBox() != null && isFontSizeAuto) { + if (frFont.getSize() == AUTO_SIZE_INT) { + getFontSizeComboBox().setSelectedItem(AUTO); + } else { + getFontSizeComboBox().setSelectedItem(frFont.getSize() + ""); + } + } + + if (getFontSizeComboBox() != null && !isFontSizeAuto) { + getFontSizeComboBox().setSelectedItem(frFont.getSize()); + } + } +} 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 d96140a8f..876da9bc6 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 @@ -1,7 +1,7 @@ package com.fr.van.chart.designer.style.label; import com.fr.chart.chartattr.Plot; -import com.fr.general.ComparatorUtils; +import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.label.LabelContentPaneWithCate; @@ -35,7 +35,9 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe } protected void initToolTipContentPane(Plot plot) { - switch (getGaugeStyle()) { + GaugeStyle gaugeStyle = ((VanChartGaugePlot) plot).getGaugeStyle(); + + switch (gaugeStyle) { case POINTER: case POINTER_SEMI: dataLabelContentPane = new LabelContentPaneWithCate(parent, VanChartGaugeCateOrPercentLabelDetailPane.this); @@ -47,11 +49,15 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe } protected boolean getFontSizeAuto() { - return ComparatorUtils.equals(getGaugeStyle(), GaugeStyle.RING) || ComparatorUtils.equals(getGaugeStyle(), GaugeStyle.SLOT); + GaugeStyle gaugeStyle = ((VanChartGaugePlot) getPlot()).getGaugeStyle(); + + return gaugeStyle == GaugeStyle.RING || gaugeStyle == GaugeStyle.SLOT; } protected boolean hasLabelPosition(Plot plot) { - switch (getGaugeStyle()) { + GaugeStyle gaugeStyle = ((VanChartGaugePlot) plot).getGaugeStyle(); + + switch (gaugeStyle) { case RING: case SLOT: return false; 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 b08a53e8d..9bfa8e82b 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 @@ -9,7 +9,9 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; +import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto; import com.fr.general.ComparatorUtils; +import com.fr.plugin.chart.attr.GaugeDetailStyle; import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; @@ -28,7 +30,6 @@ import java.awt.Dimension; */ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { - private GaugeStyle gaugeStyle; private UIButtonGroup align; private JPanel alignPane; private Integer[] oldAlignValues; @@ -37,19 +38,6 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { super(plot, parent); } - protected void initLabelDetailPane(Plot plot) { - setGaugeStyle(((VanChartGaugePlot) plot).getGaugeStyle()); - super.initLabelDetailPane(plot); - } - - public GaugeStyle getGaugeStyle() { - return gaugeStyle; - } - - public void setGaugeStyle(GaugeStyle gaugeStyle) { - this.gaugeStyle = gaugeStyle; - } - protected JPanel createLabelStylePane(double[] row, double[] col, Plot plot) { style = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")}); @@ -66,7 +54,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { protected ChartTextAttrPane initTextFontPane() { - return new ChartTextAttrPane(getFontSizeAuto()) { + return new ChartTextAttrPaneWithAuto(getFontSizeAuto(), false) { protected double[] getRowSize() { double p = TableLayout.PREFERRED; return new double[]{p, p}; @@ -75,7 +63,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { protected Component[][] getComponents(JPanel buttonPane) { UILabel text = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); return new Component[][]{ - new Component[]{text, fontNameComboBox}, + new Component[]{text, getFontNameComboBox()}, new Component[]{null, buttonPane} }; } @@ -184,7 +172,10 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { } protected boolean hasLabelAlign(Plot plot) { - return ComparatorUtils.equals(gaugeStyle, GaugeStyle.THERMOMETER) && !((VanChartGaugePlot) plot).getGaugeDetailStyle().isHorizontalLayout(); + GaugeStyle gaugeStyle = ((VanChartGaugePlot) plot).getGaugeStyle(); + GaugeDetailStyle gaugeDetailStyle = ((VanChartGaugePlot) plot).getGaugeDetailStyle(); + + return gaugeStyle == GaugeStyle.THERMOMETER && !gaugeDetailStyle.isHorizontalLayout(); } public void populate(AttrLabelDetail detail) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java index 241a5fd76..cfee6102b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java @@ -1,7 +1,7 @@ package com.fr.van.chart.designer.style.label; import com.fr.chart.chartattr.Plot; -import com.fr.general.ComparatorUtils; +import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.label.LabelContentPaneWithCateValue; @@ -22,7 +22,9 @@ public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailP } protected void initToolTipContentPane(Plot plot) { - switch (getGaugeStyle()) { + GaugeStyle gaugeStyle = ((VanChartGaugePlot) plot).getGaugeStyle(); + + switch (gaugeStyle) { case POINTER: case POINTER_SEMI: dataLabelContentPane = new LabelContentPaneWithOutCate(parent, VanChartGaugeValueLabelDetailPane.this); @@ -34,7 +36,9 @@ public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailP } protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { - switch (getGaugeStyle()) { + GaugeStyle gaugeStyle = ((VanChartGaugePlot) plot).getGaugeStyle(); + + switch (gaugeStyle) { case POINTER: case POINTER_SEMI: return getLabelPaneComponentsWithBackground(plot, p, columnSize); @@ -52,7 +56,9 @@ public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailP } protected double[] getLabelPaneRowSize(Plot plot, double p) { - switch (getGaugeStyle()) { + GaugeStyle gaugeStyle = ((VanChartGaugePlot) plot).getGaugeStyle(); + + switch (gaugeStyle) { case POINTER: case POINTER_SEMI: return new double[]{p, p, p, p, p}; @@ -62,11 +68,11 @@ public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailP } protected boolean getFontSizeAuto() { - return !ComparatorUtils.equals(getGaugeStyle(), GaugeStyle.THERMOMETER); + return ((VanChartGaugePlot) getPlot()).getGaugeStyle() != GaugeStyle.THERMOMETER; } protected boolean hasLabelPosition(Plot plot) { - return getGaugeStyle() == GaugeStyle.THERMOMETER; + return ((VanChartGaugePlot) plot).getGaugeStyle() == GaugeStyle.THERMOMETER; } protected JPanel createTableLayoutPaneWithTitle(String title, Component component) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index adb36e4dd..a9fc5c008 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -230,7 +230,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { protected Component[][] getComponents(JPanel buttonPane) { return new Component[][]{ new Component[]{null, null}, - new Component[]{null, fontNameComboBox}, + new Component[]{null, getFontNameComboBox()}, new Component[]{null, buttonPane} }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java index e3f45a9c0..5dfc50ec4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java @@ -114,7 +114,7 @@ public class VanChartPlotTooltipPane extends BasicPane { protected Component[][] getComponents(JPanel buttonPane) { return new Component[][]{ new Component[]{null, null}, - new Component[]{null, fontNameComboBox}, + new Component[]{null, getFontNameComboBox()}, new Component[]{null, buttonPane} }; } 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 1f705c9c9..c0195070a 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 @@ -68,7 +68,7 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith @Override protected Component[][] getComponents(JPanel buttonPane) { return new Component[][]{ - new Component[]{fontNameComboBox}, + new Component[]{getFontNameComboBox()}, new Component[]{buttonPane} }; } From a3b428bbf604e124d0993c413662b3f374a5111e Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 6 Mar 2020 17:08:05 +0800 Subject: [PATCH 056/375] REPORT-27732 --- .../src/main/java/com/fr/file/FILEChooserPane.java | 9 ++++----- .../src/test/java/com/fr/file/FILEChooserPaneTest.java | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 01d0cf251..efb1e3a38 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -502,13 +502,12 @@ public class FILEChooserPane extends BasicPane { String fileNameWithOutExtension = fileName.substring(0, lastDotIndex); String fileNameExtension = fileName.substring(lastDotIndex); FileExtension fileExtension = FileExtension.parse(fileNameExtension); - boolean accept = StringUtils.isEmpty(fileName) - || StringUtils.isEmpty(filterExtension) - || fileFilter.containsExtension(fileExtension.getExtension()) - || !ComparatorUtils.equals(fileNameExtension, filterExtension); - if (accept) { + if (StringUtils.isEmpty(fileName) || StringUtils.isEmpty(filterExtension) || fileFilter.containsExtension(fileExtension.getExtension())) { return fileName; } + if (!ComparatorUtils.equals(fileNameExtension, filterExtension)) { + return fileName + filterExtension; + } return fileNameWithOutExtension + filterExtension; } diff --git a/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java index 12723fbd1..79a3ea0f2 100644 --- a/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java +++ b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java @@ -25,11 +25,11 @@ public class FILEChooserPaneTest { ChooseFileFilter chooseFileFilter2 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY); String result3 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cpt", chooseFileFilter2).get(); - Assert.assertEquals("WorkBook1.cpt", result3); + Assert.assertEquals("WorkBook1.cpt.cptx", result3); ChooseFileFilter chooseFileFilter3 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY); String result4 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cptx", chooseFileFilter3).get(); - Assert.assertEquals("WorkBook1.cptx", result4); + Assert.assertEquals("WorkBook1.cptx.cpt", result4); ChooseFileFilter chooseFileFilter5 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY); String result5 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cptx", chooseFileFilter5).get(); @@ -37,7 +37,7 @@ public class FILEChooserPaneTest { ChooseFileFilter chooseFileFilter6 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY); String result6 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.xls", chooseFileFilter6).get(); - Assert.assertEquals("WorkBook1.xls", result6); + Assert.assertEquals("WorkBook1.xls.cpt", result6); } From 06e6b172fa10ead88532f088a29de48730940d0c Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sat, 7 Mar 2020 13:07:00 +0800 Subject: [PATCH 057/375] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E8=87=AA=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/constants/UIConstants.java | 4 +- .../fr/design/gui/ibutton/UIColorButton.java | 23 +++- .../gui/ibutton/UIColorButtonWithAuto.java | 35 ++++++ .../style/color/ColorControlWindow.java | 10 +- .../color/ColorControlWindowWithAuto.java | 115 ++++++++++++++++++ .../style/color/NewColorSelectPane.java | 36 +++--- .../images/gui/color/autoForeground.png | Bin 0 -> 415 bytes .../chart/gui/style/ChartTextAttrPane.java | 20 +-- .../gui/style/ChartTextAttrPaneWithAuto.java | 16 ++- ...hartGaugeCateOrPercentLabelDetailPane.java | 6 + .../label/VanChartGaugeLabelDetailPane.java | 6 +- 11 files changed, 237 insertions(+), 34 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java create mode 100644 designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java create mode 100755 designer-base/src/main/resources/com/fr/design/images/gui/color/autoForeground.png diff --git a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java index 1e119d27e..85c2c3092 100644 --- a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java +++ b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java @@ -143,7 +143,8 @@ public interface UIConstants { public static final Color TAB_BUTTON_PRESS_SELECTED = new Color(236, 236, 238); public static final Color POPUP_TITLE_BACKGROUND = new Color(0xd8f2fd); public static final Color LIST_ITEM_SPLIT_LINE = new Color(0xf0f0f3); - + public static final Color AUTO_FONT_COLOR = new Color(0, 0, 0, 0); + public static final Color TRANSPARENT_FONT_COLOR = new Color(255, 255, 255, 0); public static final BufferedImage DRAG_BAR = IOUtils.readImage("com/fr/design/images/control/bar.png"); @@ -196,6 +197,7 @@ public interface UIConstants { public static final Icon ANA_SMALL_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/anas.png"); public static final Icon REFRESH_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/refresh.png"); public static final Icon FONT_ICON = IOUtils.readIcon("/com/fr/design/images/gui/color/foreground.png"); + public static final Icon AUTO_FONT_ICON = IOUtils.readIcon("/com/fr/design/images/gui/color/autoForeground.png"); public static final Icon HISTORY_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/history.png"); public static final Icon DELETE_ICON = IOUtils.readIcon("com/fr/design/images/m_file/close.png"); public static final Icon EDIT_ICON = IOUtils.readIcon("com/fr/design/images/m_file/edit.png"); diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButton.java index 86fc56438..f957e8c39 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButton.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButton.java @@ -24,10 +24,10 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; public class UIColorButton extends UIButton implements PopupHider, UIObserver, GlobalNameObserver { - private static final int SIZE = 16; - private static final int SIZE_2 = 2; - private static final int SIZE_4 = 4; - private static final int SIZE_6 = 6; + public static final int SIZE = 16; + public static final int SIZE_2 = 2; + public static final int SIZE_4 = 4; + public static final int SIZE_6 = 6; private static final int POPUP_MENU_SHIFT = -70; private Color color = Color.BLACK; private ColorControlWindow popupWin; @@ -53,6 +53,14 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G iniListener(); } + public ColorControlWindow getPopupWin() { + return popupWin; + } + + public void setPopupWin(ColorControlWindow popupWin) { + this.popupWin = popupWin; + } + private void iniListener() { if (shouldResponseChangeListener()) { this.addColorChangeListener(new ChangeListener() { @@ -103,12 +111,15 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G if (ComparatorUtils.equals(this.color, color)) { return; } - + checkIcon(this.color, color); this.color = color; hidePopupMenu(); fireColorStateChanged(); } + protected void checkIcon(Color oldColor, Color newColor) { + } + private void showPopupMenu() { if (isEventBanned) { return; @@ -139,7 +150,7 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G repaint(); } - private ColorControlWindow getColorControlWindow() { + protected ColorControlWindow getColorControlWindow() { //find parant. if (this.popupWin == null) { this.popupWin = new ColorControlWindow(UIColorButton.this) { diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java new file mode 100644 index 000000000..0f5f0c58c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java @@ -0,0 +1,35 @@ +package com.fr.design.gui.ibutton; + +import com.fr.design.constants.UIConstants; +import com.fr.design.style.color.ColorControlWindow; +import com.fr.design.style.color.ColorControlWindowWithAuto; +import com.fr.general.ComparatorUtils; + +import java.awt.Color; + +public class UIColorButtonWithAuto extends UIColorButton { + + protected void checkIcon(Color oldColor, Color newColor) { + if (ComparatorUtils.equals(oldColor, UIConstants.AUTO_FONT_COLOR) && !ComparatorUtils.equals(newColor, UIConstants.AUTO_FONT_COLOR)) { + setIcon(UIConstants.FONT_ICON); + } + + if (!ComparatorUtils.equals(oldColor, UIConstants.AUTO_FONT_COLOR) && ComparatorUtils.equals(newColor, UIConstants.AUTO_FONT_COLOR)) { + setIcon(UIConstants.AUTO_FONT_ICON); + } + } + + protected ColorControlWindow getColorControlWindow() { + if (getPopupWin() == null) { + ColorControlWindowWithAuto colorControlWindowWithAuto = new ColorControlWindowWithAuto(UIColorButtonWithAuto.this) { + protected void colorChanged() { + UIColorButtonWithAuto.this.setColor(this.getColor()); + } + }; + + setPopupWin(colorControlWindowWithAuto); + } + + return getPopupWin(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindow.java b/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindow.java index b5a5e4075..4ee3a119e 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindow.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindow.java @@ -38,6 +38,10 @@ public abstract class ColorControlWindow extends JPopupMenu { return selectionPopupPane.getColor(); } + public PopupHider getPopupHider() { + return popupHider; + } + /** * Init components. */ @@ -49,9 +53,13 @@ public abstract class ColorControlWindow extends JPopupMenu { setOpaque(false); setDoubleBuffered(true); setFocusable(false); + initSelectionPopupPane(isSupportTransparent); + this.pack(); + } + + protected void initSelectionPopupPane(boolean isSupportTransparent) { selectionPopupPane = new ColorSelectionPopupPane(isSupportTransparent); this.add(selectionPopupPane, BorderLayout.CENTER); - this.pack(); } class ColorSelectionPopupPane extends NewColorSelectPane { diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java b/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java new file mode 100644 index 000000000..46d32c713 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java @@ -0,0 +1,115 @@ +package com.fr.design.style.color; + +import com.fr.design.border.UIRoundedBorder; +import com.fr.design.constants.UIConstants; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ipoppane.PopupHider; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; + +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +public abstract class ColorControlWindowWithAuto extends ColorControlWindow { + + private ColorSelectionPopupPaneWithAuto selectionPopupPaneWithAuto; + + public ColorControlWindowWithAuto(PopupHider popupHider) { + this(false, popupHider); + } + + public ColorControlWindowWithAuto(boolean isSupportTransparent, PopupHider popupHider) { + super(isSupportTransparent, popupHider); + } + + public Color getColor() { + if (selectionPopupPaneWithAuto == null) { + return null; + } + return selectionPopupPaneWithAuto.getColor(); + } + + protected void initSelectionPopupPane(boolean isSupportTransparent) { + selectionPopupPaneWithAuto = new ColorSelectionPopupPaneWithAuto(isSupportTransparent); + this.add(selectionPopupPaneWithAuto, BorderLayout.CENTER); + } + + class ColorSelectionPopupPaneWithAuto extends NewColorSelectPane { + private static final long serialVersionUID = 7822856562329146354L; + + public ColorSelectionPopupPaneWithAuto(boolean isSupportTransparent) { + super(isSupportTransparent); + + this.addChangeListener(new ChangeListener() { + + @Override + public void stateChanged(ChangeEvent e) { + colorChanged(); + } + }); + } + + protected void doTransparent() { + getPopupHider().hidePopupMenu(); + setColor(UIConstants.TRANSPARENT_FONT_COLOR); + } + + protected void doAuto() { + getPopupHider().hidePopupMenu(); + setColor(UIConstants.AUTO_FONT_COLOR); + } + + public void customButtonPressed() { + getPopupHider().hidePopupMenu(); + super.customButtonPressed(); + } + + protected void initSelectButton(boolean isSupportTransparent) { + setSupportTransparent(isSupportTransparent); + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(new UIRoundedBorder(UIConstants.TOOLBAR_BORDER_COLOR, 1, 5)); + + UIButton transparentButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_ChartF_Transparency")); + UIButton autoButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto")); + + transparentButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + doTransparent(); + } + }); + + autoButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + doAuto(); + } + }); + + if (isSupportTransparent) { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {f, 0}; + double[] rowSize = {p, p}; + + Component[][] components = new Component[][]{ + new Component[]{autoButton, null}, + new Component[]{transparentButton, null} + }; + + JPanel buttonGroup = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + this.add(buttonGroup, BorderLayout.NORTH); + } else { + this.add(autoButton, BorderLayout.NORTH); + } + } + + } + +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index d53232416..05c99e06c 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -56,20 +56,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { * Constructor. */ NewColorSelectPane(boolean isSupportTransparent) { - this.isSupportTransparent = isSupportTransparent; - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(new UIRoundedBorder(UIConstants.TOOLBAR_BORDER_COLOR, 1, 5)); - if (isSupportTransparent) { - 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(); - } - }); - } + initSelectButton(isSupportTransparent); // center JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); @@ -117,6 +104,27 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { centerPane.add(centerPane1); } + public void setSupportTransparent(boolean supportTransparent) { + isSupportTransparent = supportTransparent; + } + + protected void initSelectButton(boolean isSupportTransparent){ + this.isSupportTransparent = isSupportTransparent; + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(new UIRoundedBorder(UIConstants.TOOLBAR_BORDER_COLOR, 1, 5)); + if (isSupportTransparent) { + UIButton transparentButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ChartF_Transparency")); + this.add(transparentButton, BorderLayout.NORTH); + transparentButton.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + doTransparent(); + } + }); + } + } + /** * 添加监听 diff --git a/designer-base/src/main/resources/com/fr/design/images/gui/color/autoForeground.png b/designer-base/src/main/resources/com/fr/design/images/gui/color/autoForeground.png new file mode 100755 index 0000000000000000000000000000000000000000..4186fea2cff2d4650e019dcfc745bdb5346f8a4f GIT binary patch literal 415 zcmV;Q0bu@#P)Px$SxH1eR5%f>l20pyQ5426LmJB8DN-nfHvFE~J#TN5cQ!oroAca1^WJmLz0UnnO~3rVhq(gGLMME} zBW%GXG*p(=Gnj)u7=sa*gmqYjSn1SV=!op7;twNZvn9-g4HSpr6k5TQ#_T}_hHR3k z%v9Eae1aco12*AK1FtorHa);Js5Ge`t^?=XzK_A_<`vuE)<^X~zP{lX%()gw!kY#W z!V>LFF_;W$Sb`H`D+wACBTpJ4-vT z7{BG`x$0f$`C5spUC;XpiV&*)Zf#)(GY_MnPFvdB_$T;3eFLHeK5P|RwoU*5002ov JPDHLkV1gWBvYY?_ literal 0 HcmV?d00001 diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index f3998be97..71ff1c9d0 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -25,8 +25,8 @@ import java.awt.Font; public class ChartTextAttrPane extends BasicPane { private static final long serialVersionUID = 6731679928019436869L; - private static final int FONT_START = 6; - private static final int FONT_END = 72; + public static final int FONT_START = 6; + public static final int FONT_END = 72; private UIComboBox fontNameComboBox; private UIComboBox fontSizeComboBox; private UIToggleButton bold; @@ -36,7 +36,7 @@ public class ChartTextAttrPane extends BasicPane { static { for (int i = FONT_START; i <= FONT_END; i++) { - Font_Sizes[i - FONT_START] = new Integer(i); + Font_Sizes[i - FONT_START] = i; } } @@ -57,10 +57,6 @@ public class ChartTextAttrPane extends BasicPane { return bold; } - public void setBold(UIToggleButton bold) { - this.bold = bold; - } - public UIToggleButton getItalic() { return italic; } @@ -69,6 +65,10 @@ public class ChartTextAttrPane extends BasicPane { return fontColor; } + public void setFontColor(UIColorButton fontColor) { + this.fontColor = fontColor; + } + /** * 标题 * @@ -181,9 +181,13 @@ public class ChartTextAttrPane extends BasicPane { protected void initState() { fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); fontSizeComboBox = new UIComboBox(getFontSizeComboBoxModel()); - fontColor = new UIColorButton(); bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); + initFontColorState(); + } + + protected void initFontColorState() { + setFontColor(new UIColorButton()); } protected void initComponents() { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java index 35681ab41..1301b243a 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java @@ -1,6 +1,8 @@ package com.fr.design.mainframe.chart.gui.style; import com.fr.base.Utils; +import com.fr.design.gui.ibutton.UIColorButton; +import com.fr.design.gui.ibutton.UIColorButtonWithAuto; import com.fr.design.i18n.Toolkit; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; @@ -28,14 +30,22 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { initComponents(); } + protected void initFontColorState() { + if (isColorAuto) { + setFontColor(new UIColorButtonWithAuto()); + } else { + setFontColor(new UIColorButton()); + } + } + protected Object[] getFontSizeComboBoxModel() { if (isFontSizeAuto) { - String[] fontSizes = new String[Font_Sizes.length + 1]; + String[] fontSizes = new String[FONT_END - FONT_START + 2]; fontSizes[0] = AUTO; - for (int i = 1; i <= Font_Sizes.length; i++) { - fontSizes[i] = i + ""; + for (int i = 1; i < fontSizes.length; i++) { + fontSizes[i] = FONT_START + i + ""; } return fontSizes; 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 876da9bc6..d367d4083 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 @@ -54,6 +54,12 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe return gaugeStyle == GaugeStyle.RING || gaugeStyle == GaugeStyle.SLOT; } + protected boolean getFontColorAuto() { + GaugeStyle gaugeStyle = ((VanChartGaugePlot) getPlot()).getGaugeStyle(); + + return gaugeStyle == GaugeStyle.RING || gaugeStyle == GaugeStyle.SLOT; + } + protected boolean hasLabelPosition(Plot plot) { GaugeStyle gaugeStyle = ((VanChartGaugePlot) plot).getGaugeStyle(); 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 9bfa8e82b..765ac33c9 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 @@ -52,9 +52,13 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { return false; } + protected boolean getFontColorAuto() { + return false; + } + protected ChartTextAttrPane initTextFontPane() { - return new ChartTextAttrPaneWithAuto(getFontSizeAuto(), false) { + return new ChartTextAttrPaneWithAuto(getFontSizeAuto(), getFontColorAuto()) { protected double[] getRowSize() { double p = TableLayout.PREFERRED; return new double[]{p, p}; From 4b0d138b37a1ff6bbf4400bb355a537d0f84cc61 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sat, 7 Mar 2020 13:32:02 +0800 Subject: [PATCH 058/375] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E8=BF=87=E6=97=B6?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/gui/style/ChartTextAttrPane.java | 10 ++++++---- .../chart/gui/style/ChartTextAttrPaneWithAuto.java | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index 71ff1c9d0..3ac7f116e 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -10,10 +10,12 @@ import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; +import com.fr.general.GeneralUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; @@ -144,7 +146,7 @@ public class ChartTextAttrPane extends BasicPane { * @return 更新字 */ public FRFont updateFRFont() { - String name = Utils.objectToString(fontNameComboBox.getSelectedItem()); + String name = GeneralUtils.objectToString(fontNameComboBox.getSelectedItem()); return FRFont.getInstance(name, getFontStyle(), getFontSize(), fontColor.getColor()); } @@ -163,7 +165,7 @@ public class ChartTextAttrPane extends BasicPane { } protected float getFontSize() { - return Float.parseFloat(Utils.objectToString(fontSizeComboBox.getSelectedItem())); + return Float.parseFloat(GeneralUtils.objectToString(fontSizeComboBox.getSelectedItem())); } public void setEnabled(boolean enabled) { @@ -207,7 +209,7 @@ public class ChartTextAttrPane extends BasicPane { protected JPanel getContentPane (JPanel buttonPane) { double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f,e}; + double[] columnSize = {f, e}; return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), getRowSize(), columnSize); } @@ -218,7 +220,7 @@ public class ChartTextAttrPane extends BasicPane { } protected Component[][] getComponents(JPanel buttonPane) { - UILabel text = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); + UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); return new Component[][]{ new Component[]{null, null}, new Component[]{text, fontNameComboBox}, diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java index 1301b243a..f959984c1 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java @@ -1,11 +1,11 @@ package com.fr.design.mainframe.chart.gui.style; -import com.fr.base.Utils; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButtonWithAuto; import com.fr.design.i18n.Toolkit; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; +import com.fr.general.GeneralUtils; public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { @@ -59,7 +59,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { return AUTO_SIZE_INT; } - return Float.parseFloat(Utils.objectToString(getFontSizeComboBox().getSelectedItem())); + return Float.parseFloat(GeneralUtils.objectToString(getFontSizeComboBox().getSelectedItem())); } protected void setFontSize(FRFont frFont) { From cc93839488d3828b3b59d3deffc537974500e040 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sat, 7 Mar 2020 19:41:53 +0800 Subject: [PATCH 059/375] =?UTF-8?q?=E9=99=8D=E4=BD=8E=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=BC=BA=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/ibutton/UIColorButton.java | 9 ++++--- .../gui/ibutton/UIColorButtonWithAuto.java | 4 ++- .../style/color/NewColorSelectPane.java | 3 ++- .../gui/style/ChartTextAttrNoColorPane.java | 4 +-- .../gui/style/ChartTextAttrPaneWithAuto.java | 10 +++----- .../gauge/VanChartGaugeDetailAxisPane.java | 25 +++++++++++++------ ...hartGaugeCateOrPercentLabelDetailPane.java | 16 +++--------- .../label/VanChartGaugeLabelDetailPane.java | 20 +++++++++++---- .../VanChartGaugeValueLabelDetailPane.java | 17 ++++--------- 9 files changed, 56 insertions(+), 52 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButton.java index f957e8c39..28f583061 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButton.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButton.java @@ -111,13 +111,14 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G if (ComparatorUtils.equals(this.color, color)) { return; } - checkIcon(this.color, color); + Color oldColor = this.color; this.color = color; - hidePopupMenu(); - fireColorStateChanged(); + checkColorChange(oldColor, this.color); } - protected void checkIcon(Color oldColor, Color newColor) { + protected void checkColorChange(Color oldColor, Color newColor) { + hidePopupMenu(); + fireColorStateChanged(); } private void showPopupMenu() { diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java index 0f5f0c58c..db64cba87 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java @@ -9,7 +9,7 @@ import java.awt.Color; public class UIColorButtonWithAuto extends UIColorButton { - protected void checkIcon(Color oldColor, Color newColor) { + protected void checkColorChange(Color oldColor, Color newColor) { if (ComparatorUtils.equals(oldColor, UIConstants.AUTO_FONT_COLOR) && !ComparatorUtils.equals(newColor, UIConstants.AUTO_FONT_COLOR)) { setIcon(UIConstants.FONT_ICON); } @@ -17,6 +17,8 @@ public class UIColorButtonWithAuto extends UIColorButton { if (!ComparatorUtils.equals(oldColor, UIConstants.AUTO_FONT_COLOR) && ComparatorUtils.equals(newColor, UIConstants.AUTO_FONT_COLOR)) { setIcon(UIConstants.AUTO_FONT_ICON); } + + super.checkColorChange(oldColor, newColor); } protected ColorControlWindow getColorControlWindow() { diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index 05c99e06c..4b8cecad5 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -5,6 +5,7 @@ import com.fr.design.border.UIRoundedBorder; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; @@ -113,7 +114,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(new UIRoundedBorder(UIConstants.TOOLBAR_BORDER_COLOR, 1, 5)); if (isSupportTransparent) { - UIButton transparentButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ChartF_Transparency")); + UIButton transparentButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_ChartF_Transparency")); this.add(transparentButton, BorderLayout.NORTH); transparentButton.addActionListener(new ActionListener() { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java index 6cc12da41..249583768 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java @@ -4,12 +4,12 @@ package com.fr.design.mainframe.chart.gui.style; -import com.fr.base.Utils; import com.fr.design.constants.LayoutConstants; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; +import com.fr.general.GeneralUtils; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -54,7 +54,7 @@ public class ChartTextAttrNoColorPane extends ChartTextAttrPane { } public FRFont updateFRFont() { - String name = Utils.objectToString(getFontNameComboBox().getSelectedItem()); + String name = GeneralUtils.objectToString(getFontNameComboBox().getSelectedItem()); return FRFont.getInstance(name, getFontStyle(), getFontSize()); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java index f959984c1..f486e50b1 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java @@ -11,15 +11,11 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { private static final String AUTO = Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto"); private static final int AUTO_SIZE_INT = 0; - private boolean isFontSizeAuto; - private boolean isColorAuto; + private boolean isFontSizeAuto = false; + private boolean isColorAuto = false; public ChartTextAttrPaneWithAuto() { - this.isFontSizeAuto = false; - this.isColorAuto = false; - - initState(); - initComponents(); + super(); } public ChartTextAttrPaneWithAuto(boolean isFontSizeAuto, boolean isColorAuto) { 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 e04783029..55622a85b 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 @@ -2,9 +2,12 @@ package com.fr.van.chart.designer.style.axis.gauge; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; 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.ChartTextAttrPaneWithAuto; import com.fr.design.style.color.ColorSelectBox; import com.fr.plugin.chart.attr.axis.VanChartAxis; @@ -77,13 +80,13 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { } protected JPanel createLabelPane(double[] row, double[] col){ - showLabel = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Show"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hidden")}); + showLabel = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")}); labelTextAttrPane = getChartTextAttrPane(); labelPanel = new JPanel(new BorderLayout()); labelPanel.add(labelTextAttrPane); labelPanel.setBorder(BorderFactory.createEmptyBorder(0,15,0,0)); JPanel panel = new JPanel(new BorderLayout(0, 6)); - panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel), BorderLayout.NORTH); + panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel), BorderLayout.NORTH); panel.add(labelPanel, BorderLayout.CENTER); showLabel.addActionListener(new ActionListener() { @Override @@ -96,11 +99,17 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { return jPanel; } + protected ChartTextAttrPane getChartTextAttrPane() { + if (isMulti(gaugeStyle)) { + return new ChartTextAttrPaneWithAuto(false, true); + } else { + return new ChartTextAttrPane(); + } + } + private JPanel createValueDefinition(){ switch (gaugeStyle){ case RING: - minMaxValuePane = new MinMaxValuePaneWithOutTick(); - break; case SLOT: minMaxValuePane = new MinMaxValuePaneWithOutTick(); break; @@ -108,18 +117,18 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { minMaxValuePane = new VanChartMinMaxValuePane(); break; } - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), minMaxValuePane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), minMaxValuePane); } private JPanel createTickColorPane(double[] row, double[] col){ mainTickColor = new ColorSelectBox(100); secTickColor = new ColorSelectBox(100); Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Main_Graduation_Line")), mainTickColor}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Second_Graduation_Line")), secTickColor}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Main_Graduation_Line")), mainTickColor}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Second_Graduation_Line")), secTickColor}, }; JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); - JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TickColor"), panel); + JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_TickColor"), panel); panel.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); return jPanel; } 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 d367d4083..e67e19acc 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 @@ -35,9 +35,7 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe } protected void initToolTipContentPane(Plot plot) { - GaugeStyle gaugeStyle = ((VanChartGaugePlot) plot).getGaugeStyle(); - - switch (gaugeStyle) { + switch (getGaugeStyle()) { case POINTER: case POINTER_SEMI: dataLabelContentPane = new LabelContentPaneWithCate(parent, VanChartGaugeCateOrPercentLabelDetailPane.this); @@ -49,21 +47,15 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe } protected boolean getFontSizeAuto() { - GaugeStyle gaugeStyle = ((VanChartGaugePlot) getPlot()).getGaugeStyle(); - - return gaugeStyle == GaugeStyle.RING || gaugeStyle == GaugeStyle.SLOT; + return getGaugeStyle() == GaugeStyle.RING || getGaugeStyle() == GaugeStyle.SLOT; } protected boolean getFontColorAuto() { - GaugeStyle gaugeStyle = ((VanChartGaugePlot) getPlot()).getGaugeStyle(); - - return gaugeStyle == GaugeStyle.RING || gaugeStyle == GaugeStyle.SLOT; + return getGaugeStyle() == GaugeStyle.RING || getGaugeStyle() == GaugeStyle.SLOT; } protected boolean hasLabelPosition(Plot plot) { - GaugeStyle gaugeStyle = ((VanChartGaugePlot) plot).getGaugeStyle(); - - switch (gaugeStyle) { + switch (getGaugeStyle()) { case RING: case SLOT: return false; 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 765ac33c9..750b0119a 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 @@ -11,7 +11,6 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto; import com.fr.general.ComparatorUtils; -import com.fr.plugin.chart.attr.GaugeDetailStyle; import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; @@ -30,6 +29,7 @@ import java.awt.Dimension; */ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { + private GaugeStyle gaugeStyle; private UIButtonGroup align; private JPanel alignPane; private Integer[] oldAlignValues; @@ -38,6 +38,19 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { super(plot, parent); } + protected void initLabelDetailPane (Plot plot) { + setGaugeStyle(((VanChartGaugePlot) plot).getGaugeStyle()); + super.initLabelDetailPane(plot); + } + + public GaugeStyle getGaugeStyle() { + return gaugeStyle; + } + + public void setGaugeStyle(GaugeStyle gaugeStyle) { + this.gaugeStyle = gaugeStyle; + } + protected JPanel createLabelStylePane(double[] row, double[] col, Plot plot) { style = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")}); @@ -176,10 +189,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { } protected boolean hasLabelAlign(Plot plot) { - GaugeStyle gaugeStyle = ((VanChartGaugePlot) plot).getGaugeStyle(); - GaugeDetailStyle gaugeDetailStyle = ((VanChartGaugePlot) plot).getGaugeDetailStyle(); - - return gaugeStyle == GaugeStyle.THERMOMETER && !gaugeDetailStyle.isHorizontalLayout(); + return getGaugeStyle() == GaugeStyle.THERMOMETER && !((VanChartGaugePlot) plot).getGaugeDetailStyle().isHorizontalLayout(); } public void populate(AttrLabelDetail detail) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java index cfee6102b..5872014ff 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java @@ -1,7 +1,6 @@ package com.fr.van.chart.designer.style.label; import com.fr.chart.chartattr.Plot; -import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.label.LabelContentPaneWithCateValue; @@ -22,9 +21,7 @@ public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailP } protected void initToolTipContentPane(Plot plot) { - GaugeStyle gaugeStyle = ((VanChartGaugePlot) plot).getGaugeStyle(); - - switch (gaugeStyle) { + switch (getGaugeStyle()) { case POINTER: case POINTER_SEMI: dataLabelContentPane = new LabelContentPaneWithOutCate(parent, VanChartGaugeValueLabelDetailPane.this); @@ -36,9 +33,7 @@ public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailP } protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { - GaugeStyle gaugeStyle = ((VanChartGaugePlot) plot).getGaugeStyle(); - - switch (gaugeStyle) { + switch (getGaugeStyle()) { case POINTER: case POINTER_SEMI: return getLabelPaneComponentsWithBackground(plot, p, columnSize); @@ -56,9 +51,7 @@ public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailP } protected double[] getLabelPaneRowSize(Plot plot, double p) { - GaugeStyle gaugeStyle = ((VanChartGaugePlot) plot).getGaugeStyle(); - - switch (gaugeStyle) { + switch (getGaugeStyle()) { case POINTER: case POINTER_SEMI: return new double[]{p, p, p, p, p}; @@ -68,11 +61,11 @@ public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailP } protected boolean getFontSizeAuto() { - return ((VanChartGaugePlot) getPlot()).getGaugeStyle() != GaugeStyle.THERMOMETER; + return getGaugeStyle() != GaugeStyle.THERMOMETER; } protected boolean hasLabelPosition(Plot plot) { - return ((VanChartGaugePlot) plot).getGaugeStyle() == GaugeStyle.THERMOMETER; + return getGaugeStyle() == GaugeStyle.THERMOMETER; } protected JPanel createTableLayoutPaneWithTitle(String title, Component component) { From 6ab132425811b15aaf76cd60422a4bc63d9d2858 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sat, 7 Mar 2020 22:31:37 +0800 Subject: [PATCH 060/375] =?UTF-8?q?=E7=BB=9F=E4=B8=80radius?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/style/ChartTextAttrPaneWithAuto.java | 10 +++------- ...ChartGaugeCateOrPercentLabelDetailPane.java | 5 ++--- .../label/VanChartGaugeLabelDetailPane.java | 18 ++++++++++-------- .../VanChartGaugeValueLabelDetailPane.java | 2 +- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java index f486e50b1..6760474e9 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java @@ -27,11 +27,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { } protected void initFontColorState() { - if (isColorAuto) { - setFontColor(new UIColorButtonWithAuto()); - } else { - setFontColor(new UIColorButton()); - } + setFontColor(isColorAuto ? new UIColorButtonWithAuto() : new UIColorButton()); } protected Object[] getFontSizeComboBoxModel() { @@ -45,9 +41,9 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { } return fontSizes; - } else { - return super.getFontSizeComboBoxModel(); } + + return super.getFontSizeComboBoxModel(); } protected float getFontSize() { 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 e67e19acc..64187f89b 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 @@ -1,7 +1,6 @@ package com.fr.van.chart.designer.style.label; import com.fr.chart.chartattr.Plot; -import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.label.LabelContentPaneWithCate; @@ -46,11 +45,11 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe } } - protected boolean getFontSizeAuto() { + protected boolean isFontSizeAuto() { return getGaugeStyle() == GaugeStyle.RING || getGaugeStyle() == GaugeStyle.SLOT; } - protected boolean getFontColorAuto() { + protected boolean isFontColorAuto() { return getGaugeStyle() == GaugeStyle.RING || getGaugeStyle() == GaugeStyle.SLOT; } 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 750b0119a..31e329845 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 @@ -38,7 +38,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { super(plot, parent); } - protected void initLabelDetailPane (Plot plot) { + protected void initLabelDetailPane(Plot plot) { setGaugeStyle(((VanChartGaugePlot) plot).getGaugeStyle()); super.initLabelDetailPane(plot); } @@ -61,17 +61,17 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { return TableLayoutHelper.createTableLayoutPane(getLabelStyleComponents(plot), row, col); } - protected boolean getFontSizeAuto() { + protected boolean isFontSizeAuto() { return false; } - protected boolean getFontColorAuto() { + protected boolean isFontColorAuto() { return false; } protected ChartTextAttrPane initTextFontPane() { - return new ChartTextAttrPaneWithAuto(getFontSizeAuto(), getFontColorAuto()) { + return new ChartTextAttrPaneWithAuto(isFontSizeAuto(), isFontColorAuto()) { protected double[] getRowSize() { double p = TableLayout.PREFERRED; return new double[]{p, p}; @@ -205,10 +205,12 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { super.update(detail); detail.setCustom(true); - if (align != null && align.getSelectedItem() != null) { - detail.setAlign(align.getSelectedItem()); - } else if (align != null) { - align.setSelectedItem(detail.getAlign()); + if (align != null) { + if (align.getSelectedItem() != null) { + detail.setAlign(align.getSelectedItem()); + } else { + align.setSelectedItem(detail.getAlign()); + } } } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java index 5872014ff..01a21d382 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java @@ -60,7 +60,7 @@ public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailP } } - protected boolean getFontSizeAuto() { + protected boolean isFontSizeAuto() { return getGaugeStyle() != GaugeStyle.THERMOMETER; } From d563465a2042c24f2ffccbb9e9d06f07bed74844 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 8 Mar 2020 12:29:17 +0800 Subject: [PATCH 061/375] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=85=A8=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/style/label/VanChartGaugeLabelDetailPane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 31e329845..9ead77303 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 @@ -52,8 +52,8 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { } protected JPanel createLabelStylePane(double[] row, double[] col, Plot plot) { - style = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")}); + style = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), + Toolkit.i18nText("Fine-Design_Chart_Custom")}); textFontPane = initTextFontPane(); initStyleListener(); @@ -78,7 +78,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { } protected Component[][] getComponents(JPanel buttonPane) { - UILabel text = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); + UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); return new Component[][]{ new Component[]{text, getFontNameComboBox()}, new Component[]{null, buttonPane} From f14998d21843baba0c19b73d27e8279deaa37802 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 8 Mar 2020 12:52:58 +0800 Subject: [PATCH 062/375] =?UTF-8?q?check=E6=89=80=E6=9C=89=E5=85=A8?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E5=9B=BD=E9=99=85=E5=8C=96=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/color/NewColorSelectPane.java | 2 +- .../mainframe/chart/gui/ChangeConfigPane.java | 21 ++++++++-------- .../label/VanChartGaugePlotLabelPane.java | 9 ++++--- .../label/VanChartPlotLabelDetailPane.java | 18 +++++++------- .../VanChartAbstractPlotSeriesPane.java | 22 ++++++++--------- .../tooltip/VanChartPlotTooltipPane.java | 24 +++++++++---------- .../VanChartDrillMapInteractivePane.java | 13 +++++----- 7 files changed, 55 insertions(+), 54 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index 4b8cecad5..e823f3061 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -85,7 +85,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { centerPane.add(Box.createVerticalStrut(1)); // mod by anchore 16/11/16 - final UIButton customButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_More_Color")); + final UIButton customButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_More_Color")); // 不能使用 ActionListener,否则设计器工具栏中的"更多颜色"按钮会有问题(REPORT-13654) customButton.addMouseListener(new MouseAdapter() { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java index 32db1eab5..3de9aaa09 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java @@ -14,6 +14,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.gui.style.ChartTextAttrPane; +import com.fr.design.i18n.Toolkit; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -70,7 +71,7 @@ public class ChangeConfigPane extends BasicBeanPane { double[] columnSize = {p, f}; double[] rowSize = {p,p}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Change_Style")),configStyleButton}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Change_Style")),configStyleButton}, new Component[]{configPane, null}, }; return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); @@ -107,19 +108,19 @@ public class ChangeConfigPane extends BasicBeanPane { double[] rowSize = {p, p, p}; timeInterval = new UISpinner(MIN_TIME, MAX_TIME, 1, 0); colorSelectBox4carousel = new ColorSelectBoxWithOutTransparent(WIDTH); - switchStyleGroup = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Show"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Hide")}); + switchStyleGroup = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Show"), Toolkit.i18nText("Fine-Design_Report_Hide")}); Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Arrow_Style")), switchStyleGroup, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Interval")), timeInterval, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Second"))}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background")),colorSelectBox4carousel, null} + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Arrow_Style")), switchStyleGroup, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Time_Interval")), timeInterval, new UILabel(Toolkit.i18nText("Fine-Design_Chart_Time_Second"))}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Background")),colorSelectBox4carousel, null} }; return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); } private JPanel createTitleStylePane() { - final UILabel text = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); + final UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); styleAttrPane = new ChartTextAttrPane() { protected JPanel getContentPane(JPanel buttonPane) { double p = TableLayout.PREFERRED; @@ -143,7 +144,7 @@ public class ChangeConfigPane extends BasicBeanPane { private JPanel createButtonBackgroundColorPane(){ colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH); - return TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"), colorSelectBox4button, EDIT_AREA_WIDTH); + return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Basic_Background"), colorSelectBox4button, EDIT_AREA_WIDTH); } private JPanel createButtonConfigPane() { @@ -160,8 +161,8 @@ public class ChangeConfigPane extends BasicBeanPane { } private void initButtonGroup() { - configStyleButton = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Button_Style"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Carousel_Style")}); + configStyleButton = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Button_Style"), + Toolkit.i18nText("Fine-Design_Chart_Carousel_Style")}); configStyleButton.setPreferredSize(new Dimension(WIDTH * 2, (int) configStyleButton.getPreferredSize().getHeight())); configStyleButton.addActionListener(new ActionListener() { @Override @@ -227,6 +228,6 @@ public class ChangeConfigPane extends BasicBeanPane { @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Change_Config_Attributes"); + return Toolkit.i18nText("Fine-Design_Chart_Change_Config_Attributes"); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java index 42e6909e9..0f81deefc 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java @@ -7,6 +7,7 @@ import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.design.i18n.Toolkit; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -28,16 +29,14 @@ public class VanChartGaugePlotLabelPane extends VanChartPlotLabelPane { labelDetailPane = new VanChartGaugeCateOrPercentLabelDetailPane(this.plot, this.parent); gaugeValueLabelPane = new VanChartGaugeValueLabelDetailPane(this.plot, this.parent); GaugeStyle gaugeStyle = ((VanChartGaugePlot)this.plot).getGaugeStyle(); - String cateTitle, valueTitle = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Label"); + String cateTitle, valueTitle = Toolkit.i18nText("Fine-Design_Chart_Value_Label"); switch (gaugeStyle){ case POINTER: - cateTitle = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category_Label"); - break; case POINTER_SEMI: - cateTitle = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category_Label"); + cateTitle = Toolkit.i18nText("Fine-Design_Chart_Category_Label"); break; default: - cateTitle = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Percent_Label"); + cateTitle = Toolkit.i18nText("Fine-Design_Chart_Percent_Label"); break; } JPanel cateOrPercentPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(cateTitle, labelDetailPane); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index a9fc5c008..c506d89ea 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -144,7 +144,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return new JPanel(); } - autoAdjust = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_On"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); + autoAdjust = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); JPanel panel = new JPanel(new BorderLayout()); @@ -154,12 +154,12 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if (plot.isSupportLeadLine()) { - tractionLine = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Show_Guideline")); + tractionLine = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Show_Guideline")); tractionLinePane = TableLayout4VanChartHelper.createGapTableLayoutPane("", tractionLine); panel.add(tractionLinePane, BorderLayout.SOUTH); initPositionListener(); } else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) { - panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust"), autoAdjust), BorderLayout.SOUTH); + panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust"), autoAdjust), BorderLayout.SOUTH); } return panel; } @@ -201,7 +201,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ JPanel panel = TableLayoutHelper.createTableLayoutPane(comps,row,col); - return createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Attr_Layout"), panel); + return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Form_Attr_Layout"), panel); } @@ -215,14 +215,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } protected JPanel createLabelStylePane(double[] row, double[] col, Plot plot) { - style = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")}); + style = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), + Toolkit.i18nText("Fine-Design_Chart_Custom")}); textFontPane =initTextFontPane(); initStyleListener(); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(getLabelStyleComponents(plot),row,col); - return createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel); + return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel); } protected ChartTextAttrPane initTextFontPane () { @@ -238,7 +238,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } protected Component[][] getLabelStyleComponents(Plot plot) { - UILabel text = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); + UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); return new Component[][]{ new Component[]{null,null}, new Component[]{text,style}, @@ -257,7 +257,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { protected JPanel createBackgroundColorPane() { backgroundColor = new ColorSelectBox(100); - return createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundColor); + return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundColor); } protected String title4PopupWindow() { 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 eec3cf9a1..9b912ee9f 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 @@ -23,7 +23,7 @@ import com.fr.plugin.chart.base.VanChartAttrLine; import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.base.VanChartAttrTrendLine; import com.fr.van.chart.custom.style.VanChartCustomStylePane; -import com.fr.van.chart.designer.PlotFactory; +import com.fr.design.i18n.Toolkit; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartAreaSeriesFillColorPane; import com.fr.van.chart.designer.component.VanChartBeautyPane; @@ -112,7 +112,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP JPanel panel = new JPanel(new BorderLayout()); stylePane = createStylePane(); setColorPaneContent(panel); - JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color"), panel); + JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Color"), panel); panel.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); return panel.getComponentCount() == 0 ? null : colorPane; } @@ -127,13 +127,13 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP //趋势线 protected JPanel createTrendLinePane() { trendLinePane = new VanChartTrendLinePane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TrendLine"), trendLinePane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_TrendLine"), trendLinePane); } //线 protected JPanel createLineTypePane() { lineTypePane = getLineTypePane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line"), lineTypePane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Line"), lineTypePane); } protected VanChartLineTypePane getLineTypePane() { @@ -143,19 +143,19 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP //标记点类型 protected JPanel createMarkerPane() { markerPane = new VanChartMarkerPane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); } //填充颜色 protected JPanel createAreaFillColorPane() { areaSeriesFillColorPane = new VanChartAreaSeriesFillColorPane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area"), areaSeriesFillColorPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Area"), areaSeriesFillColorPane); } //边框(默认没有圆角) protected JPanel createBorderPane() { borderPane = createDiffBorderPane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); } @@ -175,7 +175,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP checkLarge(); } }); - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Model"), largeDataModelGroup); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Large_Model"), largeDataModelGroup); return createLargeDataModelPane(panel); } @@ -197,12 +197,12 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP } protected JPanel createLargeDataModelPane(JPanel jPanel) { - JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Data"), jPanel); + JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Large_Data"), jPanel); return panel; } protected UIButtonGroup createLargeDataModelGroup() { - String[] strings = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}; + String[] strings = new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")}; DataProcessor[] values = new DataProcessor[]{new LargeDataModel(), new NormalDataModel()}; return new UIButtonGroup(strings, values); } @@ -240,7 +240,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP //不透明度 protected JPanel createAlphaPane() { transparent = new UINumberDragPane(0, 100); - return TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha"), transparent); + return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Report_Alpha"), transparent); } //堆积和坐标轴设置(自定义柱形图等用到) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java index 5dfc50ec4..1c3ed4aa5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java @@ -4,7 +4,7 @@ import com.fr.chart.chartattr.Plot; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; @@ -52,7 +52,7 @@ public class VanChartPlotTooltipPane extends BasicPane { } protected void addComponents(Plot plot) { - isTooltipShow = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Tooltip")); + isTooltipShow = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Use_Tooltip")); tooltipPane = createTooltipPane(plot); double p = TableLayout.PREFERRED; @@ -96,8 +96,8 @@ public class VanChartPlotTooltipPane extends BasicPane { Component[][] components = new Component[][]{ new Component[]{tooltipContentPane,null}, new Component[]{createLabelStylePane(),null}, - new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"),borderPane),null}, - new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane),null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"),borderPane),null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane),null}, new Component[]{createDisplayStrategy(plot),null}, }; return components; @@ -109,7 +109,7 @@ public class VanChartPlotTooltipPane extends BasicPane { } protected JPanel createLabelStylePane() { - style = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")}); + style = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"),Toolkit.i18nText("Fine-Design_Chart_Custom")}); textFontPane = new ChartTextAttrPane() { protected Component[][] getComponents(JPanel buttonPane) { return new Component[][]{ @@ -120,14 +120,14 @@ public class VanChartPlotTooltipPane extends BasicPane { } }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Character"), style); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Character"), style); JPanel panel1 = new JPanel(new BorderLayout()); panel1.add(panel, BorderLayout.CENTER); panel1.add(textFontPane, BorderLayout.SOUTH); initStyleListener(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel1); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel1); } @@ -142,8 +142,8 @@ public class VanChartPlotTooltipPane extends BasicPane { protected JPanel createDisplayStrategy(Plot plot) { showAllSeries = new UICheckBox(getShowAllSeriesLabelText()); - followMouse = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Follow_Mouse"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Follow_Mouse")}); + followMouse = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow_Mouse"), + Toolkit.i18nText("Fine-Design_Chart_Not_Follow_Mouse")}); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; @@ -151,17 +151,17 @@ public class VanChartPlotTooltipPane extends BasicPane { double[] rowSize = { p,p,p}; Component[][] components = new Component[3][2]; components[0] = new Component[]{null,null}; - components[1] = new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Prompt_Box")), UIComponentUtils.wrapWithBorderLayoutPane(followMouse)}; + components[1] = new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Prompt_Box")), UIComponentUtils.wrapWithBorderLayoutPane(followMouse)}; if(plot.isSupportTooltipSeriesType() && hasTooltipSeriesType()){ components[2] = new Component[]{showAllSeries,null}; } JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel); } protected String getShowAllSeriesLabelText() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Show_All_Series"); + return Toolkit.i18nText("Fine-Design_Chart_Show_All_Series"); }; protected boolean hasTooltipSeriesType() { 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 c0195070a..cc912cf3f 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 @@ -12,6 +12,7 @@ import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWithOutImageAndShadow; import com.fr.van.chart.designer.other.VanChartInteractivePaneWithMapZoom; +import com.fr.design.i18n.Toolkit; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -51,8 +52,8 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith } private JPanel createDrillToolsPane() { - openOrClose = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); - JPanel openOrClosePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Drill_Dir"), openOrClose); + openOrClose = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")}); + JPanel openOrClosePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Drill_Dir"), openOrClose); textAttrPane = new ChartTextAttrPane() { @Override @@ -83,9 +84,9 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith double[] rowSize = {p, p, p, p, p, p}; Component[][] components = new Component[][]{ new Component[]{null}, - new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Character"), textAttrPane)}, - new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane)}, - new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Select_Color"), selectBackgroundPane)}, + new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Character"), textAttrPane)}, + new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane)}, + new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Select_Color"), selectBackgroundPane)}, new Component[]{catalogSuperLink} }; drillPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); @@ -101,7 +102,7 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith } }); - JPanel panel1 = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Drill"), panel); + JPanel panel1 = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Drill"), panel); panel.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); return panel1; } From 83872631ae7dcc9963ad416242620f25000fa923 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 8 Mar 2020 14:25:51 +0800 Subject: [PATCH 063/375] =?UTF-8?q?=E6=B2=BF=E7=94=A8=E4=BB=A5=E5=89=8D?= =?UTF-8?q?=E7=9A=84=E9=80=8F=E6=98=8E=E9=A2=9C=E8=89=B2=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9getGaugeStyle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/constants/UIConstants.java | 2 -- .../com/fr/design/gui/ibutton/UIColorButtonWithAuto.java | 5 +++-- .../fr/design/style/color/ColorControlWindowWithAuto.java | 5 +++-- .../chart/gui/style/ChartTextAttrPaneWithAuto.java | 6 +++--- .../designer/style/label/VanChartGaugeLabelDetailPane.java | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java index 85c2c3092..15a7c87c0 100644 --- a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java +++ b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java @@ -143,8 +143,6 @@ public interface UIConstants { public static final Color TAB_BUTTON_PRESS_SELECTED = new Color(236, 236, 238); public static final Color POPUP_TITLE_BACKGROUND = new Color(0xd8f2fd); public static final Color LIST_ITEM_SPLIT_LINE = new Color(0xf0f0f3); - public static final Color AUTO_FONT_COLOR = new Color(0, 0, 0, 0); - public static final Color TRANSPARENT_FONT_COLOR = new Color(255, 255, 255, 0); public static final BufferedImage DRAG_BAR = IOUtils.readImage("com/fr/design/images/control/bar.png"); diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java index db64cba87..c883148ca 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java @@ -1,5 +1,6 @@ package com.fr.design.gui.ibutton; +import com.fr.chart.base.ChartConstants; import com.fr.design.constants.UIConstants; import com.fr.design.style.color.ColorControlWindow; import com.fr.design.style.color.ColorControlWindowWithAuto; @@ -10,11 +11,11 @@ import java.awt.Color; public class UIColorButtonWithAuto extends UIColorButton { protected void checkColorChange(Color oldColor, Color newColor) { - if (ComparatorUtils.equals(oldColor, UIConstants.AUTO_FONT_COLOR) && !ComparatorUtils.equals(newColor, UIConstants.AUTO_FONT_COLOR)) { + if (ComparatorUtils.equals(oldColor, ChartConstants.AUTO_FONT_COLOR) && !ComparatorUtils.equals(newColor, ChartConstants.AUTO_FONT_COLOR)) { setIcon(UIConstants.FONT_ICON); } - if (!ComparatorUtils.equals(oldColor, UIConstants.AUTO_FONT_COLOR) && ComparatorUtils.equals(newColor, UIConstants.AUTO_FONT_COLOR)) { + if (!ComparatorUtils.equals(oldColor, ChartConstants.AUTO_FONT_COLOR) && ComparatorUtils.equals(newColor, ChartConstants.AUTO_FONT_COLOR)) { setIcon(UIConstants.AUTO_FONT_ICON); } diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java b/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java index 46d32c713..05da3d4b9 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java @@ -1,5 +1,6 @@ package com.fr.design.style.color; +import com.fr.chart.base.ChartConstants; import com.fr.design.border.UIRoundedBorder; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; @@ -59,12 +60,12 @@ public abstract class ColorControlWindowWithAuto extends ColorControlWindow { protected void doTransparent() { getPopupHider().hidePopupMenu(); - setColor(UIConstants.TRANSPARENT_FONT_COLOR); + setColor(null); } protected void doAuto() { getPopupHider().hidePopupMenu(); - setColor(UIConstants.AUTO_FONT_COLOR); + setColor(ChartConstants.AUTO_FONT_COLOR); } public void customButtonPressed() { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java index 6760474e9..79863a24c 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.chart.gui.style; +import com.fr.chart.base.ChartConstants; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButtonWithAuto; import com.fr.design.i18n.Toolkit; @@ -10,7 +11,6 @@ import com.fr.general.GeneralUtils; public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { private static final String AUTO = Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto"); - private static final int AUTO_SIZE_INT = 0; private boolean isFontSizeAuto = false; private boolean isColorAuto = false; @@ -48,7 +48,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { protected float getFontSize() { if (isFontSizeAuto && ComparatorUtils.equals(getFontSizeComboBox().getSelectedItem(), AUTO)) { - return AUTO_SIZE_INT; + return ChartConstants.AUTO_FONT_SIZE; } return Float.parseFloat(GeneralUtils.objectToString(getFontSizeComboBox().getSelectedItem())); @@ -56,7 +56,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { protected void setFontSize(FRFont frFont) { if (getFontSizeComboBox() != null && isFontSizeAuto) { - if (frFont.getSize() == AUTO_SIZE_INT) { + if (frFont.getSize() == ChartConstants.AUTO_FONT_SIZE) { getFontSizeComboBox().setSelectedItem(AUTO); } else { getFontSizeComboBox().setSelectedItem(frFont.getSize() + ""); 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 9ead77303..0303a5a20 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 @@ -44,7 +44,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { } public GaugeStyle getGaugeStyle() { - return gaugeStyle; + return ((VanChartGaugePlot)this.getPlot()).getGaugeStyle(); } public void setGaugeStyle(GaugeStyle gaugeStyle) { From 0b3fd78b106ab1c270899b1278eb5aba486f6d69 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 8 Mar 2020 14:59:56 +0800 Subject: [PATCH 064/375] =?UTF-8?q?=E6=96=B9=E6=B3=95=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/style/ChartTextAttrPane.java | 11 ++++----- .../gui/style/ChartTextAttrPaneWithAuto.java | 24 ++++++++----------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index 3ac7f116e..7d38d4d39 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -34,11 +34,10 @@ public class ChartTextAttrPane extends BasicPane { private UIToggleButton bold; private UIToggleButton italic; private UIColorButton fontColor; - public static Integer[] Font_Sizes = new Integer[FONT_END - FONT_START + 1]; - + public static Integer[] FONT_SIZES = new Integer[FONT_END - FONT_START + 1]; static { for (int i = FONT_START; i <= FONT_END; i++) { - Font_Sizes[i - FONT_START] = i; + FONT_SIZES[i - FONT_START] = i; } } @@ -114,7 +113,7 @@ public class ChartTextAttrPane extends BasicPane { fontNameComboBox.setSelectedItem(frFont.getFamily()); bold.setSelected(frFont.isBold()); italic.setSelected(frFont.isItalic()); - setFontSize(frFont); + populateFontSize(frFont); if (fontColor != null) { fontColor.setColor(frFont.getForeground()); } @@ -124,7 +123,7 @@ public class ChartTextAttrPane extends BasicPane { registerAllComboBoxListener(listener); } - protected void setFontSize(FRFont frFont) { + protected void populateFontSize(FRFont frFont) { if (fontSizeComboBox != null) { fontSizeComboBox.setSelectedItem(frFont.getSize()); } @@ -177,7 +176,7 @@ public class ChartTextAttrPane extends BasicPane { } protected Object[] getFontSizeComboBoxModel() { - return Font_Sizes; + return FONT_SIZES; } protected void initState() { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java index 79863a24c..6061ed18b 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java @@ -13,6 +13,14 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { private static final String AUTO = Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto"); private boolean isFontSizeAuto = false; private boolean isColorAuto = false; + public static String[] FONT_SIZES_WITH_AUTO = new String[FONT_END - FONT_START + 2]; + static { + FONT_SIZES_WITH_AUTO[0] = AUTO; + + for (int i = 1; i < FONT_SIZES_WITH_AUTO.length; i++) { + FONT_SIZES_WITH_AUTO[i] = FONT_START + i - 1 + ""; + } + } public ChartTextAttrPaneWithAuto() { super(); @@ -31,19 +39,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { } protected Object[] getFontSizeComboBoxModel() { - if (isFontSizeAuto) { - String[] fontSizes = new String[FONT_END - FONT_START + 2]; - - fontSizes[0] = AUTO; - - for (int i = 1; i < fontSizes.length; i++) { - fontSizes[i] = FONT_START + i + ""; - } - - return fontSizes; - } - - return super.getFontSizeComboBoxModel(); + return isFontSizeAuto ? FONT_SIZES_WITH_AUTO : FONT_SIZES; } protected float getFontSize() { @@ -54,7 +50,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { return Float.parseFloat(GeneralUtils.objectToString(getFontSizeComboBox().getSelectedItem())); } - protected void setFontSize(FRFont frFont) { + protected void populateFontSize(FRFont frFont) { if (getFontSizeComboBox() != null && isFontSizeAuto) { if (frFont.getSize() == ChartConstants.AUTO_FONT_SIZE) { getFontSizeComboBox().setSelectedItem(AUTO); From f4b02049b70c5dfa2e82481922f3b41c076df17d Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 8 Mar 2020 15:22:49 +0800 Subject: [PATCH 065/375] =?UTF-8?q?get=E6=94=B9=E4=B8=BAupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/style/ChartTextAttrNoColorPane.java | 2 +- .../mainframe/chart/gui/style/ChartTextAttrPane.java | 10 +++++----- .../chart/gui/style/ChartTextAttrPaneWithAuto.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java index 249583768..177168cd7 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java @@ -56,6 +56,6 @@ public class ChartTextAttrNoColorPane extends ChartTextAttrPane { public FRFont updateFRFont() { String name = GeneralUtils.objectToString(getFontNameComboBox().getSelectedItem()); - return FRFont.getInstance(name, getFontStyle(), getFontSize()); + return FRFont.getInstance(name, updateFontStyle(), updateFontSize()); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index 7d38d4d39..a6be91a24 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -147,10 +147,10 @@ public class ChartTextAttrPane extends BasicPane { public FRFont updateFRFont() { String name = GeneralUtils.objectToString(fontNameComboBox.getSelectedItem()); - return FRFont.getInstance(name, getFontStyle(), getFontSize(), fontColor.getColor()); + return FRFont.getInstance(name, updateFontStyle(), updateFontSize(), fontColor.getColor()); } - protected int getFontStyle() { + protected int updateFontStyle() { int style = Font.PLAIN; if (bold.isSelected() && !italic.isSelected()) { style = Font.BOLD; @@ -163,7 +163,7 @@ public class ChartTextAttrPane extends BasicPane { return style; } - protected float getFontSize() { + protected float updateFontSize() { return Float.parseFloat(GeneralUtils.objectToString(fontSizeComboBox.getSelectedItem())); } @@ -205,7 +205,7 @@ public class ChartTextAttrPane extends BasicPane { populate(FRFont.getInstance()); } - protected JPanel getContentPane (JPanel buttonPane) { + protected JPanel getContentPane(JPanel buttonPane) { double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double[] columnSize = {f, e}; @@ -213,7 +213,7 @@ public class ChartTextAttrPane extends BasicPane { return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), getRowSize(), columnSize); } - protected double[] getRowSize () { + protected double[] getRowSize() { double p = TableLayout.PREFERRED; return new double[]{p, p, p}; } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java index 6061ed18b..70fdf903e 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java @@ -42,7 +42,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { return isFontSizeAuto ? FONT_SIZES_WITH_AUTO : FONT_SIZES; } - protected float getFontSize() { + protected float updateFontSize() { if (isFontSizeAuto && ComparatorUtils.equals(getFontSizeComboBox().getSelectedItem(), AUTO)) { return ChartConstants.AUTO_FONT_SIZE; } From 4d4a90a06ded71955424a6fa3476f13f75026aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 9 Mar 2020 11:26:34 +0800 Subject: [PATCH 066/375] =?UTF-8?q?CHART-12940=20=20=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/chartx/component/TableTreeComboBox.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java index 793b49b31..fe55b4486 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java @@ -2,7 +2,6 @@ package com.fr.design.chartx.component; import com.fr.design.gui.icombobox.FRTreeComboBox; import com.fr.design.gui.itextfield.UITextField; -import com.fr.general.IOUtils; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import javax.swing.JTextField; @@ -86,9 +85,6 @@ public class TableTreeComboBox extends FRTreeComboBox { if (value instanceof DefaultMutableTreeNode) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; Object userObj = node.getUserObject(); - if (node.getChildCount() > 0) { - this.setIcon(IOUtils.readIcon("com/fr/design/images/m_insert/expandCell.gif")); - } if (userObj != null) { this.setText(ChartGEOJSONHelper.getPresentNameWithPath(userObj.toString())); } From ee5801d52e36378b7e45f882f782aec3fe3c9deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 9 Mar 2020 13:34:31 +0800 Subject: [PATCH 067/375] =?UTF-8?q?CHART-12915=20=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/chartx/component/MapAreaMatchPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index 750abf97c..9da85b491 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -18,7 +18,6 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper; import com.fr.design.parameter.ParameterInputPane; import com.fr.general.GeneralUtils; @@ -35,6 +34,7 @@ import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JPanel; import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; import javax.swing.table.DefaultTableModel; import javax.swing.tree.DefaultMutableTreeNode; import java.util.HashMap; @@ -226,7 +226,7 @@ public class MapAreaMatchPane extends BasicBeanPane { if (ArrayUtils.isNotEmpty(parameters)) { final ParameterInputPane pPane = new ParameterInputPane(parameters); - pPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + pPane.showSmallWindow(SwingUtilities.getWindowAncestor(this), new DialogActionAdapter() { @Override public void doOk() { parameterMap.putAll(pPane.update()); From 3b8ff7913455e0a63bb3c6c87910843521fd4099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 9 Mar 2020 13:54:06 +0800 Subject: [PATCH 068/375] =?UTF-8?q?CHART-12932=20=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E4=BF=9D=E5=AD=98=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table/VanAreaMapPlotTableDataContentPane.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java index 26bdf911c..284320ceb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java @@ -9,6 +9,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.plugin.chart.map.VanChartMapPlot; +import com.fr.plugin.chart.map.data.MapMatchResult; import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; import com.fr.van.chart.map.designer.data.component.SeriesTypeUseComboxPaneWithOutFilter; @@ -139,7 +140,7 @@ public class VanAreaMapPlotTableDataContentPane extends VanMapTableDataContentPa TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition(); if (topDefinitionProvider instanceof VanMapTableDefinitionProvider) { VanMapTableDefinitionProvider mapTableDefinitionProvider = (VanMapTableDefinitionProvider) topDefinitionProvider; - mapTableDefinitionProvider.setMatchResult(this.getMatchResult()); + mapTableDefinitionProvider.setMatchResult((MapMatchResult) this.getMatchResult().clone()); updateDefinition(mapTableDefinitionProvider); } } @@ -157,7 +158,7 @@ public class VanAreaMapPlotTableDataContentPane extends VanMapTableDataContentPa TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition(); if (topDefinitionProvider instanceof VanMapTableDefinitionProvider) { VanMapTableDefinitionProvider mapTableDefinitionProvider = (VanMapTableDefinitionProvider) topDefinitionProvider; - this.setMatchResult(mapTableDefinitionProvider.getMatchResult()); + this.setMatchResult((MapMatchResult) mapTableDefinitionProvider.getMatchResult().clone()); populateDefinition(mapTableDefinitionProvider); } } From c2fa176e0a57bff1b7768fd09a8787d74b0197ec Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 9 Mar 2020 14:43:20 +0800 Subject: [PATCH 069/375] =?UTF-8?q?CHART-9435=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E7=9B=98=E9=BB=98=E8=AE=A4=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/ibutton/UIColorButtonWithAuto.java | 9 +++++++++ .../chart/gui/style/ChartTextAttrPaneWithAuto.java | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java index c883148ca..814d2aa29 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java @@ -6,10 +6,19 @@ import com.fr.design.style.color.ColorControlWindow; import com.fr.design.style.color.ColorControlWindowWithAuto; import com.fr.general.ComparatorUtils; +import javax.swing.Icon; import java.awt.Color; public class UIColorButtonWithAuto extends UIColorButton { + public UIColorButtonWithAuto() { + super(); + } + + public UIColorButtonWithAuto(Icon autoFontIcon) { + super(autoFontIcon); + } + protected void checkColorChange(Color oldColor, Color newColor) { if (ComparatorUtils.equals(oldColor, ChartConstants.AUTO_FONT_COLOR) && !ComparatorUtils.equals(newColor, ChartConstants.AUTO_FONT_COLOR)) { setIcon(UIConstants.FONT_ICON); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java index 70fdf903e..66e19d970 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.chart.gui.style; import com.fr.chart.base.ChartConstants; +import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButtonWithAuto; import com.fr.design.i18n.Toolkit; @@ -35,7 +36,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { } protected void initFontColorState() { - setFontColor(isColorAuto ? new UIColorButtonWithAuto() : new UIColorButton()); + setFontColor(isColorAuto ? new UIColorButtonWithAuto(UIConstants.AUTO_FONT_ICON) : new UIColorButton(UIConstants.FONT_ICON)); } protected Object[] getFontSizeComboBoxModel() { From f23feb842df1a93d265ac980be99805b537b3d3d Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 9 Mar 2020 15:16:35 +0800 Subject: [PATCH 070/375] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E6=9E=84=E9=80=A0=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/ibutton/UIColorButtonWithAuto.java | 11 +---------- .../chart/gui/style/ChartTextAttrPaneWithAuto.java | 5 ++--- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java index 814d2aa29..a7dcad008 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java @@ -6,19 +6,10 @@ import com.fr.design.style.color.ColorControlWindow; import com.fr.design.style.color.ColorControlWindowWithAuto; import com.fr.general.ComparatorUtils; -import javax.swing.Icon; import java.awt.Color; public class UIColorButtonWithAuto extends UIColorButton { - public UIColorButtonWithAuto() { - super(); - } - - public UIColorButtonWithAuto(Icon autoFontIcon) { - super(autoFontIcon); - } - protected void checkColorChange(Color oldColor, Color newColor) { if (ComparatorUtils.equals(oldColor, ChartConstants.AUTO_FONT_COLOR) && !ComparatorUtils.equals(newColor, ChartConstants.AUTO_FONT_COLOR)) { setIcon(UIConstants.FONT_ICON); @@ -44,4 +35,4 @@ public class UIColorButtonWithAuto extends UIColorButton { return getPopupWin(); } -} +} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java index 66e19d970..26f011af4 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe.chart.gui.style; import com.fr.chart.base.ChartConstants; -import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButtonWithAuto; import com.fr.design.i18n.Toolkit; @@ -36,7 +35,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { } protected void initFontColorState() { - setFontColor(isColorAuto ? new UIColorButtonWithAuto(UIConstants.AUTO_FONT_ICON) : new UIColorButton(UIConstants.FONT_ICON)); + setFontColor(isColorAuto ? new UIColorButtonWithAuto() : new UIColorButton()); } protected Object[] getFontSizeComboBoxModel() { @@ -64,4 +63,4 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { getFontSizeComboBox().setSelectedItem(frFont.getSize()); } } -} +} \ No newline at end of file From 4011ec7344723e8be26ff02842684ccbf3a25ef5 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 9 Mar 2020 16:49:51 +0800 Subject: [PATCH 071/375] REPORT-27685 && REPORT-27478 && REPORT-27454 --- .../src/main/java/com/fr/design/RestartHelper.java | 9 ++++++++- .../com/fr/design/mainframe/DesignerFrame.java | 14 +++++++++++--- .../design/update/ui/dialog/UpdateMainDialog.java | 3 +++ .../main/java/com/fr/start/DesignerLauncher.java | 3 ++- .../java/com/fr/start/DesignerSuperListener.java | 2 +- .../src/main/java/com/fr/start/MainDesigner.java | 1 + 6 files changed, 26 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/RestartHelper.java b/designer-base/src/main/java/com/fr/design/RestartHelper.java index 596257d70..b5f1b6b81 100644 --- a/designer-base/src/main/java/com/fr/design/RestartHelper.java +++ b/designer-base/src/main/java/com/fr/design/RestartHelper.java @@ -153,7 +153,14 @@ public class RestartHelper { } finally { WorkContext.getCurrent().close(); frame.dispose(); - DesignerExiter.getInstance().execute(); + try { + // 更新升级过渡用 供当前测试 后面可删除 + Class.forName("com.fr.exit.DesignerExiter"); + DesignerExiter.getInstance().execute(); + } catch (Exception ignore) { + } finally { + System.exit(0); + } } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 4d37d7539..d6b9c047e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -50,16 +50,18 @@ import com.fr.file.FILEFactory; import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; +import com.fr.general.IOUtils; +import com.fr.invoke.Reflect; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginContext; import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; -import com.fr.stable.OperatingSystem; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.stable.image4j.codec.ico.ICODecoder; +import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.support.OSBasedAction; import com.fr.stable.os.support.OSSupportCenter; import com.fr.stable.project.ProjectConstants; @@ -501,8 +503,14 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta image = ICODecoder.read(DesignerFrame.class .getResourceAsStream("/com/fr/base/images/oem/logo.ico")); } - this.setIconImages(image); - } catch (IOException e) { + if (OperatingSystem.isMacos()) { + Class clazz = Class.forName("com.apple.eawt.Application"); + BufferedImage icon = image.isEmpty() ? IOUtils.readImage("/com/fr/base/images/oem/logo.png") : image.get(image.size() - 1); + Reflect.on(Reflect.on(clazz).call("getApplication").get()).call("setDockIconImage", icon); + } else { + this.setIconImages(image); + } + } catch (IOException | ClassNotFoundException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); this.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png")); } diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java index 52e4144de..78df599c5 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java @@ -30,6 +30,8 @@ import com.fr.general.http.HttpToolbox; import com.fr.json.JSONArray; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; +import com.fr.process.engine.core.FineProcessContext; +import com.fr.process.engine.core.FineProcessEngineEvent; import com.fr.stable.*; import com.fr.stable.project.ProjectConstants; import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse; @@ -598,6 +600,7 @@ public class UpdateMainDialog extends UIDialog { final String installLib = StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LOGS_NAME, UpdateConstants.INSTALL_LIB); final JFrame frame = DesignerContext.getDesignerFrame(); final RestartHelper helper = new RestartHelper(); + FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY); new FileProcess(callBack) { @Override public void onDownloadSuccess() { diff --git a/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java b/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java index d0633ac6a..9e98fcb40 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java @@ -1,5 +1,6 @@ package com.fr.start; +import com.fr.design.RestartHelper; import com.fr.process.FineProcess; import com.fr.process.engine.FineJavaProcessFactory; import com.fr.process.engine.core.FineProcessContext; @@ -63,6 +64,6 @@ public class DesignerLauncher { public void restart() { beforeExit(); - start(args); + RestartHelper.restart(); } } diff --git a/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java b/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java index acbd92271..db8e532dc 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java @@ -57,7 +57,7 @@ public class DesignerSuperListener { process.getPipe().listen(FineProcessEngineEvent.DESTROY, new Listener() { @Override public void on(Event event, Null param) { - DesignerLauncher.getInstance().exit(); + System.exit(0); } }); } diff --git a/designer-realize/src/main/java/com/fr/start/MainDesigner.java b/designer-realize/src/main/java/com/fr/start/MainDesigner.java index 238b03512..d4eb68e86 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -106,6 +106,7 @@ public class MainDesigner extends BaseDesigner { watch.start(); //启动运行时 FineRuntime.start(); + DesignerSubListener.getInstance().start(); Module designerRoot = ModuleContext.parseRoot("designer-startup.xml"); //传递启动参数 designerRoot.setSingleton(StartupArgs.class, new StartupArgs(args)); From 048c406c48fadef32ea9b02a72252bbac47d9832 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 9 Mar 2020 17:01:06 +0800 Subject: [PATCH 072/375] =?UTF-8?q?CHART-9435=20=E5=A4=9A=E6=8C=87?= =?UTF-8?q?=E9=92=88=E4=BB=AA=E8=A1=A8=E7=9B=98=E5=9D=90=E6=A0=87=E8=BD=B4?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E5=A4=A7=E5=B0=8F=E8=87=AA=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 55622a85b..3ec313aab 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 @@ -101,7 +101,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { protected ChartTextAttrPane getChartTextAttrPane() { if (isMulti(gaugeStyle)) { - return new ChartTextAttrPaneWithAuto(false, true); + return new ChartTextAttrPaneWithAuto(true, true); } else { return new ChartTextAttrPane(); } From b5575698bc8a42daf42fe5f139af8741eec0fb1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 9 Mar 2020 17:30:48 +0800 Subject: [PATCH 073/375] =?UTF-8?q?CHART-12933=20=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E5=8C=BA=E5=88=86=E7=82=B9=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E5=92=8C=E5=8C=BA=E5=9F=9F=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/chartx/fields/diff/MapDataSetFieldsPane.java | 2 +- .../data/contentpane/table/VanMapTableDataContentPane.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MapDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MapDataSetFieldsPane.java index e445a07ef..1b6c6f9be 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MapDataSetFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MapDataSetFieldsPane.java @@ -63,7 +63,7 @@ public abstract class MapDataSetFieldsPane Date: Mon, 9 Mar 2020 18:22:46 +0800 Subject: [PATCH 074/375] =?UTF-8?q?CHART-9435=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E7=B1=BB=E5=9E=8B=E6=9D=A5=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E8=87=AA=E5=8A=A8=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/style/ChartTextAttrPaneWithAuto.java | 32 ++++++++++++++----- .../gauge/VanChartGaugeDetailAxisPane.java | 3 +- .../label/VanChartGaugeLabelDetailPane.java | 17 +++++++++- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java index 26f011af4..4cb9f7373 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java @@ -4,6 +4,7 @@ import com.fr.chart.base.ChartConstants; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButtonWithAuto; import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.type.FontAutoType; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.general.GeneralUtils; @@ -22,18 +23,33 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { } } - public ChartTextAttrPaneWithAuto() { - super(); - } - - public ChartTextAttrPaneWithAuto(boolean isFontSizeAuto, boolean isColorAuto) { - this.isFontSizeAuto = isFontSizeAuto; - this.isColorAuto = isColorAuto; - + public ChartTextAttrPaneWithAuto(FontAutoType type) { + initAutoType(type); initState(); initComponents(); } + private void initAutoType(FontAutoType type) { + switch (type) { + case NONE: + this.isFontSizeAuto = false; + this.isColorAuto = false; + break; + case SIZE: + this.isFontSizeAuto = true; + this.isColorAuto = false; + break; + case COLOR: + this.isFontSizeAuto = false; + this.isColorAuto = true; + break; + case SIZE_AND_COLOR: + this.isFontSizeAuto = true; + this.isColorAuto = true; + break; + } + } + protected void initFontColorState() { setFontColor(isColorAuto ? new UIColorButtonWithAuto() : new UIColorButton()); } 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 3ec313aab..cdb6b04b4 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 @@ -13,6 +13,7 @@ import com.fr.design.style.color.ColorSelectBox; import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartGaugeAxis; import com.fr.plugin.chart.gauge.VanChartGaugePlot; +import com.fr.plugin.chart.type.FontAutoType; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.style.VanChartStylePane; @@ -101,7 +102,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { protected ChartTextAttrPane getChartTextAttrPane() { if (isMulti(gaugeStyle)) { - return new ChartTextAttrPaneWithAuto(true, true); + return new ChartTextAttrPaneWithAuto(FontAutoType.SIZE_AND_COLOR); } else { return new ChartTextAttrPane(); } 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 0303a5a20..af7cb3b93 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 @@ -13,6 +13,7 @@ import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.gauge.VanChartGaugePlot; +import com.fr.plugin.chart.type.FontAutoType; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.stable.Constants; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -69,9 +70,23 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { return false; } + private FontAutoType getFontAutoType(boolean isFontSizeAuto, boolean isFontColorAuto) { + if (isFontSizeAuto && isFontColorAuto) { + return FontAutoType.SIZE_AND_COLOR; + } + if (isFontSizeAuto) { + return FontAutoType.SIZE; + } + if (isFontColorAuto) { + return FontAutoType.COLOR; + } + return FontAutoType.NONE; + } + protected ChartTextAttrPane initTextFontPane() { + FontAutoType type = getFontAutoType(isFontSizeAuto(), isFontColorAuto()); - return new ChartTextAttrPaneWithAuto(isFontSizeAuto(), isFontColorAuto()) { + return new ChartTextAttrPaneWithAuto(type) { protected double[] getRowSize() { double p = TableLayout.PREFERRED; return new double[]{p, p}; From c12aa0e57b3046bafa5688d9a0783e4538c039a9 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 9 Mar 2020 20:19:03 +0800 Subject: [PATCH 075/375] =?UTF-8?q?=E7=AE=80=E5=8C=96=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/style/ChartTextAttrPaneWithAuto.java | 41 +++++++------------ 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java index 4cb9f7373..292d83c9e 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java @@ -12,9 +12,9 @@ import com.fr.general.GeneralUtils; public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { private static final String AUTO = Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto"); - private boolean isFontSizeAuto = false; - private boolean isColorAuto = false; + private FontAutoType type; public static String[] FONT_SIZES_WITH_AUTO = new String[FONT_END - FONT_START + 2]; + static { FONT_SIZES_WITH_AUTO[0] = AUTO; @@ -24,42 +24,29 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { } public ChartTextAttrPaneWithAuto(FontAutoType type) { - initAutoType(type); + this.type = type; initState(); initComponents(); } - private void initAutoType(FontAutoType type) { - switch (type) { - case NONE: - this.isFontSizeAuto = false; - this.isColorAuto = false; - break; - case SIZE: - this.isFontSizeAuto = true; - this.isColorAuto = false; - break; - case COLOR: - this.isFontSizeAuto = false; - this.isColorAuto = true; - break; - case SIZE_AND_COLOR: - this.isFontSizeAuto = true; - this.isColorAuto = true; - break; - } + private boolean isFontSizeAuto() { + return type == FontAutoType.SIZE || type == FontAutoType.SIZE_AND_COLOR; + } + + private boolean isFontColorAuto() { + return type == FontAutoType.COLOR || type == FontAutoType.SIZE_AND_COLOR; } protected void initFontColorState() { - setFontColor(isColorAuto ? new UIColorButtonWithAuto() : new UIColorButton()); + setFontColor(isFontColorAuto() ? new UIColorButtonWithAuto() : new UIColorButton()); } protected Object[] getFontSizeComboBoxModel() { - return isFontSizeAuto ? FONT_SIZES_WITH_AUTO : FONT_SIZES; + return isFontSizeAuto() ? FONT_SIZES_WITH_AUTO : FONT_SIZES; } protected float updateFontSize() { - if (isFontSizeAuto && ComparatorUtils.equals(getFontSizeComboBox().getSelectedItem(), AUTO)) { + if (isFontSizeAuto() && ComparatorUtils.equals(getFontSizeComboBox().getSelectedItem(), AUTO)) { return ChartConstants.AUTO_FONT_SIZE; } @@ -67,7 +54,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { } protected void populateFontSize(FRFont frFont) { - if (getFontSizeComboBox() != null && isFontSizeAuto) { + if (getFontSizeComboBox() != null && isFontSizeAuto()) { if (frFont.getSize() == ChartConstants.AUTO_FONT_SIZE) { getFontSizeComboBox().setSelectedItem(AUTO); } else { @@ -75,7 +62,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { } } - if (getFontSizeComboBox() != null && !isFontSizeAuto) { + if (getFontSizeComboBox() != null && !isFontSizeAuto()) { getFontSizeComboBox().setSelectedItem(frFont.getSize()); } } From f24b41b4409a523f9b59646092fe4033044b5cb8 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 10 Mar 2020 09:43:28 +0800 Subject: [PATCH 076/375] =?UTF-8?q?=E7=AE=80=E5=8C=96=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/label/VanChartGaugeLabelDetailPane.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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 af7cb3b93..ff510c708 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 @@ -70,23 +70,21 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { return false; } - private FontAutoType getFontAutoType(boolean isFontSizeAuto, boolean isFontColorAuto) { - if (isFontSizeAuto && isFontColorAuto) { + private FontAutoType getFontAutoType() { + if (isFontSizeAuto() && isFontColorAuto()) { return FontAutoType.SIZE_AND_COLOR; } - if (isFontSizeAuto) { + if (isFontSizeAuto()) { return FontAutoType.SIZE; } - if (isFontColorAuto) { + if (isFontColorAuto()) { return FontAutoType.COLOR; } return FontAutoType.NONE; } protected ChartTextAttrPane initTextFontPane() { - FontAutoType type = getFontAutoType(isFontSizeAuto(), isFontColorAuto()); - - return new ChartTextAttrPaneWithAuto(type) { + return new ChartTextAttrPaneWithAuto(getFontAutoType()) { protected double[] getRowSize() { double p = TableLayout.PREFERRED; return new double[]{p, p}; From e0cef2e6b969948ab7c2213b5680102c1e32e320 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 10 Mar 2020 10:23:11 +0800 Subject: [PATCH 077/375] fix npe --- .../java/com/fr/start/DesignerSubListener.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/DesignerSubListener.java b/designer-realize/src/main/java/com/fr/start/DesignerSubListener.java index 3e8663f89..c76e6b072 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerSubListener.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerSubListener.java @@ -26,13 +26,15 @@ public class DesignerSubListener { } public void start() { - FineProcessContext.getParentPipe().listen(FineProcessEngineEvent.READY, new Listener() { - @Override - public void on(Event event, Null param) { - if (DesignerContext.getDesignerFrame() == null || !DesignerContext.getDesignerFrame().isShowing()) { - FineProcessContext.getParentPipe().fire(new CarryMessageEvent(DesignerProcessType.INSTANCE.obtain())); + if (FineProcessContext.getParentPipe() != null) { + FineProcessContext.getParentPipe().listen(FineProcessEngineEvent.READY, new Listener() { + @Override + public void on(Event event, Null param) { + if (DesignerContext.getDesignerFrame() == null || !DesignerContext.getDesignerFrame().isShowing()) { + FineProcessContext.getParentPipe().fire(new CarryMessageEvent(DesignerProcessType.INSTANCE.obtain())); + } } - } - }); + }); + } } } From 282ba7dc2e4957a349ff7abf20fa5d979ea1157e Mon Sep 17 00:00:00 2001 From: Maksim Date: Tue, 10 Mar 2020 13:47:34 +0800 Subject: [PATCH 078/375] =?UTF-8?q?isWarDeploy=E8=B0=83=E7=94=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/env/RemoteWorkspace.java | 16 +++++++--------- .../design/write/submit/CheckServiceDialog.java | 4 ++-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java index 735c1a5bd..7a4453a83 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java @@ -2,10 +2,9 @@ package com.fr.design.env; import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.design.i18n.Toolkit; -import com.fr.invoke.ReflectException; -import com.fr.log.FineLoggerFactory; import com.fr.base.operator.common.CommonOperator; import com.fr.rpc.ExceptionHandler; +import com.fr.rpc.RPCInvokerExceptionInfo; import com.fr.stable.AssistUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; @@ -51,13 +50,12 @@ public class RemoteWorkspace implements Workspace { @Override public boolean isWarDeploy() { - - try { - return WorkContext.getCurrent().get(CommonOperator.class).isWarDeploy(); - } catch (ReflectException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - return false; - } + return WorkContext.getCurrent().get(CommonOperator.class, new ExceptionHandler() { + @Override + public Boolean callHandler(RPCInvokerExceptionInfo rpcInvokerExceptionInfo) { + return false; + } + }).isWarDeploy(); } @Override diff --git a/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java b/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java index a5f5d752b..dfad82eda 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java @@ -54,7 +54,7 @@ public class CheckServiceDialog extends JDialog implements ActionListener { font = font.applySize(15).applyStyle(1); JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Inconsistency")); label.setFont(font); - label.setPreferredSize(new Dimension(600,30)); + label.setPreferredSize(new Dimension(650,30)); JLabel label2 = new JLabel(""+Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Local_Designer") + localBranch + "/" + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + remoteBranch+""); label2.setPreferredSize(new Dimension(600,30)); @@ -98,7 +98,7 @@ public class CheckServiceDialog extends JDialog implements ActionListener { this.add(topPanel,BorderLayout.NORTH); this.add(centerPanel, BorderLayout.CENTER); this.add(buttonPanel,BorderLayout.SOUTH); - this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US)? 700:600, 500)); + this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US)? 750:600, 500)); GUICoreUtils.centerWindow(this); } From 57e7f684a9d54f536fbf9d62c6f1ce5b548b45ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 10 Mar 2020 15:07:17 +0800 Subject: [PATCH 079/375] =?UTF-8?q?CHART-12771=20=E8=B6=85=E9=93=BE?= =?UTF-8?q?=E6=82=AC=E6=B5=AE=E5=9B=BE=E8=A1=A8=E7=BB=98=E5=88=B6=E5=B8=A6?= =?UTF-8?q?=E5=9B=9E=E8=B0=83=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/chart/gui/ChartComponent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java index 3fae88fe4..ca1f4f140 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java +++ b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java @@ -257,7 +257,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene if (resolution == 0){ resolution = ScreenResolution.getScreenResolution(); } - painter.paint(g2d, chartWidth, chartHeight, resolution, null); + painter.paint(g2d, chartWidth, chartHeight, resolution, null, this); } } From 22d28e0fa3ffe7aab8394fdd3c50ce5957f09282 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 11 Mar 2020 14:40:17 +0800 Subject: [PATCH 080/375] REPORT-27790 && REPORT-27451 --- .../com/fr/design/utils/DesignerPort.java | 2 +- .../com/fr/design/webattr/WebCssPane.java | 4 ++- .../java/com/fr/design/webattr/WebJsPane.java | 10 ++++--- .../src/main/java/com/fr/start/Designer.java | 23 ++++++++++++-- .../com/fr/start/DesignerJavaRuntime.java | 19 +++++++++++- .../com/fr/start/module/DesignerStartup.java | 2 ++ .../com/fr/start/DesignerJavaRuntimeTest.java | 30 +++++++++++++++++++ 7 files changed, 81 insertions(+), 9 deletions(-) create mode 100644 designer-realize/src/test/java/com/fr/start/DesignerJavaRuntimeTest.java diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignerPort.java b/designer-base/src/main/java/com/fr/design/utils/DesignerPort.java index cd02bc5c5..55dc1f00d 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignerPort.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignerPort.java @@ -32,7 +32,7 @@ public class DesignerPort implements XMLReadable, XMLWriter { public static final String XML_TAG = "DesignerPort"; private static final int MIN_PORT = 1024; - private static final int MAX_PORT = 65536; + private static final int MAX_PORT = 65535; public static final DesignerPort INSTANCE = new DesignerPort(); diff --git a/designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java b/designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java index a6576faa1..9ebbf875f 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java @@ -12,6 +12,7 @@ import com.fr.file.FILEChooserPane; import com.fr.file.filter.ChooseFileFilter; import com.fr.stable.CoreConstants; import com.fr.stable.StringUtils; +import com.fr.stable.project.ProjectConstants; import com.fr.web.attr.ReportWebAttr; import javax.swing.BorderFactory; @@ -46,7 +47,8 @@ public class WebCssPane extends BasicPane { northPane.add(localText, FlowLayout.CENTER); northPane.add(chooseFile, FlowLayout.RIGHT); outnorth.add(northPane,BorderLayout.NORTH); - UILabel infor = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CSS_Warning")); + UILabel infor = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CSS_Warning", + ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBAPP_NAME)); infor.setForeground(new Color(207, 42, 39)); outnorth.add(infor,BorderLayout.CENTER); this.add(outnorth, BorderLayout.NORTH); diff --git a/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java b/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java index bf04e554f..7c5c2e6b9 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java @@ -15,6 +15,7 @@ import com.fr.file.filter.ChooseFileFilter; import com.fr.log.FineLoggerFactory; import com.fr.stable.CoreConstants; import com.fr.stable.StringUtils; +import com.fr.stable.project.ProjectConstants; import com.fr.web.attr.ReportWebAttr; import javax.swing.BorderFactory; @@ -97,7 +98,8 @@ public class WebJsPane extends BasicPane { northPane.add(localText); northPane.add(chooseFile); firstnorth.add(northPane,BorderLayout.NORTH); - infor1 = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING1")); + infor1 = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING1", + ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBAPP_NAME)); infor1.setForeground(new Color(207, 42, 39)); firstnorth.add(infor1,BorderLayout.CENTER); @@ -107,7 +109,7 @@ public class WebJsPane extends BasicPane { centerPane.add(urlText); centerPane.add(testConnection); secondnorth.add(centerPane,BorderLayout.NORTH); - infor2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING2")); + infor2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING2", ProjectConstants.WEBAPP_NAME)); infor2.setForeground(new Color(207, 42, 39)); secondnorth.add(infor2,BorderLayout.CENTER); @@ -221,13 +223,13 @@ public class WebJsPane extends BasicPane { localRadioSelectAction(); urlFileRadioButton.setForeground(new Color(143, 142, 139)); localFileRadioButton.setForeground(Color.black); - infor1.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING1")); + infor1.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING1", ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBAPP_NAME)); infor2.setText(" "); } else if (urlFileRadioButton.isSelected()) { urlRadioSelectAction(); localFileRadioButton.setForeground(new Color(143, 142, 139)); urlFileRadioButton.setForeground(Color.black); - infor2.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING2")); + infor2.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING2", ProjectConstants.WEBAPP_NAME)); infor1.setText(" "); } if (StringUtils.isEmpty(urlText.getText()) && StringUtils.isEmpty(localText.getText())) { diff --git a/designer-realize/src/main/java/com/fr/start/Designer.java b/designer-realize/src/main/java/com/fr/start/Designer.java index 57a653225..fb974da98 100644 --- a/designer-realize/src/main/java/com/fr/start/Designer.java +++ b/designer-realize/src/main/java/com/fr/start/Designer.java @@ -1,5 +1,7 @@ package com.fr.start; +import com.fr.log.FineLoggerFactory; + /** * 设计器主进程入口(无缝更换升级jar包,若使用其他类作为入口,需要重新打包designer.exe等,升级后仍然走的原来逻辑) * @@ -11,7 +13,24 @@ package com.fr.start; public class Designer { public static void main(String[] args) { - // 创建进程 - DesignerLauncher.getInstance().start(args); + try { + if (DesignerJavaRuntime.getInstance().isInValidVmOptions()) { + runNonGuardianDesigner(args); + } else { + // 创建进程 + DesignerLauncher.getInstance().start(args); + } + } catch (Exception e) { + runNonGuardianDesigner(args); + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + + /** + * 启动非守护设计器 + * @param args 参数 + */ + private static void runNonGuardianDesigner(String[] args) { + MainDesigner.main(args); } } diff --git a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java index 351bf1e44..63beaabfd 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java @@ -6,6 +6,8 @@ import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.os.OperatingSystem; +import java.util.Set; + /** * 设计器Java运行环境 * @@ -16,11 +18,12 @@ import com.fr.stable.os.OperatingSystem; public class DesignerJavaRuntime extends AbstractJavaRuntime { private static final String DOT = "."; + private static final String REMOTE_DEBUG = "-agentlib:jdwp=transport=dt_socket"; private static final String INSTALL4J = ".install4j"; private static final String JAVA_EXEC = "java"; private static final String WIN_JRE_BIN = StableUtils.pathJoin("jre", "bin"); private static final String MAC_JRE_BIN = StableUtils.pathJoin("jre.bundle", "Contents", "Home", "jre", "bin"); - private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m"}; + private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"}; private static final DesignerJavaRuntime INSTANCE = new DesignerJavaRuntime(); @@ -28,6 +31,20 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { return INSTANCE; } + /** + * 远程调试不走启动守护 + * @return + */ + public boolean isInValidVmOptions() { + String[] options = getJvmOptions(); + for (String op : options) { + if (op.startsWith(REMOTE_DEBUG)) { + return true; + } + } + return false; + } + @Override public String getJavaExec() { String installHome = StableUtils.getInstallHome(); diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java index 3dd7322f6..708cc0020 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java @@ -58,6 +58,8 @@ public class DesignerStartup extends Activator { BuildContext.setBuildFilePath("/com/fr/stable/build.properties"); // 检查是否是-Ddebug = true 启动 并切换对应的端口以及环境配置文件 checkDebugStart(); + // 都是在启动过程中读取,这边提前初始化xml配置 + DesignerEnvManager.getEnvManager(); // 初始化look and feel DesignUtils.initLookAndFeel(); if (DesignUtils.isPortOccupied()) { diff --git a/designer-realize/src/test/java/com/fr/start/DesignerJavaRuntimeTest.java b/designer-realize/src/test/java/com/fr/start/DesignerJavaRuntimeTest.java new file mode 100644 index 000000000..13576a6e0 --- /dev/null +++ b/designer-realize/src/test/java/com/fr/start/DesignerJavaRuntimeTest.java @@ -0,0 +1,30 @@ +package com.fr.start; + +import junit.framework.TestCase; +import org.easymock.EasyMock; +import org.junit.Assert; +import org.junit.runner.RunWith; +import org.powermock.api.easymock.PowerMock; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; + + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/10 + */ +@RunWith(PowerMockRunner.class) +@PrepareForTest({DesignerJavaRuntime.class}) +public class DesignerJavaRuntimeTest extends TestCase { + + public void testIsInValidVmOptions() { + PowerMock.mockStatic(DesignerJavaRuntime.class); + DesignerJavaRuntime designerJavaRuntime = PowerMock.createPartialMock(DesignerJavaRuntime.class, "isInstallVersion", "getJvmOptions"); + String[] options = new String[]{"-Dfile.encoding=UTF-8", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"}; + EasyMock.expect(designerJavaRuntime.getJvmOptions()).andReturn(options).anyTimes(); + EasyMock.replay(designerJavaRuntime); + PowerMock.replay(DesignerJavaRuntime.class); + Assert.assertTrue(designerJavaRuntime.isInValidVmOptions()); + } +} \ No newline at end of file From 445a349479c8651e43a1f842c886d37bdf2686a2 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 11 Mar 2020 14:47:17 +0800 Subject: [PATCH 081/375] fix --- .../src/main/java/com/fr/start/DesignerJavaRuntime.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java index 63beaabfd..c264e79cb 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java @@ -23,7 +23,7 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { private static final String JAVA_EXEC = "java"; private static final String WIN_JRE_BIN = StableUtils.pathJoin("jre", "bin"); private static final String MAC_JRE_BIN = StableUtils.pathJoin("jre.bundle", "Contents", "Home", "jre", "bin"); - private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"}; + private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m"}; private static final DesignerJavaRuntime INSTANCE = new DesignerJavaRuntime(); From 661babee78939bc5451b60dd99371626d7e4976d Mon Sep 17 00:00:00 2001 From: lucian Date: Wed, 11 Mar 2020 16:22:19 +0800 Subject: [PATCH 082/375] =?UTF-8?q?REPORT-26262=20=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95=EF=BC=8C=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E4=B8=8D=E8=83=BD=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/WidgetDefinePaneFactory.java | 32 +++++++++++++++++-- .../widget/WidgetMobilePaneFactory.java | 30 ++++++++++++++++- 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetDefinePaneFactory.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetDefinePaneFactory.java index 2df2e9f2a..0dbde28ad 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetDefinePaneFactory.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetDefinePaneFactory.java @@ -1,6 +1,7 @@ package com.fr.design.widget; import com.fr.design.ExtraDesignClassManager; +import com.fr.design.fun.CellWidgetOptionProvider; import com.fr.design.gui.core.WidgetConstants; import com.fr.design.widget.ui.ButtonDefinePane; import com.fr.design.widget.ui.CheckBoxDefinePane; @@ -42,7 +43,13 @@ import com.fr.form.ui.TextEditor; import com.fr.form.ui.TreeComboBoxEditor; import com.fr.form.ui.TreeEditor; import com.fr.form.ui.Widget; +import com.fr.general.GeneralContext; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.injectable.PluginModule; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; import com.fr.report.web.button.form.TreeNodeToggleButton; import com.fr.report.web.button.write.AppendRowButton; import com.fr.report.web.button.write.DeleteRowButton; @@ -66,6 +73,26 @@ public class WidgetDefinePaneFactory { private static Map, Appearance> pluginDefineMap = ExtraDesignClassManager.getInstance().getCellWidgetOptionsMap(); static { + putDefault(); + + GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + @Override + public void on(PluginEvent event) { + refreshPluginMap(); + } + }, new PluginFilter() { + @Override + public boolean accept(PluginContext context) { + return context.contain(PluginModule.ExtraDesign, CellWidgetOptionProvider.XML_TAG); + } + }); + } + + private WidgetDefinePaneFactory() { + + } + + private static void putDefault() { defineMap.put(NumberEditor.class, new Appearance(NumberEditorDefinePane.class, WidgetConstants.NUMBER + "")); defineMap.put(DateEditor.class, new Appearance(DateEditorDefinePane.class, WidgetConstants.DATE + "")); defineMap.put(ComboCheckBox.class, new Appearance(ComboCheckBoxDefinePane.class, WidgetConstants.COMBOCHECKBOX + "")); @@ -96,8 +123,9 @@ public class WidgetDefinePaneFactory { defineMap.put(TreeNodeToggleButton.class, new Appearance(ButtonDefinePane.class, WidgetConstants.BUTTON + "")); } - private WidgetDefinePaneFactory() { - + private static void refreshPluginMap() { + pluginDefineMap.clear(); + pluginDefineMap.putAll(ExtraDesignClassManager.getInstance().getCellWidgetOptionsMap()); } @Nullable diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetMobilePaneFactory.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetMobilePaneFactory.java index e6438897c..86eba335d 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetMobilePaneFactory.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetMobilePaneFactory.java @@ -1,13 +1,20 @@ package com.fr.design.widget; import com.fr.design.ExtraDesignClassManager; +import com.fr.design.fun.CellWidgetOptionProvider; import com.fr.design.widget.mobile.WidgetMobilePane; import com.fr.design.widget.ui.mobile.MultiFileEditorMobilePane; import com.fr.design.widget.ui.mobile.ScanCodeMobilePane; import com.fr.form.ui.MultiFileEditor; import com.fr.form.ui.TextEditor; import com.fr.form.ui.Widget; +import com.fr.general.GeneralContext; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.injectable.PluginModule; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; import java.util.HashMap; import java.util.Map; @@ -17,22 +24,43 @@ import java.util.Map; */ public class WidgetMobilePaneFactory { private static Map, Class> mobilePaneMap = new HashMap<>(); + private static Map, Class> mobilePluginPaneMap = new HashMap<>(); static { mobilePaneMap.put(MultiFileEditor.class, MultiFileEditorMobilePane.class); mobilePaneMap.put(TextEditor.class, ScanCodeMobilePane.class); - mobilePaneMap.putAll(ExtraDesignClassManager.getInstance().getCellWidgetMobileOptionsMap()); + mobilePluginPaneMap.putAll(ExtraDesignClassManager.getInstance().getCellWidgetMobileOptionsMap()); + + GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + @Override + public void on(PluginEvent event) { + refreshPluginMap(); + } + }, new PluginFilter() { + @Override + public boolean accept(PluginContext context) { + return context.contain(PluginModule.ExtraDesign, CellWidgetOptionProvider.XML_TAG); + } + }); } private WidgetMobilePaneFactory() { } + private static void refreshPluginMap() { + mobilePluginPaneMap.clear(); + mobilePluginPaneMap.putAll(ExtraDesignClassManager.getInstance().getCellWidgetMobileOptionsMap()); + } + public static WidgetMobilePane createWidgetMobilePane(Widget widget) { WidgetMobilePane mobilePane = WidgetMobilePane.DEFAULT_PANE; try { if (mobilePaneMap.containsKey(widget.getClass())) { mobilePane = mobilePaneMap.get(widget.getClass()).newInstance(); mobilePane.populate(widget); + } else if (mobilePluginPaneMap.containsKey(widget.getClass())){ + mobilePane = mobilePluginPaneMap.get(widget.getClass()).newInstance(); + mobilePane.populate(widget); } } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); From 16907ac0bf6d42b7aaa4d91e5eaadf48b502d9dd Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 12 Mar 2020 14:09:09 +0800 Subject: [PATCH 083/375] =?UTF-8?q?CHART-12973=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E8=AF=95=E7=AE=A1=E5=9E=8B=E4=BB=AA=E8=A1=A8=E7=9B=98=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 564f45f9a..9c16fa961 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 @@ -92,13 +92,12 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { if(attrLabel == null){ return; } + attrLabel.getAttrLabelDetail().getTextAttr().setFRFont(VanChartGaugePlot.THERMOMETER_LABEL_FONT); if(gaugeLayout.getSelectedIndex() == 0){ attrLabel.getAttrLabelDetail().setPosition(Constants.LEFT); - attrLabel.getAttrLabelDetail().getTextAttr().setFRFont(VanChartGaugePlot.THERMOMETER_VERTICAL_PERCENT_LABEL_FONT); attrLabel.getGaugeValueLabelDetail().setPosition(Constants.LEFT); } else { attrLabel.getAttrLabelDetail().setPosition(Constants.BOTTOM); - attrLabel.getAttrLabelDetail().getTextAttr().setFRFont(VanChartGaugePlot.THERMOMETER_PERCENT_LABEL_FONT); attrLabel.getGaugeValueLabelDetail().setPosition(Constants.BOTTOM); } } From 9dde39c35a589fceb9873c45e4560e0ae62fa4f9 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 12 Mar 2020 14:18:26 +0800 Subject: [PATCH 084/375] REPORT-27771 && REPORT-27493 && REPORT-27954 --- .../tabledatapane/TableDataManagerPane.java | 11 +++++-- .../java/com/fr/design/mainframe/JForm.java | 3 ++ .../design/actions/cell/NewPresentAction.java | 30 ++++++++++++++++--- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java index 7c484c7b2..4c08fae2b 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java @@ -33,9 +33,16 @@ public class TableDataManagerPane extends LoadingBasicPane { ); } tableDataPane = pane == null ? new TableDataPaneListPane() { - public void rename(String oldName, String newName) { + @Override + public void rename(final String oldName, final String newName) { super.rename(oldName, newName); - renameConnection(oldName, newName); + new SwingWorker() { + @Override + protected Void doInBackground() { + renameConnection(oldName, newName); + return null; + } + }; } } : pane; container.add(tableDataPane.getPanel(), BorderLayout.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 ab19002c1..ef14169e7 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 @@ -5,6 +5,7 @@ import com.fr.base.PaperSize; import com.fr.base.Parameter; import com.fr.base.extension.FileExtension; import com.fr.base.vcs.DesignerMode; +import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; import com.fr.design.actions.FormMobileAttrAction; import com.fr.design.actions.TemplateParameterAction; @@ -12,6 +13,7 @@ import com.fr.design.actions.core.WorkBookSupportable; import com.fr.design.actions.file.export.EmbeddedFormExportExportAction; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.cell.FloatElementsProvider; +import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.designer.TargetComponent; import com.fr.design.designer.beans.actions.CopyAction; import com.fr.design.designer.beans.actions.CutAction; @@ -587,6 +589,7 @@ public class JForm extends JTemplate implements BaseJForm Date: Thu, 12 Mar 2020 14:30:42 +0800 Subject: [PATCH 085/375] =?UTF-8?q?=E5=8A=A0=E7=A9=BA=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 9c16fa961..ff6a62f92 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 @@ -17,6 +17,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.attr.GaugeDetailStyle; import com.fr.plugin.chart.base.AttrLabel; +import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.stable.Constants; @@ -92,7 +93,11 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { if(attrLabel == null){ return; } - attrLabel.getAttrLabelDetail().getTextAttr().setFRFont(VanChartGaugePlot.THERMOMETER_LABEL_FONT); + AttrLabelDetail attrLabelDetail = attrLabel.getAttrLabelDetail(); + if(attrLabelDetail == null || attrLabelDetail.getTextAttr() == null){ + return; + } + attrLabelDetail.getTextAttr().setFRFont(VanChartGaugePlot.THERMOMETER_LABEL_FONT); if(gaugeLayout.getSelectedIndex() == 0){ attrLabel.getAttrLabelDetail().setPosition(Constants.LEFT); attrLabel.getGaugeValueLabelDetail().setPosition(Constants.LEFT); From 18562b4dff1722f1f45c56a2d3970aab2e592449 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 12 Mar 2020 15:24:38 +0800 Subject: [PATCH 086/375] fix --- .../java/com/fr/design/data/datapane/TableDataPaneListPane.java | 2 +- .../data/tabledata/tabledatapane/TableDataManagerPane.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java index 437334c53..d2fdc3229 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java @@ -69,7 +69,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData } if (nameableList.getSelectedValue() instanceof ListModelElement) { Nameable selected = ((ListModelElement) nameableList.getSelectedValue()).wrapper; - if (!ComparatorUtils.equals(tempName, selected.getName())) { + if (!ComparatorUtils.equals(tempName, selected.getName()) && !isNameRepeated(new List[]{Arrays.asList(allDSNames), Arrays.asList(allListNames)}, tempName)) { rename(selected.getName(), tempName); } diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java index 4c08fae2b..c55e5871e 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java @@ -42,7 +42,7 @@ public class TableDataManagerPane extends LoadingBasicPane { renameConnection(oldName, newName); return null; } - }; + }.execute(); } } : pane; container.add(tableDataPane.getPanel(), BorderLayout.CENTER); From c4dd34ac0981d508e9580b55df66831c5f478104 Mon Sep 17 00:00:00 2001 From: Maksim Date: Thu, 12 Mar 2020 15:45:28 +0800 Subject: [PATCH 087/375] =?UTF-8?q?=E8=B0=83=E7=94=A8isCluster=E5=81=9A?= =?UTF-8?q?=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/env/RemoteWorkspace.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java index 7a4453a83..3d96ea1ef 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java @@ -1,6 +1,6 @@ package com.fr.design.env; -import com.fr.cluster.engine.base.FineClusterConfig; +import com.fr.cluster.engine.remote.ClusterOperator; import com.fr.design.i18n.Toolkit; import com.fr.base.operator.common.CommonOperator; import com.fr.rpc.ExceptionHandler; @@ -79,7 +79,12 @@ public class RemoteWorkspace implements Workspace { @Override public boolean isCluster() { - return FineClusterConfig.getInstance().isCluster(); + return WorkContext.getCurrent().get(ClusterOperator.class, new ExceptionHandler() { + @Override + public Boolean callHandler(RPCInvokerExceptionInfo rpcInvokerExceptionInfo) { + return false; + } + }).isCluster(); } @Override From 2728eca125ea032c24d69c66a8d0043a66e9814c Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Thu, 12 Mar 2020 17:36:06 +0800 Subject: [PATCH 088/375] =?UTF-8?q?REPORT-27728=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E8=AE=BE=E7=BD=AE=E8=83=8C=E6=99=AF=E8=89=B2=E4=BC=9A?= =?UTF-8?q?=E9=81=AE=E6=8C=A1=E5=8E=9F=E5=A7=8B=E8=BE=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/grid/CellElementPainter.java | 2 +- designer-realize/src/main/java/com/fr/grid/GridUI.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/CellElementPainter.java b/designer-realize/src/main/java/com/fr/grid/CellElementPainter.java index 607fde54f..6148ee8d6 100644 --- a/designer-realize/src/main/java/com/fr/grid/CellElementPainter.java +++ b/designer-realize/src/main/java/com/fr/grid/CellElementPainter.java @@ -9,7 +9,7 @@ import com.fr.report.core.PaintUtils; import com.fr.report.elementcase.ElementCase; public class CellElementPainter { - public void paintBackground(Graphics2D g2d, ElementCase report, CellElement ce, int width, int height) { + public void paintBackground(Graphics2D g2d, ElementCase report, CellElement ce, double width, double height) { Style.paintBackground(g2d, ce.getStyle(), width, height); } diff --git a/designer-realize/src/main/java/com/fr/grid/GridUI.java b/designer-realize/src/main/java/com/fr/grid/GridUI.java index 266cb5cb0..ff027af08 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridUI.java +++ b/designer-realize/src/main/java/com/fr/grid/GridUI.java @@ -497,12 +497,12 @@ public class GridUI extends ComponentUI { paintCellElementRectangleList.add(this.tmpRectangle.clone()); - int cellWidth = (int) this.tmpRectangle.getWidth(); - int cellHeight = (int) this.tmpRectangle.getHeight(); + double cellWidth = this.tmpRectangle.getWidth(); + double cellHeight = this.tmpRectangle.getHeight(); // denny_Grid: 画Grid中单元格的内容(包括单元格的背景Content + Background), 不包括边框 - painter.paintBackground(g2d, report, tmpCellElement, cellWidth, cellHeight); - painter.paintContent(g2d, report, tmpCellElement, cellWidth, cellHeight, resolution); + painter.paintBackground(g2d, report, tmpCellElement, cellWidth - 1, cellHeight - 1); + painter.paintContent(g2d, report, tmpCellElement, (int) cellWidth, (int) cellHeight, resolution); // denny_Grid: 注意下面还要减一, 因为上面translate时加一 g2d.translate(-this.tmpRectangle.getX() - 1, -this.tmpRectangle.getY() - 1); paintAuthorityCell(g2d, tmpCellElement); From 8de60f31418b6db2a3c40e0597bb3189ca3ed70f Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 12 Mar 2020 20:24:21 +0800 Subject: [PATCH 089/375] REPORT-28026 && REPORT-27919 --- .../mainframe/DesignerFrameFileDealerPane.java | 16 +--------------- .../fr/design/parameter/ParameterInputPane.java | 9 +++++++++ 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index b4b469e10..bcac7f946 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -684,21 +684,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt this.dispose(); //模版重命名 - boolean success = false; - - // 提醒保存文件 - SaveSomeTemplatePane saveSomeTempaltePane = new SaveSomeTemplatePane(true); - // 只有一个文件未保存时 - if (HistoryTemplateListCache.getInstance().getHistoryCount() == 1) { - int choose = saveSomeTempaltePane.saveLastOneTemplate(); - if (choose != JOptionPane.CANCEL_OPTION) { - success = selectedOperation.rename(fnf, path, newPath); - } - } else { - if (saveSomeTempaltePane.showSavePane()) { - success = selectedOperation.rename(fnf, path, newPath); - } - } + boolean success = selectedOperation.rename(fnf, path, newPath); if (success) { HistoryTemplateListCache.getInstance().rename(fnf, path, newPath); diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java index 14487ca5f..8e8819c67 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java @@ -17,6 +17,7 @@ import com.fr.design.editor.editor.Editor; import com.fr.design.editor.editor.FloatEditor; import com.fr.design.editor.editor.IntegerEditor; import com.fr.design.editor.editor.TextEditor; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; @@ -24,6 +25,8 @@ import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.awt.*; import java.util.ArrayList; import java.util.Date; @@ -103,6 +106,12 @@ public class ParameterInputPane extends BasicPane { contentPane.add(flowTableLayoutHelper.createLabelFlowPane(parameterDisplayName + ":", editPane)); //add editor to parameter hashtable. + textF.getCurrentEditor().addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(); + } + }); this.editorNameMap.put(textF, parameter.getName()); nameAddedList.add(parameter.getName()); } From 9046015866f34875d90054079da5a3ff704835a4 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 13 Mar 2020 10:39:44 +0800 Subject: [PATCH 090/375] REPORT-27945 && REPORT-27934 && REPORT-27940 --- .../fr/common/detect/CommonPortDetector.java | 59 +++++++++++++++++++ .../main/java/com/fr/start/BaseDesigner.java | 2 + .../common/detect/CommonPortDetectorTest.java | 45 ++++++++++++++ .../com/fr/start/module/DesignerStartup.java | 5 ++ 4 files changed, 111 insertions(+) create mode 100644 designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java create mode 100644 designer-base/src/test/java/com/fr/common/detect/CommonPortDetectorTest.java diff --git a/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java b/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java new file mode 100644 index 000000000..d49b4c80a --- /dev/null +++ b/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java @@ -0,0 +1,59 @@ +package com.fr.common.detect; + +import com.fr.concurrent.NamedThreadFactory; +import com.fr.design.DesignerEnvManager; +import com.fr.log.FineLoggerFactory; +import com.fr.module.ModuleContext; +import com.fr.web.WebSocketConfig; + +import java.net.Socket; +import java.util.concurrent.ExecutorService; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/10 + */ +public class CommonPortDetector { + + private static final CommonPortDetector INSTANCE = new CommonPortDetector(); + private ExecutorService service = ModuleContext.getExecutor().newSingleThreadScheduledExecutor(new NamedThreadFactory("CommonDetector")); + + public static CommonPortDetector getInstance() { + return INSTANCE; + } + + public void execute() { + service.submit(new Runnable() { + @Override + public void run() { + detectTomcatPort(); + detectWebSocketPort(); + } + }); + } + + private void detectTomcatPort() { + int port = DesignerEnvManager.getEnvManager().getEmbedServerPort(); + if (checkPort(port)) { + FineLoggerFactory.getLogger().error("EmbedTomcat Port: {} is not available, maybe occupied by other programs, please check it!", port); + } + } + + private void detectWebSocketPort() { + Integer[] ports = WebSocketConfig.getInstance().getPort(); + for (int port : ports) { + if (checkPort(port)) { + FineLoggerFactory.getLogger().error("WebSocKet Port: {} is not available, maybe occupied by other programs, please check it!", port); + } + } + } + + private boolean checkPort(int port) { + try (Socket socket = new Socket("localhost", port)) { + return true; + } catch (Exception e) { + return false; + } + } +} diff --git a/designer-base/src/main/java/com/fr/start/BaseDesigner.java b/designer-base/src/main/java/com/fr/start/BaseDesigner.java index 90ac634ce..ba231a335 100644 --- a/designer-base/src/main/java/com/fr/start/BaseDesigner.java +++ b/designer-base/src/main/java/com/fr/start/BaseDesigner.java @@ -3,6 +3,7 @@ */ package com.fr.start; +import com.fr.common.detect.CommonPortDetector; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.constants.DesignerLaunchStatus; @@ -76,6 +77,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { public void on(Event event, Null param) { EventDispatcher.stopListen(this); collectUserInformation(); + CommonPortDetector.getInstance().execute(); } }); } diff --git a/designer-base/src/test/java/com/fr/common/detect/CommonPortDetectorTest.java b/designer-base/src/test/java/com/fr/common/detect/CommonPortDetectorTest.java new file mode 100644 index 000000000..fa9915b31 --- /dev/null +++ b/designer-base/src/test/java/com/fr/common/detect/CommonPortDetectorTest.java @@ -0,0 +1,45 @@ +package com.fr.common.detect; + +import com.fr.invoke.Reflect; +import com.fr.log.FineLoggerFactory; +import junit.framework.TestCase; +import org.junit.Assert; + +import java.io.IOException; +import java.net.ServerSocket; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/10 + */ +public class CommonPortDetectorTest extends TestCase { + + private ServerSocket serverSocket; + + @Override + public void setUp() throws Exception { + serverSocket = new ServerSocket(55555); + new Thread(new Runnable() { + @Override + public void run() { + try { + serverSocket.accept(); + } catch (IOException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + }).start(); + } + + public void testCheckPort() { + CommonPortDetector detector = CommonPortDetector.getInstance(); + boolean access = Reflect.on(detector).call("checkPort", 55555).get(); + Assert.assertTrue(access); + } + + @Override + public void tearDown() throws Exception { + serverSocket.close(); + } +} \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java index 708cc0020..60de86543 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java @@ -24,6 +24,7 @@ import com.fr.record.analyzer.Metrics; import com.fr.stable.BuildContext; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; import com.fr.start.DesignerProcessType; import com.fr.start.OemHandler; import com.fr.start.ServerStarter; @@ -91,6 +92,10 @@ public class DesignerStartup extends Activator { } }; dialog.setVisible(true); + StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.DESIGNER_PROCESS_OCCUPIED.getId(), + DesignerErrorMessage.DESIGNER_PROCESS_OCCUPIED.getMessage(), + StringUtils.EMPTY); + FineLoggerFactory.getLogger().error(DesignerErrorMessage.DESIGNER_PROCESS_OCCUPIED.getId() + ": " + DesignerErrorMessage.DESIGNER_PROCESS_OCCUPIED.getMessage()); } DesignerExiter.getInstance().execute(); return; From a1cddd627db811ebe76b3dcdcabdc450939225c8 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 13 Mar 2020 10:42:01 +0800 Subject: [PATCH 091/375] fix --- .../src/main/java/com/fr/common/detect/CommonPortDetector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java b/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java index d49b4c80a..310e75dce 100644 --- a/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java +++ b/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java @@ -17,7 +17,7 @@ import java.util.concurrent.ExecutorService; public class CommonPortDetector { private static final CommonPortDetector INSTANCE = new CommonPortDetector(); - private ExecutorService service = ModuleContext.getExecutor().newSingleThreadScheduledExecutor(new NamedThreadFactory("CommonDetector")); + private ExecutorService service = ModuleContext.getExecutor().newSingleThreadExecutor(new NamedThreadFactory("CommonPortDetector")); public static CommonPortDetector getInstance() { return INSTANCE; From 0ebfd70fc038bbd07fc24ebf03056245dc0c2dc6 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 13 Mar 2020 14:29:22 +0800 Subject: [PATCH 092/375] REPORT-28099 --- .../fr/design/mainframe/DesignerFrame.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index d6b9c047e..e72f43a5c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -109,6 +109,9 @@ import java.awt.event.WindowListener; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -316,6 +319,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta // window close listener. this.addWindowListeners(getFrameListeners()); + addMacOsListener(); + this.addComponentListener(new ComponentAdapter() { @Override @@ -523,6 +528,29 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } } + private void addMacOsListener() { + if (OperatingSystem.isMacos()) { + try { + Class app = Class.forName("com.apple.eawt.Application"); + Class handler = Class.forName("com.apple.eawt.QuitHandler"); + Object instance = Proxy.newProxyInstance(handler.getClassLoader(), new Class[]{handler}, + new InvocationHandler() { + @Override + public Object invoke(Object proxy, Method method, + Object[] args) throws Throwable { + if ("handleQuitRequestWith".equals(method.getName())) { + DesignerFrame.this.exit(); + } + return null; + } + }); + Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", instance); + } catch (ClassNotFoundException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } + protected ArrayList getFrameListeners() { ArrayList arrayList = new ArrayList<>(); From f4fe8314e8bcf5e750401b20495c9b6c676e0fe0 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 13 Mar 2020 15:42:26 +0800 Subject: [PATCH 093/375] =?UTF-8?q?fix=20=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrame.java | 23 ++-------- .../com/fr/design/os/impl/MacOsAction.java | 44 +++++++++++++++++++ 2 files changed, 47 insertions(+), 20 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index e72f43a5c..e119a4f01 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -40,6 +40,7 @@ import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.mainframe.vcs.common.VcsHelper; import com.fr.design.menu.MenuManager; import com.fr.design.menu.ShortCut; +import com.fr.design.os.impl.MacOsAction; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.event.EventDispatcher; @@ -529,26 +530,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } private void addMacOsListener() { - if (OperatingSystem.isMacos()) { - try { - Class app = Class.forName("com.apple.eawt.Application"); - Class handler = Class.forName("com.apple.eawt.QuitHandler"); - Object instance = Proxy.newProxyInstance(handler.getClassLoader(), new Class[]{handler}, - new InvocationHandler() { - @Override - public Object invoke(Object proxy, Method method, - Object[] args) throws Throwable { - if ("handleQuitRequestWith".equals(method.getName())) { - DesignerFrame.this.exit(); - } - return null; - } - }); - Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", instance); - } catch (ClassNotFoundException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } + MacOsAction macOsAction = OSSupportCenter.getAction(MacOsAction.class); + macOsAction.execute(this); } protected ArrayList getFrameListeners() { diff --git a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java new file mode 100644 index 000000000..7f5c7be08 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java @@ -0,0 +1,44 @@ +package com.fr.design.os.impl; + +import com.fr.design.mainframe.DesignerFrame; +import com.fr.invoke.Reflect; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.os.OperatingSystem; +import com.fr.stable.os.support.OSBasedAction; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/13 + */ +public class MacOsAction implements OSBasedAction { + + @Override + public void execute(final Object... objects) { + if (OperatingSystem.isMacos()) { + try { + Class app = Class.forName("com.apple.eawt.Application"); + Class handler = Class.forName("com.apple.eawt.QuitHandler"); + Object instance = Proxy.newProxyInstance(handler.getClassLoader(), new Class[]{handler}, + new InvocationHandler() { + @Override + public Object invoke(Object proxy, Method method, + Object[] args) throws Throwable { + if ("handleQuitRequestWith".equals(method.getName())) { + DesignerFrame designerFrame = (DesignerFrame) objects[0]; + designerFrame.exit(); + } + return null; + } + }); + Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", instance); + } catch (ClassNotFoundException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } +} From 0b87e101ff2e67156b1cc613ea86808213813605 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 13 Mar 2020 15:44:26 +0800 Subject: [PATCH 094/375] =?UTF-8?q?fix=20=E6=97=A0=E7=94=A8import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/DesignerFrame.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index e119a4f01..4a9fbac8a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -110,9 +110,6 @@ import java.awt.event.WindowListener; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; import java.util.ArrayList; import java.util.Iterator; import java.util.List; From 39393f87ce3e649026b5c6d5d4bd5babb902f039 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Fri, 13 Mar 2020 16:36:26 +0800 Subject: [PATCH 095/375] =?UTF-8?q?REPORT-27914=20https=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=EF=BC=8C=E6=B2=A1=E6=9C=89=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E5=9B=BA=E5=8C=96=E5=9F=8B=E7=82=B9=E5=9B=9E=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../messagecollect/solid/SolidCollector.java | 77 +++++++++++-------- 1 file changed, 45 insertions(+), 32 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java index 68cc882a9..d090b9e8f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java @@ -1,22 +1,18 @@ package com.fr.design.mainframe.messagecollect.solid; +import com.fr.analysis.cloud.solid.SolidRecordExecutor; import com.fr.general.CloudCenter; import com.fr.general.http.HttpToolbox; -import com.fr.json.JSON; -import com.fr.json.JSONFactory; import com.fr.log.FineLoggerFactory; -import com.fr.security.JwtUtils; +import com.fr.rpc.ExceptionHandler; +import com.fr.rpc.RPCInvokerExceptionInfo; import com.fr.stable.CommonUtils; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; -import java.io.IOException; import java.util.HashMap; import java.util.Map; -import static com.fr.design.mainframe.messagecollect.solid.SolidCollectConstants.REQUEST_SUBJECT; -import static com.fr.design.mainframe.messagecollect.solid.SolidCollectConstants.TIME_OUT; - /** * 设计器固化信息回传类 * Created by alex sung on 2019/8/22. @@ -24,9 +20,6 @@ import static com.fr.design.mainframe.messagecollect.solid.SolidCollectConstants public class SolidCollector { - private static final String CONTENT_URL = "/v10/collect/solid"; - private static final String DELETE_URL = "/v10/collect/solid/delete"; - private static final String UNLOCK_URL = "/v10/collect/solid/unlock"; private static final String ATTR_CIPHER_TEXT = "cipherText"; private static final String ATTR_SIGNATURE = "signature"; private static final String SOLID_UPLOAD_URL = CloudCenter.getInstance().acquireUrlByKind("design.solid"); @@ -53,27 +46,22 @@ public class SolidCollector { } FineLoggerFactory.getLogger().info("start to get solid content from server..."); try { - String content = requestContent(); - if (StringUtils.isNotEmpty(content)) { - String cipherText = JSONFactory.createJSON(JSON.OBJECT, content).optString("data"); - if(StringUtils.isNotEmpty(cipherText)){ - Map params = new HashMap<>(); - params.put(ATTR_CIPHER_TEXT, cipherText); - params.put(ATTR_SIGNATURE, String.valueOf(CommonUtils.signature())); - HttpToolbox.post(SOLID_UPLOAD_URL, params); + String cipherText = requestContent(); + if (StringUtils.isNotEmpty(cipherText)) { + Map params = new HashMap<>(); + params.put(ATTR_CIPHER_TEXT, cipherText); + params.put(ATTR_SIGNATURE, String.valueOf(CommonUtils.signature())); + HttpToolbox.post(SOLID_UPLOAD_URL, params); - String deleteUrl = WorkContext.getCurrent().getPath() + DELETE_URL; - HttpToolbox.post(deleteUrl, getParams()); - } + deleteSolidFile(); } FineLoggerFactory.getLogger().info("send solid content to cloud center success."); } catch (Exception e) { FineLoggerFactory.getLogger().info(e.getMessage(), e); } finally { - String unlockUrl = WorkContext.getCurrent().getPath() + UNLOCK_URL; try { - HttpToolbox.post(unlockUrl, getParams()); - } catch (IOException e) { + unlockSolidFile(); + } catch (Exception e) { FineLoggerFactory.getLogger().warn(e.getMessage(), e); } } @@ -81,17 +69,42 @@ public class SolidCollector { /** * 获取服务端固化文件内容 + * * @return 回传内容 */ - public String requestContent() throws Exception { - Map params = new HashMap(); - params.put("token", JwtUtils.createDefaultJWT(REQUEST_SUBJECT, TIME_OUT)); - return HttpToolbox.get(WorkContext.getCurrent().getPath() + CONTENT_URL, params); + private String requestContent() throws Exception { + return WorkContext.getCurrent().get(SolidRecordExecutor.class, new ExceptionHandler() { + @Override + public String callHandler(RPCInvokerExceptionInfo info) { + FineLoggerFactory.getLogger().error(info.getException().getMessage(), info.getException()); + return StringUtils.EMPTY; + } + }).feedBackTask(StringUtils.EMPTY); } - private Map getParams() { - Map params = new HashMap(); - params.put("token", JwtUtils.createDefaultJWT(REQUEST_SUBJECT, TIME_OUT)); - return params; + /** + * 删除服务端固化文件 + */ + private void deleteSolidFile() throws Exception { + WorkContext.getCurrent().get(SolidRecordExecutor.class, new ExceptionHandler() { + @Override + public Void callHandler(RPCInvokerExceptionInfo info) { + FineLoggerFactory.getLogger().error(info.getException().getMessage(), info.getException()); + return null; + } + }).deleteSolidFile(); + } + + /** + * unlock + */ + private void unlockSolidFile() throws Exception { + WorkContext.getCurrent().get(SolidRecordExecutor.class, new ExceptionHandler() { + @Override + public Void callHandler(RPCInvokerExceptionInfo info) { + FineLoggerFactory.getLogger().error(info.getException().getMessage(), info.getException()); + return null; + } + }).unlockSolidFile(); } } From a5943c127935fe9ff4a72775dd8230739dde5b99 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 13 Mar 2020 17:17:07 +0800 Subject: [PATCH 096/375] =?UTF-8?q?fix=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrame.java | 5 +-- .../com/fr/design/os/impl/MacOsAction.java | 44 ------------------- .../os/impl/MacOsAddListenerAction.java | 41 +++++++++++++++++ .../com/fr/design/os/impl/SupportOSImpl.java | 10 +++++ 4 files changed, 53 insertions(+), 47 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java create mode 100644 designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 4a9fbac8a..237f2f975 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -40,7 +40,7 @@ import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.mainframe.vcs.common.VcsHelper; import com.fr.design.menu.MenuManager; import com.fr.design.menu.ShortCut; -import com.fr.design.os.impl.MacOsAction; +import com.fr.design.os.impl.MacOsAddListenerAction; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.event.EventDispatcher; @@ -527,8 +527,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } private void addMacOsListener() { - MacOsAction macOsAction = OSSupportCenter.getAction(MacOsAction.class); - macOsAction.execute(this); + OSSupportCenter.buildAction(new MacOsAddListenerAction(), SupportOSImpl.DOCK_QUIT); } protected ArrayList getFrameListeners() { diff --git a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java deleted file mode 100644 index 7f5c7be08..000000000 --- a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAction.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.fr.design.os.impl; - -import com.fr.design.mainframe.DesignerFrame; -import com.fr.invoke.Reflect; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.os.OperatingSystem; -import com.fr.stable.os.support.OSBasedAction; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; - -/** - * @author hades - * @version 10.0 - * Created by hades on 2020/3/13 - */ -public class MacOsAction implements OSBasedAction { - - @Override - public void execute(final Object... objects) { - if (OperatingSystem.isMacos()) { - try { - Class app = Class.forName("com.apple.eawt.Application"); - Class handler = Class.forName("com.apple.eawt.QuitHandler"); - Object instance = Proxy.newProxyInstance(handler.getClassLoader(), new Class[]{handler}, - new InvocationHandler() { - @Override - public Object invoke(Object proxy, Method method, - Object[] args) throws Throwable { - if ("handleQuitRequestWith".equals(method.getName())) { - DesignerFrame designerFrame = (DesignerFrame) objects[0]; - designerFrame.exit(); - } - return null; - } - }); - Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", instance); - } catch (ClassNotFoundException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - } -} diff --git a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java new file mode 100644 index 000000000..4d8c892b9 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java @@ -0,0 +1,41 @@ +package com.fr.design.os.impl; + +import com.fr.design.mainframe.DesignerFrame; +import com.fr.invoke.Reflect; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.os.support.OSBasedAction; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/13 + */ +public class MacOsAddListenerAction implements OSBasedAction { + + @Override + public void execute(final Object... objects) { + try { + Class app = Class.forName("com.apple.eawt.Application"); + Class handler = Class.forName("com.apple.eawt.QuitHandler"); + Object instance = Proxy.newProxyInstance(handler.getClassLoader(), new Class[]{handler}, + new InvocationHandler() { + @Override + public Object invoke(Object proxy, Method method, + Object[] args) throws Throwable { + if ("handleQuitRequestWith".equals(method.getName())) { + DesignerFrame designerFrame = (DesignerFrame) objects[0]; + designerFrame.exit(); + } + return null; + } + }); + Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", instance); + } catch (ClassNotFoundException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java index 9bc29b829..2518ef57c 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java @@ -73,6 +73,16 @@ public enum SupportOSImpl implements SupportOS { public boolean support() { return FRContext.isChineseEnv() && !OperatingSystem.isMacos() && Arch.getArch() != Arch.ARM; } + }, + + /** + * mac下dock栏右键退出 + */ + DOCK_QUIT { + @Override + public boolean support() { + return OperatingSystem.isMacos(); + } } } From 95ca4d99c35bbd355d026fff4122acf452669b7a Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sat, 14 Mar 2020 18:15:44 +0800 Subject: [PATCH 097/375] =?UTF-8?q?CHART-12975=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=99=BE=E5=88=86=E6=AF=94=E6=A0=BC=E5=BC=8F=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=87=AA=E5=AE=9A=E4=B9=89=E5=90=8E=E7=BC=80?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/style/FormatPane.java | 77 +++++++++++-------- 1 file changed, 44 insertions(+), 33 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java b/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java index 795c6d455..cf362f7f5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java @@ -6,6 +6,7 @@ import com.fr.base.Style; import com.fr.base.TextFormat; import com.fr.data.core.FormatField; import com.fr.data.core.FormatField.FormatContents; +import com.fr.design.i18n.Toolkit; import com.fr.design.border.UIRoundedBorder; import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.UIConstants; @@ -36,20 +37,23 @@ import java.text.SimpleDateFormat; * @author zhou * @since 2012-5-24上午10:57:00 */ -public class FormatPane extends AbstractBasicStylePane implements GlobalNameObserver { +public class FormatPane extends AbstractBasicStylePane implements GlobalNameObserver { private static final long serialVersionUID = 724330854437726751L; - private static final int LABLE_X = 4; - private static final int LABLE_Y = 18; - private static final int LABLE_DELTA_WIDTH = 8; - private static final int LABLE_HEIGHT = 15; //标签背景的范围 + private static final int LABEL_X = 4; + private static final int LABEL_Y = 18; + private static final int LABEL_DELTA_WIDTH = 8; + private static final int LABEL_HEIGHT = 15; //标签背景的范围 private static final int CURRENCY_FLAG_POINT = 6; - private static final Border LEFT_BORDER = BorderFactory.createEmptyBorder(0,30,0,0); + private static final Border LEFT_BORDER = BorderFactory.createEmptyBorder(0, 30, 0, 0); - private static final Integer[] TYPES = new Integer[]{FormatContents.NULL, FormatContents.NUMBER, FormatContents.CURRENCY, FormatContents.PERCENT, FormatContents.SCIENTIFIC, - FormatContents.DATE, FormatContents.TIME, FormatContents.TEXT}; + private static final Integer[] TYPES = new Integer[]{ + FormatContents.NULL, FormatContents.NUMBER, + FormatContents.CURRENCY, FormatContents.PERCENT, + FormatContents.SCIENTIFIC, FormatContents.DATE, + FormatContents.TIME, FormatContents.TEXT}; - private static final Integer[] DATETYPES = new Integer[]{FormatContents.NULL, FormatContents.DATE, FormatContents.TIME,}; + private static final Integer[] DATE_TYPES = new Integer[]{FormatContents.NULL, FormatContents.DATE, FormatContents.TIME}; private Format format; @@ -61,7 +65,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs private JPanel centerPane; private JPanel formatFontPane; private FRFontPane frFontPane; - private boolean isRightFormate; + private boolean isRightFormat; private boolean isDate = false; private GlobalNameListener globalNameListener = null; @@ -78,7 +82,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs protected void initComponents(Integer[] types) { this.setLayout(new BorderLayout(0, 4)); - iniSampleLable(); + initSampleLabel(); contentPane = new JPanel(new BorderLayout(0, 4)) { @Override public Dimension getPreferredSize() { @@ -108,7 +112,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs frFontPane = new FRFontPane(); - UILabel font = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_FR_Font"), SwingConstants.LEFT); + UILabel font = new UILabel(Toolkit.i18nText("Fine-Design_Form_FR_Font"), SwingConstants.LEFT); JPanel fontPane = new JPanel(new BorderLayout()); fontPane.add(font, BorderLayout.NORTH); @@ -136,7 +140,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { return new Component[][]{ new Component[]{null, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format"), SwingConstants.LEFT), typePane}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Format"), SwingConstants.LEFT), typePane}, new Component[]{centerPane, null}, new Component[]{fontPane, frFontPane}, }; @@ -155,24 +159,24 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs }; } - private void iniSampleLable() { - Border innterborder = new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 4); - Font tmpFont = null; - Border border = BorderFactory.createTitledBorder(innterborder, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample"), TitledBorder.LEFT, 0, tmpFont, UIConstants.LINE_COLOR); + private void initSampleLabel() { + Border interBorder = new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 4); + String title = Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample"); + Border border = BorderFactory.createTitledBorder(interBorder, title, TitledBorder.LEFT, 0, null, UIConstants.LINE_COLOR); sampleLabel = new UILabel(FormatField.getInstance().getFormatValue()) { @Override public void paint(Graphics g) { super.paint(g); int width = getWidth(); - Color orignal = g.getColor(); + Color original = g.getColor(); g.setColor(getBackground()); - g.fillRect(LABLE_X, LABLE_Y, width - LABLE_DELTA_WIDTH, LABLE_HEIGHT); + g.fillRect(LABEL_X, LABEL_Y, width - LABEL_DELTA_WIDTH, LABEL_HEIGHT); g.setColor(UIConstants.LINE_COLOR); FontMetrics cellFM = g.getFontMetrics(); int textWidth = cellFM.stringWidth(getText()); GraphHelper.drawString(g, getText(), (width - textWidth) / 2, 26); - g.setColor(orignal); + g.setColor(original); } }; sampleLabel.setHorizontalAlignment(UILabel.CENTER); @@ -197,7 +201,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs * @return 标题 */ public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"); + return Toolkit.i18nText("Fine-Design_Report_Text"); } /** @@ -212,13 +216,9 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs if (format instanceof CoreDecimalFormat) { // check all value String pattern = ((CoreDecimalFormat) format).toPattern(); - boolean isCurrency1 = (pattern.length() > 0 && pattern.charAt(0) == '¤'); - boolean isCurrency2 = (pattern.length() > 0 && pattern.charAt(0) == '$'); - boolean isCurrency = isCurrency1 || isCurrency2; - boolean isCurrency4 = (pattern.length() > CURRENCY_FLAG_POINT && ComparatorUtils.equals(pattern.substring(0, CURRENCY_FLAG_POINT), "#,##0;")); - if (isCurrency || isCurrency4) { + if (isCurrencyFormatStyle(pattern)) { setPatternComboBoxAndList(FormatContents.CURRENCY, pattern); - } else if (pattern.endsWith("%")) { + } else if (pattern.indexOf("%") > 0) { setPatternComboBoxAndList(FormatContents.PERCENT, pattern); } else if (pattern.indexOf("E") > 0) { setPatternComboBoxAndList(FormatContents.SCIENTIFIC, pattern); @@ -238,6 +238,17 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs } } + private boolean isCurrencyFormatStyle(String pattern) { + if (pattern.length() == 0) { + return false; + } + + if (pattern.charAt(0) == '¤' || pattern.charAt(0) == '$') { + return true; + } + + return pattern.length() > CURRENCY_FLAG_POINT && pattern.startsWith("#,##0;"); + } /** * 判断是否是数组有模式 @@ -273,7 +284,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs if (getFormatContents() == FormatContents.TEXT) { return FormatField.getInstance().getFormat(getFormatContents(), patternString); } - if (isRightFormate) { + if (isRightFormat) { if (StringUtils.isNotEmpty(patternString)) { return FormatField.getInstance().getFormat(getFormatContents(), patternString); } @@ -292,7 +303,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs this.sampleLabel.setText(FormatField.getInstance().getFormatValue()); this.sampleLabel.setForeground(UIManager.getColor("Label.foreground")); try { - isRightFormate = true; + isRightFormat = true; if (StringUtils.isEmpty(String.valueOf(textField.getSelectedItem()))) { return; } @@ -300,7 +311,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs } catch (Exception e) { this.sampleLabel.setForeground(Color.red); this.sampleLabel.setText(e.getMessage()); - isRightFormate = false; + isRightFormat = false; } } @@ -401,8 +412,8 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs this.isDate = isDate; this.typeComboBox.setSelectedIndex(0); if (isDate) { - for (int i = 0; i < DATETYPES.length; i++) { - this.typeComboBox.addItem(DATETYPES[i]); + for (int i = 0; i < DATE_TYPES.length; i++) { + this.typeComboBox.addItem(DATE_TYPES[i]); } for (int i = 0; i < TYPES.length; i++) { this.typeComboBox.removeItemAt(1); @@ -411,7 +422,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObs for (int i = 0; i < TYPES.length; i++) { this.typeComboBox.addItem(TYPES[i]); } - for (int i = 0; i < DATETYPES.length; i++) { + for (int i = 0; i < DATE_TYPES.length; i++) { this.typeComboBox.removeItemAt(1); } } From 5a5cf292138336b090c8d88609aee23361c139d9 Mon Sep 17 00:00:00 2001 From: zack Date: Sun, 15 Mar 2020 20:08:42 +0800 Subject: [PATCH 098/375] =?UTF-8?q?REPORT-25545=20=E5=A1=AB=E6=8A=A5?= =?UTF-8?q?=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/write/submit/DBManipulationPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index 15e5aed4a..9df5d7916 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -701,7 +701,7 @@ public class DBManipulationPane extends BasicBeanPane { } jobs = new NameSubmitJob[dmlConfig.getSubmitJobCount()]; for (int i = 0; i < jobs.length; i++) { - jobs[i] = dmlConfig.getSubmitJob(i); + jobs[i] = dmlConfig.getNameSubmitJob(i); } condition = dmlConfig.getCondition(); UpdateCheckBox.setSelected(dmlConfig.isUpdateSelected()); From c0f0f90e353b6955294b4777f7532e09006f7a5d Mon Sep 17 00:00:00 2001 From: pengda Date: Mon, 16 Mar 2020 09:53:37 +0800 Subject: [PATCH 099/375] =?UTF-8?q?REPORT-27985=20frm=E9=87=8C=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E5=8D=95=E5=85=83=E6=A0=BC=E8=B6=85=E9=93=BE?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=BC=BA=E5=B0=91=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-form/src/main/java/com/fr/design/mainframe/JForm.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a5b76e1fc..9424a1f15 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 @@ -811,6 +811,7 @@ public class JForm extends JTemplate implements BaseJForm implements BaseJForm Date: Mon, 16 Mar 2020 10:53:35 +0800 Subject: [PATCH 100/375] =?UTF-8?q?REPORT-28099=20=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/os/impl/MacOsAddListenerAction.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java index 4d8c892b9..bc09dbf6a 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java @@ -1,6 +1,7 @@ package com.fr.design.os.impl; -import com.fr.design.mainframe.DesignerFrame; +import com.fr.design.mainframe.DesignerContext; +import com.fr.exit.DesignerExiter; import com.fr.invoke.Reflect; import com.fr.log.FineLoggerFactory; import com.fr.stable.os.support.OSBasedAction; @@ -27,8 +28,11 @@ public class MacOsAddListenerAction implements OSBasedAction { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if ("handleQuitRequestWith".equals(method.getName())) { - DesignerFrame designerFrame = (DesignerFrame) objects[0]; - designerFrame.exit(); + if (DesignerContext.getDesignerFrame() != null && DesignerContext.getDesignerFrame().isShowing()) { + DesignerContext.getDesignerFrame().exit(); + } else { + DesignerExiter.getInstance().execute(); + } } return null; } From 168627526ddb50e422f28bcfc1bd5b39382cdc78 Mon Sep 17 00:00:00 2001 From: Maksim Date: Mon, 16 Mar 2020 11:06:59 +0800 Subject: [PATCH 101/375] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E5=87=BA=E7=8E=B0=E6=97=B6=E9=97=B4=E5=81=9A?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/EnvChangeEntrance.java | 13 ++++++++++--- .../design/gui/controlpane/JControlUpdatePane.java | 12 ++++++++++++ .../fr/design/write/submit/CheckServiceDialog.java | 14 ++++++++++---- .../src/main/java/com/fr/env/EnvListPane.java | 3 ++- 4 files changed, 34 insertions(+), 8 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 c793a82fc..76b9481ea 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -245,11 +245,18 @@ public class EnvChangeEntrance { Set noExistServiceSet = getNoExistServiceSet(connectionInfo); StringBuilder textBuilder = new StringBuilder(); for (Class clazz : noExistServiceSet) { - WorkspaceAPI workspaceAPI = (WorkspaceAPI) clazz.getAnnotation(WorkspaceAPI.class); - String descriptionOfCN = InterProviderFactory.getProvider().getLocText(workspaceAPI.description()); - textBuilder.append(descriptionOfCN).append("\n"); + try { + WorkspaceAPI workspaceAPI = (WorkspaceAPI) clazz.getAnnotation(WorkspaceAPI.class); + String descriptionOfCN = InterProviderFactory.getProvider().getLocText(workspaceAPI.description()); + textBuilder.append(descriptionOfCN).append("\n"); + }catch (Exception e){ + FineLoggerFactory.getLogger().info("workspace service {} get annotation failed", clazz); + } } String areaText = textBuilder.toString(); + if(StringUtils.isEmpty(areaText)){ + return; + } CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), areaText, localBranch, remoteBranch); dialog.setVisible(true); } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java index 4bb286dbc..ebe41b2bc 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java @@ -1,10 +1,13 @@ package com.fr.design.gui.controlpane; +import com.fr.design.DesignerEnvManager; import com.fr.design.beans.BasicBeanPane; import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane; import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane; import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane; import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane; +import com.fr.design.env.DesignerWorkspaceInfo; +import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.ComparatorUtils; @@ -99,6 +102,15 @@ class JControlUpdatePane extends JPanel { if (pane != null && pane.isVisible()) { Object bean = pane.updateBean(); + try { + if (bean instanceof RemoteDesignerWorkspaceInfo) { + DesignerWorkspaceInfo info = DesignerEnvManager.getEnvManager().getWorkspaceInfo(elEditing.wrapper.getName()); + String remindTime = info.getRemindTime(); + ((RemoteDesignerWorkspaceInfo) bean).setRemindTime(remindTime); + } + }catch (Exception e){ + FineLoggerFactory.getLogger().info("remindTime is not exist"); + } if (i < creators.length) { creators[i].saveUpdatedBean(elEditing, bean); } diff --git a/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java b/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java index dfad82eda..177d6123e 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java @@ -17,6 +17,7 @@ import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextArea; +import javax.swing.JTextPane; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Frame; @@ -55,15 +56,20 @@ public class CheckServiceDialog extends JDialog implements ActionListener { JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Inconsistency")); label.setFont(font); label.setPreferredSize(new Dimension(650,30)); + String delimiter = GeneralContext.getLocale().equals(Locale.US)? "
":"/"; JLabel label2 = new JLabel(""+Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Local_Designer") - + localBranch + "/" + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + remoteBranch+""); + + localBranch + delimiter + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + remoteBranch+""); label2.setPreferredSize(new Dimension(600,30)); - JLabel label3 = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Need_Update")); - label3.setPreferredSize(new Dimension(500,30)); + + JTextPane tipsPane = new JTextPane(); + tipsPane.setEditable(false); + tipsPane.setBackground(verticalPanel.getBackground()); + tipsPane.setPreferredSize(new Dimension(500,30)); + tipsPane.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Need_Update")); verticalPanel.add(label); verticalPanel.add(label2); - verticalPanel.add(label3); + verticalPanel.add(tipsPane); topPanel.add(imagePanel,BorderLayout.WEST); topPanel.add(verticalPanel,BorderLayout.CENTER); diff --git a/designer-base/src/main/java/com/fr/env/EnvListPane.java b/designer-base/src/main/java/com/fr/env/EnvListPane.java index 6300abe95..911a7b22f 100644 --- a/designer-base/src/main/java/com/fr/env/EnvListPane.java +++ b/designer-base/src/main/java/com/fr/env/EnvListPane.java @@ -96,8 +96,9 @@ public class EnvListPane extends JListControlPane { */ public String updateEnvManager() { DesignerEnvManager mgr = DesignerEnvManager.getEnvManager(); - mgr.clearAllEnv(); + //这里代码时序换一下,因为update中需要借助mgr来获取提醒时间,已确认mgr对res无依赖 Nameable[] res = this.update(); + mgr.clearAllEnv(); for (Nameable re : res) { NameObject nameObject = (NameObject) re; mgr.putEnv(nameObject.getName(), (DesignerWorkspaceInfo) nameObject.getObject()); From 34713079a6f3e7bdbfccdbd449f81f7aa89ee04f Mon Sep 17 00:00:00 2001 From: Maksim Date: Mon, 16 Mar 2020 11:17:51 +0800 Subject: [PATCH 102/375] =?UTF-8?q?=E5=A4=84=E7=90=86NPE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 76b9481ea..6febf8785 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -249,7 +249,7 @@ public class EnvChangeEntrance { WorkspaceAPI workspaceAPI = (WorkspaceAPI) clazz.getAnnotation(WorkspaceAPI.class); String descriptionOfCN = InterProviderFactory.getProvider().getLocText(workspaceAPI.description()); textBuilder.append(descriptionOfCN).append("\n"); - }catch (Exception e){ + }catch (NullPointerException e){ FineLoggerFactory.getLogger().info("workspace service {} get annotation failed", clazz); } } From aa39a6aa6367a14b6fbad40a94d00e2051ba68fb Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 16 Mar 2020 14:39:06 +0800 Subject: [PATCH 103/375] REPORT-27937 && REPORT-28214 --- .../java/com/fr/file/FILEChooserPane.java | 1 + .../main/java/com/fr/start/MainDesigner.java | 104 +++++++++++++----- 2 files changed, 78 insertions(+), 27 deletions(-) diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index efb1e3a38..0ca481b09 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -737,6 +737,7 @@ public class FILEChooserPane extends BasicPane { fileNameTextField.setText(""); fileNameTextField.addDocumentListener(); } + dialog.setAlwaysOnTop(true); dialog.setVisible(true); return option; } diff --git a/designer-realize/src/main/java/com/fr/start/MainDesigner.java b/designer-realize/src/main/java/com/fr/start/MainDesigner.java index d4eb68e86..5b3ecea4e 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -14,6 +14,7 @@ import com.fr.design.actions.server.WidgetManagerAction; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.ErrorDialog; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.MutilTempalteTabPane; @@ -42,17 +43,24 @@ import com.fr.design.menu.ShortCut; import com.fr.design.module.DesignModuleFactory; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.event.Event; +import com.fr.event.EventDispatcher; +import com.fr.event.Listener; import com.fr.exit.DesignerExiter; import com.fr.general.ComparatorUtils; +import com.fr.general.IOUtils; +import com.fr.io.utils.ResourceIOUtils; import com.fr.log.FineLoggerFactory; import com.fr.module.Module; import com.fr.module.ModuleContext; +import com.fr.module.engine.event.LifecycleErrorEvent; import com.fr.runtime.FineRuntime; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.lifecycle.ErrorType; import com.fr.stable.lifecycle.LifecycleFatalError; +import com.fr.stable.project.ProjectConstants; import com.fr.stable.xml.XMLTools; import com.fr.start.module.StartupArgs; import com.fr.start.server.ServerTray; @@ -107,39 +115,19 @@ public class MainDesigner extends BaseDesigner { //启动运行时 FineRuntime.start(); DesignerSubListener.getInstance().start(); + EventDispatcher.listen(LifecycleErrorEvent.SELF, new Listener() { + @Override + public void on(Event event, LifecycleFatalError param) { + afterError(param); + } + }); Module designerRoot = ModuleContext.parseRoot("designer-startup.xml"); //传递启动参数 designerRoot.setSingleton(StartupArgs.class, new StartupArgs(args)); try { designerRoot.start(); } catch (LifecycleFatalError fatal) { - SplashContext.getInstance().hide(); - if (ErrorType.FINEDB.equals(fatal.getErrorType())) { - StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.FINEDB_PROBLEM.getId(), - DesignerErrorMessage.FINEDB_PROBLEM.getMessage(), - fatal.getMessage()); - JOptionPane.showMessageDialog(null, fatal.getMessage(), Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE); - } - FineLoggerFactory.getLogger().error(fatal.getMessage(), fatal); - StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.UNEXCEPTED_START_FAILED.getId(), - DesignerErrorMessage.UNEXCEPTED_START_FAILED.getMessage(), - fatal.getMessage()); - ErrorDialog dialog = new ErrorDialog(null, Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), - Toolkit.i18nText("Fine-Design_Error_Start_Report"), - fatal.getMessage()) { - @Override - protected void okEvent() { - dispose(); - DesignerExiter.getInstance().execute(); - } - - @Override - protected void restartEvent() { - dispose(); - RestartHelper.restart(); - } - }; - dialog.setVisible(true); + afterError(fatal); } if (WorkContext.getCurrent().isLocal()) { @@ -150,6 +138,68 @@ public class MainDesigner extends BaseDesigner { watch.stop(); } + private static void afterError(LifecycleFatalError fatal) { + SplashContext.getInstance().hide(); + if (ErrorType.FINEDB.equals(fatal.getErrorType())) { + StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.FINEDB_PROBLEM.getId(), + DesignerErrorMessage.FINEDB_PROBLEM.getMessage(), + fatal.getMessage()); + FineLoggerFactory.getLogger().error(DesignerErrorMessage.FINEDB_PROBLEM.getId() + ": " + DesignerErrorMessage.FINEDB_PROBLEM.getMessage()); + int result = FineJOptionPane.showOptionDialog(null, + Toolkit.i18nText("Fine-Design_Error_Finedb_Backup_Reset"), + Toolkit.i18nText("Fine-Design_Basic_Error_Tittle"), + JOptionPane.YES_NO_OPTION, + JOptionPane.ERROR_MESSAGE, + IOUtils.readIcon("com/fr/design/images/error/error2.png"), + new Object[] {Toolkit.i18nText("Fine-Design_Basic_Reset"), Toolkit.i18nText("Fine-Design_Basic_Cancel")}, + null); + if (result == JOptionPane.YES_OPTION) { + boolean success = false; + try { + ResourceIOUtils.copy(StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_NAME), + StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_BAK_NAME)); + success = ResourceIOUtils.delete(StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_NAME)); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + afterBackupFailed(); + } + if (!success) { + afterBackupFailed(); + } + } else { + DesignerExiter.getInstance().execute(); + } + } + FineLoggerFactory.getLogger().error(fatal.getMessage(), fatal); + StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.UNEXCEPTED_START_FAILED.getId(), + DesignerErrorMessage.UNEXCEPTED_START_FAILED.getMessage(), + fatal.getMessage()); + ErrorDialog dialog = new ErrorDialog(null, Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), + Toolkit.i18nText("Fine-Design_Error_Start_Report"), + fatal.getMessage()) { + @Override + protected void okEvent() { + dispose(); + DesignerExiter.getInstance().execute(); + } + + @Override + protected void restartEvent() { + dispose(); + RestartHelper.restart(); + } + }; + dialog.setVisible(true); + } + + private static void afterBackupFailed() { + FineJOptionPane.showMessageDialog(null, + Toolkit.i18nText("Fine-Design_Error_Finedb_Backup_Reset_Result", + ResourceIOUtils.getRealPath(StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_NAME))), + Toolkit.i18nText("Fine-Design_Basic_Error"), + JOptionPane.ERROR_MESSAGE); + DesignerExiter.getInstance().execute(); + } /** * 创建新建文件的快捷方式数组。 * From d44fd448c9468ee04d50736ed763d741237bab47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 16 Mar 2020 14:49:48 +0800 Subject: [PATCH 104/375] CHART-12992&&CHART-13025 bugFix --- .../chartx/component/MapAreaMatchPane.java | 3 +- .../chartx/component/MatchAreaTable.java | 1 + .../chartx/component/TableTreeComboBox.java | 16 +++++- .../table/VanMapTableDataContentPane.java | 55 ++++++++++++++++--- 4 files changed, 66 insertions(+), 9 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index 9da85b491..ef9bbd797 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -250,7 +250,8 @@ public class MapAreaMatchPane extends BasicBeanPane { int size = dataModel.getRowCount(); HashSet columnData = new LinkedHashSet<>(); for (int i = 0; i < size; i++) { - columnData.add(dataModel.getValueAt(i, colIndex)); + Object valueAt = dataModel.getValueAt(i, colIndex); + columnData.add(valueAt == null ? StringUtils.EMPTY : valueAt); } return columnData.toArray(); } catch (TableDataException ignore) { diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java index 4dc6ad024..72ca947fd 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java @@ -125,6 +125,7 @@ public class MatchAreaTable extends JTable { } public Object getCellEditorValue() { + comboBox.resetText(); return comboBox.getSelectedItem(); } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java index fe55b4486..0eaf75f08 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java @@ -2,6 +2,8 @@ package com.fr.design.chartx.component; import com.fr.design.gui.icombobox.FRTreeComboBox; import com.fr.design.gui.itextfield.UITextField; +import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralUtils; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import javax.swing.JTextField; @@ -39,6 +41,19 @@ public class TableTreeComboBox extends FRTreeComboBox { matchLeafNode(parent, node, textField); } + @Override + public void setSelectedItemString(String name) { + super.setSelectedItemString(name); + this.textField.setText(name); + } + + public void resetText() { + Object selectedItem = this.getSelectedItem(); + if(!ComparatorUtils.equals(selectedItem, textField.getText())){ + textField.setText(GeneralUtils.objectToString(selectedItem)); + } + } + private boolean matchLeafNode(TreePath parent, TreeNode node, UITextField textField) { for (Enumeration e = node.children(); e.hasMoreElements(); ) { TreeNode n = (TreeNode) e.nextElement(); @@ -71,7 +86,6 @@ public class TableTreeComboBox extends FRTreeComboBox { .getLastPathComponent(); if (node.isLeaf()) { TableTreeComboBox.this.setSelectedItem(treePath); - textField.setText(pathToString(treePath)); MenuSelectionManager.defaultManager().clearSelectedPath(); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java index feb7ffd37..09d72a72e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java @@ -21,6 +21,8 @@ import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; /** * @author Bjorn @@ -52,12 +54,18 @@ public abstract class VanMapTableDataContentPane extends AbstractTableDataConten this.matchResult = matchResult; } - public JPanel createAreaPanel(final UIComboBox areaBox) { + public JPanel createAreaPanel(UIComboBox areaBox) { JPanel areaPanel = new JPanel(new BorderLayout(4, 0)); areaBox.setPreferredSize(new Dimension(70, 20)); areaPanel.add(areaBox, BorderLayout.CENTER); UIButton uiButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/config.png")); - uiButton.addActionListener(new ActionListener() { + uiButton.addActionListener(createActionListener(areaBox)); + areaPanel.add(uiButton, BorderLayout.EAST); + return areaPanel; + } + + private ActionListener createActionListener(final UIComboBox areaBox){ + return new ActionListener() { private TwoTuple> treeNodeAndItems; @Override @@ -67,9 +75,8 @@ public abstract class VanMapTableDataContentPane extends AbstractTableDataConten } final MapAreaMatchPane pane = new MapAreaMatchPane(treeNodeAndItems); - String nameTable = getTableName(); + final String nameTable = getTableName(); - pane.populateBean(matchResult, nameTable, Utils.objectToString(areaBox.getSelectedItem())); BasicDialog dialog = pane.showWindow(new JFrame()); dialog.addDialogActionListener(new DialogActionListener() { @Override @@ -82,11 +89,45 @@ public abstract class VanMapTableDataContentPane extends AbstractTableDataConten } }); + dialog.addWindowListener(new WindowListener() { + @Override + public void windowOpened(WindowEvent e) { + pane.populateBean(matchResult, nameTable, Utils.objectToString(areaBox.getSelectedItem())); + } + + @Override + public void windowClosing(WindowEvent e) { + + } + + @Override + public void windowClosed(WindowEvent e) { + + } + + @Override + public void windowIconified(WindowEvent e) { + + } + + @Override + public void windowDeiconified(WindowEvent e) { + + } + + @Override + public void windowActivated(WindowEvent e) { + + } + + @Override + public void windowDeactivated(WindowEvent e) { + + } + }); dialog.setVisible(true); } - }); - areaPanel.add(uiButton, BorderLayout.EAST); - return areaPanel; + }; } @Override From 1f4fed29582c889c7837c7221a4cc3e30762dbbb Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 16 Mar 2020 15:08:44 +0800 Subject: [PATCH 105/375] fix restart --- designer-realize/src/main/java/com/fr/start/MainDesigner.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/start/MainDesigner.java b/designer-realize/src/main/java/com/fr/start/MainDesigner.java index 5b3ecea4e..a52efdde7 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -165,6 +165,8 @@ public class MainDesigner extends BaseDesigner { } if (!success) { afterBackupFailed(); + } else { + RestartHelper.restart(); } } else { DesignerExiter.getInstance().execute(); From d457e9c1cfd90c2002355ccdcfc0b429360ef710 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 16 Mar 2020 16:21:08 +0800 Subject: [PATCH 106/375] =?UTF-8?q?fix=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/MainDesigner.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/MainDesigner.java b/designer-realize/src/main/java/com/fr/start/MainDesigner.java index a52efdde7..cac05f841 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -59,6 +59,7 @@ import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.lifecycle.ErrorType; +import com.fr.stable.lifecycle.FineLifecycleFatalError; import com.fr.stable.lifecycle.LifecycleFatalError; import com.fr.stable.project.ProjectConstants; import com.fr.stable.xml.XMLTools; @@ -115,9 +116,9 @@ public class MainDesigner extends BaseDesigner { //启动运行时 FineRuntime.start(); DesignerSubListener.getInstance().start(); - EventDispatcher.listen(LifecycleErrorEvent.SELF, new Listener() { + EventDispatcher.listen(LifecycleErrorEvent.SELF, new Listener() { @Override - public void on(Event event, LifecycleFatalError param) { + public void on(Event event, FineLifecycleFatalError param) { afterError(param); } }); @@ -126,7 +127,7 @@ public class MainDesigner extends BaseDesigner { designerRoot.setSingleton(StartupArgs.class, new StartupArgs(args)); try { designerRoot.start(); - } catch (LifecycleFatalError fatal) { + } catch (FineLifecycleFatalError fatal) { afterError(fatal); } From c3d397bee3cf76a9112c9fa4f4a7bab9828703d6 Mon Sep 17 00:00:00 2001 From: Maksim Date: Mon, 16 Mar 2020 17:30:20 +0800 Subject: [PATCH 107/375] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E9=95=BF=E5=BA=A6=E6=9D=A5=E5=AE=9A=E4=B9=89=E9=97=B4?= =?UTF-8?q?=E9=9A=94=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 2 +- .../submit => env}/CheckServiceDialog.java | 8 ++- .../java/com/fr/env/utils/DisplayUtils.java | 39 ++++++++++++++ .../com/fr/design/EnvChangeEntranceTest.java | 2 +- .../com/fr/env/utils/DisplayUtilsTest.java | 52 +++++++++++++++++++ 5 files changed, 99 insertions(+), 4 deletions(-) rename designer-base/src/main/java/com/fr/{design/write/submit => env}/CheckServiceDialog.java (94%) create mode 100644 designer-base/src/main/java/com/fr/env/utils/DisplayUtils.java create mode 100644 designer-base/src/test/java/com/fr/env/utils/DisplayUtilsTest.java 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 6febf8785..076d59f8b 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -14,7 +14,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.design.utils.DesignUtils; -import com.fr.design.write.submit.CheckServiceDialog; +import com.fr.env.CheckServiceDialog; import com.fr.env.EnvListPane; import com.fr.exit.DesignerExiter; import com.fr.general.GeneralContext; diff --git a/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java b/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java similarity index 94% rename from designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java rename to designer-base/src/main/java/com/fr/env/CheckServiceDialog.java index 177d6123e..0389d7d58 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/CheckServiceDialog.java +++ b/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java @@ -1,4 +1,4 @@ -package com.fr.design.write.submit; +package com.fr.env; import com.fr.design.DesignerEnvManager; import com.fr.design.env.RemoteDesignerWorkspaceInfo; @@ -7,6 +7,7 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.env.utils.DisplayUtils; import com.fr.general.FRFont; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; @@ -56,7 +57,10 @@ public class CheckServiceDialog extends JDialog implements ActionListener { JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Inconsistency")); label.setFont(font); label.setPreferredSize(new Dimension(650,30)); - String delimiter = GeneralContext.getLocale().equals(Locale.US)? "
":"/"; + + String text = Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Local_Designer") + localBranch + + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + remoteBranch; + String delimiter = DisplayUtils.getDisplayLength(text) > 70? "
":"/"; JLabel label2 = new JLabel(""+Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Local_Designer") + localBranch + delimiter + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + remoteBranch+""); label2.setPreferredSize(new Dimension(600,30)); diff --git a/designer-base/src/main/java/com/fr/env/utils/DisplayUtils.java b/designer-base/src/main/java/com/fr/env/utils/DisplayUtils.java new file mode 100644 index 000000000..1795c5fb1 --- /dev/null +++ b/designer-base/src/main/java/com/fr/env/utils/DisplayUtils.java @@ -0,0 +1,39 @@ +package com.fr.env.utils; + +/** + * @author: Maksim + * @Date: Created in 2020/3/16 + * @Description: + */ +public class DisplayUtils { + + /** + * 获取字符串显示时的计算长度 + * @param text 被计算的字符串 + * @return 计算长度 + */ + public static int getDisplayLength(String text){ + if (text == null) { + return 0; + } + char[] c = text.toCharArray(); + int len = 0; + for (int i = 0; i < c.length; i++) { + len++; + if(!isLetter(c[i])){ + len++; + }; + } + return len; + } + + /** + * 判断字符是否为字母、数字、英文符号 + * @param c 传入的字符 + * @return 如果符合上述条件,返回true + */ + public static boolean isLetter(char c) { + int k = 0x80; + return c / k == 0; + } +} diff --git a/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java b/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java index 360bdfd9f..f37c6e73d 100644 --- a/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java +++ b/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java @@ -2,7 +2,7 @@ package com.fr.design; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceType; -import com.fr.design.write.submit.CheckServiceDialog; +import com.fr.env.CheckServiceDialog; import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; import org.easymock.EasyMock; diff --git a/designer-base/src/test/java/com/fr/env/utils/DisplayUtilsTest.java b/designer-base/src/test/java/com/fr/env/utils/DisplayUtilsTest.java new file mode 100644 index 000000000..181bd9788 --- /dev/null +++ b/designer-base/src/test/java/com/fr/env/utils/DisplayUtilsTest.java @@ -0,0 +1,52 @@ +package com.fr.env.utils; + +import org.junit.Assert; +import org.junit.Test; + + +/** + * @author: Maksim + * @Date: Created in 2020/3/16 + * @Description: + */ +public class DisplayUtilsTest { + + @Test + public void getDisplayLengthTest() { + String s1 = "本地设计器"; + String s2 = "リモートサーバ"; + String s3 = "Local Designer:"; + String s4 = "本地,设,计器: persist-2020.01.15"; + String s5 = "ローカルデザイナrelease-2020.03.03 ... Remote Server:persist-2020.01.15"; + String s6 = "本地 00:00ロ ーカDE / abc "; + + int length1 = DisplayUtils.getDisplayLength(s1); + int length2 = DisplayUtils.getDisplayLength(s2); + int length3 = DisplayUtils.getDisplayLength(s3); + int length4 = DisplayUtils.getDisplayLength(s4); + int length5 = DisplayUtils.getDisplayLength(s5); + int length6 = DisplayUtils.getDisplayLength(s6); + Assert.assertEquals(10,length1); + Assert.assertEquals(14,length2); + Assert.assertEquals(15,length3); + Assert.assertEquals(34,length4); + Assert.assertEquals(72,length5); + Assert.assertEquals(26,length6); + } + + @Test + public void isLetterTest(){ + char c1 = 'A'; + char c2 = '中'; + char c3 = ','; + char c4 = ','; + char c5 = 'デ'; + char c6 = ' '; + Assert.assertTrue(DisplayUtils.isLetter(c1)); + Assert.assertFalse(DisplayUtils.isLetter(c2)); + Assert.assertTrue(DisplayUtils.isLetter(c3)); + Assert.assertFalse(DisplayUtils.isLetter(c4)); + Assert.assertFalse(DisplayUtils.isLetter(c5)); + Assert.assertTrue(DisplayUtils.isLetter(c6)); + } +} \ No newline at end of file From b9f3b1b7377a8de303fe865aaa24500820226f3b Mon Sep 17 00:00:00 2001 From: Maksim Date: Mon, 16 Mar 2020 17:38:52 +0800 Subject: [PATCH 108/375] =?UTF-8?q?NPE=E5=A4=84=E7=90=86=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 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 076d59f8b..b9d59f27b 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -245,13 +245,13 @@ public class EnvChangeEntrance { Set noExistServiceSet = getNoExistServiceSet(connectionInfo); StringBuilder textBuilder = new StringBuilder(); for (Class clazz : noExistServiceSet) { - try { - WorkspaceAPI workspaceAPI = (WorkspaceAPI) clazz.getAnnotation(WorkspaceAPI.class); - String descriptionOfCN = InterProviderFactory.getProvider().getLocText(workspaceAPI.description()); - textBuilder.append(descriptionOfCN).append("\n"); - }catch (NullPointerException e){ + WorkspaceAPI workspaceAPI = (WorkspaceAPI) clazz.getAnnotation(WorkspaceAPI.class); + if(workspaceAPI == null){ FineLoggerFactory.getLogger().info("workspace service {} get annotation failed", clazz); + continue; } + String descriptionOfCN = InterProviderFactory.getProvider().getLocText(workspaceAPI.description()); + textBuilder.append(descriptionOfCN).append("\n"); } String areaText = textBuilder.toString(); if(StringUtils.isEmpty(areaText)){ From 323d892a15156d9760da8b63f79519f5fe1c3413 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 16 Mar 2020 17:40:59 +0800 Subject: [PATCH 109/375] =?UTF-8?q?fix=20=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/start/LifecycleFatalErrorHandler.java | 100 ++++++++++++++++++ .../main/java/com/fr/start/MainDesigner.java | 81 +------------- 2 files changed, 102 insertions(+), 79 deletions(-) create mode 100644 designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java diff --git a/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java b/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java new file mode 100644 index 000000000..1241dae0a --- /dev/null +++ b/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java @@ -0,0 +1,100 @@ +package com.fr.start; + +import com.fr.design.RestartHelper; +import com.fr.design.dialog.ErrorDialog; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.messagecollect.StartErrorMessageCollector; +import com.fr.design.mainframe.messagecollect.entity.DesignerErrorMessage; +import com.fr.exit.DesignerExiter; +import com.fr.general.IOUtils; +import com.fr.io.utils.ResourceIOUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StableUtils; +import com.fr.stable.lifecycle.ErrorType; +import com.fr.stable.lifecycle.FineLifecycleFatalError; +import com.fr.stable.project.ProjectConstants; + +import javax.swing.*; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/16 + */ +public class LifecycleFatalErrorHandler { + + private static final LifecycleFatalErrorHandler INSTANCE = new LifecycleFatalErrorHandler(); + + public static LifecycleFatalErrorHandler getInstance() { + return INSTANCE; + } + + + public void handle(FineLifecycleFatalError fatal) { + SplashContext.getInstance().hide(); + if (ErrorType.FINEDB.equals(fatal.getErrorType())) { + StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.FINEDB_PROBLEM.getId(), + DesignerErrorMessage.FINEDB_PROBLEM.getMessage(), + fatal.getMessage()); + FineLoggerFactory.getLogger().error(DesignerErrorMessage.FINEDB_PROBLEM.getId() + ": " + DesignerErrorMessage.FINEDB_PROBLEM.getMessage()); + int result = FineJOptionPane.showOptionDialog(null, + Toolkit.i18nText("Fine-Design_Error_Finedb_Backup_Reset"), + Toolkit.i18nText("Fine-Design_Basic_Error_Tittle"), + JOptionPane.YES_NO_OPTION, + JOptionPane.ERROR_MESSAGE, + IOUtils.readIcon("com/fr/design/images/error/error2.png"), + new Object[] {Toolkit.i18nText("Fine-Design_Basic_Reset"), Toolkit.i18nText("Fine-Design_Basic_Cancel")}, + null); + if (result == JOptionPane.YES_OPTION) { + boolean success = false; + try { + ResourceIOUtils.copy(StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_NAME), + StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_BAK_NAME)); + success = ResourceIOUtils.delete(StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_NAME)); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + afterBackupFailed(); + } + if (!success) { + afterBackupFailed(); + } else { + RestartHelper.restart(); + } + } else { + DesignerExiter.getInstance().execute(); + } + } + FineLoggerFactory.getLogger().error(fatal.getMessage(), fatal); + StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.UNEXCEPTED_START_FAILED.getId(), + DesignerErrorMessage.UNEXCEPTED_START_FAILED.getMessage(), + fatal.getMessage()); + ErrorDialog dialog = new ErrorDialog(null, Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), + Toolkit.i18nText("Fine-Design_Error_Start_Report"), + fatal.getMessage()) { + @Override + protected void okEvent() { + dispose(); + DesignerExiter.getInstance().execute(); + } + + @Override + protected void restartEvent() { + dispose(); + RestartHelper.restart(); + } + }; + dialog.setVisible(true); + } + + private void afterBackupFailed() { + FineJOptionPane.showMessageDialog(null, + Toolkit.i18nText("Fine-Design_Error_Finedb_Backup_Reset_Result", + ResourceIOUtils.getRealPath(StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_NAME))), + Toolkit.i18nText("Fine-Design_Basic_Error"), + JOptionPane.ERROR_MESSAGE); + DesignerExiter.getInstance().execute(); + } + + +} diff --git a/designer-realize/src/main/java/com/fr/start/MainDesigner.java b/designer-realize/src/main/java/com/fr/start/MainDesigner.java index cac05f841..2cdc83230 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -3,7 +3,6 @@ package com.fr.start; import com.fr.base.BaseUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignerEnvManager; -import com.fr.design.RestartHelper; import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.file.WebPreviewUtils; import com.fr.design.actions.file.newReport.NewPolyReportAction; @@ -13,8 +12,6 @@ import com.fr.design.actions.server.StyleListAction; import com.fr.design.actions.server.WidgetManagerAction; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.constants.UIConstants; -import com.fr.design.dialog.ErrorDialog; -import com.fr.design.dialog.FineJOptionPane; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.MutilTempalteTabPane; @@ -24,7 +21,6 @@ import com.fr.design.gui.ibutton.UIPreviewButton; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.itoolbar.UILargeToolbar; -import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.ActiveKeyGenerator; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.InformationCollector; @@ -33,8 +29,6 @@ import com.fr.design.mainframe.JWorkBook; import com.fr.design.mainframe.alphafine.component.AlphaFinePane; import com.fr.design.mainframe.bbs.UserInfoLabel; import com.fr.design.mainframe.bbs.UserInfoPane; -import com.fr.design.mainframe.messagecollect.StartErrorMessageCollector; -import com.fr.design.mainframe.messagecollect.entity.DesignerErrorMessage; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.MenuDef; @@ -46,10 +40,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; -import com.fr.exit.DesignerExiter; import com.fr.general.ComparatorUtils; -import com.fr.general.IOUtils; -import com.fr.io.utils.ResourceIOUtils; import com.fr.log.FineLoggerFactory; import com.fr.module.Module; import com.fr.module.ModuleContext; @@ -58,10 +49,7 @@ import com.fr.runtime.FineRuntime; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; -import com.fr.stable.lifecycle.ErrorType; import com.fr.stable.lifecycle.FineLifecycleFatalError; -import com.fr.stable.lifecycle.LifecycleFatalError; -import com.fr.stable.project.ProjectConstants; import com.fr.stable.xml.XMLTools; import com.fr.start.module.StartupArgs; import com.fr.start.server.ServerTray; @@ -69,7 +57,6 @@ import com.fr.third.org.apache.commons.lang3.time.StopWatch; import com.fr.workspace.WorkContext; import javax.swing.JComponent; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.border.MatteBorder; import java.awt.Component; @@ -119,7 +106,7 @@ public class MainDesigner extends BaseDesigner { EventDispatcher.listen(LifecycleErrorEvent.SELF, new Listener() { @Override public void on(Event event, FineLifecycleFatalError param) { - afterError(param); + LifecycleFatalErrorHandler.getInstance().handle(param); } }); Module designerRoot = ModuleContext.parseRoot("designer-startup.xml"); @@ -128,7 +115,7 @@ public class MainDesigner extends BaseDesigner { try { designerRoot.start(); } catch (FineLifecycleFatalError fatal) { - afterError(fatal); + LifecycleFatalErrorHandler.getInstance().handle(fatal); } if (WorkContext.getCurrent().isLocal()) { @@ -139,70 +126,6 @@ public class MainDesigner extends BaseDesigner { watch.stop(); } - private static void afterError(LifecycleFatalError fatal) { - SplashContext.getInstance().hide(); - if (ErrorType.FINEDB.equals(fatal.getErrorType())) { - StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.FINEDB_PROBLEM.getId(), - DesignerErrorMessage.FINEDB_PROBLEM.getMessage(), - fatal.getMessage()); - FineLoggerFactory.getLogger().error(DesignerErrorMessage.FINEDB_PROBLEM.getId() + ": " + DesignerErrorMessage.FINEDB_PROBLEM.getMessage()); - int result = FineJOptionPane.showOptionDialog(null, - Toolkit.i18nText("Fine-Design_Error_Finedb_Backup_Reset"), - Toolkit.i18nText("Fine-Design_Basic_Error_Tittle"), - JOptionPane.YES_NO_OPTION, - JOptionPane.ERROR_MESSAGE, - IOUtils.readIcon("com/fr/design/images/error/error2.png"), - new Object[] {Toolkit.i18nText("Fine-Design_Basic_Reset"), Toolkit.i18nText("Fine-Design_Basic_Cancel")}, - null); - if (result == JOptionPane.YES_OPTION) { - boolean success = false; - try { - ResourceIOUtils.copy(StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_NAME), - StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_BAK_NAME)); - success = ResourceIOUtils.delete(StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_NAME)); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - afterBackupFailed(); - } - if (!success) { - afterBackupFailed(); - } else { - RestartHelper.restart(); - } - } else { - DesignerExiter.getInstance().execute(); - } - } - FineLoggerFactory.getLogger().error(fatal.getMessage(), fatal); - StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.UNEXCEPTED_START_FAILED.getId(), - DesignerErrorMessage.UNEXCEPTED_START_FAILED.getMessage(), - fatal.getMessage()); - ErrorDialog dialog = new ErrorDialog(null, Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), - Toolkit.i18nText("Fine-Design_Error_Start_Report"), - fatal.getMessage()) { - @Override - protected void okEvent() { - dispose(); - DesignerExiter.getInstance().execute(); - } - - @Override - protected void restartEvent() { - dispose(); - RestartHelper.restart(); - } - }; - dialog.setVisible(true); - } - - private static void afterBackupFailed() { - FineJOptionPane.showMessageDialog(null, - Toolkit.i18nText("Fine-Design_Error_Finedb_Backup_Reset_Result", - ResourceIOUtils.getRealPath(StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_NAME))), - Toolkit.i18nText("Fine-Design_Basic_Error"), - JOptionPane.ERROR_MESSAGE); - DesignerExiter.getInstance().execute(); - } /** * 创建新建文件的快捷方式数组。 * From ac2fc4dda22fd6e6a33747ab504f78ed19e432d1 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 16 Mar 2020 18:46:41 +0800 Subject: [PATCH 110/375] =?UTF-8?q?fix=20=E5=B0=81=E8=A3=85=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/start/LifecycleFatalErrorHandler.java | 146 +++++++++++------- 1 file changed, 92 insertions(+), 54 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java b/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java index 1241dae0a..252b01dc1 100644 --- a/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java +++ b/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java @@ -16,6 +16,8 @@ import com.fr.stable.lifecycle.FineLifecycleFatalError; import com.fr.stable.project.ProjectConstants; import javax.swing.*; +import java.util.HashMap; +import java.util.Map; /** * @author hades @@ -25,75 +27,111 @@ import javax.swing.*; public class LifecycleFatalErrorHandler { private static final LifecycleFatalErrorHandler INSTANCE = new LifecycleFatalErrorHandler(); + private Map map = new HashMap<>(); + + private LifecycleFatalErrorHandler() { + for (ErrorType type : ErrorType.values()) { + if (ErrorType.FINEDB.equals(type)) { + map.put(type, FineDBHandler.SELF); + } else { + map.put(type, DefaultHandler.SELF); + } + } + } public static LifecycleFatalErrorHandler getInstance() { return INSTANCE; } - public void handle(FineLifecycleFatalError fatal) { SplashContext.getInstance().hide(); - if (ErrorType.FINEDB.equals(fatal.getErrorType())) { - StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.FINEDB_PROBLEM.getId(), - DesignerErrorMessage.FINEDB_PROBLEM.getMessage(), - fatal.getMessage()); - FineLoggerFactory.getLogger().error(DesignerErrorMessage.FINEDB_PROBLEM.getId() + ": " + DesignerErrorMessage.FINEDB_PROBLEM.getMessage()); - int result = FineJOptionPane.showOptionDialog(null, - Toolkit.i18nText("Fine-Design_Error_Finedb_Backup_Reset"), - Toolkit.i18nText("Fine-Design_Basic_Error_Tittle"), - JOptionPane.YES_NO_OPTION, - JOptionPane.ERROR_MESSAGE, - IOUtils.readIcon("com/fr/design/images/error/error2.png"), - new Object[] {Toolkit.i18nText("Fine-Design_Basic_Reset"), Toolkit.i18nText("Fine-Design_Basic_Cancel")}, - null); - if (result == JOptionPane.YES_OPTION) { - boolean success = false; - try { - ResourceIOUtils.copy(StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_NAME), - StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_BAK_NAME)); - success = ResourceIOUtils.delete(StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_NAME)); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - afterBackupFailed(); - } - if (!success) { - afterBackupFailed(); + map.get(fatal.getErrorType()).handle(fatal); + } + + interface Handler { + void handle(FineLifecycleFatalError error); + } + + /** + * finedb处理 + */ + enum FineDBHandler implements Handler { + + SELF { + @Override + public void handle(FineLifecycleFatalError fatal) { + StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.FINEDB_PROBLEM.getId(), + DesignerErrorMessage.FINEDB_PROBLEM.getMessage(), + fatal.getMessage()); + FineLoggerFactory.getLogger().error(DesignerErrorMessage.FINEDB_PROBLEM.getId() + ": " + DesignerErrorMessage.FINEDB_PROBLEM.getMessage()); + int result = FineJOptionPane.showOptionDialog(null, + Toolkit.i18nText("Fine-Design_Error_Finedb_Backup_Reset"), + Toolkit.i18nText("Fine-Design_Basic_Error_Tittle"), + JOptionPane.YES_NO_OPTION, + JOptionPane.ERROR_MESSAGE, + IOUtils.readIcon("com/fr/design/images/error/error2.png"), + new Object[] {Toolkit.i18nText("Fine-Design_Basic_Reset"), Toolkit.i18nText("Fine-Design_Basic_Cancel")}, + null); + if (result == JOptionPane.YES_OPTION) { + boolean success = false; + try { + ResourceIOUtils.copy(StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_NAME), + StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_BAK_NAME)); + success = ResourceIOUtils.delete(StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_NAME)); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + afterBackupFailed(); + } + if (!success) { + afterBackupFailed(); + } else { + RestartHelper.restart(); + } } else { - RestartHelper.restart(); + DesignerExiter.getInstance().execute(); } - } else { - DesignerExiter.getInstance().execute(); } - } - FineLoggerFactory.getLogger().error(fatal.getMessage(), fatal); - StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.UNEXCEPTED_START_FAILED.getId(), - DesignerErrorMessage.UNEXCEPTED_START_FAILED.getMessage(), - fatal.getMessage()); - ErrorDialog dialog = new ErrorDialog(null, Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), - Toolkit.i18nText("Fine-Design_Error_Start_Report"), - fatal.getMessage()) { - @Override - protected void okEvent() { - dispose(); + + private void afterBackupFailed() { + FineJOptionPane.showMessageDialog(null, + Toolkit.i18nText("Fine-Design_Error_Finedb_Backup_Reset_Result", + ResourceIOUtils.getRealPath(StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_NAME))), + Toolkit.i18nText("Fine-Design_Basic_Error"), + JOptionPane.ERROR_MESSAGE); DesignerExiter.getInstance().execute(); } + } + } + /** + * 默认处理 + */ + enum DefaultHandler implements Handler { + SELF { @Override - protected void restartEvent() { - dispose(); - RestartHelper.restart(); - } - }; - dialog.setVisible(true); - } + public void handle(FineLifecycleFatalError fatal) { + FineLoggerFactory.getLogger().error(fatal.getMessage(), fatal); + StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.UNEXCEPTED_START_FAILED.getId(), + DesignerErrorMessage.UNEXCEPTED_START_FAILED.getMessage(), + fatal.getMessage()); + ErrorDialog dialog = new ErrorDialog(null, Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), + Toolkit.i18nText("Fine-Design_Error_Start_Report"), + fatal.getMessage()) { + @Override + protected void okEvent() { + dispose(); + DesignerExiter.getInstance().execute(); + } - private void afterBackupFailed() { - FineJOptionPane.showMessageDialog(null, - Toolkit.i18nText("Fine-Design_Error_Finedb_Backup_Reset_Result", - ResourceIOUtils.getRealPath(StableUtils.pathJoin(ProjectConstants.EMBED_DB_DIRECTORY, ProjectConstants.FINE_DB_NAME))), - Toolkit.i18nText("Fine-Design_Basic_Error"), - JOptionPane.ERROR_MESSAGE); - DesignerExiter.getInstance().execute(); + @Override + protected void restartEvent() { + dispose(); + RestartHelper.restart(); + } + }; + dialog.setVisible(true); + } + } } From 390943846cba7a4d08e3e1a24173dbab34d99d6d Mon Sep 17 00:00:00 2001 From: yaohwu Date: Mon, 16 Mar 2020 20:07:18 +0800 Subject: [PATCH 111/375] =?UTF-8?q?REPORT-27520=20=E5=A4=8D=E9=80=89?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=BB=84=E9=BB=98=E8=AE=A4=E5=80=BC=E5=A4=B1?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/designer/creator/XRadio.java | 2 ++ .../com/fr/design/widget/ui/designer/RadioDefinePane.java | 4 ++++ .../main/java/com/fr/design/widget/ui/RadioDefinePane.java | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XRadio.java b/designer-form/src/main/java/com/fr/design/designer/creator/XRadio.java index 3e122d070..af207457f 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XRadio.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XRadio.java @@ -15,7 +15,9 @@ import java.beans.IntrospectionException; /** * @author richer * @since 6.5.3 + * @deprecated */ +@Deprecated public class XRadio extends XWidgetCreator { public XRadio(Radio widget, Dimension initSize) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/RadioDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/RadioDefinePane.java index 9117b5c51..140e294e0 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/RadioDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/RadioDefinePane.java @@ -11,6 +11,10 @@ import com.fr.general.FRFont; import javax.swing.*; import java.awt.*; +/** + * @deprecated + */ +@Deprecated public class RadioDefinePane extends AbstractDataModify { public RadioDefinePane(XCreator xCreator) { super(xCreator); diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/RadioDefinePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/RadioDefinePane.java index b3915ac11..5de31c110 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/RadioDefinePane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/RadioDefinePane.java @@ -10,6 +10,10 @@ import com.fr.general.FRFont; import javax.swing.*; import java.awt.*; +/** + * @deprecated + */ +@Deprecated public class RadioDefinePane extends AbstractDataModify { public RadioDefinePane() { this.iniComoponents(); From 68f8530144bf8e6db1724fa99e5f9a194141b0e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 17 Mar 2020 11:01:24 +0800 Subject: [PATCH 112/375] =?UTF-8?q?CHART-13033=20&&=20CHART-13045=09?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=B8=8B=E6=8B=89=E6=A1=86=E6=97=B6=E5=B1=95?= =?UTF-8?q?=E5=BC=80=E4=B8=8B=E6=8B=89=E5=88=97=E8=A1=A8=20&&=20=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E4=BF=9D=E5=AD=98=E7=9A=84=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E5=92=8C=E5=8C=BA=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/icombobox/FRTreeComboBox.java | 61 ++++++++++--------- .../chartx/component/MapAreaMatchPane.java | 9 --- .../chartx/component/TableTreeComboBox.java | 42 ++++++++++++- 3 files changed, 73 insertions(+), 39 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java index c3dd64c9d..a7a913335 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java @@ -1,22 +1,14 @@ package com.fr.design.gui.icombobox; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.IllegalComponentStateException; -import java.awt.RenderingHints; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.awt.event.MouseMotionAdapter; -import java.awt.event.MouseMotionListener; -import java.util.Enumeration; +import com.fr.design.constants.UIConstants; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.ComparatorUtils; +import com.fr.general.NameObject; +import com.fr.stable.Constants; +import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.DefaultListCellRenderer; @@ -38,16 +30,23 @@ import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreeCellRenderer; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; - -import com.fr.design.constants.UIConstants; -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.general.ComparatorUtils; -import com.fr.general.NameObject; -import com.fr.stable.Constants; -import com.fr.stable.StringUtils; +import java.util.Enumeration; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.IllegalComponentStateException; +import java.awt.RenderingHints; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionAdapter; +import java.awt.event.MouseMotionListener; public class FRTreeComboBox extends UIComboBox { @@ -79,7 +78,7 @@ public class FRTreeComboBox extends UIComboBox { boolean showRoot, boolean editable) { this.setTree(tree); this.tree.setCellRenderer(renderer); - this.setEditor(new FrTreeSearchComboBoxEditor(this)); + this.setEditor(createEditor()); if (!showRoot) { tree.expandPath(new TreePath(tree.getModel().getRoot())); tree.setRootVisible(false); @@ -101,6 +100,10 @@ public class FRTreeComboBox extends UIComboBox { return true; } + protected UIComboBoxEditor createEditor() { + return new FrTreeSearchComboBoxEditor(this); + } + public void setTree(JTree tree) { this.tree = tree; if (tree != null) { @@ -529,7 +532,7 @@ public class FRTreeComboBox extends UIComboBox { } } - class FrTreeSearchComboBoxEditor extends UIComboBoxEditor implements DocumentListener { + public class FrTreeSearchComboBoxEditor extends UIComboBoxEditor implements DocumentListener { private volatile boolean setting = false; private FRTreeComboBox comboBox; private Object item; diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index ef9bbd797..cc202fcf1 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -180,10 +180,6 @@ public class MapAreaMatchPane extends BasicBeanPane { if (matchResult == null) { return; } - if (tableNameCombox.getSelectedItem() != null) { - matchResult.setTableName(tableNameCombox.getSelectedItem().getTableDataName()); - } - matchResult.setColumnName(GeneralUtils.objectToString(areaNameBox.getSelectedItem())); matchResultTable.updateBean(matchResult); } @@ -195,11 +191,6 @@ public class MapAreaMatchPane extends BasicBeanPane { public void populateBean(MapMatchResult matchResult, String tableName, String areaName) { //先取保存的数据集名称和区域名,若不存在,就取数据集面板配置的数据集名称和区域名 matchResultTable.populateBean(matchResult); - - if (matchResult != null && StringUtils.isNotEmpty(matchResult.getTableName())) { - tableName = matchResult.getTableName(); - areaName = matchResult.getColumnName(); - } tableNameCombox.setSelectedTableDataByName(tableName); if (StringUtils.isEmpty(areaName)) { return; diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java index 0eaf75f08..e8f02984f 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java @@ -1,6 +1,7 @@ package com.fr.design.chartx.component; import com.fr.design.gui.icombobox.FRTreeComboBox; +import com.fr.design.gui.icombobox.UIComboBoxEditor; import com.fr.design.gui.itextfield.UITextField; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralUtils; @@ -19,6 +20,8 @@ import java.awt.Component; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; /** * @author Bjorn @@ -49,11 +52,16 @@ public class TableTreeComboBox extends FRTreeComboBox { public void resetText() { Object selectedItem = this.getSelectedItem(); - if(!ComparatorUtils.equals(selectedItem, textField.getText())){ + if (!ComparatorUtils.equals(selectedItem, textField.getText())) { textField.setText(GeneralUtils.objectToString(selectedItem)); } } + @Override + protected UIComboBoxEditor createEditor() { + return new TableTreeComboBoxEditor(this); + } + private boolean matchLeafNode(TreePath parent, TreeNode node, UITextField textField) { for (Enumeration e = node.children(); e.hasMoreElements(); ) { TreeNode n = (TreeNode) e.nextElement(); @@ -107,4 +115,36 @@ public class TableTreeComboBox extends FRTreeComboBox { } }; + class TableTreeComboBoxEditor extends FrTreeSearchComboBoxEditor { + + public TableTreeComboBoxEditor(FRTreeComboBox comboBox) { + super(comboBox); + textField.addMouseListener(mouseListener); + } + + private MouseListener mouseListener = new MouseListener() { + + public void mouseClicked(MouseEvent e) { + + } + + public void mousePressed(MouseEvent e) { + + } + + public void mouseReleased(MouseEvent e) { + setPopupVisible(true); + } + + public void mouseEntered(MouseEvent e) { + + } + + public void mouseExited(MouseEvent e) { + + } + }; + + } + } From 28a21eca1f84ba85f996b60fa8cb5c32070cd00e Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 17 Mar 2020 11:58:43 +0800 Subject: [PATCH 113/375] =?UTF-8?q?REPORT-27434=201.15jar=E5=81=87?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E9=97=AE=E9=A2=98=20=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E8=A3=85=E7=BD=AE=E9=9C=80=E8=A6=81=E5=90=8C=E6=AD=A5=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) 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 482b0d337..a6d33b3a4 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 @@ -93,6 +93,7 @@ public abstract class JTemplate> protected U authorityUndoState = null; protected T template; // 当前模板 protected TemplateProcessInfo processInfo; // 模板过程的相关信息 + private JComponent centerPane; private static short currentIndex = 0;// 此变量用于多次新建模板时,让名字不重复 private DesignModelAdapter designModel; private PreviewProvider previewType; @@ -121,15 +122,15 @@ public abstract class JTemplate> this.template = t; this.previewType = parserPreviewProvider(t.getPreviewType()); this.editingFILE = file; + addCenterPane(); this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder()); - this.add(createCenterPane(), BorderLayout.CENTER); this.undoState = createUndoState(); designModel = createDesignModel(); consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile)); } - + void onGetFocus() { consumeTimer.start(); } @@ -248,17 +249,38 @@ public abstract class JTemplate> /** * 刷新内部资源 + * + * 刷新资源的同时。 + * CenterPane 负责监听改动。 + * 所以需要同步处理 */ public void refreshResource() { try { this.template = JTemplateFactory.asIOFile(this.editingFILE); setTarget(this.template); + + // 先移除旧的。 + removeCenterPane(); + // 加入新的 + addCenterPane(); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - + + private void addCenterPane() { + + this.centerPane = createCenterPane(); + this.add(centerPane, BorderLayout.CENTER); + } + + private void removeCenterPane() { + + JComponent centerPane = this.centerPane; + this.remove(centerPane); + } + /** * 刷新容器 */ From 9bb8e24a315cd890e8455e82f2e7747e6722f947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 17 Mar 2020 16:29:11 +0800 Subject: [PATCH 114/375] =?UTF-8?q?CHART-13043=20=20=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/chartx/component/MapAreaMatchPane.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index cc202fcf1..26b9dd30b 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -69,7 +69,6 @@ public class MapAreaMatchPane extends BasicBeanPane { private static final Object[] HEADER_WITH_EMPTY = new Object[]{Toolkit.i18nText("Fine-Design_Chart_Area_Name"), Toolkit.i18nText("Fine-Design_Chart_Match_To"), ""}; - public MapAreaMatchPane(TwoTuple> treeNodeAndItems) { initButtonGroup(); initRefreshLabel(); @@ -77,13 +76,17 @@ public class MapAreaMatchPane extends BasicBeanPane { this.setLayout(new BorderLayout(5, 10)); this.add(createContentPane(), BorderLayout.NORTH); initTable(treeNodeAndItems); + + JPanel tablePane = new JPanel(); + tablePane.setLayout(new BorderLayout(5, 10)); + tablePane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); JScrollPane matchAreaScroll = new JScrollPane(matchAreaTable) { @Override public Dimension getPreferredSize() { - return new Dimension(400, 300); + return new Dimension(400, 290); } }; - this.add(matchAreaScroll, BorderLayout.CENTER); + tablePane.add(matchAreaScroll, BorderLayout.CENTER); JScrollPane matchResultScroll = new JScrollPane(matchResultTable) { @Override public Dimension getPreferredSize() { @@ -91,8 +94,10 @@ public class MapAreaMatchPane extends BasicBeanPane { } }; matchResultScroll.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Chart_Custom_Match_List"))); - this.add(matchResultScroll, BorderLayout.SOUTH); - this.setBorder(BorderFactory.createEmptyBorder(5, 20, 5, 20)); + tablePane.add(matchResultScroll, BorderLayout.SOUTH); + + this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10)); + this.add(tablePane, BorderLayout.SOUTH); } private JPanel createContentPane() { From dfb4ae0ad8ef15ad4e6c1d378bd821e0a6cc5dfe Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 17 Mar 2020 20:16:24 +0800 Subject: [PATCH 115/375] =?UTF-8?q?REPORT-27434=201.15jar=E5=81=87?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E9=97=AE=E9=A2=98=20=E6=9B=B4=E6=8D=A2?= =?UTF-8?q?=E4=B8=8B=E4=BD=8D=E7=BD=AE=E3=80=82=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E5=90=8E=E6=94=B9=E5=8A=A8=E4=BA=86=E4=BB=A3=E7=A0=81=E7=9A=84?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E3=80=82=20=E6=B2=A1=E5=86=8D=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a6d33b3a4..ef125dc18 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 @@ -122,9 +122,9 @@ public abstract class JTemplate> this.template = t; this.previewType = parserPreviewProvider(t.getPreviewType()); this.editingFILE = file; - addCenterPane(); this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder()); + addCenterPane(); this.undoState = createUndoState(); designModel = createDesignModel(); From 3c52008d16b5f90af503074ed6725ffe6e4d40f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 18 Mar 2020 09:45:22 +0800 Subject: [PATCH 116/375] =?UTF-8?q?CHART-13057=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=80=82=E5=BA=94=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/chartx/component/MapAreaMatchPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index 26b9dd30b..dee0355b8 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -73,7 +73,7 @@ public class MapAreaMatchPane extends BasicBeanPane { initButtonGroup(); initRefreshLabel(); areaNameBox = new UIComboBox(); - this.setLayout(new BorderLayout(5, 10)); + this.setLayout(new BorderLayout(5, 5)); this.add(createContentPane(), BorderLayout.NORTH); initTable(treeNodeAndItems); @@ -97,7 +97,7 @@ public class MapAreaMatchPane extends BasicBeanPane { tablePane.add(matchResultScroll, BorderLayout.SOUTH); this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10)); - this.add(tablePane, BorderLayout.SOUTH); + this.add(tablePane, BorderLayout.CENTER); } private JPanel createContentPane() { From f94e551ceb441bfea49b454c2e235fd5b1075f79 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 18 Mar 2020 11:04:58 +0800 Subject: [PATCH 117/375] =?UTF-8?q?REPORT-28365=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=BF=AB=E9=80=9F=E5=AE=9A=E4=BD=8D=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/cardlayout/XWTabFitLayout.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 f2f58f17b..ed2386068 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,11 +8,15 @@ 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; @@ -589,7 +593,11 @@ public class XWTabFitLayout extends XWFitLayout { */ @Override public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { - return new WidgetPropertyUIProvider[0]; + if (FormDesignerUtils.isAppRelayout(WidgetPropertyPane.getInstance().getEditingFormDesigner())) { + return new WidgetPropertyUIProvider[] {new MobileBookMarkPropertyUI(this), new MobileBooKMarkUsePropertyUI(this)}; + } else { + return super.getWidgetPropertyUIProviders(); + } } @Override From 64083b375d2341e40e077dac11705a1eba4def35 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 18 Mar 2020 12:06:24 +0800 Subject: [PATCH 118/375] =?UTF-8?q?fix=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/creator/cardlayout/XWTabFitLayout.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ed2386068..f17ac0925 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 @@ -596,7 +596,7 @@ public class XWTabFitLayout extends XWFitLayout { if (FormDesignerUtils.isAppRelayout(WidgetPropertyPane.getInstance().getEditingFormDesigner())) { return new WidgetPropertyUIProvider[] {new MobileBookMarkPropertyUI(this), new MobileBooKMarkUsePropertyUI(this)}; } else { - return super.getWidgetPropertyUIProviders(); + return new WidgetPropertyUIProvider[0]; } } From fe0226e1bc7a8d61c9bfe402a5537f301d7e968c Mon Sep 17 00:00:00 2001 From: lucian Date: Wed, 18 Mar 2020 18:16:40 +0800 Subject: [PATCH 119/375] =?UTF-8?q?REPORT-27608=20=E5=A4=9A=E7=83=AD?= =?UTF-8?q?=E7=82=B9=E5=9B=BE=E7=89=87=E6=8F=92=E4=BB=B6=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E7=83=AD=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/core/ActionFactory.java | 14 ++++++++++++ .../fr/start/module/DesignerActivator.java | 22 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java index 83aeaefe3..574195470 100644 --- a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java +++ b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java @@ -260,6 +260,13 @@ public class ActionFactory { } } + public static void referCellInsertActionClass(Class[] cls) { + if (cls != null) { + actionClasses.clear(); + Collections.addAll(actionClasses, cls); + } + } + /** * 生成单元格插入相关的Action * 表单中报表块编辑需要屏蔽掉"插入子报表" @@ -318,6 +325,13 @@ public class ActionFactory { } } + public static void referFloatInsertActionClass(Class[] cls) { + if (cls != null) { + floatActionClasses.clear(); + Collections.addAll(floatActionClasses, cls); + } + } + /** * 生成悬浮元素插入相关的Action * diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 796b983f8..38efb4c1f 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -63,6 +63,7 @@ import com.fr.design.update.actions.RecoverForDesigner; import com.fr.design.update.push.DesignerPushUpdateManager; import com.fr.design.widget.ui.btn.FormSubmitButtonDetailPane; import com.fr.form.stable.ElementCaseThumbnailProcessor; +import com.fr.general.GeneralContext; import com.fr.general.xml.GeneralXMLTools; import com.fr.js.EmailJavaScript; import com.fr.js.JavaScriptImpl; @@ -75,6 +76,11 @@ import com.fr.locale.LocaleScope; import com.fr.log.FineLoggerFactory; import com.fr.log.LogHandler; import com.fr.module.Activator; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.injectable.PluginModule; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; import com.fr.quickeditor.cellquick.CellBiasTextPainterEditor; import com.fr.quickeditor.cellquick.CellDSColumnEditor; import com.fr.quickeditor.cellquick.CellFormulaQuickEditor; @@ -181,6 +187,7 @@ public class DesignerActivator extends Activator { ActionFactory.registerFloatInsertActionClass(actionsForInsertFloatElement()); DesignModuleFactory.registerCreators4Hyperlink(hyperlinkTypes()); + createPluginListener(); justStartModules4Designer(); CalculatorProviderContext.setValueConverter(valueConverter()); @@ -193,6 +200,21 @@ public class DesignerActivator extends Activator { InformationCollector.getInstance().collectStartTime(); } + private void createPluginListener() { + GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + @Override + public void on(PluginEvent event) { + ActionFactory.referCellInsertActionClass(actionsForInsertCellElement()); + ActionFactory.referFloatInsertActionClass(actionsForInsertFloatElement()); + } + }, new PluginFilter() { + @Override + public boolean accept(PluginContext context) { + return context.contain(PluginModule.ExtraDesign, ElementUIProvider.MARK_STRING); + } + }); + } + private static Class[] actionsForInsertCellElement() { List> classes = new ArrayList<>(); Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); From 73039732f405d19bf6345f681e403d8c61facde4 Mon Sep 17 00:00:00 2001 From: Maksim Date: Wed, 18 Mar 2020 19:07:27 +0800 Subject: [PATCH 120/375] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=97=B6=E6=97=A7=E7=9A=84=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 4 ++++ .../main/java/com/fr/env/CheckServiceDialog.java | 6 ++++-- .../java/com/fr/env/TestConnectionResult.java | 15 +++------------ 3 files changed, 11 insertions(+), 14 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 b9d59f27b..c2a9b7c2d 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -250,6 +250,10 @@ public class EnvChangeEntrance { FineLoggerFactory.getLogger().info("workspace service {} get annotation failed", clazz); continue; } + //一些不想暴露给用户的服务,可以在注解中不添加description,检测但不做提示,如固件回传 + if(StringUtils.isEmpty(workspaceAPI.description())){ + continue; + } String descriptionOfCN = InterProviderFactory.getProvider().getLocText(workspaceAPI.description()); textBuilder.append(descriptionOfCN).append("\n"); } diff --git a/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java b/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java index 0389d7d58..f9303f08b 100644 --- a/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java +++ b/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java @@ -20,6 +20,7 @@ import javax.swing.JPanel; import javax.swing.JTextArea; import javax.swing.JTextPane; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.Dimension; import java.awt.Frame; import java.awt.event.ActionEvent; @@ -49,7 +50,7 @@ public class CheckServiceDialog extends JDialog implements ActionListener { JLabel imageLabel = new JLabel(); imageLabel.setIcon(icon); imagePanel.add(imageLabel); - imagePanel.setPreferredSize(new Dimension(110,80)); + imagePanel.setPreferredSize(new Dimension(110,100)); JPanel verticalPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); FRFont font = FRFont.getInstance(); @@ -68,7 +69,7 @@ public class CheckServiceDialog extends JDialog implements ActionListener { JTextPane tipsPane = new JTextPane(); tipsPane.setEditable(false); tipsPane.setBackground(verticalPanel.getBackground()); - tipsPane.setPreferredSize(new Dimension(500,30)); + tipsPane.setPreferredSize(new Dimension(500,40)); tipsPane.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Need_Update")); verticalPanel.add(label); @@ -77,6 +78,7 @@ public class CheckServiceDialog extends JDialog implements ActionListener { topPanel.add(imagePanel,BorderLayout.WEST); topPanel.add(verticalPanel,BorderLayout.CENTER); + topPanel.setBorder(BorderFactory.createEmptyBorder(10,10,0,10)); //中间的文本域面板 centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); diff --git a/designer-base/src/main/java/com/fr/env/TestConnectionResult.java b/designer-base/src/main/java/com/fr/env/TestConnectionResult.java index 5362dbbd8..4524254f4 100644 --- a/designer-base/src/main/java/com/fr/env/TestConnectionResult.java +++ b/designer-base/src/main/java/com/fr/env/TestConnectionResult.java @@ -34,7 +34,7 @@ public enum TestConnectionResult { }, /** - * 不完全成功,版本不匹配,但测试连接成功。 + * 不完全成功,版本不匹配,但测试连接成功。该状态先保留 */ PARTLY_SUCCESS { @Override @@ -89,16 +89,7 @@ public enum TestConnectionResult { if (!value) { return FULLY_FAILED; } - try { - String serverVersion = new FunctionalHttpRequest(info).getServerVersion(); - if (AssistUtils.equals(serverVersion, WorkContext.getVersion())) { - return FULLY_SUCCESS; - } - return PARTLY_SUCCESS; - } catch (Exception e) { - // 发生异常,说明没连接上。返回完全失败。 - FineLoggerFactory.getLogger().error(e.getMessage()); - return FULLY_FAILED; - } + //去掉测试连接时所做的检测 + return FULLY_SUCCESS; } } From 923a9841a8cf7df6f134088db7ebdac79e52c560 Mon Sep 17 00:00:00 2001 From: Maksim Date: Wed, 18 Mar 2020 19:08:42 +0800 Subject: [PATCH 121/375] =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/main/java/com/fr/env/CheckServiceDialog.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java b/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java index f9303f08b..9134d6429 100644 --- a/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java +++ b/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java @@ -20,7 +20,6 @@ import javax.swing.JPanel; import javax.swing.JTextArea; import javax.swing.JTextPane; import java.awt.BorderLayout; -import java.awt.Color; import java.awt.Dimension; import java.awt.Frame; import java.awt.event.ActionEvent; From 4c30a05784f39d44b6e9937085d7fede4cccfbc2 Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 18 Mar 2020 19:31:27 +0800 Subject: [PATCH 122/375] =?UTF-8?q?REPORT-28363=20=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E6=BC=94=E7=A4=BA=E5=90=AF=E5=8A=A8=E5=86=85?= =?UTF-8?q?=E7=BD=AE=E6=9C=8D=E5=8A=A1=E5=99=A8=EF=BC=8C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/DesignerEnvManager.java | 12 +++++-- .../fr/design/mainframe/DesignerFrame.java | 15 ++++++-- .../push/DesignerPushUpdateManager.java | 9 ++++- .../main/java/com/fr/start/ServerStarter.java | 36 ++++++++----------- 4 files changed, 45 insertions(+), 27 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index cb8634c00..81211cc57 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -82,6 +82,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private static final String VERSION_80 = "80"; private static final int CACHINGTEMPLATE_LIMIT = 5; private static final String WEB_NAME = "webapps"; + /** + * 指定默认工作空间 + */ + public static final String DEFAULT_WORKSPACE_PATH = "fr.designer.workspace.default"; private static DesignerEnvManager designerEnvManager; // gui. private String activationKey = null; @@ -555,6 +559,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private String getDefaultenvPath(String installHome) { + String defaultWorkspacePath = System.getProperty(DEFAULT_WORKSPACE_PATH); + if (defaultWorkspacePath != null) { + return defaultWorkspacePath; + } //这里需要转成反斜杠和生成默认路径一致 return new File(StableUtils.pathJoin(installHome, WEB_NAME, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME)).getPath(); } @@ -1397,6 +1405,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { /** * 对国际化进行校验 * 非简繁英日韩的默认环境 设计器全部默认为英文版本 + * * @param locale * @return */ @@ -1548,8 +1557,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { readVcsAttr(reader); } else if (DesignerPort.XML_TAG.equals(name)) { readDesignerPort(reader); - } - else { + } else { readLayout(reader, name); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 237f2f975..31798e665 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -471,7 +471,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta OSSupportCenter.buildAction(new OSBasedAction() { @Override public void execute(Object... objects) { - bbsLoginPane[0] = ad.createBBSLoginPane(); + bbsLoginPane[0] = ad.createBBSLoginPane(); } }, SupportOSImpl.USERINFOPANE); processor.hold(northEastPane, LogMessageBar.getInstance(), bbsLoginPane[0]); @@ -483,7 +483,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta OSSupportCenter.buildAction(new OSBasedAction() { @Override public void execute(Object... objects) { - northEastPane.add(ad.createBBSLoginPane()); + northEastPane.add(ad.createBBSLoginPane()); } }, SupportOSImpl.USERINFOPANE); @@ -508,7 +508,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } if (OperatingSystem.isMacos()) { Class clazz = Class.forName("com.apple.eawt.Application"); - BufferedImage icon = image.isEmpty() ? IOUtils.readImage("/com/fr/base/images/oem/logo.png") : image.get(image.size() - 1); + BufferedImage icon = image.isEmpty() ? IOUtils.readImage("/com/fr/base/images/oem/logo.png") : image.get(image.size() - 1); Reflect.on(Reflect.on(clazz).call("getApplication").get()).call("setDockIconImage", icon); } else { this.setIconImages(image); @@ -1284,4 +1284,13 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta progressDialog.dispose(); } + + /** + * 设计器是否已经打开 + * + * @return 设计器是否已经打开 + */ + public boolean isDesignerOpened() { + return designerOpened; + } } diff --git a/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java b/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java index 12b1d74b7..efd809e79 100644 --- a/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java +++ b/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java @@ -58,7 +58,14 @@ public class DesignerPushUpdateManager { private String getFullLatestVersion() { try { - String res = HttpToolbox.get(CloudCenter.getInstance().acquireUrlByKind("jar10.update")); + String url = CloudCenter.getInstance().acquireUrlByKind("jar10.update"); + if(StringUtils.isBlank(url)){ + return StringUtils.EMPTY; + } + String res = HttpToolbox.get(url); + if(StringUtils.isBlank(res)){ + return StringUtils.EMPTY; + } return new JSONObject(res).optString("buildNO"); } catch (Throwable e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); diff --git a/designer-base/src/main/java/com/fr/start/ServerStarter.java b/designer-base/src/main/java/com/fr/start/ServerStarter.java index d4e1143c6..d2b8498bb 100644 --- a/designer-base/src/main/java/com/fr/start/ServerStarter.java +++ b/designer-base/src/main/java/com/fr/start/ServerStarter.java @@ -3,10 +3,9 @@ package com.fr.start; import com.fr.base.ServerConfig; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.BrowseUtils; -import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; -import com.fr.stable.StableUtils; import com.fr.start.server.FineEmbedServer; import com.fr.start.server.FineEmbedServerMonitor; import com.fr.workspace.WorkContext; @@ -25,23 +24,11 @@ public class ServerStarter { if (!WorkContext.getCurrent().isLocal()) { //有问题,这里拿不到远程的http端口 BrowseUtils.browser(WorkContext.getCurrent().getPath()); - } else if (ComparatorUtils.equals(StableUtils.getInstallHome(), ".")) {//august:供代码使用 - String web = GeneralContext.getCurrentAppNameOfEnv(); - browserURLWithLocalEnv("http://localhost:" + DesignerEnvManager.getEnvManager().getEmbedServerPort() + "/" + web + "/" + ServerConfig.getInstance().getServletName()); } else { - initDemoServerAndBrowser(); - } - - } - - - private static void initDemoServerAndBrowser() { - - try { - FineEmbedServer.start(); - } finally { - //先访问Demo, 后访问报表, 不需要重置服务器. - BrowseUtils.browser("http://localhost:" + DesignerEnvManager.getEnvManager().getEmbedServerPort() + "/" + GeneralContext.getCurrentAppNameOfEnv() + "/" + ServerConfig.getInstance().getServletName()); + browserURLWithLocalEnv("http://localhost:" + + DesignerEnvManager.getEnvManager().getEmbedServerPort() + + "/" + GeneralContext.getCurrentAppNameOfEnv() + + "/" + ServerConfig.getInstance().getServletName()); } } @@ -51,8 +38,8 @@ public class ServerStarter { * @param url 指定路径 */ public static void browserURLWithLocalEnv(final String url) { - - if (!FineEmbedServerMonitor.getInstance().isComplete()) { + // 内置服务器没有启动并且设计器已经打开,可以使用带进度条的启动方式 + if (!FineEmbedServer.isRunning() && DesignerContext.getDesignerFrame().isDesignerOpened()) { FineEmbedServerMonitor.getInstance().monitor(); ExecutorService service = Executors.newSingleThreadExecutor(new NamedThreadFactory("ServerStarter")); service.submit(new Runnable() { @@ -68,8 +55,15 @@ public class ServerStarter { } }); service.shutdown(); + } else if (!FineEmbedServer.isRunning()) { + // 普通方式启动内置服务器 + try { + FineEmbedServer.start(); + } finally { + BrowseUtils.browser(url); + } } else { - FineEmbedServer.start(); + // 已经启动内置服务器只需打开链接 BrowseUtils.browser(url); } } From dca98b258201f7102ff074f44231f3ae1218c0b4 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 18 Mar 2020 19:54:45 +0800 Subject: [PATCH 123/375] =?UTF-8?q?REPORT-28383=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E8=8F=9C=E5=8D=95=E6=A0=8F-=E6=96=87=E4=BB=B6-?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/file/filter/ChooseFileFilter.java | 28 ++++++++-------- .../java/com/fr/file/FILEChooserPaneTest.java | 10 ++++++ .../fr/file/filter/ChooseFileFilterTest.java | 33 +++++++++++++++++++ 3 files changed, 58 insertions(+), 13 deletions(-) create mode 100644 designer-base/src/test/java/com/fr/file/filter/ChooseFileFilterTest.java diff --git a/designer-base/src/main/java/com/fr/file/filter/ChooseFileFilter.java b/designer-base/src/main/java/com/fr/file/filter/ChooseFileFilter.java index a25ebe7b6..147e1946d 100644 --- a/designer-base/src/main/java/com/fr/file/filter/ChooseFileFilter.java +++ b/designer-base/src/main/java/com/fr/file/filter/ChooseFileFilter.java @@ -4,6 +4,8 @@ import com.fr.base.extension.FileExtension; import com.fr.file.FILE; import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; +import com.fr.stable.CoreConstants; +import com.fr.stable.StringUtils; import javax.swing.filechooser.FileFilter; import java.io.File; @@ -275,25 +277,25 @@ public class ChooseFileFilter extends FileFilter implements FILEFilter, java.io. } /** + * 默认情况下 返回首位的后缀名 * get extention. */ public String getExtensionString() { - if (filters == null) { - return ""; - } - - StringBuffer extsb = new StringBuffer("."); - -// Enumeration keys = filters.keys(); -// while (keys.hasMoreElements()) { -// extsb.append((String) keys.nextElement()); -// } + return getExtensionString(0); + } - for (int i = 0; i < filters.size(); i++) { - extsb.append(filters.get(i)); + public String getExtensionString(int index) { + if (filters == null || filters.isEmpty() || index >= filters.size()) { + return StringUtils.EMPTY; } + return CoreConstants.DOT + filters.get(index); + } - return extsb.toString(); + public int getExtensionCount() { + if (filters == null || filters.isEmpty()) { + return 0; + } + return filters.size(); } /** diff --git a/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java index 79a3ea0f2..064cd05ce 100644 --- a/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java +++ b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java @@ -39,6 +39,16 @@ public class FILEChooserPaneTest { String result6 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.xls", chooseFileFilter6).get(); Assert.assertEquals("WorkBook1.xls.cpt", result6); + ChooseFileFilter chooseFileFilter7 = new ChooseFileFilter(FileExtension.XLS, StringUtils.EMPTY); + chooseFileFilter7.addExtension(".xlsx"); + String result7 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1", chooseFileFilter7).get(); + Assert.assertEquals("WorkBook1.xls", result7); + + ChooseFileFilter chooseFileFilter8 = new ChooseFileFilter(FileExtension.XLSX, StringUtils.EMPTY); + chooseFileFilter8.addExtension(".xls"); + String result8 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1", chooseFileFilter8).get(); + Assert.assertEquals("WorkBook1.xlsx", result8); + } } diff --git a/designer-base/src/test/java/com/fr/file/filter/ChooseFileFilterTest.java b/designer-base/src/test/java/com/fr/file/filter/ChooseFileFilterTest.java new file mode 100644 index 000000000..ec6779bab --- /dev/null +++ b/designer-base/src/test/java/com/fr/file/filter/ChooseFileFilterTest.java @@ -0,0 +1,33 @@ +package com.fr.file.filter; + +import com.fr.base.extension.FileExtension; +import com.fr.stable.CoreConstants; +import com.fr.stable.StringUtils; +import junit.framework.TestCase; +import org.junit.Assert; + + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/18 + */ +public class ChooseFileFilterTest extends TestCase { + + public void testGetExtensionString() { + ChooseFileFilter chooseFileFilter = new ChooseFileFilter(FileExtension.XLSX, StringUtils.EMPTY); + chooseFileFilter.addExtension(FileExtension.XLS.getExtension()); + Assert.assertEquals(CoreConstants.DOT + FileExtension.XLSX.getExtension(), chooseFileFilter.getExtensionString()); + Assert.assertEquals(CoreConstants.DOT + FileExtension.XLS.getExtension(), chooseFileFilter.getExtensionString(1)); + ChooseFileFilter chooseFileFilter1 = new ChooseFileFilter(); + Assert.assertEquals(StringUtils.EMPTY, chooseFileFilter1.getExtensionString()); + Assert.assertEquals(StringUtils.EMPTY, chooseFileFilter1.getExtensionString(1)); + + } + + public void testGetExtensionCount() { + ChooseFileFilter chooseFileFilter = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY); + chooseFileFilter.addExtension(FileExtension.CPTX.getExtension()); + Assert.assertEquals(2, chooseFileFilter.getExtensionCount()); + } +} \ No newline at end of file From b5acdf4ac5531656178a2547605ec4522879c153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 19 Mar 2020 10:45:26 +0800 Subject: [PATCH 124/375] =?UTF-8?q?CHART-12820=20=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E8=BE=B9=E7=95=8C=E4=B8=A2=E5=A4=B1=20&&=20CHART-13035=20?= =?UTF-8?q?=E9=92=BB=E5=8F=96=E5=9C=B0=E5=9B=BE=E4=B8=8B=E6=8B=89=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E6=A0=B7=E5=BC=8F=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/chartx/component/MatchAreaTable.java | 5 ++++- .../com/fr/design/chartx/component/TableTreeComboBox.java | 4 ++-- .../com/fr/design/mainframe/chart/gui/type/MapPlotPane.java | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java index 72ca947fd..f4cdd84e0 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java @@ -4,6 +4,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.general.GeneralUtils; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; +import com.fr.stable.StringUtils; import javax.swing.AbstractCellEditor; import javax.swing.JTable; @@ -113,7 +114,9 @@ public class MatchAreaTable extends JTable { } private void initComboBox(Object value, boolean editor) { - comboBox = new TableTreeComboBox(new JTree(root)); + //地图不显示第一层,钻取地图显示第一层。 + boolean showRoot = root.getUserObject() !=null && StringUtils.isNotEmpty(root.getUserObject().toString()); + comboBox = new TableTreeComboBox(new JTree(root),showRoot); comboBox.setEditable(true); comboBox.setSelectedItem(value); diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java index e8f02984f..97426e4c7 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java @@ -32,8 +32,8 @@ public class TableTreeComboBox extends FRTreeComboBox { private JTextField textField; - public TableTreeComboBox(JTree tree) { - super(tree, null); + public TableTreeComboBox(JTree tree, boolean showRoot) { + super(tree, null, showRoot, false); textField = (JTextField) (this.getEditor().getEditorComponent()); textField.addKeyListener(treeKeyListener); tree.setCellRenderer(tableNameTreeRenderer); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MapPlotPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MapPlotPane.java index 988073926..96cae8b43 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MapPlotPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MapPlotPane.java @@ -67,6 +67,10 @@ public class MapPlotPane extends AbstractDeprecatedChartTypePane { return new String[0]; } + public void reLayout(String chartID) { + + } + /** * 界面标题 * @return 界面标题 From aa0519150a7476c80ae496a3cf7c1667b4ebba89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 19 Mar 2020 10:50:47 +0800 Subject: [PATCH 125/375] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/chartx/component/MatchAreaTable.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java index f4cdd84e0..9c16b4663 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java @@ -4,7 +4,6 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.general.GeneralUtils; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; -import com.fr.stable.StringUtils; import javax.swing.AbstractCellEditor; import javax.swing.JTable; @@ -115,8 +114,8 @@ public class MatchAreaTable extends JTable { private void initComboBox(Object value, boolean editor) { //地图不显示第一层,钻取地图显示第一层。 - boolean showRoot = root.getUserObject() !=null && StringUtils.isNotEmpty(root.getUserObject().toString()); - comboBox = new TableTreeComboBox(new JTree(root),showRoot); + boolean showRoot = root.getUserObject() != null; + comboBox = new TableTreeComboBox(new JTree(root), showRoot); comboBox.setEditable(true); comboBox.setSelectedItem(value); From a70c2e2c6f1fe1a6dbc7e4366e648e86c36d4aa6 Mon Sep 17 00:00:00 2001 From: Maksim Date: Thu, 19 Mar 2020 15:18:34 +0800 Subject: [PATCH 126/375] =?UTF-8?q?=E5=BF=BD=E7=95=A5=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E6=83=B3=E6=9A=B4=E9=9C=B2=E7=9A=84=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 3 +-- 1 file changed, 1 insertion(+), 2 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 c2a9b7c2d..43c829822 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -250,8 +250,7 @@ public class EnvChangeEntrance { FineLoggerFactory.getLogger().info("workspace service {} get annotation failed", clazz); continue; } - //一些不想暴露给用户的服务,可以在注解中不添加description,检测但不做提示,如固件回传 - if(StringUtils.isEmpty(workspaceAPI.description())){ + if(workspaceAPI.ignore()){ continue; } String descriptionOfCN = InterProviderFactory.getProvider().getLocText(workspaceAPI.description()); From e9abf0da09956d0fc402a03d33e7d70b9295464a Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 17 Mar 2020 11:58:43 +0800 Subject: [PATCH 127/375] =?UTF-8?q?REPORT-27434=201.15jar=E5=81=87?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E9=97=AE=E9=A2=98=20=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E8=A3=85=E7=BD=AE=E9=9C=80=E8=A6=81=E5=90=8C=E6=AD=A5=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) 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 482b0d337..a6d33b3a4 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 @@ -93,6 +93,7 @@ public abstract class JTemplate> protected U authorityUndoState = null; protected T template; // 当前模板 protected TemplateProcessInfo processInfo; // 模板过程的相关信息 + private JComponent centerPane; private static short currentIndex = 0;// 此变量用于多次新建模板时,让名字不重复 private DesignModelAdapter designModel; private PreviewProvider previewType; @@ -121,15 +122,15 @@ public abstract class JTemplate> this.template = t; this.previewType = parserPreviewProvider(t.getPreviewType()); this.editingFILE = file; + addCenterPane(); this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder()); - this.add(createCenterPane(), BorderLayout.CENTER); this.undoState = createUndoState(); designModel = createDesignModel(); consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile)); } - + void onGetFocus() { consumeTimer.start(); } @@ -248,17 +249,38 @@ public abstract class JTemplate> /** * 刷新内部资源 + * + * 刷新资源的同时。 + * CenterPane 负责监听改动。 + * 所以需要同步处理 */ public void refreshResource() { try { this.template = JTemplateFactory.asIOFile(this.editingFILE); setTarget(this.template); + + // 先移除旧的。 + removeCenterPane(); + // 加入新的 + addCenterPane(); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - + + private void addCenterPane() { + + this.centerPane = createCenterPane(); + this.add(centerPane, BorderLayout.CENTER); + } + + private void removeCenterPane() { + + JComponent centerPane = this.centerPane; + this.remove(centerPane); + } + /** * 刷新容器 */ From 872096f863776e74e2efa84aa332c4510d41ae5f Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 17 Mar 2020 20:16:24 +0800 Subject: [PATCH 128/375] =?UTF-8?q?REPORT-27434=201.15jar=E5=81=87?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E9=97=AE=E9=A2=98=20=E6=9B=B4=E6=8D=A2?= =?UTF-8?q?=E4=B8=8B=E4=BD=8D=E7=BD=AE=E3=80=82=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E5=90=8E=E6=94=B9=E5=8A=A8=E4=BA=86=E4=BB=A3=E7=A0=81=E7=9A=84?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E3=80=82=20=E6=B2=A1=E5=86=8D=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a6d33b3a4..ef125dc18 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 @@ -122,9 +122,9 @@ public abstract class JTemplate> this.template = t; this.previewType = parserPreviewProvider(t.getPreviewType()); this.editingFILE = file; - addCenterPane(); this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder()); + addCenterPane(); this.undoState = createUndoState(); designModel = createDesignModel(); From fb13a402d2447f211b2c5c1d448f1225c22477e2 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 19 Mar 2020 20:59:02 +0800 Subject: [PATCH 129/375] =?UTF-8?q?REPORT-28459=20JWorkBook=E6=9C=AA?= =?UTF-8?q?=E9=87=8A=E6=94=BE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/DesignTableDataManager.java | 1 + .../com/fr/design/event/RemoveListener.java | 11 ++++++++++ .../com/fr/design/mainframe/JWorkBook.java | 5 +++++ .../mainframe/ReportComponentComposite.java | 8 ++++++- .../fr/design/mainframe/SheetNameTabPane.java | 21 ++++++++++++++----- 5 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/event/RemoveListener.java diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index 25492c55e..a84e1337b 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -114,6 +114,7 @@ public abstract class DesignTableDataManager { public static void closeTemplate(JTemplate template) { if (template != null) { + template.whenClose(); columnCache.remove(getEditingTableDataSource()); dsListenersMap.remove(template.getPath()); } diff --git a/designer-base/src/main/java/com/fr/design/event/RemoveListener.java b/designer-base/src/main/java/com/fr/design/event/RemoveListener.java new file mode 100644 index 000000000..ff3eae305 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/event/RemoveListener.java @@ -0,0 +1,11 @@ +package com.fr.design.event; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/19 + */ +public interface RemoveListener { + + void doRemoveAction(); +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 621d3f40b..0759ddf98 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -1188,4 +1188,9 @@ public class JWorkBook extends JTemplate { provider.addChooseFileFilter(fileChooser, this.suffix()); } } + + @Override + public void whenClose() { + reportComposite.doRemoveAction(); + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java index 71fb27502..0299899a0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe; import com.fr.base.ScreenResolution; import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.designer.EditingState; +import com.fr.design.event.RemoveListener; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.icontainer.UIModeControlContainer; @@ -30,7 +31,7 @@ import java.util.ArrayList; * @editor zhou * @since 2012-3-27下午12:12:05 */ -public class ReportComponentComposite extends JComponent { +public class ReportComponentComposite extends JComponent implements RemoveListener { private static final int MAX = 400; private static final int HUND = 100; @@ -250,4 +251,9 @@ public class ReportComponentComposite extends JComponent { public void fireTargetModified() { parent.fireTargetModified(); } + + @Override + public void doRemoveAction() { + sheetNameTab.doRemoveAction(); + } } 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 747789cdb..74443e831 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 @@ -5,6 +5,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; @@ -27,6 +28,7 @@ import com.fr.base.vcs.DesignerMode; import com.fr.design.actions.UpdateAction; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.event.RemoveListener; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonUI; @@ -44,7 +46,6 @@ import com.fr.poly.PolyDesigner; import com.fr.report.poly.PolyWorkSheet; import com.fr.report.report.TemplateReport; import com.fr.report.worksheet.WorkSheet; -import com.fr.stable.ProductConstants; /** * NameTabPane of sheets @@ -52,7 +53,7 @@ import com.fr.stable.ProductConstants; * @editor zhou * @since 2012-3-26下午1:45:53 */ -public class SheetNameTabPane extends JComponent implements MouseListener, MouseMotionListener { +public class SheetNameTabPane extends JComponent implements MouseListener, MouseMotionListener, RemoveListener { private static final Color LINE_COLOR = new Color(0xababab); @@ -140,6 +141,10 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse private boolean isAuthorityEditing = false; + private ComponentListener listener; + + private DesignerFrame designerFrame; + public SheetNameTabPane(ReportComponentComposite reportCompositeX) { this.reportComposite = reportCompositeX; this.setLayout(new BorderLayout(0, 0)); @@ -203,14 +208,20 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse } } }); - - DesignerContext.getDesignerFrame().addComponentListener(new ComponentAdapter(){ + listener = new ComponentAdapter(){ @Override public void componentResized(ComponentEvent e) { for (int i = 0; i < lastOneIndex * NUM; i++) { moveLeft(); } } - }); + }; + designerFrame = DesignerContext.getDesignerFrame(); + designerFrame.addComponentListener(listener); + } + + @Override + public void doRemoveAction() { + designerFrame.removeComponentListener(listener); } private ActionListener createLeftButtonActionListener() { From 6c9c51e5e2cf5087f377ee7f74fe66171e25e0b4 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 19 Mar 2020 21:06:39 +0800 Subject: [PATCH 130/375] =?UTF-8?q?=E6=BC=8F=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 ef125dc18..29c1dcb53 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 @@ -247,6 +247,13 @@ public abstract class JTemplate> } + /** + * 模板关闭时 + */ + public void whenClose() { + // do nothing + } + /** * 刷新内部资源 * From 137ef15f48605eaa7db42c38c98b140096c46392 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 19 Mar 2020 21:19:37 +0800 Subject: [PATCH 131/375] =?UTF-8?q?REPORT-28459=20JWorkBook=E6=9C=AA?= =?UTF-8?q?=E9=87=8A=E6=94=BE=E9=97=AE=E9=A2=98=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/DesignTableDataManager.java | 1 + .../com/fr/design/event/RemoveListener.java | 11 ++++++++++ .../com/fr/design/mainframe/JTemplate.java | 7 +++++++ .../com/fr/design/mainframe/JWorkBook.java | 5 +++++ .../mainframe/ReportComponentComposite.java | 8 ++++++- .../fr/design/mainframe/SheetNameTabPane.java | 21 ++++++++++++++----- 6 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/event/RemoveListener.java diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index 25492c55e..a84e1337b 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -114,6 +114,7 @@ public abstract class DesignTableDataManager { public static void closeTemplate(JTemplate template) { if (template != null) { + template.whenClose(); columnCache.remove(getEditingTableDataSource()); dsListenersMap.remove(template.getPath()); } diff --git a/designer-base/src/main/java/com/fr/design/event/RemoveListener.java b/designer-base/src/main/java/com/fr/design/event/RemoveListener.java new file mode 100644 index 000000000..ff3eae305 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/event/RemoveListener.java @@ -0,0 +1,11 @@ +package com.fr.design.event; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/19 + */ +public interface RemoveListener { + + void doRemoveAction(); +} 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 ef125dc18..29c1dcb53 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 @@ -247,6 +247,13 @@ public abstract class JTemplate> } + /** + * 模板关闭时 + */ + public void whenClose() { + // do nothing + } + /** * 刷新内部资源 * diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 621d3f40b..0759ddf98 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -1188,4 +1188,9 @@ public class JWorkBook extends JTemplate { provider.addChooseFileFilter(fileChooser, this.suffix()); } } + + @Override + public void whenClose() { + reportComposite.doRemoveAction(); + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java index 71fb27502..0299899a0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe; import com.fr.base.ScreenResolution; import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.designer.EditingState; +import com.fr.design.event.RemoveListener; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.icontainer.UIModeControlContainer; @@ -30,7 +31,7 @@ import java.util.ArrayList; * @editor zhou * @since 2012-3-27下午12:12:05 */ -public class ReportComponentComposite extends JComponent { +public class ReportComponentComposite extends JComponent implements RemoveListener { private static final int MAX = 400; private static final int HUND = 100; @@ -250,4 +251,9 @@ public class ReportComponentComposite extends JComponent { public void fireTargetModified() { parent.fireTargetModified(); } + + @Override + public void doRemoveAction() { + sheetNameTab.doRemoveAction(); + } } 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 747789cdb..74443e831 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 @@ -5,6 +5,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; @@ -27,6 +28,7 @@ import com.fr.base.vcs.DesignerMode; import com.fr.design.actions.UpdateAction; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.event.RemoveListener; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonUI; @@ -44,7 +46,6 @@ import com.fr.poly.PolyDesigner; import com.fr.report.poly.PolyWorkSheet; import com.fr.report.report.TemplateReport; import com.fr.report.worksheet.WorkSheet; -import com.fr.stable.ProductConstants; /** * NameTabPane of sheets @@ -52,7 +53,7 @@ import com.fr.stable.ProductConstants; * @editor zhou * @since 2012-3-26下午1:45:53 */ -public class SheetNameTabPane extends JComponent implements MouseListener, MouseMotionListener { +public class SheetNameTabPane extends JComponent implements MouseListener, MouseMotionListener, RemoveListener { private static final Color LINE_COLOR = new Color(0xababab); @@ -140,6 +141,10 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse private boolean isAuthorityEditing = false; + private ComponentListener listener; + + private DesignerFrame designerFrame; + public SheetNameTabPane(ReportComponentComposite reportCompositeX) { this.reportComposite = reportCompositeX; this.setLayout(new BorderLayout(0, 0)); @@ -203,14 +208,20 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse } } }); - - DesignerContext.getDesignerFrame().addComponentListener(new ComponentAdapter(){ + listener = new ComponentAdapter(){ @Override public void componentResized(ComponentEvent e) { for (int i = 0; i < lastOneIndex * NUM; i++) { moveLeft(); } } - }); + }; + designerFrame = DesignerContext.getDesignerFrame(); + designerFrame.addComponentListener(listener); + } + + @Override + public void doRemoveAction() { + designerFrame.removeComponentListener(listener); } private ActionListener createLeftButtonActionListener() { From 9826396544e64ed4015a1d46b4e0e3c10cdfee15 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 20 Mar 2020 09:42:57 +0800 Subject: [PATCH 132/375] REPORT-28447 && REPORT-28365 --- .../design/data/tabledata/tabledatapane/DBTableDataPane.java | 2 +- .../ui/designer/mobile/component/MobileBookMarkUsePane.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java index e7be5bf33..8b5a4e77f 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java @@ -240,7 +240,7 @@ public class DBTableDataPane extends AbstractTableDataPane { maxPanel.setBorder(null); JPanel wrapMaxPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); wrapMaxPanel.add(maxPanel); - wrapMaxPanel.setPreferredSize(new Dimension(250, 20)); + wrapMaxPanel.setPreferredSize(new Dimension(350, 20)); UIToolbar editToolBar = ToolBarDef.createJToolBar(); toolBarDef.updateToolBar(editToolBar); editToolBar.add(isShareCheckBox); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileBookMarkUsePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileBookMarkUsePane.java index fb4148629..703833069 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileBookMarkUsePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileBookMarkUsePane.java @@ -1,6 +1,7 @@ package com.fr.design.widget.ui.designer.mobile.component; import com.fr.design.designer.IntervalConstants; +import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreator; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icheckbox.UICheckBox; @@ -8,12 +9,11 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.form.ui.container.WLayout; import javax.swing.BorderFactory; import javax.swing.JPanel; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -77,6 +77,7 @@ public class MobileBookMarkUsePane extends BasicPane { public void update(XCreator xCreator) { WLayout wLayout = ((WLayout) xCreator.toData()); wLayout.setShowBookmarks(showHierarchicalBookmarksCheck.isSelected()); + WidgetPropertyPane.getInstance().getEditingFormDesigner().getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED); } @Override From 2835206968969e4b146dd5732a18865f30beba2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 20 Mar 2020 11:19:32 +0800 Subject: [PATCH 133/375] =?UTF-8?q?CHART-13049=20=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E4=B8=8B=E5=B8=83=E5=B1=80=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/data/table/SeriesTypeUseComboxPane.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java index 3779ff841..804ca541b 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java @@ -14,11 +14,13 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.design.utils.gui.GUICoreUtils; - -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; import java.util.ArrayList; import java.util.List; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; /** * 属性表: 柱形, 饼图 数据集界面, "系列名使用"界面. @@ -57,7 +59,7 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { this.add(cardPane, BorderLayout.CENTER); dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); JPanel panel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 290, 24, dataScreeningPane); - panel.setBorder(BorderFactory.createEmptyBorder(0,5,0,5)); + panel.setBorder(BorderFactory.createEmptyBorder(0,10,0,10)); dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,5,0,5)); this.add(panel, BorderLayout.SOUTH); } From aaa47a74c6215c43a436289ea10f58ec67ce1bf0 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 20 Mar 2020 14:53:03 +0800 Subject: [PATCH 134/375] =?UTF-8?q?REPORT-28459=20=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/DesignerFrame.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index b7fbae773..38d6a5efe 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -1110,7 +1110,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta int index = HistoryTemplateListCache.getInstance().contains(jt); List> historyList = HistoryTemplateListCache.getInstance().getHistoryList(); if (index != -1) { - historyList.get(index).activeJTemplate(index, jt); + JTemplate currentTemplate = historyList.get(index); + // 双击激活已经打开的模板之前 需要释放一下 + currentTemplate.whenClose(); + currentTemplate.activeJTemplate(index, jt); } else { this.addAndActivateJTemplate(jt); } From 047b1a2b44db871c4a76ced8bf1099fd99c27eaf Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 20 Mar 2020 14:55:52 +0800 Subject: [PATCH 135/375] =?UTF-8?q?REPORT-28459=20JWorkBook=E6=9C=AA?= =?UTF-8?q?=E9=87=8A=E6=94=BE=20=E5=9C=BA=E6=99=AF=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/DesignerFrame.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 31798e665..8d22f3f9f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -1126,7 +1126,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta int index = HistoryTemplateListCache.getInstance().contains(jt); List> historyList = HistoryTemplateListCache.getInstance().getHistoryList(); if (index != -1) { - historyList.get(index).activeJTemplate(index, jt); + JTemplate currentTemplate = historyList.get(index); + // 双击激活已经打开的模板之前 需要释放一下 + currentTemplate.whenClose(); + currentTemplate.activeJTemplate(index, jt); } else { this.addAndActivateJTemplate(jt); } From 38c8770933d676ff6ddfc164f29dfc51f9d586ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 20 Mar 2020 16:40:44 +0800 Subject: [PATCH 136/375] =?UTF-8?q?CHART-12820=20=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E8=BE=B9=E7=95=8C=E5=86=85=E7=BC=BA=E5=B0=91=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/chart/gui/type/MapPlotPane.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MapPlotPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MapPlotPane.java index 96cae8b43..a6c78de94 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MapPlotPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MapPlotPane.java @@ -71,6 +71,11 @@ public class MapPlotPane extends AbstractDeprecatedChartTypePane { } + @Override + public String getPlotID() { + return ChartConstants.MAP_CHART; + } + /** * 界面标题 * @return 界面标题 From 76aa8a08d36f5f07e9fe91941e9533b2c5e30064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 23 Mar 2020 14:27:14 +0800 Subject: [PATCH 137/375] =?UTF-8?q?CHART-13116=20=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=8C=B9=E9=85=8D=E6=97=B6=E6=8A=8A=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BD=AC=E6=8D=A2=E4=B8=BAString?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/chartx/component/MapAreaMatchPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index dee0355b8..ed260bf22 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -247,7 +247,7 @@ public class MapAreaMatchPane extends BasicBeanPane { HashSet columnData = new LinkedHashSet<>(); for (int i = 0; i < size; i++) { Object valueAt = dataModel.getValueAt(i, colIndex); - columnData.add(valueAt == null ? StringUtils.EMPTY : valueAt); + columnData.add(GeneralUtils.objectToString(valueAt)); } return columnData.toArray(); } catch (TableDataException ignore) { From 567c127a12662fb0336f20f5b9c9ac23508ae961 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 23 Mar 2020 15:03:13 +0800 Subject: [PATCH 138/375] =?UTF-8?q?REPORT-28459=20JWorkBook=20=E6=9C=AA?= =?UTF-8?q?=E9=87=8A=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 17 ++++++++-- .../fr/design/mainframe/DesignerFrame.java | 28 +++++----------- .../file/HistoryTemplateListCacheTest.java | 33 +++++++++++++++++++ 3 files changed, 56 insertions(+), 22 deletions(-) create mode 100644 designer-base/src/test/java/com/fr/design/file/HistoryTemplateListCacheTest.java diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 2f9a69b31..6568f458d 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -178,15 +178,28 @@ public class HistoryTemplateListCache implements CallbackEvent { * @return 位置 */ public int contains(JTemplate jt) { + return contains(jt, null); + } + + public int contains(FILE file) { + return contains(null, file); + } + + private int contains(JTemplate jt, FILE file) { + FILE item = null; + if (jt != null) { + item = jt.getEditingFILE(); + } else { + item = file; + } for (int i = 0; i < historyList.size(); i++) { - if (ComparatorUtils.equals(historyList.get(i).getEditingFILE(), jt.getEditingFILE())) { + if (ComparatorUtils.equals(historyList.get(i).getEditingFILE(), item)) { return i; } } return -1; } - /** * 判断是否打开过该模板 * 由于切换环境不会关闭模板,可能存在同名的模板,所以该方法不能准确找到所选的模板, diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 8d22f3f9f..e66515fe9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -1101,6 +1101,14 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ private void openFile(FILE tplFile) { + if (tplFile != null) { + int index = HistoryTemplateListCache.getInstance().contains(tplFile); + if (index != -1) { + HistoryTemplateListCache.getInstance().getHistoryList().get(index).activeOldJTemplate(); + return; + } + } + JTemplate jt = JTemplateFactory.createJTemplate(tplFile); if (jt == null) { return; @@ -1110,26 +1118,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta this.addAndActivateJTemplate(); MutilTempalteTabPane.getInstance().setTemTemplate( HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()); - } else { - activeTemplate(jt); - } - } - - /** - * 激活指定的模板 - * - * @param jt 当前报表 - * @date 2014-10-14-下午6:31:23 - */ - private void activeTemplate(JTemplate jt) { - // 如果该模板已经打开,则进行激活就可以了 - int index = HistoryTemplateListCache.getInstance().contains(jt); - List> historyList = HistoryTemplateListCache.getInstance().getHistoryList(); - if (index != -1) { - JTemplate currentTemplate = historyList.get(index); - // 双击激活已经打开的模板之前 需要释放一下 - currentTemplate.whenClose(); - currentTemplate.activeJTemplate(index, jt); } else { this.addAndActivateJTemplate(jt); } diff --git a/designer-base/src/test/java/com/fr/design/file/HistoryTemplateListCacheTest.java b/designer-base/src/test/java/com/fr/design/file/HistoryTemplateListCacheTest.java new file mode 100644 index 000000000..bd9f8484d --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/file/HistoryTemplateListCacheTest.java @@ -0,0 +1,33 @@ +package com.fr.design.file; + +import com.fr.design.mainframe.JTemplate; +import com.fr.file.FILE; +import com.fr.invoke.Reflect; +import junit.framework.TestCase; +import org.easymock.EasyMock; +import org.junit.Assert; + +import java.util.ArrayList; +import java.util.Arrays; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/23 + */ +public class HistoryTemplateListCacheTest extends TestCase { + + public void testContains() { + JTemplate jTemplate = EasyMock.mock(JTemplate.class); + FILE file = EasyMock.mock(FILE.class); + EasyMock.expect(jTemplate.getEditingFILE()).andReturn(file).anyTimes(); + EasyMock.replay(file); + EasyMock.replay(jTemplate); + Assert.assertEquals(-1, HistoryTemplateListCache.getInstance().contains(file)); + Assert.assertEquals(-1, HistoryTemplateListCache.getInstance().contains(jTemplate)); + Reflect.on(HistoryTemplateListCache.getInstance()).set("historyList", new ArrayList<>(Arrays.asList(jTemplate))); + Assert.assertEquals(0, HistoryTemplateListCache.getInstance().contains(file)); + Assert.assertEquals(0, HistoryTemplateListCache.getInstance().contains(jTemplate)); + } + +} \ No newline at end of file From 63d019cb6e6903e8fb26fd48705f3267ea29e5cd Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 23 Mar 2020 15:14:21 +0800 Subject: [PATCH 139/375] =?UTF-8?q?REPORT-28459=20JWorkBook=20=E6=9C=AA?= =?UTF-8?q?=E9=87=8A=E6=94=BE=20=E5=90=8C=E6=AD=A5=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 17 ++++++++-- .../fr/design/mainframe/DesignerFrame.java | 28 +++++----------- .../file/HistoryTemplateListCacheTest.java | 33 +++++++++++++++++++ 3 files changed, 56 insertions(+), 22 deletions(-) create mode 100644 designer-base/src/test/java/com/fr/design/file/HistoryTemplateListCacheTest.java diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 2f9a69b31..6568f458d 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -178,15 +178,28 @@ public class HistoryTemplateListCache implements CallbackEvent { * @return 位置 */ public int contains(JTemplate jt) { + return contains(jt, null); + } + + public int contains(FILE file) { + return contains(null, file); + } + + private int contains(JTemplate jt, FILE file) { + FILE item = null; + if (jt != null) { + item = jt.getEditingFILE(); + } else { + item = file; + } for (int i = 0; i < historyList.size(); i++) { - if (ComparatorUtils.equals(historyList.get(i).getEditingFILE(), jt.getEditingFILE())) { + if (ComparatorUtils.equals(historyList.get(i).getEditingFILE(), item)) { return i; } } return -1; } - /** * 判断是否打开过该模板 * 由于切换环境不会关闭模板,可能存在同名的模板,所以该方法不能准确找到所选的模板, diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 38d6a5efe..dd31d8322 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -1085,6 +1085,14 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ private void openFile(FILE tplFile) { + if (tplFile != null) { + int index = HistoryTemplateListCache.getInstance().contains(tplFile); + if (index != -1) { + HistoryTemplateListCache.getInstance().getHistoryList().get(index).activeOldJTemplate(); + return; + } + } + JTemplate jt = JTemplateFactory.createJTemplate(tplFile); if (jt == null) { return; @@ -1094,26 +1102,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta this.addAndActivateJTemplate(); MutilTempalteTabPane.getInstance().setTemTemplate( HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()); - } else { - activeTemplate(jt); - } - } - - /** - * 激活指定的模板 - * - * @param jt 当前报表 - * @date 2014-10-14-下午6:31:23 - */ - private void activeTemplate(JTemplate jt) { - // 如果该模板已经打开,则进行激活就可以了 - int index = HistoryTemplateListCache.getInstance().contains(jt); - List> historyList = HistoryTemplateListCache.getInstance().getHistoryList(); - if (index != -1) { - JTemplate currentTemplate = historyList.get(index); - // 双击激活已经打开的模板之前 需要释放一下 - currentTemplate.whenClose(); - currentTemplate.activeJTemplate(index, jt); } else { this.addAndActivateJTemplate(jt); } diff --git a/designer-base/src/test/java/com/fr/design/file/HistoryTemplateListCacheTest.java b/designer-base/src/test/java/com/fr/design/file/HistoryTemplateListCacheTest.java new file mode 100644 index 000000000..bd9f8484d --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/file/HistoryTemplateListCacheTest.java @@ -0,0 +1,33 @@ +package com.fr.design.file; + +import com.fr.design.mainframe.JTemplate; +import com.fr.file.FILE; +import com.fr.invoke.Reflect; +import junit.framework.TestCase; +import org.easymock.EasyMock; +import org.junit.Assert; + +import java.util.ArrayList; +import java.util.Arrays; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/23 + */ +public class HistoryTemplateListCacheTest extends TestCase { + + public void testContains() { + JTemplate jTemplate = EasyMock.mock(JTemplate.class); + FILE file = EasyMock.mock(FILE.class); + EasyMock.expect(jTemplate.getEditingFILE()).andReturn(file).anyTimes(); + EasyMock.replay(file); + EasyMock.replay(jTemplate); + Assert.assertEquals(-1, HistoryTemplateListCache.getInstance().contains(file)); + Assert.assertEquals(-1, HistoryTemplateListCache.getInstance().contains(jTemplate)); + Reflect.on(HistoryTemplateListCache.getInstance()).set("historyList", new ArrayList<>(Arrays.asList(jTemplate))); + Assert.assertEquals(0, HistoryTemplateListCache.getInstance().contains(file)); + Assert.assertEquals(0, HistoryTemplateListCache.getInstance().contains(jTemplate)); + } + +} \ No newline at end of file From b5c6415475c407b49c1cabf048c07f9a96915ec3 Mon Sep 17 00:00:00 2001 From: Kara Date: Mon, 23 Mar 2020 16:28:20 +0800 Subject: [PATCH 140/375] REPORT-28202 && REPORT-28259 && REPORT-27271 && REPORT-28036 --- .../com/fr/design/data/DesignTableDataManager.java | 9 +++++++++ .../tabledata/wrapper/AbstractTableDataWrapper.java | 13 ++++++++++--- .../fr/design/file/HistoryTemplateListCache.java | 3 +-- .../src/main/java/com/fr/start/BaseDesigner.java | 2 -- .../fr/design/data/DesignTableDataManagerTest.java | 9 +++++++++ 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index a84e1337b..dc7002fa8 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -248,6 +248,15 @@ public abstract class DesignTableDataManager { } } + public static String[] getDsColumnNames(String dsName) { + TableDataSource dataSource = getEditingTableDataSource(); + Map map = columnCache.get(dataSource); + if (map == null) { + return new String[0]; + } + return map.get(dsName); + } + /** * august:返回当前正在编辑的具有报表数据源的模板(基本报表、聚合报表) 包括 : 图表模板 * diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java index 812eb25af..a5d20cfcf 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java @@ -50,10 +50,11 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter(); TableDataSource tds = adapter == null ? null : adapter.getBook(); String[] colNames = tabledata.getColumnNames(tds); + String[] colNamesInCache = DesignTableDataManager.getDsColumnNames(name); if(ArrayUtils.isNotEmpty(colNames)){ - columnNameList = new ArrayList(); - columnNameList.addAll(Arrays.asList(colNames)); - return columnNameList; + return toColumnNameList(colNames); + } else if (ArrayUtils.isNotEmpty(colNamesInCache)) { + return toColumnNameList(colNames); } EmbeddedTableData embeddedTableData = null; @@ -69,6 +70,12 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { return columnNameList; } + private List toColumnNameList(String[] colNames) { + columnNameList = new ArrayList<>(); + columnNameList.addAll(Arrays.asList(colNames)); + return columnNameList; + } + /** * 生成子节点 * diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 6568f458d..f8b089fe6 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -407,8 +407,7 @@ public class HistoryTemplateListCache implements CallbackEvent { JTemplate jt = getCurrentEditingTemplate(); boolean access = jt != null && jt.getEditingFILE() != null && jt.getEditingFILE().exists(); if (access) { - closeSelectedReport(jt); - DesignerContext.getDesignerFrame().openTemplate(jt.getEditingFILE()); + jt.refreshResource(); } } diff --git a/designer-base/src/main/java/com/fr/start/BaseDesigner.java b/designer-base/src/main/java/com/fr/start/BaseDesigner.java index ba231a335..90ac634ce 100644 --- a/designer-base/src/main/java/com/fr/start/BaseDesigner.java +++ b/designer-base/src/main/java/com/fr/start/BaseDesigner.java @@ -3,7 +3,6 @@ */ package com.fr.start; -import com.fr.common.detect.CommonPortDetector; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.constants.DesignerLaunchStatus; @@ -77,7 +76,6 @@ public abstract class BaseDesigner extends ToolBarMenuDock { public void on(Event event, Null param) { EventDispatcher.stopListen(this); collectUserInformation(); - CommonPortDetector.getInstance().execute(); } }); } diff --git a/designer-base/src/test/java/com/fr/design/data/DesignTableDataManagerTest.java b/designer-base/src/test/java/com/fr/design/data/DesignTableDataManagerTest.java index c6675da0d..9a5ce7b8c 100644 --- a/designer-base/src/test/java/com/fr/design/data/DesignTableDataManagerTest.java +++ b/designer-base/src/test/java/com/fr/design/data/DesignTableDataManagerTest.java @@ -9,6 +9,7 @@ import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.file.ProcedureConfig; import com.fr.file.TableDataConfig; import com.fr.invoke.Reflect; +import com.fr.stable.ArrayUtils; import org.easymock.EasyMock; import org.junit.Assert; import org.junit.Test; @@ -146,4 +147,12 @@ public class DesignTableDataManagerTest { "columnCache").get(); Assert.assertEquals(new String[]{"a", "b", "c"}, map.get(null).get("ds1")); } + + @Test + public void testGetDsColumnNames() { + Assert.assertTrue(ArrayUtils.isEmpty(DesignTableDataManager.getDsColumnNames("ds1"))); + String[] columnNames = new String[]{"a", "b", "c"}; + DesignTableDataManager.addDsColumnNames("ds1", new String[]{"a", "b", "c"}); + Assert.assertEquals(columnNames, DesignTableDataManager.getDsColumnNames("ds1")); + } } From 7364fd157bb742d1ccc7e9bb47d15d4d15b327ae Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 24 Mar 2020 14:14:30 +0800 Subject: [PATCH 141/375] CHART-13168 && REPORT-27122 --- .../data/tabledata/wrapper/AbstractTableDataWrapper.java | 2 +- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java index a5d20cfcf..82022bea6 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java @@ -54,7 +54,7 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { if(ArrayUtils.isNotEmpty(colNames)){ return toColumnNameList(colNames); } else if (ArrayUtils.isNotEmpty(colNamesInCache)) { - return toColumnNameList(colNames); + return toColumnNameList(colNamesInCache); } EmbeddedTableData embeddedTableData = null; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index e66515fe9..6d9dc3b61 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -1141,8 +1141,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta Thread.currentThread().interrupt(); } - DesignerEnvManager.getEnvManager().setLastOpenFile( - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath()); + JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (jt != null) { + DesignerEnvManager.getEnvManager().setLastOpenFile(jt.getEditingFILE().getPath()); + } DesignerEnvManager.getEnvManager().setLastWestRegionToolPaneY( WestRegionContainerPane.getInstance().getToolPaneY()); From fe01323af02935a217b9781c82d6c33063d39a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 24 Mar 2020 17:29:49 +0800 Subject: [PATCH 142/375] =?UTF-8?q?CHART-13072=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=B8=AD=E6=9F=A5=E8=AF=A2=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84=E6=97=B6=E5=80=99=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=B8=BAFR=E9=A2=84=E8=A7=88=E6=95=B0=E6=8D=AE=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chartx/component/MapAreaMatchPane.java | 59 ++++++++----------- 1 file changed, 23 insertions(+), 36 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index ed260bf22..41202061c 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -1,40 +1,34 @@ package com.fr.design.chartx.component; import com.fr.base.BaseUtils; -import com.fr.base.ParameterMapNameSpace; import com.fr.chartx.TwoTuple; -import com.fr.chartx.data.execute.ExecuteDataSetHelper; import com.fr.data.TableDataSource; import com.fr.data.TableDataSourceTailor; -import com.fr.data.core.DataCoreUtils; +import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.NameTableData; import com.fr.design.beans.BasicBeanPane; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataComboBox; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; -import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper; -import com.fr.design.parameter.ParameterInputPane; +import com.fr.general.ComparatorUtils; import com.fr.general.GeneralUtils; import com.fr.general.data.DataModel; -import com.fr.general.data.TableDataException; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.map.data.MapMatchResult; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import com.fr.script.Calculator; -import com.fr.stable.ArrayUtils; -import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JPanel; import javax.swing.JScrollPane; -import javax.swing.SwingUtilities; import javax.swing.table.DefaultTableModel; import javax.swing.tree.DefaultMutableTreeNode; import java.util.HashMap; @@ -214,47 +208,40 @@ public class MapAreaMatchPane extends BasicBeanPane { private Object[] getColumnData(String tableName, String columnName) { NameTableData nameTableData = new NameTableData(tableName); - TableDataSource dataSource = TableDataSourceTailor.extractTableData(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getTarget()); + TableDataSource dataSource = TableDataSourceTailor.extractTableData(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget()); Calculator calculator = Calculator.createCalculator(); calculator.setAttribute(TableDataSource.KEY, dataSource); - ParameterProvider[] parameters = nameTableData.getParameters(calculator); - final Map parameterMap = new HashMap<>(); - - if (ArrayUtils.isNotEmpty(parameters)) { - final ParameterInputPane pPane = new ParameterInputPane(parameters); - pPane.showSmallWindow(SwingUtilities.getWindowAncestor(this), new DialogActionAdapter() { - @Override - public void doOk() { - parameterMap.putAll(pPane.update()); - } - }).setVisible(true); - } - for (ParameterProvider parameter : parameters) { - if (parameterMap.containsKey(parameter.getName())) { - parameter.setValue(parameterMap.get(parameter.getName())); - } - } - ParameterMapNameSpace parameterMapNameSpace = ParameterMapNameSpace.create(parameterMap); - calculator.pushNameSpace(parameterMapNameSpace); - + nameTableData.createTableData(calculator); try { - DataModel dataModel = ExecuteDataSetHelper.createDataModel(calculator, nameTableData); - int colIndex = DataCoreUtils.getColumnIndexByName(dataModel, columnName); + EmbeddedTableData tableData = DesignTableDataManager.previewTableDataNeedInputParameters(dataSource, nameTableData, Integer.MAX_VALUE, false); + int colIndex = getColIndex(tableData, columnName); if (colIndex == DataModel.COLUMN_NAME_NOT_FOUND) { return null; } - int size = dataModel.getRowCount(); + int size = tableData.getRowCount(); HashSet columnData = new LinkedHashSet<>(); for (int i = 0; i < size; i++) { - Object valueAt = dataModel.getValueAt(i, colIndex); + Object valueAt = tableData.getValueAt(i, colIndex); columnData.add(GeneralUtils.objectToString(valueAt)); } return columnData.toArray(); - } catch (TableDataException ignore) { + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); return null; } } + private int getColIndex(EmbeddedTableData tableData, String columnName) { + int colIndex = 0; + + for (int count = tableData.getColumnCount(); colIndex < count; ++colIndex) { + if (ComparatorUtils.tableDataColumnNameEquals(tableData.getColumnName(colIndex), columnName)) { + return colIndex; + } + } + return DataModel.COLUMN_NAME_NOT_FOUND; + } + private void populateMatchData(Object[] columnData) { Set geoAreas = matchAreaTable.getItems(); From 2f42c6c52ae82ed619f0ea861041047db79b7898 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 24 Mar 2020 17:46:29 +0800 Subject: [PATCH 143/375] =?UTF-8?q?REPORT-28368=20=E6=AD=BB=E9=94=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20=E5=B8=B8=E9=87=8F=E4=B8=8D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=AF=8F=E6=AC=A1=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/loghandler/DesignerLogHandler.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java index 57d1d457f..5937770c4 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java @@ -53,6 +53,12 @@ public class DesignerLogHandler { private static final int SERVER_GAP_Y = -20; + private static final String ERROR_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert") + ":"; + + private static final String WARN_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Seriously") + ":"; + + private static final String NORMAL_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Normal") + ":"; + public static DesignerLogHandler getInstance() { return HOLDER.singleton; @@ -310,11 +316,11 @@ public class DesignerLogHandler { private String appendLocaleMark(String str, int style) { if (style == DesignerLogger.ERROR_INT) { - str = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert") + ":" + str + "\n"; + str = ERROR_MARK + str + "\n"; } else if (style == DesignerLogger.WARN_INT) { - str = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Seriously") + ":" + str + "\n"; + str = WARN_MARK + str + "\n"; } else { - str = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Normal") + ":" + str + "\n"; + str = NORMAL_MARK + str + "\n"; } return str; } From 2ac41d22f71d91eab15690a4f156a9cea9491409 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 25 Mar 2020 10:40:43 +0800 Subject: [PATCH 144/375] =?UTF-8?q?=E5=90=88=E4=BB=A3=E7=A0=81=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file/export/AbstractExportAction.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java b/designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java index 4f8424c41..5277d2ebf 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java @@ -2,6 +2,7 @@ package com.fr.design.actions.file.export; import com.fr.design.actions.JTemplateAction; import com.fr.design.base.mode.DesignModeContext; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.iprogressbar.FRProgressBar; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; @@ -132,10 +133,10 @@ public abstract class AbstractExportAction> extends JT E e = getEditingComponent(); if (!e.isALLSaved() && !DesignModeContext.isVcsMode()) { e.stopEditing(); - int returnVal = JOptionPane.showConfirmDialog( + int returnVal = FineJOptionPane.showConfirmDialog( DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + e.getEditingFILE() + "\" ?", - ProductConstants.PRODUCT_NAME, + Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE ); @@ -171,30 +172,30 @@ public abstract class AbstractExportAction> extends JT this.setProgress(100); FineLoggerFactory.getLogger().info("\"" + name + "\"" + Toolkit.i18nText("Fine-Design_Report_Finish_Export") + "!"); - JOptionPane.showMessageDialog( + FineJOptionPane.showMessageDialog( DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Report_Exported_Successfully") + "\n" + name); } catch (RemoteDesignPermissionDeniedException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); this.setProgress(100); target.closeTemplate(); - JOptionPane.showMessageDialog( + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineJOptionPane.showMessageDialog( DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Engine_Remote_Design_Permission_Denied"), - UIManager.getString("OptionPane.messageDialogTitle"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon") ); } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); this.setProgress(100); target.closeTemplate(); - JOptionPane.showMessageDialog( + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineJOptionPane.showMessageDialog( DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Report_Export_Failed") + "\n" + path, - UIManager.getString("OptionPane.messageDialogTitle"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon") ); From e215b36f5e43ef1fce974ab9cf33f0b36ce3a9c5 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 25 Mar 2020 14:26:09 +0800 Subject: [PATCH 145/375] REPORT-28257 && REPORT-28257 --- .../com/fr/design/formula/FunctionManagerPane.java | 6 ++++-- .../com/fr/design/write/submit/CustomJobPane.java | 2 +- .../main/java/com/fr/start/DesignerLauncher.java | 1 + .../src/main/java/com/fr/start/FineDesigner.java | 14 ++++++++++++++ 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 designer-realize/src/main/java/com/fr/start/FineDesigner.java diff --git a/designer-base/src/main/java/com/fr/design/formula/FunctionManagerPane.java b/designer-base/src/main/java/com/fr/design/formula/FunctionManagerPane.java index 3d56dd925..c40a917e3 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FunctionManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FunctionManagerPane.java @@ -142,8 +142,10 @@ public class FunctionManagerPane extends BasicPane { editorButton.setPreferredSize(new Dimension(editorButton.getPreferredSize().width, classNameTextField.getPreferredSize().height)); reportletNamePane.add(editorButton); editorButton.addActionListener(createEditorButtonActionListener()); - northPane.add(GUICoreUtils.createFlowPane(new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Class_Name") + ":"), - reportletNamePane}, FlowLayout.LEFT)); + JPanel classNamePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + classNamePane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Class_Name") + ":"), BorderLayout.NORTH); + classNamePane.add(reportletNamePane, BorderLayout.CENTER); + northPane.add(classNamePane); DescriptionTextArea descriptionArea = new DescriptionTextArea(); descriptionArea.setWrapStyleWord(true); descriptionArea.setLineWrap(true); diff --git a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java index fcb272dd5..d07d42b3e 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java @@ -29,7 +29,7 @@ import java.awt.event.ActionListener; public abstract class CustomJobPane extends BasicBeanPane { protected UITextField classNameTextField; protected ObjectProperiesPane objectProperiesPane; - public static final int DEFAULT_LENGTH = 30; + private static final int DEFAULT_LENGTH = 25; public CustomJobPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); diff --git a/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java b/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java index 9e98fcb40..90ebc1a31 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerLauncher.java @@ -46,6 +46,7 @@ public class DesignerLauncher { jvmSettings(DesignerJavaRuntime.getInstance().getJvmOptions()). arguments(args). directory(BIN_HOME). + entryPackage(FineDesigner.class). startProcess(DesignerProcessType.INSTANCE); DesignerSuperListener.getInstance().start(); } diff --git a/designer-realize/src/main/java/com/fr/start/FineDesigner.java b/designer-realize/src/main/java/com/fr/start/FineDesigner.java new file mode 100644 index 000000000..a3e202308 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/start/FineDesigner.java @@ -0,0 +1,14 @@ +package com.fr.start; + +import com.fr.process.engine.core.FineProcessEntry; + +/** + * 包装类 改变子进程的进程名 + * + * @author hades + * @version 10.0 + * Created by hades on 2020/3/24 + */ +public class FineDesigner extends FineProcessEntry { + +} From fc9c029ec720f7402429dc0b21fcea29fbc71359 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 25 Mar 2020 19:45:56 +0800 Subject: [PATCH 146/375] =?UTF-8?q?REPORT-28368=20=E6=AD=BB=E9=94=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20=E5=B8=B8=E9=87=8F=E4=B8=8D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=AF=8F=E6=AC=A1=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/os/impl/SupportOSImpl.java | 14 ++++++++++ .../resources/com/fr/design/icon/logo.png | Bin 0 -> 2478 bytes .../src/main/java/com/fr/start/Designer.java | 4 ++- .../com/fr/start/DesignerJavaRuntime.java | 26 ++++++++++++++++-- 4 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/icon/logo.png diff --git a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java index 2518ef57c..f6c0e3054 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java @@ -83,6 +83,20 @@ public enum SupportOSImpl implements SupportOS { public boolean support() { return OperatingSystem.isMacos(); } + }, + + NON_GUARDIAN_START { + @Override + public boolean support() { + return OperatingSystem.isLinux() || Arch.getArch() == Arch.ARM; + } + }, + + DOCK_ICON { + @Override + public boolean support() { + return OperatingSystem.isMacos(); + } } } diff --git a/designer-base/src/main/resources/com/fr/design/icon/logo.png b/designer-base/src/main/resources/com/fr/design/icon/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..d4c7d8b24d0c6dc5c2792e5749f70a2e1b3e54b5 GIT binary patch literal 2478 zcmb_eX;_n27CuQZp~zw>DhLvkQE)3*6tocd#JJ!Z6;T0Md{hun+)yBpd}9@?&L~5b zT53$j(UGDBt1JRSqKH;eK?H#ygoq+2A#4(|k=`5U&-BrM{c)f3e&^itp5<=e_nbA$ zEX*dE0f0roa`t)v3W5|cr6Uo#KW8Vv7YPCEMS+P@MJp@bA;D47KW)Y0zY~oa$B$f_ za(; zlRg?cm-HG=>7t0Fq1J)j`$axG778baiz6FXFqQAy(bN(bcfA+gyOLIQT`)7RJAQRl zEz;)d5+Z^bhKPN+{8HN+$}4;NC?bt6FfmfI=0ixi>f{E!_Xh6~;OvGjx3$kE>wEsW zEvG`Dxx*l13N}X@7zV%U8k@?Ys`{5NX(Y9(vTbv2YIEaCL>H zFPM<64j+D$#S}bmIqS#+Q}7P1I$UIXK76L14#vS!JDq{G$$a(tli1b$?r?wI$qnTq z22dp?!WXeodZ~pU;&2I5id&}u= zLE3CVvxFrkq7<=MPA890YkO1o+@gqbpx{PXnmwE_m7tAf;b~-1{^JgvyhyEG<7OWR zu2bQS)DTn}bDbhO4hOSN*~NhCY`7yHWIz?&sXRKz$nyMs+9Wt(M$8KFsK+_^ZuvG& zge?c_w$Ln4DiSjSTnFq3&nTmMGu0fHRG9QpIpEr7M-)XP?X4*AvX}=pDo4p~$7zS8?~dv8GTl=%>X$sR0wE3MnIJh!9^vNFH19w`)Ov?4uycSa8 zPD5A4I5g0;@mT=2odU}BrUgPly~)pIs(ApSoYa)TF#rViG(qFfpwj#^>EIlpoj(tS zvj%YbYXr`MiiXoCfNeB7HdGSXJ|WNr36O!j{u+U*`Tu5;sd<7qp5JzRXGa`RT|n3J zf5($6Em{KOaH0?)!VacrkZ61ce7e7X?l?ryh|5|##6r|&2k@8})Mx6JVctkemki5s zD(i?ZktANOBxAAS?gh$_8{PoNxpa31l1_1IOaY6yNxU5s5Fl#96ut}0v8i({8Een2 z!5gL@x;h(i>i1Z*TR45E-nC>DR+uO*Z{Lfj6SWV>^h)^#1mW)2l+oQDkC9R`p2P}& z&jSe`ToEA8T`?Rs+)|l)pzOXNYp{{c(udpLwnWIO#~Tc{?a(XcbpM&(!x|jmxca%Q zqw}n`2B&SRrPhjDurtR{W*GZj2hxGRuU01hpq29R$8W*5=cOr1%prO@mS3SXPseov zJEfP;do%RnV?7C}N|^vZH#ouqjgh*(_-C0K&*i8#@(t3qHe&(h*)`&((T`Y=rRy}@ z9%wgqY;L$p-y8iuI(4)1>NC}aNVMMX_I4J{mAyK~Y`&Ky!1o4}u{Hl;r~{Lx)EY zbm7+@z$cOx#1Jk!8@wvkH(&}FY zVeYj6lGhW4&M>=E1~w(DV!efed05xPe=bhg9=SKy!@==fZ+YX4?J+z2Y-7-gG51ns z>VgkM?oC0DZ82MP_$~)6mp3o^?fq4m{61;p)%4u5iQe5;==K0j!-e|Ri#0BWg0`^T zZ)S`|7Zv%W_f`G`8oy+u`03-&t*l^Kc?oY}`vrhk)Y?@8h1=TmC-U90tlr)}V}5Gm z`)r1;mMmCTC~{|=0p3sBpWwo>5Nmaz0i+Hs5o+yW5W+Ac|JG9KH_h*F{(TA b<=S4uzIAu2m_gHz;`RkBS;Nlrk2vxN5SNVE literal 0 HcmV?d00001 diff --git a/designer-realize/src/main/java/com/fr/start/Designer.java b/designer-realize/src/main/java/com/fr/start/Designer.java index fb974da98..1f8d181ce 100644 --- a/designer-realize/src/main/java/com/fr/start/Designer.java +++ b/designer-realize/src/main/java/com/fr/start/Designer.java @@ -1,5 +1,6 @@ package com.fr.start; +import com.fr.design.os.impl.SupportOSImpl; import com.fr.log.FineLoggerFactory; /** @@ -14,7 +15,8 @@ public class Designer { public static void main(String[] args) { try { - if (DesignerJavaRuntime.getInstance().isInValidVmOptions()) { + if (DesignerJavaRuntime.getInstance().isInValidVmOptions() + || SupportOSImpl.NON_GUARDIAN_START.support()) { runNonGuardianDesigner(args); } else { // 创建进程 diff --git a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java index c264e79cb..ed7553620 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java @@ -1,12 +1,18 @@ package com.fr.start; +import com.fr.design.os.impl.SupportOSImpl; import com.fr.general.ComparatorUtils; +import com.fr.general.IOUtils; import com.fr.process.engine.core.AbstractJavaRuntime; +import com.fr.stable.ArrayUtils; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.os.OperatingSystem; -import java.util.Set; +import javax.imageio.ImageIO; +import java.io.File; +import java.io.IOException; + /** * 设计器Java运行环境 @@ -23,8 +29,20 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { private static final String JAVA_EXEC = "java"; private static final String WIN_JRE_BIN = StableUtils.pathJoin("jre", "bin"); private static final String MAC_JRE_BIN = StableUtils.pathJoin("jre.bundle", "Contents", "Home", "jre", "bin"); + private static final String BIN_HOME = StableUtils.pathJoin(StableUtils.getInstallHome(), "bin"); + private static final String LOGO_PATH = StableUtils.pathJoin(BIN_HOME, "logo.png"); + private static final String DOCK_OPTIONS = "-Xdock:icon=" + StableUtils.pathJoin(StableUtils.getInstallHome(), "bin", "logo.png"); private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m"}; + static { + if (SupportOSImpl.DOCK_ICON.support()) { + try { + ImageIO.write(IOUtils.readImage("com/fr/design/icon/logo.png"), "png", new File(LOGO_PATH)); + } catch (IOException ignore) { + } + } + } + private static final DesignerJavaRuntime INSTANCE = new DesignerJavaRuntime(); public static DesignerJavaRuntime getInstance() { @@ -79,7 +97,11 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { @Override public String[] getJvmOptions() { if (isInstallVersion()) { - return super.getJvmOptions(); + String[] options = super.getJvmOptions(); + if (SupportOSImpl.DOCK_ICON.support()) { + options = ArrayUtils.add(options, DOCK_OPTIONS); + } + return options; } else { return DEBUG_OPTIONS; } From a4584870bd2fa7b88e18d18c7233ffbd7e341208 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 25 Mar 2020 19:52:24 +0800 Subject: [PATCH 147/375] =?UTF-8?q?REPORT-28186=20mac=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E7=9F=AD=E6=9A=82=E5=8E=9F=E7=94=9Fjava=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/DesignerJavaRuntime.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java index ed7553620..6b0c45eab 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java @@ -31,7 +31,7 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { private static final String MAC_JRE_BIN = StableUtils.pathJoin("jre.bundle", "Contents", "Home", "jre", "bin"); private static final String BIN_HOME = StableUtils.pathJoin(StableUtils.getInstallHome(), "bin"); private static final String LOGO_PATH = StableUtils.pathJoin(BIN_HOME, "logo.png"); - private static final String DOCK_OPTIONS = "-Xdock:icon=" + StableUtils.pathJoin(StableUtils.getInstallHome(), "bin", "logo.png"); + private static final String DOCK_OPTIONS = "-Xdock:icon=" + LOGO_PATH; private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m"}; static { From d5e6daeff9f43d8f3c8d3ac3987138a0c5a2bb44 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 26 Mar 2020 14:55:42 +0800 Subject: [PATCH 148/375] =?UTF-8?q?CHART-13063=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=AF=95=E7=AE=A1=E4=BB=AA=E8=A1=A8=E7=9B=98=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/gauge/VanChartGaugeSeriesPane.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 ff6a62f92..c4ce90edc 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 @@ -74,7 +74,18 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { private JPanel createGaugeLayoutPane() { gaugeLayout = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical")}); - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Report_Page_Setup_Orientation"),gaugeLayout); + + String title = Toolkit.i18nText("Fine-Design_Report_Page_Setup_Orientation"); + + if (plot instanceof VanChartGaugePlot) { + VanChartGaugePlot gaugePlot = (VanChartGaugePlot) plot; + + if (gaugePlot.getGaugeStyle() == GaugeStyle.THERMOMETER) { + title = Toolkit.i18nText("Fine-Design_Report_Page_Setup_Sort_Orientation"); + } + } + + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(title, gaugeLayout); gaugeLayout.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { From 29c32eaee54feafbaa604b8733be0aebec2ee0f2 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 26 Mar 2020 15:44:21 +0800 Subject: [PATCH 149/375] =?UTF-8?q?CHART-13065=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E9=97=B4=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/style/label/VanChartGaugeLabelDetailPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ff510c708..bbdb6acb3 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 @@ -30,6 +30,7 @@ import java.awt.Dimension; */ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { + private static final int TEXT_FONT_PANE_HEIGHT = 50; private GaugeStyle gaugeStyle; private UIButtonGroup align; private JPanel alignPane; @@ -198,7 +199,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { protected void checkStyleUse() { textFontPane.setVisible(true); - textFontPane.setPreferredSize(new Dimension(0, 60)); + textFontPane.setPreferredSize(new Dimension(0, TEXT_FONT_PANE_HEIGHT)); } protected boolean hasLabelAlign(Plot plot) { From 4c897370947ec0832b53b58b59a364ded8dcd351 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 26 Mar 2020 15:51:27 +0800 Subject: [PATCH 150/375] REPORT-27106 && REPORT-27144 --- .../com/fr/design/DesignerEnvManager.java | 20 +++++++++++++++++++ .../java/com/fr/design/dialog/TipDialog.java | 8 +++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 81211cc57..d94605d42 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -8,18 +8,21 @@ import com.fr.base.Utils; import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; +import com.fr.design.dialog.ErrorDialog; import com.fr.design.env.DesignerWorkspaceGenerator; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceType; import com.fr.design.env.LocalDesignerWorkspaceInfo; import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.i18n.Toolkit; import com.fr.design.locale.impl.ProductImproveMark; import com.fr.design.mainframe.vcs.VcsConfigManager; import com.fr.design.update.push.DesignerPushUpdateConfigManager; import com.fr.design.style.color.ColorSelectConfigManager; import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignerPort; +import com.fr.exit.DesignerExiter; import com.fr.file.FILEFactory; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogFormatter; @@ -345,6 +348,23 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } catch (IOException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + ErrorDialog dialog = new ErrorDialog(null, + Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), + Toolkit.i18nText("Fine-Design_Error_Start_Report"), + e.getMessage()) { + @Override + protected void okEvent() { + dispose(); + DesignerExiter.getInstance().execute(); + } + + @Override + protected void restartEvent() { + dispose(); + RestartHelper.restart(); + } + }; + dialog.setVisible(true); } finally { if (null != fileWriter) { try { diff --git a/designer-base/src/main/java/com/fr/design/dialog/TipDialog.java b/designer-base/src/main/java/com/fr/design/dialog/TipDialog.java index e4cf0c8e7..894f4e45b 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/TipDialog.java +++ b/designer-base/src/main/java/com/fr/design/dialog/TipDialog.java @@ -8,6 +8,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.IOUtils; import javax.swing.*; +import javax.swing.text.BadLocationException; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; @@ -39,7 +40,12 @@ public abstract class TipDialog extends JDialog implements ActionListener { northPane.add(iconPane, BorderLayout.WEST); northPane.add(tipPane, BorderLayout.CENTER); - JTextArea area = new JTextArea(type); + JTextPane area = new JTextPane(); + UILabel typeLabel = new UILabel(type); + area.insertComponent(typeLabel); + UILabel logoIconLabel = new UILabel(); + logoIconLabel.setIcon(IOUtils.readIcon("com/fr/base/images/oem/logo.png")); + area.insertComponent(logoIconLabel); area.setPreferredSize(new Dimension(400, 100)); area.setEnabled(true); area.setEditable(false); From 91c9b0535d35dbdb087e44c7052e9b450659412f Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 26 Mar 2020 15:54:18 +0800 Subject: [PATCH 151/375] fix import --- designer-base/src/main/java/com/fr/design/dialog/TipDialog.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/dialog/TipDialog.java b/designer-base/src/main/java/com/fr/design/dialog/TipDialog.java index 894f4e45b..cb2adb527 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/TipDialog.java +++ b/designer-base/src/main/java/com/fr/design/dialog/TipDialog.java @@ -8,7 +8,6 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.IOUtils; import javax.swing.*; -import javax.swing.text.BadLocationException; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; From c4e900ef74eca06bf917ff59f23987f1f4225139 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 26 Mar 2020 16:19:14 +0800 Subject: [PATCH 152/375] =?UTF-8?q?CHART-13064=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=90=AB=E6=9C=89=E8=87=AA=E5=8A=A8button=E7=9A=84=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E9=80=89=E6=8B=A9=E5=99=A8=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/color/ColorControlWindowWithAuto.java | 10 ++++++++++ .../fr/design/style/color/NewColorSelectPane.java | 12 ++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java b/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java index 05da3d4b9..cbb0e97ea 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorControlWindowWithAuto.java @@ -16,6 +16,7 @@ import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -46,6 +47,8 @@ public abstract class ColorControlWindowWithAuto extends ColorControlWindow { class ColorSelectionPopupPaneWithAuto extends NewColorSelectPane { private static final long serialVersionUID = 7822856562329146354L; + private final static int BUTTON_HEIGHT = 15; + public ColorSelectionPopupPaneWithAuto(boolean isSupportTransparent) { super(isSupportTransparent); @@ -111,6 +114,13 @@ public abstract class ColorControlWindowWithAuto extends ColorControlWindow { } } + public Dimension getPreferredSize() { + if (isSupportTransparent()) { + return new Dimension(super.getPreferredSize().width, TRANSPARENT_WINDOW_HEIGHT + BUTTON_HEIGHT); + } + return new Dimension(super.getPreferredSize().width, WINDOW_HEIGHT + BUTTON_HEIGHT); + } + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index e823f3061..6c21c10cb 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -40,8 +40,8 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { // 是否支持透明 private boolean isSupportTransparent; - private final static int TRANSPANENT_WINDOW_HEIGHT = 165; - private final static int WINDWO_HEIGHT = 150; + public final static int TRANSPARENT_WINDOW_HEIGHT = 165; + public final static int WINDOW_HEIGHT = 150; // 最近使用颜色 private UsedColorPane usedColorPane; @@ -105,6 +105,10 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { centerPane.add(centerPane1); } + public boolean isSupportTransparent() { + return isSupportTransparent; + } + public void setSupportTransparent(boolean supportTransparent) { isSupportTransparent = supportTransparent; } @@ -208,9 +212,9 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { @Override public Dimension getPreferredSize() { if (isSupportTransparent) { - return new Dimension(super.getPreferredSize().width, TRANSPANENT_WINDOW_HEIGHT); + return new Dimension(super.getPreferredSize().width, TRANSPARENT_WINDOW_HEIGHT); } - return new Dimension(super.getPreferredSize().width, WINDWO_HEIGHT); + return new Dimension(super.getPreferredSize().width, WINDOW_HEIGHT); } /** From 235422b755dede0a800eee8cb373dcf03f443c55 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 26 Mar 2020 17:13:58 +0800 Subject: [PATCH 153/375] =?UTF-8?q?CHART-13052=20=E4=B8=BA=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E7=9B=98=E5=9D=90=E6=A0=87=E8=BD=B4=E8=BD=B4=E6=A0=87?= =?UTF-8?q?=E7=AD=BEhtmlPane=E5=88=86=E9=85=8DparentPane?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/designer/style/axis/gauge/VanChartGaugeAxisPane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeAxisPane.java index ac1a0a0f7..b1f516e34 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeAxisPane.java @@ -24,6 +24,8 @@ public class VanChartGaugeAxisPane extends VanChartAxisPane { this.setLayout(new BorderLayout()); gaugeAxisPane = new VanChartAxisScrollPaneWithGauge(); this.add(gaugeAxisPane, BorderLayout.CENTER); + + gaugeAxisPane.setParentPane(parent); } @Override From 81b36cdd4185f3e883626d6cd56471821859ad94 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 27 Mar 2020 09:04:31 +0800 Subject: [PATCH 154/375] REPORT-27106 && REPORT-28229 --- .../env/DesignerWorkspaceGenerator.java | 62 ++++++++++++++++++- .../design/mainframe/errorinfo/ErrorInfo.java | 7 ++- .../StartErrorMessageCollector.java | 3 +- .../entity/DesignerErrorMessage.java | 0 4 files changed, 67 insertions(+), 5 deletions(-) rename {designer-realize => designer-base}/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java (94%) rename {designer-realize => designer-base}/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java (90%) rename {designer-realize => designer-base}/src/main/java/com/fr/design/mainframe/messagecollect/entity/DesignerErrorMessage.java (100%) diff --git a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java index 1174a8a73..d39f6a1d5 100644 --- a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java +++ b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java @@ -1,15 +1,35 @@ package com.fr.design.env; +import com.fr.concurrent.NamedThreadFactory; +import com.fr.design.EnvChangeEntrance; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.messagecollect.StartErrorMessageCollector; +import com.fr.design.mainframe.messagecollect.entity.DesignerErrorMessage; +import com.fr.general.IOUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.module.ModuleContext; +import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.connect.WorkspaceClient; +import javax.swing.*; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + /** * 根据配置生成运行环境 */ public class DesignerWorkspaceGenerator { - public static Workspace generate(DesignerWorkspaceInfo config) throws Exception { + private static final int WAIT_FREQ = 60; + private static ExecutorService service = ModuleContext.getExecutor().newSingleThreadExecutor( + new NamedThreadFactory("DesignerWorkspaceGenerator")); + + public static Workspace generate(final DesignerWorkspaceInfo config) throws Exception { if (config == null || config.getType() == null) { return null; @@ -22,7 +42,19 @@ public class DesignerWorkspaceGenerator { break; } case Remote: { - WorkspaceClient client = WorkContext.getConnector().connect(config.getConnection()); + Future future = service.submit(new Callable() { + @Override + public WorkspaceClient call() throws Exception { + return WorkContext.getConnector().connect(config.getConnection()); + } + }); + WorkspaceClient client = null; + try { + client = future.get(WAIT_FREQ, TimeUnit.SECONDS); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + RemoteHandler.handle(config); + } if (client != null) { workspace = new RemoteWorkspace(client, config.getConnection()); } @@ -31,4 +63,30 @@ public class DesignerWorkspaceGenerator { } return workspace; } + + enum RemoteHandler { + SELF; + public static void handle(DesignerWorkspaceInfo config) { + StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.REMOTE_DESIGN_NO_RESPONSE.getId(), + DesignerErrorMessage.REMOTE_DESIGN_NO_RESPONSE.getMessage(), + StringUtils.EMPTY); + int result = FineJOptionPane.showOptionDialog(null, + Toolkit.i18nText("Fine-Design_Error_Remote_No_Response_Tip"), + Toolkit.i18nText("Fine-Design_Basic_Error_Tittle"), + JOptionPane.YES_NO_OPTION, + JOptionPane.ERROR_MESSAGE, + IOUtils.readIcon("com/fr/design/images/error/error2.png"), + new Object[] {Toolkit.i18nText("Fine-Design_Error_Remote_No_Response_Wait"), Toolkit.i18nText("Fine-Design_Error_Remote_No_Response_Switch")}, + null); + if (result == JOptionPane.YES_OPTION) { + try { + generate(config); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } else { + EnvChangeEntrance.getInstance().dealEvnExceptionWhenStartDesigner(); + } + } + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java similarity index 94% rename from designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java rename to designer-base/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java index 9bfd729dd..99950edae 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java @@ -21,6 +21,9 @@ import java.util.Date; */ public class ErrorInfo { + private static final String SUFFIX = ".json"; + private static final String FOLDER_NAME = "errorInfo"; + private String username; private String uuid; private String activekey; @@ -128,8 +131,8 @@ public class ErrorInfo { public void saveFileToCache(JSONObject jo) { String content = jo.toString(); - String fileName = UUID.randomUUID() + ErrorInfoUploader.SUFFIX; - File file = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), ErrorInfoUploader.FOLDER_NAME, fileName)); + String fileName = UUID.randomUUID() + SUFFIX; + File file = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), FOLDER_NAME, fileName)); FileOutputStream out = null; try (InputStream in = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8))) { StableUtils.makesureFileExist(file); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java similarity index 90% rename from designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java rename to designer-base/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java index 0b6a6b0e4..3f31bf9aa 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java @@ -1,8 +1,8 @@ package com.fr.design.mainframe.messagecollect; -import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.errorinfo.ErrorInfo; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; /** @@ -30,6 +30,7 @@ public class StartErrorMessageCollector { } public void record(String id, String msg, String detail) { + FineLoggerFactory.getLogger().error(id + ": " + msg + "detail: " + detail); ErrorInfo errorInfo = new ErrorInfo(StringUtils.EMPTY, uuid, activeKey); errorInfo.setLogid(id); errorInfo.setLog(msg); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/DesignerErrorMessage.java b/designer-base/src/main/java/com/fr/design/mainframe/messagecollect/entity/DesignerErrorMessage.java similarity index 100% rename from designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/DesignerErrorMessage.java rename to designer-base/src/main/java/com/fr/design/mainframe/messagecollect/entity/DesignerErrorMessage.java From 0107dc1f7d5f09141f3c7034ecf37ebe0c6e93b1 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 27 Mar 2020 13:00:03 +0800 Subject: [PATCH 155/375] REPORT-28846 && REPORT-28830 && REPORT-27109 --- .../src/main/java/com/fr/design/RestartHelper.java | 6 +++++- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 7 +++++-- .../messagecollect/StartErrorMessageCollector.java | 2 +- .../fr/design/cell/editor/BiasTextPainterCellEditor.java | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/RestartHelper.java b/designer-base/src/main/java/com/fr/design/RestartHelper.java index b5f1b6b81..64fdda7ba 100644 --- a/designer-base/src/main/java/com/fr/design/RestartHelper.java +++ b/designer-base/src/main/java/com/fr/design/RestartHelper.java @@ -202,7 +202,11 @@ public class RestartHelper { } catch (IOException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } - DesignerContext.getDesignerFrame().exit(); + if (DesignerContext.getDesignerFrame() != null) { + DesignerContext.getDesignerFrame().exit(); + } else { + DesignerExiter.getInstance().execute(); + } } } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 6d9dc3b61..2cf8d8c35 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -1104,8 +1104,11 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta if (tplFile != null) { int index = HistoryTemplateListCache.getInstance().contains(tplFile); if (index != -1) { - HistoryTemplateListCache.getInstance().getHistoryList().get(index).activeOldJTemplate(); - return; + JTemplate jt = HistoryTemplateListCache.getInstance().getHistoryList().get(index); + if (!(jt instanceof JVirtualTemplate)) { + jt.activeOldJTemplate(); + return; + } } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java index 3f31bf9aa..ca3fd13cc 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/messagecollect/StartErrorMessageCollector.java @@ -30,7 +30,7 @@ public class StartErrorMessageCollector { } public void record(String id, String msg, String detail) { - FineLoggerFactory.getLogger().error(id + ": " + msg + "detail: " + detail); + FineLoggerFactory.getLogger().error(id + ": " + msg + ", detail: " + detail); ErrorInfo errorInfo = new ErrorInfo(StringUtils.EMPTY, uuid, activeKey); errorInfo.setLogid(id); errorInfo.setLog(msg); diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/BiasTextPainterCellEditor.java b/designer-realize/src/main/java/com/fr/design/cell/editor/BiasTextPainterCellEditor.java index e97a92b4d..f3cea3941 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/BiasTextPainterCellEditor.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/BiasTextPainterCellEditor.java @@ -88,7 +88,7 @@ public class BiasTextPainterCellEditor extends AbstractCellEditor { Window parentWindow = SwingUtilities.getWindowAncestor(grid); this.biasTextPainterPane = new BiasTextPainterPane(); Dimension dimension = this.biasTextPainterPane.getPreferredSize(); - Dimension wrapDimension = new Dimension((int) (dimension.width * MULTIPLE), (int) (dimension.height * MULTIPLE)); + Dimension wrapDimension = new Dimension((int) (dimension.width * MULTIPLE), (int) (dimension.height * Math.pow(MULTIPLE, 2))); this.biasTextPainterPane.populate(biasTextPainter); return this.biasTextPainterPane.showWindowWithCustomSize(parentWindow, new DialogActionAdapter() { From c2a9b828064315a76c4f33b831be34957d929b23 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 27 Mar 2020 13:09:35 +0800 Subject: [PATCH 156/375] =?UTF-8?q?fix=20=E9=81=97=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/dialog/TipDialog.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/dialog/TipDialog.java b/designer-base/src/main/java/com/fr/design/dialog/TipDialog.java index cb2adb527..35f9c3c0f 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/TipDialog.java +++ b/designer-base/src/main/java/com/fr/design/dialog/TipDialog.java @@ -6,6 +6,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.IOUtils; +import com.fr.stable.StringUtils; import javax.swing.*; import java.awt.BorderLayout; @@ -42,9 +43,11 @@ public abstract class TipDialog extends JDialog implements ActionListener { JTextPane area = new JTextPane(); UILabel typeLabel = new UILabel(type); area.insertComponent(typeLabel); - UILabel logoIconLabel = new UILabel(); - logoIconLabel.setIcon(IOUtils.readIcon("com/fr/base/images/oem/logo.png")); - area.insertComponent(logoIconLabel); + if (StringUtils.isNotEmpty(type)) { + UILabel logoIconLabel = new UILabel(); + logoIconLabel.setIcon(IOUtils.readIcon("com/fr/base/images/oem/logo.png")); + area.insertComponent(logoIconLabel); + } area.setPreferredSize(new Dimension(400, 100)); area.setEnabled(true); area.setEditable(false); From a691ce2f76d823aba88a97fc1cfe290c30690e34 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 27 Mar 2020 13:27:51 +0800 Subject: [PATCH 157/375] fix dock name --- .../src/main/java/com/fr/start/DesignerJavaRuntime.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java index 6b0c45eab..f75e07ea6 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java @@ -32,6 +32,7 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { private static final String BIN_HOME = StableUtils.pathJoin(StableUtils.getInstallHome(), "bin"); private static final String LOGO_PATH = StableUtils.pathJoin(BIN_HOME, "logo.png"); private static final String DOCK_OPTIONS = "-Xdock:icon=" + LOGO_PATH; + private static final String DOCK_NAME_OPTIONS = "-Xdock:name=" + FineDesigner.class.getName(); private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m"}; static { @@ -99,7 +100,7 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { if (isInstallVersion()) { String[] options = super.getJvmOptions(); if (SupportOSImpl.DOCK_ICON.support()) { - options = ArrayUtils.add(options, DOCK_OPTIONS); + options = ArrayUtils.addAll(options, DOCK_OPTIONS, DOCK_NAME_OPTIONS); } return options; } else { From 1a8bf02e6c1dfec8cfc507109a88098e375330de Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 27 Mar 2020 14:24:43 +0800 Subject: [PATCH 158/375] =?UTF-8?q?REPORT-28792=20=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0tab=E5=9D=97=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/FormCreatorDropTarget.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java index 756a89f56..f61eb2f8a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -93,7 +93,7 @@ public class FormCreatorDropTarget extends DropTarget { //SetSelection时要确保选中的是最顶层的布局 //tab布局添加的时候是初始化了XWCardLayout,实际上最顶层的布局是XWCardMainBorderLayout XCreator addingXCreator = addingModel.getXCreator(); - Widget widget = (addingXCreator.getTopLayout() != null) ? (addingXCreator.getTopLayout().toData()) : addingXCreator.toData(); + Widget widget = (addingXCreator.getBackupParent() != null && addingXCreator.getTopLayout() != null) ? (addingXCreator.getTopLayout().toData()) : addingXCreator.toData(); //图表埋点 dealChartBuryingPoint(widget); if (addingXCreator.isShared()) { From 48f0d92f7884f6e9a54f490dca389fb1eedc0891 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 27 Mar 2020 15:33:12 +0800 Subject: [PATCH 159/375] REPORT-28873 --- .../java/com/fr/design/mainframe/DesignerFrame.java | 12 ++++++++++++ .../main/java/com/fr/start/DesignerJavaRuntime.java | 11 +---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 2cf8d8c35..1b86b6239 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -60,6 +60,7 @@ import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.ProductConstants; +import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.image4j.codec.ico.ICODecoder; import com.fr.stable.os.OperatingSystem; @@ -72,6 +73,7 @@ import com.fr.workspace.Workspace; import com.fr.workspace.connect.WorkspaceConnectionInfo; import org.jetbrains.annotations.Nullable; +import javax.imageio.ImageIO; import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JFrame; @@ -176,6 +178,16 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta private int contentHeight = (int) (java.awt.Toolkit.getDefaultToolkit().getScreenSize().getHeight()); + static { + if (SupportOSImpl.DOCK_ICON.support()) { + try { + ImageIO.write(IOUtils.readImage("com/fr/design/icon/logo.png"), "png", new File( + StableUtils.pathJoin(StableUtils.getInstallHome(), "bin", "logo.png"))); + } catch (IOException ignore) { + } + } + } + private WindowAdapter windowAdapter = new WindowAdapter() { @Override diff --git a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java index f75e07ea6..1a6e272a4 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java @@ -32,18 +32,9 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { private static final String BIN_HOME = StableUtils.pathJoin(StableUtils.getInstallHome(), "bin"); private static final String LOGO_PATH = StableUtils.pathJoin(BIN_HOME, "logo.png"); private static final String DOCK_OPTIONS = "-Xdock:icon=" + LOGO_PATH; - private static final String DOCK_NAME_OPTIONS = "-Xdock:name=" + FineDesigner.class.getName(); + private static final String DOCK_NAME_OPTIONS = "-Xdock:name=" + FineDesigner.class.getSimpleName(); private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m"}; - static { - if (SupportOSImpl.DOCK_ICON.support()) { - try { - ImageIO.write(IOUtils.readImage("com/fr/design/icon/logo.png"), "png", new File(LOGO_PATH)); - } catch (IOException ignore) { - } - } - } - private static final DesignerJavaRuntime INSTANCE = new DesignerJavaRuntime(); public static DesignerJavaRuntime getInstance() { From 3b042ad1d84b525c5f90324f53bf392b96dc6621 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 27 Mar 2020 16:02:36 +0800 Subject: [PATCH 160/375] =?UTF-8?q?fix=20mac=E4=B8=8B=E4=B8=8D=E7=94=A8awt?= =?UTF-8?q?=E7=9A=84=E5=BA=93=E8=AF=BB=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/DesignerFrame.java | 12 ------------ .../main/java/com/fr/start/DesignerJavaRuntime.java | 8 +++++++- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 1b86b6239..2cf8d8c35 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -60,7 +60,6 @@ import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.ProductConstants; -import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.image4j.codec.ico.ICODecoder; import com.fr.stable.os.OperatingSystem; @@ -73,7 +72,6 @@ import com.fr.workspace.Workspace; import com.fr.workspace.connect.WorkspaceConnectionInfo; import org.jetbrains.annotations.Nullable; -import javax.imageio.ImageIO; import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JFrame; @@ -178,16 +176,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta private int contentHeight = (int) (java.awt.Toolkit.getDefaultToolkit().getScreenSize().getHeight()); - static { - if (SupportOSImpl.DOCK_ICON.support()) { - try { - ImageIO.write(IOUtils.readImage("com/fr/design/icon/logo.png"), "png", new File( - StableUtils.pathJoin(StableUtils.getInstallHome(), "bin", "logo.png"))); - } catch (IOException ignore) { - } - } - } - private WindowAdapter windowAdapter = new WindowAdapter() { @Override diff --git a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java index 1a6e272a4..5f4f62210 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java @@ -9,7 +9,6 @@ import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.os.OperatingSystem; -import javax.imageio.ImageIO; import java.io.File; import java.io.IOException; @@ -35,6 +34,13 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { private static final String DOCK_NAME_OPTIONS = "-Xdock:name=" + FineDesigner.class.getSimpleName(); private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m"}; + static { + try { + IOUtils.copy(DesignerJavaRuntime.class.getResourceAsStream("/com/fr/design/icon/logo.png"), "logo.png", new File(BIN_HOME)); + } catch (IOException ignore) { + } + } + private static final DesignerJavaRuntime INSTANCE = new DesignerJavaRuntime(); public static DesignerJavaRuntime getInstance() { From ef9e7cf1303d6dc9a5b1a66377fe408d4dba9e9e Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 27 Mar 2020 18:25:21 +0800 Subject: [PATCH 161/375] =?UTF-8?q?REPORT-28894=20=E5=A4=9A=E6=AC=A1?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E8=BF=9C=E7=A8=8B=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20&&=20xml=E4=B8=8D=E5=8F=AF=E8=AF=BB=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/DesignerEnvManager.java | 43 +++++++++++-------- .../env/DesignerWorkspaceGenerator.java | 8 +++- .../main/java/com/fr/exit/DesignerExiter.java | 6 +++ 3 files changed, 38 insertions(+), 19 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index d94605d42..77c779ce3 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -202,6 +202,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { XMLTools.readFileXML(designerEnvManager, designerEnvManager.getDesignerEnvFile()); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + XmlHandler.Self.handle(e); } // james:如果没有env定义,要设置一个默认的 @@ -348,23 +349,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } catch (IOException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); - ErrorDialog dialog = new ErrorDialog(null, - Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), - Toolkit.i18nText("Fine-Design_Error_Start_Report"), - e.getMessage()) { - @Override - protected void okEvent() { - dispose(); - DesignerExiter.getInstance().execute(); - } - - @Override - protected void restartEvent() { - dispose(); - RestartHelper.restart(); - } - }; - dialog.setVisible(true); + XmlHandler.Self.handle(e); } finally { if (null != fileWriter) { try { @@ -2059,4 +2044,28 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { public void setVcsConfigManager(VcsConfigManager vcsConfigManager) { this.vcsConfigManager = vcsConfigManager; } + + enum XmlHandler { + Self; + public void handle(Throwable throwable) { + ErrorDialog dialog = new ErrorDialog(null, + Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), + Toolkit.i18nText("Fine-Design_Error_Start_Report"), + throwable.getMessage()) { + @Override + protected void okEvent() { + dispose(); + DesignerExiter.getInstance().execute(); + } + + @Override + protected void restartEvent() { + dispose(); + RestartHelper.restart(); + } + }; + dialog.setVisible(true); + DesignerExiter.getInstance().execute(); + } + }; } diff --git a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java index d39f6a1d5..f77debe66 100644 --- a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java +++ b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java @@ -8,7 +8,6 @@ import com.fr.design.mainframe.messagecollect.StartErrorMessageCollector; import com.fr.design.mainframe.messagecollect.entity.DesignerErrorMessage; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; -import com.fr.module.ModuleContext; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; @@ -17,6 +16,7 @@ import com.fr.workspace.connect.WorkspaceClient; import javax.swing.*; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; @@ -26,7 +26,7 @@ import java.util.concurrent.TimeUnit; public class DesignerWorkspaceGenerator { private static final int WAIT_FREQ = 60; - private static ExecutorService service = ModuleContext.getExecutor().newSingleThreadExecutor( + private static ExecutorService service = Executors.newCachedThreadPool( new NamedThreadFactory("DesignerWorkspaceGenerator")); public static Workspace generate(final DesignerWorkspaceInfo config) throws Exception { @@ -89,4 +89,8 @@ public class DesignerWorkspaceGenerator { } } } + + public static void stop() { + service.shutdown(); + } } diff --git a/designer-base/src/main/java/com/fr/exit/DesignerExiter.java b/designer-base/src/main/java/com/fr/exit/DesignerExiter.java index 06260894e..e7189511a 100644 --- a/designer-base/src/main/java/com/fr/exit/DesignerExiter.java +++ b/designer-base/src/main/java/com/fr/exit/DesignerExiter.java @@ -1,5 +1,6 @@ package com.fr.exit; +import com.fr.design.env.DesignerWorkspaceGenerator; import com.fr.process.engine.core.FineProcessContext; import com.fr.process.engine.core.FineProcessEngineEvent; import com.fr.stable.StableUtils; @@ -19,9 +20,14 @@ public class DesignerExiter { } public void execute() { + beforeExit(); if (FineProcessContext.getParentPipe() != null) { FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY); } System.exit(0); } + + private void beforeExit() { + DesignerWorkspaceGenerator.stop(); + } } From 630e28c14701ed8ea2bf808c455b4443ef2c7483 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 27 Mar 2020 21:46:35 +0800 Subject: [PATCH 162/375] =?UTF-8?q?REPORT-28830=20=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/common/report/ReportState.java | 21 +++++++++++++++ .../java/com/fr/design/EnvChangeEntrance.java | 11 +++++++- .../env/DesignerWorkspaceGenerator.java | 9 ++++++- .../com/fr/start/DesignerSuperListener.java | 26 +++++++++++++++++++ 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/common/report/ReportState.java diff --git a/designer-base/src/main/java/com/fr/common/report/ReportState.java b/designer-base/src/main/java/com/fr/common/report/ReportState.java new file mode 100644 index 000000000..cc32e439c --- /dev/null +++ b/designer-base/src/main/java/com/fr/common/report/ReportState.java @@ -0,0 +1,21 @@ +package com.fr.common.report; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/27 + */ +public enum ReportState { + + STOP("stop"), ACTIVE("active"); + + private String value; + + ReportState(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } +} \ No newline at end of file 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 43c829822..81e62239b 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -1,5 +1,6 @@ package com.fr.design; +import com.fr.common.report.ReportState; import com.fr.design.data.DesignTableDataManager; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; @@ -24,6 +25,9 @@ import com.fr.json.JSONArray; import com.fr.license.exception.RegistEditionException; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; +import com.fr.process.ProcessEventPipe; +import com.fr.process.engine.core.CarryMessageEvent; +import com.fr.process.engine.core.FineProcessContext; import com.fr.rpc.Result; import com.fr.stable.AssistUtils; import com.fr.stable.EnvChangedListener; @@ -407,6 +411,10 @@ public class EnvChangeEntrance { @Override public void doOk() { + ProcessEventPipe pipe = FineProcessContext.getParentPipe(); + if (FineProcessContext.getParentPipe() != null) { + pipe.fire(new CarryMessageEvent(ReportState.ACTIVE.getValue())); + } if (!envListOkAction(envListPane, PopTipStrategy.NOW)) { DesignerExiter.getInstance().execute(); } @@ -414,7 +422,8 @@ public class EnvChangeEntrance { @Override public void doCancel() { - DesignerExiter.getInstance().execute(); } + DesignerExiter.getInstance().execute(); + } }); envListDialog.setVisible(true); } diff --git a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java index f77debe66..ccbd5170c 100644 --- a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java +++ b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java @@ -1,5 +1,6 @@ package com.fr.design.env; +import com.fr.common.report.ReportState; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.EnvChangeEntrance; import com.fr.design.dialog.FineJOptionPane; @@ -8,6 +9,9 @@ import com.fr.design.mainframe.messagecollect.StartErrorMessageCollector; import com.fr.design.mainframe.messagecollect.entity.DesignerErrorMessage; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; +import com.fr.process.ProcessEventPipe; +import com.fr.process.engine.core.CarryMessageEvent; +import com.fr.process.engine.core.FineProcessContext; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; @@ -67,6 +71,10 @@ public class DesignerWorkspaceGenerator { enum RemoteHandler { SELF; public static void handle(DesignerWorkspaceInfo config) { + ProcessEventPipe eventPipe = FineProcessContext.getParentPipe(); + if (eventPipe != null) { + eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue())); + } StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.REMOTE_DESIGN_NO_RESPONSE.getId(), DesignerErrorMessage.REMOTE_DESIGN_NO_RESPONSE.getMessage(), StringUtils.EMPTY); @@ -85,7 +93,6 @@ public class DesignerWorkspaceGenerator { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } else { - EnvChangeEntrance.getInstance().dealEvnExceptionWhenStartDesigner(); } } } diff --git a/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java b/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java index db8e532dc..ebf135d26 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java @@ -1,5 +1,6 @@ package com.fr.start; +import com.fr.common.report.ReportState; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.dialog.ErrorDialog; import com.fr.design.i18n.Toolkit; @@ -9,12 +10,14 @@ import com.fr.design.utils.DesignUtils; import com.fr.event.Event; import com.fr.event.Listener; import com.fr.event.Null; +import com.fr.general.ComparatorUtils; import com.fr.process.FineProcess; import com.fr.process.ProcessEventPipe; import com.fr.process.engine.core.FineProcessContext; import com.fr.process.engine.core.FineProcessEngineEvent; import com.fr.stable.StringUtils; +import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; @@ -33,10 +36,12 @@ public class DesignerSuperListener { private static final int FIXED_FREQ = 2; private final ScheduledExecutorService service = Executors.newScheduledThreadPool(2, new NamedThreadFactory("DesignerListener")); + private final ExecutorService helpService = Executors.newSingleThreadExecutor( new NamedThreadFactory("DesignerSuperListener-Help")); private FineProcess process; private ScheduledFuture fixedFuture; private ScheduledFuture onceFuture; + private volatile boolean cancel = false; private DesignerSuperListener() { @@ -49,6 +54,7 @@ public class DesignerSuperListener { public void start() { process = FineProcessContext.getProcess(DesignerProcessType.INSTANCE); startExitListener(); + startHelpLister(); startFrameListener(); startFallBackListener(); } @@ -62,6 +68,24 @@ public class DesignerSuperListener { }); } + private void startHelpLister() { + helpService.submit(new Runnable() { + @Override + public void run() { + while (!cancel) { + ProcessEventPipe pipe = process.getPipe(); + String msg = pipe.info(); + if (ComparatorUtils.equals(ReportState.STOP.getValue(), msg)) { + onceFuture.cancel(false); + } + if (ComparatorUtils.equals(ReportState.ACTIVE.getValue(), msg)) { + startFrameListener(); + } + } + } + }); + } + private void startFrameListener() { onceFuture = service.schedule(new Runnable() { @Override @@ -138,10 +162,12 @@ public class DesignerSuperListener { public void stopTask() { onceFuture.cancel(false); fixedFuture.cancel(false); + cancel = true; } public void stop() { stopTask(); service.shutdown(); + helpService.shutdown(); } } From ba343eb2b487f9c3c278fffd5c8efb35b0f4cb00 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 31 Mar 2020 11:52:46 +0800 Subject: [PATCH 163/375] =?UTF-8?q?REPORT-29003=20=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/env/DesignerWorkspaceGenerator.java | 4 ++-- .../src/main/java/com/fr/start/DesignerSuperListener.java | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java index ccbd5170c..288f6baa3 100644 --- a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java +++ b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java @@ -23,6 +23,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; /** * 根据配置生成运行环境 @@ -55,7 +56,7 @@ public class DesignerWorkspaceGenerator { WorkspaceClient client = null; try { client = future.get(WAIT_FREQ, TimeUnit.SECONDS); - } catch (Exception e) { + } catch (TimeoutException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); RemoteHandler.handle(config); } @@ -92,7 +93,6 @@ public class DesignerWorkspaceGenerator { } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } - } else { } } } diff --git a/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java b/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java index ebf135d26..f6fa3c937 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java @@ -81,6 +81,9 @@ public class DesignerSuperListener { if (ComparatorUtils.equals(ReportState.ACTIVE.getValue(), msg)) { startFrameListener(); } + if (ComparatorUtils.equals(DesignerProcessType.INSTANCE.obtain(), msg)) { + frameReport(); + } } } }); @@ -90,6 +93,7 @@ public class DesignerSuperListener { onceFuture = service.schedule(new Runnable() { @Override public void run() { + cancel = true; ProcessEventPipe pipe = process.getPipe(); pipe.fire(FineProcessEngineEvent.READY); if (StringUtils.isNotEmpty(pipe.info())) { From 57115393825ba779904ec9f52c7a8f84da3ff3f5 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 31 Mar 2020 12:01:23 +0800 Subject: [PATCH 164/375] =?UTF-8?q?REPORT-29003=20=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/env/DesignerWorkspaceGenerator.java | 4 ++-- .../src/main/java/com/fr/start/DesignerSuperListener.java | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java index ccbd5170c..288f6baa3 100644 --- a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java +++ b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java @@ -23,6 +23,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; /** * 根据配置生成运行环境 @@ -55,7 +56,7 @@ public class DesignerWorkspaceGenerator { WorkspaceClient client = null; try { client = future.get(WAIT_FREQ, TimeUnit.SECONDS); - } catch (Exception e) { + } catch (TimeoutException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); RemoteHandler.handle(config); } @@ -92,7 +93,6 @@ public class DesignerWorkspaceGenerator { } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } - } else { } } } diff --git a/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java b/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java index ebf135d26..f6fa3c937 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java @@ -81,6 +81,9 @@ public class DesignerSuperListener { if (ComparatorUtils.equals(ReportState.ACTIVE.getValue(), msg)) { startFrameListener(); } + if (ComparatorUtils.equals(DesignerProcessType.INSTANCE.obtain(), msg)) { + frameReport(); + } } } }); @@ -90,6 +93,7 @@ public class DesignerSuperListener { onceFuture = service.schedule(new Runnable() { @Override public void run() { + cancel = true; ProcessEventPipe pipe = process.getPipe(); pipe.fire(FineProcessEngineEvent.READY); if (StringUtils.isNotEmpty(pipe.info())) { From 6b3a7dc6ff8d59481246333d2eb49a48f08eaf97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 31 Mar 2020 17:30:33 +0800 Subject: [PATCH 165/375] =?UTF-8?q?CHART-11709=09=20=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=85=8D=E8=89=B2=E8=AE=BE=E7=BD=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/style/AbstractPopBox.java | 33 ++- .../background/gradient/FixedGradientBar.java | 4 +- .../background/gradient/GradientBar.java | 111 ++++---- .../design/style/color/ColorSelectDialog.java | 7 +- .../design/style/color/ColorSelectPane.java | 15 +- .../chartx/component/button/ColorButton.java | 174 +++++++++++++ .../combobox/ColorSchemeComboBox.java | 205 +++++++++++++++ .../chart/gui/style/ChartColorAdjustPane.java | 238 ++++++++++++++++++ .../design/module/ChartPreFillStylePane.java | 19 +- .../chart/area/VanChartAreaSeriesPane.java | 7 +- .../bubble/VanChartBubbleSeriesPane.java | 3 +- .../column/VanChartColumnSeriesPane.java | 1 - .../style/VanChartCustomSeriesPane.java | 5 +- .../component/VanChartBeautyPane.java | 16 +- .../component/VanChartFillStylePane.java | 194 +++++++++++++- .../VanChartAbstractPlotSeriesPane.java | 27 +- .../style/VanChartFunnelSeriesPane.java | 1 - .../style/series/VanChartGanttSeriesPane.java | 6 + .../chart/gauge/VanChartGaugeSeriesPane.java | 9 +- .../style/VanChartHeatMapSeriesPane.java | 5 +- .../chart/line/VanChartLineSeriesPane.java | 6 + .../van/chart/map/VanChartMapSeriesPane.java | 51 +++- .../style/VanChartMultiPieSeriesPane.java | 7 +- .../van/chart/pie/VanChartPieSeriesPane.java | 1 - .../chart/radar/VanChartRadarSeriesPane.java | 5 +- .../scatter/VanChartScatterSeriesPane.java | 1 - .../style/VanChartStructureSeriesPane.java | 7 +- .../style/VanChartWordCloudSeriesPane.java | 7 +- 28 files changed, 1026 insertions(+), 139 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/component/button/ColorButton.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java create mode 100644 designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java diff --git a/designer-base/src/main/java/com/fr/design/style/AbstractPopBox.java b/designer-base/src/main/java/com/fr/design/style/AbstractPopBox.java index 83768079c..4df9b7514 100644 --- a/designer-base/src/main/java/com/fr/design/style/AbstractPopBox.java +++ b/designer-base/src/main/java/com/fr/design/style/AbstractPopBox.java @@ -5,15 +5,22 @@ import com.fr.design.style.background.BackgroundJComponent; import com.fr.design.style.background.gradient.GradientBackgroundPane; import com.fr.general.Background; -import javax.swing.*; +import javax.swing.JPanel; +import javax.swing.JWindow; +import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.util.ArrayList; +import java.util.List; +import java.awt.AWTEvent; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.Window; import java.awt.event.AWTEventListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.util.ArrayList; -import java.util.List; /** * @author kunsnat E-mail:kunsnat@gmail.com @@ -50,7 +57,7 @@ public abstract class AbstractPopBox extends JPanel { } }; - private void showPopupMenu() { + protected void showPopupMenu() { if (selectPopupWindow != null && selectPopupWindow.isVisible()) { hidePopupMenu(); return; @@ -98,12 +105,16 @@ public abstract class AbstractPopBox extends JPanel { private void mouseClick(MouseEvent evt) { Point point = new Point((int) (evt.getLocationOnScreen().getX()), (int) evt.getLocationOnScreen().getY()); Dimension popBoxD = AbstractPopBox.this.getSize(); - Point popBoxP = AbstractPopBox.this.getLocationOnScreen(); - Dimension popMenuD = this.getControlWindow().getSize(); - Point popMenuP = this.getControlWindow().getLocation(); - Rectangle popBoxRect = new Rectangle(popBoxP, popBoxD); - Rectangle popMenuRect = new Rectangle(popMenuP, popMenuD); - if (!popBoxRect.contains(point) && !popMenuRect.contains(point)) { + try { + Point popBoxP = AbstractPopBox.this.getLocationOnScreen(); + Dimension popMenuD = this.getControlWindow().getSize(); + Point popMenuP = this.getControlWindow().getLocation(); + Rectangle popBoxRect = new Rectangle(popBoxP, popBoxD); + Rectangle popMenuRect = new Rectangle(popMenuP, popMenuD); + if (!popBoxRect.contains(point) && !popMenuRect.contains(point)) { + this.hidePopupMenu(); + } + } catch (Exception ignore){ this.hidePopupMenu(); } } diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBar.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBar.java index 33df00bc5..8c502114b 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBar.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/FixedGradientBar.java @@ -1,6 +1,6 @@ package com.fr.design.style.background.gradient; -import com.fr.design.style.background.gradient.GradientBar; +import java.awt.Color; /** * 这个bar不能拖拽滑动 @@ -8,6 +8,8 @@ import com.fr.design.style.background.gradient.GradientBar; public class FixedGradientBar extends GradientBar { private static final long serialVersionUID = 2787525421995954889L; + public static final Color NEW_CHARACTER = new Color(99, 178, 238); + public FixedGradientBar(int minvalue, int maxvalue) { super(minvalue, maxvalue); } diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java index b197a3d39..dcb381e81 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java @@ -1,40 +1,38 @@ package com.fr.design.style.background.gradient; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.LinearGradientPaint; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.geom.Point2D; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.swing.JComponent; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; - import com.fr.design.DesignerEnvManager; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.mainframe.DesignerContext; import com.fr.design.style.color.ColorCell; -import com.fr.design.style.color.ColorSelectConfigManager; import com.fr.design.style.color.ColorSelectDetailPane; import com.fr.design.style.color.ColorSelectDialog; import com.fr.design.style.color.ColorSelectable; import com.fr.stable.AssistUtils; +import javax.swing.JComponent; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.LinearGradientPaint; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.geom.Point2D; + /** * TODO:面板缩放的功能没有考虑(就是尾值过大,导致超过界面显示的情况),原来的那个实现完全是个BUG。要缩放的情况也比较少,就干脆以后弄吧 */ -public class GradientBar extends JComponent implements UIObserver,ColorSelectable{ +public class GradientBar extends JComponent implements UIObserver, ColorSelectable { /** * @@ -54,12 +52,12 @@ public class GradientBar extends JComponent implements UIObserver,ColorSelectabl private UINumberField endLabel; private ChangeListener changeListener = null; - private UIObserverListener uiObserverListener; - + private List uiObserverListener; + private static final int MOUSE_OFFSET = 4; - + private static final int MAX_VERTICAL = 45; - + // 选中的颜色 private Color color; @@ -89,6 +87,11 @@ public class GradientBar extends JComponent implements UIObserver,ColorSelectabl iniListener(); } + public void updateColor(Color begin, Color end) { + p1.setColorInner(begin); + p2.setColorInner(end); + } + protected void addMouseClickListener() { this.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { @@ -142,14 +145,14 @@ public class GradientBar extends JComponent implements UIObserver,ColorSelectabl } private void iniListener() { + uiObserverListener = new ArrayList<>(); if (shouldResponseChangeListener()) { this.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { - if (uiObserverListener == null) { - return; + for (UIObserverListener observerListener : uiObserverListener) { + observerListener.doChange(); } - uiObserverListener.doChange(); } }); } @@ -199,14 +202,14 @@ public class GradientBar extends JComponent implements UIObserver,ColorSelectabl * 状态改变 */ public void stateChanged() { - if (changeListener != null) { + if (changeListener != null) { changeListener.stateChanged(null); } } /** * 增加监听 - * + * * @param changeListener 监听 */ public void addChangeListener(ChangeListener changeListener) { @@ -215,14 +218,14 @@ public class GradientBar extends JComponent implements UIObserver,ColorSelectabl /** * 如果左右两个按钮还在初始位置,就为true - * @return 同上 + * + * @return 同上 */ public boolean isOriginalPlace() { return AssistUtils.equals(startLabel.getValue(), min) && AssistUtils.equals(endLabel.getValue(), max); } /** - * * @return */ public double getStartValue() { @@ -230,7 +233,6 @@ public class GradientBar extends JComponent implements UIObserver,ColorSelectabl } /** - * * @return */ public double getEndValue() { @@ -238,7 +240,6 @@ public class GradientBar extends JComponent implements UIObserver,ColorSelectabl } /** - * * @param startValue */ public void setStartValue(double startValue) { @@ -246,7 +247,6 @@ public class GradientBar extends JComponent implements UIObserver,ColorSelectabl } /** - * * @param endValue */ public void setEndValue(double endValue) { @@ -254,7 +254,6 @@ public class GradientBar extends JComponent implements UIObserver,ColorSelectabl } /** - * * @return */ public SelectColorPointBtn getSelectColorPointBtnP1() { @@ -262,7 +261,6 @@ public class GradientBar extends JComponent implements UIObserver,ColorSelectabl } /** - * * @return */ public SelectColorPointBtn getSelectColorPointBtnP2() { @@ -276,7 +274,7 @@ public class GradientBar extends JComponent implements UIObserver,ColorSelectabl * */ public void registerChangeListener(UIObserverListener listener) { - uiObserverListener = listener; + uiObserverListener.add(listener); } @Override @@ -288,22 +286,23 @@ public class GradientBar extends JComponent implements UIObserver,ColorSelectabl return true; } - @Override - public void setColor(Color color) { - this.color = color; - } - - @Override - public Color getColor() { - return this.color; - } - - /** - * 选中颜色 - * @param ColorCell 颜色单元格 - */ - @Override - public void colorSetted(ColorCell colorCell) { - - } + @Override + public void setColor(Color color) { + this.color = color; + } + + @Override + public Color getColor() { + return this.color; + } + + /** + * 选中颜色 + * + * @param ColorCell 颜色单元格 + */ + @Override + public void colorSetted(ColorCell colorCell) { + + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java index b717ea67e..33eb6dbf1 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java @@ -6,6 +6,7 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.JPanel; +import java.io.Serializable; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dialog; @@ -13,7 +14,6 @@ import java.awt.FlowLayout; import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.io.Serializable; /** @@ -136,8 +136,13 @@ public class ColorSelectDialog extends MiddleChartDialog{ * void */ public static void showDialog(Frame owner,ColorSelectDetailPane pane,Color initialColor,ColorSelectable selectePane){ + showDialog(owner,pane,initialColor,selectePane,false); + } + + public static void showDialog(Frame owner,ColorSelectDetailPane pane,Color initialColor,ColorSelectable selectePane, boolean alwaysOnTop){ ColorTracker okListener = new ColorTracker(pane); ColorSelectDialog dialog = new ColorSelectDialog(owner,pane,initialColor,okListener,selectePane); + dialog.setAlwaysOnTop(alwaysOnTop); dialog.setModal(true); dialog.show(); } 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 bb902fa93..c82eac0c0 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 @@ -11,16 +11,21 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.gui.GUICoreUtils; - -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.util.ArrayList; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.util.ArrayList; /** * The pane used to select color @@ -196,6 +201,6 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable @Override public void customButtonPressed() { pane = new ColorSelectDetailPane(Color.WHITE); - ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, Color.WHITE, this); + ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, Color.WHITE, this, true); } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/button/ColorButton.java b/designer-chart/src/main/java/com/fr/design/chartx/component/button/ColorButton.java new file mode 100644 index 000000000..dd908505d --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/button/ColorButton.java @@ -0,0 +1,174 @@ +package com.fr.design.chartx.component.button; + +import com.fr.base.BaseUtils; +import com.fr.base.background.ColorBackground; +import com.fr.design.style.AbstractSelectBox; +import com.fr.design.style.color.ColorSelectPane; + +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-03-06 + */ +public class ColorButton extends AbstractSelectBox { + + private static final double DEL_WIDTH = 7; + + public static final int WIDTH = 18; + + private BufferedImage closeIcon = BaseUtils.readImageWithCache("com/fr/design/images/toolbarbtn/chartChangeClose.png"); + + private Color color; + + private boolean isMoveOn = false; + + private ColorSelectPane colorPane; + + private boolean lastButton; + + private ChangeListener changeListener; + + public ColorButton(Color color) { + this.color = color; + addMouseListener(getMouseListener()); + } + + public Dimension getPreferredSize() { + return new Dimension(WIDTH, WIDTH); + } + + private void paintDeleteButton(Graphics g2d) { + Rectangle2D bounds = this.getBounds(); + + int x = (int) (bounds.getWidth() - DEL_WIDTH); + int y = 1; + + g2d.drawImage(closeIcon, x, y, closeIcon.getWidth(), closeIcon.getHeight(), null); + } + + public void setLastButton(boolean lastButton) { + this.lastButton = lastButton; + } + + @Override + public void paint(Graphics g) { + this.setSize(WIDTH, WIDTH); + Graphics2D g2d = (Graphics2D) g; + g2d.setPaint(color); + Rectangle2D rec = new Rectangle2D.Double(0, 0, WIDTH + 1, WIDTH + 1); + g2d.fill(rec); + + if (isMoveOn && !lastButton) { + paintDeleteButton(g); + } + } + + protected void deleteButton() { + + } + + + private void checkMoveOn(boolean moveOn) { + this.isMoveOn = moveOn; + repaint(); + } + + protected MouseListener getMouseListener() { + return new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + mouseClick(e); + } + + public void mouseEntered(MouseEvent e) { + checkMoveOn(true); + } + + public void mouseExited(MouseEvent e) { + checkMoveOn(false); + } + }; + } + + + public void mouseClick(MouseEvent e) { + if (!lastButton) { + Rectangle2D bounds = this.getBounds(); + if (bounds == null) { + return; + } + if (e.getX() >= bounds.getWidth() - DEL_WIDTH && e.getY() <= DEL_WIDTH) { + deleteButton(); + hidePopupMenu(); + return; + } + } + //打开颜色选择面板 + showPopupMenu(); + } + + public JPanel initWindowPane(double preferredWidth) { + // 下拉的时候重新生成面板,刷新最近使用颜色 + colorPane = new ColorSelectPane(false) { + @Override + public void setVisible(boolean b) { + super.setVisible(b); + } + }; + colorPane.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + hidePopupMenu(); + color = ((ColorSelectPane) e.getSource()).getColor(); + fireDisplayComponent(ColorBackground.getInstance(color)); + ColorButton.this.stateChanged(); + } + }); + return colorPane; + } + + public void stateChanged() { + if (changeListener != null) { + changeListener.stateChanged(null); + } + } + + public void addChangeListener(ChangeListener changeListener) { + this.changeListener = changeListener; + } + + + /** + * 获取当前选中的颜色 + * + * @return 当前选中的颜色 + */ + public Color getSelectObject() { + return this.color; + } + + /** + * 设置选中的颜色 + * + * @param color 颜色 + */ + public void setSelectObject(Color color) { + this.color = color; + colorPane.setColor(color); + + fireDisplayComponent(ColorBackground.getInstance(color)); + } + +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java new file mode 100644 index 000000000..8f8d69a22 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java @@ -0,0 +1,205 @@ +package com.fr.design.chartx.component.combobox; + +import com.fr.base.ChartColorMatching; +import com.fr.base.ChartPreStyleConfig; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.icombobox.UIComboBoxRenderer; +import com.fr.design.i18n.Toolkit; +import com.fr.general.GeneralUtils; + +import javax.swing.DefaultComboBoxModel; +import javax.swing.JLabel; +import javax.swing.JList; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.LinearGradientPaint; +import java.awt.geom.Rectangle2D; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-03-05 + * 一个带颜色展示的配色选择下拉框 + */ +public class ColorSchemeComboBox extends UIComboBox { + + private Map colorSchemes; + + public ColorSchemeComboBox() { + this(null); + } + + public ColorSchemeComboBox(Map colorSchemes) { + //通过配色方案的集合初始化下拉控件,如果参数为null,从配置中读取配色方案。 + if (colorSchemes == null) { + colorSchemes = getColorSchemesFromConfig(); + } + this.colorSchemes = colorSchemes; + + this.setModel(new DefaultComboBoxModel(colorSchemes.keySet().toArray())); + + this.setRenderer(new ColorSchemeCellRenderer()); + } + + private Map getColorSchemesFromConfig() { + Map colorSchemes = new LinkedHashMap<>(); + ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); + + //所有的样式名称 + Iterator names = config.names(); + + //添加默认的方案和第一个方案 + String defaultName = config.getCurrentStyle(); + ChartColorMatching defaultStyle = (ChartColorMatching) config.getPreStyle(defaultName); + Object firstName = names.next(); + ChartColorMatching firstStyle = (ChartColorMatching) config.getPreStyle(firstName); + if (defaultStyle == null) { + defaultStyle = firstStyle; + } + colorSchemes.put(Toolkit.i18nText("Fine-Design_Report_Default"), colorMatchingToColorInfo(defaultStyle)); + colorSchemes.put(firstStyle.getId(), colorMatchingToColorInfo(firstStyle)); + + //添加其他的配色方案 + while (names.hasNext()) { + Object key = names.next(); + ChartColorMatching colorMatching = (ChartColorMatching) config.getPreStyle(key); + colorSchemes.put(colorMatching.getId(), colorMatchingToColorInfo(colorMatching)); + } + + //添加自定义组合色和自定义渐变色 + colorSchemes.put(Toolkit.i18nText("Fine-Design_Chart_Custom_Combination_Color"), null); + colorSchemes.put(Toolkit.i18nText("Fine-Design_Chart_Custom_Gradient"), null); + + return colorSchemes; + } + + public ColorInfo getSelectColorInfo() { + String selectedItem = (String) getSelectedItem(); + return colorSchemes.get(selectedItem); + } + + private ColorInfo colorMatchingToColorInfo(ChartColorMatching colorMatching) { + ColorInfo colorInfo = new ColorInfo(); + colorInfo.setGradient(colorMatching.getGradient()); + colorInfo.setColors(colorMatching.getColorList()); + return colorInfo; + } + + + public class ColorInfo { + + private List colors; + + private boolean gradient; + + public List getColors() { + return colors; + } + + public void setColors(List colors) { + this.colors = colors; + } + + public boolean isGradient() { + return gradient; + } + + public void setGradient(boolean gradient) { + this.gradient = gradient; + } + } + + /** + * CellRenderer. + */ + class ColorSchemeCellRenderer extends UIComboBoxRenderer { + + private String schemeName = Toolkit.i18nText("Fine-Design_Report_Default"); + + //左边距 + private static final double X = 4d; + + //上边距 + private static final double Y = 4d; + + private static final String BLANK_SPACE = " "; + + private static final int HEIGHT = 20; + + @Override + public Dimension getPreferredSize() { + Dimension preferredSize = super.getPreferredSize(); + preferredSize.setSize(super.getPreferredSize().getWidth(), HEIGHT); + return preferredSize; + } + + @Override + public Dimension getMinimumSize() { + return getPreferredSize(); + } + + public Component getListCellRendererComponent( + JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + JLabel comp = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + this.schemeName = GeneralUtils.objectToString(value); + ColorInfo colorInfo = colorSchemes.get(schemeName); + if (colorInfo == null) { + comp.setText(BLANK_SPACE + schemeName); + } else { + FontMetrics fontMetrics = comp.getFontMetrics(comp.getFont()); + double width = (HEIGHT - 2 * Y) * 5; + String fill = BLANK_SPACE; + while (fontMetrics.stringWidth(fill) < width + 3 * X) { + fill += BLANK_SPACE; + } + comp.setText(fill + schemeName); + } + comp.setToolTipText(schemeName); + return comp; + } + + public void paint(Graphics g) { + super.paint(g); + + Graphics2D g2d = (Graphics2D) g; + + ColorInfo colorInfo = colorSchemes.get(schemeName); + if (colorInfo != null) { + if (colorInfo.isGradient()) { + drawGradient(g2d, colorInfo.getColors()); + } else { + drawCombineColor(g2d, colorInfo.getColors()); + } + } + } + + private void drawGradient(Graphics2D g2d, List colors) { + //上下留4px,宽度等于5倍高 + double height = HEIGHT - 2 * Y; + double width = height * 5; + LinearGradientPaint linearGradientPaint = new LinearGradientPaint((float) X, (float) Y, (float) (X + width), (float) Y, new float[]{0f, 1f}, colors.toArray(new Color[colors.size()])); + g2d.setPaint(linearGradientPaint); + Rectangle2D rec = new Rectangle2D.Double(X, Y, width, height); + g2d.fill(rec); + } + + private void drawCombineColor(Graphics2D g2d, List colors) { + int size = colors.size() > 5 ? 5 : colors.size(); + double height = HEIGHT - 2 * Y; + double width = height * 5 / size; + for (int i = 0; i < size; i++) { + g2d.setPaint(colors.get(i)); + Rectangle2D rec = new Rectangle2D.Double(X + width * i, Y, width, height); + g2d.fill(rec); + } + } + } +} diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java new file mode 100644 index 000000000..5578f49c6 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java @@ -0,0 +1,238 @@ +package com.fr.design.mainframe.chart.gui.style; + +import com.fr.base.BaseUtils; +import com.fr.base.background.ColorBackground; +import com.fr.design.chartx.component.button.ColorButton; +import com.fr.design.event.UIObserver; +import com.fr.design.event.UIObserverListener; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.VerticalFlowLayout; +import com.fr.design.style.AbstractSelectBox; +import com.fr.design.style.color.ColorSelectPane; + +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.util.ArrayList; +import java.util.List; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; + +/** + * 配色方案选择组合色之后,可以调整颜色的组件 + * + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-03-25 + */ +public class ChartColorAdjustPane extends JPanel implements UIObserver { + + public static final Color[] defaultColors = { + new Color(99, 178, 238), + new Color(118, 218, 145), + new Color(248, 203, 127), + new Color(248, 149, 136), + new Color(124, 214, 207), + new Color(145, 146, 171), + new Color(120, 152, 225), + new Color(239, 166, 102), + new Color(237, 221, 134), + new Color(153, 135, 206), + }; + + private static final int COUNT_OF_ROW = 8; + + private static final int MAX_BUTTON = 40; + + private List colorButtons = new ArrayList<>(); + + private List uiObserverListener; + + private ChangeListener changeListener; + + + + + public ChartColorAdjustPane() { + this(defaultColors); + } + + public ChartColorAdjustPane(Color[] colors) { + iniListener(); + createColorButton(colors); + createContentPane(); + } + + public void updateColor() { + updateColor(defaultColors); + } + + public void updateColor(Color[] colors) { + createColorButton(colors); + relayout(); + } + + public Color[] getColors() { + int size = colorButtons.size(); + Color[] colors = new Color[size]; + for (int i = 0; i < size; i++) { + colors[i] = colorButtons.get(i).getSelectObject(); + } + return colors; + } + + private void relayout() { + this.removeAll(); + createContentPane(); + this.validate(); + this.repaint(); + } + + private void createContentPane() { + VerticalFlowLayout layout = new VerticalFlowLayout(0, 0, 0); + layout.setAlignLeft(true); + this.setLayout(layout); + + for (int i = 0, size = colorButtons.size(); i < size; i += COUNT_OF_ROW) { + JPanel panel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + int count = i + COUNT_OF_ROW > colorButtons.size() ? colorButtons.size() : i + COUNT_OF_ROW; + for (int j = i; j < count; j++) { + colorButtons.get(j).setLastButton(false); + panel.add(colorButtons.get(j)); + } + if (i + COUNT_OF_ROW > colorButtons.size()) { + panel.add(new AddColorButton()); + this.add(panel); + } else if (i + COUNT_OF_ROW == colorButtons.size() && colorButtons.size() != MAX_BUTTON) { + this.add(panel); + this.add(new AddColorButton()); + } else { + this.add(panel); + } + } + if (colorButtons.size() == 1) { + colorButtons.get(0).setLastButton(true); + } + } + + private void createColorButton(Color[] colors) { + colorButtons.clear(); + for (Color color : colors) { + colorButtons.add(createColorButton(color)); + } + } + + private ColorButton createColorButton(Color color) { + ColorButton colorButton = new ColorButton(color) { + @Override + protected void deleteButton() { + colorButtons.remove(this); + stateChanged(); + relayout(); + } + }; + + colorButton.addChangeListener(changeListener); + return colorButton; + } + + private void iniListener() { + uiObserverListener = new ArrayList<>(); + if (shouldResponseChangeListener()) { + this.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + for (UIObserverListener observerListener : uiObserverListener) { + observerListener.doChange(); + } + } + }); + } + } + + public void stateChanged() { + if (changeListener != null) { + changeListener.stateChanged(null); + } + } + + public void addChangeListener(ChangeListener changeListener) { + this.changeListener = changeListener; + } + + public void registerChangeListener(UIObserverListener listener) { + uiObserverListener.add(listener); + } + + public boolean shouldResponseChangeListener() { + return true; + } + + + private class AddColorButton extends AbstractSelectBox { + + BufferedImage image = BaseUtils.readImageWithCache("/com/fr/design/images/buttonicon/add.png"); + + public AddColorButton() { + addMouseListener(getMouseListener()); + } + + @Override + public void paint(Graphics g) { + this.setSize(ColorButton.WIDTH, ColorButton.WIDTH); + Graphics2D g2d = (Graphics2D) g; + g2d.setPaint(Color.WHITE); + Rectangle2D rec = new Rectangle2D.Double(0, 0, ColorButton.WIDTH + 1, ColorButton.WIDTH + 1); + g2d.fill(rec); + g2d.drawImage(image, 0, 0, ColorButton.WIDTH + 1, ColorButton.WIDTH + 1, null); + } + + public Dimension getPreferredSize() { + return new Dimension(ColorButton.WIDTH, ColorButton.WIDTH); + } + + protected MouseListener getMouseListener() { + return new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + showPopupMenu(); + } + }; + } + + public JPanel initWindowPane(double preferredWidth) { + // 下拉的时候重新生成面板,刷新最近使用颜色 + ColorSelectPane colorPane = new ColorSelectPane(false) { + public void setVisible(boolean b) { + super.setVisible(b); + } + }; + colorPane.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + hidePopupMenu(); + Color color = ((ColorSelectPane) e.getSource()).getColor(); + fireDisplayComponent(ColorBackground.getInstance(color)); + colorButtons.add(createColorButton(color)); + ChartColorAdjustPane.this.stateChanged(); + relayout(); + } + }); + return colorPane; + } + + public Color getSelectObject() { + return null; + } + + public void setSelectObject(Color color) { + + } + } +} diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java index 66a103e65..de85cfcdb 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java @@ -7,11 +7,12 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.style.ChartAccColorPane; +import com.fr.design.mainframe.chart.gui.style.ChartColorAdjustPane; import com.fr.design.style.background.gradient.FixedGradientBar; - import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Color; @@ -20,8 +21,6 @@ import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.List; /** @@ -37,7 +36,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { private UIButton accButton; private UIButton gradientButton; - private ChartAccColorPane colorAcc; + private ChartColorAdjustPane colorAdjustPane; private FixedGradientBar colorGradient; public ChartPreFillStylePane() { @@ -53,13 +52,13 @@ public class ChartPreFillStylePane extends BasicBeanPane { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.LEFT)); - buttonPane.add(accButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Acc_Set"))); + buttonPane.add(accButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Color"))); buttonPane.add(gradientButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gradient_Color"))); customPane.add(buttonPane, BorderLayout.NORTH); changeColorSetPane = new JPanel(cardLayout = new CardLayout()); changeColorSetPane.add(colorGradient = new FixedGradientBar(4, 130), "gradient"); - changeColorSetPane.add(colorAcc = new ChartAccColorPane(), "acc"); + changeColorSetPane.add(colorAdjustPane = new ChartColorAdjustPane(), "acc"); cardLayout.show(changeColorSetPane, "acc"); customPane.add(changeColorSetPane, BorderLayout.CENTER); @@ -68,7 +67,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { customPane.setPreferredSize(new Dimension(200, 200)); colorGradient.setPreferredSize(new Dimension(120, 30)); colorGradient.getSelectColorPointBtnP1().setColorInner(Color.WHITE); - colorGradient.getSelectColorPointBtnP2().setColorInner(Color.black); + colorGradient.getSelectColorPointBtnP2().setColorInner(FixedGradientBar.NEW_CHARACTER); double p = TableLayout.PREFERRED; double[] columnSize = {p, p}; @@ -131,7 +130,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { cardLayout.show(changeColorSetPane, "acc"); if (colorList.size() > 0) { - colorAcc.populateBean(colorList.toArray(new Color[colorList.size()])); + colorAdjustPane.updateColor(colorList.toArray(new Color[colorList.size()])); } } } @@ -152,7 +151,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { } else { chartColorMatching.setGradient(false); - Color[] colors = colorAcc.updateBean(); + Color[] colors = colorAdjustPane.getColors(); for(Color color : colors) { colorList.add(color); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java index 45beccc7e..d3b511b1f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java @@ -6,6 +6,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.van.chart.column.VanChartCustomStackAndAxisConditionPane; +import com.fr.van.chart.designer.component.VanChartBeautyPane; import com.fr.van.chart.line.VanChartLineSeriesPane; import javax.swing.JPanel; @@ -27,7 +28,6 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane { double[] col = {f}; Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, new Component[]{createLineTypePane()}, new Component[]{createMarkerPane()}, new Component[]{createAreaFillColorPane()}, @@ -44,4 +44,9 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane { protected Class getStackAndAxisPaneClass() { return VanChartCustomStackAndAxisConditionPane.class; } + + //风格 + protected VanChartBeautyPane createStylePane() { + return new VanChartBeautyPane(); + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java index 44077c0ba..0bb6ede07 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java @@ -37,14 +37,13 @@ public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane { double[] col = {f}; Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, new Component[]{createBubblePane()}, new Component[]{createStackedAndAxisPane()}, new Component[]{null} }; if (!((VanChartBubblePlot) plot).isForceBubble()) { - components[3] = new Component[]{createLargeDataModelPane()}; + components[2] = new Component[]{createLargeDataModelPane()}; } contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col); 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 12c42408f..fd870048c 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 @@ -53,7 +53,6 @@ public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane { double[] columnSize = {f}; double[] rowSize = {p,p,p,p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, new Component[]{createSeriesStylePane(new double[]{p,p}, new double[]{f,e})}, new Component[]{createBorderPane()}, new Component[]{createStackedAndAxisPane()}, diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomSeriesPane.java index 425258a5b..2cd3d74e1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomSeriesPane.java @@ -4,7 +4,6 @@ import com.fr.chart.chartattr.Chart; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane; import com.fr.design.mainframe.chart.gui.style.series.ChartSeriesPane; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.custom.VanChartCustomPlot; @@ -24,7 +23,7 @@ public class VanChartCustomSeriesPane extends ChartSeriesPane { private JPanel seriesPane; protected VanChartCustomPlotSeriesTabPane plotSeriesPane; - private ChartFillStylePane fillStylePane;//配色 + private VanChartFillStylePane fillStylePane;//配色 private VanChartBeautyPane stylePane;//风格 @@ -81,7 +80,7 @@ public class VanChartCustomSeriesPane extends ChartSeriesPane { }; JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); - panel.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); + panel.setBorder(BorderFactory.createEmptyBorder(5,5,0,5)); return panel; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java index f6642bd71..db41e8a48 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java @@ -29,7 +29,7 @@ public class VanChartBeautyPane extends BasicBeanPane { double[] columnSize = {f, e}; double[] rowSize = {p}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Style")), styleBox}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Gradient_Style")), styleBox}, } ; JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); this.setLayout(new BorderLayout()); @@ -37,17 +37,17 @@ public class VanChartBeautyPane extends BasicBeanPane { } protected String[] getNameArray(){ - return new String[]{Toolkit.i18nText("Fine-Design_Chart_Default_Name"), - Toolkit.i18nText("Fine-Design_Chart_Style_TopDownShade") + return new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), + Toolkit.i18nText("Fine-Design_Chart_Off") }; } @Override public void populateBean(Integer ob) { int finalIndex; switch (ob){ - case ChartConstants.STYLE_NONE: finalIndex = 0; break; - case ChartConstants.STYLE_SHADE: finalIndex = 1; break; - default: finalIndex = 0; + case ChartConstants.STYLE_NONE: finalIndex = 1; break; + case ChartConstants.STYLE_SHADE: finalIndex = 0; break; + default: finalIndex = 1; } styleBox.setSelectedIndex(finalIndex); } @@ -57,8 +57,8 @@ public class VanChartBeautyPane extends BasicBeanPane { int index = styleBox.getSelectedIndex(); int style; switch (index){ - case 0: style = ChartConstants.STYLE_NONE; break; - case 1: style = ChartConstants.STYLE_SHADE; break; + case 0: style = ChartConstants.STYLE_SHADE; break; + case 1: style = ChartConstants.STYLE_NONE; break; default: style = ChartConstants.STYLE_NONE; } return style; 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 e395f26e9..ae8d1135e 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 @@ -1,42 +1,212 @@ package com.fr.van.chart.designer.component; +import com.fr.base.ChartColorMatching; +import com.fr.base.ChartPreStyleConfig; +import com.fr.base.Utils; +import com.fr.chart.base.AttrFillStyle; +import com.fr.chart.base.ChartConstants; +import com.fr.chart.base.ChartUtils; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.chartx.component.combobox.ColorSchemeComboBox; +import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; -import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane; - +import com.fr.design.mainframe.chart.gui.style.ChartColorAdjustPane; +import com.fr.design.style.background.gradient.FixedGradientBar; +import com.fr.stable.StringUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.BorderFactory; import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; import java.awt.Component; import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; /** * Created by mengao on 2017/8/17. */ -public class VanChartFillStylePane extends ChartFillStylePane { +public class VanChartFillStylePane extends BasicBeanPane { + + + protected ColorSchemeComboBox styleSelectBox; + protected JPanel customPane; + protected JPanel changeColorSetPane; + protected FixedGradientBar colorGradient; + + protected CardLayout cardLayout; + + protected ChartColorAdjustPane colorAdjustPane; + + private Color[] gradientColors; + private Color[] accColors; + + private boolean gradientSelect = false; + + public VanChartFillStylePane() { + this.setLayout(new BorderLayout()); + + styleSelectBox = new ColorSchemeComboBox(); + customPane = new JPanel(FRGUIPaneFactory.createBorderLayout()); + + changeColorSetPane = new JPanel(cardLayout = new CardLayout()); + changeColorSetPane.add(colorGradient = new FixedGradientBar(4, 130), "gradient"); + gradientColors = new Color[]{Color.WHITE, FixedGradientBar.NEW_CHARACTER}; + changeColorSetPane.add(colorAdjustPane = new ChartColorAdjustPane(), "acc"); + accColors = ChartColorAdjustPane.defaultColors; + cardLayout.show(changeColorSetPane, "acc"); + customPane.add(changeColorSetPane, BorderLayout.CENTER); + initListener(); + initLayout(); + } + + private void initListener() { + colorAdjustPane.registerChangeListener(new UIObserverListener() { + @Override + public void doChange() { + accColors = colorAdjustPane.getColors(); + if (styleSelectBox.getSelectedIndex() != styleSelectBox.getItemCount() - 2) { + styleSelectBox.setSelectedIndex(styleSelectBox.getItemCount() - 2); + } + VanChartFillStylePane.this.revalidate(); + } + }); + colorGradient.registerChangeListener(new UIObserverListener() { + @Override + public void doChange() { + gradientColors[0] = colorGradient.getSelectColorPointBtnP1().getColorInner(); + gradientColors[1] = colorGradient.getSelectColorPointBtnP2().getColorInner(); + if (styleSelectBox.getSelectedIndex() != styleSelectBox.getItemCount() - 1) { + styleSelectBox.setSelectedIndex(styleSelectBox.getItemCount() - 1); + } + } + }); + styleSelectBox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + ColorSchemeComboBox.ColorInfo selectColorInfo = styleSelectBox.getSelectColorInfo(); + if (styleSelectBox.getSelectedIndex() == styleSelectBox.getItemCount() - 2) { + colorAdjustPane.updateColor(accColors); + cardLayout.show(changeColorSetPane, "acc"); + gradientSelect = false; + } else if (styleSelectBox.getSelectedIndex() == styleSelectBox.getItemCount() - 1) { + colorGradient.updateColor(gradientColors[0], gradientColors[1]); + changeColorSetPane.add(colorGradient, "gradient"); + cardLayout.show(changeColorSetPane, "gradient"); + gradientSelect = true; + } else if (selectColorInfo.isGradient()) { + colorGradient.updateColor(selectColorInfo.getColors().get(0), selectColorInfo.getColors().get(1)); + changeColorSetPane.add(colorGradient, "gradient"); + cardLayout.show(changeColorSetPane, "gradient"); + gradientSelect = true; + } else { + colorAdjustPane.updateColor(selectColorInfo.getColors().toArray(new Color[]{})); + cardLayout.show(changeColorSetPane, "acc"); + gradientSelect = false; + } + VanChartFillStylePane.this.revalidate(); + } + }); + } + + protected void initLayout() { + this.setLayout(new BorderLayout()); + this.add(getContentPane(), BorderLayout.CENTER); + } @Override - protected JPanel getContentPane () { + public Dimension getPreferredSize() { + if (gradientSelect) { + return new Dimension(225, 80); + } + return super.getPreferredSize(); + } + + protected JPanel getContentPane() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double[] columnSize = {f, e}; double[] rowSize = {p, p}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color_Match")),styleSelectBox}, - new Component[]{null,customPane}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Match_Color_Scheme")), styleSelectBox}, + new Component[]{null, customPane}, }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); - panel.setBorder(BorderFactory.createEmptyBorder(5,5,0,0)); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); return panel; } + @Override - public Dimension getPreferredSize() { - if(styleSelectBox.getSelectedIndex() != styleSelectBox.getItemCount() - 1) { - return new Dimension(styleSelectBox.getPreferredSize().width, 30); + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color"); + } + + @Override + public void populateBean(AttrFillStyle condition) { + String fillStyleName = condition == null ? "" : condition.getFillStyleName(); + if (StringUtils.isBlank(fillStyleName)) {//兼容处理 + if (condition == null || condition.getColorStyle() == ChartConstants.COLOR_DEFAULT) { + styleSelectBox.setSelectedIndex(0);//默认 + } else { + int colorStyle = condition.getColorStyle(); + if (colorStyle == ChartConstants.COLOR_GRADIENT) { + gradientColors[0] = condition.getColorIndex(0); + gradientColors[1] = condition.getColorIndex(1); + styleSelectBox.setSelectedIndex(styleSelectBox.getItemCount() - 1); + } else { + int colorSize = condition.getColorSize(); + accColors = new Color[colorSize]; + for (int i = 0; i < colorSize; i++) { + accColors[i] = condition.getColorIndex(i); + } + styleSelectBox.setSelectedIndex(styleSelectBox.getItemCount() - 2); + } + } + } else { + styleSelectBox.setSelectedItem(fillStyleName); } - return super.getPreferredSize(); + } + + @Override + public AttrFillStyle updateBean() { + AttrFillStyle condition = new AttrFillStyle(); + condition.clearColors(); + + //自定义组合色 + if (styleSelectBox.getSelectedIndex() == styleSelectBox.getItemCount() - 2) { + condition.setColorStyle(ChartConstants.COLOR_ACC); + for (int i = 0, length = accColors.length; i < length; i++) { + condition.addFillColor(accColors[i]); + } + //自定义渐变色 + } else if (styleSelectBox.getSelectedIndex() == styleSelectBox.getItemCount() - 1) { + condition.setColorStyle(ChartConstants.COLOR_GRADIENT); + Color start = gradientColors[0]; + Color end = gradientColors[1]; + condition.addFillColor(start); + condition.addFillColor(end); + } else if (styleSelectBox.getSelectedIndex() == 0) { + condition.setColorStyle(ChartConstants.COLOR_DEFAULT); + } else { + ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance(); + Object preStyle = manager.getPreStyle(styleSelectBox.getSelectedItem()); + if (preStyle instanceof ChartColorMatching) { + AttrFillStyle def = ChartUtils.chartColorMatching2AttrFillStyle((ChartColorMatching) preStyle); + def.setFillStyleName(Utils.objectToString(styleSelectBox.getSelectedItem())); + return def; + } else { + condition.setColorStyle(ChartConstants.COLOR_DEFAULT); + } + condition.setCustomFillStyle(true); + } + + return condition; } } 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 9b912ee9f..2bcdda789 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 @@ -10,8 +10,8 @@ import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane; import com.fr.design.mainframe.chart.gui.style.series.AbstractPlotSeriesPane; import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.attr.plot.VanChartPlot; @@ -23,7 +23,6 @@ import com.fr.plugin.chart.base.VanChartAttrLine; import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.base.VanChartAttrTrendLine; import com.fr.van.chart.custom.style.VanChartCustomStylePane; -import com.fr.design.i18n.Toolkit; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartAreaSeriesFillColorPane; import com.fr.van.chart.designer.component.VanChartBeautyPane; @@ -62,6 +61,8 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP private VanChartBorderPane borderPane;//边框 + protected VanChartFillStylePane vanChartFillStylePane;//配色 + private UINumberDragPane transparent;//不透明度 protected VanChartStackedAndAxisListControlPane stackAndAxisEditPane;//堆積和坐標軸 @@ -86,18 +87,18 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); } JPanel panel = new JPanel(new BorderLayout()); - if (fillStylePane != null) { - panel.add(fillStylePane, BorderLayout.NORTH); + JPanel colorPane = getColorPane(); + if(colorPane != null) { + panel.add(colorPane, BorderLayout.NORTH); } panel.add(getContentInPlotType(), BorderLayout.CENTER); return panel; } - @Override /** * 返回 填充界面. */ - protected ChartFillStylePane getFillStylePane() { + protected VanChartFillStylePane getVanChartFillStylePane() { //如果是自定義組合圖,則不創建填充界面 return parentPane instanceof VanChartCustomStylePane ? null : new VanChartFillStylePane(); } @@ -111,9 +112,13 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP protected JPanel getColorPane() { JPanel panel = new JPanel(new BorderLayout()); stylePane = createStylePane(); + vanChartFillStylePane = getVanChartFillStylePane(); + if (vanChartFillStylePane != null) { + panel.add(vanChartFillStylePane, BorderLayout.NORTH); + } setColorPaneContent(panel); JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Color"), panel); - panel.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); + panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 0)); return panel.getComponentCount() == 0 ? null : colorPane; } @@ -266,7 +271,9 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP checkoutMapType(plot); - super.populateBean(plot);//配色 + if(vanChartFillStylePane != null) { //配色 + vanChartFillStylePane.populateBean(plot.getPlotFillStyle()); + } if (stylePane != null) {//风格 stylePane.populateBean(plot.getPlotStyle()); @@ -323,7 +330,9 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP //更新之前先更新界面的map类型属性 checkoutMapType(plot); - super.updateBean(plot);//配色 + if(vanChartFillStylePane != null) {//配色 + plot.setPlotFillStyle(vanChartFillStylePane.updateBean()); + } if (stylePane != null) {//风格 plot.setPlotStyle(stylePane.updateBean()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelSeriesPane.java index 8a02cd5f4..9df55249a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelSeriesPane.java @@ -31,7 +31,6 @@ public class VanChartFunnelSeriesPane extends VanChartAbstractPlotSeriesPane { double[] columnSize = {f}; double[] rowSize = {p,p,p,p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, new Component[]{createFunnelStylePane()}, new Component[]{createBorderPane()}, }; diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java index 8b96c3694..c17d97692 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java @@ -13,6 +13,7 @@ import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.gantt.VanChartGanttPlot; import com.fr.stable.CoreConstants; import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.VanChartBeautyPane; import com.fr.van.chart.designer.component.VanChartMarkerPane; import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane; @@ -121,4 +122,9 @@ public class VanChartGanttSeriesPane extends VanChartAbstractPlotSeriesPane { } } + + @Override + protected VanChartBeautyPane createStylePane() { + return null; + } } 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 c4ce90edc..858fb0ae7 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 @@ -6,6 +6,7 @@ import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; @@ -13,8 +14,6 @@ import com.fr.design.mainframe.chart.gui.style.series.ColorPickerPaneWithFormula import com.fr.design.mainframe.chart.gui.style.series.UIColorPickerPane; import com.fr.design.style.color.ColorSelectBox; import com.fr.general.ComparatorUtils; -import com.fr.design.i18n.Toolkit; - import com.fr.plugin.chart.attr.GaugeDetailStyle; import com.fr.plugin.chart.base.AttrLabel; import com.fr.plugin.chart.base.AttrLabelDetail; @@ -22,6 +21,7 @@ import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.stable.Constants; import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.VanChartBeautyPane; import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane; import javax.swing.JPanel; @@ -306,4 +306,9 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { colorPickerPane.updateBean(detailStyle.getHotAreaColor()); } } + + @Override + protected VanChartBeautyPane createStylePane() { + return null; + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/style/VanChartHeatMapSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/style/VanChartHeatMapSeriesPane.java index f4c7bd476..7c4fa4ad4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/style/VanChartHeatMapSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/style/VanChartHeatMapSeriesPane.java @@ -9,10 +9,9 @@ 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.gui.ChartStylePane; -import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane; - import com.fr.plugin.chart.heatmap.VanChartHeatMapPlot; import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.VanChartFillStylePane; import com.fr.van.chart.map.VanChartMapSeriesPane; import javax.swing.JPanel; @@ -41,7 +40,7 @@ public class VanChartHeatMapSeriesPane extends VanChartMapSeriesPane { /** * 返回 填充界面. */ - protected ChartFillStylePane getFillStylePane() { + protected VanChartFillStylePane getVanChartFillStylePane() { return null; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java index aea7ace9e..8300cac6b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java @@ -4,6 +4,7 @@ import com.fr.chart.chartattr.Plot; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.van.chart.designer.component.VanChartBeautyPane; import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane; import javax.swing.JPanel; @@ -38,4 +39,9 @@ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane { return contentPane; } + @Override + protected VanChartBeautyPane createStylePane() { + return null; + } + } \ No newline at end of file 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 fd00a87c8..b24e8fc33 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 @@ -6,6 +6,7 @@ import com.fr.chart.chartglyph.ConditionAttr; import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; @@ -36,6 +37,7 @@ import com.fr.van.chart.map.designer.style.series.VanChartMapScatterMarkerPane; import com.fr.van.chart.map.line.VanChartCurvePane; import com.fr.van.chart.map.line.VanChartLineMapEffectPane; +import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; @@ -157,6 +159,35 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane { } } + @Override + protected JPanel getContentPane(boolean custom) { + JPanel panel = new JPanel(new BorderLayout()); + mapType = ((VanChartMapPlot) plot).getAllLayersMapType(); + if(mapType == MapType.CUSTOM || mapType == MapType.DRILL_CUSTOM) { + vanChartFillStylePane = getVanChartFillStylePane(); + panel.add(vanChartFillStylePane, BorderLayout.NORTH); + } + panel.add(getContentInPlotType(), BorderLayout.CENTER); + return panel; + } + + //获取颜色面板 + private JPanel getColorPane(MapType paneType) { + JPanel panel = new JPanel(new BorderLayout()); + stylePane = createStylePane(); + mapType = ((VanChartMapPlot) plot).getAllLayersMapType(); + if(mapType != MapType.CUSTOM && mapType != MapType.DRILL_CUSTOM) { + vanChartFillStylePane = getVanChartFillStylePane(); + if (vanChartFillStylePane != null) { + panel.add(vanChartFillStylePane, BorderLayout.NORTH); + } + } + setColorPaneContent(panel, paneType); + JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Color"), panel); + panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 0)); + return panel.getComponentCount() == 0 ? null : colorPane; + } + /** * 在每个不同类型Plot, 得到不同类型的属性. 比如: 柱形的风格, 折线的线型曲线. */ @@ -176,10 +207,17 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane { } //设置色彩面板内容 - protected void setColorPaneContent(JPanel panel) { - panel.add(createNullValueColorPane(), BorderLayout.CENTER); - panel.add(createAlphaPane(), BorderLayout.SOUTH); - + protected void setColorPaneContent(JPanel panel, MapType paneType) { + switch (paneType) { + case AREA: + panel.add(createNullValueColorPane(), BorderLayout.CENTER); + panel.add(createAlphaPane(), BorderLayout.SOUTH); + break; + case POINT: + panel.add(createPointAlphaPane(), BorderLayout.CENTER); + default: + return; + } } @@ -192,7 +230,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane { double[] col = {f}; Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, + new Component[]{getColorPane(MapType.AREA)}, new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), borderWithAlphaPane)}, }; @@ -213,7 +251,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane { double[] col = {f}; Component[][] components = new Component[][]{ - new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle((com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), createPointAlphaPane())}, + new Component[]{getColorPane(MapType.POINT)}, new Component[]{createMarkerComPane()}, //大数据模式 恢复用注释。下面1行删除。 new Component[]{createLargeDataModelPane()}, @@ -232,6 +270,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane { curvePane = new VanChartCurvePane(); Component[][] components = new Component[][]{ + new Component[]{getColorPane(MapType.LINE)}, new Component[]{createCurvePane()}, //大数据模式 恢复用注释。下面1行删除。 new Component[]{createLineMapLargeDataModelPane()}, diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieSeriesPane.java index df967518b..4fa61802d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieSeriesPane.java @@ -7,9 +7,9 @@ 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.gui.ChartStylePane; - import com.fr.plugin.chart.multilayer.VanChartMultiPiePlot; import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.VanChartBeautyPane; import com.fr.van.chart.pie.VanChartPieSeriesPane; import javax.swing.JPanel; @@ -90,4 +90,9 @@ public class VanChartMultiPieSeriesPane extends VanChartPieSeriesPane { multiPiePlot.setSupportRotation(supportRotation.getSelectedIndex() == 0); } } + + @Override + protected VanChartBeautyPane createStylePane() { + return null; + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java index 2169c4a20..a6a1a5e28 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java @@ -41,7 +41,6 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane { double[] columnSize = {f}; double[] rowSize = {p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, new Component[]{createSeriesStylePane(rowSize, new double[]{f, e})}, new Component[]{createBorderPane()}, }; diff --git a/designer-chart/src/main/java/com/fr/van/chart/radar/VanChartRadarSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/radar/VanChartRadarSeriesPane.java index 683896922..5500cf9a3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/radar/VanChartRadarSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/radar/VanChartRadarSeriesPane.java @@ -43,7 +43,6 @@ public class VanChartRadarSeriesPane extends VanChartAbstractPlotSeriesPane { private Component[][] getPaneComponents() { if(plot instanceof VanChartRadarPlot && ((VanChartRadarPlot)plot).isStackChart()) { return new Component[][]{ - new Component[]{getColorPane()}, new Component[]{createRadarTypePane()}, new Component[]{createBorderPane()}, }; @@ -59,7 +58,9 @@ public class VanChartRadarSeriesPane extends VanChartAbstractPlotSeriesPane { //设置色彩面板内容 protected void setColorPaneContent (JPanel panel) { - panel.add(createAlphaPane(), BorderLayout.CENTER); + if(plot instanceof VanChartRadarPlot && ((VanChartRadarPlot)plot).isStackChart()) { + panel.add(createAlphaPane(), BorderLayout.CENTER); + } } private JPanel createRadarTypePane() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java index a85725a8e..c6d7f8af6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java @@ -35,7 +35,6 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane { double[] col = {f}; Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, new Component[]{createLineTypePane()}, new Component[]{createMarkerPane()}, new Component[]{createStackedAndAxisPane()}, diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureSeriesPane.java index b9e542711..ee2cda46a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureSeriesPane.java @@ -10,10 +10,10 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.style.color.ColorSelectBox; - import com.fr.plugin.chart.base.AttrNode; import com.fr.plugin.chart.structure.VanChartStructurePlot; import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.VanChartBeautyPane; import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane; import javax.swing.JPanel; @@ -142,4 +142,9 @@ public class VanChartStructureSeriesPane extends VanChartAbstractPlotSeriesPane } } } + + @Override + protected VanChartBeautyPane createStylePane() { + return null; + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java index d5ab61b95..884e96b33 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java @@ -15,10 +15,10 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.general.IOUtils; - import com.fr.plugin.chart.wordcloud.CloudShapeType; import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot; import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.VanChartBeautyPane; import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane; import javax.swing.JPanel; @@ -228,4 +228,9 @@ public class VanChartWordCloudSeriesPane extends VanChartAbstractPlotSeriesPane } } } + + @Override + protected VanChartBeautyPane createStylePane() { + return null; + } } From 011f0098d85b87f23b76b76d5d722206a88645c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 31 Mar 2020 17:41:27 +0800 Subject: [PATCH 166/375] CHART-11709 --- .../mainframe/chart/gui/style/ChartColorAdjustPane.java | 6 +++--- .../van/chart/designer/component/VanChartFillStylePane.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java index 5578f49c6..52bde97a6 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java @@ -34,7 +34,7 @@ import java.awt.image.BufferedImage; */ public class ChartColorAdjustPane extends JPanel implements UIObserver { - public static final Color[] defaultColors = { + public static final Color[] DEFAULT_COLORS = { new Color(99, 178, 238), new Color(118, 218, 145), new Color(248, 203, 127), @@ -61,7 +61,7 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver { public ChartColorAdjustPane() { - this(defaultColors); + this(DEFAULT_COLORS); } public ChartColorAdjustPane(Color[] colors) { @@ -71,7 +71,7 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver { } public void updateColor() { - updateColor(defaultColors); + updateColor(DEFAULT_COLORS); } public void updateColor(Color[] colors) { 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 ae8d1135e..95c8011c0 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 @@ -58,7 +58,7 @@ public class VanChartFillStylePane extends BasicBeanPane { changeColorSetPane.add(colorGradient = new FixedGradientBar(4, 130), "gradient"); gradientColors = new Color[]{Color.WHITE, FixedGradientBar.NEW_CHARACTER}; changeColorSetPane.add(colorAdjustPane = new ChartColorAdjustPane(), "acc"); - accColors = ChartColorAdjustPane.defaultColors; + accColors = ChartColorAdjustPane.DEFAULT_COLORS; cardLayout.show(changeColorSetPane, "acc"); customPane.add(changeColorSetPane, BorderLayout.CENTER); initListener(); From d2713dced7d238913526a90fab781f1c40f5955e Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 31 Mar 2020 18:08:12 +0800 Subject: [PATCH 167/375] =?UTF-8?q?REPORT-28351=20=E5=BC=BA=E8=BD=AC?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/template/info/JWorkBookProcessInfo.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java index eec777328..85266b7cd 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java @@ -5,6 +5,7 @@ import com.fr.main.impl.WorkBook; import com.fr.main.parameter.ReportParameterAttr; import com.fr.report.cellcase.CellCase; import com.fr.report.poly.PolyWorkSheet; +import com.fr.report.report.Report; import com.fr.report.worksheet.WorkSheet; import java.util.Iterator; @@ -61,8 +62,12 @@ public class JWorkBookProcessInfo extends TemplateProcessInfo { int blockCount = 0; if (!template.isElementCaseBook()) { // 如果是聚合报表 for (int i = 0; i < template.getReportCount(); i++) { - PolyWorkSheet r = (PolyWorkSheet) template.getReport(i); - blockCount += r.getBlockCount(); + Report report = template.getReport(i); + // 考虑多个sheet下 包含WorkSheet的情况 需要判断下 + if (report instanceof PolyWorkSheet) { + PolyWorkSheet r = (PolyWorkSheet) report; + blockCount += r.getBlockCount(); + } } } return blockCount; From 3f3c67455862e0aa4dfc1a8dfd997a45edcb0903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 1 Apr 2020 10:33:55 +0800 Subject: [PATCH 168/375] =?UTF-8?q?CHART-11709=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../combobox/ColorSchemeComboBox.java | 48 ++++++- .../component/VanChartFillStylePane.java | 130 +++++++++++------- 2 files changed, 121 insertions(+), 57 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java index 8f8d69a22..ae076b8f3 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java @@ -93,6 +93,43 @@ public class ColorSchemeComboBox extends UIComboBox { return colorInfo; } + public SelectType getSelectType() { + int selectedIndex = this.getSelectedIndex(); + int itemCount = this.getItemCount(); + if (selectedIndex == itemCount - 1) { + return SelectType.GRADATION_COLOR; + } + if (selectedIndex == itemCount - 2) { + return SelectType.COMBINATION_COLOR; + } + if (selectedIndex == 0) { + return SelectType.DEFAULT; + } + return SelectType.NORMAL; + } + + public void setSelectType(SelectType selectType) { + int itemCount = this.getItemCount(); + switch (selectType) { + case DEFAULT: + setSelectedIndex(0); + break; + case GRADATION_COLOR: + setSelectedIndex(itemCount - 1); + break; + case COMBINATION_COLOR: + setSelectedIndex(itemCount - 2); + break; + } + } + + public enum SelectType { + DEFAULT, + COMBINATION_COLOR, + GRADATION_COLOR, + NORMAL + } + public class ColorInfo { @@ -134,6 +171,8 @@ public class ColorSchemeComboBox extends UIComboBox { private static final int HEIGHT = 20; + private static final int MAX_COUNT = 5; + @Override public Dimension getPreferredSize() { Dimension preferredSize = super.getPreferredSize(); @@ -155,8 +194,9 @@ public class ColorSchemeComboBox extends UIComboBox { comp.setText(BLANK_SPACE + schemeName); } else { FontMetrics fontMetrics = comp.getFontMetrics(comp.getFont()); - double width = (HEIGHT - 2 * Y) * 5; + double width = (HEIGHT - 2 * Y) * MAX_COUNT; String fill = BLANK_SPACE; + //图形和文字之间留的宽度大于3倍的X while (fontMetrics.stringWidth(fill) < width + 3 * X) { fill += BLANK_SPACE; } @@ -184,7 +224,7 @@ public class ColorSchemeComboBox extends UIComboBox { private void drawGradient(Graphics2D g2d, List colors) { //上下留4px,宽度等于5倍高 double height = HEIGHT - 2 * Y; - double width = height * 5; + double width = height * MAX_COUNT; LinearGradientPaint linearGradientPaint = new LinearGradientPaint((float) X, (float) Y, (float) (X + width), (float) Y, new float[]{0f, 1f}, colors.toArray(new Color[colors.size()])); g2d.setPaint(linearGradientPaint); Rectangle2D rec = new Rectangle2D.Double(X, Y, width, height); @@ -192,9 +232,9 @@ public class ColorSchemeComboBox extends UIComboBox { } private void drawCombineColor(Graphics2D g2d, List colors) { - int size = colors.size() > 5 ? 5 : colors.size(); + int size = Math.min(colors.size(), MAX_COUNT); double height = HEIGHT - 2 * Y; - double width = height * 5 / size; + double width = height * MAX_COUNT / size; for (int i = 0; i < size; i++) { g2d.setPaint(colors.get(i)); Rectangle2D rec = new Rectangle2D.Double(X + width * i, Y, width, height); 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 95c8011c0..154ed5557 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 @@ -70,8 +70,8 @@ public class VanChartFillStylePane extends BasicBeanPane { @Override public void doChange() { accColors = colorAdjustPane.getColors(); - if (styleSelectBox.getSelectedIndex() != styleSelectBox.getItemCount() - 2) { - styleSelectBox.setSelectedIndex(styleSelectBox.getItemCount() - 2); + if (styleSelectBox.getSelectType() != ColorSchemeComboBox.SelectType.COMBINATION_COLOR) { + styleSelectBox.setSelectType(ColorSchemeComboBox.SelectType.COMBINATION_COLOR); } VanChartFillStylePane.this.revalidate(); } @@ -81,33 +81,37 @@ public class VanChartFillStylePane extends BasicBeanPane { public void doChange() { gradientColors[0] = colorGradient.getSelectColorPointBtnP1().getColorInner(); gradientColors[1] = colorGradient.getSelectColorPointBtnP2().getColorInner(); - if (styleSelectBox.getSelectedIndex() != styleSelectBox.getItemCount() - 1) { - styleSelectBox.setSelectedIndex(styleSelectBox.getItemCount() - 1); + if (styleSelectBox.getSelectType() != ColorSchemeComboBox.SelectType.GRADATION_COLOR) { + styleSelectBox.setSelectType(ColorSchemeComboBox.SelectType.GRADATION_COLOR); } } }); styleSelectBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - ColorSchemeComboBox.ColorInfo selectColorInfo = styleSelectBox.getSelectColorInfo(); - if (styleSelectBox.getSelectedIndex() == styleSelectBox.getItemCount() - 2) { - colorAdjustPane.updateColor(accColors); - cardLayout.show(changeColorSetPane, "acc"); - gradientSelect = false; - } else if (styleSelectBox.getSelectedIndex() == styleSelectBox.getItemCount() - 1) { - colorGradient.updateColor(gradientColors[0], gradientColors[1]); - changeColorSetPane.add(colorGradient, "gradient"); - cardLayout.show(changeColorSetPane, "gradient"); - gradientSelect = true; - } else if (selectColorInfo.isGradient()) { - colorGradient.updateColor(selectColorInfo.getColors().get(0), selectColorInfo.getColors().get(1)); - changeColorSetPane.add(colorGradient, "gradient"); - cardLayout.show(changeColorSetPane, "gradient"); - gradientSelect = true; - } else { - colorAdjustPane.updateColor(selectColorInfo.getColors().toArray(new Color[]{})); - cardLayout.show(changeColorSetPane, "acc"); - gradientSelect = false; + switch (styleSelectBox.getSelectType()) { + case COMBINATION_COLOR: + colorAdjustPane.updateColor(accColors); + cardLayout.show(changeColorSetPane, "acc"); + gradientSelect = false; + break; + case GRADATION_COLOR: + colorGradient.updateColor(gradientColors[0], gradientColors[1]); + cardLayout.show(changeColorSetPane, "gradient"); + gradientSelect = true; + break; + default: + ColorSchemeComboBox.ColorInfo selectColorInfo = styleSelectBox.getSelectColorInfo(); + if (selectColorInfo.isGradient()) { + colorGradient.updateColor(selectColorInfo.getColors().get(0), selectColorInfo.getColors().get(1)); + cardLayout.show(changeColorSetPane, "gradient"); + gradientSelect = true; + } else { + colorAdjustPane.updateColor(selectColorInfo.getColors().toArray(new Color[]{})); + cardLayout.show(changeColorSetPane, "acc"); + gradientSelect = false; + } + break; } VanChartFillStylePane.this.revalidate(); } @@ -153,20 +157,20 @@ public class VanChartFillStylePane extends BasicBeanPane { String fillStyleName = condition == null ? "" : condition.getFillStyleName(); if (StringUtils.isBlank(fillStyleName)) {//兼容处理 if (condition == null || condition.getColorStyle() == ChartConstants.COLOR_DEFAULT) { - styleSelectBox.setSelectedIndex(0);//默认 + styleSelectBox.setSelectType(ColorSchemeComboBox.SelectType.DEFAULT);//默认 } else { int colorStyle = condition.getColorStyle(); if (colorStyle == ChartConstants.COLOR_GRADIENT) { gradientColors[0] = condition.getColorIndex(0); gradientColors[1] = condition.getColorIndex(1); - styleSelectBox.setSelectedIndex(styleSelectBox.getItemCount() - 1); + styleSelectBox.setSelectType(ColorSchemeComboBox.SelectType.GRADATION_COLOR); } else { int colorSize = condition.getColorSize(); accColors = new Color[colorSize]; for (int i = 0; i < colorSize; i++) { accColors[i] = condition.getColorIndex(i); } - styleSelectBox.setSelectedIndex(styleSelectBox.getItemCount() - 2); + styleSelectBox.setSelectType(ColorSchemeComboBox.SelectType.COMBINATION_COLOR); } } } else { @@ -176,37 +180,57 @@ public class VanChartFillStylePane extends BasicBeanPane { @Override public AttrFillStyle updateBean() { + switch (styleSelectBox.getSelectType()) { + case COMBINATION_COLOR: + return updateCombinationColor(); + case GRADATION_COLOR: + return updateGradationColor(); + case DEFAULT: + return updateDefaultColor(); + default: + return updateNormalColor(); + } + } + + private AttrFillStyle updateCombinationColor() { AttrFillStyle condition = new AttrFillStyle(); condition.clearColors(); - - //自定义组合色 - if (styleSelectBox.getSelectedIndex() == styleSelectBox.getItemCount() - 2) { - condition.setColorStyle(ChartConstants.COLOR_ACC); - for (int i = 0, length = accColors.length; i < length; i++) { - condition.addFillColor(accColors[i]); - } - //自定义渐变色 - } else if (styleSelectBox.getSelectedIndex() == styleSelectBox.getItemCount() - 1) { - condition.setColorStyle(ChartConstants.COLOR_GRADIENT); - Color start = gradientColors[0]; - Color end = gradientColors[1]; - condition.addFillColor(start); - condition.addFillColor(end); - } else if (styleSelectBox.getSelectedIndex() == 0) { - condition.setColorStyle(ChartConstants.COLOR_DEFAULT); - } else { - ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance(); - Object preStyle = manager.getPreStyle(styleSelectBox.getSelectedItem()); - if (preStyle instanceof ChartColorMatching) { - AttrFillStyle def = ChartUtils.chartColorMatching2AttrFillStyle((ChartColorMatching) preStyle); - def.setFillStyleName(Utils.objectToString(styleSelectBox.getSelectedItem())); - return def; - } else { - condition.setColorStyle(ChartConstants.COLOR_DEFAULT); - } - condition.setCustomFillStyle(true); + condition.setColorStyle(ChartConstants.COLOR_ACC); + for (int i = 0, length = accColors.length; i < length; i++) { + condition.addFillColor(accColors[i]); } + condition.setCustomFillStyle(true); + return condition; + } + private AttrFillStyle updateGradationColor() { + AttrFillStyle condition = new AttrFillStyle(); + condition.clearColors(); + condition.setColorStyle(ChartConstants.COLOR_GRADIENT); + Color start = gradientColors[0]; + Color end = gradientColors[1]; + condition.addFillColor(start); + condition.addFillColor(end); + condition.setCustomFillStyle(true); return condition; } + + private AttrFillStyle updateDefaultColor() { + AttrFillStyle condition = new AttrFillStyle(); + condition.clearColors(); + condition.setColorStyle(ChartConstants.COLOR_DEFAULT); + return condition; + } + + private AttrFillStyle updateNormalColor() { + ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance(); + Object preStyle = manager.getPreStyle(styleSelectBox.getSelectedItem()); + if (preStyle instanceof ChartColorMatching) { + AttrFillStyle def = ChartUtils.chartColorMatching2AttrFillStyle((ChartColorMatching) preStyle); + def.setFillStyleName(Utils.objectToString(styleSelectBox.getSelectedItem())); + return def; + } else { + return updateDefaultColor(); + } + } } From 746ca6e969cceace13b8eef3511b281d6c5fe84b Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 1 Apr 2020 15:52:53 +0800 Subject: [PATCH 169/375] =?UTF-8?q?REPORT-28907=20=E5=90=8C=E6=AD=A5fire?= =?UTF-8?q?=20&&=20REPORT-28351=20=E5=BC=BA=E8=BD=AC=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=88=B0release=20&&=20MOBILE-26199=20?= =?UTF-8?q?=E6=8F=90=E4=BE=9Btab=E6=A0=87=E9=A2=98=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/MobileTemplateStyleProvider.java | 25 +++++++++++ .../AbstractMobileTemplateStyleProvider.java | 25 +++++++++++ .../accessibles/MobileTemplateStylePane.java | 43 +++++++++++++++++-- .../main/java/com/fr/exit/DesignerExiter.java | 2 +- .../template/info/JWorkBookProcessInfo.java | 9 +++- 5 files changed, 98 insertions(+), 6 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/MobileTemplateStyleProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractMobileTemplateStyleProvider.java diff --git a/designer-base/src/main/java/com/fr/design/fun/MobileTemplateStyleProvider.java b/designer-base/src/main/java/com/fr/design/fun/MobileTemplateStyleProvider.java new file mode 100644 index 000000000..770e65a9e --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/MobileTemplateStyleProvider.java @@ -0,0 +1,25 @@ +package com.fr.design.fun; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.general.cardtag.mobile.MobileTemplateStyle; +import com.fr.stable.fun.mark.Mutable; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/31 + */ +public interface MobileTemplateStyleProvider extends Mutable { + + String XML_TAG = "MobileTemplateStyleProvider"; + + int CURRENT_LEVEL = 1; + + Class classFroMobileTemplateStyle(); + + + Class> classFroMobileTemplateStyleAppearance(); + + String displayName(); + +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractMobileTemplateStyleProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractMobileTemplateStyleProvider.java new file mode 100644 index 000000000..54c947c57 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractMobileTemplateStyleProvider.java @@ -0,0 +1,25 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.MobileTemplateStyleProvider; +import com.fr.design.fun.MobileWidgetStyleProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/31 + */ +@API(level = MobileWidgetStyleProvider.CURRENT_LEVEL) +public abstract class AbstractMobileTemplateStyleProvider extends AbstractProvider implements MobileTemplateStyleProvider { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java index 76434545e..9c52673d7 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java @@ -1,11 +1,14 @@ package com.fr.design.mainframe.widget.accessibles; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.fun.MobileTemplateStyleProvider; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.mobile.ui.TemplateStyleDefinePaneFactory; import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.general.cardtag.mobile.MobileTemplateStyle; import com.fr.general.cardtag.mobile.MobileTemplateStyleType; +import com.fr.invoke.Reflect; import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListModel; import javax.swing.JList; @@ -18,9 +21,12 @@ import java.awt.Dimension; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; public class MobileTemplateStylePane extends AbstractTemplateStylePane { private static final List STYLE_LIST = new ArrayList(); @@ -36,6 +42,7 @@ public class MobileTemplateStylePane extends AbstractTemplateStylePane> map = new HashMap<>(); private JPanel right; private CardLayout card; + private Set> extraStyle = new HashSet<>(); public MobileTemplateStylePane(WCardTagLayout tagLayout){ init(tagLayout); } @@ -52,6 +59,7 @@ public class MobileTemplateStylePane extends AbstractTemplateStylePane list = getMobileTemplateStyleProvider(); + for (MobileTemplateStyleProvider provider : list) { + String displayName = provider.displayName(); + Class> clazz = provider.classFroMobileTemplateStyleAppearance(); + BasicBeanPane styleBasicBeanPane = Reflect.on(clazz).create().get(); + listModel.addElement(displayName); + map.put(displayName, styleBasicBeanPane); + right.add(displayName, styleBasicBeanPane); + extraStyle.add(provider.classFroMobileTemplateStyle()); + } + } + public static ListCellRenderer render = new DefaultListCellRenderer() { @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { @@ -97,16 +119,31 @@ public class MobileTemplateStylePane extends AbstractTemplateStylePane getMobileTemplateStyleProvider() { + List list = new ArrayList<>(); + Set sets = ExtraDesignClassManager.getInstance().getArray(MobileTemplateStyleProvider.XML_TAG); + list.addAll(sets); + return Collections.unmodifiableList(list); + } } diff --git a/designer-base/src/main/java/com/fr/exit/DesignerExiter.java b/designer-base/src/main/java/com/fr/exit/DesignerExiter.java index e7189511a..b9067a22e 100644 --- a/designer-base/src/main/java/com/fr/exit/DesignerExiter.java +++ b/designer-base/src/main/java/com/fr/exit/DesignerExiter.java @@ -22,7 +22,7 @@ public class DesignerExiter { public void execute() { beforeExit(); if (FineProcessContext.getParentPipe() != null) { - FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY); + FineProcessContext.getParentPipe().syncFire(FineProcessEngineEvent.DESTROY); } System.exit(0); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java index eec777328..85266b7cd 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java @@ -5,6 +5,7 @@ import com.fr.main.impl.WorkBook; import com.fr.main.parameter.ReportParameterAttr; import com.fr.report.cellcase.CellCase; import com.fr.report.poly.PolyWorkSheet; +import com.fr.report.report.Report; import com.fr.report.worksheet.WorkSheet; import java.util.Iterator; @@ -61,8 +62,12 @@ public class JWorkBookProcessInfo extends TemplateProcessInfo { int blockCount = 0; if (!template.isElementCaseBook()) { // 如果是聚合报表 for (int i = 0; i < template.getReportCount(); i++) { - PolyWorkSheet r = (PolyWorkSheet) template.getReport(i); - blockCount += r.getBlockCount(); + Report report = template.getReport(i); + // 考虑多个sheet下 包含WorkSheet的情况 需要判断下 + if (report instanceof PolyWorkSheet) { + PolyWorkSheet r = (PolyWorkSheet) report; + blockCount += r.getBlockCount(); + } } } return blockCount; From 3c9245c79cacfc11baaae5c40aa59a5666bbaf69 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 1 Apr 2020 20:01:28 +0800 Subject: [PATCH 170/375] =?UTF-8?q?CHART-12817=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=AD=96=E7=95=A5=E6=96=87=E6=A1=88=E5=92=8C?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/VanChartPlotLegendPane.java | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) 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 f4e1127f2..d67fdc374 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 @@ -8,6 +8,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -81,7 +82,7 @@ public class VanChartPlotLegendPane extends BasicPane { } protected void initComponents(){ - isLegendVisible = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Legend_Visible")); + isLegendVisible = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Legend_Visible")); legendPane = createLegendPane(); double p = TableLayout.PREFERRED; @@ -121,9 +122,9 @@ public class VanChartPlotLegendPane extends BasicPane { Component[][] components = new Component[][]{ new Component[]{createTitlePositionPane(new double[]{p,p,p},columnSize),null}, new Component[]{createTitleStylePane(),null} , - new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"),borderPane),null}, - new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane),null}, - new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), createDisplayStrategy()),null} + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"),borderPane),null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane),null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), createDisplayStrategy()),null} }; return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } @@ -146,16 +147,16 @@ public class VanChartPlotLegendPane extends BasicPane { Component[][] components = new Component[][]{ new Component[]{createTitlePositionPane(new double[]{p,p,p},columnSize),null}, new Component[]{createTitleStylePane(),null} , - new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"),borderPane),null}, - new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane),null}, - new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel),null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"),borderPane),null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane),null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel),null}, }; return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } protected JPanel createTitlePositionPane(double[] row, double[] col){ - String[] textArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Top"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Bottom"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Left"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Right"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Right_Top")}; + String[] textArray = {Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Top"), Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Bottom"), + Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Left"), Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Right"), Toolkit.i18nText("Fine-Design_Chart_Right_Top")}; Integer[] valueArray = {Constants.TOP, Constants.BOTTOM, Constants.LEFT, Constants.RIGHT, Constants.RIGHT_TOP}; Icon[] iconArray = {BaseUtils.readIcon("/com/fr/design/images/chart/ChartLegend/layout_top.png"), BaseUtils.readIcon("/com/fr/design/images/chart/ChartLegend/layout_bottom.png"), @@ -167,13 +168,13 @@ public class VanChartPlotLegendPane extends BasicPane { location = new UIButtonGroup(iconArray, valueArray); location.setAllToolTips(textArray); - customFloatPositionButton = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Float_Position")); + customFloatPositionButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Custom_Float_Position")); UIComponentUtils.setLineWrap(customFloatPositionButton); customFloatPositionButton.setEventBannded(true); Component[][] components = new Component[][]{ new Component[]{null,null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Position")),location}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")),location}, new Component[]{null,customFloatPositionButton} }; @@ -182,7 +183,7 @@ public class VanChartPlotLegendPane extends BasicPane { initPositionListener(); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,row,col); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), panel); } private void initPositionListener(){ @@ -230,18 +231,17 @@ public class VanChartPlotLegendPane extends BasicPane { protected JPanel createTitleStylePane(){ textAttrPane = new ChartTextAttrPane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane); } protected JPanel createDisplayStrategy(){ //区域显示策略 恢复用注释。开始删除。 maxProportion = new UISpinner(0, 100, 1, 30); - limitSize = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")}); - limitSizeTitle = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion")); + limitSize = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), Toolkit.i18nText("Fine-Design_Chart_Custom")}); + limitSizeTitle = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Max_Proportion")); - - JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"), limitSize); - maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); + JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Area_Size"), limitSize); + maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); JPanel panel = new JPanel(new BorderLayout()); panel.add(limitSizePane, BorderLayout.NORTH); @@ -262,7 +262,7 @@ public class VanChartPlotLegendPane extends BasicPane { } private JPanel createHighlightPane(){ - highlightButton = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_On"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); + highlightButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -271,7 +271,7 @@ public class VanChartPlotLegendPane extends BasicPane { double[] rowSize = {p,p}; Component[][] components = new Component[][]{ new Component[]{null,null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Highlight")),highlightButton} + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Highlight")),highlightButton} }; return TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); } @@ -295,8 +295,7 @@ public class VanChartPlotLegendPane extends BasicPane { //区域显示策略 恢复用注释。删除下面方法。 //检查最大显示占比是否可用 private void checkMaxProPortionUse() { - maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); - maxProportionPane.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); + maxProportionPane.setVisible(limitSize.getSelectedIndex() == 1 && limitSize.isEnabled()); } protected void checkBoxUse() { @@ -328,7 +327,7 @@ public class VanChartPlotLegendPane extends BasicPane { } legend.setFloating(customFloatPositionButton.isSelected()); //区域显示策略 恢复用注释。下面2行删除。 - legend.setLimitSize(limitSize.getSelectedIndex() == 0); + legend.setLimitSize(limitSize.getSelectedIndex() == 1); legend.setMaxHeight(maxProportion.getValue()); //区域显示策略 恢复用注释。取消注释。 //legend.setLimitAttribute(limitPane.updateBean()); @@ -352,7 +351,7 @@ public class VanChartPlotLegendPane extends BasicPane { customFloatPositionPane.setFloatPosition_x(legend.getFloatPercentX()); customFloatPositionPane.setFloatPosition_y(legend.getFloatPercentY()); //区域显示策略 恢复用注释。下面2行删除。 - limitSize.setSelectedIndex(legend.isLimitSize() ? 0 : 1); + limitSize.setSelectedIndex(legend.isLimitSize() ? 1 : 0); maxProportion.setValue(legend.getMaxHeight()); //区域显示策略 恢复用注释。取消注释。 //limitPane.populateBean(legend.getLimitAttribute()); From b9ec2f32cfc099e916808e9d2ac053ed5a3f7d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 2 Apr 2020 14:39:04 +0800 Subject: [PATCH 171/375] =?UTF-8?q?CHART-13213=20=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E6=A8=A1=E7=B3=8A=E5=8C=B9=E9=85=8D=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chartx/component/MapAreaMatchPane.java | 1 + .../chartx/component/MatchAreaTable.java | 28 +++++-------- .../chartx/component/MatchResultTable.java | 39 +++++++++++++++++-- 3 files changed, 47 insertions(+), 21 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java index 41202061c..a3e610460 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java @@ -118,6 +118,7 @@ public class MapAreaMatchPane extends BasicBeanPane { matchAreaTable.setItems(treeNodeAndItems.getSecond()); matchResultTable = new MatchResultTable(new Object[0][3], HEADER_WITH_EMPTY); + matchResultTable.setItems(treeNodeAndItems.getSecond()); DefaultTableModel model = new DefaultTableModel(new Object[0][3], HEADER_WITH_EMPTY); matchResultTable.setModel(model); diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java index 9c16b4663..9dd13e77f 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java @@ -1,6 +1,5 @@ package com.fr.design.chartx.component; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.general.GeneralUtils; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; @@ -63,6 +62,16 @@ public class MatchAreaTable extends JTable { this.areaNameIndex = areaNameIndex; } + @Override + public boolean isCellEditable(int row, int column) { + //第一列不可编辑 + int col = convertColumnIndexToModel(column); + if (col == 0) { + return false; + } + return true; + } + public void setModel(TableModel dataModel) { super.setModel(dataModel); @@ -70,7 +79,6 @@ public class MatchAreaTable extends JTable { items = new HashSet<>(); } TableColumnModel columnModel = getColumnModel(); - columnModel.getColumn(0).setCellEditor(new UILabelEditor()); columnModel.getColumn(1).setCellEditor(new UIComboBoxRenderAndEditor()); columnModel.getColumn(1).setCellRenderer(new UIComboBoxRenderAndEditor()); } @@ -131,20 +139,4 @@ public class MatchAreaTable extends JTable { return comboBox.getSelectedItem(); } } - - public static class UILabelEditor extends AbstractCellEditor implements TableCellEditor { - - UILabel uiLabel; - - public Component getTableCellEditorComponent(JTable table, Object value, - boolean isSelected, - int row, int column) { - uiLabel = new UILabel(GeneralUtils.objectToString(value)); - return uiLabel; - } - - public Object getCellEditorValue() { - return uiLabel.getText(); - } - } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchResultTable.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchResultTable.java index 8a85c84a4..5f03a7551 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MatchResultTable.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MatchResultTable.java @@ -3,8 +3,10 @@ package com.fr.design.chartx.component; import com.fr.base.BaseUtils; import com.fr.base.Utils; import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralUtils; import com.fr.plugin.chart.map.data.MapMatchResult; import com.fr.stable.StringUtils; @@ -18,7 +20,9 @@ import javax.swing.table.TableColumnModel; import javax.swing.table.TableModel; import java.util.LinkedHashMap; import java.util.Map; +import java.util.Set; import java.util.Vector; +import java.awt.Color; import java.awt.Component; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -32,6 +36,8 @@ public class MatchResultTable extends JTable { private MatchAreaTable matchAreaTable; + private Set items; + public MatchResultTable(Object[][] data, Object[] header) { super(data, header); this.getTableHeader().setReorderingAllowed(false); @@ -41,12 +47,26 @@ public class MatchResultTable extends JTable { this.matchAreaTable = matchAreaTable; } + public void setItems(Set items) { + this.items = items; + } + + @Override + public boolean isCellEditable(int row, int column) { + //第一列和第二列不可编辑 + int col = convertColumnIndexToModel(column); + if (col == 0 || col == 1) { + return false; + } + return true; + } + + public void setModel(TableModel dataModel) { super.setModel(dataModel); TableColumnModel columnModel = getColumnModel(); - columnModel.getColumn(0).setCellEditor(new MatchAreaTable.UILabelEditor()); - columnModel.getColumn(1).setCellEditor(new MatchAreaTable.UILabelEditor()); + columnModel.getColumn(1).setCellRenderer(new UILabelEditorAndRender()); columnModel.getColumn(2).setCellEditor(new UIButtonEditorAndRender()); columnModel.getColumn(2).setCellRenderer(new UIButtonEditorAndRender()); columnModel.getColumn(2).setMaxWidth(20); @@ -56,7 +76,6 @@ public class MatchResultTable extends JTable { int rowCount = this.getRowCount(); for (int i = 0; i < rowCount; i++) { if (ComparatorUtils.equals(this.getValueAt(i, 0), areaName)) { - getColumnModel().getColumn(1).getCellEditor().stopCellEditing(); this.setValueAt(result, i, 1); return; } @@ -143,4 +162,18 @@ public class MatchResultTable extends JTable { } } + public class UILabelEditorAndRender implements TableCellRenderer { + + UILabel uiLabel; + + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + uiLabel = new UILabel(GeneralUtils.objectToString(value)); + if (!items.contains(value)) { + uiLabel.setForeground(Color.GRAY); + uiLabel.setText(value + Toolkit.i18nText("Fine-Design_Chart_Lost_Data")); + } + return uiLabel; + } + } + } From afa34b3338efec97e6d4afaf07539028b15c3cfc Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 2 Apr 2020 15:02:34 +0800 Subject: [PATCH 172/375] =?UTF-8?q?CHART-12817=20=E5=9B=BE=E4=BE=8B?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=92=E5=88=97=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/HeatMapRangeLegendPane.java | 9 +- .../style/VanChartPlotLegendPane.java | 112 ++++++++++++++---- .../style/VanChartRangeLegendPane.java | 42 ++++--- 3 files changed, 112 insertions(+), 51 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/HeatMapRangeLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/HeatMapRangeLegendPane.java index db0d5c864..60c535ceb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/HeatMapRangeLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/HeatMapRangeLegendPane.java @@ -3,6 +3,7 @@ package com.fr.van.chart.designer.style; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.i18n.Toolkit; import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent; import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula; @@ -38,8 +39,8 @@ public class HeatMapRangeLegendPane extends VanChartRangeLegendPane { @Override protected UIButtonGroup createLegendTypeButton(){ return new UIButtonGroup(new String[]{ - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Legend_Gradual"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Legend_Section") + Toolkit.i18nText("Fine-Design_Chart_Legend_Gradual"), + Toolkit.i18nText("Fine-Design_Chart_Legend_Section") }, new LegendType[]{LegendType.GRADUAL, LegendType.SECTION}); } @@ -53,7 +54,7 @@ public class HeatMapRangeLegendPane extends VanChartRangeLegendPane { protected Component[][] getPaneComponents(MinMaxValuePaneWithOutTick minMaxValuePane, ColorSelectBoxWithOutTransparent colorSelectBox, UINumberDragPane numberDragPane, LegendGradientBar legendGradientBar) { return new Component[][]{ new Component[]{minMaxValuePane, null}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Divided_Stage")), numberDragPane}, + new Component[]{new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Value_Divided_Stage")), numberDragPane}, new Component[]{null, legendGradientBar} }; } @@ -64,7 +65,7 @@ public class HeatMapRangeLegendPane extends VanChartRangeLegendPane { @Override protected SectionLegendPane createSectionLegendPane() { - return new SectionLegendPane(this.parent) { + return new SectionLegendPane(this.getLegendPaneParent()) { @Override protected MapColorPickerPaneWithFormula createSectionIntervalConfigPane(AbstractAttrNoScrollPane parent) { return new SectionIntervalConfigPaneWithOutNum(parent); 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 d67fdc374..51faecff1 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 @@ -16,6 +16,7 @@ import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.attr.VanChartLegend; +import com.fr.plugin.chart.type.ArrangeType; import com.fr.stable.Constants; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartFloatPositionPane; @@ -45,32 +46,31 @@ public class VanChartPlotLegendPane extends BasicPane { private static final int HEIGHT = 100; private static final int GAP = 20; - protected UICheckBox isLegendVisible; + private UICheckBox isLegendVisible; + private JPanel legendPane; - protected JPanel legendPane; - - protected ChartTextAttrPane textAttrPane; - protected VanChartBorderWithRadiusPane borderPane; - protected VanChartBackgroundWithOutImagePane backgroundPane; - protected UIButtonGroup location; - protected UIToggleButton customFloatPositionButton; - protected VanChartFloatPositionPane customFloatPositionPane; + private ChartTextAttrPane textAttrPane; + private VanChartBorderWithRadiusPane borderPane; + private VanChartBackgroundWithOutImagePane backgroundPane; + private UIButtonGroup location; + private UIToggleButton customFloatPositionButton; + private UIButtonGroup arrangeButton; + private JPanel arrangePane; + private VanChartFloatPositionPane customFloatPositionPane; //区域显示策略 恢复用注释。下面4行删除。 - protected UIButtonGroup limitSize; - protected UISpinner maxProportion; + private UIButtonGroup limitSize; + private UISpinner maxProportion; private UILabel limitSizeTitle; private JPanel maxProportionPane; //区域显示策略 恢复用注释。取消注释。 //private LimitPane limitPane; //高亮显示的按钮 - protected UIButtonGroup highlightButton; - protected JPanel highlightPane; - - - protected VanChartStylePane parent; + private UIButtonGroup highlightButton; + private JPanel highlightPane; + private VanChartStylePane parent; public VanChartPlotLegendPane() { initComponents(); @@ -81,7 +81,27 @@ public class VanChartPlotLegendPane extends BasicPane { initComponents(); } - protected void initComponents(){ + public JPanel getHighlightPane() { + return highlightPane; + } + + public VanChartStylePane getLegendPaneParent() { + return parent; + } + + public JPanel getArrangePane() { + return arrangePane; + } + + public UIButtonGroup getLegendLocation() { + return location; + } + + public UIToggleButton getCustomFloatPositionButton() { + return customFloatPositionButton; + } + + private void initComponents() { isLegendVisible = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Legend_Visible")); legendPane = createLegendPane(); @@ -101,7 +121,7 @@ public class VanChartPlotLegendPane extends BasicPane { addLegendListener(); } - protected void addLegendListener(){ + private void addLegendListener() { isLegendVisible.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { checkBoxUse(); @@ -154,11 +174,19 @@ public class VanChartPlotLegendPane extends BasicPane { return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } - protected JPanel createTitlePositionPane(double[] row, double[] col){ - String[] textArray = {Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Top"), Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Bottom"), - Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Left"), Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Right"), Toolkit.i18nText("Fine-Design_Chart_Right_Top")}; + private JPanel createTitlePositionPane(double[] row, double[] col) { + String[] textArray = { + Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Top"), + Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Bottom"), + Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Left"), + Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Right"), + Toolkit.i18nText("Fine-Design_Chart_Right_Top") + }; + Integer[] valueArray = {Constants.TOP, Constants.BOTTOM, Constants.LEFT, Constants.RIGHT, Constants.RIGHT_TOP}; - Icon[] iconArray = {BaseUtils.readIcon("/com/fr/design/images/chart/ChartLegend/layout_top.png"), + + Icon[] iconArray = { + BaseUtils.readIcon("/com/fr/design/images/chart/ChartLegend/layout_top.png"), BaseUtils.readIcon("/com/fr/design/images/chart/ChartLegend/layout_bottom.png"), BaseUtils.readIcon("/com/fr/design/images/chart/ChartLegend/layout_left.png"), BaseUtils.readIcon("/com/fr/design/images/chart/ChartLegend/layout_right.png"), @@ -179,19 +207,42 @@ public class VanChartPlotLegendPane extends BasicPane { }; customFloatPositionPane = new VanChartFloatPositionPane(); + arrangePane = createArrangePane(); initPositionListener(); - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,row,col); + JPanel positionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); + + JPanel panel = new JPanel(new BorderLayout()); + panel.add(positionPane, BorderLayout.NORTH); + panel.add(arrangePane, BorderLayout.CENTER); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), panel); } + private JPanel createArrangePane() { + arrangeButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Arrange_Flow"), Toolkit.i18nText("Fine-Design_Chart_Arrange_Aligned")}, + new ArrangeType[]{ArrangeType.FLOW, ArrangeType.ALIGNED}); + + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + + Component[][] components = new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Arrange")), arrangeButton} + }; + + return TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p}, new double[]{f, e}); + } + private void initPositionListener(){ location.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { customFloatPositionButton.setSelected(false); + checkArrangePaneVisible(); checkDisplayStrategyUse(); } }); @@ -201,6 +252,7 @@ public class VanChartPlotLegendPane extends BasicPane { public void mouseClicked(MouseEvent e) { if(!customFloatPositionButton.isSelected()){ customFloatPositionButton.setSelected(true); + checkArrangePaneVisible(); checkDisplayStrategyUse(); } } @@ -229,12 +281,12 @@ public class VanChartPlotLegendPane extends BasicPane { }); } - protected JPanel createTitleStylePane(){ + private JPanel createTitleStylePane() { textAttrPane = new ChartTextAttrPane(); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane); } - protected JPanel createDisplayStrategy(){ + private JPanel createDisplayStrategy() { //区域显示策略 恢复用注释。开始删除。 maxProportion = new UISpinner(0, 100, 1, 30); limitSize = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), Toolkit.i18nText("Fine-Design_Chart_Custom")}); @@ -278,10 +330,18 @@ public class VanChartPlotLegendPane extends BasicPane { protected void checkAllUse() { checkBoxUse(); + checkArrangePaneVisible(); checkDisplayStrategyUse(); this.repaint(); } + protected void checkArrangePaneVisible() { + boolean visible = !getCustomFloatPositionButton().isSelected() + && (getLegendLocation().getSelectedIndex() == 0 || getLegendLocation().getSelectedIndex() == 1); + + arrangePane.setVisible(visible); + } + //检查显示策略界面是否可用 protected void checkDisplayStrategyUse() { //区域显示策略 恢复用注释。下面2行删除。 @@ -326,6 +386,7 @@ public class VanChartPlotLegendPane extends BasicPane { legend.setPosition(-1); } legend.setFloating(customFloatPositionButton.isSelected()); + legend.setArrange(arrangeButton.getSelectedItem()); //区域显示策略 恢复用注释。下面2行删除。 legend.setLimitSize(limitSize.getSelectedIndex() == 1); legend.setMaxHeight(maxProportion.getValue()); @@ -350,6 +411,7 @@ public class VanChartPlotLegendPane extends BasicPane { customFloatPositionButton.setSelected(legend.isFloating()); customFloatPositionPane.setFloatPosition_x(legend.getFloatPercentX()); customFloatPositionPane.setFloatPosition_y(legend.getFloatPercentY()); + arrangeButton.setSelectedItem(legend.getArrange()); //区域显示策略 恢复用注释。下面2行删除。 limitSize.setSelectedIndex(legend.isLimitSize() ? 1 : 0); maxProportion.setValue(legend.getMaxHeight()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java index 2e7ae3278..cb708963b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java @@ -3,6 +3,7 @@ package com.fr.van.chart.designer.style; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.layout.TableLayout; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayoutHelper; import com.fr.plugin.chart.attr.VanChartLegend; import com.fr.plugin.chart.range.VanChartRangeLegend; @@ -49,10 +50,10 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { ordinaryLegendPane = new JPanel(); //渐变色图例面板 gradualLegendPane = createGradualLegendPane(); - gradualLegendPane.setParentPane(parent); + gradualLegendPane.setParentPane(this.getLegendPaneParent()); //区域段图例面板 sectionLegendPane = createSectionLegendPane(); - sectionLegendPane.setParentPane(parent); + sectionLegendPane.setParentPane(this.getLegendPaneParent()); JPanel panel = new JPanel(new CardLayout()){ @Override @@ -79,7 +80,7 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { } protected SectionLegendPane createSectionLegendPane() { - return new SectionLegendPane(this.parent); + return new SectionLegendPane(this.getLegendPaneParent()); } private JPanel createTableLayoutPaneWithTitle(String title, Component component) { @@ -88,9 +89,9 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { protected UIButtonGroup createLegendTypeButton(){ return new UIButtonGroup(new String[]{ - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Legend_Ordinary"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Legend_Gradual"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Legend_Section") + Toolkit.i18nText("Fine-Design_Chart_Legend_Ordinary"), + Toolkit.i18nText("Fine-Design_Chart_Legend_Gradual"), + Toolkit.i18nText("Fine-Design_Chart_Legend_Section") }, new LegendType[]{LegendType.ORDINARY, LegendType.GRADUAL, LegendType.SECTION}); } @@ -104,7 +105,7 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { initLegendTypeButtonListener(); - JPanel legendTypeButtonWithTilePane = createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Legend_Form"),legendTypeButton); + JPanel legendTypeButtonWithTilePane = createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Legend_Form"), legendTypeButton); legendTypeButtonWithTilePane.setBorder(BorderFactory.createEmptyBorder(0,5,0,0)); rangeLegendPane = createRangeLegendPane(); @@ -129,6 +130,7 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { @Override public void actionPerformed(ActionEvent e) { checkCardPane(); + checkArrangePaneVisible(); } }); } @@ -138,33 +140,29 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { cardLayout.show(rangeLegendPane, legendTypeButton.getSelectedItem().getStringType()); } - @Override - protected void addLegendListener(){ - isLegendVisible.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - checkBoxUse(); - } - }); - } - @Override protected void checkAllUse() { checkBoxUse(); + checkArrangePaneVisible(); checkDisplayStrategyUse(); checkCardPane(); this.repaint(); } - @Override - protected void checkBoxUse() { - isLegendVisible.setEnabled(true); - legendPane.setVisible(isLegendVisible.isSelected()); + protected void checkArrangePaneVisible() { + boolean visible = legendTypeButton.getSelectedItem() != LegendType.GRADUAL + && !getCustomFloatPositionButton().isSelected() + && (getLegendLocation().getSelectedIndex() == 0 || getLegendLocation().getSelectedIndex() == 1); + + getArrangePane().setVisible(visible); } private void checkHighlightVisible(){ - if(this.highlightPane != null){ + JPanel highlightPane = this.getHighlightPane(); + + if (highlightPane != null) { LegendType legendType = legendTypeButton.getSelectedItem(); - this.highlightPane.setVisible(legendType != LegendType.GRADUAL); + highlightPane.setVisible(legendType != LegendType.GRADUAL); } } From 51b8d222cd1bd525eef8c2a36369e6eef8973e6b Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 2 Apr 2020 15:22:32 +0800 Subject: [PATCH 173/375] =?UTF-8?q?REPORT-28351=20=E5=BC=BA=E8=BD=AC?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20=E5=90=8C=E6=AD=A5=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/template/info/JWorkBookProcessInfo.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java index eec777328..85266b7cd 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java @@ -5,6 +5,7 @@ import com.fr.main.impl.WorkBook; import com.fr.main.parameter.ReportParameterAttr; import com.fr.report.cellcase.CellCase; import com.fr.report.poly.PolyWorkSheet; +import com.fr.report.report.Report; import com.fr.report.worksheet.WorkSheet; import java.util.Iterator; @@ -61,8 +62,12 @@ public class JWorkBookProcessInfo extends TemplateProcessInfo { int blockCount = 0; if (!template.isElementCaseBook()) { // 如果是聚合报表 for (int i = 0; i < template.getReportCount(); i++) { - PolyWorkSheet r = (PolyWorkSheet) template.getReport(i); - blockCount += r.getBlockCount(); + Report report = template.getReport(i); + // 考虑多个sheet下 包含WorkSheet的情况 需要判断下 + if (report instanceof PolyWorkSheet) { + PolyWorkSheet r = (PolyWorkSheet) report; + blockCount += r.getBlockCount(); + } } } return blockCount; From d0bc79e59e6e325bfa280cc0a9965d1b0d0bd1ce Mon Sep 17 00:00:00 2001 From: eason-skx Date: Thu, 2 Apr 2020 17:04:21 +0800 Subject: [PATCH 174/375] =?UTF-8?q?feat:CHART-12905=20=E5=88=A0=E9=99=A4ph?= =?UTF-8?q?antom=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/chart/ChartDesignerActivator.java | 26 +++++++------------ .../fr/design/chart/gui/ChartComponent.java | 9 ++----- .../design/mainframe/chart/ChartEditPane.java | 6 ----- 3 files changed, 12 insertions(+), 29 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java index c3213c10b..c5bfdc839 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java @@ -4,7 +4,6 @@ import com.fr.chart.chartattr.ChartCollection; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.gui.ChartComponent; -import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.ChartPropertyPane; import com.fr.design.module.ChartEmptyDataStyleAction; import com.fr.design.module.ChartHyperlinkGroup; @@ -16,42 +15,37 @@ import com.fr.locale.LocaleMarker; import com.fr.locale.LocaleScope; import com.fr.module.Activator; import com.fr.module.extension.Prepare; -import com.fr.plugin.chart.vanchart.imgevent.design.DesignImageEvent; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; -import com.fr.van.chart.DownloadOnlineSourcesHelper; import com.fr.van.chart.map.server.ChartMapEditorAction; /** * Created by juhaoyu on 2018/6/27. */ public class ChartDesignerActivator extends Activator implements Prepare { - + @Override public void start() { - + StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class); StableFactory.getStaticMarkedInstanceObjectFromClass(ExtraChartDesignClassManagerProvider.XML_TAG, ExtraChartDesignClassManagerProvider.class); - + DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup()); - + DesignModuleFactory.registerChartEditorClass(ChartEditor.class); DesignModuleFactory.registerChartComponentClass(ChartComponent.class); - + DesignModuleFactory.registerChartDialogClass(ChartDialog.class); - + DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); - + ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); ActionFactory.registerChartEmptyDataStyleAction(new ChartEmptyDataStyleAction()); ActionFactory.registerChartMapEditorAction(new ChartMapEditorAction()); - + ActionFactory.registerChartCollection(ChartCollection.class); - + DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption()); - - DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance()); - DesignImageEvent.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); ChartTypeInterfaceManager.addPluginChangedListener(); } @@ -63,6 +57,6 @@ public class ChartDesignerActivator extends Activator implements Prepare { @Override public void stop() { - + } } diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java index ca1f4f140..c8fafe9cd 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java +++ b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java @@ -31,7 +31,7 @@ import java.awt.event.MouseMotionListener; * 类说明: 事件说明: 工具栏编辑--> 是刷新ChartComponent 然后响应整个设计块的改变事件 右键编辑 ---> 刷新ChartCompment 刷新对应的工具栏(加入事件) 然后响应整个设计块的改变事件 */ -public class ChartComponent extends MiddleChartComponent implements MouseListener, MouseMotionListener, CallbackEvent{ +public class ChartComponent extends MiddleChartComponent implements MouseListener, MouseMotionListener{ private static final long serialVersionUID = 744164838619052097L; private final List listeners = new ArrayList(); private ChartCollection chartCollection4Design; @@ -257,12 +257,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene if (resolution == 0){ resolution = ScreenResolution.getScreenResolution(); } - painter.paint(g2d, chartWidth, chartHeight, resolution, null, this); + painter.paint(g2d, chartWidth, chartHeight, resolution, null); } } - - @Override - public void callback() { - this.repaint(); - } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java index af6540893..0089785ce 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java @@ -115,12 +115,6 @@ public class ChartEditPane extends BasicPane implements AttributeChange, Prepare if (!ComparatorUtils.equals(collection, lastCollection)) { - VanChart vanChart = collection.getSelectedChartProvider(VanChart.class); - if (vanChart != null) { - //此处画图 - vanChart.demoImgEvent(true); - } - try { lastCollection = collection.clone(); } catch (CloneNotSupportedException e) { From e108f4d28ba58ea8318b89bfe567bcaa0487792b Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 2 Apr 2020 17:16:45 +0800 Subject: [PATCH 175/375] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/VanChartPlotLegendPane.java | 44 +++++++++---------- .../style/VanChartRangeLegendPane.java | 11 ++--- 2 files changed, 26 insertions(+), 29 deletions(-) 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 51faecff1..acfc7811e 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 @@ -16,7 +16,7 @@ import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.attr.VanChartLegend; -import com.fr.plugin.chart.type.ArrangeType; +import com.fr.plugin.chart.type.LayoutType; import com.fr.stable.Constants; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartFloatPositionPane; @@ -54,8 +54,8 @@ public class VanChartPlotLegendPane extends BasicPane { private VanChartBackgroundWithOutImagePane backgroundPane; private UIButtonGroup location; private UIToggleButton customFloatPositionButton; - private UIButtonGroup arrangeButton; - private JPanel arrangePane; + private UIButtonGroup layoutButton; + private JPanel layoutPane; private VanChartFloatPositionPane customFloatPositionPane; //区域显示策略 恢复用注释。下面4行删除。 @@ -89,10 +89,6 @@ public class VanChartPlotLegendPane extends BasicPane { return parent; } - public JPanel getArrangePane() { - return arrangePane; - } - public UIButtonGroup getLegendLocation() { return location; } @@ -207,7 +203,7 @@ public class VanChartPlotLegendPane extends BasicPane { }; customFloatPositionPane = new VanChartFloatPositionPane(); - arrangePane = createArrangePane(); + layoutPane = createLayoutPane(); initPositionListener(); @@ -215,14 +211,15 @@ public class VanChartPlotLegendPane extends BasicPane { JPanel panel = new JPanel(new BorderLayout()); panel.add(positionPane, BorderLayout.NORTH); - panel.add(arrangePane, BorderLayout.CENTER); + panel.add(layoutPane, BorderLayout.CENTER); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), panel); } - private JPanel createArrangePane() { - arrangeButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Arrange_Flow"), Toolkit.i18nText("Fine-Design_Chart_Arrange_Aligned")}, - new ArrangeType[]{ArrangeType.FLOW, ArrangeType.ALIGNED}); + private JPanel createLayoutPane() { + layoutButton = new UIButtonGroup<>( + new String[]{Toolkit.i18nText("Fine-Design_Chart_Layout_Flow"), Toolkit.i18nText("Fine-Design_Chart_Layout_Aligned")}, + new LayoutType[]{LayoutType.FLOW, LayoutType.ALIGNED}); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -230,7 +227,7 @@ public class VanChartPlotLegendPane extends BasicPane { Component[][] components = new Component[][]{ new Component[]{null, null}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Arrange")), arrangeButton} + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Arrange")), layoutButton} }; return TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p}, new double[]{f, e}); @@ -242,7 +239,7 @@ public class VanChartPlotLegendPane extends BasicPane { @Override public void stateChanged(ChangeEvent e) { customFloatPositionButton.setSelected(false); - checkArrangePaneVisible(); + checkLayoutPaneVisible(); checkDisplayStrategyUse(); } }); @@ -252,7 +249,7 @@ public class VanChartPlotLegendPane extends BasicPane { public void mouseClicked(MouseEvent e) { if(!customFloatPositionButton.isSelected()){ customFloatPositionButton.setSelected(true); - checkArrangePaneVisible(); + checkLayoutPaneVisible(); checkDisplayStrategyUse(); } } @@ -330,16 +327,19 @@ public class VanChartPlotLegendPane extends BasicPane { protected void checkAllUse() { checkBoxUse(); - checkArrangePaneVisible(); + checkLayoutPaneVisible(); checkDisplayStrategyUse(); this.repaint(); } - protected void checkArrangePaneVisible() { - boolean visible = !getCustomFloatPositionButton().isSelected() - && (getLegendLocation().getSelectedIndex() == 0 || getLegendLocation().getSelectedIndex() == 1); + protected void checkLayoutPaneVisible() { + layoutPane.setVisible(isVisibleLayoutPane()); + } + + protected boolean isVisibleLayoutPane() { + int locationIndex = getLegendLocation().getSelectedIndex(); - arrangePane.setVisible(visible); + return !getCustomFloatPositionButton().isSelected() && (locationIndex == 0 || locationIndex == 1); } //检查显示策略界面是否可用 @@ -386,7 +386,7 @@ public class VanChartPlotLegendPane extends BasicPane { legend.setPosition(-1); } legend.setFloating(customFloatPositionButton.isSelected()); - legend.setArrange(arrangeButton.getSelectedItem()); + legend.setLayout(layoutButton.getSelectedItem()); //区域显示策略 恢复用注释。下面2行删除。 legend.setLimitSize(limitSize.getSelectedIndex() == 1); legend.setMaxHeight(maxProportion.getValue()); @@ -411,7 +411,7 @@ public class VanChartPlotLegendPane extends BasicPane { customFloatPositionButton.setSelected(legend.isFloating()); customFloatPositionPane.setFloatPosition_x(legend.getFloatPercentX()); customFloatPositionPane.setFloatPosition_y(legend.getFloatPercentY()); - arrangeButton.setSelectedItem(legend.getArrange()); + layoutButton.setSelectedItem(legend.getLayout()); //区域显示策略 恢复用注释。下面2行删除。 limitSize.setSelectedIndex(legend.isLimitSize() ? 1 : 0); maxProportion.setValue(legend.getMaxHeight()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java index cb708963b..25ef2a15b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java @@ -130,7 +130,7 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { @Override public void actionPerformed(ActionEvent e) { checkCardPane(); - checkArrangePaneVisible(); + checkLayoutPaneVisible(); } }); } @@ -143,18 +143,15 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { @Override protected void checkAllUse() { checkBoxUse(); - checkArrangePaneVisible(); + checkLayoutPaneVisible(); checkDisplayStrategyUse(); checkCardPane(); this.repaint(); } - protected void checkArrangePaneVisible() { - boolean visible = legendTypeButton.getSelectedItem() != LegendType.GRADUAL - && !getCustomFloatPositionButton().isSelected() - && (getLegendLocation().getSelectedIndex() == 0 || getLegendLocation().getSelectedIndex() == 1); + protected boolean isVisibleLayoutPane() { - getArrangePane().setVisible(visible); + return super.isVisibleLayoutPane() && legendTypeButton.getSelectedItem() != LegendType.GRADUAL; } private void checkHighlightVisible(){ From f2300031de0940d63f0af5315f1cf09e644c1d4b Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 2 Apr 2020 17:39:04 +0800 Subject: [PATCH 176/375] =?UTF-8?q?=E6=B6=88=E9=99=A4=E9=AD=94=E6=9C=AF?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/designer/style/VanChartPlotLegendPane.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 acfc7811e..faa112952 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 @@ -337,9 +337,13 @@ public class VanChartPlotLegendPane extends BasicPane { } protected boolean isVisibleLayoutPane() { - int locationIndex = getLegendLocation().getSelectedIndex(); + if (customFloatPositionButton.isSelected()) { + return false; + } + + int locationIntValue = getLegendLocation().getSelectedItem(); - return !getCustomFloatPositionButton().isSelected() && (locationIndex == 0 || locationIndex == 1); + return locationIntValue == Constants.TOP || locationIntValue == Constants.BOTTOM; } //检查显示策略界面是否可用 From 6c59a624a80e90a82d8b9d6be89d8e3f2f0d2df7 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 3 Apr 2020 09:54:05 +0800 Subject: [PATCH 177/375] =?UTF-8?q?REPORT-26941=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E8=8F=9C=E5=8D=95-=E9=80=89=E9=A1=B9=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=BA=9F=E5=BC=83=E9=85=8D=E7=BD=AE=E9=A1=B9=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/PreferencePane.java | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 3fc03f438..8f88cdeff 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -149,9 +149,6 @@ public class PreferencePane extends BasicPane { private UIColorButton paginationLineColorTBButton; - private UICheckBox supportCellEditorDefCheckBox; - private UICheckBox isDragPermitedCheckBox; - private UITextField logExportDirectoryField; private UIComboBox logLevelComboBox, pageLengthComboBox, reportLengthComboBox; @@ -199,7 +196,6 @@ public class PreferencePane extends BasicPane { createFunctionPane(generalPane); createEditPane(generalPane); - createGuiOfGridPane(generalPane); createColorSettingPane(generalPane); createVcsSettingPane(generalPane); @@ -447,18 +443,6 @@ public class PreferencePane extends BasicPane { } - private void createGuiOfGridPane(JPanel generalPane) { - // GridPane - JPanel guiOfGridPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Preference_Setting_Grid")); - generalPane.add(guiOfGridPane); - - supportCellEditorDefCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Preference_Support_Cell_Editor_Definition")); - guiOfGridPane.add(supportCellEditorDefCheckBox); - - isDragPermitedCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Preference_Is_Drag_Permited")); - guiOfGridPane.add(isDragPermitedCheckBox); - } - private void createColorSettingPane(JPanel generalPane) { // Color Setting Pane JPanel colorSettingPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Preference_Setting_Colors")); @@ -696,9 +680,6 @@ public class PreferencePane extends BasicPane { useIntervalCheckBox.setSelected(vcsConfigManager.isUseInterval()); gcEnableCheckBox.setSelected(GcConfig.getInstance().isGcEnable()); gcButton.setEnabled(gcEnableCheckBox.isSelected()); - supportCellEditorDefCheckBox.setSelected(designerEnvManager.isSupportCellEditorDef()); - - isDragPermitedCheckBox.setSelected(designerEnvManager.isDragPermited()); gridLineColorTBButton.setColor(designerEnvManager.getGridLineColor()); paginationLineColorTBButton.setColor(designerEnvManager.getPaginationLineColor()); @@ -768,12 +749,8 @@ public class PreferencePane extends BasicPane { designerEnvManager.setDefaultStringToFormula(defaultStringToFormulaBox.isSelected()); - designerEnvManager.setSupportCellEditorDef(supportCellEditorDefCheckBox.isSelected()); - designerEnvManager.setAutoCompleteShortcuts(shortCutKeyStore != null ? shortCutKeyStore.toString().replace(TYPE, DISPLAY_TYPE) : shortCutLabel.getText()); - designerEnvManager.setDragPermited(isDragPermitedCheckBox.isSelected()); - designerEnvManager.setGridLineColor(gridLineColorTBButton.getColor()); designerEnvManager.setPaginationLineColor(paginationLineColorTBButton.getColor()); From fc7c0f090cf1e38d7b5b2c8a51c273bd62d064b1 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 3 Apr 2020 13:23:20 +0800 Subject: [PATCH 178/375] =?UTF-8?q?CHART-12817=20=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=97=A7=E6=A8=A1=E7=89=88=E4=B8=AD=E7=9A=84=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E9=99=90=E5=88=B6=E4=B8=8D=E9=99=90=E5=88=B6=E4=B8=BA=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/style/VanChartPlotLegendPane.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) 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 faa112952..5a9d8ebda 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 @@ -59,9 +59,8 @@ public class VanChartPlotLegendPane extends BasicPane { private VanChartFloatPositionPane customFloatPositionPane; //区域显示策略 恢复用注释。下面4行删除。 - private UIButtonGroup limitSize; + private UIButtonGroup customSize; private UISpinner maxProportion; - private UILabel limitSizeTitle; private JPanel maxProportionPane; //区域显示策略 恢复用注释。取消注释。 //private LimitPane limitPane; @@ -286,17 +285,16 @@ public class VanChartPlotLegendPane extends BasicPane { private JPanel createDisplayStrategy() { //区域显示策略 恢复用注释。开始删除。 maxProportion = new UISpinner(0, 100, 1, 30); - limitSize = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), Toolkit.i18nText("Fine-Design_Chart_Custom")}); - limitSizeTitle = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Max_Proportion")); + customSize = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), Toolkit.i18nText("Fine-Design_Chart_Custom")}); - JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Area_Size"), limitSize); + JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Area_Size"), customSize); maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); JPanel panel = new JPanel(new BorderLayout()); panel.add(limitSizePane, BorderLayout.NORTH); panel.add(maxProportionPane, BorderLayout.CENTER); - limitSize.addActionListener(new ActionListener() { + customSize.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { checkMaxProPortionUse(); @@ -349,7 +347,7 @@ public class VanChartPlotLegendPane extends BasicPane { //检查显示策略界面是否可用 protected void checkDisplayStrategyUse() { //区域显示策略 恢复用注释。下面2行删除。 - limitSize.setEnabled(!customFloatPositionButton.isSelected()); + customSize.setEnabled(!customFloatPositionButton.isSelected()); checkMaxProPortionUse(); //区域显示策略 恢复用注释。取消注释。 // GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected()); @@ -359,7 +357,7 @@ public class VanChartPlotLegendPane extends BasicPane { //区域显示策略 恢复用注释。删除下面方法。 //检查最大显示占比是否可用 private void checkMaxProPortionUse() { - maxProportionPane.setVisible(limitSize.getSelectedIndex() == 1 && limitSize.isEnabled()); + maxProportionPane.setVisible(customSize.getSelectedIndex() == 1 && customSize.isEnabled()); } protected void checkBoxUse() { @@ -392,7 +390,7 @@ public class VanChartPlotLegendPane extends BasicPane { legend.setFloating(customFloatPositionButton.isSelected()); legend.setLayout(layoutButton.getSelectedItem()); //区域显示策略 恢复用注释。下面2行删除。 - legend.setLimitSize(limitSize.getSelectedIndex() == 1); + legend.setCustomSize(customSize.getSelectedIndex() == 1); legend.setMaxHeight(maxProportion.getValue()); //区域显示策略 恢复用注释。取消注释。 //legend.setLimitAttribute(limitPane.updateBean()); @@ -417,7 +415,7 @@ public class VanChartPlotLegendPane extends BasicPane { customFloatPositionPane.setFloatPosition_y(legend.getFloatPercentY()); layoutButton.setSelectedItem(legend.getLayout()); //区域显示策略 恢复用注释。下面2行删除。 - limitSize.setSelectedIndex(legend.isLimitSize() ? 1 : 0); + customSize.setSelectedIndex(legend.isCustomSize() ? 1 : 0); maxProportion.setValue(legend.getMaxHeight()); //区域显示策略 恢复用注释。取消注释。 //limitPane.populateBean(legend.getLimitAttribute()); From 74f3b0957a4df47b3795b57f3cbdec80e034915c Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Fri, 3 Apr 2020 14:54:12 +0800 Subject: [PATCH 179/375] =?UTF-8?q?REPORT-28697=20=E8=BE=B9=E6=A1=86?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=BA=E9=80=8F=E6=98=8E=E8=89=B2=EF=BC=8C?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/style/BorderPane.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/BorderPane.java b/designer-base/src/main/java/com/fr/design/style/BorderPane.java index aa1185f5d..442f30189 100644 --- a/designer-base/src/main/java/com/fr/design/style/BorderPane.java +++ b/designer-base/src/main/java/com/fr/design/style/BorderPane.java @@ -14,6 +14,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.style.color.ColorSelectBox; +import com.fr.design.style.color.NewColorSelectBox; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; @@ -69,7 +70,7 @@ public class BorderPane extends BasicPane { private JToggleButton rightToggleButton; private LineComboBox currentLineCombo; - private ColorSelectBox currentLineColorPane; + private NewColorSelectBox currentLineColorPane; private UIButton insidebutton; @@ -88,7 +89,7 @@ public class BorderPane extends BasicPane { verticalToggleButton = new ToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/vertical.png"), BorderPane.VERTICAL_BORDER); rightToggleButton = new ToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/right.png"), BorderPane.RIGHT_BORDER); this.currentLineCombo = new LineComboBox(CoreConstants.UNDERLINE_STYLE_ARRAY); - this.currentLineColorPane = new ColorSelectBox(100); + this.currentLineColorPane = new NewColorSelectBox(100); this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); this.setLayout(FRGUIPaneFactory.createBorderLayout()); From 74ebe8ddc471fc213c3c4bc5534a376e4b150702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 3 Apr 2020 16:05:30 +0800 Subject: [PATCH 180/375] =?UTF-8?q?CHART-13272=20=E5=9F=8B=E7=82=B9?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AD=97=E6=AE=B5&&=E6=B5=8B=E8=AF=95=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/info/ChartInfo.java | 45 +++++++++++++++++-- .../chart/info/ChartInfoCollector.java | 39 +++++++++++----- .../design/mainframe/chart/ChartEditPane.java | 4 +- .../type/AbstractVanChartTypePane.java | 2 +- .../mainframe/FormCreatorDropTarget.java | 17 +++++-- 5 files changed, 87 insertions(+), 20 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java index 9d305ef1d..69e2c0802 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java @@ -30,6 +30,7 @@ public class ChartInfo extends AbstractPointInfo { private static final String XML_CHART_CONSUMING_MAP = "chartConsumingMap"; private static final String ATTR_TEST_TEMPLATE = "testTemplate"; + private static final String ATTR_TEST_CHART = "testChart"; private static final String ATTR_DAY_COUNT = "day_count"; private static final String ATTR_USERNAME = "username"; private static final String ATTR_UUID = "uuid"; @@ -44,6 +45,11 @@ public class ChartInfo extends AbstractPointInfo { private static final String ATTR_CHART_PROPERTY_END_TIME = "chartPropertyEndTime"; private static final String ATTR_JAR_TIME = "jarTime"; private static final String ATTR_VERSION = "version"; + private static final String ATTR_USER_ID = "userId"; + private static final String ATTR_FIRST_CHART_TYPE = "firstChartType"; + private static final String ATTR_OVER_CHART_TYPE_COUNT = "overChartTypeCount"; + private static final String ATTR_IS_NEW = "isNew"; + private static final String ATTR_IS_REUSE = "isReuse"; private static final int COMPLETE_DAY_COUNT = 3; // 判断图表是否可以上传的天数 @@ -57,6 +63,8 @@ public class ChartInfo extends AbstractPointInfo { private boolean testTemplate; + private boolean testChart; + private ChartInfo() { } @@ -64,6 +72,7 @@ public class ChartInfo extends AbstractPointInfo { this.chartId = chartId; this.templateId = templateId; this.book = book; + this.testChart = true; } public String getChartId() { @@ -91,13 +100,17 @@ public class ChartInfo extends AbstractPointInfo { @Override public boolean isTestTemplate() { - return testTemplate; + return testTemplate || testChart; } public void setTestTemplate(boolean testTemplate) { this.testTemplate = testTemplate; } + public void setTestChart(boolean testChart) { + this.testChart = testChart; + } + static ChartInfo newInstanceByRead(XMLableReader reader) { ChartInfo chartInfo = new ChartInfo(); reader.readXMLObject(chartInfo); @@ -105,13 +118,14 @@ public class ChartInfo extends AbstractPointInfo { } public static ChartInfo newInstance(String chartId, String chartType) { - return newInstance(chartId, chartType, null); + return newInstance(chartId, chartType, null, false, false); } - public static ChartInfo newInstance(String chartId, String chartType, String createTime) { + public static ChartInfo newInstance(String chartId, String chartType, String createTime, boolean isNew, boolean isReuse) { HashMap chartConsumingMap = new HashMap<>(); String username = MarketConfig.getInstance().getBbsUsername(); + String userId = String.valueOf(MarketConfig.getInstance().getBbsUid()); String uuid = DesignerEnvManager.getEnvManager().getUUID(); String activityKey = DesignerEnvManager.getEnvManager().getActivationKey(); @@ -138,6 +152,11 @@ public class ChartInfo extends AbstractPointInfo { chartConsumingMap.put(ATTR_CHART_PROPERTY_END_TIME, ""); chartConsumingMap.put(ATTR_JAR_TIME, jarTime); chartConsumingMap.put(ATTR_VERSION, version); + chartConsumingMap.put(ATTR_USER_ID, userId); + chartConsumingMap.put(ATTR_FIRST_CHART_TYPE, chartType); + chartConsumingMap.put(ATTR_OVER_CHART_TYPE_COUNT, "0"); + chartConsumingMap.put(ATTR_IS_NEW, String.valueOf(isNew)); + chartConsumingMap.put(ATTR_IS_REUSE, String.valueOf(isReuse)); ChartInfo chartInfo = new ChartInfo(chartId, templateId, book); chartInfo.chartConsumingMap = chartConsumingMap; @@ -158,6 +177,7 @@ public class ChartInfo extends AbstractPointInfo { writer.attr(ATTR_DAY_COUNT, this.idleDayCount); } writer.attr(ATTR_TEST_TEMPLATE, this.testTemplate); + writer.attr(ATTR_TEST_CHART, this.testChart); writer.startTAG(XML_CHART_CONSUMING_MAP); writer.attr(ATTR_USERNAME, chartConsumingMap.get(ATTR_USERNAME)); writer.attr(ATTR_UUID, chartConsumingMap.get(ATTR_UUID)); @@ -170,6 +190,11 @@ public class ChartInfo extends AbstractPointInfo { writer.attr(ATTR_CHART_PROPERTY_END_TIME, chartConsumingMap.get(ATTR_CHART_PROPERTY_END_TIME)); writer.attr(ATTR_JAR_TIME, chartConsumingMap.get(ATTR_JAR_TIME)); writer.attr(ATTR_VERSION, chartConsumingMap.get(ATTR_VERSION)); + writer.attr(ATTR_USER_ID, chartConsumingMap.get(ATTR_USER_ID)); + writer.attr(ATTR_FIRST_CHART_TYPE, chartConsumingMap.get(ATTR_FIRST_CHART_TYPE)); + writer.attr(ATTR_OVER_CHART_TYPE_COUNT, chartConsumingMap.get(ATTR_OVER_CHART_TYPE_COUNT)); + writer.attr(ATTR_IS_NEW, chartConsumingMap.get(ATTR_IS_NEW)); + writer.attr(ATTR_IS_REUSE, chartConsumingMap.get(ATTR_IS_REUSE)); writer.end(); writer.end(); } @@ -182,6 +207,7 @@ public class ChartInfo extends AbstractPointInfo { chartId = reader.getAttrAsString(ATTR_CHART_ID, StringUtils.EMPTY); templateId = reader.getAttrAsString(ATTR_TEMPLATE_ID, StringUtils.EMPTY); testTemplate = reader.getAttrAsBoolean(ATTR_TEST_TEMPLATE, true); + testChart = reader.getAttrAsBoolean(ATTR_TEST_CHART, false); } else { String name = reader.getTagName(); if (XML_CHART_CONSUMING_MAP.equals(name)) { @@ -198,6 +224,11 @@ public class ChartInfo extends AbstractPointInfo { chartConsumingMap.put(ATTR_CHART_PROPERTY_END_TIME, reader.getAttrAsString(ATTR_CHART_PROPERTY_END_TIME, StringUtils.EMPTY)); chartConsumingMap.put(ATTR_JAR_TIME, reader.getAttrAsString(ATTR_JAR_TIME, StringUtils.EMPTY)); chartConsumingMap.put(ATTR_VERSION, reader.getAttrAsString(ATTR_VERSION, "8.0")); + chartConsumingMap.put(ATTR_USER_ID, reader.getAttrAsString(ATTR_USER_ID, StringUtils.EMPTY)); + chartConsumingMap.put(ATTR_FIRST_CHART_TYPE, reader.getAttrAsString(ATTR_FIRST_CHART_TYPE, StringUtils.EMPTY)); + chartConsumingMap.put(ATTR_OVER_CHART_TYPE_COUNT, reader.getAttrAsString(ATTR_OVER_CHART_TYPE_COUNT, "0")); + chartConsumingMap.put(ATTR_IS_NEW, reader.getAttrAsString(ATTR_IS_NEW, StringUtils.EMPTY)); + chartConsumingMap.put(ATTR_IS_REUSE, reader.getAttrAsString(ATTR_IS_REUSE, StringUtils.EMPTY)); } } } @@ -231,8 +262,16 @@ public class ChartInfo extends AbstractPointInfo { chartConsumingMap.put(ATTR_CHART_TYPE, chartType); chartConsumingMap.put(ATTR_CHART_PROPERTY_FIRST_TIME, ""); chartConsumingMap.put(ATTR_CHART_PROPERTY_END_TIME, ""); + String count = chartConsumingMap.get(ATTR_OVER_CHART_TYPE_COUNT); + count = StringUtils.isEmpty(count) ? "1" : String.valueOf(Integer.parseInt(count) + 1); + chartConsumingMap.put(ATTR_OVER_CHART_TYPE_COUNT, count); } + public void updateFirstType(String chartType) { + chartConsumingMap.put(ATTR_FIRST_CHART_TYPE, chartType); + } + + @Override public ChartInfo clone() { ChartInfo chartInfo = new ChartInfo(); 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 d622c688a..b1aec5036 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 @@ -53,21 +53,25 @@ public class ChartInfoCollector extends AbstractPointCollector { } public void collection(ChartProvider chartProvider, String createTime) { + collection(chartProvider, createTime, false); + } + + public void collection(ChartProvider chartProvider, String createTime, boolean isReuse) { if (chartProvider instanceof VanChart) { VanChart vanChart = (VanChart) chartProvider; - collection(vanChart.getUuid(), vanChart.getID(), createTime); + collection(vanChart.getUuid(), vanChart.getID(), createTime, isReuse); } } /** * 新建图表,保存状态 */ - public void collection(String chartId, String chartType, String createTime) { + public void collection(String chartId, String chartType, String createTime, boolean isReuse) { if (!shouldCollectInfo()) { return; } - ChartInfo chartInfo = ChartInfo.newInstance(chartId, chartType, createTime); + ChartInfo chartInfo = ChartInfo.newInstance(chartId, chartType, createTime, true, isReuse); chartInfoCacheMap.put(chartId, chartInfo); } @@ -85,7 +89,7 @@ public class ChartInfoCollector extends AbstractPointCollector { if (!shouldCollectInfo()) { return; } - ChartInfo chartInfo = getOrCreateChartInfo(chartId, chartType); + ChartInfo chartInfo = getOrCreateChartInfo(chartId, chartType, null); //更新编辑时间 chartInfo.updatePropertyTime(); @@ -94,22 +98,22 @@ public class ChartInfoCollector extends AbstractPointCollector { chartInfo.resetIdleDayCount(); } - public void updateChartTypeTime(ChartProvider chartProvider) { + public void updateChartTypeTime(ChartProvider chartProvider, String oldType) { if (chartProvider instanceof VanChart) { VanChart vanChart = (VanChart) chartProvider; - updateChartTypeTime(vanChart.getUuid(), vanChart.getID()); + updateChartTypeTime(vanChart.getUuid(), vanChart.getID(), oldType); } } /** * 图表类型变化,更新类型和类型确认时间 */ - public void updateChartTypeTime(String chartId, String chartType) { + public void updateChartTypeTime(String chartId, String chartType, String oldType) { if (!shouldCollectInfo()) { return; } - ChartInfo chartInfo = getOrCreateChartInfo(chartId, chartType); + ChartInfo chartInfo = getOrCreateChartInfo(chartId, chartType, oldType); //更新类型确认时间和类型 chartInfo.updateChartType(chartType); @@ -118,7 +122,7 @@ public class ChartInfoCollector extends AbstractPointCollector { chartInfo.resetIdleDayCount(); } - private ChartInfo getOrCreateChartInfo(String chartId, String chartType) { + private ChartInfo getOrCreateChartInfo(String chartId, String chartType, String oldType) { //缓存中有从缓存中拿 if (chartInfoCacheMap.containsKey(chartId)) { return chartInfoCacheMap.get(chartId); @@ -129,12 +133,27 @@ public class ChartInfoCollector extends AbstractPointCollector { chartInfoCacheMap.put(chartId, chartInfo); return chartInfo; } - //都有的话创建一个并加入到缓存中 + //都没有的话创建一个并加入到缓存中 ChartInfo chartInfo = ChartInfo.newInstance(chartId, chartType); + if (StringUtils.isNotEmpty(oldType)) { + chartInfo.updateFirstType(oldType); + } chartInfoCacheMap.put(chartId, chartInfo); return chartInfo; } + public void checkTestChart(ChartProvider chartProvider) { + if (chartProvider instanceof VanChart) { + checkTestChart((VanChart) chartProvider); + } + } + + public void checkTestChart(VanChart vanChart) { + boolean testChart = vanChart.isTestChart(); + ChartInfo chartInfo = chartInfoCacheMap.get(vanChart.getUuid()); + chartInfo.setTestChart(testChart); + } + /** * 保存模板的时候将该模板中的图表埋点信息保存 */ diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java index 0089785ce..83e194c71 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java @@ -6,7 +6,6 @@ import com.fr.chart.chartattr.ChartCollection; import com.fr.chartx.attr.ChartProvider; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.beans.FurtherBasicBeanPane; -import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.tabledata.Prepare4DataSourceChange; import com.fr.design.dialog.BasicPane; @@ -20,9 +19,9 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartOtherPane; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartTypePane; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; -import com.fr.plugin.chart.vanchart.VanChart; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; @@ -116,6 +115,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange, Prepare if (!ComparatorUtils.equals(collection, lastCollection)) { try { + ChartInfoCollector.getInstance().checkTestChart(collection.getSelectedChartProvider(ChartProvider.class)); lastCollection = collection.clone(); } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error("error in clone ChartEditPane"); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index 36f34c995..e9395ccb5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -111,7 +111,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane chartCollections = widget.getChartCollections(); + for (BaseChartCollection baseChartCollection : chartCollections) { + ChartCollection chartCollection = (ChartCollection) baseChartCollection; + for (int i = 0, size = chartCollection.getChartCount(); i < size; i++) { + ChartProvider chart = chartCollection.getChart(i, ChartProvider.class); + //是否是共享的复用组件 + boolean isReuse = StringUtils.isNotEmpty(this.addingModel.getXCreator().getShareId()); + ChartInfoCollector.getInstance().collection(chart, null, isReuse); + ChartInfoCollector.getInstance().checkTestChart(chart); + } } } } From b9708f302f734fdacf9c4bd9818bb30b0bd9764d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 3 Apr 2020 17:02:27 +0800 Subject: [PATCH 181/375] =?UTF-8?q?CHART-13272=20=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=94=B6=E9=9B=86=E5=9F=8B=E7=82=B9=E7=9A=84?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/chart/info/ChartInfoCollector.java | 3 +++ 1 file changed, 3 insertions(+) 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 b1aec5036..bfc5a0d35 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 @@ -149,6 +149,9 @@ public class ChartInfoCollector extends AbstractPointCollector { } public void checkTestChart(VanChart vanChart) { + if (!shouldCollectInfo()) { + return; + } boolean testChart = vanChart.isTestChart(); ChartInfo chartInfo = chartInfoCacheMap.get(vanChart.getUuid()); chartInfo.setTestChart(testChart); From 61d948b24c129af1c9847adebd8e4e2406614c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 7 Apr 2020 13:49:07 +0800 Subject: [PATCH 182/375] =?UTF-8?q?CHART-13222=20=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E4=B8=8B=E7=9A=84=E6=95=B0=E6=8D=AE=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/data/table/SeriesTypeUseComboxPane.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java index 804ca541b..4e78591ad 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java @@ -9,10 +9,12 @@ import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.constants.LayoutConstants; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.frpane.UIComboBoxPane; +import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.design.utils.gui.UIComponentUtils; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -59,11 +61,16 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { this.add(cardPane, BorderLayout.CENTER); dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); JPanel panel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 290, 24, dataScreeningPane); - panel.setBorder(BorderFactory.createEmptyBorder(0,10,0,10)); + panel.setBorder(BorderFactory.createEmptyBorder(0,5,0,5)); dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,5,0,5)); this.add(panel, BorderLayout.SOUTH); } + protected UIComboBox createComboBox() { + UIComboBox uiComboBox = new UIComboBox(); + UIComponentUtils.setPreferedWidth(uiComboBox, 100); + return uiComboBox; + } /** * 检查box 是否使用, hasUse, 表示上层已经使用, 否则, 则此界面都可使用 * @param hasUse 是否使用 From 4646b8e6e19cec3297cc9024e5c4b8dff8a1b598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 7 Apr 2020 16:22:58 +0800 Subject: [PATCH 183/375] =?UTF-8?q?CHART-13274=20&&=20CHART-13285=20?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E9=85=8D=E8=89=B2=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/combobox/ColorSchemeComboBox.java | 4 ++++ .../chart/gui/style/ChartColorAdjustPane.java | 15 ++++++--------- .../designer/component/VanChartFillStylePane.java | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java index ae076b8f3..9fcbeb2b6 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java @@ -14,6 +14,7 @@ import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; @@ -130,6 +131,9 @@ public class ColorSchemeComboBox extends UIComboBox { NORMAL } + public Set getItems() { + return colorSchemes.keySet(); + } public class ColorInfo { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java index 52bde97a6..b053a5eb9 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java @@ -58,8 +58,6 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver { private ChangeListener changeListener; - - public ChartColorAdjustPane() { this(DEFAULT_COLORS); } @@ -70,10 +68,6 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver { createContentPane(); } - public void updateColor() { - updateColor(DEFAULT_COLORS); - } - public void updateColor(Color[] colors) { createColorButton(colors); relayout(); @@ -124,8 +118,9 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver { private void createColorButton(Color[] colors) { colorButtons.clear(); - for (Color color : colors) { - colorButtons.add(createColorButton(color)); + int size = Math.min(colors.length, MAX_BUTTON); + for (int i = 0; i < size; i++) { + colorButtons.add(createColorButton(colors[i])); } } @@ -219,7 +214,9 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver { hidePopupMenu(); Color color = ((ColorSelectPane) e.getSource()).getColor(); fireDisplayComponent(ColorBackground.getInstance(color)); - colorButtons.add(createColorButton(color)); + if(colorButtons.size() < MAX_BUTTON) { + colorButtons.add(createColorButton(color)); + } ChartColorAdjustPane.this.stateChanged(); relayout(); } 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 154ed5557..c66262796 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 @@ -155,7 +155,7 @@ public class VanChartFillStylePane extends BasicBeanPane { @Override public void populateBean(AttrFillStyle condition) { String fillStyleName = condition == null ? "" : condition.getFillStyleName(); - if (StringUtils.isBlank(fillStyleName)) {//兼容处理 + if (StringUtils.isBlank(fillStyleName) || !styleSelectBox.getItems().contains(fillStyleName)) {//兼容处理 if (condition == null || condition.getColorStyle() == ChartConstants.COLOR_DEFAULT) { styleSelectBox.setSelectType(ColorSchemeComboBox.SelectType.DEFAULT);//默认 } else { From 305e063fd6e153f258a122ffaf866a9ba47a39dd Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 7 Apr 2020 11:55:00 +0800 Subject: [PATCH 184/375] =?UTF-8?q?MOBILE-26026=20=E8=81=94=E6=8E=92?= =?UTF-8?q?=E6=8C=89=E9=92=AETab=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 设计器端联排按钮Tab样式配置界面 允许Tab标题栏样式配置界面不显示预览面板 --- .../ui/MobileTemplateStyleDefinePane.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java index feb19463d..0f7c3ed15 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java @@ -63,14 +63,16 @@ public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane Date: Wed, 8 Apr 2020 14:21:12 +0800 Subject: [PATCH 185/375] =?UTF-8?q?MOBILE-26026=20=E8=81=94=E6=8E=92?= =?UTF-8?q?=E6=8C=89=E9=92=AETab=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 设计器端联排按钮Tab样式配置界面 允许Tab标题栏样式配置界面不显示或重写内置的背景和字体设置 --- .../ui/MobileTemplateStyleDefinePane.java | 48 +++++++++++-------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java index 0f7c3ed15..7c07aee6f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java @@ -113,18 +113,7 @@ public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane Date: Wed, 8 Apr 2020 14:22:30 +0800 Subject: [PATCH 186/375] =?UTF-8?q?MOBILE-26026=20=E8=81=94=E6=8E=92?= =?UTF-8?q?=E6=8C=89=E9=92=AETab=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 设计器端联排按钮Tab样式配置界面 --- .../mobile/ui/UniteStyleDefinePane.java | 232 ++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java new file mode 100644 index 000000000..722d5f91c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java @@ -0,0 +1,232 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.gui.ibutton.UIColorButton; +import com.fr.design.gui.icombobox.LineComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UnsignedIntUISpinner; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.widget.MobileTabFontConfPane; +import com.fr.design.mainframe.widget.UITitleSplitLine; +import com.fr.design.mainframe.widget.preview.MobileTemplatePreviewPane; +import com.fr.design.style.color.ColorSelectBox; +import com.fr.form.ui.container.cardlayout.WCardTagLayout; +import com.fr.general.cardtag.mobile.MobileTemplateStyle; +import com.fr.general.cardtag.mobile.TabFontConfig; +import com.fr.general.cardtag.mobile.UniteStyle; +import com.fr.stable.CoreConstants; + +import javax.swing.*; +import java.awt.*; + +public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane { + private static final int SPLIT_LINE_WIDTH = 520; + private static final int SPLIT_LINE_HEIGHT = 20; + + private static final int TOGGLE_BUTTON_WIDTH = 20; + private static final int LABEL_WIDTH = 75; + private static final int LINE_COMPONENT_WIDTH = 157; + private static final int LINE_COMPONENT_HEIGHT = 20; + + private UnsignedIntUISpinner paddingLeftSpinner; + private UnsignedIntUISpinner paddingRightSpinner; + + private ColorSelectBox initialBackgroundColorBox; + private ColorSelectBox selectedBackgroundColorBox; + + private LineComboBox borderWidthComboBox; + private ColorSelectBox borderColorBox; + private UnsignedIntUISpinner borderRadiusSpinner; + + private MobileTabFontConfPane tabFontConfPane; + private UIColorButton selectedFontColorButton; + + public UniteStyleDefinePane(WCardTagLayout tagLayout) { + super(tagLayout); + } + + @Override + protected void createBuiltinConfPane(JPanel centerPane) { + // ignore builtin conf pane + } + + @Override + protected void createExtraConfPane(JPanel centerPane) { + UITitleSplitLine paddingSplit = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Button_Padding"), SPLIT_LINE_WIDTH); + paddingSplit.setPreferredSize(new Dimension(SPLIT_LINE_WIDTH, SPLIT_LINE_HEIGHT)); + centerPane.add(paddingSplit); + centerPane.add(this.createPaddingConfPane()); + + UITitleSplitLine backgroundSplit = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Button_Background"), SPLIT_LINE_WIDTH); + backgroundSplit.setPreferredSize(new Dimension(SPLIT_LINE_WIDTH, SPLIT_LINE_HEIGHT)); + centerPane.add(backgroundSplit); + centerPane.add(this.createBackgroundColorConfPanel()); + + UITitleSplitLine borderSplit = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Border"), SPLIT_LINE_WIDTH); + borderSplit.setPreferredSize(new Dimension(SPLIT_LINE_WIDTH, SPLIT_LINE_HEIGHT)); + centerPane.add(borderSplit); + centerPane.add(this.createBorderConfPanel()); + + UITitleSplitLine fontSplit = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Char"), SPLIT_LINE_WIDTH); + fontSplit.setPreferredSize(new Dimension(SPLIT_LINE_WIDTH, SPLIT_LINE_HEIGHT)); + centerPane.add(fontSplit); + centerPane.add(this.createFontConfPanel()); + } + + private JPanel createPaddingConfPane() { + + this.paddingLeftSpinner = new UnsignedIntUISpinner(0, Integer.MAX_VALUE, 1, UniteStyle.DEFAULT_PADDING_LEFT); + this.paddingLeftSpinner.setPreferredSize(new Dimension(62, LINE_COMPONENT_HEIGHT)); + this.paddingRightSpinner = new UnsignedIntUISpinner(0, Integer.MAX_VALUE, 1, UniteStyle.DEFAULT_PADDING_RIGHT); + this.paddingRightSpinner.setPreferredSize(new Dimension(62, LINE_COMPONENT_HEIGHT)); + + UILabel paddingLeftLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left") + ":", SwingConstants.RIGHT); + paddingLeftLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); + UILabel paddingRightLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Right") + ":", SwingConstants.RIGHT); + paddingLeftLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); + + JPanel paddingPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{ + paddingLeftLabel, paddingLeftSpinner, paddingRightLabel,paddingRightSpinner + }}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + paddingPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 20)); + + return paddingPanel; + } + + private JPanel createBackgroundColorConfPanel() { + this.initialBackgroundColorBox = new ColorSelectBox(LINE_COMPONENT_WIDTH); + this.initialBackgroundColorBox.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT)); + this.selectedBackgroundColorBox = new ColorSelectBox(LINE_COMPONENT_WIDTH); + this.selectedBackgroundColorBox.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT)); + + UILabel initialBackgroundColorLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Init_Fill") + ":", SwingConstants.RIGHT); + initialBackgroundColorLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); + UILabel selectedBackgroundColorLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Select_Fill") + ":", SwingConstants.RIGHT); + selectedBackgroundColorLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); + + JPanel backgroundColorPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ + new Component[]{ initialBackgroundColorLabel, initialBackgroundColorBox }, + new Component[]{ selectedBackgroundColorLabel, selectedBackgroundColorBox } + }, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + backgroundColorPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 20)); + + return backgroundColorPanel; + } + + private JPanel createBorderConfPanel() { + this.borderWidthComboBox = new LineComboBox(CoreConstants.UNDERLINE_STYLE_ARRAY); + this.borderWidthComboBox.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT)); + this.borderColorBox = new ColorSelectBox(LINE_COMPONENT_WIDTH); + this.borderColorBox.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT)); + this.borderRadiusSpinner = new UnsignedIntUISpinner(0, Integer.MAX_VALUE, 1, UniteStyle.DEFAULT_BORDER_RADIUS); + this.borderRadiusSpinner.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT)); + + UILabel borderSizeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_FRFont_Line_Style") + ":", SwingConstants.RIGHT); + borderSizeLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); + UILabel borderColorLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Colors") + ":", SwingConstants.RIGHT); + borderColorLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); + UILabel borderRadiusLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius") + ":", SwingConstants.RIGHT); + borderRadiusLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); + + JPanel borderPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ + new Component[]{ borderSizeLabel, borderWidthComboBox}, + new Component[]{ borderColorLabel, borderColorBox }, + new Component[]{ borderRadiusLabel, borderRadiusSpinner } + }, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + borderPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 20)); + + return borderPanel; + } + + private JPanel createFontConfPanel() { + this.tabFontConfPane = new MobileTabFontConfPane(); + this.selectedFontColorButton = new UIColorButton(); + this.selectedFontColorButton.setPreferredSize(new Dimension(TOGGLE_BUTTON_WIDTH, LINE_COMPONENT_HEIGHT)); + JPanel selectedFontColorPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + selectedFontColorPanel.add(this.selectedFontColorButton); + + UILabel initialFontLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Init_Char") + ":", SwingConstants.RIGHT); + initialFontLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); + UILabel selectedFontLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Select_Char") + ":", SwingConstants.RIGHT); + selectedFontLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT)); + + JPanel fontPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ + new Component[]{ initialFontLabel, tabFontConfPane }, + new Component[]{ selectedFontLabel, selectedFontColorPanel } + }, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + fontPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 20)); + + return fontPanel; + } + + @Override + protected void initDefaultConfig() { + this.paddingLeftSpinner.setValue(UniteStyle.DEFAULT_PADDING_LEFT); + this.paddingRightSpinner.setValue(UniteStyle.DEFAULT_PADDING_RIGHT); + + this.initialBackgroundColorBox.setSelectObject(UniteStyle.DEFAULT_INITIAL_BACKGROUND_COLOR); + this.selectedBackgroundColorBox.setSelectObject(UniteStyle.DEFAULT_SELECTED_BACKGROUND_COLOR); + + this.borderWidthComboBox.setSelectedLineStyle(UniteStyle.DEFAULT_BORDER_LINE.getLineStyle()); + this.borderColorBox.setSelectObject(UniteStyle.DEFAULT_BORDER_LINE.getColor()); + this.borderRadiusSpinner.setValue(UniteStyle.DEFAULT_BORDER_RADIUS); + + this.tabFontConfPane.populate(UniteStyle.DEFAULT_TAB_FONT.getFont()); + this.selectedFontColorButton.setColor(UniteStyle.DEFAULT_TAB_FONT.getSelectColor()); + } + + @Override + protected MobileTemplatePreviewPane createPreviewPane() { + return null; + } + + @Override + protected MobileTemplateStyle getDefaultTemplateStyle() { + return new UniteStyle(); + } + + @Override + public void populateSubStyle(MobileTemplateStyle ob) { + UniteStyle style = (UniteStyle) ob; + this.paddingLeftSpinner.setValue(style.getPaddingLeft()); + this.paddingRightSpinner.setValue(style.getPaddingRight()); + + this.initialBackgroundColorBox.setSelectObject(style.getInitialColor()); + this.selectedBackgroundColorBox.setSelectObject(style.getSelectColor()); + + this.borderWidthComboBox.setSelectedLineStyle(style.getBorderWidth()); + this.borderColorBox.setSelectObject(style.getBorderColor()); + this.borderRadiusSpinner.setValue(style.getBorderRadius()); + + this.tabFontConfPane.populate(style.getTabFontConfig().getFont()); + this.selectedFontColorButton.setColor(style.getTabFontConfig().getSelectColor()); + } + + @Override + public MobileTemplateStyle updateSubStyle() { + UniteStyle style = new UniteStyle(); + style.setPaddingLeft((int) this.paddingLeftSpinner.getValue()); + style.setPaddingRight((int) this.paddingRightSpinner.getValue()); + + style.setInitialColor(this.initialBackgroundColorBox.getSelectObject()); + style.setSelectColor(this.selectedBackgroundColorBox.getSelectObject()); + + style.setBorderWidth(this.borderWidthComboBox.getSelectedLineStyle()); + style.setBorderColor(this.borderColorBox.getSelectObject()); + style.setBorderRadius((int) this.borderRadiusSpinner.getValue()); + + TabFontConfig config = new TabFontConfig(); + config.setFont(this.tabFontConfPane.update()); + config.setSelectColor(this.selectedFontColorButton.getColor()); + style.setTabFontConfig(config); + + return style; + } + + @Override + protected String title4PopupWindow() { + return null; + } +} From 15110f30db634069f40c675791f632d6eb2b6fbb Mon Sep 17 00:00:00 2001 From: Starryi Date: Wed, 8 Apr 2020 14:25:05 +0800 Subject: [PATCH 187/375] =?UTF-8?q?MOBILE-26026=20=E8=81=94=E6=8E=92?= =?UTF-8?q?=E6=8C=89=E9=92=AETab=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将设计器端联排按钮Tab样式配置界面加入到设计器内置的Tab标题栏样式组中 --- .../mainframe/mobile/ui/TemplateStyleDefinePaneFactory.java | 2 ++ .../mainframe/widget/accessibles/MobileTemplateStylePane.java | 1 + 2 files changed, 3 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TemplateStyleDefinePaneFactory.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TemplateStyleDefinePaneFactory.java index dab5a03ba..16cfe4995 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TemplateStyleDefinePaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TemplateStyleDefinePaneFactory.java @@ -7,6 +7,7 @@ import com.fr.general.cardtag.mobile.DownMenuStyle; import com.fr.general.cardtag.mobile.MobileTemplateStyle; import com.fr.general.cardtag.mobile.SliderStyle; import com.fr.general.cardtag.mobile.UpMenuStyle; +import com.fr.general.cardtag.mobile.UniteStyle; import com.fr.invoke.Reflect; import com.fr.log.FineLoggerFactory; import java.util.HashMap; @@ -20,6 +21,7 @@ public class TemplateStyleDefinePaneFactory { defineMap.put(UpMenuStyle.STYLE_NAME, new StyleDefinePaneUI(UpMenuStyleDefinePane.class)); defineMap.put(DownMenuStyle.STYLE_NAME, new StyleDefinePaneUI(DownMenuStyleDefinePane.class)); defineMap.put(SliderStyle.STYLE_NAME, new StyleDefinePaneUI(SliderStyleDefinePane.class)); + defineMap.put(UniteStyle.STYLE_NAME, new StyleDefinePaneUI(UniteStyleDefinePane.class)); } public static BasicBeanPane createDefinePane(String style, WCardTagLayout tagLayout) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java index 9c52673d7..38f70de81 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java @@ -35,6 +35,7 @@ public class MobileTemplateStylePane extends AbstractTemplateStylePane Date: Thu, 9 Apr 2020 14:19:04 +0800 Subject: [PATCH 188/375] bugfix --- .../design/widget/ui/designer/mobile/ElementCaseDefinePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java index 31c29d72e..723616280 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java @@ -107,9 +107,9 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane { new Component[] {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Horizontal"), SwingConstants.LEFT), hComboBox}, new Component[] {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Vertical"), SwingConstants.LEFT), vComboBox}, createComponents(), - new Component[] {heightRestrictCheckBox, null}, new Component[] {allowFullCheckBox, null}, new Component[] {functionalWhenUnactivatedCheckBox, null}, + new Component[] {heightRestrictCheckBox, null}, new Component[] {maxHeightLabel, maxHeightSpinner} }; double f = TableLayout.FILL; From fd15016024ee9bf2a25b5b35946e97458d5f98c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 9 Apr 2020 15:28:33 +0800 Subject: [PATCH 189/375] =?UTF-8?q?CHART-12791=20=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E5=9F=8B=E7=82=B9=E4=B8=AD=E7=9A=84=E7=B1=BB=E5=9E=8B=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/info/ChartInfoCollector.java | 37 ++++++------------- 1 file changed, 11 insertions(+), 26 deletions(-) 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 bfc5a0d35..5b76b197c 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 @@ -7,7 +7,6 @@ import com.fr.design.mainframe.template.info.TemplateInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; -import com.fr.plugin.chart.vanchart.VanChart; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; @@ -57,36 +56,29 @@ public class ChartInfoCollector extends AbstractPointCollector { } public void collection(ChartProvider chartProvider, String createTime, boolean isReuse) { - if (chartProvider instanceof VanChart) { - VanChart vanChart = (VanChart) chartProvider; - collection(vanChart.getUuid(), vanChart.getID(), createTime, isReuse); - } + collection(chartProvider.getChartUuid(), chartProvider.getID(), createTime, isReuse); } /** * 新建图表,保存状态 */ public void collection(String chartId, String chartType, String createTime, boolean isReuse) { - if (!shouldCollectInfo()) { + if (!shouldCollectInfo() || StringUtils.isEmpty(chartId)) { return; } - ChartInfo chartInfo = ChartInfo.newInstance(chartId, chartType, createTime, true, isReuse); chartInfoCacheMap.put(chartId, chartInfo); } public void updateChartPropertyTime(ChartProvider chartProvider) { - if (chartProvider instanceof VanChart) { - VanChart vanChart = (VanChart) chartProvider; - updateChartPropertyTime(vanChart.getUuid(), vanChart.getID()); - } + updateChartPropertyTime(chartProvider.getChartUuid(), chartProvider.getID()); } /** * 图表编辑,更新编辑时间 */ public void updateChartPropertyTime(String chartId, String chartType) { - if (!shouldCollectInfo()) { + if (!shouldCollectInfo() || StringUtils.isEmpty(chartId)) { return; } ChartInfo chartInfo = getOrCreateChartInfo(chartId, chartType, null); @@ -99,17 +91,14 @@ public class ChartInfoCollector extends AbstractPointCollector { } public void updateChartTypeTime(ChartProvider chartProvider, String oldType) { - if (chartProvider instanceof VanChart) { - VanChart vanChart = (VanChart) chartProvider; - updateChartTypeTime(vanChart.getUuid(), vanChart.getID(), oldType); - } + updateChartTypeTime(chartProvider.getChartUuid(), chartProvider.getID(), oldType); } /** * 图表类型变化,更新类型和类型确认时间 */ public void updateChartTypeTime(String chartId, String chartType, String oldType) { - if (!shouldCollectInfo()) { + if (!shouldCollectInfo() || StringUtils.isEmpty(chartId)) { return; } @@ -143,18 +132,14 @@ public class ChartInfoCollector extends AbstractPointCollector { } public void checkTestChart(ChartProvider chartProvider) { - if (chartProvider instanceof VanChart) { - checkTestChart((VanChart) chartProvider); - } - } - - public void checkTestChart(VanChart vanChart) { if (!shouldCollectInfo()) { return; } - boolean testChart = vanChart.isTestChart(); - ChartInfo chartInfo = chartInfoCacheMap.get(vanChart.getUuid()); - chartInfo.setTestChart(testChart); + ChartInfo chartInfo = chartInfoCacheMap.get(chartProvider.getChartUuid()); + if (chartInfo != null) { + boolean testChart = chartProvider.isTestChart(); + chartInfo.setTestChart(testChart); + } } /** From 50d3d79a18a4f21f38001c5f81db30eb1e6833e2 Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 9 Apr 2020 16:39:01 +0800 Subject: [PATCH 190/375] =?UTF-8?q?MOBILE-26390=20=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=A0=B7=E5=BC=8F=E8=AE=BE=E7=BD=AE=E4=BA=86?= =?UTF-8?q?=E8=BE=B9=E6=A1=86=EF=BC=8C=E5=AE=9E=E9=99=85=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 区分线型和线宽 --- .../SidebarMobileBookMarkStyleCustomDefinePane.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java index 79bab33df..66358a30e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java @@ -145,7 +145,7 @@ public class SidebarMobileBookMarkStyleCustomDefinePane extends BasicBeanPane Date: Thu, 9 Apr 2020 17:29:26 +0800 Subject: [PATCH 191/375] REPORT-29539 && REPORT-29457 --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 4 ++++ .../src/main/java/com/fr/design/i18n/DesignI18nImpl.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) 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 81e62239b..f16cdd504 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -404,6 +404,10 @@ public class EnvChangeEntrance { * 处理异常 */ public void dealEvnExceptionWhenStartDesigner() { + ProcessEventPipe eventPipe = FineProcessContext.getParentPipe(); + if (eventPipe != null) { + eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue())); + } final EnvListPane envListPane = new EnvListPane(); envListPane.populateEnvManager(currentEnvName); BasicDialog envListDialog = envListPane.showWindow(SwingUtilities.getWindowAncestor(DesignerContext.getDesignerFrame())); diff --git a/designer-base/src/main/java/com/fr/design/i18n/DesignI18nImpl.java b/designer-base/src/main/java/com/fr/design/i18n/DesignI18nImpl.java index 176d6ec3c..6e4fa7d3b 100644 --- a/designer-base/src/main/java/com/fr/design/i18n/DesignI18nImpl.java +++ b/designer-base/src/main/java/com/fr/design/i18n/DesignI18nImpl.java @@ -1,5 +1,6 @@ package com.fr.design.i18n; +import com.fr.design.DesignerEnvManager; import com.fr.general.GeneralContext; import com.fr.general.log.MessageFormatter; import com.fr.locale.DesignI18nProvider; @@ -29,7 +30,7 @@ public class DesignI18nImpl implements DesignI18nProvider { @Override public String i18nText(String key) { - return localeManager.getLocalBundle(GeneralContext.getLocale()).getText(localeManager, key); + return localeManager.getLocalBundle(DesignerEnvManager.getEnvManager().getLanguage()).getText(localeManager, key); } @Override From daadcdc0fe30b1a0ee70ea3c15e429dc5344d8b0 Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 9 Apr 2020 23:11:39 +0800 Subject: [PATCH 192/375] =?UTF-8?q?MOBILE-26026=20=E8=81=94=E6=8E=92?= =?UTF-8?q?=E6=8C=89=E9=92=AETab=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 设计器端区分线型和线宽 --- .../fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java index 722d5f91c..2f269b028 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java @@ -196,7 +196,7 @@ public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane { this.initialBackgroundColorBox.setSelectObject(style.getInitialColor()); this.selectedBackgroundColorBox.setSelectObject(style.getSelectColor()); - this.borderWidthComboBox.setSelectedLineStyle(style.getBorderWidth()); + this.borderWidthComboBox.setSelectedLineStyle(style.getBorderLineStyle()); this.borderColorBox.setSelectObject(style.getBorderColor()); this.borderRadiusSpinner.setValue(style.getBorderRadius()); @@ -213,7 +213,7 @@ public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane { style.setInitialColor(this.initialBackgroundColorBox.getSelectObject()); style.setSelectColor(this.selectedBackgroundColorBox.getSelectObject()); - style.setBorderWidth(this.borderWidthComboBox.getSelectedLineStyle()); + style.setBorderLineStyle(this.borderWidthComboBox.getSelectedLineStyle()); style.setBorderColor(this.borderColorBox.getSelectObject()); style.setBorderRadius((int) this.borderRadiusSpinner.getValue()); From 1ad716365b7decd75dc0c971a61be6fcc4050f61 Mon Sep 17 00:00:00 2001 From: vito Date: Fri, 10 Apr 2020 10:07:02 +0800 Subject: [PATCH 193/375] =?UTF-8?q?REPORT-28415=2010.0=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E5=B8=86=E8=BD=AF=E6=9C=8D=E5=8A=A1=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/help/AboutPane.java | 10 +-- .../fr/design/extra/PluginOperateUtils.java | 22 +++-- .../java/com/fr/design/extra/PluginUtils.java | 86 +++++++++++-------- .../mainframe/InformationCollector.java | 3 + .../fr/design/mainframe/bbs/BBSConstants.java | 2 +- .../errorinfo/ErrorInfoUploader.java | 23 +++-- 6 files changed, 91 insertions(+), 55 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java b/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java index b8acba9fe..3ede15950 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java @@ -72,11 +72,11 @@ public class AboutPane extends JPanel { addPhoneAndQQPane(contentPane); // 官网 - JPanel urlActionPane = getURLActionPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Official_Website"), CloudCenter.getInstance().acquireUrlByKind("website." + GeneralContext.getLocale(), ProductConstants.WEBSITE_URL)); + JPanel urlActionPane = getURLActionPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Official_Website"), CloudCenter.getInstance().acquireConf("website." + GeneralContext.getLocale(), ProductConstants.WEBSITE_URL)); // 支持邮箱 - String defaultEmail = CloudCenter.getInstance().acquireUrlByKind("support.email", ProductConstants.SUPPORT_EMAIL); - JPanel emailPane = getEmailActionPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Support_Email"), CloudCenter.getInstance().acquireUrlByKind("support.email." + GeneralContext.getLocale(), defaultEmail)); + String defaultEmail = CloudCenter.getInstance().acquireConf("support.email", ProductConstants.SUPPORT_EMAIL); + JPanel emailPane = getEmailActionPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Support_Email"), CloudCenter.getInstance().acquireConf("support.email." + GeneralContext.getLocale(), defaultEmail)); contentPane.add(urlActionPane); contentPane.add(emailPane); @@ -96,7 +96,7 @@ public class AboutPane extends JPanel { if (GeneralContext.getLocale().equals(Locale.US)) { return; } - boxCenterAlignmentPane = new BoxCenterAligmentPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Service_Phone") + CloudCenter.getInstance().acquireUrlByKind("service.phone." + FRContext.getLocale(), COMPANY_TELEPHONE)); + boxCenterAlignmentPane = new BoxCenterAligmentPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Service_Phone") + CloudCenter.getInstance().acquireConf("service.phone." + FRContext.getLocale(), COMPANY_TELEPHONE)); contentPane.add(boxCenterAlignmentPane); // 繁体版不显示QQ if (GeneralContext.getLocale().equals(Locale.TAIWAN)) { @@ -176,7 +176,7 @@ public class AboutPane extends JPanel { private String getCopyRight() { return append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_About_CopyRight"), COPYRIGHT_LABEL, - ProductConstants.HISTORY, StringUtils.BLANK, CloudCenter.getInstance().acquireUrlByKind("company.name", ProductConstants.COMPANY_NAME)); + ProductConstants.HISTORY, StringUtils.BLANK, CloudCenter.getInstance().acquireConf("company.name", ProductConstants.COMPANY_NAME)); } private String getBuildTitle() { diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java b/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java index 4b0edb979..801b4e369 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java @@ -1,10 +1,10 @@ package com.fr.design.extra; import com.fr.config.MarketConfig; +import com.fr.design.bridge.exec.JSCallback; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.exe.callback.InstallFromDiskCallback; import com.fr.design.extra.exe.callback.InstallOnlineCallback; -import com.fr.design.bridge.exec.JSCallback; import com.fr.design.extra.exe.callback.ModifyStatusCallback; import com.fr.design.extra.exe.callback.UninstallPluginCallback; import com.fr.design.extra.exe.callback.UpdateFromDiskCallback; @@ -13,6 +13,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; +import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginContext; @@ -25,9 +26,9 @@ import com.fr.plugin.manage.control.PluginTaskResult; import com.fr.plugin.view.PluginView; import com.fr.stable.StringUtils; -import javax.swing.JOptionPane; -import javax.swing.SwingUtilities; +import javax.swing.*; import java.io.File; +import java.net.HttpURLConnection; import java.util.List; @@ -110,13 +111,18 @@ public class PluginOperateUtils { public static String getRecommendPlugins() { String plistUrl = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.feature"); JSONArray resultArray = JSONArray.create(); + if (StringUtils.isBlank(plistUrl)) { + return resultArray.toString(); + } try { HttpClient httpClient = new HttpClient(plistUrl); - String result = httpClient.getResponseText(); - JSONArray jsonArray = new JSONArray(result); - resultArray = PluginUtils.filterPluginsFromVersion(jsonArray); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); + if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { + String result = httpClient.getResponseText(); + JSONArray jsonArray = new JSONArray(result); + resultArray = PluginUtils.filterPluginsFromVersion(jsonArray); + } + } catch (JSONException e) { + FineLoggerFactory.getLogger().info(e.getMessage(), e); } return resultArray.toString(); } diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java b/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java index d1997684f..bec02a200 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java @@ -2,6 +2,7 @@ package com.fr.design.extra; import com.fr.base.TemplateUtils; import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.i18n.Toolkit; import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; @@ -12,8 +13,8 @@ import com.fr.plugin.basic.version.Version; import com.fr.plugin.basic.version.VersionIntervalFactory; import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginMarker; -import com.fr.plugin.error.PluginErrorCode; import com.fr.plugin.error.PluginBaseErrorCode; +import com.fr.plugin.error.PluginErrorCode; import com.fr.plugin.manage.PluginManager; import com.fr.plugin.view.PluginView; import com.fr.stable.EncodeConstants; @@ -21,11 +22,12 @@ import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; -import javax.swing.JOptionPane; +import javax.swing.*; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.URLDecoder; import java.text.SimpleDateFormat; @@ -38,7 +40,7 @@ import java.util.Map; * Created by ibm on 2017/5/25. */ public class PluginUtils { - + private static final String ERROR_CODE_I18N_PREFIX = "FR-Plugin_Error_"; public static final String FR_VERSION = "fr_version"; @@ -46,8 +48,7 @@ public class PluginUtils { public static PluginMarker createPluginMarker(String pluginInfo) { //todo 判空 String[] plugin = pluginInfo.split("_"); - PluginMarker pluginMarker = PluginMarker.create(plugin[0], plugin[1]); - return pluginMarker; + return PluginMarker.create(plugin[0], plugin[1]); } public static JSONObject getLatestPluginInfo(String pluginID) throws Exception { @@ -90,7 +91,11 @@ public class PluginUtils { InputStream reader = null; FileOutputStream writer = null; try { - HttpClient httpClient = new HttpClient(getDownloadPath(id)); + String downloadPath = getDownloadPath(id); + if (StringUtils.isBlank(downloadPath)) { + throw new PluginVerifyException(Toolkit.i18nText("Fine-Design_Basic_Plugin_Connect_Server_Error")); + } + HttpClient httpClient = new HttpClient(downloadPath); if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { int totalSize = httpClient.getContentLength(); reader = httpClient.getResponseStream(); @@ -108,12 +113,12 @@ public class PluginUtils { p.process(totalBytesRead / (double) totalSize); } } else { - throw new com.fr.plugin.PluginVerifyException(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Connect_Server_Error")); + throw new PluginVerifyException(Toolkit.i18nText("Fine-Design_Basic_Plugin_Connect_Server_Error")); } } catch (PluginVerifyException e) { FineJOptionPane.showMessageDialog(null, e.getMessage(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); return false; - } catch (Exception e) { + } catch (IOException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); return false; } finally { @@ -122,7 +127,7 @@ public class PluginUtils { return true; } - private static void closeStream(InputStream reader, FileOutputStream writer){ + private static void closeStream(InputStream reader, FileOutputStream writer) { try { if (null != reader) { reader.close(); @@ -136,18 +141,26 @@ public class PluginUtils { } } - private static String getDownloadPath(String id) throws Exception { - HashMap map = new HashMap(); - map.put("id", id); - HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("shop.script.download")+ "?" + FR_VERSION + "=" + ProductConstants.VERSION); + private static String getDownloadPath(String id) { + String url = CloudCenter.getInstance().acquireUrlByKind("shop.script.download"); + if (StringUtils.isBlank(url)) { + return StringUtils.EMPTY; + } + HttpClient httpClient = new HttpClient(url + "?" + FR_VERSION + "=" + ProductConstants.VERSION); httpClient.asGet(); - String resText = httpClient.getResponseText(); - JSONObject resultJSONObject = new JSONObject(resText); - String scriptUrl = resultJSONObject.optString("result"); - String charSet = EncodeConstants.ENCODING_UTF_8; - scriptUrl = URLDecoder.decode(URLDecoder.decode(scriptUrl, charSet), charSet); - - return scriptUrl; + if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { + String resText = httpClient.getResponseText(); + JSONObject resultJSONObject = new JSONObject(resText); + String scriptUrl = resultJSONObject.optString("result"); + String charSet = EncodeConstants.ENCODING_UTF_8; + try { + scriptUrl = URLDecoder.decode(URLDecoder.decode(scriptUrl, charSet), charSet); + } catch (UnsupportedEncodingException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return scriptUrl; + } + return StringUtils.EMPTY; } public static boolean isPluginMatch(PluginView pluginView, String text) { @@ -194,22 +207,22 @@ public class PluginUtils { return StringUtils.EMPTY; } } - + public static String getMessageByErrorCode(PluginBaseErrorCode errorCode) { - if(errorCode == PluginErrorCode.None){ + if (errorCode == PluginErrorCode.None) { return ""; } - + return com.fr.design.i18n.Toolkit.i18nCompatibleServerText(getInterKeyByErrorCode(errorCode)); } - + private static String getInterKeyByErrorCode(PluginBaseErrorCode errorCode) { - - return errorCode.getDescription(); + + return errorCode.getDescription(); } - + public static PluginMarker getInstalledPluginMarkerByID(String pluginID) { - + PluginContext context = PluginManager.getContext(pluginID); if (context != null) { return context.getMarker(); @@ -219,29 +232,30 @@ public class PluginUtils { /** * 在不同设计器版本下展示不同插件 + * * @return 插件 */ - public static JSONArray filterPluginsFromVersion(JSONArray oriJSONArray) throws Exception{ - JSONArray resultJSONArray = JSONArray.create(); - for(int i = 0; i < oriJSONArray.length(); i++){ + public static JSONArray filterPluginsFromVersion(JSONArray oriJSONArray) { + JSONArray resultJSONArray = JSONArray.create(); + for (int i = 0; i < oriJSONArray.length(); i++) { JSONObject jo = oriJSONArray.getJSONObject(i); String envVersion = jo.optString("envversion"); - if(isCompatibleCurrentEnv(envVersion)){ + if (isCompatibleCurrentEnv(envVersion)) { resultJSONArray.put(jo); } } return resultJSONArray; } - private static boolean isCompatibleCurrentEnv(String envVersion){ + private static boolean isCompatibleCurrentEnv(String envVersion) { return VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion()); } - public static JSONArray transferStorePluginToJson(PluginContext [] pluginContexts){ + public static JSONArray transferStorePluginToJson(PluginContext[] pluginContexts) { JSONArray ja = JSONArray.create(); try { - for(PluginContext pluginContext : pluginContexts){ + for (PluginContext pluginContext : pluginContexts) { JSONObject jo = JSONObject.create(); jo.put("id", pluginContext.getID()); jo.put("name", pluginContext.getName()); @@ -265,7 +279,7 @@ public class PluginUtils { jo.put("switchedReason", pluginContext.getSwitchedReason()); ja.put(jo); } - }catch (Exception e){ + } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } return ja; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java index b4b43cafd..b0e806657 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java @@ -198,6 +198,9 @@ public class InformationCollector implements XMLReadable, XMLWriter { } JSONObject content = getJSONContentAsByte(); String url = CloudCenter.getInstance().acquireUrlByKind("user.info.v10"); + if (StringUtils.isBlank(url)) { + return; + } boolean success = false; try { HashMap para = new HashMap<>(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSConstants.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSConstants.java index 5e12f224f..ea99f70e4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSConstants.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/BBSConstants.java @@ -64,7 +64,7 @@ public class BBSConstants { } private static String[] loadAllGuestsInfoOnline(String key, String defaultValue) { - String guest = CloudCenter.getInstance().acquireUrlByKind(key, defaultValue); + String guest = CloudCenter.getInstance().acquireConf(key, defaultValue); if (StringUtils.isNotEmpty(guest)) { return guest.split("\\|"); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java index e22e1059e..81da86212 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java @@ -17,6 +17,7 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.EnvChangedListener; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; import java.io.File; import java.io.FileInputStream; @@ -100,7 +101,10 @@ public class ErrorInfoUploader { private void downloadSolution(File localCacheZip) { try { - String downloadURL = CloudCenter.getInstance().acquireUrlByKind("solution.download", "http://cloud.fanruan.com/api/solution"); + String downloadURL = CloudCenter.getInstance().acquireUrlByKind("solution.download"); + if (StringUtils.isBlank(downloadURL)) { + return; + } downloadURL = String.format("%s?token=%s", downloadURL, SiteCenterToken.generateToken()); InputStream in = HttpToolbox.post(downloadURL, new HashMap(), HttpResponseType.STREAM); StableUtils.makesureFileExist(localCacheZip); @@ -119,7 +123,10 @@ public class ErrorInfoUploader { private boolean needUpdate(File localCacheZip) { if (localCacheZip.exists()) { // 判断本地文件大小. - String checkURL = CloudCenter.getInstance().acquireUrlByKind("solution.check", "http://cloud.fanruan.com/api/solution/cache/check"); + String checkURL = CloudCenter.getInstance().acquireUrlByKind("solution.check"); + if (StringUtils.isBlank(checkURL)) { + return false; + } checkURL = String.format("%s?token=%s", checkURL, SiteCenterToken.generateToken()); try { JSONObject res = new JSONObject(HttpToolbox.get(checkURL)); @@ -143,6 +150,9 @@ public class ErrorInfoUploader { } File[] files = folder.listFiles(); + if (files == null) { + return; + } if (ArrayUtils.getLength(files) > MAX_ERROR_SIZE) { CommonIOUtils.deleteFile(folder); return; @@ -166,9 +176,12 @@ public class ErrorInfoUploader { } jsonArray.put(new JSONObject(content)); tempFiles.add(file); - if( jsonArray.length() == MAX_ITEMS || count == files.length){ + if (jsonArray.length() == MAX_ITEMS || count == files.length) { String url = CloudCenter.getInstance().acquireUrlByKind("design.error"); - if(sendErrorInfo(url, jsonArray)){ + if (StringUtils.isBlank(url)) { + return; + } + if (sendErrorInfo(url, jsonArray)) { deleteFiles(tempFiles); } jsonArray = new JSONArray(); @@ -182,7 +195,7 @@ public class ErrorInfoUploader { } private void deleteFiles(List files) { - for(File file : files) { + for (File file : files) { CommonIOUtils.deleteFile(file); } } From ef24b120a9e7d6d41d3db1788105411a4bc52b37 Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 23 Mar 2020 10:59:47 +0800 Subject: [PATCH 194/375] =?UTF-8?q?REPORT-27647=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E5=AE=89=E8=A3=85=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?-=E6=A8=A1=E6=9D=BF=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=20ui=20=E7=95=8C=E9=9D=A2=201=E3=80=81=20?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E7=BB=84=E4=BB=B6=E5=BA=93=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=202=E3=80=81=20=E5=B0=8F=E5=9C=86=E7=82=B9=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/DesignerEnvManager.java | 22 +- .../fun/ComponentLibraryPaneProcessor.java | 31 ++ ...AbstractComponentLibraryPaneProcessor.java | 25 ++ .../com/fr/design/gui/imenu/UIMenuItem.java | 75 +--- .../com/fr/design/gui/imenu/UIMenuItemUI.java | 81 ++++ .../mainframe/toolbar/ToolBarMenuDock.java | 20 +- .../main/java/com/fr/design/menu/MenuDef.java | 35 +- .../com/fr/design/menu/SnapChatMenuDef.java | 161 +++++++ .../fr/design/menu/SnapChatMenuItemUI.java | 31 ++ .../com/fr/design/menu/SnapChatMenuUI.java | 29 ++ .../fr/design/menu/SnapChatUpdateAction.java | 74 ++++ .../java/com/fr/design/menu/SnapChatUtil.java | 33 ++ .../com/fr/design/notification/SnapChat.java | 28 ++ .../design/notification/SnapChatAllTypes.java | 38 ++ .../design/notification/SnapChatConfig.java | 88 ++++ .../fr/design/notification/SnapChatKey.java | 9 + .../mainframe/FormWidgetDetailPane.java | 391 ++--------------- .../component/ComponentLibraryManager.java | 23 + .../pane/ComponentLibraryPaneCreator.java | 68 +++ .../ComponentLibraryPaneProcessorImpl.java | 412 ++++++++++++++++++ 20 files changed, 1229 insertions(+), 445 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/ComponentLibraryPaneProcessor.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractComponentLibraryPaneProcessor.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItemUI.java create mode 100644 designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java create mode 100644 designer-base/src/main/java/com/fr/design/menu/SnapChatMenuItemUI.java create mode 100644 designer-base/src/main/java/com/fr/design/menu/SnapChatMenuUI.java create mode 100644 designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java create mode 100644 designer-base/src/main/java/com/fr/design/menu/SnapChatUtil.java create mode 100644 designer-base/src/main/java/com/fr/design/notification/SnapChat.java create mode 100644 designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java create mode 100644 designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java create mode 100644 designer-base/src/main/java/com/fr/design/notification/SnapChatKey.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/component/ComponentLibraryManager.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneProcessorImpl.java diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 77c779ce3..9cb45918c 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -18,6 +18,7 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.i18n.Toolkit; import com.fr.design.locale.impl.ProductImproveMark; import com.fr.design.mainframe.vcs.VcsConfigManager; +import com.fr.design.notification.SnapChatConfig; import com.fr.design.update.push.DesignerPushUpdateConfigManager; import com.fr.design.style.color.ColorSelectConfigManager; import com.fr.design.utils.DesignUtils; @@ -161,6 +162,11 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { * alphafine */ private AlphaFineConfigManager alphaFineConfigManager = AlphaFineConfigManager.getInstance(); + + /** + * 阅后即焚的配置项 + */ + private SnapChatConfig snapChatConfig = SnapChatConfig.getInstance(); private DesignerPushUpdateConfigManager designerPushUpdateConfigManager = DesignerPushUpdateConfigManager.getInstance(); @@ -1562,11 +1568,17 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { readVcsAttr(reader); } else if (DesignerPort.XML_TAG.equals(name)) { readDesignerPort(reader); + }else if (name.equals(SnapChatConfig.XML_TAG)) { + readSnapChatConfig(reader); } else { readLayout(reader, name); } } } + + private void readSnapChatConfig(XMLableReader reader) { + reader.readXMLObject(this.snapChatConfig = SnapChatConfig.getInstance()); + } private void readAlphaFineAttr(XMLableReader reader) { reader.readXMLObject(this.alphaFineConfigManager = AlphaFineConfigManager.getInstance()); @@ -1783,9 +1795,17 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { writeDesignerPushUpdateAttr(writer); writeVcsAttr(writer); writeDesignerPort(writer); + writeSnapChatConfig(writer); writer.end(); } - + + private void writeSnapChatConfig(XMLPrintWriter writer) { + + if (this.snapChatConfig != null) { + this.snapChatConfig.writeXML(writer); + } + } + private void writeAlphaFineAttr(XMLPrintWriter writer) { if (this.alphaFineConfigManager != null) { this.alphaFineConfigManager.writeXML(writer); diff --git a/designer-base/src/main/java/com/fr/design/fun/ComponentLibraryPaneProcessor.java b/designer-base/src/main/java/com/fr/design/fun/ComponentLibraryPaneProcessor.java new file mode 100644 index 000000000..88385a11b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/ComponentLibraryPaneProcessor.java @@ -0,0 +1,31 @@ +package com.fr.design.fun; + +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.mainframe.DockingView; +import com.fr.stable.fun.mark.Immutable; + +import javax.swing.JPanel; + +/** + * created by Harrison on 2020/03/16 + **/ +public interface ComponentLibraryPaneProcessor extends Immutable { + + String XML_TAG = "ParameterExpandablePaneUIProvider"; + + int CURRENT_LEVEL = 1; + + UIScrollPane createShowPanel(boolean isEdit); + + JPanel createMenuNorthPane(); + + UIComboBox createMenuComBox(); + + void parentView(DockingView dockingView); + + void parentPane(JPanel panel); + + void complete(); + +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractComponentLibraryPaneProcessor.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractComponentLibraryPaneProcessor.java new file mode 100644 index 000000000..f376ad788 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractComponentLibraryPaneProcessor.java @@ -0,0 +1,25 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.ComponentLibraryPaneProcessor; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; +import com.fr.stable.fun.mark.Layer; + +/** + * created by Harrison on 2020/03/16 + **/ +@API(level = ComponentLibraryPaneProcessor.CURRENT_LEVEL) +public abstract class AbstractComponentLibraryPaneProcessor extends AbstractProvider implements ComponentLibraryPaneProcessor { + + @Override + public int currentAPILevel() { + + return ComponentLibraryPaneProcessor.CURRENT_LEVEL; + } + + @Override + public int layerIndex() { + + return Layer.DEFAULT_LAYER_INDEX; + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItem.java b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItem.java index 37f1fe052..3230dbda2 100644 --- a/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItem.java +++ b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItem.java @@ -1,15 +1,11 @@ package com.fr.design.gui.imenu; -import java.awt.*; - -import javax.swing.*; -import javax.swing.plaf.basic.BasicMenuItemUI; - import com.fr.design.constants.UIConstants; -import com.fr.stable.Constants; import com.fr.stable.StringUtils; -import com.fr.design.utils.gui.GUIPaintUtils; -import sun.swing.SwingUtilities2; + +import javax.swing.Action; +import javax.swing.Icon; +import javax.swing.JMenuItem; public class UIMenuItem extends JMenuItem{ public UIMenuItem() { @@ -42,66 +38,5 @@ public class UIMenuItem extends JMenuItem{ public String getText() { return StringUtils.BLANK + super.getText(); } - - private class UIMenuItemUI extends BasicMenuItemUI { - @Override - protected void paintBackground(Graphics g, JMenuItem menuItem,Color bgColor) { - if(menuItem.getIcon() == null) { - super.paintBackground(g, menuItem, bgColor); - return; - } - ButtonModel model = menuItem.getModel(); - Color oldColor = g.getColor(); - int menuWidth = menuItem.getWidth(); - int menuHeight = menuItem.getHeight(); - - g.setColor(UIConstants.NORMAL_BACKGROUND); - g.fillRect(0, 0, menuWidth, menuHeight); - if(menuItem.isOpaque()) { - if (model.isArmed()|| (menuItem instanceof JMenu && model.isSelected())) { - GUIPaintUtils.fillPaint((Graphics2D)g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); - } else { - GUIPaintUtils.fillPaint((Graphics2D)g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, menuItem.getBackground(), 7); - } - g.setColor(oldColor); - } - else if (model.isArmed() || (menuItem instanceof JMenu && - model.isSelected())) { - GUIPaintUtils.fillPaint((Graphics2D)g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); - g.setColor(oldColor); - } - } - - protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) { - ButtonModel model = menuItem.getModel(); - FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g); - int mnemIndex = menuItem.getDisplayedMnemonicIndex(); - - if(!model.isEnabled()) { - // *** paint the text disabled - if ( UIManager.get("MenuItem.disabledForeground") instanceof Color ) { - g.setColor( UIManager.getColor("MenuItem.disabledForeground") ); - SwingUtilities2.drawStringUnderlineCharAt(menuItem, g,text, - -1, textRect.x, textRect.y + fm.getAscent()); - } else { - g.setColor(menuItem.getBackground().brighter()); - SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, - -1, textRect.x, textRect.y + fm.getAscent()); - g.setColor(menuItem.getBackground().darker()); - SwingUtilities2.drawStringUnderlineCharAt(menuItem, g,text, - -1, textRect.x - 1, textRect.y + - fm.getAscent() - 1); - } - } else { - // *** paint the text normally - if (model.isArmed()|| (menuItem instanceof JMenu && model.isSelected())) { - g.setColor(Color.WHITE); // Uses protected field. - } - SwingUtilities2.drawStringUnderlineCharAt(menuItem, g,text, - -1, textRect.x, textRect.y + fm.getAscent()); - } - } - - } - + } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItemUI.java b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItemUI.java new file mode 100644 index 000000000..0d883abfb --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItemUI.java @@ -0,0 +1,81 @@ +package com.fr.design.gui.imenu; + +import com.fr.design.constants.UIConstants; +import com.fr.design.utils.gui.GUIPaintUtils; +import com.fr.stable.Constants; +import sun.swing.SwingUtilities2; + +import javax.swing.ButtonModel; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.UIManager; +import javax.swing.plaf.basic.BasicMenuItemUI; +import java.awt.Color; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Rectangle; + +/** + * created by Harrison on 2020/03/22 + **/ +public class UIMenuItemUI extends BasicMenuItemUI { + + @Override + protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) { + if (menuItem.getIcon() == null) { + super.paintBackground(g, menuItem, bgColor); + return; + } + ButtonModel model = menuItem.getModel(); + Color oldColor = g.getColor(); + int menuWidth = menuItem.getWidth(); + int menuHeight = menuItem.getHeight(); + + g.setColor(UIConstants.NORMAL_BACKGROUND); + g.fillRect(0, 0, menuWidth, menuHeight); + if (menuItem.isOpaque()) { + if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { + GUIPaintUtils.fillPaint((Graphics2D) g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); + } else { + GUIPaintUtils.fillPaint((Graphics2D) g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, menuItem.getBackground(), 7); + } + g.setColor(oldColor); + } else if (model.isArmed() || (menuItem instanceof JMenu && + model.isSelected())) { + GUIPaintUtils.fillPaint((Graphics2D) g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); + g.setColor(oldColor); + } + } + + protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) { + ButtonModel model = menuItem.getModel(); + FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g); + int mnemIndex = menuItem.getDisplayedMnemonicIndex(); + + if (!model.isEnabled()) { + // *** paint the text disabled + if (UIManager.get("MenuItem.disabledForeground") instanceof Color) { + g.setColor(UIManager.getColor("MenuItem.disabledForeground")); + SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, + -1, textRect.x, textRect.y + fm.getAscent()); + } else { + g.setColor(menuItem.getBackground().brighter()); + SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, + -1, textRect.x, textRect.y + fm.getAscent()); + g.setColor(menuItem.getBackground().darker()); + SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, + -1, textRect.x - 1, textRect.y + + fm.getAscent() - 1); + } + } else { + // *** paint the text normally + if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { + g.setColor(Color.WHITE); // Uses protected field. + } + SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, + -1, textRect.x, textRect.y + fm.getAscent()); + } + } + +} 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 cdafa8c41..bc4b85ced 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 @@ -12,7 +12,6 @@ import com.fr.design.actions.UpdateAction; import com.fr.design.actions.community.BBSAction; import com.fr.design.actions.community.BugAction; import com.fr.design.actions.community.CenterAction; -import com.fr.design.actions.community.CusDemandAction; import com.fr.design.actions.community.FacebookFansAction; import com.fr.design.actions.community.NeedAction; import com.fr.design.actions.community.QuestionAction; @@ -53,7 +52,9 @@ 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; @@ -563,15 +564,24 @@ public abstract class ToolBarMenuDock { * @return 社区菜单的子菜单 */ public ShortCut[] createCommunityShortCuts() { + final java.util.List shortCuts = new ArrayList(); shortCuts.add(new BBSAction()); + + shortCuts.add(SeparatorDef.DEFAULT); + shortCuts.add(new VideoAction()); shortCuts.add(new TutorialAction()); shortCuts.add(new QuestionAction()); shortCuts.add(new TechSolutionAction()); + + shortCuts.add(SeparatorDef.DEFAULT); + shortCuts.add(new BugAction()); shortCuts.add(new NeedAction()); - shortCuts.add(new CusDemandAction()); + + shortCuts.add(SeparatorDef.DEFAULT); + shortCuts.add(new CenterAction()); shortCuts.add(new SignAction()); LocaleCenter.buildAction(new LocaleAction() { @@ -594,7 +604,11 @@ public abstract class ToolBarMenuDock { } public MenuDef createCommunityMenuDef() { - MenuDef menuDef = new MenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community"), 'C'); + + MenuDef menuDef = new SnapChatMenuDef( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community"), + 'C', + SnapChatAllTypes.Menu.BBS); ShortCut[] otherCommunityShortCuts = createCommunityShortCuts(); for (ShortCut shortCut : otherCommunityShortCuts) { menuDef.addShortCut(shortCut); diff --git a/designer-base/src/main/java/com/fr/design/menu/MenuDef.java b/designer-base/src/main/java/com/fr/design/menu/MenuDef.java index c18749c12..f495e03f1 100644 --- a/designer-base/src/main/java/com/fr/design/menu/MenuDef.java +++ b/designer-base/src/main/java/com/fr/design/menu/MenuDef.java @@ -38,8 +38,8 @@ public class MenuDef extends ShortCut { protected UIMenu createdJMenu; protected UIButton createdButton; protected JPopupMenu popupMenu; - private boolean hasScrollSubMenu; - private boolean isHeadMenu; + protected boolean hasScrollSubMenu; + protected boolean isHeadMenu; private String anchor; @@ -187,18 +187,13 @@ public class MenuDef extends ShortCut { */ public UIMenu createJMenu() { if (createdJMenu == null) { - if (hasScrollSubMenu) { - createdJMenu = new UIScrollMenu(this.getName()); - } else if (isHeadMenu){ - createdJMenu = new UIHeadMenu(this.getName()); - } else { - createdJMenu = new UIMenu(this.getName()); - } + createdJMenu = createJMenu0(); createdJMenu.setMnemonic(this.getMnemonic()); if (this.iconPath != null) { createdJMenu.setIcon(BaseUtils.readIcon(this.iconPath)); } - createdJMenu.addMenuListener(menuDefListener); + MenuListener menuListener = createMenuListener(); + createdJMenu.addMenuListener(menuListener); ContainerListener listener = getContainerListener(); if (listener != null) { createdJMenu.getPopupMenu().addContainerListener(listener); @@ -207,7 +202,20 @@ public class MenuDef extends ShortCut { return createdJMenu; } - + + protected UIMenu createJMenu0() { + + UIMenu createdJMenu; + if (hasScrollSubMenu) { + createdJMenu = new UIScrollMenu(this.getName()); + } else if (isHeadMenu){ + createdJMenu = new UIHeadMenu(this.getName()); + } else { + createdJMenu = new UIMenu(this.getName()); + } + return createdJMenu; + } + protected ContainerListener getContainerListener() { return null; } @@ -377,6 +385,11 @@ public class MenuDef extends ShortCut { public void intoJToolBar(JToolBar toolBar) { toolBar.add(this.createUIButton()); } + + protected MenuListener createMenuListener() { + + return menuDefListener; + } private MenuListener menuDefListener = new MenuListener() { diff --git a/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java b/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java new file mode 100644 index 000000000..473c17f25 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java @@ -0,0 +1,161 @@ +package com.fr.design.menu; + +import com.fr.design.gui.imenu.UIMenu; +import com.fr.design.gui.imenu.UIScrollMenu; +import com.fr.design.notification.SnapChat; +import com.fr.design.notification.SnapChatConfig; +import com.fr.design.notification.SnapChatKey; + +import javax.swing.JMenu; +import javax.swing.event.MenuEvent; +import javax.swing.event.MenuListener; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.geom.Ellipse2D; +import java.awt.image.BufferedImage; + +/** + * created by Harrison on 2020/03/16 + **/ +public class SnapChatMenuDef extends MenuDef implements SnapChat { + + private SnapChatKey uniqueKey; + private SnapChatMenuUI menuUI = new SnapChatMenuUI(this); + + public SnapChatMenuDef(String name, SnapChatKey uniqueKey) { + super(name); + this.uniqueKey = uniqueKey; + } + + public SnapChatMenuDef(Boolean rePaint, SnapChatKey uniqueKey) { + super(rePaint); + this.uniqueKey = uniqueKey; + } + + public SnapChatMenuDef(String name, char mnemonic, SnapChatKey uniqueKey) { + super(name, mnemonic); + this.uniqueKey = uniqueKey; + } + + @Override + public boolean hasRead() { + + String calcKey = calcKey(); + return SnapChatConfig.getInstance().hasRead(calcKey); + } + + @Override + public void markRead() { + + String calcKey = calcKey(); + SnapChatConfig.getInstance().markRead(calcKey); + } + + @Override + public SnapChatKey key() { + + return this.uniqueKey; + } + + @Override + protected MenuListener createMenuListener() { + + return new SnapChatMenuListener(); + } + + private String calcKey() { + + return key().calc(); + } + + @Override + protected UIMenu createJMenu0() { + + UIMenu createdJMenu; + if (hasScrollSubMenu) { + createdJMenu = new SnapChatUIScrollMenu(this.getName()); + } else if (isHeadMenu){ + createdJMenu = new SnapChatUIHeadMenu(this.getName()); + } else { + createdJMenu = new SnapChatUIMenu(this.getName()); + } + return createdJMenu; + } + + private class SnapChatMenuListener implements MenuListener { + + @Override + public void menuSelected(MenuEvent e) { + + markRead(); + Object source = e.getSource(); + if (!(source instanceof JMenu)) { + return; + } + updateMenu(); + } + + @Override + public void menuDeselected(MenuEvent e) { + + } + + @Override + public void menuCanceled(MenuEvent e) { + + } + } + + private class SnapChatUIScrollMenu extends UIScrollMenu { + + public SnapChatUIScrollMenu(String s) { + super(s); + } + + @Override + public void updateUI() { + setUI(menuUI); + } + } + + private class SnapChatUIMenu extends UIMenu { + + public SnapChatUIMenu(String name) { + + super(name); + } + + @Override + public void updateUI() { + + setUI(menuUI); + } + } + + private class SnapChatUIHeadMenu extends UIMenu { + + public SnapChatUIHeadMenu(String name) { + + super(name); + } + + @Override + public void updateUI() { + + setUI(menuUI); + } + } + + public static void main(String[] args) { + + BufferedImage image = new BufferedImage(16, 16, Image.SCALE_DEFAULT); + Graphics2D g2d = image.createGraphics(); + g2d.setColor(Color.green); + Ellipse2D.Double shape = + new Ellipse2D.Double(2, 2, 1, 1); + g2d.fill(shape); + g2d.draw(shape); + System.out.println(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuItemUI.java b/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuItemUI.java new file mode 100644 index 000000000..c9ab8532d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuItemUI.java @@ -0,0 +1,31 @@ +package com.fr.design.menu; + +import com.fr.design.gui.imenu.UIMenuItemUI; + +import javax.swing.JMenuItem; +import java.awt.Graphics; +import java.awt.Rectangle; + +/** + * created by Harrison on 2020/03/22 + **/ +class SnapChatMenuItemUI extends UIMenuItemUI { + + private final SnapChatUpdateAction snapChatUpdateAction; + + public SnapChatMenuItemUI(SnapChatUpdateAction snapChatUpdateAction) { + + this.snapChatUpdateAction = snapChatUpdateAction; + } + + @Override + protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) { + + super.paintText(g, menuItem, textRect, text); + + if (!snapChatUpdateAction.hasRead()) { + SnapChatUtil.paintSnapChat(g, textRect); + } + } + +} diff --git a/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuUI.java b/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuUI.java new file mode 100644 index 000000000..47bc3c663 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuUI.java @@ -0,0 +1,29 @@ +package com.fr.design.menu; + +import com.fr.design.gui.imenu.UIMenuUI; + +import javax.swing.JMenuItem; +import java.awt.Graphics; +import java.awt.Rectangle; + +/** + * created by Harrison on 2020/03/22 + **/ +public class SnapChatMenuUI extends UIMenuUI { + + private SnapChatMenuDef menuDef; + + public SnapChatMenuUI(SnapChatMenuDef menuDef) { + this.menuDef = menuDef; + } + + @Override + protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) { + + super.paintText(g, menuItem, textRect, text); + + if (!menuDef.hasRead()) { + SnapChatUtil.paintSnapChat(g, textRect); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java b/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java new file mode 100644 index 000000000..fe1088ea8 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java @@ -0,0 +1,74 @@ +package com.fr.design.menu; + +import com.fr.design.actions.UpdateAction; +import com.fr.design.gui.imenu.UIMenuItem; +import com.fr.design.notification.SnapChat; +import com.fr.design.notification.SnapChatConfig; +import com.fr.design.notification.SnapChatKey; + +import java.awt.event.ActionEvent; + +/** + * created by Harrison on 2020/03/22 + **/ +public class SnapChatUpdateAction extends UpdateAction implements SnapChat { + + private SnapChatKey uniqueKey; + + public SnapChatUpdateAction(SnapChatKey uniqueKey) { + this.uniqueKey = uniqueKey; + } + + @Override + public void actionPerformed(ActionEvent e) { + + markRead(); + actionPerformed0(e); + } + + protected void actionPerformed0(ActionEvent e) { + + } + + @Override + public boolean hasRead() { + + String calcKey = calcKey(); + return SnapChatConfig.getInstance().hasRead(calcKey); + } + + @Override + public void markRead() { + + String calcKey = calcKey(); + SnapChatConfig.getInstance().markRead(calcKey); + } + + @Override + public SnapChatKey key() { + + return this.uniqueKey; + } + + private String calcKey() { + + return key().calc(); + } + + @Override + public UIMenuItem createMenuItem() { + + Object object = this.getValue(UIMenuItem.class.getName()); + if (object == null && !(object instanceof UIMenuItem)) { + UIMenuItem menuItem = new UIMenuItem(this); + // 设置名字用作单元测 + menuItem.setName(getName()); + menuItem.setUI(new SnapChatMenuItemUI(this)); + object = menuItem; + + this.putValue(UIMenuItem.class.getName(), object); + } + return (UIMenuItem) object; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/menu/SnapChatUtil.java b/designer-base/src/main/java/com/fr/design/menu/SnapChatUtil.java new file mode 100644 index 000000000..6eb648055 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/menu/SnapChatUtil.java @@ -0,0 +1,33 @@ +package com.fr.design.menu; + +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.geom.Ellipse2D; + +/** + * created by Harrison on 2020/03/22 + **/ +public class SnapChatUtil { + + public static void paintSnapChat(Graphics g, Rectangle textRect) { + + Color oldColor = g.getColor(); + + double x = textRect.getWidth(); + x += textRect.getX(); + x += 2; + + double y = textRect.getY(); + + Graphics2D g2d = (Graphics2D) g; + g2d.setColor(Color.red); + Ellipse2D.Double shape = + new Ellipse2D.Double(x, y, 4, 4); + g2d.fill(shape); + g2d.draw(shape); + + g2d.setColor(oldColor); + } +} diff --git a/designer-base/src/main/java/com/fr/design/notification/SnapChat.java b/designer-base/src/main/java/com/fr/design/notification/SnapChat.java new file mode 100644 index 000000000..8dd6f8aa2 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChat.java @@ -0,0 +1,28 @@ +package com.fr.design.notification; + +/** + * 阅后即焚的消息提醒 + * + * created by Harrison on 2020/03/16 + **/ +public interface SnapChat { + + /** + * 已读 + * + * @return 是否为已读 + */ + boolean hasRead(); + + /** + * 标记为已读 + */ + void markRead(); + + /** + * 独一无二的标志 + * + * @return 字符标志 + */ + SnapChatKey key(); +} 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 new file mode 100644 index 000000000..6aeb384df --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChatAllTypes.java @@ -0,0 +1,38 @@ +package com.fr.design.notification; + +import com.fr.stable.CommonUtils; + +/** + * created by Harrison on 2020/03/16 + **/ +public abstract class SnapChatAllTypes { + + public enum Menu implements SnapChatKey { + + /** + * 社区按钮 + */ + BBS("BBS"); + + private static final String SIGN = "0001"; + + private String key; + + Menu(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/notification/SnapChatConfig.java b/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java new file mode 100644 index 000000000..c9cc17764 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java @@ -0,0 +1,88 @@ +package com.fr.design.notification; + +import com.fr.stable.xml.XMLPrintWriter; +import com.fr.stable.xml.XMLReadable; +import com.fr.stable.xml.XMLable; +import com.fr.stable.xml.XMLableReader; + +import java.util.HashMap; +import java.util.Map; + +/** + * created by Harrison on 2020/03/16 + **/ +@SuppressWarnings("unchecked") +public class SnapChatConfig implements XMLable { + + public static final String XML_TAG = "SnapChatConfig"; + + /** + * 已经阅读过的属性 + */ + private Map markReadMap = new HashMap<>(8); + + private static final SnapChatConfig INSTANCE = new SnapChatConfig(); + + public static SnapChatConfig getInstance() { + return INSTANCE; + } + + public Boolean hasRead(String key) { + + Map map = markReadMap; + Boolean val = map.get(key); + return val == null ? Boolean.FALSE : val; + } + + public void markRead(String key) { + + markReadMap.put(key, Boolean.TRUE); + } + + @Override + public void readXML(XMLableReader reader) { + + String tagName = reader.getTagName(); + if ("MarkReadMap".equals(tagName)) { + readMarkReadMapXML(reader); + } + } + + @Override + public void writeXML(XMLPrintWriter writer) { + + writer.startTAG(XML_TAG); + writeMarkReadMapXML(writer); + writer.end(); + } + + private void readMarkReadMapXML(XMLableReader reader) { + + reader.readXMLObject(new XMLReadable() { + @Override + public void readXML(XMLableReader reader) { + String tmpVal = reader.getElementValue(); + Boolean markRead = Boolean.valueOf(tmpVal); + markReadMap.put(reader.getAttrAsString("key", ""), markRead); + } + }); + } + + /** + * 写入map + */ + private void writeMarkReadMapXML(XMLPrintWriter writer) { + + writer.startTAG("MarkReadMap"); + for (Map.Entry item : markReadMap.entrySet()) { + writer.startTAG("item").attr("key", item.getKey()).textNode(item.getValue().toString()).end(); + } + writer.end(); + } + + @Override + public Object clone() throws CloneNotSupportedException { + + return null; + } +} diff --git a/designer-base/src/main/java/com/fr/design/notification/SnapChatKey.java b/designer-base/src/main/java/com/fr/design/notification/SnapChatKey.java new file mode 100644 index 000000000..fa316db35 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChatKey.java @@ -0,0 +1,9 @@ +package com.fr.design.notification; + +/** + * created by Harrison on 2020/03/16 + **/ +public interface SnapChatKey { + + String calc(); +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index c32abb2ff..7d00e367c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -1,42 +1,19 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.icontainer.UIScrollPane; -import com.fr.design.gui.ilable.UILabel; +import com.fr.design.fun.ComponentLibraryPaneProcessor; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.widget.FRWidgetFactory; -import com.fr.form.share.ShareLoader; -import com.fr.form.ui.SharableWidgetBindInfo; -import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.share.ShareConstants; -import com.fr.stable.ArrayUtils; -import com.fr.stable.StringUtils; +import com.fr.design.mainframe.component.pane.ComponentLibraryPaneCreator; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; +import com.fr.plugin.observer.PluginListenerRegistration; -import javax.swing.BorderFactory; -import javax.swing.DefaultComboBoxModel; import javax.swing.Icon; -import javax.swing.JFileChooser; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; -import javax.swing.SwingWorker; -import javax.swing.filechooser.FileNameExtensionFilter; import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Desktop; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; /** * Created with IntelliJ IDEA. @@ -45,19 +22,6 @@ import java.net.URISyntaxException; * Time: 下午8:18 */ public class FormWidgetDetailPane extends FormDockView{ - private static final int LOCAL_WIDGET_LABEL_WIDTH = 90; - - private UIScrollPane downPane; - private JPanel reuWidgetPanel; - private UIComboBox comboBox; - private SharableWidgetBindInfo[] elCaseBindInfoList; - private UIButton deleteButton; - private JPanel editPanel; - private JPanel resetPanel; - private JPanel menutPanelNorthPane; - private SwingWorker sw; - //组件面板是否可以编辑 - private boolean isEdit; public static FormWidgetDetailPane getInstance() { if (HOLDER.singleton == null) { @@ -68,6 +32,7 @@ public class FormWidgetDetailPane extends FormDockView{ private FormWidgetDetailPane(){ setLayout(FRGUIPaneFactory.createBorderLayout()); + listenPluginComponentPane(); } @@ -89,350 +54,56 @@ public class FormWidgetDetailPane extends FormDockView{ public Icon getViewIcon() { return BaseUtils.readIcon("/com/fr/design/images/m_report/attributes.png"); } - + /** * 初始化 */ + @Override public void refreshDockingView(){ + FormDesigner designer = this.getEditingFormDesigner(); removeAll(); if(designer == null){ clearDockingView(); return; } - reuWidgetPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - reuWidgetPanel.setBorder(null); - if (elCaseBindInfoList == null) { - if (sw != null) { - sw.cancel(true); - } - sw = new SwingWorker() { - @Override - protected Object doInBackground() throws Exception { - elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); - refreshDownPanel(false); - return null; - } - }; - sw.execute(); - } - initReuWidgetPanel(); - initMenuPanel(); - - add(reuWidgetPanel, BorderLayout.CENTER); - - } - - /** - * 初始化组件共享和复用面板 - */ - private void initReuWidgetPanel() { - elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); - downPane = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, false)); - downPane.setBorder(null); - reuWidgetPanel.add(downPane); - } - - /** - * 初始化菜单栏面板 - */ - private void initMenuPanel() { - JPanel menutPanel = new JPanel(); - menutPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); - menutPanel.setBorder(BorderFactory.createEmptyBorder(3, 10, 10, 15)); - - menutPanelNorthPane = new JPanel(new BorderLayout()); - UILabel localWidgetLabel = FRWidgetFactory.createLineWrapLabel( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Local_Widget"), - LOCAL_WIDGET_LABEL_WIDTH); - menutPanelNorthPane.add(localWidgetLabel, BorderLayout.WEST); - menutPanelNorthPane.add(initEditButtonPane(), BorderLayout.EAST); - menutPanelNorthPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); - - menutPanel.add(menutPanelNorthPane, BorderLayout.NORTH); - comboBox = new UIComboBox(getFormCategories()); - comboBox.setPreferredSize(new Dimension(240, comboBox.getPreferredSize().height)); - initComboBoxSelectedListener(); - menutPanel.add(comboBox, BorderLayout.CENTER); - reuWidgetPanel.add(menutPanel, BorderLayout.NORTH); - - } - - /** - * 创建菜单栏按钮面板 - */ - private JPanel initEditButtonPane() { - editPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0)); - - editPanel.add(createRefreshButton()); - editPanel.add(createDownloadButton()); - editPanel.add(createInstallButton()); - editPanel.add(createDeleteButton()); - - return editPanel; + + initComponentPane(); } - - /** - * 创建取消删除面板 - */ - private JPanel initResetButtonPane() { - resetPanel = new JPanel(); - UIButton resetButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Reset")); - resetPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); - resetButton.setBackground(Color.white); - resetButton.setForeground(new Color(0x333334)); - resetButton.addActionListener(new ActionListener() { + + private void listenPluginComponentPane() { + + PluginFilter filter = new PluginFilter() { @Override - public void actionPerformed(ActionEvent e) { - refreshDownPanel(false); - replaceButtonPanel(false); - reuWidgetPanel.remove(deleteButton); + public boolean accept(PluginContext context) { + return context.contain(ComponentLibraryPaneProcessor.XML_TAG); } - }); - - deleteButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Remove_Item")); - deleteButton.setBackground(Color.white); - deleteButton.setForeground(new Color(0xeb1d1f)); - deleteButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - if (ShareLoader.getLoader().removeModulesFromList()) { - refreshShareMoudule(); - reuWidgetPanel.remove(deleteButton); - elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Share_Module_Removed_Successful")); - refreshDownPanel(false); - replaceButtonPanel(false); - refreshComboxData(); - } else { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Share_Module_Removed_Failed")); - } - - } - }); - JPanel deletePane = new JPanel(new BorderLayout()); - deletePane.add(deleteButton, BorderLayout.CENTER); - deletePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); - - resetPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); - resetPanel.add(resetButton, BorderLayout.CENTER); - resetPanel.add(deletePane, BorderLayout.WEST); - - refreshDownPanel(true); - - return resetPanel; - - } - - - private void initComboBoxSelectedListener() { - comboBox.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - ShareLoader.getLoader().resetRemovedModuleList(); - int filterIndex = comboBox.getSelectedIndex(); - if (filterIndex == 0) { - elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); - } else { - String filterName = comboBox.getSelectedItem().toString(); - elCaseBindInfoList = ShareLoader.getLoader().getFilterBindInfoList(filterName); - } - refreshDownPanel(isEdit); - - } - }); - } - - /** - * 创建工具条按钮 - */ - private UIButton createToolButton(Icon icon, String toolTip, ActionListener actionListener) { - UIButton toolButton = new UIButton(); - toolButton.setIcon(icon); - toolButton.setToolTipText(toolTip); - toolButton.set4ToolbarButton(); - toolButton.addActionListener(actionListener); - return toolButton; - - } - - /** - * 创建刷新按钮 - */ - private UIButton createRefreshButton() { - return createToolButton( - BaseUtils.readIcon("/com/fr/design/form/images/refresh.png"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh"), - new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - if (sw != null) { - sw.cancel(true); - } - sw = new SwingWorker() { - @Override - protected Object doInBackground() throws Exception { - ShareLoader.getLoader().refreshModule(); - elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); - refreshComboxData(); - refreshDownPanel(false); - return null; - } - }; - sw.execute(); - } - } - ); - } - - private void refreshComboxData() { - comboBox.setSelectedIndex(0); - comboBox.setModel(new DefaultComboBoxModel(getFormCategories())); - } - - /** - * 创建下载模板的按钮 - */ - private UIButton createDownloadButton() { - UIButton downloadButton = new UIButton(); - downloadButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/download icon.png")); - downloadButton.set4ToolbarButton(); - downloadButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Download_Template")); - downloadButton.addActionListener(new ActionListener() { + }; + PluginListenerRegistration.getInstance().listenRunningChanged(new PluginEventListener() { @Override - public void actionPerformed(ActionEvent e) { - String url = CloudCenter.getInstance().acquireUrlByKind("reuse.url"); - if (StringUtils.isEmpty(url)) { - FineLoggerFactory.getLogger().info("The URL is empty!"); - return; - } - try { - Desktop.getDesktop().browse(new URI(url)); - } catch (IOException exp) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser_Duplicate")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } - } - }); - return downloadButton; - } - - /** - * 创建安装模板的按钮 - */ - private UIButton createInstallButton() { - return createToolButton( - BaseUtils.readIcon("/com/fr/design/form/images/install icon.png"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Install_Template"), - new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - JFileChooser fileChooser = new JFileChooser(); - fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); - fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu")); - int returnValue = fileChooser.showDialog(new UILabel(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); - if (returnValue == JFileChooser.APPROVE_OPTION) { - final File chosenFile = fileChooser.getSelectedFile(); - installFromDiskZipFile(chosenFile); - } - } - } - ); - } - - /** - * 创建删除模板的按钮 - */ - private UIButton createDeleteButton() { - return createToolButton( - BaseUtils.readIcon("/com/fr/design/form/images/delete icon.png"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Delete_Template"), - new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - replaceButtonPanel(true); - } - } - ); - } - - private void replaceButtonPanel(boolean isEdit) { - this.isEdit = isEdit; - if (isEdit) { - menutPanelNorthPane.remove(editPanel); - menutPanelNorthPane.add(initResetButtonPane(), BorderLayout.EAST); - } else { - menutPanelNorthPane.remove(resetPanel); - menutPanelNorthPane.add(initEditButtonPane(), BorderLayout.EAST); - ShareLoader.getLoader().resetRemovedModuleList(); - } - } - - private void installFromDiskZipFile(File chosenFile) { - if (chosenFile != null && chosenFile.getName().endsWith(ShareConstants.SUFFIX_MODULE)) { - try { - if (ShareLoader.getLoader().installModuleFromDiskZipFile(chosenFile)) { - refreshShareMoudule(); - elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); - refreshDownPanel(false); - refreshComboxData(); - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Share_Module_OK")); - } else { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Share_Module_Error")); - } - } catch (IOException e) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Share_Module_Error")); - FineLoggerFactory.getLogger().error(e.getMessage(), e); + public void on(PluginEvent event) { + refreshDockingView(); } - } + }, filter); } - - private void refreshShareMoudule() { - try { - ShareLoader.getLoader().refreshModule(); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - - /** - * 获取报表块组件分类 - */ - public String[] getFormCategories() { - return ArrayUtils.addAll(new String[] {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_AllCategories")}, ShareLoader.getLoader().getModuleCategory()); - } - - public void refreshDownPanel(boolean isEdit) { - reuWidgetPanel.remove(downPane); - downPane = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, isEdit)); - downPane.setBorder(null); - reuWidgetPanel.add(downPane); - repaintContainer(); - - } - - public void repaintContainer() { - validate(); - repaint(); - revalidate(); + + private void initComponentPane() { + + ComponentLibraryPaneCreator creator = ComponentLibraryPaneCreator.getNew(); + JPanel componentLibraryPane = creator.create(this); + add(componentLibraryPane, BorderLayout.CENTER); } /** * 清除数据 */ public void clearDockingView() { + JScrollPane psp = new JScrollPane(); psp.setBorder(null); this.add(psp, BorderLayout.CENTER); } - - /** * 定位 * @return 位置 diff --git a/designer-form/src/main/java/com/fr/design/mainframe/component/ComponentLibraryManager.java b/designer-form/src/main/java/com/fr/design/mainframe/component/ComponentLibraryManager.java new file mode 100644 index 000000000..7cd5e6e82 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/component/ComponentLibraryManager.java @@ -0,0 +1,23 @@ +package com.fr.design.mainframe.component; + +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.fun.ComponentLibraryPaneProcessor; +import com.fr.design.mainframe.component.pane.ComponentLibraryPaneProcessorImpl; + +/** + * created by Harrison on 2020/03/16 + **/ +public class ComponentLibraryManager { + + private static ComponentLibraryPaneProcessor DEFAULT = new ComponentLibraryPaneProcessorImpl(); + + public static ComponentLibraryPaneProcessor selectPaneProcessor() { + + ComponentLibraryPaneProcessor right = ExtraDesignClassManager.getInstance().getSingle(ComponentLibraryPaneProcessor.XML_TAG); + + if (right == null || DEFAULT.layerIndex() > right.layerIndex()) { + right = DEFAULT; + } + return right; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java b/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java new file mode 100644 index 000000000..97425fdb4 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java @@ -0,0 +1,68 @@ +package com.fr.design.mainframe.component.pane; + +import com.fr.design.fun.ComponentLibraryPaneProcessor; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DockingView; +import com.fr.design.mainframe.component.ComponentLibraryManager; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; + +/** + * created by Harrison on 2020/03/22 + **/ +public class ComponentLibraryPaneCreator { + + private ComponentLibraryPaneProcessor processor; + + public ComponentLibraryPaneCreator() { + + processor = ComponentLibraryManager.selectPaneProcessor(); + } + + public static ComponentLibraryPaneCreator getNew() { + + return new ComponentLibraryPaneCreator(); + } + + public JPanel create(DockingView dockingView) { + + JPanel componentLibPanel = createComponentLibPanel(); + processor.parentView(dockingView); + processor.parentPane(componentLibPanel); + + JPanel menuPanel = createMenuPanel(); + componentLibPanel.add(menuPanel, BorderLayout.NORTH); + + UIScrollPane showPane = processor.createShowPanel(false); + componentLibPanel.add(showPane); + return componentLibPanel; + } + + private JPanel createComponentLibPanel() { + + JPanel reuWidgetPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + reuWidgetPanel.setBorder(null); + return reuWidgetPanel; + } + + /** + * 初始化菜单栏面板 + */ + private JPanel createMenuPanel() { + + JPanel menuPanel = new JPanel(); + menuPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); + menuPanel.setBorder(BorderFactory.createEmptyBorder(3, 10, 10, 15)); + + JPanel menuPanelNorthPane = processor.createMenuNorthPane(); + menuPanel.add(menuPanelNorthPane, BorderLayout.NORTH); + + UIComboBox menuPanelComboBox = processor.createMenuComBox(); + menuPanel.add(menuPanelComboBox, BorderLayout.CENTER); + return menuPanel; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneProcessorImpl.java b/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneProcessorImpl.java new file mode 100644 index 000000000..18148ce0d --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneProcessorImpl.java @@ -0,0 +1,412 @@ +package com.fr.design.mainframe.component.pane; + +import com.fr.base.BaseUtils; +import com.fr.design.fun.impl.AbstractComponentLibraryPaneProcessor; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DockingView; +import com.fr.design.mainframe.ShareWidgetPane; +import com.fr.design.widget.FRWidgetFactory; +import com.fr.form.share.ShareLoader; +import com.fr.form.ui.SharableWidgetBindInfo; +import com.fr.general.CloudCenter; +import com.fr.log.FineLoggerFactory; +import com.fr.share.ShareConstants; +import com.fr.stable.ArrayUtils; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.DefaultComboBoxModel; +import javax.swing.Icon; +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.SwingWorker; +import javax.swing.filechooser.FileNameExtensionFilter; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Desktop; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + +/** + * created by Harrison on 2020/03/16 + **/ +public class ComponentLibraryPaneProcessorImpl extends AbstractComponentLibraryPaneProcessor { + + private static final int LOCAL_WIDGET_LABEL_WIDTH = 90; + + private DockingView parentView; + + private SwingWorker sw; + + private JPanel componentLibPane; + private UIScrollPane showPane; + + private UIComboBox menuPanelComboBox; + private JPanel menuPanelNorthPane; + private SharableWidgetBindInfo[] bindInfoArray; + + private UIButton deleteButton; + private JPanel editPanel; + private JPanel resetPanel; + /** + * 组件面板是否可以编辑 + */ + private boolean isEdit; + + public ComponentLibraryPaneProcessorImpl() { + + } + + @Override + public void parentView(DockingView dockingView) { + + parentView = dockingView; + if (bindInfoArray == null) { + if (sw != null) { + sw.cancel(true); + } + sw = new SwingWorker() { + @Override + protected Object doInBackground() throws Exception { + bindInfoArray = ShareLoader.getLoader().getAllBindInfoList(); + refreshShowPanel(false); + return null; + } + }; + sw.execute(); + } + } + + @Override + public void parentPane(JPanel panel) { + this.componentLibPane = panel; + } + + @Override + public void complete() { + + } + + /** + * 初始化组件共享和复用面板 + */ + @Override + public UIScrollPane createShowPanel(boolean isEdit) { + + showPane = new UIScrollPane( + new ShareWidgetPane(bindInfoArray, isEdit) + ); + showPane.setBorder(null); + return showPane; + } + + + @Override + public UIComboBox createMenuComBox() { + + menuPanelComboBox = new UIComboBox(getFormCategories()); + menuPanelComboBox.setPreferredSize(new Dimension(240, menuPanelComboBox.getPreferredSize().height)); + addComboBoxListener(); + return menuPanelComboBox; + } + + private void addComboBoxListener() { + + menuPanelComboBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + ShareLoader.getLoader().resetRemovedModuleList(); + int filterIndex = menuPanelComboBox.getSelectedIndex(); + if (filterIndex == 0) { + bindInfoArray = ShareLoader.getLoader().getAllBindInfoList(); + } else { + String filterName = menuPanelComboBox.getSelectedItem().toString(); + bindInfoArray = ShareLoader.getLoader().getFilterBindInfoList(filterName); + } + refreshShowPanel(isEdit); + } + }); + } + + @Override + public JPanel createMenuNorthPane() { + + menuPanelNorthPane = new JPanel(new BorderLayout()); + UILabel localWidgetLabel = FRWidgetFactory.createLineWrapLabel( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Local_Widget"), + LOCAL_WIDGET_LABEL_WIDTH); + menuPanelNorthPane.add(localWidgetLabel, BorderLayout.WEST); + menuPanelNorthPane.add(initEditButtonPane(), BorderLayout.EAST); + menuPanelNorthPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); + return menuPanelNorthPane; + + } + + /** + * 创建菜单栏按钮面板 + */ + protected JPanel initEditButtonPane() { + + editPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0)); + + editPanel.add(createRefreshButton()); + editPanel.add(createDownloadButton()); + editPanel.add(createInstallButton()); + editPanel.add(createDeleteButton()); + + return editPanel; + } + + /** + * 创建取消删除面板 + */ + protected JPanel initResetButtonPane() { + + resetPanel = new JPanel(); + UIButton resetButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Reset")); + resetPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); + resetButton.setBackground(Color.white); + resetButton.setForeground(new Color(0x333334)); + resetButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + refreshShowPanel(false); + replaceButtonPanel(false); + componentLibPane.remove(deleteButton); + } + }); + + deleteButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Remove_Item")); + deleteButton.setBackground(Color.white); + deleteButton.setForeground(new Color(0xeb1d1f)); + deleteButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (ShareLoader.getLoader().removeModulesFromList()) { + refreshShareModule(); + componentLibPane.remove(deleteButton); + bindInfoArray = ShareLoader.getLoader().getAllBindInfoList(); + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Share_Module_Removed_Successful")); + refreshShowPanel(false); + replaceButtonPanel(false); + refreshComboBoxData(); + } else { + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Share_Module_Removed_Failed")); + } + + } + }); + JPanel deletePane = new JPanel(new BorderLayout()); + deletePane.add(deleteButton, BorderLayout.CENTER); + deletePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); + + resetPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); + resetPanel.add(resetButton, BorderLayout.CENTER); + resetPanel.add(deletePane, BorderLayout.WEST); + + refreshShowPanel(true); + + return resetPanel; + + } + + + /** + * 创建工具条按钮 + */ + protected UIButton createToolButton(Icon icon, String toolTip, ActionListener actionListener) { + + UIButton toolButton = new UIButton(); + toolButton.setIcon(icon); + toolButton.setToolTipText(toolTip); + toolButton.set4ToolbarButton(); + toolButton.addActionListener(actionListener); + return toolButton; + + } + + /** + * 创建刷新按钮 + */ + protected UIButton createRefreshButton() { + + return createToolButton( + BaseUtils.readIcon("/com/fr/design/form/images/refresh.png"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh"), + new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (sw != null) { + sw.cancel(true); + } + sw = new SwingWorker() { + @Override + protected Object doInBackground() throws Exception { + ShareLoader.getLoader().refreshModule(); + bindInfoArray = ShareLoader.getLoader().getAllBindInfoList(); + refreshComboBoxData(); + refreshShowPanel(false); + return null; + } + }; + sw.execute(); + } + } + ); + } + + /** + * 创建下载模板的按钮 + */ + protected UIButton createDownloadButton() { + UIButton downloadButton = new UIButton(); + downloadButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/download icon.png")); + downloadButton.set4ToolbarButton(); + downloadButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Download_Template")); + downloadButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + String url = CloudCenter.getInstance().acquireUrlByKind("reuse.url"); + if (StringUtils.isEmpty(url)) { + FineLoggerFactory.getLogger().info("The URL is empty!"); + return; + } + try { + Desktop.getDesktop().browse(new URI(url)); + } catch (IOException exp) { + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser_Duplicate")); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + } catch (URISyntaxException exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + } catch (Exception exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); + } + } + }); + return downloadButton; + } + + /** + * 创建安装模板的按钮 + */ + protected UIButton createInstallButton() { + return createToolButton( + BaseUtils.readIcon("/com/fr/design/form/images/install icon.png"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Install_Template"), + new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + JFileChooser fileChooser = new JFileChooser(); + fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); + fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu")); + int returnValue = fileChooser.showDialog(new UILabel(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); + if (returnValue == JFileChooser.APPROVE_OPTION) { + final File chosenFile = fileChooser.getSelectedFile(); + installFromDiskZipFile(chosenFile); + } + } + } + ); + } + + /** + * 创建删除模板的按钮 + */ + protected UIButton createDeleteButton() { + return createToolButton( + BaseUtils.readIcon("/com/fr/design/form/images/delete icon.png"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Delete_Template"), + new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + replaceButtonPanel(true); + } + } + ); + } + + /** + * 获取报表块组件分类 + */ + protected String[] getFormCategories() { + + return ArrayUtils.addAll(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_AllCategories")}, ShareLoader.getLoader().getModuleCategory()); + } + + protected void refreshShowPanel(boolean isEdit) { + + componentLibPane.remove(showPane); + showPane = createShowPanel(isEdit); + componentLibPane.add(showPane); + repaint(); + } + + private void refreshComboBoxData() { + + menuPanelComboBox.setSelectedIndex(0); + menuPanelComboBox.setModel(new DefaultComboBoxModel(getFormCategories())); + } + + private void replaceButtonPanel(boolean isEdit) { + + this.isEdit = isEdit; + if (isEdit) { + menuPanelNorthPane.remove(editPanel); + menuPanelNorthPane.add(initResetButtonPane(), BorderLayout.EAST); + } else { + menuPanelNorthPane.remove(resetPanel); + menuPanelNorthPane.add(initEditButtonPane(), BorderLayout.EAST); + ShareLoader.getLoader().resetRemovedModuleList(); + } + } + + private void installFromDiskZipFile(File chosenFile) { + + if (chosenFile != null && chosenFile.getName().endsWith(ShareConstants.SUFFIX_MODULE)) { + try { + if (ShareLoader.getLoader().installModuleFromDiskZipFile(chosenFile)) { + refreshShareModule(); + bindInfoArray = ShareLoader.getLoader().getAllBindInfoList(); + refreshShowPanel(false); + refreshComboBoxData(); + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Share_Module_OK")); + } else { + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Share_Module_Error")); + } + } catch (IOException e) { + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Share_Module_Error")); + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } + + private void refreshShareModule() { + try { + ShareLoader.getLoader().refreshModule(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + + public void repaint() { + + parentView.validate(); + parentView.repaint(); + parentView.revalidate(); + } + +} From 7704b05efdb0be05d6f5a24a3659fdd630b2b421 Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 23 Mar 2020 14:12:58 +0800 Subject: [PATCH 195/375] =?UTF-8?q?REPORT-27647=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E5=AE=89=E8=A3=85=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?-=E6=A8=A1=E6=9D=BF=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=201=E3=80=81=E7=A9=BA=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=202=E3=80=81=E5=88=A4=E7=A9=BA=203=E3=80=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20xml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/ComponentLibraryPaneProcessor.java | 28 ++++++++++++++++++- .../design/notification/SnapChatConfig.java | 7 +++-- .../pane/ComponentLibraryPaneCreator.java | 8 ++++-- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/ComponentLibraryPaneProcessor.java b/designer-base/src/main/java/com/fr/design/fun/ComponentLibraryPaneProcessor.java index 88385a11b..7b484b156 100644 --- a/designer-base/src/main/java/com/fr/design/fun/ComponentLibraryPaneProcessor.java +++ b/designer-base/src/main/java/com/fr/design/fun/ComponentLibraryPaneProcessor.java @@ -8,24 +8,50 @@ import com.fr.stable.fun.mark.Immutable; import javax.swing.JPanel; /** + * 组件库面板处理器 + * * created by Harrison on 2020/03/16 **/ public interface ComponentLibraryPaneProcessor extends Immutable { - String XML_TAG = "ParameterExpandablePaneUIProvider"; + String XML_TAG = "ComponentLibraryPaneProcessor"; int CURRENT_LEVEL = 1; + /** + * 创建展示面板 + * + * @param isEdit 是否可以编辑 + * @return 展示面板 + */ UIScrollPane createShowPanel(boolean isEdit); + /** + * 创建菜单的上部面板 + * + * @return 面板 + */ JPanel createMenuNorthPane(); + /** + * 创建复选框 + * + * @return 复选框 + */ UIComboBox createMenuComBox(); void parentView(DockingView dockingView); + /** + * 父面板 + * + * @param panel 面板 + */ void parentPane(JPanel panel); + /** + * 创建完成 + */ void complete(); } diff --git a/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java b/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java index c9cc17764..04170e3be 100644 --- a/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java @@ -1,5 +1,6 @@ package com.fr.design.notification; +import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLReadable; import com.fr.stable.xml.XMLable; @@ -63,7 +64,7 @@ public class SnapChatConfig implements XMLable { public void readXML(XMLableReader reader) { String tmpVal = reader.getElementValue(); Boolean markRead = Boolean.valueOf(tmpVal); - markReadMap.put(reader.getAttrAsString("key", ""), markRead); + markReadMap.put(reader.getAttrAsString("key", StringUtils.EMPTY), markRead); } }); } @@ -82,7 +83,7 @@ public class SnapChatConfig implements XMLable { @Override public Object clone() throws CloneNotSupportedException { - - return null; + + return super.clone(); } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java b/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java index 97425fdb4..8cb5d1533 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java @@ -59,10 +59,14 @@ public class ComponentLibraryPaneCreator { menuPanel.setBorder(BorderFactory.createEmptyBorder(3, 10, 10, 15)); JPanel menuPanelNorthPane = processor.createMenuNorthPane(); - menuPanel.add(menuPanelNorthPane, BorderLayout.NORTH); + if (menuPanelNorthPane != null) { + menuPanel.add(menuPanelNorthPane, BorderLayout.NORTH); + } UIComboBox menuPanelComboBox = processor.createMenuComBox(); - menuPanel.add(menuPanelComboBox, BorderLayout.CENTER); + if (menuPanelComboBox != null) { + menuPanel.add(menuPanelComboBox, BorderLayout.CENTER); + } return menuPanel; } } From b01c14e44b86de43098bd1f4d6eefe2034730a99 Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 24 Mar 2020 14:23:15 +0800 Subject: [PATCH 196/375] =?UTF-8?q?REPORT-27647=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E5=AE=89=E8=A3=85=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?-=E6=A8=A1=E6=9D=BF=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=201=E3=80=81=E6=8A=BD=E5=87=BA=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=9B=B4=E9=80=9A=E7=94=A8=E7=9A=84=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=9D=A5=E6=B7=BB=E5=8A=A0=E9=9D=A2=E6=9D=BF=202=E3=80=81?= =?UTF-8?q?=E4=B8=BA=E5=85=B1=E4=BA=AB=E5=8A=A0=E8=BD=BD=E5=99=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=8F=92=E4=BB=B6=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/fun/PropertyItemPaneProvider.java | 25 ++ .../AbstractPropertyItemPaneProvider.java | 31 ++ .../mainframe/EastRegionContainerPane.java | 139 +++++- .../com/fr/design/mainframe/PaneHolder.java | 17 + .../fr/design/mainframe/PropertyItemBean.java | 68 +++ .../fr/design/menu/SnapChatUpdateAction.java | 8 +- .../mainframe/FormWidgetDetailPane.java | 392 +++++++++++++++-- .../java/com/fr/design/mainframe/JForm.java | 61 ++- .../component/ComponentLibraryManager.java | 23 - .../pane/ComponentLibraryPaneCreator.java | 72 --- .../ComponentLibraryPaneProcessorImpl.java | 412 ------------------ 11 files changed, 697 insertions(+), 551 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/PropertyItemPaneProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractPropertyItemPaneProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/PaneHolder.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/PropertyItemBean.java delete mode 100644 designer-form/src/main/java/com/fr/design/mainframe/component/ComponentLibraryManager.java delete mode 100644 designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java delete mode 100644 designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneProcessorImpl.java diff --git a/designer-base/src/main/java/com/fr/design/fun/PropertyItemPaneProvider.java b/designer-base/src/main/java/com/fr/design/fun/PropertyItemPaneProvider.java new file mode 100644 index 000000000..2dbead9ed --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/PropertyItemPaneProvider.java @@ -0,0 +1,25 @@ +package com.fr.design.fun; + +import com.fr.design.mainframe.PaneHolder; +import com.fr.design.mainframe.PropertyItemBean; +import com.fr.stable.fun.mark.Mutable; +import org.jetbrains.annotations.Nullable; + +/** + * created by Harrison on 2020/03/23 + **/ +public interface PropertyItemPaneProvider extends Mutable { + + int CURRENT_LEVEL = 1; + + String XML_TAG = "PropertyItemPaneProvider"; + + String key(); + + PropertyItemBean getItem(); + + @Nullable + PaneHolder getPaneHolder(Class clazz); + + String replaceKey(); +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractPropertyItemPaneProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractPropertyItemPaneProvider.java new file mode 100644 index 000000000..44e4abd4d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractPropertyItemPaneProvider.java @@ -0,0 +1,31 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.PropertyItemPaneProvider; +import com.fr.design.mainframe.PaneHolder; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +/** + * created by Harrison on 2020/03/23 + **/ +@API(level = PropertyItemPaneProvider.CURRENT_LEVEL) +public abstract class AbstractPropertyItemPaneProvider extends AbstractProvider implements PropertyItemPaneProvider { + + @Override + public PaneHolder getPaneHolder(Class clazz) { + + if (sign().equals(clazz)) { + return getPathHolder0(); + } + return null; + } + + protected abstract PaneHolder getPathHolder0(); + + protected abstract Class sign(); + + @Override + public int currentAPILevel() { + return PropertyItemPaneProvider.CURRENT_LEVEL; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 07191d536..790c0eb39 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -3,7 +3,9 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignerEnvManager; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.constants.UIConstants; +import com.fr.design.fun.PropertyItemPaneProvider; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonUI; import com.fr.design.gui.icontainer.UIEastResizableContainer; @@ -12,12 +14,38 @@ import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.general.FRFont; - +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.context.PluginRuntime; +import com.fr.plugin.injectable.PluginModule; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; +import com.fr.plugin.observer.PluginEventType; +import com.fr.plugin.observer.PluginListenerRegistration; import com.fr.stable.StringUtils; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JDialog; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.SwingConstants; +import javax.swing.SwingUtilities; import javax.swing.border.EmptyBorder; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Container; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsEnvironment; +import java.awt.Image; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; @@ -26,6 +54,7 @@ import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.util.HashSet; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; import java.util.Set; @@ -101,9 +130,95 @@ public class EastRegionContainerPane extends UIEastResizableContainer { defaultAuthorityPane = getDefaultPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Not_Support_Authority_Edit")); switchMode(PropertyMode.REPORT); setContainerWidth(CONTAINER_WIDTH); + + initPluginPane(); + listenPlugin(); } - + + private void listenPlugin() { + + PluginFilter filter = new PluginFilter() { + @Override + public boolean accept(PluginContext context) { + return context.contain(PropertyItemPaneProvider.XML_TAG); + } + }; + PluginListenerRegistration.getInstance().listen( + PluginEventType.AfterRun, + new PluginEventListener() { + @Override + public void on(PluginEvent event) { + PluginContext context = event.getContext(); + PluginRuntime runtime = context.getRuntime(); + Set providers = runtime.get(PropertyItemPaneProvider.XML_TAG); + for (PropertyItemPaneProvider provider : providers) { + addPropertyItem(provider); + } + updateAllPropertyPane(); + } + }, filter); + PluginListenerRegistration.getInstance().listen( + PluginEventType.BeforeStop, + new PluginEventListener(10) { + @Override + public void on(PluginEvent event) { + PluginContext context = event.getContext(); + PluginRuntime runtime = context.getRuntime(); + Set providers = runtime.get(PropertyItemPaneProvider.XML_TAG); + for (PropertyItemPaneProvider provider : providers) { + removePropertyItem(provider); + + } + updateAllPropertyPane(); + } + }, filter); + } + + private void removePropertyItem(PropertyItemPaneProvider provider) { + + propertyItemMap.remove(provider.key()); + String replaceKey = provider.replaceKey(); + PropertyItem replaceItem = propertyItemMap.get(replaceKey); + if (replaceItem != null) { + replaceItem.setReplace(false); + } + } + + private void initPluginPane() { + + ExtraDesignClassManager classManager = PluginModule.getAgent(PluginModule.ExtraDesign); + Set providers = classManager.getArray(PropertyItemPaneProvider.XML_TAG); + for (PropertyItemPaneProvider provider : providers) { + addPropertyItem(provider); + } + } + + private void addPropertyItem(PropertyItemPaneProvider provider) { + + String key = provider.key(); + PropertyItemBean itemBean = provider.getItem(); + PropertyItem propertyItem = new PropertyItem(itemBean.getName(), + itemBean.getTitle(), + itemBean.getBtnIconName(), + itemBean.getVisibleModes(), + itemBean.getEnableModes()); + UIButton button = propertyItem.getButton(); + List buttonListeners = itemBean.getButtonListeners(); + for (ActionListener buttonListener : buttonListeners) { + button.addActionListener(buttonListener); + } + propertyItemMap.put(key, propertyItem); + + String replaceKey = provider.replaceKey(); + PropertyItem replaceItem = propertyItemMap.get(replaceKey); + if (replaceItem != null) { + replaceItem.setReplace(true); + } + + } + private void initPropertyItemList() { + propertyItemMap = new LinkedHashMap<>(); // 有序map // 单元格元素 PropertyItem cellElement = new PropertyItem(KEY_CELL_ELEMENT, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell_Element"), @@ -360,6 +475,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void replaceConfiguredRolesPane(JComponent pane) { propertyItemMap.get(KEY_CONFIGURED_ROLES).replaceContentPane(pane); } + + public void replaceKeyPane(String key, JComponent pane) { + + propertyItemMap.get(key).replaceContentPane(pane); + } public JComponent getConfiguredRolesPane() { return propertyItemMap.get(KEY_CONFIGURED_ROLES).getContentPane(); @@ -511,6 +631,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private PopupDialog popupDialog; // 弹出框 private boolean isPoppedOut = false; // 是否弹出 private boolean isVisible = true; // 是否可见 + private boolean replace = false; // 是否被替代 private boolean isEnabled = true; // 是否可用 private Set visibleModes; private Set enableModes; @@ -563,13 +684,19 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } public boolean isVisible() { - return isVisible; + // 取决于可见且未替代 + return isVisible && !replace; } public void setVisible(boolean isVisible) { this.isVisible = isVisible; } - + + public void setReplace(boolean replace) { + + this.replace = replace; + } + public boolean isEnabled() { return isEnabled; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/PaneHolder.java b/designer-base/src/main/java/com/fr/design/mainframe/PaneHolder.java new file mode 100644 index 000000000..aef5e0b13 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/PaneHolder.java @@ -0,0 +1,17 @@ +package com.fr.design.mainframe; + +import javax.swing.JPanel; + +/** + * created by Harrison on 2020/03/23 + **/ +public interface PaneHolder { + + /** + * 得到 Pane + * + * @param arg 参数 + * @return 面板 + */ + JPanel getInstance(T arg); +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/PropertyItemBean.java b/designer-base/src/main/java/com/fr/design/mainframe/PropertyItemBean.java new file mode 100644 index 000000000..f6a250def --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/PropertyItemBean.java @@ -0,0 +1,68 @@ +package com.fr.design.mainframe; + +import java.awt.event.ActionListener; +import java.util.List; + +/** + * created by Harrison on 2020/03/23 + **/ +public class PropertyItemBean { + + private String name; + private String title; + private String btnIconName; + private EastRegionContainerPane.PropertyMode[] visibleModes; + private EastRegionContainerPane.PropertyMode[] enableModes; + private List buttonListeners; + + public PropertyItemBean() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getBtnIconName() { + return btnIconName; + } + + public void setBtnIconName(String btnIconName) { + this.btnIconName = btnIconName; + } + + public EastRegionContainerPane.PropertyMode[] getVisibleModes() { + return visibleModes; + } + + public void setVisibleModes(EastRegionContainerPane.PropertyMode[] visibleModes) { + this.visibleModes = visibleModes; + } + + public EastRegionContainerPane.PropertyMode[] getEnableModes() { + return enableModes; + } + + public void setEnableModes(EastRegionContainerPane.PropertyMode[] enableModes) { + this.enableModes = enableModes; + } + + public List getButtonListeners() { + return buttonListeners; + } + + public void setButtonListeners(List buttonListeners) { + this.buttonListeners = buttonListeners; + } +} diff --git a/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java b/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java index fe1088ea8..482954546 100644 --- a/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java +++ b/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java @@ -11,7 +11,7 @@ import java.awt.event.ActionEvent; /** * created by Harrison on 2020/03/22 **/ -public class SnapChatUpdateAction extends UpdateAction implements SnapChat { +public abstract class SnapChatUpdateAction extends UpdateAction implements SnapChat { private SnapChatKey uniqueKey; @@ -20,15 +20,13 @@ public class SnapChatUpdateAction extends UpdateAction implements SnapChat { } @Override - public void actionPerformed(ActionEvent e) { + public final void actionPerformed(ActionEvent e) { markRead(); actionPerformed0(e); } - protected void actionPerformed0(ActionEvent e) { - - } + protected abstract void actionPerformed0(ActionEvent e); @Override public boolean hasRead() { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index 7d00e367c..f49f2859b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -1,19 +1,43 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; -import com.fr.design.fun.ComponentLibraryPaneProcessor; +import com.fr.base.FRContext; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.component.pane.ComponentLibraryPaneCreator; -import com.fr.plugin.context.PluginContext; -import com.fr.plugin.manage.PluginFilter; -import com.fr.plugin.observer.PluginEvent; -import com.fr.plugin.observer.PluginEventListener; -import com.fr.plugin.observer.PluginListenerRegistration; +import com.fr.design.widget.FRWidgetFactory; +import com.fr.form.share.ShareLoader; +import com.fr.form.ui.SharableWidgetBindInfo; +import com.fr.general.CloudCenter; +import com.fr.log.FineLoggerFactory; +import com.fr.share.ShareConstants; +import com.fr.stable.ArrayUtils; +import com.fr.stable.StringUtils; +import javax.swing.BorderFactory; +import javax.swing.DefaultComboBoxModel; import javax.swing.Icon; +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; +import javax.swing.SwingWorker; +import javax.swing.filechooser.FileNameExtensionFilter; import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Desktop; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; /** * Created with IntelliJ IDEA. @@ -22,6 +46,19 @@ import java.awt.BorderLayout; * Time: 下午8:18 */ public class FormWidgetDetailPane extends FormDockView{ + private static final int LOCAL_WIDGET_LABEL_WIDTH = 90; + + private UIScrollPane downPane; + private JPanel reuWidgetPanel; + private UIComboBox comboBox; + private SharableWidgetBindInfo[] elCaseBindInfoList; + private UIButton deleteButton; + private JPanel editPanel; + private JPanel resetPanel; + private JPanel menutPanelNorthPane; + private SwingWorker sw; + //组件面板是否可以编辑 + private boolean isEdit; public static FormWidgetDetailPane getInstance() { if (HOLDER.singleton == null) { @@ -32,7 +69,6 @@ public class FormWidgetDetailPane extends FormDockView{ private FormWidgetDetailPane(){ setLayout(FRGUIPaneFactory.createBorderLayout()); - listenPluginComponentPane(); } @@ -54,56 +90,350 @@ public class FormWidgetDetailPane extends FormDockView{ public Icon getViewIcon() { return BaseUtils.readIcon("/com/fr/design/images/m_report/attributes.png"); } - + /** * 初始化 */ - @Override public void refreshDockingView(){ - FormDesigner designer = this.getEditingFormDesigner(); removeAll(); if(designer == null){ clearDockingView(); return; } - - initComponentPane(); + reuWidgetPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + reuWidgetPanel.setBorder(null); + if (elCaseBindInfoList == null) { + if (sw != null) { + sw.cancel(true); + } + sw = new SwingWorker() { + @Override + protected Object doInBackground() throws Exception { + elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); + refreshDownPanel(false); + return null; + } + }; + sw.execute(); + } + initReuWidgetPanel(); + initMenuPanel(); + + add(reuWidgetPanel, BorderLayout.CENTER); + + } + + /** + * 初始化组件共享和复用面板 + */ + private void initReuWidgetPanel() { + elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); + downPane = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, false)); + downPane.setBorder(null); + reuWidgetPanel.add(downPane); + } + + /** + * 初始化菜单栏面板 + */ + private void initMenuPanel() { + JPanel menutPanel = new JPanel(); + menutPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); + menutPanel.setBorder(BorderFactory.createEmptyBorder(3, 10, 10, 15)); + + menutPanelNorthPane = new JPanel(new BorderLayout()); + UILabel localWidgetLabel = FRWidgetFactory.createLineWrapLabel( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Local_Widget"), + LOCAL_WIDGET_LABEL_WIDTH); + menutPanelNorthPane.add(localWidgetLabel, BorderLayout.WEST); + menutPanelNorthPane.add(initEditButtonPane(), BorderLayout.EAST); + menutPanelNorthPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); + + menutPanel.add(menutPanelNorthPane, BorderLayout.NORTH); + comboBox = new UIComboBox(getFormCategories()); + comboBox.setPreferredSize(new Dimension(240, comboBox.getPreferredSize().height)); + initComboBoxSelectedListener(); + menutPanel.add(comboBox, BorderLayout.CENTER); + reuWidgetPanel.add(menutPanel, BorderLayout.NORTH); + + } + + /** + * 创建菜单栏按钮面板 + */ + private JPanel initEditButtonPane() { + editPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0)); + + editPanel.add(createRefreshButton()); + editPanel.add(createDownloadButton()); + editPanel.add(createInstallButton()); + editPanel.add(createDeleteButton()); + + return editPanel; } - - private void listenPluginComponentPane() { - - PluginFilter filter = new PluginFilter() { + + /** + * 创建取消删除面板 + */ + private JPanel initResetButtonPane() { + resetPanel = new JPanel(); + UIButton resetButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Reset")); + resetPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); + resetButton.setBackground(Color.white); + resetButton.setForeground(new Color(0x333334)); + resetButton.addActionListener(new ActionListener() { @Override - public boolean accept(PluginContext context) { - return context.contain(ComponentLibraryPaneProcessor.XML_TAG); + public void actionPerformed(ActionEvent e) { + refreshDownPanel(false); + replaceButtonPanel(false); + reuWidgetPanel.remove(deleteButton); } - }; - PluginListenerRegistration.getInstance().listenRunningChanged(new PluginEventListener() { + }); + + deleteButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Remove_Item")); + deleteButton.setBackground(Color.white); + deleteButton.setForeground(new Color(0xeb1d1f)); + deleteButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (ShareLoader.getLoader().removeModulesFromList()) { + refreshShareMoudule(); + reuWidgetPanel.remove(deleteButton); + elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Share_Module_Removed_Successful")); + refreshDownPanel(false); + replaceButtonPanel(false); + refreshComboxData(); + } else { + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Share_Module_Removed_Failed")); + } + + } + }); + JPanel deletePane = new JPanel(new BorderLayout()); + deletePane.add(deleteButton, BorderLayout.CENTER); + deletePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); + + resetPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); + resetPanel.add(resetButton, BorderLayout.CENTER); + resetPanel.add(deletePane, BorderLayout.WEST); + + refreshDownPanel(true); + + return resetPanel; + + } + + + private void initComboBoxSelectedListener() { + comboBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + ShareLoader.getLoader().resetRemovedModuleList(); + int filterIndex = comboBox.getSelectedIndex(); + if (filterIndex == 0) { + elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); + } else { + String filterName = comboBox.getSelectedItem().toString(); + elCaseBindInfoList = ShareLoader.getLoader().getFilterBindInfoList(filterName); + } + refreshDownPanel(isEdit); + + } + }); + } + + /** + * 创建工具条按钮 + */ + private UIButton createToolButton(Icon icon, String toolTip, ActionListener actionListener) { + UIButton toolButton = new UIButton(); + toolButton.setIcon(icon); + toolButton.setToolTipText(toolTip); + toolButton.set4ToolbarButton(); + toolButton.addActionListener(actionListener); + return toolButton; + + } + + /** + * 创建刷新按钮 + */ + private UIButton createRefreshButton() { + return createToolButton( + BaseUtils.readIcon("/com/fr/design/form/images/refresh.png"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh"), + new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (sw != null) { + sw.cancel(true); + } + sw = new SwingWorker() { + @Override + protected Object doInBackground() throws Exception { + ShareLoader.getLoader().refreshModule(); + elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); + refreshComboxData(); + refreshDownPanel(false); + return null; + } + }; + sw.execute(); + } + } + ); + } + + private void refreshComboxData() { + comboBox.setSelectedIndex(0); + comboBox.setModel(new DefaultComboBoxModel(getFormCategories())); + } + + /** + * 创建下载模板的按钮 + */ + private UIButton createDownloadButton() { + UIButton downloadButton = new UIButton(); + downloadButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/download icon.png")); + downloadButton.set4ToolbarButton(); + downloadButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Download_Template")); + downloadButton.addActionListener(new ActionListener() { @Override - public void on(PluginEvent event) { - refreshDockingView(); + public void actionPerformed(ActionEvent e) { + String url = CloudCenter.getInstance().acquireUrlByKind("reuse.url"); + if (StringUtils.isEmpty(url)) { + FRContext.getLogger().info("The URL is empty!"); + return; + } + try { + Desktop.getDesktop().browse(new URI(url)); + } catch (IOException exp) { + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser_Duplicate")); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + } catch (URISyntaxException exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + } catch (Exception exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); + } + } + }); + return downloadButton; + } + + /** + * 创建安装模板的按钮 + */ + private UIButton createInstallButton() { + return createToolButton( + BaseUtils.readIcon("/com/fr/design/form/images/install icon.png"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Install_Template"), + new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + JFileChooser fileChooser = new JFileChooser(); + fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); + fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu")); + int returnValue = fileChooser.showDialog(new UILabel(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); + if (returnValue == JFileChooser.APPROVE_OPTION) { + final File chosenFile = fileChooser.getSelectedFile(); + installFromDiskZipFile(chosenFile); + } + } + } + ); + } + + /** + * 创建删除模板的按钮 + */ + private UIButton createDeleteButton() { + return createToolButton( + BaseUtils.readIcon("/com/fr/design/form/images/delete icon.png"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Delete_Template"), + new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + replaceButtonPanel(true); + } + } + ); + } + + private void replaceButtonPanel(boolean isEdit) { + this.isEdit = isEdit; + if (isEdit) { + menutPanelNorthPane.remove(editPanel); + menutPanelNorthPane.add(initResetButtonPane(), BorderLayout.EAST); + } else { + menutPanelNorthPane.remove(resetPanel); + menutPanelNorthPane.add(initEditButtonPane(), BorderLayout.EAST); + ShareLoader.getLoader().resetRemovedModuleList(); + } + } + + private void installFromDiskZipFile(File chosenFile) { + if (chosenFile != null && chosenFile.getName().endsWith(ShareConstants.SUFFIX_MODULE)) { + try { + if (ShareLoader.getLoader().installModuleFromDiskZipFile(chosenFile)) { + refreshShareMoudule(); + elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); + refreshDownPanel(false); + refreshComboxData(); + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Share_Module_OK")); + } else { + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Share_Module_Error")); + } + } catch (IOException e) { + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Share_Module_Error")); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } - }, filter); + } } - - private void initComponentPane() { - - ComponentLibraryPaneCreator creator = ComponentLibraryPaneCreator.getNew(); - JPanel componentLibraryPane = creator.create(this); - add(componentLibraryPane, BorderLayout.CENTER); + + private void refreshShareMoudule() { + try { + ShareLoader.getLoader().refreshModule(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + + /** + * 获取报表块组件分类 + */ + public String[] getFormCategories() { + return ArrayUtils.addAll(new String[] {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_AllCategories")}, ShareLoader.getLoader().getModuleCategory()); + } + + public void refreshDownPanel(boolean isEdit) { + reuWidgetPanel.remove(downPane); + downPane = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, isEdit)); + downPane.setBorder(null); + reuWidgetPanel.add(downPane); + repaintContainer(); + + } + + public void repaintContainer() { + validate(); + repaint(); + revalidate(); } /** * 清除数据 */ public void clearDockingView() { - JScrollPane psp = new JScrollPane(); psp.setBorder(null); this.add(psp, BorderLayout.CENTER); } + + /** * 定位 * @return 位置 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 cee0d5b90..98c95a38b 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 @@ -7,6 +7,7 @@ import com.fr.base.extension.FileExtension; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.FormMobileAttrAction; import com.fr.design.actions.TemplateParameterAction; import com.fr.design.actions.core.WorkBookSupportable; @@ -31,6 +32,7 @@ import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; import com.fr.design.fun.PreviewProvider; +import com.fr.design.fun.PropertyItemPaneProvider; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; import com.fr.design.gui.ilable.UILabel; @@ -67,6 +69,14 @@ import com.fr.form.ui.container.WLayout; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.page.PaperSettingProvider; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.context.PluginRuntime; +import com.fr.plugin.injectable.PluginModule; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; +import com.fr.plugin.observer.PluginEventType; +import com.fr.plugin.observer.PluginListenerRegistration; import com.fr.report.cell.Elem; import com.fr.report.cell.cellattr.CellImage; import com.fr.report.worksheet.FormElementCase; @@ -93,6 +103,7 @@ import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Set; public class JForm extends JTemplate implements BaseJForm
{ private static final String FORM_CARD = "FORM"; @@ -118,12 +129,58 @@ public class JForm extends JTemplate implements BaseJForm providers = runtime.get(PropertyItemPaneProvider.XML_TAG); + for (PropertyItemPaneProvider provider : providers) { + addPane(provider); + } + } + }, filter); + } + + private void initPluginPane() { + + ExtraDesignClassManager classManager = PluginModule.getAgent(PluginModule.ExtraDesign); + Set providers = classManager.getArray(PropertyItemPaneProvider.XML_TAG); + for (PropertyItemPaneProvider provider : providers) { + addPane(provider); + } } - + + private void addPane(PropertyItemPaneProvider provider) { + + PaneHolder holder = provider.getPaneHolder(FormDesigner.class); + if (holder != null) { + JPanel panel = holder.getInstance(formDesign); + EastRegionContainerPane.getInstance().replaceKeyPane(provider.key(), panel); + } + } + @Override public void refreshEastPropertiesPane() { // 暂时用不到,遇到的时候再加刷新右侧tab面板的代码 @@ -768,7 +825,7 @@ public class JForm extends JTemplate implements BaseJForm right.layerIndex()) { - right = DEFAULT; - } - return right; - } -} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java b/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java deleted file mode 100644 index 8cb5d1533..000000000 --- a/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneCreator.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.fr.design.mainframe.component.pane; - -import com.fr.design.fun.ComponentLibraryPaneProcessor; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.icontainer.UIScrollPane; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.DockingView; -import com.fr.design.mainframe.component.ComponentLibraryManager; - -import javax.swing.BorderFactory; -import javax.swing.JPanel; -import java.awt.BorderLayout; - -/** - * created by Harrison on 2020/03/22 - **/ -public class ComponentLibraryPaneCreator { - - private ComponentLibraryPaneProcessor processor; - - public ComponentLibraryPaneCreator() { - - processor = ComponentLibraryManager.selectPaneProcessor(); - } - - public static ComponentLibraryPaneCreator getNew() { - - return new ComponentLibraryPaneCreator(); - } - - public JPanel create(DockingView dockingView) { - - JPanel componentLibPanel = createComponentLibPanel(); - processor.parentView(dockingView); - processor.parentPane(componentLibPanel); - - JPanel menuPanel = createMenuPanel(); - componentLibPanel.add(menuPanel, BorderLayout.NORTH); - - UIScrollPane showPane = processor.createShowPanel(false); - componentLibPanel.add(showPane); - return componentLibPanel; - } - - private JPanel createComponentLibPanel() { - - JPanel reuWidgetPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - reuWidgetPanel.setBorder(null); - return reuWidgetPanel; - } - - /** - * 初始化菜单栏面板 - */ - private JPanel createMenuPanel() { - - JPanel menuPanel = new JPanel(); - menuPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); - menuPanel.setBorder(BorderFactory.createEmptyBorder(3, 10, 10, 15)); - - JPanel menuPanelNorthPane = processor.createMenuNorthPane(); - if (menuPanelNorthPane != null) { - menuPanel.add(menuPanelNorthPane, BorderLayout.NORTH); - } - - UIComboBox menuPanelComboBox = processor.createMenuComBox(); - if (menuPanelComboBox != null) { - menuPanel.add(menuPanelComboBox, BorderLayout.CENTER); - } - return menuPanel; - } -} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneProcessorImpl.java b/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneProcessorImpl.java deleted file mode 100644 index 18148ce0d..000000000 --- a/designer-form/src/main/java/com/fr/design/mainframe/component/pane/ComponentLibraryPaneProcessorImpl.java +++ /dev/null @@ -1,412 +0,0 @@ -package com.fr.design.mainframe.component.pane; - -import com.fr.base.BaseUtils; -import com.fr.design.fun.impl.AbstractComponentLibraryPaneProcessor; -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.icontainer.UIScrollPane; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.DockingView; -import com.fr.design.mainframe.ShareWidgetPane; -import com.fr.design.widget.FRWidgetFactory; -import com.fr.form.share.ShareLoader; -import com.fr.form.ui.SharableWidgetBindInfo; -import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.share.ShareConstants; -import com.fr.stable.ArrayUtils; -import com.fr.stable.StringUtils; - -import javax.swing.BorderFactory; -import javax.swing.DefaultComboBoxModel; -import javax.swing.Icon; -import javax.swing.JFileChooser; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.SwingWorker; -import javax.swing.filechooser.FileNameExtensionFilter; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Desktop; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -/** - * created by Harrison on 2020/03/16 - **/ -public class ComponentLibraryPaneProcessorImpl extends AbstractComponentLibraryPaneProcessor { - - private static final int LOCAL_WIDGET_LABEL_WIDTH = 90; - - private DockingView parentView; - - private SwingWorker sw; - - private JPanel componentLibPane; - private UIScrollPane showPane; - - private UIComboBox menuPanelComboBox; - private JPanel menuPanelNorthPane; - private SharableWidgetBindInfo[] bindInfoArray; - - private UIButton deleteButton; - private JPanel editPanel; - private JPanel resetPanel; - /** - * 组件面板是否可以编辑 - */ - private boolean isEdit; - - public ComponentLibraryPaneProcessorImpl() { - - } - - @Override - public void parentView(DockingView dockingView) { - - parentView = dockingView; - if (bindInfoArray == null) { - if (sw != null) { - sw.cancel(true); - } - sw = new SwingWorker() { - @Override - protected Object doInBackground() throws Exception { - bindInfoArray = ShareLoader.getLoader().getAllBindInfoList(); - refreshShowPanel(false); - return null; - } - }; - sw.execute(); - } - } - - @Override - public void parentPane(JPanel panel) { - this.componentLibPane = panel; - } - - @Override - public void complete() { - - } - - /** - * 初始化组件共享和复用面板 - */ - @Override - public UIScrollPane createShowPanel(boolean isEdit) { - - showPane = new UIScrollPane( - new ShareWidgetPane(bindInfoArray, isEdit) - ); - showPane.setBorder(null); - return showPane; - } - - - @Override - public UIComboBox createMenuComBox() { - - menuPanelComboBox = new UIComboBox(getFormCategories()); - menuPanelComboBox.setPreferredSize(new Dimension(240, menuPanelComboBox.getPreferredSize().height)); - addComboBoxListener(); - return menuPanelComboBox; - } - - private void addComboBoxListener() { - - menuPanelComboBox.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - ShareLoader.getLoader().resetRemovedModuleList(); - int filterIndex = menuPanelComboBox.getSelectedIndex(); - if (filterIndex == 0) { - bindInfoArray = ShareLoader.getLoader().getAllBindInfoList(); - } else { - String filterName = menuPanelComboBox.getSelectedItem().toString(); - bindInfoArray = ShareLoader.getLoader().getFilterBindInfoList(filterName); - } - refreshShowPanel(isEdit); - } - }); - } - - @Override - public JPanel createMenuNorthPane() { - - menuPanelNorthPane = new JPanel(new BorderLayout()); - UILabel localWidgetLabel = FRWidgetFactory.createLineWrapLabel( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Local_Widget"), - LOCAL_WIDGET_LABEL_WIDTH); - menuPanelNorthPane.add(localWidgetLabel, BorderLayout.WEST); - menuPanelNorthPane.add(initEditButtonPane(), BorderLayout.EAST); - menuPanelNorthPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); - return menuPanelNorthPane; - - } - - /** - * 创建菜单栏按钮面板 - */ - protected JPanel initEditButtonPane() { - - editPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0)); - - editPanel.add(createRefreshButton()); - editPanel.add(createDownloadButton()); - editPanel.add(createInstallButton()); - editPanel.add(createDeleteButton()); - - return editPanel; - } - - /** - * 创建取消删除面板 - */ - protected JPanel initResetButtonPane() { - - resetPanel = new JPanel(); - UIButton resetButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Reset")); - resetPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); - resetButton.setBackground(Color.white); - resetButton.setForeground(new Color(0x333334)); - resetButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - refreshShowPanel(false); - replaceButtonPanel(false); - componentLibPane.remove(deleteButton); - } - }); - - deleteButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Remove_Item")); - deleteButton.setBackground(Color.white); - deleteButton.setForeground(new Color(0xeb1d1f)); - deleteButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - if (ShareLoader.getLoader().removeModulesFromList()) { - refreshShareModule(); - componentLibPane.remove(deleteButton); - bindInfoArray = ShareLoader.getLoader().getAllBindInfoList(); - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Share_Module_Removed_Successful")); - refreshShowPanel(false); - replaceButtonPanel(false); - refreshComboBoxData(); - } else { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Share_Module_Removed_Failed")); - } - - } - }); - JPanel deletePane = new JPanel(new BorderLayout()); - deletePane.add(deleteButton, BorderLayout.CENTER); - deletePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); - - resetPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); - resetPanel.add(resetButton, BorderLayout.CENTER); - resetPanel.add(deletePane, BorderLayout.WEST); - - refreshShowPanel(true); - - return resetPanel; - - } - - - /** - * 创建工具条按钮 - */ - protected UIButton createToolButton(Icon icon, String toolTip, ActionListener actionListener) { - - UIButton toolButton = new UIButton(); - toolButton.setIcon(icon); - toolButton.setToolTipText(toolTip); - toolButton.set4ToolbarButton(); - toolButton.addActionListener(actionListener); - return toolButton; - - } - - /** - * 创建刷新按钮 - */ - protected UIButton createRefreshButton() { - - return createToolButton( - BaseUtils.readIcon("/com/fr/design/form/images/refresh.png"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh"), - new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - if (sw != null) { - sw.cancel(true); - } - sw = new SwingWorker() { - @Override - protected Object doInBackground() throws Exception { - ShareLoader.getLoader().refreshModule(); - bindInfoArray = ShareLoader.getLoader().getAllBindInfoList(); - refreshComboBoxData(); - refreshShowPanel(false); - return null; - } - }; - sw.execute(); - } - } - ); - } - - /** - * 创建下载模板的按钮 - */ - protected UIButton createDownloadButton() { - UIButton downloadButton = new UIButton(); - downloadButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/download icon.png")); - downloadButton.set4ToolbarButton(); - downloadButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Download_Template")); - downloadButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - String url = CloudCenter.getInstance().acquireUrlByKind("reuse.url"); - if (StringUtils.isEmpty(url)) { - FineLoggerFactory.getLogger().info("The URL is empty!"); - return; - } - try { - Desktop.getDesktop().browse(new URI(url)); - } catch (IOException exp) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser_Duplicate")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } - } - }); - return downloadButton; - } - - /** - * 创建安装模板的按钮 - */ - protected UIButton createInstallButton() { - return createToolButton( - BaseUtils.readIcon("/com/fr/design/form/images/install icon.png"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Install_Template"), - new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - JFileChooser fileChooser = new JFileChooser(); - fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); - fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu")); - int returnValue = fileChooser.showDialog(new UILabel(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); - if (returnValue == JFileChooser.APPROVE_OPTION) { - final File chosenFile = fileChooser.getSelectedFile(); - installFromDiskZipFile(chosenFile); - } - } - } - ); - } - - /** - * 创建删除模板的按钮 - */ - protected UIButton createDeleteButton() { - return createToolButton( - BaseUtils.readIcon("/com/fr/design/form/images/delete icon.png"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Delete_Template"), - new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - replaceButtonPanel(true); - } - } - ); - } - - /** - * 获取报表块组件分类 - */ - protected String[] getFormCategories() { - - return ArrayUtils.addAll(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_AllCategories")}, ShareLoader.getLoader().getModuleCategory()); - } - - protected void refreshShowPanel(boolean isEdit) { - - componentLibPane.remove(showPane); - showPane = createShowPanel(isEdit); - componentLibPane.add(showPane); - repaint(); - } - - private void refreshComboBoxData() { - - menuPanelComboBox.setSelectedIndex(0); - menuPanelComboBox.setModel(new DefaultComboBoxModel(getFormCategories())); - } - - private void replaceButtonPanel(boolean isEdit) { - - this.isEdit = isEdit; - if (isEdit) { - menuPanelNorthPane.remove(editPanel); - menuPanelNorthPane.add(initResetButtonPane(), BorderLayout.EAST); - } else { - menuPanelNorthPane.remove(resetPanel); - menuPanelNorthPane.add(initEditButtonPane(), BorderLayout.EAST); - ShareLoader.getLoader().resetRemovedModuleList(); - } - } - - private void installFromDiskZipFile(File chosenFile) { - - if (chosenFile != null && chosenFile.getName().endsWith(ShareConstants.SUFFIX_MODULE)) { - try { - if (ShareLoader.getLoader().installModuleFromDiskZipFile(chosenFile)) { - refreshShareModule(); - bindInfoArray = ShareLoader.getLoader().getAllBindInfoList(); - refreshShowPanel(false); - refreshComboBoxData(); - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Share_Module_OK")); - } else { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Share_Module_Error")); - } - } catch (IOException e) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Share_Module_Error")); - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - } - - private void refreshShareModule() { - try { - ShareLoader.getLoader().refreshModule(); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - - public void repaint() { - - parentView.validate(); - parentView.repaint(); - parentView.revalidate(); - } - -} From bfa9fe39768a2d9f9fcf7ec73fd9bf670bcb3307 Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 24 Mar 2020 14:38:48 +0800 Subject: [PATCH 197/375] =?UTF-8?q?REPORT-27647=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E5=AE=89=E8=A3=85=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?-=E6=A8=A1=E6=9D=BF=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=20=E5=88=A0=E6=8E=89=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/fun/PropertyItemPaneProvider.java | 21 ++++++++++++++++ ...AbstractComponentLibraryPaneProcessor.java | 25 ------------------- .../mainframe/EastRegionContainerPane.java | 6 +++++ 3 files changed, 27 insertions(+), 25 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractComponentLibraryPaneProcessor.java diff --git a/designer-base/src/main/java/com/fr/design/fun/PropertyItemPaneProvider.java b/designer-base/src/main/java/com/fr/design/fun/PropertyItemPaneProvider.java index 2dbead9ed..2c5c3f2d4 100644 --- a/designer-base/src/main/java/com/fr/design/fun/PropertyItemPaneProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/PropertyItemPaneProvider.java @@ -14,12 +14,33 @@ public interface PropertyItemPaneProvider extends Mutable { String XML_TAG = "PropertyItemPaneProvider"; + /** + * 独一无二的标志 + * + * @return 标志 + */ String key(); + /** + * 配置属性 + * + * @return 熟悉 + */ PropertyItemBean getItem(); + /** + * 面板持有者 + * + * @param clazz 类型 + * @return 持有者 + */ @Nullable PaneHolder getPaneHolder(Class clazz); + /** + * 想要替代的类型 + * + * @return 替代类型 + */ String replaceKey(); } diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractComponentLibraryPaneProcessor.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractComponentLibraryPaneProcessor.java deleted file mode 100644 index f376ad788..000000000 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractComponentLibraryPaneProcessor.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.fr.design.fun.impl; - -import com.fr.design.fun.ComponentLibraryPaneProcessor; -import com.fr.stable.fun.impl.AbstractProvider; -import com.fr.stable.fun.mark.API; -import com.fr.stable.fun.mark.Layer; - -/** - * created by Harrison on 2020/03/16 - **/ -@API(level = ComponentLibraryPaneProcessor.CURRENT_LEVEL) -public abstract class AbstractComponentLibraryPaneProcessor extends AbstractProvider implements ComponentLibraryPaneProcessor { - - @Override - public int currentAPILevel() { - - return ComponentLibraryPaneProcessor.CURRENT_LEVEL; - } - - @Override - public int layerIndex() { - - return Layer.DEFAULT_LAYER_INDEX; - } -} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 790c0eb39..0c23e8658 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -178,6 +178,9 @@ public class EastRegionContainerPane extends UIEastResizableContainer { propertyItemMap.remove(provider.key()); String replaceKey = provider.replaceKey(); + if (replaceKey == null) { + return; + } PropertyItem replaceItem = propertyItemMap.get(replaceKey); if (replaceItem != null) { replaceItem.setReplace(false); @@ -210,6 +213,9 @@ public class EastRegionContainerPane extends UIEastResizableContainer { propertyItemMap.put(key, propertyItem); String replaceKey = provider.replaceKey(); + if (replaceKey == null) { + return; + } PropertyItem replaceItem = propertyItemMap.get(replaceKey); if (replaceItem != null) { replaceItem.setReplace(true); From 57223cd5b6fc83a11c8a17895548f91a94f3277d Mon Sep 17 00:00:00 2001 From: Harrison Date: Wed, 25 Mar 2020 14:43:34 +0800 Subject: [PATCH 198/375] =?UTF-8?q?REPORT-27647=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E5=AE=89=E8=A3=85=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?-=E6=A8=A1=E6=9D=BF=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=20=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=9B=91=E5=90=AC=E4=B8=8A=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/fun/PropertyItemPaneProvider.java | 4 +++ .../mainframe/EastRegionContainerPane.java | 36 ++++++++++++++----- .../fr/design/mainframe/PropertyItemBean.java | 10 ++++++ .../design/notification/SnapChatConfig.java | 12 +++---- .../java/com/fr/design/mainframe/JForm.java | 2 +- 5 files changed, 48 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/PropertyItemPaneProvider.java b/designer-base/src/main/java/com/fr/design/fun/PropertyItemPaneProvider.java index 2c5c3f2d4..4e5112d8c 100644 --- a/designer-base/src/main/java/com/fr/design/fun/PropertyItemPaneProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/PropertyItemPaneProvider.java @@ -14,6 +14,10 @@ public interface PropertyItemPaneProvider extends Mutable { String XML_TAG = "PropertyItemPaneProvider"; + int FIRST = 100; + + int LAST = -100; + /** * 独一无二的标志 * diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 0c23e8658..d73f36a7a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -145,7 +145,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { }; PluginListenerRegistration.getInstance().listen( PluginEventType.AfterRun, - new PluginEventListener() { + new PluginEventListener(PropertyItemPaneProvider.FIRST) { @Override public void on(PluginEvent event) { PluginContext context = event.getContext(); @@ -159,7 +159,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { }, filter); PluginListenerRegistration.getInstance().listen( PluginEventType.BeforeStop, - new PluginEventListener(10) { + new PluginEventListener(PropertyItemPaneProvider.FIRST) { @Override public void on(PluginEvent event) { PluginContext context = event.getContext(); @@ -200,11 +200,22 @@ public class EastRegionContainerPane extends UIEastResizableContainer { String key = provider.key(); PropertyItemBean itemBean = provider.getItem(); - PropertyItem propertyItem = new PropertyItem(itemBean.getName(), - itemBean.getTitle(), - itemBean.getBtnIconName(), - itemBean.getVisibleModes(), - itemBean.getEnableModes()); + String btnIconBaseDir = itemBean.getBtnIconBaseDir(); + PropertyItem propertyItem; + if (StringUtils.isEmpty(btnIconBaseDir)) { + propertyItem = new PropertyItem(itemBean.getName(), + itemBean.getTitle(), + itemBean.getBtnIconName(), + itemBean.getVisibleModes(), + itemBean.getEnableModes()); + } else{ + propertyItem = new PropertyItem(itemBean.getName(), + itemBean.getTitle(), + itemBean.getBtnIconName(), + btnIconBaseDir, + itemBean.getVisibleModes(), + itemBean.getEnableModes()); + } UIButton button = propertyItem.getButton(); List buttonListeners = itemBean.getButtonListeners(); for (ActionListener buttonListener : buttonListeners) { @@ -648,14 +659,21 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private static final String ICON_SUFFIX_DISABLED = "_disabled.png"; private static final String ICON_SUFFIX_SELECTED = "_selected.png"; private String btnIconName; + private String iconBaseDir; private String iconSuffix = ICON_SUFFIX_NORMAL; // normal, diabled, selected, 三者之一 private final Color selectedBtnBackground = new Color(0xF5F5F7); private Color originBtnBackground; - + + public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes) { + this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes); + } + + public PropertyItem(String name, String title, String btnIconName, String iconBaseDir, PropertyMode[] visibleModes, PropertyMode[] enableModes) { this.name = name; this.title = title; this.btnIconName = btnIconName; + this.iconBaseDir = iconBaseDir; initButton(); initPropertyPanel(); initModes(visibleModes, enableModes); @@ -793,7 +811,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } private String getBtnIconUrl() { - return ICON_BASE_DIR + btnIconName + iconSuffix; + return iconBaseDir + btnIconName + iconSuffix; } public void resetButtonIcon() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/PropertyItemBean.java b/designer-base/src/main/java/com/fr/design/mainframe/PropertyItemBean.java index f6a250def..ee54364ba 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/PropertyItemBean.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/PropertyItemBean.java @@ -11,6 +11,7 @@ public class PropertyItemBean { private String name; private String title; private String btnIconName; + private String btnIconBaseDir; private EastRegionContainerPane.PropertyMode[] visibleModes; private EastRegionContainerPane.PropertyMode[] enableModes; private List buttonListeners; @@ -42,6 +43,15 @@ public class PropertyItemBean { this.btnIconName = btnIconName; } + public String getBtnIconBaseDir() { + + return btnIconBaseDir; + } + + public void setBtnIconBaseDir(String btnIconBaseDir) { + this.btnIconBaseDir = btnIconBaseDir; + } + public EastRegionContainerPane.PropertyMode[] getVisibleModes() { return visibleModes; } diff --git a/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java b/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java index 04170e3be..ed6b7a6d8 100644 --- a/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java @@ -43,9 +43,12 @@ public class SnapChatConfig implements XMLable { @Override public void readXML(XMLableReader reader) { - String tagName = reader.getTagName(); - if ("MarkReadMap".equals(tagName)) { - readMarkReadMapXML(reader); + if (reader.isChildNode()) { + if ("item".equals(reader.getTagName())) { + String tmpVal = reader.getElementValue(); + Boolean markRead = Boolean.valueOf(tmpVal); + markReadMap.put(reader.getAttrAsString("key", StringUtils.EMPTY), markRead); + } } } @@ -62,9 +65,6 @@ public class SnapChatConfig implements XMLable { reader.readXMLObject(new XMLReadable() { @Override public void readXML(XMLableReader reader) { - String tmpVal = reader.getElementValue(); - Boolean markRead = Boolean.valueOf(tmpVal); - markReadMap.put(reader.getAttrAsString("key", StringUtils.EMPTY), markRead); } }); } 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 98c95a38b..e95a7962c 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 @@ -150,7 +150,7 @@ public class JForm extends JTemplate implements BaseJForm Date: Wed, 25 Mar 2020 14:55:58 +0800 Subject: [PATCH 199/375] =?UTF-8?q?REPORT-27647=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E5=AE=89=E8=A3=85=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?-=E6=A8=A1=E6=9D=BF=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=20=E5=A4=84=E7=90=86=E4=B8=8B=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E7=9A=84=20npe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EastRegionContainerPane.java | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index d73f36a7a..9276bd5c6 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -200,21 +200,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer { String key = provider.key(); PropertyItemBean itemBean = provider.getItem(); - String btnIconBaseDir = itemBean.getBtnIconBaseDir(); - PropertyItem propertyItem; - if (StringUtils.isEmpty(btnIconBaseDir)) { - propertyItem = new PropertyItem(itemBean.getName(), - itemBean.getTitle(), - itemBean.getBtnIconName(), - itemBean.getVisibleModes(), - itemBean.getEnableModes()); - } else{ - propertyItem = new PropertyItem(itemBean.getName(), + PropertyItem propertyItem = new PropertyItem(itemBean.getName(), itemBean.getTitle(), itemBean.getBtnIconName(), - btnIconBaseDir, itemBean.getVisibleModes(), itemBean.getEnableModes()); + String btnIconBaseDir = itemBean.getBtnIconBaseDir(); + if (StringUtils.isNotEmpty(btnIconBaseDir)) { + propertyItem.setIconBaseDir(btnIconBaseDir); } UIButton button = propertyItem.getButton(); List buttonListeners = itemBean.getButtonListeners(); @@ -730,7 +723,16 @@ public class EastRegionContainerPane extends UIEastResizableContainer { this.isEnabled = isEnabled; button.setEnabled(isEnabled); } - + + public void setIconBaseDir(String iconBaseDir) { + this.iconBaseDir = iconBaseDir; + } + + private String getIconBaseDir() { + + return StringUtils.isEmpty(iconBaseDir) ? ICON_BASE_DIR : iconBaseDir; + } + private void initPropertyPanel() { propertyPanel = new JPanel(); propertyPanel.setBackground(Color.pink); @@ -811,7 +813,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } private String getBtnIconUrl() { - return iconBaseDir + btnIconName + iconSuffix; + + return getIconBaseDir() + btnIconName + iconSuffix; } public void resetButtonIcon() { From fa49b621244fae2e3cac8e2ddb813f8247630be6 Mon Sep 17 00:00:00 2001 From: Harrison Date: Thu, 26 Mar 2020 15:33:40 +0800 Subject: [PATCH 200/375] =?UTF-8?q?REPORT-27647=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E5=AE=89=E8=A3=85=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?-=E6=A8=A1=E6=9D=BF=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=20=E5=9B=BE=E7=89=87=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=85=88=E5=8A=A0=E8=BD=BD=E8=BF=9B=E5=8E=BB=E3=80=82=20set=20?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E5=B0=B1=E6=99=9A=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/EastRegionContainerPane.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 9276bd5c6..cf8f4f74d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -203,12 +203,9 @@ public class EastRegionContainerPane extends UIEastResizableContainer { PropertyItem propertyItem = new PropertyItem(itemBean.getName(), itemBean.getTitle(), itemBean.getBtnIconName(), + itemBean.getBtnIconBaseDir(), itemBean.getVisibleModes(), itemBean.getEnableModes()); - String btnIconBaseDir = itemBean.getBtnIconBaseDir(); - if (StringUtils.isNotEmpty(btnIconBaseDir)) { - propertyItem.setIconBaseDir(btnIconBaseDir); - } UIButton button = propertyItem.getButton(); List buttonListeners = itemBean.getButtonListeners(); for (ActionListener buttonListener : buttonListeners) { From 897c9cbd2e6d05117175cf2e56077425162ce01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 10 Apr 2020 11:04:31 +0800 Subject: [PATCH 201/375] =?UTF-8?q?CHART-13390=20&&=20CHART-13384=20?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../combobox/ColorSchemeComboBox.java | 12 ++++++++---- .../component/VanChartFillStylePane.java | 19 ++++++++++--------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java index 9fcbeb2b6..4358a728d 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java @@ -177,6 +177,8 @@ public class ColorSchemeComboBox extends UIComboBox { private static final int MAX_COUNT = 5; + private static final int BLANK = 1; + @Override public Dimension getPreferredSize() { Dimension preferredSize = super.getPreferredSize(); @@ -198,7 +200,8 @@ public class ColorSchemeComboBox extends UIComboBox { comp.setText(BLANK_SPACE + schemeName); } else { FontMetrics fontMetrics = comp.getFontMetrics(comp.getFont()); - double width = (HEIGHT - 2 * Y) * MAX_COUNT; + //宽度是5倍的高加上4倍的留白 + double width = (HEIGHT - 2 * Y) * MAX_COUNT + BLANK * (MAX_COUNT - 1); String fill = BLANK_SPACE; //图形和文字之间留的宽度大于3倍的X while (fontMetrics.stringWidth(fill) < width + 3 * X) { @@ -228,7 +231,7 @@ public class ColorSchemeComboBox extends UIComboBox { private void drawGradient(Graphics2D g2d, List colors) { //上下留4px,宽度等于5倍高 double height = HEIGHT - 2 * Y; - double width = height * MAX_COUNT; + double width = height * MAX_COUNT + BLANK * (MAX_COUNT - 1); LinearGradientPaint linearGradientPaint = new LinearGradientPaint((float) X, (float) Y, (float) (X + width), (float) Y, new float[]{0f, 1f}, colors.toArray(new Color[colors.size()])); g2d.setPaint(linearGradientPaint); Rectangle2D rec = new Rectangle2D.Double(X, Y, width, height); @@ -238,10 +241,11 @@ public class ColorSchemeComboBox extends UIComboBox { private void drawCombineColor(Graphics2D g2d, List colors) { int size = Math.min(colors.size(), MAX_COUNT); double height = HEIGHT - 2 * Y; - double width = height * MAX_COUNT / size; + //加上1px留白 + double width = ((height + BLANK) * MAX_COUNT - size) / size; for (int i = 0; i < size; i++) { g2d.setPaint(colors.get(i)); - Rectangle2D rec = new Rectangle2D.Double(X + width * i, Y, width, height); + Rectangle2D rec = new Rectangle2D.Double(X + (width + BLANK) * i, Y, width, height); g2d.fill(rec); } } 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 c66262796..63c24a221 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 @@ -52,7 +52,15 @@ public class VanChartFillStylePane extends BasicBeanPane { this.setLayout(new BorderLayout()); styleSelectBox = new ColorSchemeComboBox(); - customPane = new JPanel(FRGUIPaneFactory.createBorderLayout()); + customPane = new JPanel(FRGUIPaneFactory.createBorderLayout()) { + @Override + public Dimension getPreferredSize() { + if (!gradientSelect) { + return colorAdjustPane.getPreferredSize(); + } + return colorGradient.getPreferredSize(); + } + }; changeColorSetPane = new JPanel(cardLayout = new CardLayout()); changeColorSetPane.add(colorGradient = new FixedGradientBar(4, 130), "gradient"); @@ -119,18 +127,11 @@ public class VanChartFillStylePane extends BasicBeanPane { } protected void initLayout() { + this.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); this.setLayout(new BorderLayout()); this.add(getContentPane(), BorderLayout.CENTER); } - @Override - public Dimension getPreferredSize() { - if (gradientSelect) { - return new Dimension(225, 80); - } - return super.getPreferredSize(); - } - protected JPanel getContentPane() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; From d301796c95693500142510bada12fd843b7656cd Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 24 Mar 2020 18:08:10 +0800 Subject: [PATCH 202/375] =?UTF-8?q?REPORT-27647=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E5=AE=89=E8=A3=85=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?-=E6=A8=A1=E6=9D=BF=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=20=E8=B0=83=E6=95=B4=E6=9A=B4=E9=9C=B2?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3=EF=BC=8C=E8=BF=94=E5=9B=9E=E5=90=88?= =?UTF-8?q?=E9=80=82=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/FormCreatorDropTarget.java | 6 ++++-- .../java/com/fr/design/mainframe/FormWidgetDetailPane.java | 4 ++-- .../main/java/com/fr/design/mainframe/ShareWidgetPane.java | 7 ++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java index 5f64335be..06cb19d0a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -23,8 +23,9 @@ import com.fr.design.icon.IconPathConstants; import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.utils.ComponentUtils; import com.fr.form.share.SharableEditorProvider; +import com.fr.form.share.SharableWidgetProvider; import com.fr.form.share.ShareLoader; -import com.fr.form.ui.SharableWidgetBindInfo; +import com.fr.form.ui.ChartEditor; import com.fr.form.ui.Widget; import com.fr.stable.Constants; import com.fr.stable.StringUtils; @@ -42,6 +43,7 @@ import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.dnd.DropTargetEvent; +import java.util.Map; /** * 添加模式下鼠标事件处理器。 @@ -101,7 +103,7 @@ public class FormCreatorDropTarget extends DropTarget { if (addingXCreator.isShared()) { String shareId = addingXCreator.getShareId(); SharableEditorProvider sharableEditor = ShareLoader.getLoader().getSharedElCaseEditorById(shareId); - SharableWidgetBindInfo bindInfo = ShareLoader.getLoader().getElCaseBindInfoById(shareId); + SharableWidgetProvider bindInfo = ShareLoader.getLoader().getElCaseBindInfoById(shareId); if (sharableEditor != null && bindInfo != null) { Map tdNameMap = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(bindInfo.getName(), sharableEditor.getTableDataSource()); //合并数据集之后,可能会有数据集名称变化,做一下联动 diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index f49f2859b..ecb3faa70 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -8,8 +8,8 @@ import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.widget.FRWidgetFactory; +import com.fr.form.share.SharableWidgetProvider; import com.fr.form.share.ShareLoader; -import com.fr.form.ui.SharableWidgetBindInfo; import com.fr.general.CloudCenter; import com.fr.log.FineLoggerFactory; import com.fr.share.ShareConstants; @@ -51,7 +51,7 @@ public class FormWidgetDetailPane extends FormDockView{ private UIScrollPane downPane; private JPanel reuWidgetPanel; private UIComboBox comboBox; - private SharableWidgetBindInfo[] elCaseBindInfoList; + private SharableWidgetProvider[] elCaseBindInfoList; private UIButton deleteButton; private JPanel editPanel; private JPanel resetPanel; diff --git a/designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetPane.java b/designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetPane.java index 32ce586c7..549a4b174 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetPane.java @@ -1,7 +1,8 @@ package com.fr.design.mainframe; -import com.fr.form.ui.SharableWidgetBindInfo; + +import com.fr.form.share.SharableWidgetProvider; import javax.swing.*; import java.awt.*; @@ -12,12 +13,12 @@ import java.awt.*; */ public class ShareWidgetPane extends JPanel { - public ShareWidgetPane(SharableWidgetBindInfo[] elCaseBindInfoList, boolean isEdit) { + public ShareWidgetPane(SharableWidgetProvider[] elCaseBindInfoList, boolean isEdit) { this.setBorder(BorderFactory.createEmptyBorder(10, 3, 0, 0));// 设置面板的边框 ,距离上、左、下、右 的距离 if (elCaseBindInfoList != null) { int rowCount = (elCaseBindInfoList.length + 1) / 2; this.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 10)); - for (SharableWidgetBindInfo rbModuleInfo : elCaseBindInfoList) { + for (SharableWidgetProvider rbModuleInfo : elCaseBindInfoList) { ShareWidgetButton widgetButton = new ShareWidgetButton(rbModuleInfo); widgetButton.setElementCaseEdit(isEdit); this.add(widgetButton); From 486e03ae6a459202995890162afe832d932fb1dc Mon Sep 17 00:00:00 2001 From: Harrison Date: Fri, 10 Apr 2020 11:09:31 +0800 Subject: [PATCH 203/375] =?UTF-8?q?REPORT-27647=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E5=AE=89=E8=A3=85=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?-=E6=A8=A1=E6=9D=BF=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=20=E8=B0=83=E6=95=B4=E6=9A=B4=E9=9C=B2?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3=EF=BC=8C=E8=BF=94=E5=9B=9E=E5=90=88?= =?UTF-8?q?=E9=80=82=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/ShareWidgetButton.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetButton.java b/designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetButton.java index a79ac17a5..7e7d76d89 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetButton.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetButton.java @@ -1,14 +1,13 @@ package com.fr.design.mainframe; -import com.fr.base.BaseUtils; import com.fr.base.iofile.attr.SharableAttrMark; import com.fr.base.vcs.DesignerMode; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.gui.ilable.UILabel; +import com.fr.form.share.SharableWidgetProvider; import com.fr.form.share.ShareLoader; import com.fr.form.ui.AbstractBorderStyleWidget; -import com.fr.form.ui.SharableWidgetBindInfo; import com.fr.form.ui.Widget; import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.general.ComparatorUtils; @@ -52,8 +51,9 @@ import java.io.Serializable; * Time: 16:14 */ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMotionListener, Serializable { + private static final Dimension TAB_DEFAULT_SIZE = new Dimension(500, 300); - private SharableWidgetBindInfo bindInfo; + private SharableWidgetProvider bindInfo; private MouseEvent lastPressEvent; private JPanel reportPane; private boolean isEdit; @@ -72,7 +72,7 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot } }; - public ShareWidgetButton(SharableWidgetBindInfo bindInfo) { + public ShareWidgetButton(SharableWidgetProvider bindInfo) { this.bindInfo = bindInfo; this.setPreferredSize(new Dimension(108, 68)); initUI(); @@ -149,11 +149,11 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot }; } - public SharableWidgetBindInfo getBindInfo() { + public SharableWidgetProvider getBindInfo() { return bindInfo; } - public void setBindInfo(SharableWidgetBindInfo bindInfo) { + public void setBindInfo(SharableWidgetProvider bindInfo) { this.bindInfo = bindInfo; } From 8ca6f60ea72b5b9e9ae6f91c05e367c8db80a1ee Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 10 Apr 2020 11:57:37 +0800 Subject: [PATCH 204/375] =?UTF-8?q?REPORT-29457=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E8=AF=BB=E5=8F=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/i18n/DesignI18nImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/i18n/DesignI18nImpl.java b/designer-base/src/main/java/com/fr/design/i18n/DesignI18nImpl.java index 6e4fa7d3b..7d5770864 100644 --- a/designer-base/src/main/java/com/fr/design/i18n/DesignI18nImpl.java +++ b/designer-base/src/main/java/com/fr/design/i18n/DesignI18nImpl.java @@ -15,6 +15,11 @@ import java.util.Locale; public class DesignI18nImpl implements DesignI18nProvider { + static { + // GeneralContext上下文 存储本次启动的语言环境 直接使用DesignerEnvManager 会在设置语言环境后 不重启 立即生效 存在问题 + GeneralContext.setLocale(DesignerEnvManager.getEnvManager().getLanguage()); + } + private static DesignI18nImpl instance = new DesignI18nImpl(); public static DesignI18nImpl getInstance() { @@ -30,7 +35,7 @@ public class DesignI18nImpl implements DesignI18nProvider { @Override public String i18nText(String key) { - return localeManager.getLocalBundle(DesignerEnvManager.getEnvManager().getLanguage()).getText(localeManager, key); + return localeManager.getLocalBundle(GeneralContext.getLocale()).getText(localeManager, key); } @Override From 00c4744eec30a9d801c59972568d2a1b3bbc47c4 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 10 Apr 2020 17:28:30 +0800 Subject: [PATCH 205/375] MOBILE-26388 && MOBILE-26387 && MOBILE-26189 --- .../designer/creator/XWAbsoluteLayout.java | 12 ------- .../design/mainframe/WidgetPropertyPane.java | 3 +- .../mobile/TabMobileWidgetDefinePane.java | 32 ++++++++++++++----- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 22d702dfd..56fcf6486 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -13,11 +13,8 @@ import com.fr.design.designer.beans.adapters.layout.FRAbsoluteLayoutAdapter; import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; -import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI; import com.fr.design.form.layout.FRAbsoluteLayout; -import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.form.util.XCreatorConstants; -import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.icon.IconPathConstants; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.EditingMouseListener; @@ -593,13 +590,4 @@ public class XWAbsoluteLayout extends XLayoutContainer { public boolean isSupportShared() { return true; } - - @Override - public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { - if (FormDesignerUtils.isAppRelayout(WidgetPropertyPane.getInstance().getEditingFormDesigner())) { - return new WidgetPropertyUIProvider[] {new MobileBooKMarkUsePropertyUI(this)}; - } else { - return super.getWidgetPropertyUIProviders(); - } - } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java index c96683f31..f7668b30a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java @@ -9,6 +9,7 @@ import com.fr.design.designer.creator.*; import com.fr.design.designer.properties.EventPropertyTable; import com.fr.design.designer.properties.mobile.MobileBookMarkPropertyUI; import com.fr.design.designer.properties.mobile.MobileStylePropertyUI; +import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.icontainer.UIScrollPane; @@ -178,7 +179,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper if (selection != null && xCreator != null) { embeddedPropertyUIProviders = selection.getSelectedCreator().getWidgetPropertyUIProviders(); if(!designer.getDesignerMode().isFormParameterEditor()) { - if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class)) { + if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class) && FormDesignerUtils.isAppRelayout(designer)) { embeddedPropertyUIProviders = ArrayUtils.insert(0, embeddedPropertyUIProviders, new MobileBookMarkPropertyUI(xCreator)); } if (xCreator.supportMobileStyle()) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java index 5cf7f74f7..51d9aa10a 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java @@ -5,6 +5,7 @@ import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.creator.XCreator; import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; @@ -14,6 +15,7 @@ import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.widget.accessibles.AccessibleTemplateStyleEditor; import com.fr.design.mainframe.widget.accessibles.MobileTemplateStylePane; +import com.fr.design.widget.ui.designer.mobile.component.MobileBookMarkUsePane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentMarginPane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentLayoutIntervalPane; import com.fr.form.ui.container.cardlayout.WCardTagLayout; @@ -30,6 +32,7 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { private AttributeChangeListener changeListener; private MobileComponentMarginPane marginPane; private MobileComponentLayoutIntervalPane intervalPane; + private MobileBookMarkUsePane mobileBookMarkUsePane; public TabMobileWidgetDefinePane(XCreator xCreator) { this.xCreator = xCreator; @@ -62,9 +65,15 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { JPanel holder = FRGUIPaneFactory.createBorderLayout_S_Pane(); holder.add(jPanel, BorderLayout.NORTH); if (!shouldHidePadding(designer)) { + JPanel innerAdvancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); marginPane = new MobileComponentMarginPane(FormTabPaddingAttrMark.XML_TAG); intervalPane = new MobileComponentLayoutIntervalPane(FormTabPaddingAttrMark.XML_TAG); - UIExpandablePane advancePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, marginPane); + if (FormDesignerUtils.isAppRelayout(designer)) { + mobileBookMarkUsePane = new MobileBookMarkUsePane(); + innerAdvancePane.add(mobileBookMarkUsePane, BorderLayout.SOUTH); + } + innerAdvancePane.add(marginPane, BorderLayout.CENTER); + UIExpandablePane advancePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, innerAdvancePane); UIExpandablePane layoutPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"), 280, 20, intervalPane); //高级 holder.add(advancePane, BorderLayout.CENTER); @@ -77,27 +86,34 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { @Override public void populate(FormDesigner designer) { - templateStyleEditor.setValue(((WCardTagLayout) xCreator.toData()).getMobileTemplateStyle()); + WCardTagLayout wCardTagLayout = (WCardTagLayout) xCreator.toData(); + templateStyleEditor.setValue((wCardTagLayout).getMobileTemplateStyle()); // 数据 populate 完成后,再设置监听 this.bindListeners2Widgets(); this.addAttributeChangeListener(changeListener); if (marginPane != null) {//业务层面可以写成shouldHidePadding但是这样写应该性能差点 - marginPane.populate((WCardTagLayout) xCreator.toData()); + marginPane.populate(wCardTagLayout); } if (intervalPane != null) { - intervalPane.populate((WCardTagLayout) xCreator.toData()); + intervalPane.populate(wCardTagLayout); + } + if (mobileBookMarkUsePane != null) { + mobileBookMarkUsePane.populate(xCreator); } } @Override public void update() { - ((WCardTagLayout) xCreator.toData()).setMobileTemplateStyle((MobileTemplateStyle) templateStyleEditor.getValue()); + WCardTagLayout wCardTagLayout = (WCardTagLayout) xCreator.toData(); + (wCardTagLayout).setMobileTemplateStyle((MobileTemplateStyle) templateStyleEditor.getValue()); DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来 if (marginPane != null) { - marginPane.update((WCardTagLayout) xCreator.toData()); + marginPane.update(wCardTagLayout); } if (intervalPane != null) { - intervalPane.update((WCardTagLayout) xCreator.toData()); + intervalPane.update(wCardTagLayout); } - } + if (mobileBookMarkUsePane != null) { + mobileBookMarkUsePane.update(xCreator); + } } } From 3d72ad46378adea54965c2277183b836ce9671cd Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 10 Apr 2020 17:30:01 +0800 Subject: [PATCH 206/375] fix --- .../widget/ui/designer/mobile/TabMobileWidgetDefinePane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java index 51d9aa10a..3f3d34eaf 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java @@ -115,5 +115,6 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { } if (mobileBookMarkUsePane != null) { mobileBookMarkUsePane.update(xCreator); - } } + } + } } From 6894dce984c42ea61cb8f39addeb35dedcc23824 Mon Sep 17 00:00:00 2001 From: Starryi Date: Fri, 10 Apr 2020 18:05:28 +0800 Subject: [PATCH 207/375] =?UTF-8?q?MOBILE-26191=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=BF=AB=E9=80=9F=E5=AE=9A=E4=BD=8D=E9=85=8D=E7=BD=AE=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E5=AD=98=E5=9C=A8=E4=B8=8D=E7=AC=A6=E5=90=88=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 组件高度较小 2. 国际版上内容超出显示范围,不可滚动 --- ...arMobileBookMarkStyleCustomDefinePane.java | 37 +++++++++++++------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java index 66358a30e..817f29951 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.mobile.ui; import com.fr.base.BaseUtils; import com.fr.base.Utils; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.AttrScrollPane; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.LineComboBox; @@ -34,6 +35,7 @@ import java.awt.*; public class SidebarMobileBookMarkStyleCustomDefinePane extends BasicBeanPane { private static final long serialVersionUID = 1L; + private static final int COLUMN_HEIGHT = 20; private static final int COLUMN_WIDTH = 160; private UnsignedIntUISpinner buttonWidthSpinner; @@ -73,9 +75,20 @@ public class SidebarMobileBookMarkStyleCustomDefinePane extends BasicBeanPane Date: Mon, 13 Apr 2020 11:21:42 +0800 Subject: [PATCH 208/375] =?UTF-8?q?REPORT-29722=E3=80=90=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=8D=E7=94=A8=E6=8F=92=E4=BB=B6=E3=80=91@harrison,?= =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=9A=84=E5=B0=8F=E7=BA=A2=E7=82=B9=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E8=A3=85=E6=8F=92=E4=BB=B6=E4=B9=9F=E6=9C=89=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=A4=84=E7=90=86=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=80=E4=B8=8B=E8=8F=9C=E5=8D=95=E7=9A=84=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E3=80=82=20=E9=BB=98=E8=AE=A4=E6=98=AF=E5=B7=B2=E8=AF=BB?= =?UTF-8?q?=E7=8A=B6=E6=80=81=EF=BC=8C=E5=8F=AA=E6=9C=89=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E4=BA=86=E9=9D=9E=E5=B7=B2=E8=AF=BB=E7=9A=84=E6=8C=89=E9=92=AE?= =?UTF-8?q?=EF=BC=8C=E6=89=8D=E4=BC=9A=E5=B1=95=E7=A4=BA=E6=88=90=E9=9D=9E?= =?UTF-8?q?=E5=B7=B2=E8=AF=BB=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/menu/SnapChatMenuDef.java | 28 ++++++- .../fr/design/menu/SnapChatUpdateAction.java | 9 ++- .../com/fr/design/notification/SnapChat.java | 7 ++ .../design/notification/SnapChatConfig.java | 8 +- .../fr/design/menu/SnapChatMenuDefTest.java | 76 +++++++++++++++++++ 5 files changed, 124 insertions(+), 4 deletions(-) create mode 100644 designer-base/src/test/java/com/fr/design/menu/SnapChatMenuDefTest.java diff --git a/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java b/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java index 473c17f25..defbf0dbb 100644 --- a/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java +++ b/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java @@ -42,7 +42,9 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat { public boolean hasRead() { String calcKey = calcKey(); - return SnapChatConfig.getInstance().hasRead(calcKey); + Boolean val = SnapChatConfig.getInstance().hasRead(calcKey); + // 默认读过了。 + return val == null ? defaultStatus() : val; } @Override @@ -52,6 +54,30 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat { SnapChatConfig.getInstance().markRead(calcKey); } + @Override + public boolean defaultStatus() { + + return true; + } + + @Override + public void addShortCut(ShortCut... shortCuts) { + + if (shortCuts == null) { + return; + } + for (ShortCut shortCut : shortCuts) { + if (shortCut instanceof SnapChatUpdateAction) { + SnapChatUpdateAction action = (SnapChatUpdateAction) shortCut; + if (!action.hasRead()) { + String calcKey = calcKey(); + SnapChatConfig.getInstance().resetRead(calcKey); + } + } + } + super.addShortCut(shortCuts); + } + @Override public SnapChatKey key() { diff --git a/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java b/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java index 482954546..9ade76250 100644 --- a/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java +++ b/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java @@ -32,7 +32,8 @@ public abstract class SnapChatUpdateAction extends UpdateAction implements SnapC public boolean hasRead() { String calcKey = calcKey(); - return SnapChatConfig.getInstance().hasRead(calcKey); + Boolean val = SnapChatConfig.getInstance().hasRead(calcKey); + return val == null ? defaultStatus() : val; } @Override @@ -42,6 +43,12 @@ public abstract class SnapChatUpdateAction extends UpdateAction implements SnapC SnapChatConfig.getInstance().markRead(calcKey); } + @Override + public boolean defaultStatus() { + + return false; + } + @Override public SnapChatKey key() { diff --git a/designer-base/src/main/java/com/fr/design/notification/SnapChat.java b/designer-base/src/main/java/com/fr/design/notification/SnapChat.java index 8dd6f8aa2..4f610c060 100644 --- a/designer-base/src/main/java/com/fr/design/notification/SnapChat.java +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChat.java @@ -7,6 +7,13 @@ package com.fr.design.notification; **/ public interface SnapChat { + /** + * 默认状态 + * + * @return 默认状态 + */ + boolean defaultStatus(); + /** * 已读 * diff --git a/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java b/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java index ed6b7a6d8..c192d054c 100644 --- a/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java @@ -31,8 +31,7 @@ public class SnapChatConfig implements XMLable { public Boolean hasRead(String key) { Map map = markReadMap; - Boolean val = map.get(key); - return val == null ? Boolean.FALSE : val; + return map.get(key); } public void markRead(String key) { @@ -40,6 +39,11 @@ public class SnapChatConfig implements XMLable { markReadMap.put(key, Boolean.TRUE); } + public void resetRead(String key) { + + markReadMap.put(key, Boolean.FALSE); + } + @Override public void readXML(XMLableReader reader) { diff --git a/designer-base/src/test/java/com/fr/design/menu/SnapChatMenuDefTest.java b/designer-base/src/test/java/com/fr/design/menu/SnapChatMenuDefTest.java new file mode 100644 index 000000000..25671596c --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/menu/SnapChatMenuDefTest.java @@ -0,0 +1,76 @@ +package com.fr.design.menu; + +import com.fr.config.dao.DaoContext; +import com.fr.config.dao.impl.LocalClassHelperDao; +import com.fr.config.dao.impl.LocalEntityDao; +import com.fr.config.dao.impl.LocalXmlEntityDao; +import com.fr.design.actions.UpdateAction; +import com.fr.design.notification.SnapChatAllTypes; +import com.fr.design.notification.SnapChatConfig; +import com.fr.stable.xml.XMLableReader; +import com.fr.store.StateHubManager; +import com.fr.store.impl.MemoryLock; +import com.fr.store.impl.MemoryStore; +import com.fr.transaction.Configurations; +import com.fr.transaction.LocalConfigurationHelper; +import org.easymock.EasyMock; +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.api.support.membermodification.MemberMatcher; +import org.powermock.core.classloader.annotations.PowerMockIgnore; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; +import org.powermock.reflect.Whitebox; + +import java.awt.event.ActionEvent; +import java.util.HashMap; + +@RunWith(PowerMockRunner.class) +@PrepareForTest({SnapChatConfig.class, SnapChatUpdateAction.class}) +@PowerMockIgnore({"javax.crypto.*","javax.net.ssl.*","sun.security.ssl.*","com.sun.*"}) +public class SnapChatMenuDefTest { + + @Before + public void before() throws Exception { + + DaoContext.setXmlEntityDao(new LocalXmlEntityDao()); + DaoContext.setClassHelperDao(new LocalClassHelperDao()); + DaoContext.setEntityDao(new LocalEntityDao()); + StateHubManager.setLock(new MemoryLock()); + StateHubManager.setStorage(new MemoryStore()); + Configurations.setHelper(new LocalConfigurationHelper()); + } + + @Test + public void testAddShortCut() throws Exception { + + PowerMock.suppress(MemberMatcher.constructor(UpdateAction.class)); + SnapChatConfig snapChatConfig = EasyMock.partialMockBuilder(SnapChatConfig.class) + .addMockedMethod("readXML") + .createMock(); + Whitebox.setInternalState(snapChatConfig, "markReadMap", new HashMap()); + snapChatConfig.readXML(EasyMock.anyObject(XMLableReader.class)); + EasyMock.expectLastCall().anyTimes(); + EasyMock.replay(snapChatConfig); + + PowerMock.mockStatic(SnapChatConfig.class); + EasyMock.expect(SnapChatConfig.getInstance()).andReturn(snapChatConfig).anyTimes(); + PowerMock.replayAll(); + + SnapChatMenuDef menuDef = new SnapChatMenuDef("test", SnapChatAllTypes.Menu.BBS); + ShortCut action = new SnapChatUpdateAction(SnapChatAllTypes.Menu.BBS) { + @Override + protected void actionPerformed0(ActionEvent e) { + + } + }; + + Assert.assertTrue(menuDef.hasRead()); + + menuDef.addShortCut(action); + Assert.assertFalse(menuDef.hasRead()); + } +} \ No newline at end of file From 2c91ce7fa4e1fe0d5d9bf6449d9ade611cc93cf6 Mon Sep 17 00:00:00 2001 From: Starryi Date: Mon, 13 Apr 2020 14:01:57 +0800 Subject: [PATCH 209/375] =?UTF-8?q?MOBILE-26509=20=E8=81=94=E6=8E=92tab?= =?UTF-8?q?=E7=9A=84=E6=A0=87=E9=A2=98=E8=83=8C=E6=99=AF=E8=89=B2=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=BA=86"=E9=80=8F=E6=98=8E"=EF=BC=8C=E4=BD=86?= =?UTF-8?q?=E5=9C=A8=E7=A7=BB=E5=8A=A8=E7=AB=AF=E4=B8=8A=E7=9C=8B=E6=98=AF?= =?UTF-8?q?=E7=99=BD=E8=89=B2=E7=9A=84=EF=BC=8C=E5=BA=94=E8=AF=A5=E6=98=BE?= =?UTF-8?q?=E7=A4=BAtab=E8=83=8C=E6=99=AF=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 设计文档修改为背景色选择器无透明项 --- .../design/mainframe/mobile/ui/UniteStyleDefinePane.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java index 2f269b028..527697501 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java @@ -12,6 +12,7 @@ import com.fr.design.mainframe.widget.MobileTabFontConfPane; import com.fr.design.mainframe.widget.UITitleSplitLine; import com.fr.design.mainframe.widget.preview.MobileTemplatePreviewPane; import com.fr.design.style.color.ColorSelectBox; +import com.fr.design.style.color.NewColorSelectBox; import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.general.cardtag.mobile.MobileTemplateStyle; import com.fr.general.cardtag.mobile.TabFontConfig; @@ -33,8 +34,8 @@ public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane { private UnsignedIntUISpinner paddingLeftSpinner; private UnsignedIntUISpinner paddingRightSpinner; - private ColorSelectBox initialBackgroundColorBox; - private ColorSelectBox selectedBackgroundColorBox; + private NewColorSelectBox initialBackgroundColorBox; + private NewColorSelectBox selectedBackgroundColorBox; private LineComboBox borderWidthComboBox; private ColorSelectBox borderColorBox; @@ -96,9 +97,9 @@ public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane { } private JPanel createBackgroundColorConfPanel() { - this.initialBackgroundColorBox = new ColorSelectBox(LINE_COMPONENT_WIDTH); + this.initialBackgroundColorBox = new NewColorSelectBox(LINE_COMPONENT_WIDTH); this.initialBackgroundColorBox.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT)); - this.selectedBackgroundColorBox = new ColorSelectBox(LINE_COMPONENT_WIDTH); + this.selectedBackgroundColorBox = new NewColorSelectBox(LINE_COMPONENT_WIDTH); this.selectedBackgroundColorBox.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT)); UILabel initialBackgroundColorLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Init_Fill") + ":", SwingConstants.RIGHT); From 82d69aa9cbc91db3f9bacde151531a7c7fde922b Mon Sep 17 00:00:00 2001 From: Starryi Date: Mon, 13 Apr 2020 14:20:15 +0800 Subject: [PATCH 210/375] =?UTF-8?q?MOBILE-26514=20=E4=BE=A7=E8=BE=B9?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E8=AE=BE=E7=BD=AE=E4=BA=86=E9=80=8F=E6=98=8E?= =?UTF-8?q?=E4=BC=9A=E5=AF=BC=E8=87=B4=E4=BF=9D=E5=AD=98=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 处理ColorSelectBox选择透明后返回空对象的问题 --- .../ui/SidebarMobileBookMarkStyleCustomDefinePane.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java index 817f29951..ae79160bb 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java @@ -358,9 +358,7 @@ public class SidebarMobileBookMarkStyleCustomDefinePane extends BasicBeanPane Date: Mon, 13 Apr 2020 18:17:30 +0800 Subject: [PATCH 211/375] =?UTF-8?q?KERNEL-3790=20PluginStoreConstants=20?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E5=A5=BD=E5=83=8F=E4=B8=8D=E5=A4=AA=E5=AF=B9?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E6=80=8E=E4=B9=88=E8=BF=98=E6=8F=90=E4=BE=9B?= =?UTF-8?q?=E5=8D=95=E4=BE=8B=E6=96=B9=E6=B3=95=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/extra/WebViewDlgHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java b/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java index 3abcfc0a4..47d154146 100644 --- a/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java @@ -75,7 +75,7 @@ public class WebViewDlgHelper { } return; } - String jar_version = PluginStoreConstants.getInstance().getProps(ENV_VERSION, StringUtils.EMPTY); + String jar_version = PluginStoreConstants.getProps(ENV_VERSION, StringUtils.EMPTY); if (ComparatorUtils.equals(jar_version, ProductConstants.VERSION)) { updateShopScripts(SHOP_SCRIPTS); showPluginDlg(); @@ -297,7 +297,7 @@ public class WebViewDlgHelper { protected Void doInBackground() throws Exception { String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.update"); if (url != null) { - String text = HttpToolbox.get(url + "?" + PluginUtils.FR_VERSION + "=" + ProductConstants.VERSION + "&version=" + PluginStoreConstants.getInstance().getProps("VERSION")); + String text = HttpToolbox.get(url + "?" + PluginUtils.FR_VERSION + "=" + ProductConstants.VERSION + "&version=" + PluginStoreConstants.getProps("VERSION")); JSONObject resultJSONObject = new JSONObject(text); String isLatest = resultJSONObject.optString("result"); if (!ComparatorUtils.equals(isLatest, LATEST)) { From 0cd9cbb974947e035410cd0a485387c844b9e6fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 14 Apr 2020 14:11:55 +0800 Subject: [PATCH 212/375] =?UTF-8?q?CHART-13460=20FR=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=BC=BA=E5=A4=B1=E4=B8=8B=E8=BD=BD=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/chart/ChartDesignerActivator.java | 4 +++ .../chart/DownloadOnlineSourcesHelper.java | 28 +++++++++---------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java index c5bfdc839..f47f42134 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java @@ -1,6 +1,7 @@ package com.fr.design.chart; import com.fr.chart.chartattr.ChartCollection; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.gui.ChartComponent; @@ -17,6 +18,7 @@ import com.fr.module.Activator; import com.fr.module.extension.Prepare; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; +import com.fr.van.chart.DownloadOnlineSourcesHelper; import com.fr.van.chart.map.server.ChartMapEditorAction; /** @@ -47,6 +49,8 @@ public class ChartDesignerActivator extends Activator implements Prepare { DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption()); + GEOJSONHelper.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); + ChartTypeInterfaceManager.addPluginChangedListener(); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java b/designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java index c0fd71068..33dba72f9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java +++ b/designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java @@ -6,26 +6,32 @@ import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.PluginConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.IOUtils; - import com.fr.general.CloudCenter; +import com.fr.general.IOUtils; import com.fr.general.http.HttpClient; import com.fr.plugin.chart.DownloadSourcesEvent; import com.fr.stable.CommonUtils; import com.fr.stable.StableUtils; import com.fr.workspace.WorkContext; -import javax.swing.*; -import java.awt.*; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.awt.image.BufferedImage; +import javax.swing.ImageIcon; +import javax.swing.JDialog; +import javax.swing.JFrame; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JProgressBar; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.net.HttpURLConnection; import java.util.ArrayList; import java.util.List; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Rectangle; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.image.BufferedImage; /** * Created by shine on 2017/8/21. @@ -51,13 +57,6 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent { //总共字节数 private double totalBytes = 0; - - private static final double PHANTOM_MB = 96.1 * 1024 * 1024; - - public void addPhantomSiteInfo() { - this.addSiteInfo("plugin.phantomjs", ChartConstants.PHANTOMJS_URL, PHANTOM_MB); - } - private static final double MAP_JSON_MB = 4.5 * 1024 * 1024; public void addMapJSONSiteInfo() { @@ -219,7 +218,6 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent { @Override public void downloadSources() { this.addMapJSONSiteInfo(); - this.addPhantomSiteInfo(); this.installOnline(); } From 212bcef93f38d2e69d015862f817e29c7517fc11 Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Tue, 14 Apr 2020 16:53:49 +0800 Subject: [PATCH 213/375] EPORT-27996 bugfix --- .../java/com/fr/design/gui/ilist/TableViewList.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java b/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java index 06a4f5480..cccf64e26 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java @@ -91,10 +91,10 @@ public class TableViewList extends UIList { if (refreshList != null) { refreshList.cancel(true); } - refreshList = new SwingWorker() { + refreshList = new SwingWorker() { @Override - protected Void doInBackground() throws Exception { + protected DefaultListModel doInBackground() throws Exception { Connection datasource = ConnectionConfig.getInstance().getConnection(databaseName); boolean status = false; int count = 3; @@ -106,13 +106,13 @@ public class TableViewList extends UIList { if (!status) { throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); } - TableViewList.this.setModel(processDataInAnotherThread(databaseName, searchFilter, typesFilter)); - return null; + return processDataInAnotherThread(databaseName, searchFilter, typesFilter); } + @Override public void done() { try { - get(); + TableViewList.this.setModel(get()); } catch (Exception e) { if (!(e instanceof InterruptedException) && !(e instanceof CancellationException)) { TableViewList.this.setModel(failed); From 39a4c196878f3d7226a1cdeb63fc9a7659084519 Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 14 Apr 2020 18:10:38 +0800 Subject: [PATCH 214/375] =?UTF-8?q?REPORT-29669=20=E5=B1=8F=E8=94=BD?= =?UTF-8?q?=E7=BD=91=E5=9D=80=E7=AE=A1=E7=90=86=E4=B8=AD=E5=BF=83=E5=BC=80?= =?UTF-8?q?=E5=85=B3=E5=9C=A8=E5=85=B3=E9=97=AD=E5=90=8E=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/extra/exe/GetPluginCategoriesExecutor.java | 3 ++- .../design/extra/exe/GetPluginFromStoreExecutor.java | 4 ++-- .../com/fr/design/extra/exe/SearchOnlineExecutor.java | 10 +++++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java b/designer-base/src/main/java/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java index 0a3b76211..1d6e8c483 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java @@ -4,6 +4,7 @@ import com.fr.design.extra.PluginConstants; import com.fr.design.extra.Process; import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; +import com.fr.stable.StringUtils; /** * Created by vito on 16/5/16. @@ -28,7 +29,7 @@ public class GetPluginCategoriesExecutor implements Executor { @Override public void run(Process process) { String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.category"); - if (url != null) { + if (StringUtils.isNotEmpty(url)) { HttpClient httpClient = new HttpClient(url); result = httpClient.getResponseText(); } else { diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java b/designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java index 4a1168734..3bf7b2cb3 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java @@ -52,7 +52,7 @@ public class GetPluginFromStoreExecutor implements Executor { @Override public void run(Process process) { - String plistUrl = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.plist") + "?"; + String plistUrl = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.plist"); boolean getRecommend = StringUtils.isEmpty(category) && StringUtils.isEmpty(seller) && StringUtils.isEmpty(fee) && StringUtils.isEmpty(scope); if (getRecommend) { result = PluginOperateUtils.getRecommendPlugins(); @@ -61,7 +61,7 @@ public class GetPluginFromStoreExecutor implements Executor { if (StringUtils.isNotBlank(plistUrl)) { StringBuilder url = new StringBuilder(); - url.append(plistUrl); + url.append(plistUrl).append("?"); PluginOperateUtils.dealParams(url, category, seller, fee, scope); try { HttpClient httpClient = new HttpClient(url.toString()); diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/SearchOnlineExecutor.java b/designer-base/src/main/java/com/fr/design/extra/exe/SearchOnlineExecutor.java index fdbd8562f..1a84519ee 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/SearchOnlineExecutor.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/SearchOnlineExecutor.java @@ -14,8 +14,8 @@ import com.fr.stable.StringUtils; * Created by vito on 16/4/18. */ public class SearchOnlineExecutor implements Executor { - private String result = StringUtils.EMPTY; - private String keyword; + private String result = JSONArray.create().toString(); + private final String keyword; public SearchOnlineExecutor(String keyword) { this.keyword = keyword; @@ -42,7 +42,11 @@ public class SearchOnlineExecutor implements Executor { result = PluginOperateUtils.getRecommendPlugins(); return; } - HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("shop.plugin.store") + "&keyword=" + keyword); + String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.store"); + if (StringUtils.isEmpty(url)) { + return; + } + HttpClient httpClient = new HttpClient(url + "&keyword=" + keyword); httpClient.asGet(); String responseText = httpClient.getResponseText(); JSONObject jsonObject = new JSONObject(responseText); From 78d85bdeeeb75edf0d77ae057b83536c59db4b04 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 14 Apr 2020 18:23:51 +0800 Subject: [PATCH 215/375] =?UTF-8?q?REPORT-29886=20=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E5=86=99=E6=AD=BB=E6=83=85=E5=86=B5=E6=8E=92=E6=9F=A5=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/formula/JavaEditorPane.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java b/designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java index 9b5a95a43..a34762a1f 100644 --- a/designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java @@ -220,8 +220,8 @@ public class JavaEditorPane extends BasicPane { " }\n" + "\n" + " /**\n" + - " * 获取数据集的列数\n" + - " * @return 数据集的列\n" + + " * Get the number of columns in a dataset\n" + + " * @return Dataset columns\n" + " * @throws TableDataException\n" + " */\n" + " public int getColumnCount() throws TableDataException {\n" + @@ -229,9 +229,9 @@ public class JavaEditorPane extends BasicPane { " }\n" + "\n" + " /**\n" + - " * 获取数据集指定列的列名\n" + - " * @param columnIndex 指定列的索引\n" + - " * @return 指定列的列名\n" + + " * Get the column name of the specified column of the dataset\n" + + " * @param columnIndex The index of the specified column\n" + + " * @return The column name of the specified column\n" + " * @throws TableDataException\n" + " */\n" + " public String getColumnName(int columnIndex) throws TableDataException {\n" + @@ -239,8 +239,8 @@ public class JavaEditorPane extends BasicPane { " }\n" + "\n" + " /**\n" + - " * 获取数据集的行数\n" + - " * @return 数据集数据行数\n" + + " * Get the number of rows in the dataset\n" + + " * @return Dataset rows\n" + " * @throws TableDataException\n" + " */\n" + " public int getRowCount() throws TableDataException {\n" + @@ -248,10 +248,10 @@ public class JavaEditorPane extends BasicPane { " }\n" + "\n" + " /**\n" + - " * 获取数据集指定位置上的值\n" + - " * @param rowIndex 指定的行索引\n" + - " * @param columnIndex 指定的列索引\n" + - " * @return 指定位置的值\n" + + " * Get the value at the specified position in the dataset\n" + + " * @param rowIndex The specified row index\n" + + " * @param columnIndex The specified column index\n" + + " * @return The value of the specified location\n" + " */\n" + " public Object getValueAt(int rowIndex, int columnIndex) {\n" + " return null;\n" + @@ -263,12 +263,12 @@ public class JavaEditorPane extends BasicPane { "import com.fr.script.AbstractFunction;\n" + "\n" + "/**\n" + - " * 自定义函数\n" + + " * Custom function\n" + " */\n" + "public class CustomFun extends AbstractFunction {\n" + " /**\n" + - " * @param args 函数的参数,是经过了算子处理了其中特殊参数的\n" + - " * @return 经过函数处理的值,用于参与最终计算\n" + + " * @param args The parameters of the function are processed by calculator with special parameters\n" + + " * @return The value processed by the function is used to participate in the final calculation\n" + " */\n" + " public Object run(Object[] args) {\n" + " return null;\n" + From 10dd3858cdde8e28497d0926f380212c43dcbaef Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 14 Apr 2020 20:01:39 +0800 Subject: [PATCH 216/375] =?UTF-8?q?KERNEL-3501=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E8=87=AA=E9=80=82=E5=BA=94=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E9=87=8D=E6=9E=84=EF=BC=8C=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E6=8F=90=E4=BE=9B=E5=8D=95=E5=85=83=E6=A0=BC=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E4=BF=AE=E6=94=B9=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/unit/ReportLengthUNIT.java | 21 ++++++++ .../unit/ReportLengthUnitProcessor.java | 14 +++++ .../com/fr/design/unit/UnitConvertUtil.java | 42 +++++++++++++++ .../AbstracReportLengthUnitProcessor.java | 19 +++++++ .../unit/impl/AbstractReportLengthUNIT.java | 22 ++++++++ .../design/unit/impl/CMReportLengthUNIT.java | 32 +++++++++++ .../unit/impl/INCHReportLengthUNIT.java | 31 +++++++++++ .../design/unit/impl/MMReportLengthUNIT.java | 31 +++++++++++ .../design/unit/impl/PTReportLengthUNIT.java | 30 +++++++++++ .../FormWidgetDefinePaneFactoryBase.java | 7 ++- .../columnrow/ColumnRowSizingAction.java | 49 +++++------------ .../java/com/fr/design/condition/WHPane.java | 53 +++++-------------- .../grid/AbstractGridHeaderMouseHandler.java | 26 +++------ 13 files changed, 280 insertions(+), 97 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/unit/ReportLengthUNIT.java create mode 100644 designer-base/src/main/java/com/fr/design/unit/ReportLengthUnitProcessor.java create mode 100644 designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java create mode 100644 designer-base/src/main/java/com/fr/design/unit/impl/AbstracReportLengthUnitProcessor.java create mode 100644 designer-base/src/main/java/com/fr/design/unit/impl/AbstractReportLengthUNIT.java create mode 100644 designer-base/src/main/java/com/fr/design/unit/impl/CMReportLengthUNIT.java create mode 100644 designer-base/src/main/java/com/fr/design/unit/impl/INCHReportLengthUNIT.java create mode 100644 designer-base/src/main/java/com/fr/design/unit/impl/MMReportLengthUNIT.java create mode 100644 designer-base/src/main/java/com/fr/design/unit/impl/PTReportLengthUNIT.java diff --git a/designer-base/src/main/java/com/fr/design/unit/ReportLengthUNIT.java b/designer-base/src/main/java/com/fr/design/unit/ReportLengthUNIT.java new file mode 100644 index 000000000..513232d95 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/unit/ReportLengthUNIT.java @@ -0,0 +1,21 @@ +package com.fr.design.unit; + +import com.fr.stable.fun.mark.Mutable; +import com.fr.stable.unit.UNIT; + +/** + * Created by kerry on 2020-04-09 + */ +public interface ReportLengthUNIT extends Mutable { + String MARK_STRING = "ReportLengthUNIT"; + + int CURRENT_LEVEL = 1; + + String unitText(); + + int unitType(); + + float unit2Value4Scale(UNIT value); + + UNIT float2UNIT(float value); +} diff --git a/designer-base/src/main/java/com/fr/design/unit/ReportLengthUnitProcessor.java b/designer-base/src/main/java/com/fr/design/unit/ReportLengthUnitProcessor.java new file mode 100644 index 000000000..f496d69db --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/unit/ReportLengthUnitProcessor.java @@ -0,0 +1,14 @@ +package com.fr.design.unit; + +import com.fr.stable.fun.mark.Immutable; + +/** + * Created by kerry on 2020-04-09 + */ +public interface ReportLengthUnitProcessor extends Immutable { + String MARK_STRING = "ReportLengthUnitProcessor"; + int CURRENT_LEVEL = 1; + + ReportLengthUNIT getReportLengthUNIT(); + +} diff --git a/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java b/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java new file mode 100644 index 000000000..80d35d83b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java @@ -0,0 +1,42 @@ +package com.fr.design.unit; + +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.unit.impl.CMReportLengthUNIT; +import com.fr.design.unit.impl.INCHReportLengthUNIT; +import com.fr.design.unit.impl.MMReportLengthUNIT; +import com.fr.design.unit.impl.PTReportLengthUNIT; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by kerry on 2020-04-09 + */ +public class UnitConvertUtil { + private static List lengthUNITList = new ArrayList(); + + static { + lengthUNITList.add(new CMReportLengthUNIT()); + lengthUNITList.add(new INCHReportLengthUNIT()); + lengthUNITList.add(new PTReportLengthUNIT()); + lengthUNITList.add(new MMReportLengthUNIT()); + } + + private UnitConvertUtil() { + + } + + + public static ReportLengthUNIT parseLengthUNIT(int unitType) { + ReportLengthUnitProcessor lengthUnitProcessor = ExtraDesignClassManager.getInstance().getSingle(ReportLengthUnitProcessor.MARK_STRING); + if (lengthUnitProcessor != null) { + return lengthUnitProcessor.getReportLengthUNIT(); + } + for (ReportLengthUNIT lengthUNIT : lengthUNITList) { + if (unitType == lengthUNIT.unitType()) { + return lengthUNIT; + } + } + return new MMReportLengthUNIT(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/unit/impl/AbstracReportLengthUnitProcessor.java b/designer-base/src/main/java/com/fr/design/unit/impl/AbstracReportLengthUnitProcessor.java new file mode 100644 index 000000000..64242b3b3 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/unit/impl/AbstracReportLengthUnitProcessor.java @@ -0,0 +1,19 @@ +package com.fr.design.unit.impl; + +import com.fr.design.unit.ReportLengthUnitProcessor; + +/** + * Created by kerry on 2020-04-09 + */ +public abstract class AbstracReportLengthUnitProcessor implements ReportLengthUnitProcessor { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } +} diff --git a/designer-base/src/main/java/com/fr/design/unit/impl/AbstractReportLengthUNIT.java b/designer-base/src/main/java/com/fr/design/unit/impl/AbstractReportLengthUNIT.java new file mode 100644 index 000000000..d1947b8f4 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/unit/impl/AbstractReportLengthUNIT.java @@ -0,0 +1,22 @@ +package com.fr.design.unit.impl; + + +import com.fr.design.unit.ReportLengthUNIT; + +/** + * Created by kerry on 2020-04-09 + */ +public abstract class AbstractReportLengthUNIT implements ReportLengthUNIT { + + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/unit/impl/CMReportLengthUNIT.java b/designer-base/src/main/java/com/fr/design/unit/impl/CMReportLengthUNIT.java new file mode 100644 index 000000000..e3b550d01 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/unit/impl/CMReportLengthUNIT.java @@ -0,0 +1,32 @@ +package com.fr.design.unit.impl; + +import com.fr.design.unit.impl.AbstractReportLengthUNIT; +import com.fr.stable.Constants; +import com.fr.stable.unit.CM; +import com.fr.stable.unit.UNIT; + +/** + * Created by kerry on 2020-04-09 + */ +public class CMReportLengthUNIT extends AbstractReportLengthUNIT { + @Override + public String unitText() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_CM"); + } + + @Override + public int unitType() { + return Constants.UNIT_CM; + } + + @Override + public float unit2Value4Scale(UNIT value) { + return value.toCMValue4Scale2(); + } + + @Override + public UNIT float2UNIT(float value) { + return new CM(value); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/unit/impl/INCHReportLengthUNIT.java b/designer-base/src/main/java/com/fr/design/unit/impl/INCHReportLengthUNIT.java new file mode 100644 index 000000000..c919e14e1 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/unit/impl/INCHReportLengthUNIT.java @@ -0,0 +1,31 @@ +package com.fr.design.unit.impl; + +import com.fr.design.unit.impl.AbstractReportLengthUNIT; +import com.fr.stable.Constants; +import com.fr.stable.unit.INCH; +import com.fr.stable.unit.UNIT; + +/** + * Created by kerry on 2020-04-09 + */ +public class INCHReportLengthUNIT extends AbstractReportLengthUNIT { + @Override + public String unitText() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_INCH"); + } + + @Override + public int unitType() { + return Constants.UNIT_INCH; + } + + @Override + public float unit2Value4Scale(UNIT value) { + return value.toINCHValue4Scale3(); + } + + @Override + public UNIT float2UNIT(float value) { + return new INCH(value); + } +} diff --git a/designer-base/src/main/java/com/fr/design/unit/impl/MMReportLengthUNIT.java b/designer-base/src/main/java/com/fr/design/unit/impl/MMReportLengthUNIT.java new file mode 100644 index 000000000..e6f3523ec --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/unit/impl/MMReportLengthUNIT.java @@ -0,0 +1,31 @@ +package com.fr.design.unit.impl; + +import com.fr.design.unit.impl.AbstractReportLengthUNIT; +import com.fr.stable.Constants; +import com.fr.stable.unit.MM; +import com.fr.stable.unit.UNIT; + +/** + * Created by kerry on 2020-04-09 + */ +public class MMReportLengthUNIT extends AbstractReportLengthUNIT { + @Override + public String unitText() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM"); + } + + @Override + public int unitType() { + return Constants.UNIT_MM; + } + + @Override + public float unit2Value4Scale(UNIT value) { + return value.toMMValue4Scale2(); + } + + @Override + public UNIT float2UNIT(float value) { + return new MM(value); + } +} diff --git a/designer-base/src/main/java/com/fr/design/unit/impl/PTReportLengthUNIT.java b/designer-base/src/main/java/com/fr/design/unit/impl/PTReportLengthUNIT.java new file mode 100644 index 000000000..1ab5bbedf --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/unit/impl/PTReportLengthUNIT.java @@ -0,0 +1,30 @@ +package com.fr.design.unit.impl; + +import com.fr.stable.Constants; +import com.fr.stable.unit.PT; +import com.fr.stable.unit.UNIT; + +/** + * Created by kerry on 2020-04-09 + */ +public class PTReportLengthUNIT extends AbstractReportLengthUNIT { + @Override + public String unitText() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_PT_Duplicate"); + } + + @Override + public int unitType() { + return Constants.UNIT_PT; + } + + @Override + public float unit2Value4Scale(UNIT value) { + return value.toPTValue4Scale2(); + } + + @Override + public UNIT float2UNIT(float value) { + return new PT(value); + } +} diff --git a/designer-form/src/main/java/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java b/designer-form/src/main/java/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java index 9df0a3201..1947e9ec4 100644 --- a/designer-form/src/main/java/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java +++ b/designer-form/src/main/java/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java @@ -127,6 +127,11 @@ public class FormWidgetDefinePaneFactoryBase { } + + public static void registerDefinePane(Class widget, Appearance appearance) { + defineMap.put(widget, appearance); + } + public static RN createWidgetDefinePane(XCreator creator, FormDesigner designer, Widget widget, Operator operator) { if (isExtraXWidget(widget)) { WidgetDefinePane widgetDefinePane = new WidgetDefinePane(creator, designer); @@ -165,4 +170,4 @@ public class FormWidgetDefinePaneFactoryBase { } } -} \ No newline at end of file +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java b/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java index c9cc9e1b5..b14d1945b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java @@ -10,14 +10,11 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.unit.ReportLengthUNIT; +import com.fr.design.unit.UnitConvertUtil; import com.fr.grid.selection.CellSelection; import com.fr.report.elementcase.ElementCase; import com.fr.stable.ArrayUtils; -import com.fr.stable.Constants; -import com.fr.stable.unit.CM; -import com.fr.stable.unit.INCH; -import com.fr.stable.unit.MM; -import com.fr.stable.unit.PT; import com.fr.stable.unit.UNIT; /** @@ -28,7 +25,7 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction protected ColumnRowSizingAction(ElementCasePane t, int indexOfColumnOrRow) { super(t, indexOfColumnOrRow); } - + @Override protected boolean executeActionReturnUndoRecordNeededWithCellSelection( CellSelection cs) { @@ -43,7 +40,7 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction }; UNIT len = getShowLen(report, cs); populateNumberDialog(uPane, len); - + final CellSelection finalCS = cs; uPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @@ -52,21 +49,13 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction try { float newHeight = (float) uPane.update(); int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit(); - UNIT len; - if (unitType == Constants.UNIT_CM) { - len = new CM(newHeight); - } else if (unitType == Constants.UNIT_INCH) { - len = new INCH(newHeight); - } else if (unitType == Constants.UNIT_PT) { - len = new PT(newHeight); - } else { - len = new MM(newHeight); - } + ReportLengthUNIT lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType); + UNIT len = lengthUNIT.float2UNIT(newHeight); updateAction(report, len, finalCS); } catch (ValueNotChangeException e) { // nothing } - + ePane.fireTargetModified(); } }).setVisible(true); @@ -75,28 +64,16 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction protected void populateNumberDialog(final UnitInputPane uPane, UNIT unit) { int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit(); - float va; - if (unitType == Constants.UNIT_CM) { - va = unit.toCMValue4Scale2(); - uPane.setUnitText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_CM")); - } else if (unitType == Constants.UNIT_INCH) { - va = unit.toINCHValue4Scale3(); - uPane.setUnitText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_INCH")); - } else if (unitType == Constants.UNIT_PT) { - va = unit.toPTValue4Scale2(); - uPane.setUnitText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_PT")); - } else { - va = unit.toMMValue4Scale2(); - uPane.setUnitText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM")); - } - + ReportLengthUNIT lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType); + float va = lengthUNIT.unit2Value4Scale(unit); + uPane.setUnitText(lengthUNIT.unitText()); uPane.populate(va); } - + protected abstract String title4UnitInputPane(); - + protected abstract void updateAction(ElementCase report, UNIT len, CellSelection cs); - + protected abstract UNIT getShowLen(ElementCase report, CellSelection cs); protected abstract UNIT getIndexLen(int index, ElementCase report); diff --git a/designer-realize/src/main/java/com/fr/design/condition/WHPane.java b/designer-realize/src/main/java/com/fr/design/condition/WHPane.java index dce2d466a..ed8eea854 100644 --- a/designer-realize/src/main/java/com/fr/design/condition/WHPane.java +++ b/designer-realize/src/main/java/com/fr/design/condition/WHPane.java @@ -3,17 +3,16 @@ package com.fr.design.condition; import com.fr.design.DesignerEnvManager; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UIBasicSpinner; +import com.fr.design.unit.ReportLengthUNIT; +import com.fr.design.unit.UnitConvertUtil; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.report.cell.cellattr.highlight.HighlightAction; -import com.fr.stable.Constants; -import com.fr.stable.unit.*; +import com.fr.stable.unit.UNIT; -import javax.swing.*; -import java.awt.event.FocusAdapter; -import java.awt.event.FocusEvent; +import javax.swing.JSpinner; +import javax.swing.SpinnerNumberModel; import java.math.BigDecimal; -import java.text.ParseException; /** * @author richie @@ -45,23 +44,12 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane Date: Wed, 15 Apr 2020 09:06:29 +0800 Subject: [PATCH 217/375] =?UTF-8?q?CHART-13481=20=E5=A4=A7=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=9A=84=E9=AB=98=E4=BA=AE?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/designer/style/VanChartLegendPane.java | 1 + .../chart/designer/style/VanChartPlotLegendPane.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartLegendPane.java index facef9208..8fb3aed22 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartLegendPane.java @@ -68,6 +68,7 @@ public class VanChartLegendPane extends AbstractVanChartScrollPane { if (plot == null) { return; } + legendContent.setPlot(plot); VanChartLegend legend = (VanChartLegend) plot.getLegend(); if (legendContent != null) { legendContent.populateBean(legend); 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 5a9d8ebda..4ab88f616 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 @@ -2,14 +2,15 @@ package com.fr.van.chart.designer.style; import com.fr.base.BaseUtils; import com.fr.base.Style; +import com.fr.chart.chartattr.Plot; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.UIBubbleFloatPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.i18n.Toolkit; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; @@ -18,6 +19,7 @@ import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.attr.VanChartLegend; import com.fr.plugin.chart.type.LayoutType; import com.fr.stable.Constants; +import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartFloatPositionPane; import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; @@ -46,6 +48,8 @@ public class VanChartPlotLegendPane extends BasicPane { private static final int HEIGHT = 100; private static final int GAP = 20; + private Plot plot; + private UICheckBox isLegendVisible; private JPanel legendPane; @@ -80,6 +84,10 @@ public class VanChartPlotLegendPane extends BasicPane { initComponents(); } + public void setPlot(Plot plot) { + this.plot = plot; + } + public JPanel getHighlightPane() { return highlightPane; } @@ -421,6 +429,7 @@ public class VanChartPlotLegendPane extends BasicPane { //limitPane.populateBean(legend.getLimitAttribute()); if(highlightButton != null){ highlightButton.setSelectedItem(legend.isHighlight()); + highlightButton.setEnabled(!PlotFactory.largeDataModel(plot)); } } From 5290d345e872791fbc1c2d0224c172da24d1599b Mon Sep 17 00:00:00 2001 From: Harrison Date: Wed, 15 Apr 2020 09:18:07 +0800 Subject: [PATCH 218/375] =?UTF-8?q?REPORT-29722=E3=80=90=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=8D=E7=94=A8=E6=8F=92=E4=BB=B6=E3=80=91@harrison,?= =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=9A=84=E5=B0=8F=E7=BA=A2=E7=82=B9=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E8=A3=85=E6=8F=92=E4=BB=B6=E4=B9=9F=E6=9C=89=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=A4=84=E7=90=86=20=E5=8C=85=E6=8B=AC?= =?UTF-8?q?=E6=8F=92=E5=85=A5=E4=B9=9F=E8=A6=81=E5=A4=84=E7=90=86=E4=B8=80?= =?UTF-8?q?=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/menu/MenuDef.java | 6 ++- .../com/fr/design/menu/SnapChatMenuDef.java | 41 ++++++++++++------- .../fr/design/menu/SnapChatMenuDefTest.java | 30 ++++++++++++++ 3 files changed, 62 insertions(+), 15 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/menu/MenuDef.java b/designer-base/src/main/java/com/fr/design/menu/MenuDef.java index f495e03f1..10f994494 100644 --- a/designer-base/src/main/java/com/fr/design/menu/MenuDef.java +++ b/designer-base/src/main/java/com/fr/design/menu/MenuDef.java @@ -138,9 +138,13 @@ public class MenuDef extends ShortCut { */ public void addShortCut(ShortCut... shortcut) { for (ShortCut i : shortcut) { - this.shortcutList.add(i); + addShortCut(i); } } + + public void addShortCut(ShortCut shortCut) { + this.shortcutList.add(shortCut); + } public void removeShortCut(ShortCut shortCut) { diff --git a/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java b/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java index defbf0dbb..2ec3f6c7e 100644 --- a/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java +++ b/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java @@ -61,23 +61,20 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat { } @Override - public void addShortCut(ShortCut... shortCuts) { + public void addShortCut(ShortCut shortCut) { - if (shortCuts == null) { - return; - } - for (ShortCut shortCut : shortCuts) { - if (shortCut instanceof SnapChatUpdateAction) { - SnapChatUpdateAction action = (SnapChatUpdateAction) shortCut; - if (!action.hasRead()) { - String calcKey = calcKey(); - SnapChatConfig.getInstance().resetRead(calcKey); - } - } - } - super.addShortCut(shortCuts); + addSnapChatNotification(shortCut); + super.addShortCut(shortCut); } + @Override + public void insertShortCut(int index, ShortCut shortCut) { + + addSnapChatNotification(shortCut); + super.insertShortCut(index, shortCut); + } + + @Override public SnapChatKey key() { @@ -90,6 +87,22 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat { return new SnapChatMenuListener(); } + /** + * 添加提醒 + * + * @param shortCut 快捷方式 + */ + private void addSnapChatNotification(ShortCut shortCut) { + + if (shortCut instanceof SnapChatUpdateAction) { + SnapChatUpdateAction action = (SnapChatUpdateAction) shortCut; + if (!action.hasRead()) { + String calcKey = calcKey(); + SnapChatConfig.getInstance().resetRead(calcKey); + } + } + } + private String calcKey() { return key().calc(); diff --git a/designer-base/src/test/java/com/fr/design/menu/SnapChatMenuDefTest.java b/designer-base/src/test/java/com/fr/design/menu/SnapChatMenuDefTest.java index 25671596c..298f51a4c 100644 --- a/designer-base/src/test/java/com/fr/design/menu/SnapChatMenuDefTest.java +++ b/designer-base/src/test/java/com/fr/design/menu/SnapChatMenuDefTest.java @@ -73,4 +73,34 @@ public class SnapChatMenuDefTest { menuDef.addShortCut(action); Assert.assertFalse(menuDef.hasRead()); } + + @Test + public void testInsertShortCut() throws Exception { + + PowerMock.suppress(MemberMatcher.constructor(UpdateAction.class)); + SnapChatConfig snapChatConfig = EasyMock.partialMockBuilder(SnapChatConfig.class) + .addMockedMethod("readXML") + .createMock(); + Whitebox.setInternalState(snapChatConfig, "markReadMap", new HashMap()); + snapChatConfig.readXML(EasyMock.anyObject(XMLableReader.class)); + EasyMock.expectLastCall().anyTimes(); + EasyMock.replay(snapChatConfig); + + PowerMock.mockStatic(SnapChatConfig.class); + EasyMock.expect(SnapChatConfig.getInstance()).andReturn(snapChatConfig).anyTimes(); + PowerMock.replayAll(); + + SnapChatMenuDef menuDef = new SnapChatMenuDef("test", SnapChatAllTypes.Menu.BBS); + ShortCut action = new SnapChatUpdateAction(SnapChatAllTypes.Menu.BBS) { + @Override + protected void actionPerformed0(ActionEvent e) { + + } + }; + + Assert.assertTrue(menuDef.hasRead()); + + menuDef.insertShortCut(0, action); + Assert.assertFalse(menuDef.hasRead()); + } } \ No newline at end of file From 14a6040285cf6d9e0b9193b17956155b77cd72eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 15 Apr 2020 09:56:54 +0800 Subject: [PATCH 219/375] =?UTF-8?q?CHART-13460=20=E6=89=93=E5=8C=85?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/chart/ChartDesignerActivator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java index f47f42134..8ad2e6198 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java @@ -1,7 +1,6 @@ package com.fr.design.chart; import com.fr.chart.chartattr.ChartCollection; -import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.gui.ChartComponent; @@ -16,6 +15,7 @@ import com.fr.locale.LocaleMarker; import com.fr.locale.LocaleScope; import com.fr.module.Activator; import com.fr.module.extension.Prepare; +import com.fr.plugin.chart.vanchart.export.ImagePainter; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.van.chart.DownloadOnlineSourcesHelper; @@ -49,7 +49,7 @@ public class ChartDesignerActivator extends Activator implements Prepare { DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption()); - GEOJSONHelper.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); + ImagePainter.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); ChartTypeInterfaceManager.addPluginChangedListener(); } From 8499541ae917e94c20fe342e1c91e24b1cdfec41 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 15 Apr 2020 10:42:02 +0800 Subject: [PATCH 220/375] MOBILE-26530 && MOBILE-26197 --- .../fr/design/designer/creator/XWAbsoluteLayout.java | 12 ++++++++++++ .../ui/designer/mobile/MobileAdvanceDefinePane.java | 12 +++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 56fcf6486..22d702dfd 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -13,8 +13,11 @@ import com.fr.design.designer.beans.adapters.layout.FRAbsoluteLayoutAdapter; import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; +import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI; import com.fr.design.form.layout.FRAbsoluteLayout; +import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.form.util.XCreatorConstants; +import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.icon.IconPathConstants; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.EditingMouseListener; @@ -590,4 +593,13 @@ public class XWAbsoluteLayout extends XLayoutContainer { public boolean isSupportShared() { return true; } + + @Override + public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { + if (FormDesignerUtils.isAppRelayout(WidgetPropertyPane.getInstance().getEditingFormDesigner())) { + return new WidgetPropertyUIProvider[] {new MobileBooKMarkUsePropertyUI(this)}; + } else { + return super.getWidgetPropertyUIProviders(); + } + } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java index 587ea5395..34f6a7adf 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java @@ -20,6 +20,7 @@ import com.fr.form.ui.Widget; import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WSortLayout; import com.fr.form.ui.mobile.MobileBookMark; +import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.general.ComparatorUtils; import com.fr.general.IOUtils; import com.fr.stable.StringUtils; @@ -33,6 +34,7 @@ import java.awt.event.FocusEvent; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.util.Iterator; +import java.util.List; /** * @author hades @@ -180,12 +182,16 @@ public class MobileAdvanceDefinePane extends MobileWidgetDefinePane { Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget(); WLayout container = form.getContainer(); WSortLayout wSortLayout = (WSortLayout) container.getWidget(container.getWidgetCount() - 1); - Iterator iterator = wSortLayout.getMobileWidgetIterator(); - while (iterator.hasNext()) { - Widget widget = form.getWidgetByName(iterator.next()); + List list = wSortLayout.getOrderedMobileWidgetList(); + for (String value : list) { + Widget widget = form.getWidgetByName(value); if (widget != null && ComparatorUtils.equals(widget.getMobileBookMark().getBookMarkName(), name)) { return true; } + CRBoundsWidget boundsWidget = (CRBoundsWidget) wSortLayout.getWidget(value); + if (boundsWidget != null && ComparatorUtils.equals(boundsWidget.getWidget().getMobileBookMark().getBookMarkName(), name)) { + return true; + } } return false; } From f16a9205372dccacca259671f45f909b18c9c0c8 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 15 Apr 2020 11:45:12 +0800 Subject: [PATCH 221/375] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractFormAdaptiveConfigUI.java | 18 +++++++++++++ .../fit/menupane/FormAdaptiveConfigUI.java | 26 +++++++++++++++++++ .../fit/menupane/ReportFitAttrAction.java | 15 +++++++++-- .../unit/ReportLengthUnitProcessor.java | 2 +- .../com/fr/design/unit/UnitConvertUtil.java | 2 +- .../form/FormElementCaseDesigner.java | 8 +++++- 6 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/report/fit/menupane/AbstractFormAdaptiveConfigUI.java create mode 100644 designer-base/src/main/java/com/fr/design/report/fit/menupane/FormAdaptiveConfigUI.java diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/AbstractFormAdaptiveConfigUI.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/AbstractFormAdaptiveConfigUI.java new file mode 100644 index 000000000..bf0822104 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/AbstractFormAdaptiveConfigUI.java @@ -0,0 +1,18 @@ +package com.fr.design.report.fit.menupane; + + +/** + * Created by kerry on 2020-04-09 + */ +public abstract class AbstractFormAdaptiveConfigUI implements FormAdaptiveConfigUI { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } +} diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/FormAdaptiveConfigUI.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/FormAdaptiveConfigUI.java new file mode 100644 index 000000000..cd88ec4ec --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/FormAdaptiveConfigUI.java @@ -0,0 +1,26 @@ +package com.fr.design.report.fit.menupane; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.stable.fun.mark.Immutable; + +import javax.swing.JComponent; +import java.awt.Dimension; +import java.awt.image.BufferedImage; + + +/** + * Created by kerry on 2020-04-09 + */ +public interface FormAdaptiveConfigUI extends Immutable { + + String MARK_STRING = "FormAdaptiveConfigUI"; + int CURRENT_LEVEL = 1; + + + BasicBeanPane getConfigPane(); + + BufferedImage getElementCaseImage(Dimension size, JComponent elementCasePane); + + +} + diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java index 29a8a7deb..ebffc9809 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java @@ -1,5 +1,6 @@ package com.fr.design.report.fit.menupane; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.JTemplateAction; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.DialogActionAdapter; @@ -42,6 +43,10 @@ public class ReportFitAttrAction extends JTemplateAction { @Override public String getMenuName() { + FormAdaptiveConfigUI configPane = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUI.MARK_STRING); + if (configPane != null) { + return configPane.getConfigPane().getTitle(); + } return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Elementcase"); } @@ -85,7 +90,13 @@ public class ReportFitAttrAction extends JTemplateAction { final TemplateFitAttrPane attrPane = new TemplateFitAttrPane(); showReportFitDialog(fitAttr, jwb, wbTpl, attrPane); } else { - final ReportFitAttrPane attrPane = new ReportFitAttrPane(); + BasicBeanPane attrPane = null; + FormAdaptiveConfigUI configPane = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUI.MARK_STRING); + if (configPane != null) { + attrPane = configPane.getConfigPane(); + }else{ + attrPane = new ReportFitAttrPane(); + } showReportFitDialog(fitAttr, jwb, wbTpl, attrPane); } } @@ -102,4 +113,4 @@ public class ReportFitAttrAction extends JTemplateAction { dialog.setVisible(true); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/unit/ReportLengthUnitProcessor.java b/designer-base/src/main/java/com/fr/design/unit/ReportLengthUnitProcessor.java index f496d69db..4adffd28c 100644 --- a/designer-base/src/main/java/com/fr/design/unit/ReportLengthUnitProcessor.java +++ b/designer-base/src/main/java/com/fr/design/unit/ReportLengthUnitProcessor.java @@ -9,6 +9,6 @@ public interface ReportLengthUnitProcessor extends Immutable { String MARK_STRING = "ReportLengthUnitProcessor"; int CURRENT_LEVEL = 1; - ReportLengthUNIT getReportLengthUNIT(); + ReportLengthUNIT getReportLengthUNIT(int unitType); } diff --git a/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java b/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java index 80d35d83b..fee1cccd7 100644 --- a/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java +++ b/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java @@ -30,7 +30,7 @@ public class UnitConvertUtil { public static ReportLengthUNIT parseLengthUNIT(int unitType) { ReportLengthUnitProcessor lengthUnitProcessor = ExtraDesignClassManager.getInstance().getSingle(ReportLengthUnitProcessor.MARK_STRING); if (lengthUnitProcessor != null) { - return lengthUnitProcessor.getReportLengthUNIT(); + return lengthUnitProcessor.getReportLengthUNIT(unitType); } for (ReportLengthUNIT lengthUNIT : lengthUNITList) { if (unitType == lengthUNIT.unitType()) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java index 07954c796..ae4221dce 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java @@ -5,6 +5,7 @@ package com.fr.design.mainframe.form; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignState; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.AllowAuthorityEditAction; import com.fr.design.actions.ExitAuthorityEditAction; import com.fr.design.base.mode.DesignModeContext; @@ -25,6 +26,7 @@ import com.fr.design.menu.NameSeparator; import com.fr.design.menu.ShortCut; import com.fr.design.menu.ToolBarDef; import com.fr.design.present.ConditionAttributesGroupPane; +import com.fr.design.report.fit.menupane.FormAdaptiveConfigUI; import com.fr.design.selection.SelectableElement; import com.fr.design.selection.Selectedable; import com.fr.design.selection.SelectionListener; @@ -123,6 +125,10 @@ public class FormElementCaseDesigner */ @Override public BufferedImage getElementCaseImage(Dimension size) { + FormAdaptiveConfigUI adaptiveConfigUI = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUI.MARK_STRING); + if (adaptiveConfigUI != null) { + return adaptiveConfigUI.getElementCaseImage(size, this.elementCasePane); + } BufferedImage image = null; try { image = new java.awt.image.BufferedImage(size.width, size.height, @@ -351,4 +357,4 @@ public class FormElementCaseDesigner public FormElementCaseProvider getEditingElementCase() { return this.getEditingElementCasePane().getTarget(); } -} \ No newline at end of file +} From 97a5d34dd1497ef87fb586b95e879074d16f91c3 Mon Sep 17 00:00:00 2001 From: zack Date: Wed, 15 Apr 2020 16:17:44 +0800 Subject: [PATCH 222/375] =?UTF-8?q?REPORT-29773=20=E5=A4=96=E5=8C=85?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=EF=BC=9A=E9=99=84=E4=BB=B6=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E4=B8=8B=E6=8B=89=E6=A0=91?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E7=AC=AC3=E5=B1=82=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=BA=86=E5=88=97=E5=BA=8F=E5=8F=B7=EF=BC=8C=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=97=A0=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tree/layer/config/LayerDataConfigPane.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataConfigPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataConfigPane.java index c67dd08d9..8925bfdbd 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataConfigPane.java @@ -7,6 +7,7 @@ import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.present.dict.TableDataDictPane; import com.fr.form.ui.tree.LayerConfig; import com.fr.form.ui.tree.LayerDependence; +import com.fr.stable.StringUtils; import java.awt.*; import java.util.*; @@ -73,13 +74,20 @@ public class LayerDataConfigPane extends BasicBeanPane { if (wrapper != null) { columnNames = wrapper.calculateColumnNameList(); } else { - columnNames = new ArrayList(); + columnNames = new ArrayList<>(); } - String viewColStr = tableDataDictPane.updateBean().getValueColumnName(); - String modelColStr = tableDataDictPane.updateBean().getKeyColumnName(); - TableDataDictionary dictionary = tableDataDictPane.updateBean(); + TableDataDictionary dataDictionary = tableDataDictPane.updateBean(); + String viewColStr = dataDictionary.getValueColumnName(); + String modelColStr = dataDictionary.getKeyColumnName(); int viewCol = columnNames.indexOf(viewColStr); int modelCol = columnNames.indexOf(modelColStr); + if (StringUtils.EMPTY.equals(viewColStr)) { + viewCol = dataDictionary.getValueColumnIndex(); + } + if (StringUtils.EMPTY.equals(modelColStr)) { + modelCol = dataDictionary.getKeyColumnIndex(); + } + TableDataDictionary dictionary = tableDataDictPane.updateBean(); //将数据设置到当前正在修改的layerData中 this.layerConfig.setDictionary(dictionary); this.layerConfig.setModelColumn(modelCol); From 72308f9db4c7c2932deeb17c4c85c62d239066c3 Mon Sep 17 00:00:00 2001 From: zack Date: Wed, 15 Apr 2020 16:19:42 +0800 Subject: [PATCH 223/375] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frpane/tree/layer/config/LayerDataConfigPane.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataConfigPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataConfigPane.java index 8925bfdbd..3ba2e025f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataConfigPane.java @@ -76,18 +76,17 @@ public class LayerDataConfigPane extends BasicBeanPane { } else { columnNames = new ArrayList<>(); } - TableDataDictionary dataDictionary = tableDataDictPane.updateBean(); - String viewColStr = dataDictionary.getValueColumnName(); - String modelColStr = dataDictionary.getKeyColumnName(); + TableDataDictionary dictionary = tableDataDictPane.updateBean(); + String viewColStr = dictionary.getValueColumnName(); + String modelColStr = dictionary.getKeyColumnName(); int viewCol = columnNames.indexOf(viewColStr); int modelCol = columnNames.indexOf(modelColStr); if (StringUtils.EMPTY.equals(viewColStr)) { - viewCol = dataDictionary.getValueColumnIndex(); + viewCol = dictionary.getValueColumnIndex(); } if (StringUtils.EMPTY.equals(modelColStr)) { - modelCol = dataDictionary.getKeyColumnIndex(); + modelCol = dictionary.getKeyColumnIndex(); } - TableDataDictionary dictionary = tableDataDictPane.updateBean(); //将数据设置到当前正在修改的layerData中 this.layerConfig.setDictionary(dictionary); this.layerConfig.setModelColumn(modelCol); From 98ed342ae5b55a2cc74d6416470cf338b7902796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 15 Apr 2020 17:03:03 +0800 Subject: [PATCH 224/375] =?UTF-8?q?CHART-13491=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=9B=BE=E8=A1=A8=E5=B1=9E=E6=80=A7=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=8F=98=E5=8C=96=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/chart/ChartEditPane.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java index 83e194c71..3dc90d3a3 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java @@ -22,6 +22,7 @@ import com.fr.design.mainframe.chart.gui.ChartTypePane; import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.vanchart.VanChart; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; @@ -113,7 +114,11 @@ public class ChartEditPane extends BasicPane implements AttributeChange, Prepare selectedPane.update(collection); if (!ComparatorUtils.equals(collection, lastCollection)) { - + VanChart vanChart = collection.getSelectedChartProvider(VanChart.class); + if (vanChart != null) { + //此处画图 + vanChart.attrChange(); + } try { ChartInfoCollector.getInstance().checkTestChart(collection.getSelectedChartProvider(ChartProvider.class)); lastCollection = collection.clone(); From 6df360e0f55fd1f2786f1130293e93462a8e78bc Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 15 Apr 2020 17:28:13 +0800 Subject: [PATCH 225/375] REPORT-29704 && REPORT-29960 && REPORT-29958 && REPORT-29752 --- .../mainframe/loghandler/LogMessageBar.java | 5 ++- .../com/fr/design/utils/DesignerPort.java | 9 ++++- .../mainframe/SheetAuthorityEditPane.java | 12 +++++-- .../com/fr/start/DesignerJavaRuntime.java | 36 +++++++++++++++++-- 4 files changed, 55 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java index 54bb4addc..8b3cedeef 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java @@ -12,6 +12,9 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; public class LogMessageBar extends JPanel { + + private static final String LOG_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log"); + private UILabel messageLabel; private int width = 600; private static volatile LogMessageBar THIS; @@ -56,7 +59,7 @@ public class LogMessageBar extends JPanel { if (message == null) { return; } - messageLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log") + " | " + message); + messageLabel.setText(LOG_MARK + " | " + message); repaint(); } diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignerPort.java b/designer-base/src/main/java/com/fr/design/utils/DesignerPort.java index 55dc1f00d..254cc5e91 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignerPort.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignerPort.java @@ -1,5 +1,6 @@ package com.fr.design.utils; +import com.fr.common.report.ReportState; import com.fr.design.DesignerEnvManager; import com.fr.design.RestartHelper; import com.fr.design.dialog.TipDialog; @@ -12,6 +13,9 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.exit.DesignerExiter; import com.fr.general.ComparatorUtils; import com.fr.general.IOUtils; +import com.fr.process.ProcessEventPipe; +import com.fr.process.engine.core.CarryMessageEvent; +import com.fr.process.engine.core.FineProcessContext; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLReadable; @@ -86,7 +90,10 @@ public class DesignerPort implements XMLReadable, XMLWriter { } public void resetPort() { - + ProcessEventPipe eventPipe = FineProcessContext.getParentPipe(); + if (eventPipe != null) { + eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue())); + } TipDialog dialog = new TipDialog(null, StringUtils.EMPTY, Toolkit.i18nText("Fine-Design_Port_Found_Port_Conflict"), diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/SheetAuthorityEditPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/SheetAuthorityEditPane.java index f559c828f..baa19fd71 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/SheetAuthorityEditPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/SheetAuthorityEditPane.java @@ -8,6 +8,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; +import com.fr.design.ui.util.UIUtil; import com.fr.general.ComparatorUtils; import com.fr.main.impl.WorkBook; @@ -119,9 +120,14 @@ public class SheetAuthorityEditPane extends AuthorityEditPane { if (StringUtils.isEmpty(name.getText())){ return; } - checkPane.add(populateCheckPane(), BorderLayout.CENTER); - checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); - checkVisibleCheckBoxes(); + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + checkPane.add(populateCheckPane(), BorderLayout.CENTER); + checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); + checkVisibleCheckBoxes(); + } + }); } /** diff --git a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java index 5f4f62210..553a84212 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java @@ -2,15 +2,25 @@ package com.fr.start; import com.fr.design.os.impl.SupportOSImpl; import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralContext; +import com.fr.general.GeneralUtils; import com.fr.general.IOUtils; +import com.fr.locale.InterProviderFactory; +import com.fr.log.FineLoggerFactory; import com.fr.process.engine.core.AbstractJavaRuntime; import com.fr.stable.ArrayUtils; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.os.OperatingSystem; +import java.io.BufferedReader; import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; /** @@ -32,11 +42,14 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { private static final String LOGO_PATH = StableUtils.pathJoin(BIN_HOME, "logo.png"); private static final String DOCK_OPTIONS = "-Xdock:icon=" + LOGO_PATH; private static final String DOCK_NAME_OPTIONS = "-Xdock:name=" + FineDesigner.class.getSimpleName(); + private static final String WIN_VM_OPTIONS_PATH = StableUtils.pathJoin(BIN_HOME, "designer.vmoptions"); private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m"}; static { try { - IOUtils.copy(DesignerJavaRuntime.class.getResourceAsStream("/com/fr/design/icon/logo.png"), "logo.png", new File(BIN_HOME)); + if (SupportOSImpl.DOCK_ICON.support()) { + IOUtils.copy(DesignerJavaRuntime.class.getResourceAsStream("/com/fr/design/icon/logo.png"), "logo.png", new File(BIN_HOME)); + } } catch (IOException ignore) { } } @@ -82,7 +95,7 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { } private boolean isInstallVersion() { - return !ComparatorUtils.equals(StableUtils.getInstallHome(), DOT); + return !ComparatorUtils.equals(GeneralUtils.readFullBuildNO(), InterProviderFactory.getProvider().getLocText("Fine-Core_Basic_About_No_Build")); } @@ -96,9 +109,28 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { public String[] getJvmOptions() { if (isInstallVersion()) { String[] options = super.getJvmOptions(); + // win下环境变量 存在错误的设置会导致问题 直接读vmoptions + if (SupportOSImpl.VM_OPTIONS_ADAPTER.support()) { + long start = System.currentTimeMillis(); + List optionList = new ArrayList<>(); + try (BufferedReader reader = new BufferedReader(new FileReader(new File(WIN_VM_OPTIONS_PATH)))) { + String option = null; + while ((option = reader.readLine()) != null) { + optionList.add(option.trim()); + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return DEBUG_OPTIONS; + } + FineLoggerFactory.getLogger().error("time: " + (System.currentTimeMillis() - start)); + if (!optionList.isEmpty()) { + return optionList.toArray(new String[0]); + } + } if (SupportOSImpl.DOCK_ICON.support()) { options = ArrayUtils.addAll(options, DOCK_OPTIONS, DOCK_NAME_OPTIONS); } + FineLoggerFactory.getLogger().debug("Vm Options: " + Arrays.toString(options)); return options; } else { return DEBUG_OPTIONS; From 7f89921f60607912bf6cd50c65bd77db5b40fe8b Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 15 Apr 2020 17:30:09 +0800 Subject: [PATCH 226/375] =?UTF-8?q?fix=20=E5=8E=BB=E6=8E=89=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/DesignerJavaRuntime.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java index 553a84212..b99f648ae 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java @@ -111,7 +111,6 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { String[] options = super.getJvmOptions(); // win下环境变量 存在错误的设置会导致问题 直接读vmoptions if (SupportOSImpl.VM_OPTIONS_ADAPTER.support()) { - long start = System.currentTimeMillis(); List optionList = new ArrayList<>(); try (BufferedReader reader = new BufferedReader(new FileReader(new File(WIN_VM_OPTIONS_PATH)))) { String option = null; @@ -122,7 +121,6 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { FineLoggerFactory.getLogger().error(e.getMessage(), e); return DEBUG_OPTIONS; } - FineLoggerFactory.getLogger().error("time: " + (System.currentTimeMillis() - start)); if (!optionList.isEmpty()) { return optionList.toArray(new String[0]); } From 8c5a90411bf7be01e666d008270e61bb174ac60d Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 15 Apr 2020 20:09:40 +0800 Subject: [PATCH 227/375] =?UTF-8?q?REPORT-29958=20=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E7=B1=BB=E6=BC=8F=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/os/impl/SupportOSImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java index f6c0e3054..5b8d4d2e8 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java @@ -97,6 +97,14 @@ public enum SupportOSImpl implements SupportOS { public boolean support() { return OperatingSystem.isMacos(); } + }, + + + VM_OPTIONS_ADAPTER { + @Override + public boolean support() { + return OperatingSystem.isWindows(); + } } } From 30c9304b7044e0688192c1a42fc07e7e9c4dfbb6 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Thu, 16 Apr 2020 11:55:29 +0800 Subject: [PATCH 228/375] =?UTF-8?q?REPORT-29985=20=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E7=BD=91=E5=9D=80=E7=AE=A1=E7=90=86=E4=B8=AD=E5=BF=83=E5=BC=80?= =?UTF-8?q?=E5=85=B3-=E5=9B=BA=E5=8C=96=E5=9F=8B=E7=82=B9-=E5=9B=9E?= =?UTF-8?q?=E4=BC=A0=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/messagecollect/solid/SolidCollector.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java index d090b9e8f..194ca75d9 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java @@ -22,7 +22,6 @@ import java.util.Map; public class SolidCollector { private static final String ATTR_CIPHER_TEXT = "cipherText"; private static final String ATTR_SIGNATURE = "signature"; - private static final String SOLID_UPLOAD_URL = CloudCenter.getInstance().acquireUrlByKind("design.solid"); private static volatile SolidCollector instance; @@ -44,6 +43,11 @@ public class SolidCollector { if (WorkContext.getCurrent().isLocal()) { return; } + String url = CloudCenter.getInstance().acquireConf("design.solid", "https://cloud.fanruan.com/api/solid/upload"); + if (StringUtils.isEmpty(url)) { + FineLoggerFactory.getLogger().info("failed to get solid content upload url..."); + return; + } FineLoggerFactory.getLogger().info("start to get solid content from server..."); try { String cipherText = requestContent(); @@ -51,7 +55,7 @@ public class SolidCollector { Map params = new HashMap<>(); params.put(ATTR_CIPHER_TEXT, cipherText); params.put(ATTR_SIGNATURE, String.valueOf(CommonUtils.signature())); - HttpToolbox.post(SOLID_UPLOAD_URL, params); + HttpToolbox.post(url, params); deleteSolidFile(); } From cf6471ba0469543c4e756ef32eb8a72670cbe60a Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Thu, 16 Apr 2020 12:30:16 +0800 Subject: [PATCH 229/375] =?UTF-8?q?REPORT-29416=20=E5=8A=A9=E8=AE=B0?= =?UTF-8?q?=E7=AC=A6=E6=98=AF=E5=90=A6=E5=9C=A8=E6=96=87=E6=9C=AC=E4=B8=AD?= =?UTF-8?q?=E6=A0=87=E8=AE=B0=EF=BC=8C=E6=94=B9=E4=B8=BA=E5=8F=AF=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=88=E9=85=8D=E7=BD=AE=E9=9D=A2=E6=9D=BF=E4=B8=AD?= =?UTF-8?q?=E4=B8=8D=E9=9C=80=E8=A6=81=E6=A0=87=E8=AE=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/ibutton/UIRadioButton.java | 16 +++ .../design/gui/ibutton/UIRadioButtonUI.java | 121 ++++++++++++++++++ .../fr/design/gui/icheckbox/UICheckBox.java | 18 ++- .../com/fr/design/report/PageSetupPane.java | 8 +- 4 files changed, 156 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIRadioButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIRadioButton.java index 1c2aef38a..7112e5d65 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIRadioButton.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIRadioButton.java @@ -22,6 +22,8 @@ public class UIRadioButton extends JRadioButton implements UIObserver, GlobalNam private GlobalNameListener globalNameListener = null; private String radioButtonName = StringUtils.EMPTY; + private boolean markMnemonic = true; + public UIRadioButton() { super(); initListener(); @@ -58,6 +60,13 @@ public class UIRadioButton extends JRadioButton implements UIObserver, GlobalNam initComponent(); } + public UIRadioButton(String text, boolean selected, boolean markMnemonic) { + super(text, selected); + initListener(); + initComponent(); + this.markMnemonic = markMnemonic; + } + public UIRadioButton(String text, Icon icon) { super(text, icon); initListener(); @@ -70,6 +79,13 @@ public class UIRadioButton extends JRadioButton implements UIObserver, GlobalNam initListener(); } + public void setMnemonic(char mnemonic) { + super.setMnemonic(mnemonic); + if (!markMnemonic) { + setDisplayedMnemonicIndex(-1); + } + } + private void initListener() { if (shouldResponseChangeListener()) { this.addItemListener(new ItemListener() { diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIRadioButtonUI.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIRadioButtonUI.java index 0e054b693..811c1c2bd 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIRadioButtonUI.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIRadioButtonUI.java @@ -5,9 +5,12 @@ import com.fr.design.utils.ThemeUtils; import javax.swing.*; import javax.swing.plaf.ComponentUI; +import javax.swing.plaf.basic.BasicHTML; import javax.swing.plaf.metal.MetalRadioButtonUI; import java.awt.*; import java.awt.event.KeyEvent; +import javax.swing.text.View; +import sun.swing.SwingUtilities2; /** * Created by IntelliJ IDEA. @@ -84,6 +87,124 @@ public class UIRadioButtonUI extends MetalRadioButtonUI { return radioButton; } + // ******************************** + // Paint Methods + // ******************************** + public synchronized void paint(Graphics g, JComponent c) { + + AbstractButton b = (AbstractButton) c; + ButtonModel model = b.getModel(); + + Dimension size = c.getSize(); + + int w = size.width; + int h = size.height; + + Font f = c.getFont(); + g.setFont(f); + FontMetrics fm = SwingUtilities2.getFontMetrics(c, g, f); + + Rectangle viewRect = new Rectangle(size); + Rectangle iconRect = new Rectangle(); + Rectangle textRect = new Rectangle(); + + Insets i = c.getInsets(); + viewRect.x += i.left; + viewRect.y += i.top; + viewRect.width -= (i.right + viewRect.x); + viewRect.height -= (i.bottom + viewRect.y); + + Icon altIcon = b.getIcon(); + Icon selectedIcon = null; + Icon disabledIcon = null; + + String text = SwingUtilities.layoutCompoundLabel( + c, fm, b.getText(), altIcon != null ? altIcon : getDefaultIcon(), + b.getVerticalAlignment(), b.getHorizontalAlignment(), + b.getVerticalTextPosition(), b.getHorizontalTextPosition(), + viewRect, iconRect, textRect, b.getIconTextGap()); + + // fill background + if (c.isOpaque()) { + g.setColor(b.getBackground()); + g.fillRect(0, 0, size.width, size.height); + } + + + // Paint the radio button + if (altIcon != null) { + + if (!model.isEnabled()) { + if (model.isSelected()) { + altIcon = b.getDisabledSelectedIcon(); + } else { + altIcon = b.getDisabledIcon(); + } + } else if (model.isPressed() && model.isArmed()) { + altIcon = b.getPressedIcon(); + if (altIcon == null) { + // Use selected icon + altIcon = b.getSelectedIcon(); + } + } else if (model.isSelected()) { + if (b.isRolloverEnabled() && model.isRollover()) { + altIcon = b.getRolloverSelectedIcon(); + if (altIcon == null) { + altIcon = b.getSelectedIcon(); + } + } else { + altIcon = b.getSelectedIcon(); + } + } else if (b.isRolloverEnabled() && model.isRollover()) { + altIcon = b.getRolloverIcon(); + } + + if (altIcon == null) { + altIcon = b.getIcon(); + } + + altIcon.paintIcon(c, g, iconRect.x, iconRect.y); + + } else { + getDefaultIcon().paintIcon(c, g, iconRect.x, iconRect.y); + } + + // Draw the Text + if (text != null) { + View v = (View) c.getClientProperty(BasicHTML.propertyKey); + if (v != null) { + v.paint(g, textRect); + } else { + int mnemIndex = b.getDisplayedMnemonicIndex(); + if (model.isEnabled()) { + // *** paint the text normally + g.setColor(b.getForeground()); + } else { + // *** paint the text disabled + g.setColor(getDisabledTextColor()); + } + if (markMnemonic(text, mnemIndex)) { + SwingUtilities2.drawStringUnderlineCharAt(c, g, text, + mnemIndex, textRect.x, textRect.y + fm.getAscent()); + } else { + SwingUtilities2.drawString(c, g, text, textRect.x, textRect.y + fm.getAscent()); + } + } + if (b.hasFocus() && b.isFocusPainted() && + textRect.width > 0 && textRect.height > 0) { + paintFocus(g, textRect, size); + } + } + } + + /** + * @param text + * @param mnemIndex 助记符在text中的索引 + * @return true:需要给助记符画一个下划线 + */ + private boolean markMnemonic(String text, int mnemIndex) { + return mnemIndex > 0 && text != null && text.length() > 0 && text.length() > mnemIndex; + } /** * Paints the focus for the radiobutton diff --git a/designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java b/designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java index 379274b90..e294d8022 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java @@ -34,6 +34,7 @@ public class UICheckBox extends JCheckBox implements UIObserver, GlobalNameObser private UIObserverListener uiObserverListener; private GlobalNameListener globalNameListener = null; private String checkboxName = ""; + private boolean markMnemonic = true; public UICheckBox(String string) { super(string); @@ -53,6 +54,13 @@ public class UICheckBox extends JCheckBox implements UIObserver, GlobalNameObser initListener(); } + public UICheckBox(String locText, boolean b, boolean markMnemonic) { + super(locText, b); + setUI(new UICheckBoxUI()); + initListener(); + this.markMnemonic=markMnemonic; + } + public UICheckBox(String text, Icon icon) { super(text, icon); setUI(new UICheckBoxUI()); @@ -189,14 +197,18 @@ public class UICheckBox extends JCheckBox implements UIObserver, GlobalNameObser if (v != null) { v.paint(g, textRect); } else { - int mnemIndex = b.getDisplayedMnemonicIndex(); + if (model.isEnabled()) { g.setColor(b.getForeground()); } else { g.setColor(getDisabledTextColor()); } - SwingUtilities2.drawStringUnderlineCharAt(c, g, text, - mnemIndex, textRect.x, textRect.y + fm.getAscent()); + if (markMnemonic) { + SwingUtilities2.drawStringUnderlineCharAt(c, g, text, + b.getDisplayedMnemonicIndex(), textRect.x, textRect.y + fm.getAscent()); + } else { + SwingUtilities2.drawString(c, g, text, textRect.x, textRect.y + fm.getAscent()); + } } } } diff --git a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java b/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java index db9234925..20beaa564 100644 --- a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java @@ -885,12 +885,12 @@ public class PageSetupPane extends BasicPane { Icon topBottomIcon = BaseUtils.readIcon("/com/fr/base/images/dialog/pagesetup/down.png"); - topBottomRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Top_To_Bottom")); + topBottomRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Top_To_Bottom"),false,false); pageOrderPane.add(FRGUIPaneFactory.createIconRadio_S_Pane(topBottomIcon, topBottomRadioButton)); topBottomRadioButton.setMnemonic('B'); Icon leftRightIcon = BaseUtils.readIcon("/com/fr/base/images/dialog/pagesetup/over.png"); - leftRightRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Left_To_Right")); + leftRightRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Left_To_Right"), false, false); pageOrderPane.add(FRGUIPaneFactory.createIconRadio_S_Pane(leftRightIcon, leftRightRadioButton)); leftRightRadioButton.setMnemonic('R'); @@ -907,9 +907,9 @@ public class PageSetupPane extends BasicPane { defaultPane.add(outcenterOnPagePane); - this.horizonalCenterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Horizontally")); + this.horizonalCenterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Horizontally"), false, false); this.horizonalCenterCheckBox.setMnemonic('H'); - this.verticalCenterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Vertically")); + this.verticalCenterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Vertically"), false, false); this.verticalCenterCheckBox.setMnemonic('V'); centerOnPagePane.add(GUICoreUtils.createFlowPane(horizonalCenterCheckBox, FlowLayout.CENTER)); From 1122c29fdb225d00701b40fe97665354def7e10c Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 16 Apr 2020 16:48:44 +0800 Subject: [PATCH 230/375] =?UTF-8?q?REPORT-29732=20&&=20REPORT-29432=20?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/itableeditorpane/UITableModelAdapter.java | 2 +- .../com/fr/design/javascript/JavaScriptImplPane.java | 3 ++- .../widget/accessibles/BaseAccessibleEditor.java | 3 ++- .../java/com/fr/design/parameter/ParameterArrayPane.java | 5 +++-- .../java/com/fr/design/present/dict/FormulaDictPane.java | 7 ++++--- .../src/main/java/com/fr/design/upm/UpmFinder.java | 2 +- .../adapters/layout/FRCardMainBorderLayoutAdapter.java | 5 +++-- .../widget/ui/designer/component/WidgetBoundPane.java | 9 +++++---- .../ui/designer/component/WidgetCardTagBoundPane.java | 5 +++-- .../com/fr/design/cell/editor/DSColumnCellEditor.java | 2 +- .../main/java/com/fr/design/dscolumn/DSColumnPane.java | 2 ++ .../src/main/java/com/fr/design/webattr/WebJsPane.java | 4 ++-- 12 files changed, 29 insertions(+), 20 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java b/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java index fc219a30b..7d0411307 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java +++ b/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java @@ -235,7 +235,7 @@ public abstract class UITableModelAdapter extends AbstractTabl public void actionPerformed(ActionEvent e) { int[] selectedRow = table.getSelectedRows(); if (ismultiSelected()) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multiple_Select_Warn_Text")); + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multiple_Select_Warn_Text")); return; } if (table.getCellEditor() != null) { diff --git a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java index 8806d6853..158c05d1e 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java @@ -2,6 +2,7 @@ package com.fr.design.javascript; import com.fr.base.Parameter; import com.fr.design.data.tabledata.tabledatapane.OneListTableModel; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.UITableEditAction; @@ -62,7 +63,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { } if (tempSet.contains(list.get(i).toString())) { list.remove(i); - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Duplicate_Name") + "!"); + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Duplicate_Name") + "!"); parameterChanger(list); return; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java index 9f73a06d3..e6ddd8138 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java @@ -12,6 +12,7 @@ import java.util.ArrayList; import javax.swing.*; import com.fr.design.constants.UIConstants; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ibutton.UIButton; @@ -222,7 +223,7 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor } public static void showMessage(String message, Component editorComponent) { - JOptionPane.showMessageDialog(editorComponent, message, "Validation Error", JOptionPane.ERROR_MESSAGE); + FineJOptionPane.showMessageDialog(editorComponent, message, "Validation Error", JOptionPane.ERROR_MESSAGE); } diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java index 30cac90eb..d3efcae4a 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java @@ -2,6 +2,7 @@ package com.fr.design.parameter; import com.fr.base.Parameter; import com.fr.base.ParameterConfig; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableSelfCreator; @@ -36,14 +37,14 @@ public class ParameterArrayPane extends JListControlPane { String tempName = getEditingName(); if (StringUtils.isEmpty(tempName)) { nameableList.stopEditing(); - JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name")); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name")); setIllegalIndex(editingIndex); return; } if (!ComparatorUtils.equals(tempName, selectedName) && isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { nameableList.stopEditing(); - JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name")); setIllegalIndex(editingIndex); } diff --git a/designer-base/src/main/java/com/fr/design/present/dict/FormulaDictPane.java b/designer-base/src/main/java/com/fr/design/present/dict/FormulaDictPane.java index ff1384620..2eca81466 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/FormulaDictPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/FormulaDictPane.java @@ -10,6 +10,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.widget.FRWidgetFactory; import com.fr.stable.StringUtils; import javax.swing.*; @@ -20,6 +21,7 @@ public class FormulaDictPane extends FurtherBasicBeanPane { private static final int EDITOR_COLUMN = 15; private static final int LEFT_BORDER = 5; + private static final int MAX_WIDTH = 30; private FormulaEditor keyFormulaEditor; private FormulaEditor valueFormulaEditor; @@ -61,10 +63,9 @@ public class FormulaDictPane extends FurtherBasicBeanPane { valueFormulaContainer.add(new JLabel(icon)); valueFormulaContainer.add(valueFormulaEditor); - Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Actual_Value"), UILabel.LEFT), keyFormulaContainer}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value"), UILabel.LEFT), valueFormulaContainer}, + new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Actual_Value"), MAX_WIDTH, UILabel.LEFT), keyFormulaContainer}, + new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value"), MAX_WIDTH, UILabel.LEFT), valueFormulaContainer}, new Component[]{tag, null} }; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE); diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java b/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java index 4febad3a9..9a6205cf4 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java @@ -88,7 +88,7 @@ public class UpmFinder { dialog.setVisible(true); } } else { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Plugin_Message")); + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Plugin_Message")); UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame()); dialog.setAutoUpdateAfterInit(); dialog.showDialog(); diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java index 1d529743a..9718d4a6f 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java @@ -3,6 +3,7 @@ package com.fr.design.designer.beans.adapters.layout; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.form.layout.FRBorderLayout; import com.fr.general.ComparatorUtils; @@ -47,13 +48,13 @@ public class FRCardMainBorderLayoutAdapter extends FRBorderLayoutAdapter { if (ComparatorUtils.equals(constraints, BorderLayout.NORTH) || ComparatorUtils.equals(constraints, BorderLayout.SOUTH)) { int containerHeight = container.getHeight(); if (rectangle.height > containerHeight) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); return true; } } else if (ComparatorUtils.equals(constraints, BorderLayout.EAST) || ComparatorUtils.equals(constraints, BorderLayout.WEST)) { int containerWidth = container.getWidth(); if (rectangle.width > containerWidth) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); return true; } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java index c9928759b..ab148f2ae 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java @@ -10,6 +10,7 @@ import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.cardlayout.XWCardLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.FormDesigner; @@ -115,11 +116,11 @@ public class WidgetBoundPane extends BasicPane { PaddingMargin margin = wabs.getMargin(); if (bounds.width != w) { if (bounds.width == rec.width - margin.getLeft() - margin.getRight()) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds")); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds")); width.setValue(bounds.width); return; } else if (w < minWidth) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Width") + Integer.toString(minWidth)); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Width") + Integer.toString(minWidth)); width.setValue(bounds.width); return; } @@ -136,11 +137,11 @@ public class WidgetBoundPane extends BasicPane { int minHeight = (int) (MINHEIGHT * ((WFitLayout) wabs).getResolutionScaling()); if (bounds.height != h) { if (bounds.height == rec.height - margin.getTop() - margin.getBottom()) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds")); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds")); height.setValue(bounds.height); return; } else if (h < minHeight) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Height") + Integer.toString(minHeight)); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Height") + Integer.toString(minHeight)); height.setValue(bounds.height); return; } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java index 97bc5aaa3..22d544c1a 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java @@ -4,6 +4,7 @@ import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; @@ -48,13 +49,13 @@ public class WidgetCardTagBoundPane extends WidgetBoundPane { Rectangle rectangle = tabLayout.getBounds(); if(ComparatorUtils.equals(displayPosition, WTabDisplayPosition.TOP_POSITION) || ComparatorUtils.equals(displayPosition, WTabDisplayPosition.BOTTOM_POSITION)){ if(rectangle.height < size){ - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); return; } parentBounds.height = size; }else{ if(rectangle.width < size){ - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); + FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); return; } parentBounds.width = size; diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java b/designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java index a7fb154e0..97efbda44 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java @@ -65,7 +65,7 @@ public class DSColumnCellEditor extends AbstractCellEditor implements DialogActi this.dsColumnPane = new DSColumnPane(); dsColumnPane.putElementcase(grid.getElementCasePane()); dsColumnPane.putCellElement(cellElement); - BasicDialog dsColumnDialog = this.dsColumnPane.showWindow(SwingUtilities.getWindowAncestor(grid)); + BasicDialog dsColumnDialog = this.dsColumnPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(grid), null, DSColumnPane.DEFAULT_DIMENSION); dsColumnDialog.addDialogActionListener(this); diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnPane.java index 4b33304cd..afade5626 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnPane.java @@ -26,6 +26,8 @@ import java.beans.PropertyChangeListener; */ public class DSColumnPane extends BasicPane { + public static final Dimension DEFAULT_DIMENSION = new Dimension(700, 600); + private TableDataSource tplEC; private UITabbedPane tabbedPane; private DSColumnBasicPane basicPane = null; diff --git a/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java b/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java index 7c5c2e6b9..b2934b10e 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java @@ -129,7 +129,7 @@ public class WebJsPane extends BasicPane { if (url.matches("^[a-zA-z]+://.+js")) { return url; } else { - JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Add_JS_warning")); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Add_JS_warning")); return ""; } } @@ -190,7 +190,7 @@ public class WebJsPane extends BasicPane { public void actionPerformed(ActionEvent arg0) { String uri = urlText.getText(); if (!uri.matches("^[a-zA-z]+://.+js")) { - JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Add_JS_warning")); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Add_JS_warning")); return; } InputStream in = null; From 20dc52dc6f6cd18104ad97ef1283b7dffcc865b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 16 Apr 2020 16:52:04 +0800 Subject: [PATCH 231/375] =?UTF-8?q?CHART-13473=20=20=20=E7=94=BB=E5=9B=BE?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=82=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/chart/ChartDesignerActivator.java | 2 ++ .../java/com/fr/design/chart/gui/ChartComponent.java | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java index 8ad2e6198..65d6abd64 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java @@ -4,6 +4,7 @@ import com.fr.chart.chartattr.ChartCollection; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.gui.ChartComponent; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.ChartPropertyPane; import com.fr.design.module.ChartEmptyDataStyleAction; import com.fr.design.module.ChartHyperlinkGroup; @@ -50,6 +51,7 @@ public class ChartDesignerActivator extends Activator implements Prepare { DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption()); ImagePainter.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); + ImagePainter.registerDefaultCallbackEvent(HistoryTemplateListCache.getInstance()); ChartTypeInterfaceManager.addPluginChangedListener(); } diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java index c8fafe9cd..aa7f9107b 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java +++ b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java @@ -31,7 +31,7 @@ import java.awt.event.MouseMotionListener; * 类说明: 事件说明: 工具栏编辑--> 是刷新ChartComponent 然后响应整个设计块的改变事件 右键编辑 ---> 刷新ChartCompment 刷新对应的工具栏(加入事件) 然后响应整个设计块的改变事件 */ -public class ChartComponent extends MiddleChartComponent implements MouseListener, MouseMotionListener{ +public class ChartComponent extends MiddleChartComponent implements MouseListener, MouseMotionListener, CallbackEvent{ private static final long serialVersionUID = 744164838619052097L; private final List listeners = new ArrayList(); private ChartCollection chartCollection4Design; @@ -257,7 +257,12 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene if (resolution == 0){ resolution = ScreenResolution.getScreenResolution(); } - painter.paint(g2d, chartWidth, chartHeight, resolution, null); + painter.paint(g2d, chartWidth, chartHeight, resolution, null,this); } } + + @Override + public void callback() { + this.repaint(); + } } \ No newline at end of file From 2aae7b867dd86a786fbc0f1014de00c3ef06a0d7 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 16 Apr 2020 16:56:46 +0800 Subject: [PATCH 232/375] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/socketio/DesignerSocketIO.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 63bc3d999..79061dbab 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.socketio; import com.fr.config.RemoteConfigEvent; import com.fr.decision.webservice.utils.DecisionServiceConstants; import com.fr.design.EnvChangeEntrance; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.loghandler.DesignerLogger; @@ -146,7 +147,7 @@ public class DesignerSocketIO { UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override public void run() { - JOptionPane.showMessageDialog( + FineJOptionPane.showMessageDialog( DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), UIManager.getString("OptionPane.messageDialogTitle"), From 430b3f4706b4ed9fafbcd0655914e4b8c37f089e Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 16 Apr 2020 17:59:40 +0800 Subject: [PATCH 233/375] =?UTF-8?q?REPORT-29576=20=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/BaseDesigner.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/designer-base/src/main/java/com/fr/start/BaseDesigner.java b/designer-base/src/main/java/com/fr/start/BaseDesigner.java index 90ac634ce..1469dd32e 100644 --- a/designer-base/src/main/java/com/fr/start/BaseDesigner.java +++ b/designer-base/src/main/java/com/fr/start/BaseDesigner.java @@ -3,6 +3,7 @@ */ package com.fr.start; +import com.fr.common.report.ReportState; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.constants.DesignerLaunchStatus; @@ -24,6 +25,9 @@ import com.fr.file.FILEFactory; import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; +import com.fr.process.ProcessEventPipe; +import com.fr.process.engine.core.CarryMessageEvent; +import com.fr.process.engine.core.FineProcessContext; import com.fr.stable.OperatingSystem; import java.awt.Window; @@ -75,6 +79,11 @@ public abstract class BaseDesigner extends ToolBarMenuDock { @Override public void on(Event event, Null param) { EventDispatcher.stopListen(this); + // 启动完成 停止监听 + ProcessEventPipe eventPipe = FineProcessContext.getParentPipe(); + if (eventPipe != null) { + eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue())); + } collectUserInformation(); } }); From d0e9ebe0c8d8e9c50db50402f5aacb81a85fe162 Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 16 Apr 2020 19:21:10 +0800 Subject: [PATCH 234/375] =?UTF-8?q?REPORT-29536=E3=80=90=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE-=E6=9C=AC=E5=9C=B0=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E7=BA=B8=E5=BC=A0=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E7=9A=84custom=E6=AF=94=E5=85=B6=E4=BB=96=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E5=A4=9A=E5=87=BA=E9=A6=96=E8=A1=8C=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractNativePrintSettingPane.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java index 2b2229783..2ff9d4180 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java @@ -103,14 +103,14 @@ public abstract class AbstractNativePrintSettingPane extends JPanel { showDialogCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Show_Print_Setting_Window_When_Printing")); showDialogCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20)); UILabel showDialogCheckTip = GUICoreUtils.createTipLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tip_Use_Default_Settings")); - JPanel showDialogCheckPane = GUICoreUtils.createFlowPane(new Component[] { + JPanel showDialogCheckPane = GUICoreUtils.createFlowPane(new Component[]{ showDialogCheck, showDialogCheckTip}, FlowLayout.LEFT); // 打印需要指定 sheet needSelectSheetCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Need_Select_Sheet_When_Printing")); needSelectSheetCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20)); UILabel needSelectSheetCheckTip = GUICoreUtils.createTipLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tip_Invalid_In_Page_View")); - JPanel needSelectSheetCheckPane = GUICoreUtils.createFlowPane(new Component[] { + JPanel needSelectSheetCheckPane = GUICoreUtils.createFlowPane(new Component[]{ needSelectSheetCheck, needSelectSheetCheckTip}, FlowLayout.LEFT); return createHeaderPane(tipDownload, showDialogCheckPane, needSelectSheetCheckPane); @@ -263,7 +263,7 @@ public abstract class AbstractNativePrintSettingPane extends JPanel { ' ' + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_mm") + ']'; - this.setText(sbuf); + this.setText(" " + sbuf); break; } } @@ -461,8 +461,8 @@ public abstract class AbstractNativePrintSettingPane extends JPanel { extraUpdate(nativePrintAttr); nativePrintAttr.setShowDialog(showDialogCheck.isSelected()); nativePrintAttr.setNeedSelectSheet(needSelectSheetCheck.isSelected()); - nativePrintAttr.setPrinterName((String)printerComboBox.getSelectedItem()); - nativePrintAttr.setCopy((int)copySpinner.getValue()); + nativePrintAttr.setPrinterName((String) printerComboBox.getSelectedItem()); + nativePrintAttr.setCopy((int) copySpinner.getValue()); // 页码 if (allPageRadioButton.isSelected()) { @@ -472,7 +472,7 @@ public abstract class AbstractNativePrintSettingPane extends JPanel { } else if (customPageRadioButton.isSelected()) { nativePrintAttr.setPageType(NativePrintAttr.PageType.SPECIFIED_PAGES); nativePrintAttr.setArea(specifiedAreaField.getText()); - } else if (doublePrintComboBox.getSelectedIndex() == ODD_INDEX){ + } else if (doublePrintComboBox.getSelectedIndex() == ODD_INDEX) { nativePrintAttr.setPageType(NativePrintAttr.PageType.ODD_PAGES); } else { nativePrintAttr.setPageType(NativePrintAttr.PageType.EVEN_PAGES); @@ -494,7 +494,7 @@ public abstract class AbstractNativePrintSettingPane extends JPanel { nativePrintAttr.setInheritPageMarginSetting(inheritPageMarginSettingCheck.isSelected()); nativePrintAttr.setMargin(pageMarginSettingPane.updateBean()); nativePrintAttr.setFitPaperSize(fitPaperSizeCheck.isSelected()); - nativePrintAttr.setScalePercent((int)scalePercentField.getValue()); + nativePrintAttr.setScalePercent((int) scalePercentField.getValue()); } protected void extraUpdate(NativePrintAttr nativePrintAttr) { From 06e18697dc73e6e2c59453e90166693cb334909c Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 16 Apr 2020 19:49:24 +0800 Subject: [PATCH 235/375] =?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 --- .../design/actions/file/PreferencePane.java | 3 +- .../fun/FormAdaptiveConfigUIProcessor.java | 35 ++++++++++++++++ .../design/fun/ReportLengthUNITProvider.java | 39 ++++++++++++++++++ ...AbstractFormAdaptiveConfigUIProcessor.java | 38 +++++++++++++++++ .../AbstractReportLengthUNITProvider.java | 41 +++++++++++++++++++ .../AbstractFormAdaptiveConfigUI.java | 18 -------- .../fit/menupane/FormAdaptiveConfigUI.java | 26 ------------ .../fit/menupane/ReportFitAttrAction.java | 5 ++- .../com/fr/design/unit/ReportLengthUNIT.java | 21 ---------- .../unit/ReportLengthUnitProcessor.java | 14 ------- .../com/fr/design/unit/UnitConvertUtil.java | 26 ++++++++---- .../AbstracReportLengthUnitProcessor.java | 19 --------- .../unit/impl/AbstractReportLengthUNIT.java | 22 ---------- .../design/unit/impl/CMReportLengthUNIT.java | 4 +- .../unit/impl/INCHReportLengthUNIT.java | 4 +- .../design/unit/impl/MMReportLengthUNIT.java | 4 +- .../design/unit/impl/PTReportLengthUNIT.java | 3 +- .../columnrow/ColumnRowSizingAction.java | 7 ++-- .../java/com/fr/design/condition/WHPane.java | 8 ++-- .../form/FormElementCaseDesigner.java | 7 ++-- .../grid/AbstractGridHeaderMouseHandler.java | 4 +- 21 files changed, 198 insertions(+), 150 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/FormAdaptiveConfigUIProcessor.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/ReportLengthUNITProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormAdaptiveConfigUIProcessor.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportLengthUNITProvider.java delete mode 100644 designer-base/src/main/java/com/fr/design/report/fit/menupane/AbstractFormAdaptiveConfigUI.java delete mode 100644 designer-base/src/main/java/com/fr/design/report/fit/menupane/FormAdaptiveConfigUI.java delete mode 100644 designer-base/src/main/java/com/fr/design/unit/ReportLengthUNIT.java delete mode 100644 designer-base/src/main/java/com/fr/design/unit/ReportLengthUnitProcessor.java delete mode 100644 designer-base/src/main/java/com/fr/design/unit/impl/AbstracReportLengthUnitProcessor.java delete mode 100644 designer-base/src/main/java/com/fr/design/unit/impl/AbstractReportLengthUNIT.java diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 8f88cdeff..387082ed0 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -28,6 +28,7 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.vcs.VcsConfigManager; import com.fr.design.mainframe.vcs.common.VcsHelper; import com.fr.design.os.impl.SupportOSImpl; +import com.fr.design.unit.UnitConvertUtil; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.general.ComparatorUtils; @@ -575,7 +576,7 @@ public class PreferencePane extends BasicPane { pageLengthComboBox = new UIComboBox(new String[]{i18nText("Fine-Design_Basic_Page_Setup_MM"), i18nText("Fine-Design_Report_Unit_CM"), i18nText("Fine-Design_Report_Unit_INCH")}); pageLengthComboBox.setPreferredSize(new Dimension(80, 20)); pageLengthComboBox.setMinimumSize(new Dimension(80, 20)); - reportLengthComboBox = new UIComboBox(new String[]{i18nText("Fine-Design_Basic_Page_Setup_MM"), i18nText("Fine-Design_Report_Unit_CM"), i18nText("Fine-Design_Report_Unit_INCH"), i18nText("Fine-Design_Report_Unit_PT_Duplicate")}); + reportLengthComboBox = new UIComboBox(UnitConvertUtil.getUnitItems()); reportLengthComboBox.setPreferredSize(new Dimension(80, 20)); reportLengthComboBox.setMinimumSize(new Dimension(80, 20)); UILabel pagelengthLabel = new UILabel(i18nText("Fine-Design_Basic_Page_Setup_Scale_Units") + ":"); diff --git a/designer-base/src/main/java/com/fr/design/fun/FormAdaptiveConfigUIProcessor.java b/designer-base/src/main/java/com/fr/design/fun/FormAdaptiveConfigUIProcessor.java new file mode 100644 index 000000000..a91e202c9 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/FormAdaptiveConfigUIProcessor.java @@ -0,0 +1,35 @@ +package com.fr.design.fun; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.stable.fun.mark.Immutable; + +import javax.swing.JComponent; +import java.awt.Dimension; +import java.awt.image.BufferedImage; + + +/** + * Created by kerry on 2020-04-09 + * 临时接口,后续自适应内置后删除 + */ +public interface FormAdaptiveConfigUIProcessor extends Immutable { + + String MARK_STRING = "FormAdaptiveConfigUI"; + int CURRENT_LEVEL = 1; + + /** + * 获取表单自适应配置界面 + * @return 表单自适应配置界面 + */ + BasicBeanPane getConfigPane(); + + /** + * 绘制自适应下报表块在表单界面中显示图片 + * @param size 绘制尺寸 + * @param elementCasePane 报表块内容对象 + * @return 自适应下报表块在表单界面中显示的图片 + */ + BufferedImage paintFormElementCaseImage(Dimension size, JComponent elementCasePane); + +} + diff --git a/designer-base/src/main/java/com/fr/design/fun/ReportLengthUNITProvider.java b/designer-base/src/main/java/com/fr/design/fun/ReportLengthUNITProvider.java new file mode 100644 index 000000000..af97950cf --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/ReportLengthUNITProvider.java @@ -0,0 +1,39 @@ +package com.fr.design.fun; + +import com.fr.stable.fun.mark.Mutable; +import com.fr.stable.unit.UNIT; + +/** + * Created by kerry on 2020-04-09 + */ +public interface ReportLengthUNITProvider extends Mutable { + String MARK_STRING = "ReportLengthUNITProvider"; + + int CURRENT_LEVEL = 1; + + /** + * 标尺单位显示字符 + * @return 标尺单位字符 + */ + String unitText(); + + /** + * 标尺单位类型(之前是将int类型的值直接保存在数据库里面的) + * @return 返回标尺单位类型 + */ + int unitType(); + + /** + * UNIT转标尺单位值 + * @param value UNIT + * @return 标尺单位值 + */ + float unit2Value4Scale(UNIT value); + + /** + * 标尺单位值转UNIT + * @param value 标尺单位值 + * @return UNIT + */ + UNIT float2UNIT(float value); +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormAdaptiveConfigUIProcessor.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormAdaptiveConfigUIProcessor.java new file mode 100644 index 000000000..e57333987 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormAdaptiveConfigUIProcessor.java @@ -0,0 +1,38 @@ +package com.fr.design.fun.impl; + + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.fun.FormAdaptiveConfigUIProcessor; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +import javax.swing.JComponent; +import java.awt.Dimension; +import java.awt.image.BufferedImage; + +/** + * Created by kerry on 2020-04-09 + */ +@API(level = FormAdaptiveConfigUIProcessor.CURRENT_LEVEL) +public abstract class AbstractFormAdaptiveConfigUIProcessor extends AbstractProvider implements FormAdaptiveConfigUIProcessor { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + + @Override + public BasicBeanPane getConfigPane() { + return null; + } + + @Override + public BufferedImage paintFormElementCaseImage(Dimension size, JComponent elementCasePane) { + return null; + } +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportLengthUNITProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportLengthUNITProvider.java new file mode 100644 index 000000000..b550b07c1 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportLengthUNITProvider.java @@ -0,0 +1,41 @@ +package com.fr.design.fun.impl; + + +import com.fr.design.fun.ReportLengthUNITProvider; +import com.fr.stable.StringUtils; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; +import com.fr.stable.unit.UNIT; + +/** + * Created by kerry on 2020-04-09 + */ +@API(level = ReportLengthUNITProvider.CURRENT_LEVEL) +public abstract class AbstractReportLengthUNITProvider extends AbstractProvider implements ReportLengthUNITProvider { + + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String unitText() { + return StringUtils.EMPTY; + } + + @Override + public int unitType() { + return 0; + } + + @Override + public float unit2Value4Scale(UNIT value) { + return 0; + } + + @Override + public UNIT float2UNIT(float value) { + return null; + } +} diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/AbstractFormAdaptiveConfigUI.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/AbstractFormAdaptiveConfigUI.java deleted file mode 100644 index bf0822104..000000000 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/AbstractFormAdaptiveConfigUI.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.fr.design.report.fit.menupane; - - -/** - * Created by kerry on 2020-04-09 - */ -public abstract class AbstractFormAdaptiveConfigUI implements FormAdaptiveConfigUI { - - @Override - public int currentAPILevel() { - return CURRENT_LEVEL; - } - - @Override - public int layerIndex() { - return DEFAULT_LAYER_INDEX; - } -} diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/FormAdaptiveConfigUI.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/FormAdaptiveConfigUI.java deleted file mode 100644 index cd88ec4ec..000000000 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/FormAdaptiveConfigUI.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.fr.design.report.fit.menupane; - -import com.fr.design.beans.BasicBeanPane; -import com.fr.stable.fun.mark.Immutable; - -import javax.swing.JComponent; -import java.awt.Dimension; -import java.awt.image.BufferedImage; - - -/** - * Created by kerry on 2020-04-09 - */ -public interface FormAdaptiveConfigUI extends Immutable { - - String MARK_STRING = "FormAdaptiveConfigUI"; - int CURRENT_LEVEL = 1; - - - BasicBeanPane getConfigPane(); - - BufferedImage getElementCaseImage(Dimension size, JComponent elementCasePane); - - -} - diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java index ebffc9809..bbf5106c3 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java @@ -5,6 +5,7 @@ import com.fr.design.actions.JTemplateAction; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.UIDialog; +import com.fr.design.fun.FormAdaptiveConfigUIProcessor; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.MenuKeySet; @@ -43,7 +44,7 @@ public class ReportFitAttrAction extends JTemplateAction { @Override public String getMenuName() { - FormAdaptiveConfigUI configPane = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUI.MARK_STRING); + FormAdaptiveConfigUIProcessor configPane = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUIProcessor.MARK_STRING); if (configPane != null) { return configPane.getConfigPane().getTitle(); } @@ -91,7 +92,7 @@ public class ReportFitAttrAction extends JTemplateAction { showReportFitDialog(fitAttr, jwb, wbTpl, attrPane); } else { BasicBeanPane attrPane = null; - FormAdaptiveConfigUI configPane = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUI.MARK_STRING); + FormAdaptiveConfigUIProcessor configPane = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUIProcessor.MARK_STRING); if (configPane != null) { attrPane = configPane.getConfigPane(); }else{ diff --git a/designer-base/src/main/java/com/fr/design/unit/ReportLengthUNIT.java b/designer-base/src/main/java/com/fr/design/unit/ReportLengthUNIT.java deleted file mode 100644 index 513232d95..000000000 --- a/designer-base/src/main/java/com/fr/design/unit/ReportLengthUNIT.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.fr.design.unit; - -import com.fr.stable.fun.mark.Mutable; -import com.fr.stable.unit.UNIT; - -/** - * Created by kerry on 2020-04-09 - */ -public interface ReportLengthUNIT extends Mutable { - String MARK_STRING = "ReportLengthUNIT"; - - int CURRENT_LEVEL = 1; - - String unitText(); - - int unitType(); - - float unit2Value4Scale(UNIT value); - - UNIT float2UNIT(float value); -} diff --git a/designer-base/src/main/java/com/fr/design/unit/ReportLengthUnitProcessor.java b/designer-base/src/main/java/com/fr/design/unit/ReportLengthUnitProcessor.java deleted file mode 100644 index 4adffd28c..000000000 --- a/designer-base/src/main/java/com/fr/design/unit/ReportLengthUnitProcessor.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.fr.design.unit; - -import com.fr.stable.fun.mark.Immutable; - -/** - * Created by kerry on 2020-04-09 - */ -public interface ReportLengthUnitProcessor extends Immutable { - String MARK_STRING = "ReportLengthUnitProcessor"; - int CURRENT_LEVEL = 1; - - ReportLengthUNIT getReportLengthUNIT(int unitType); - -} diff --git a/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java b/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java index fee1cccd7..406ddcfdd 100644 --- a/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java +++ b/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java @@ -1,6 +1,7 @@ package com.fr.design.unit; import com.fr.design.ExtraDesignClassManager; +import com.fr.design.fun.ReportLengthUNITProvider; import com.fr.design.unit.impl.CMReportLengthUNIT; import com.fr.design.unit.impl.INCHReportLengthUNIT; import com.fr.design.unit.impl.MMReportLengthUNIT; @@ -8,18 +9,23 @@ import com.fr.design.unit.impl.PTReportLengthUNIT; import java.util.ArrayList; import java.util.List; +import java.util.Set; /** * Created by kerry on 2020-04-09 */ public class UnitConvertUtil { - private static List lengthUNITList = new ArrayList(); + private static List lengthUNITList = new ArrayList(); static { + lengthUNITList.add(new MMReportLengthUNIT()); lengthUNITList.add(new CMReportLengthUNIT()); lengthUNITList.add(new INCHReportLengthUNIT()); lengthUNITList.add(new PTReportLengthUNIT()); - lengthUNITList.add(new MMReportLengthUNIT()); + Set providers = ExtraDesignClassManager.getInstance().getArray(ReportLengthUNITProvider.MARK_STRING); + for (ReportLengthUNITProvider provider : providers) { + lengthUNITList.add(provider); + } } private UnitConvertUtil() { @@ -27,16 +33,20 @@ public class UnitConvertUtil { } - public static ReportLengthUNIT parseLengthUNIT(int unitType) { - ReportLengthUnitProcessor lengthUnitProcessor = ExtraDesignClassManager.getInstance().getSingle(ReportLengthUnitProcessor.MARK_STRING); - if (lengthUnitProcessor != null) { - return lengthUnitProcessor.getReportLengthUNIT(unitType); - } - for (ReportLengthUNIT lengthUNIT : lengthUNITList) { + public static ReportLengthUNITProvider parseLengthUNIT(int unitType) { + for (ReportLengthUNITProvider lengthUNIT : lengthUNITList) { if (unitType == lengthUNIT.unitType()) { return lengthUNIT; } } return new MMReportLengthUNIT(); } + + public static String[] getUnitItems() { + String[] unitItems = new String[lengthUNITList.size()]; + for (int i = 0; i < lengthUNITList.size(); i++) { + unitItems[i] = lengthUNITList.get(i).unitText(); + } + return unitItems; + } } diff --git a/designer-base/src/main/java/com/fr/design/unit/impl/AbstracReportLengthUnitProcessor.java b/designer-base/src/main/java/com/fr/design/unit/impl/AbstracReportLengthUnitProcessor.java deleted file mode 100644 index 64242b3b3..000000000 --- a/designer-base/src/main/java/com/fr/design/unit/impl/AbstracReportLengthUnitProcessor.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.fr.design.unit.impl; - -import com.fr.design.unit.ReportLengthUnitProcessor; - -/** - * Created by kerry on 2020-04-09 - */ -public abstract class AbstracReportLengthUnitProcessor implements ReportLengthUnitProcessor { - - @Override - public int currentAPILevel() { - return CURRENT_LEVEL; - } - - @Override - public int layerIndex() { - return DEFAULT_LAYER_INDEX; - } -} diff --git a/designer-base/src/main/java/com/fr/design/unit/impl/AbstractReportLengthUNIT.java b/designer-base/src/main/java/com/fr/design/unit/impl/AbstractReportLengthUNIT.java deleted file mode 100644 index d1947b8f4..000000000 --- a/designer-base/src/main/java/com/fr/design/unit/impl/AbstractReportLengthUNIT.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.fr.design.unit.impl; - - -import com.fr.design.unit.ReportLengthUNIT; - -/** - * Created by kerry on 2020-04-09 - */ -public abstract class AbstractReportLengthUNIT implements ReportLengthUNIT { - - - @Override - public int currentAPILevel() { - return CURRENT_LEVEL; - } - - @Override - public String mark4Provider() { - return getClass().getName(); - } - -} diff --git a/designer-base/src/main/java/com/fr/design/unit/impl/CMReportLengthUNIT.java b/designer-base/src/main/java/com/fr/design/unit/impl/CMReportLengthUNIT.java index e3b550d01..ef4dcb64a 100644 --- a/designer-base/src/main/java/com/fr/design/unit/impl/CMReportLengthUNIT.java +++ b/designer-base/src/main/java/com/fr/design/unit/impl/CMReportLengthUNIT.java @@ -1,6 +1,6 @@ package com.fr.design.unit.impl; -import com.fr.design.unit.impl.AbstractReportLengthUNIT; +import com.fr.design.fun.impl.AbstractReportLengthUNITProvider; import com.fr.stable.Constants; import com.fr.stable.unit.CM; import com.fr.stable.unit.UNIT; @@ -8,7 +8,7 @@ import com.fr.stable.unit.UNIT; /** * Created by kerry on 2020-04-09 */ -public class CMReportLengthUNIT extends AbstractReportLengthUNIT { +public class CMReportLengthUNIT extends AbstractReportLengthUNITProvider { @Override public String unitText() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_CM"); diff --git a/designer-base/src/main/java/com/fr/design/unit/impl/INCHReportLengthUNIT.java b/designer-base/src/main/java/com/fr/design/unit/impl/INCHReportLengthUNIT.java index c919e14e1..5cfcb6920 100644 --- a/designer-base/src/main/java/com/fr/design/unit/impl/INCHReportLengthUNIT.java +++ b/designer-base/src/main/java/com/fr/design/unit/impl/INCHReportLengthUNIT.java @@ -1,6 +1,6 @@ package com.fr.design.unit.impl; -import com.fr.design.unit.impl.AbstractReportLengthUNIT; +import com.fr.design.fun.impl.AbstractReportLengthUNITProvider; import com.fr.stable.Constants; import com.fr.stable.unit.INCH; import com.fr.stable.unit.UNIT; @@ -8,7 +8,7 @@ import com.fr.stable.unit.UNIT; /** * Created by kerry on 2020-04-09 */ -public class INCHReportLengthUNIT extends AbstractReportLengthUNIT { +public class INCHReportLengthUNIT extends AbstractReportLengthUNITProvider { @Override public String unitText() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_INCH"); diff --git a/designer-base/src/main/java/com/fr/design/unit/impl/MMReportLengthUNIT.java b/designer-base/src/main/java/com/fr/design/unit/impl/MMReportLengthUNIT.java index e6f3523ec..a4bc2baca 100644 --- a/designer-base/src/main/java/com/fr/design/unit/impl/MMReportLengthUNIT.java +++ b/designer-base/src/main/java/com/fr/design/unit/impl/MMReportLengthUNIT.java @@ -1,6 +1,6 @@ package com.fr.design.unit.impl; -import com.fr.design.unit.impl.AbstractReportLengthUNIT; +import com.fr.design.fun.impl.AbstractReportLengthUNITProvider; import com.fr.stable.Constants; import com.fr.stable.unit.MM; import com.fr.stable.unit.UNIT; @@ -8,7 +8,7 @@ import com.fr.stable.unit.UNIT; /** * Created by kerry on 2020-04-09 */ -public class MMReportLengthUNIT extends AbstractReportLengthUNIT { +public class MMReportLengthUNIT extends AbstractReportLengthUNITProvider { @Override public String unitText() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM"); diff --git a/designer-base/src/main/java/com/fr/design/unit/impl/PTReportLengthUNIT.java b/designer-base/src/main/java/com/fr/design/unit/impl/PTReportLengthUNIT.java index 1ab5bbedf..9be7a8778 100644 --- a/designer-base/src/main/java/com/fr/design/unit/impl/PTReportLengthUNIT.java +++ b/designer-base/src/main/java/com/fr/design/unit/impl/PTReportLengthUNIT.java @@ -1,5 +1,6 @@ package com.fr.design.unit.impl; +import com.fr.design.fun.impl.AbstractReportLengthUNITProvider; import com.fr.stable.Constants; import com.fr.stable.unit.PT; import com.fr.stable.unit.UNIT; @@ -7,7 +8,7 @@ import com.fr.stable.unit.UNIT; /** * Created by kerry on 2020-04-09 */ -public class PTReportLengthUNIT extends AbstractReportLengthUNIT { +public class PTReportLengthUNIT extends AbstractReportLengthUNITProvider { @Override public String unitText() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_PT_Duplicate"); diff --git a/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java b/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java index b14d1945b..f7e86d2c0 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java @@ -4,13 +4,14 @@ package com.fr.design.actions.columnrow; import com.fr.design.DesignerEnvManager; +import com.fr.design.fun.ReportLengthUNITProvider; import com.fr.design.gui.frpane.UnitInputPane; import com.fr.design.gui.frpane.UnitInputPane.ValueNotChangeException; import com.fr.design.mainframe.DesignerContext; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.mainframe.ElementCasePane; -import com.fr.design.unit.ReportLengthUNIT; +import com.fr.design.fun.ReportLengthUNITProvider; import com.fr.design.unit.UnitConvertUtil; import com.fr.grid.selection.CellSelection; import com.fr.report.elementcase.ElementCase; @@ -49,7 +50,7 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction try { float newHeight = (float) uPane.update(); int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit(); - ReportLengthUNIT lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType); + ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType); UNIT len = lengthUNIT.float2UNIT(newHeight); updateAction(report, len, finalCS); } catch (ValueNotChangeException e) { @@ -64,7 +65,7 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction protected void populateNumberDialog(final UnitInputPane uPane, UNIT unit) { int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit(); - ReportLengthUNIT lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType); + ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType); float va = lengthUNIT.unit2Value4Scale(unit); uPane.setUnitText(lengthUNIT.unitText()); uPane.populate(va); diff --git a/designer-realize/src/main/java/com/fr/design/condition/WHPane.java b/designer-realize/src/main/java/com/fr/design/condition/WHPane.java index ed8eea854..7b4f636a6 100644 --- a/designer-realize/src/main/java/com/fr/design/condition/WHPane.java +++ b/designer-realize/src/main/java/com/fr/design/condition/WHPane.java @@ -3,7 +3,7 @@ package com.fr.design.condition; import com.fr.design.DesignerEnvManager; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UIBasicSpinner; -import com.fr.design.unit.ReportLengthUNIT; +import com.fr.design.fun.ReportLengthUNITProvider; import com.fr.design.unit.UnitConvertUtil; import com.fr.design.utils.gui.GUICoreUtils; @@ -47,7 +47,7 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane Date: Fri, 17 Apr 2020 09:40:18 +0800 Subject: [PATCH 236/375] =?UTF-8?q?REPORT-29882=208.0=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E5=8D=87=E7=BA=A710.0=E5=90=8E=EF=BC=8C=E6=A8=A1=E6=9D=BFweb?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=89=93=E4=B8=8D=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/style/background/BackgroundPane.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java b/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java index 66fa06c9e..593250ca8 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java @@ -118,6 +118,9 @@ public class BackgroundPane extends BasicPane { */ public void populate(Background background) { BackgroundUIWrapper wrapper = getBackgroundUIWrapper(background); + if (wrapper == null) { + return; + } int index = wrapper.getIndex(); BackgroundDetailPane quickPane = getTabItemPane(background, index); quickPane.populate(background); From bbc19821876d36fc943ca7d6be25fa8d05996874 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 17 Apr 2020 10:28:17 +0800 Subject: [PATCH 237/375] =?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 --- .../fr/design/fun/impl/AbstractReportLengthUNITProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportLengthUNITProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportLengthUNITProvider.java index b550b07c1..da77c947f 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportLengthUNITProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportLengthUNITProvider.java @@ -36,6 +36,7 @@ public abstract class AbstractReportLengthUNITProvider extends AbstractProvider @Override public UNIT float2UNIT(float value) { - return null; + return UNIT.ZERO; } } + From 434692b6801f997b5867ea5a9341c82bb95565c5 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 17 Apr 2020 10:54:24 +0800 Subject: [PATCH 238/375] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/FormAdaptiveConfigUIProcessor.java | 11 +++--- ...AbstractFormAdaptiveConfigUIProcessor.java | 17 +--------- .../fit/menupane/ReportFitAttrAction.java | 14 +------- .../java/com/fr/design/mainframe/JForm.java | 34 ++++++++++++------- 4 files changed, 30 insertions(+), 46 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/FormAdaptiveConfigUIProcessor.java b/designer-base/src/main/java/com/fr/design/fun/FormAdaptiveConfigUIProcessor.java index a91e202c9..1f2853b91 100644 --- a/designer-base/src/main/java/com/fr/design/fun/FormAdaptiveConfigUIProcessor.java +++ b/designer-base/src/main/java/com/fr/design/fun/FormAdaptiveConfigUIProcessor.java @@ -1,6 +1,7 @@ package com.fr.design.fun; -import com.fr.design.beans.BasicBeanPane; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.menu.ShortCut; import com.fr.stable.fun.mark.Immutable; import javax.swing.JComponent; @@ -14,14 +15,14 @@ import java.awt.image.BufferedImage; */ public interface FormAdaptiveConfigUIProcessor extends Immutable { - String MARK_STRING = "FormAdaptiveConfigUI"; + String MARK_STRING = "FormAdaptiveConfigUIProcessor"; int CURRENT_LEVEL = 1; /** - * 获取表单自适应配置界面 - * @return 表单自适应配置界面 + * 获取表单自适应配置菜单 + * @return 表单自适应配置菜单 */ - BasicBeanPane getConfigPane(); + ShortCut getConfigShortCut(JTemplate jTemplate); /** * 绘制自适应下报表块在表单界面中显示图片 diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormAdaptiveConfigUIProcessor.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormAdaptiveConfigUIProcessor.java index e57333987..1fc76077c 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormAdaptiveConfigUIProcessor.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormAdaptiveConfigUIProcessor.java @@ -1,20 +1,14 @@ package com.fr.design.fun.impl; -import com.fr.design.beans.BasicBeanPane; import com.fr.design.fun.FormAdaptiveConfigUIProcessor; -import com.fr.stable.fun.impl.AbstractProvider; import com.fr.stable.fun.mark.API; -import javax.swing.JComponent; -import java.awt.Dimension; -import java.awt.image.BufferedImage; - /** * Created by kerry on 2020-04-09 */ @API(level = FormAdaptiveConfigUIProcessor.CURRENT_LEVEL) -public abstract class AbstractFormAdaptiveConfigUIProcessor extends AbstractProvider implements FormAdaptiveConfigUIProcessor { +public abstract class AbstractFormAdaptiveConfigUIProcessor implements FormAdaptiveConfigUIProcessor { @Override public int currentAPILevel() { @@ -26,13 +20,4 @@ public abstract class AbstractFormAdaptiveConfigUIProcessor extends AbstractProv return DEFAULT_LAYER_INDEX; } - @Override - public BasicBeanPane getConfigPane() { - return null; - } - - @Override - public BufferedImage paintFormElementCaseImage(Dimension size, JComponent elementCasePane) { - return null; - } } diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java index bbf5106c3..c24125059 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java @@ -1,11 +1,9 @@ package com.fr.design.report.fit.menupane; -import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.JTemplateAction; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.UIDialog; -import com.fr.design.fun.FormAdaptiveConfigUIProcessor; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.MenuKeySet; @@ -44,10 +42,6 @@ public class ReportFitAttrAction extends JTemplateAction { @Override public String getMenuName() { - FormAdaptiveConfigUIProcessor configPane = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUIProcessor.MARK_STRING); - if (configPane != null) { - return configPane.getConfigPane().getTitle(); - } return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Elementcase"); } @@ -91,13 +85,7 @@ public class ReportFitAttrAction extends JTemplateAction { final TemplateFitAttrPane attrPane = new TemplateFitAttrPane(); showReportFitDialog(fitAttr, jwb, wbTpl, attrPane); } else { - BasicBeanPane attrPane = null; - FormAdaptiveConfigUIProcessor configPane = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUIProcessor.MARK_STRING); - if (configPane != null) { - attrPane = configPane.getConfigPane(); - }else{ - attrPane = new ReportFitAttrPane(); - } + final ReportFitAttrPane attrPane = new ReportFitAttrPane(); showReportFitDialog(fitAttr, jwb, wbTpl, attrPane); } } 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 e95a7962c..5502274bc 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 @@ -31,6 +31,7 @@ import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; +import com.fr.design.fun.FormAdaptiveConfigUIProcessor; import com.fr.design.fun.PreviewProvider; import com.fr.design.fun.PropertyItemPaneProvider; import com.fr.design.gui.frpane.HyperlinkGroupPane; @@ -129,20 +130,20 @@ public class JForm extends JTemplate implements BaseJForm implements BaseJForm providers = classManager.getArray(PropertyItemPaneProvider.XML_TAG); for (PropertyItemPaneProvider provider : providers) { addPane(provider); } } - + private void addPane(PropertyItemPaneProvider provider) { - + PaneHolder holder = provider.getPaneHolder(FormDesigner.class); if (holder != null) { JPanel panel = holder.getInstance(formDesign); EastRegionContainerPane.getInstance().replaceKeyPane(provider.key(), panel); } } - + @Override public void refreshEastPropertiesPane() { // 暂时用不到,遇到的时候再加刷新右侧tab面板的代码 @@ -561,12 +562,21 @@ public class JForm extends JTemplate implements BaseJForm implements BaseJForm Date: Fri, 17 Apr 2020 13:20:15 +0800 Subject: [PATCH 239/375] =?UTF-8?q?REPORT-29462=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E8=8F=9C=E5=8D=95=E6=A0=8F-=E6=A8=A1=E6=9D=BF-?= =?UTF-8?q?=E7=BA=B8=E5=BC=A0=E8=83=8C=E6=99=AF-=E6=B8=90=E5=8F=98?= =?UTF-8?q?=E8=89=B2=EF=BC=8C=E6=BB=91=E5=8A=A8=E5=8F=B3=E8=BE=B9=E6=B8=B8?= =?UTF-8?q?=E6=A0=87=EF=BC=8C=E7=A1=AE=E5=AE=9A=E5=90=8E=E5=86=8D=E6=AC=A1?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=EF=BC=8C=E4=BD=8D=E7=BD=AE=E5=9B=9E=E5=88=B0?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/style/background/gradient/GradientBar.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java index dcb381e81..efeffa4e4 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java @@ -244,6 +244,7 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab */ public void setStartValue(double startValue) { startLabel.setValue(startValue); + p1.setX(startValue); } /** @@ -251,6 +252,7 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab */ public void setEndValue(double endValue) { endLabel.setValue(endValue); + p2.setX(endValue); } /** From 7df8d3748619a7395bb95cfd1d6fd9e3cbcb9e92 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 17 Apr 2020 16:27:53 +0800 Subject: [PATCH 240/375] MOBILE-26174 && MOBILE-25651 --- .../fr/design/actions/FormMobileAttrAction.java | 4 ++-- .../actions/report/ReportMobileAttrAction.java | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java index b387cbc70..deec25c0b 100644 --- a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java @@ -82,13 +82,13 @@ public class FormMobileAttrAction extends JTemplateAction { if (changeSize) { ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); } - jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent()); //改变布局为自适应布局,只在移动端属性设置保存后改变一次 boolean changeLayout = !oldAdaptive && formMobileAttr.isAdaptivePropertyAutoMatch(); if (changeLayout) { + jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent()); doChangeBodyLayout(); + WidgetPropertyPane.getInstance().refreshDockingView(); } - WidgetPropertyPane.getInstance().refreshDockingView(); jf.fireTargetModified(); } }); diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java index a31108f2c..a002f56e8 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java @@ -1,5 +1,6 @@ package com.fr.design.actions.report; +import com.fr.base.PaperSize; import com.fr.base.iofile.attr.MobileOnlyTemplateAttrMark; import com.fr.design.actions.JWorkBookAction; import com.fr.design.dialog.BasicDialog; @@ -13,8 +14,10 @@ import com.fr.general.IOUtils; import com.fr.intelli.record.Focus; import com.fr.main.TemplateWorkBook; +import com.fr.page.PaperSettingProvider; import com.fr.record.analyzer.EnableMetrics; import com.fr.report.mobile.ElementCaseMobileAttr; +import com.fr.report.report.Report; import javax.swing.*; import java.awt.event.ActionEvent; @@ -51,6 +54,7 @@ public class ReportMobileAttrAction extends JWorkBookAction{ final ReportMobileAttrPane mobileAttrPane = new ReportMobileAttrPane(); mobileAttrPane.populateBean(mobileAttr); + final boolean oldMobileCanvasSize = mobileAttr.isMobileCanvasSize(); BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { @@ -69,7 +73,16 @@ public class ReportMobileAttrAction extends JWorkBookAction{ } recordFunction(); // 设置移动端属性并刷新界面 - wbTpl.setReportMobileAttr(elementCaseMobileAttr); // 会同时修改页面设置,放到最后 + wbTpl.setReportMobileAttr(elementCaseMobileAttr); + boolean change = !oldMobileCanvasSize && elementCaseMobileAttr.isMobileCanvasSize(); + if (change) { + // 当相关属性从未勾选到勾选状态时 设置成移动端标准页面大小 + for (int i = 0; i < wbTpl.getReportCount(); i++) { + Report report = wbTpl.getReport(i); + PaperSettingProvider paperSetting = report.getReportSettings().getPaperSetting(); + paperSetting.setPaperSize(PaperSize.PAPERSIZE_MOBILE); + } + } jwb.fireTargetModified(); } }); From 0a530fdd684101bf0054bb7e99f0ba64abba90aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 17 Apr 2020 17:14:07 +0800 Subject: [PATCH 241/375] =?UTF-8?q?CHART-13559=20=E5=A4=A7=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=8B=E5=8A=A8=E7=94=BB=E7=89=B9=E6=95=88=E5=92=8C?= =?UTF-8?q?=E9=AB=98=E4=BA=AE=E7=9A=84label=E4=B9=9F=E8=A6=81=E5=8F=98?= =?UTF-8?q?=E7=81=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../other/VanChartInteractivePane.java | 18 ++++++++++++++++-- .../designer/style/VanChartPlotLegendPane.java | 9 ++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java index f25cbe992..f402418d7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java @@ -14,6 +14,7 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.plugin.chart.attr.axis.VanChartAxis; @@ -60,6 +61,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { private UIComboBox largeDataMode; private UISpinner largeModeThresholdNumber; + protected UILabel chartAnimationLabel; protected UIButtonGroup isChartAnimation; //坐标轴翻转属性 @@ -371,7 +373,17 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { protected JPanel createAnimationPane() { isChartAnimation = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation_Effects"), isChartAnimation); + chartAnimationLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Animation_Effects")); + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double[] columnSize = {f, e}; + double[] rowSize = {p,p}; + Component[][] components = new Component[][]{ + new Component[]{null,null}, + new Component[]{chartAnimationLabel,isChartAnimation} + }; + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation"), panel); } @@ -499,7 +511,9 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { private void populateChartAnimate(Chart chart, Plot plot) { if (plot.isSupportAnimate()) { isChartAnimation.setSelectedIndex(chart.isJSDraw() ? 0 : 1); - isChartAnimation.setEnabled(!largeModel(plot)); + boolean largeModel = largeModel(plot); + isChartAnimation.setEnabled(!largeModel); + chartAnimationLabel.setEnabled(!largeModel); } } 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 4ab88f616..7e597bd5d 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 @@ -70,6 +70,7 @@ public class VanChartPlotLegendPane extends BasicPane { //private LimitPane limitPane; //高亮显示的按钮 + private UILabel highlightLabel; private UIButtonGroup highlightButton; private JPanel highlightPane; @@ -318,7 +319,7 @@ public class VanChartPlotLegendPane extends BasicPane { private JPanel createHighlightPane(){ highlightButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); - + highlightLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Highlight")); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; @@ -326,7 +327,7 @@ public class VanChartPlotLegendPane extends BasicPane { double[] rowSize = {p,p}; Component[][] components = new Component[][]{ new Component[]{null,null}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Highlight")),highlightButton} + new Component[]{highlightLabel, highlightButton} }; return TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); } @@ -429,7 +430,9 @@ public class VanChartPlotLegendPane extends BasicPane { //limitPane.populateBean(legend.getLimitAttribute()); if(highlightButton != null){ highlightButton.setSelectedItem(legend.isHighlight()); - highlightButton.setEnabled(!PlotFactory.largeDataModel(plot)); + boolean largeDataModel = PlotFactory.largeDataModel(plot); + highlightButton.setEnabled(!largeDataModel); + highlightLabel.setEnabled(!largeDataModel); } } From 6963b99daec0f7368a0ad859772f76f1fd95ad9f Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 17 Apr 2020 18:11:36 +0800 Subject: [PATCH 242/375] REPORT-29118 && REPORT-29117 --- .../os/impl/MacOsAddListenerAction.java | 67 ++++++++++++++----- .../com/fr/start/module/DesignerStartup.java | 8 +-- 2 files changed, 54 insertions(+), 21 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java index bc09dbf6a..f33527ccb 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java @@ -1,7 +1,10 @@ package com.fr.design.os.impl; +import com.fr.design.actions.help.AboutDialog; +import com.fr.design.actions.help.AboutPane; import com.fr.design.mainframe.DesignerContext; import com.fr.exit.DesignerExiter; +import com.fr.general.ComparatorUtils; import com.fr.invoke.Reflect; import com.fr.log.FineLoggerFactory; import com.fr.stable.os.support.OSBasedAction; @@ -21,25 +24,55 @@ public class MacOsAddListenerAction implements OSBasedAction { public void execute(final Object... objects) { try { Class app = Class.forName("com.apple.eawt.Application"); - Class handler = Class.forName("com.apple.eawt.QuitHandler"); - Object instance = Proxy.newProxyInstance(handler.getClassLoader(), new Class[]{handler}, - new InvocationHandler() { - @Override - public Object invoke(Object proxy, Method method, - Object[] args) throws Throwable { - if ("handleQuitRequestWith".equals(method.getName())) { - if (DesignerContext.getDesignerFrame() != null && DesignerContext.getDesignerFrame().isShowing()) { - DesignerContext.getDesignerFrame().exit(); - } else { - DesignerExiter.getInstance().execute(); - } - } - return null; - } - }); - Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", instance); + Class quitHandler = Class.forName("com.apple.eawt.QuitHandler"); + Object quitInstance = getProxy(quitHandler, "handleQuitRequestWith", new QuitAction()); + Class aboutHandler = Class.forName("com.apple.eawt.AboutHandler"); + Object aboutInstance = getProxy(aboutHandler, "", new AboutAction()); + Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", quitInstance) + .call("setAboutHandler", aboutInstance); } catch (ClassNotFoundException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } + + + private Object getProxy(Class clazz, final String methodName, final Action action) { + return Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz}, + new InvocationHandler() { + @Override + public Object invoke(Object proxy, Method method, + Object[] args) throws Throwable { + if (ComparatorUtils.equals(methodName, method.getName())) { + action.execute(); + } + return null; + } + }); + } + + interface Action { + void execute(); + } + + private class QuitAction implements Action { + + @Override + public void execute() { + if (DesignerContext.getDesignerFrame() != null && DesignerContext.getDesignerFrame().isShowing()) { + DesignerContext.getDesignerFrame().exit(); + } else { + DesignerExiter.getInstance().execute(); + } + } + } + + private class AboutAction implements Action { + + @Override + public void execute() { + AboutPane aboutPane = new AboutPane(); + AboutDialog aboutDialog = new AboutDialog(DesignerContext.getDesignerFrame(), aboutPane); + aboutDialog.setVisible(true); + } + } } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java index 60de86543..56af5583f 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java @@ -16,11 +16,11 @@ import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignerPort; import com.fr.exit.DesignerExiter; import com.fr.general.ComparatorUtils; -import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.module.Activator; import com.fr.record.analyzer.EnableMetrics; import com.fr.record.analyzer.Metrics; +import com.fr.stable.ArrayUtils; import com.fr.stable.BuildContext; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; @@ -35,8 +35,6 @@ import com.fr.start.server.FineEmbedServer; import com.fr.value.NotNullLazyValue; import org.jetbrains.annotations.NotNull; -import javax.swing.JFrame; -import javax.swing.JOptionPane; import java.io.File; import java.util.concurrent.ExecutorService; @@ -71,7 +69,9 @@ public class DesignerStartup extends Activator { if (DesignUtils.isStarted()) { // 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了 final String[] args = startupArgsValue.getValue().get(); - DesignUtils.clientSend(args); + if (ArrayUtils.isNotEmpty(args)) { + DesignUtils.clientSend(args); + } FineLoggerFactory.getLogger().info("The Designer Has Been Started"); if (args.length == 0) { TipDialog dialog = new TipDialog(null, From 8c88dc76c08eed102b14ae907439d6ee2313847d Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 17 Apr 2020 20:29:50 +0800 Subject: [PATCH 243/375] MOBILE-26198 && MOBILE-26189 --- .../design/mainframe/WidgetPropertyPane.java | 3 +- .../mobile/MobileAdvanceDefinePane.java | 137 +------------- .../mobile/TabMobileWidgetDefinePane.java | 15 +- .../component/MobileAdvanceInnerPane.java | 169 ++++++++++++++++++ .../component/MobileComponentFrozenPane.java | 19 ++ 5 files changed, 209 insertions(+), 134 deletions(-) create mode 100644 designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileAdvanceInnerPane.java diff --git a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java index f7668b30a..93533b772 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java @@ -6,6 +6,7 @@ import com.fr.design.constants.UIConstants; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.*; +import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.designer.properties.EventPropertyTable; import com.fr.design.designer.properties.mobile.MobileBookMarkPropertyUI; import com.fr.design.designer.properties.mobile.MobileStylePropertyUI; @@ -179,7 +180,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper if (selection != null && xCreator != null) { embeddedPropertyUIProviders = selection.getSelectedCreator().getWidgetPropertyUIProviders(); if(!designer.getDesignerMode().isFormParameterEditor()) { - if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class) && FormDesignerUtils.isAppRelayout(designer)) { + if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class, XWCardTagLayout.class) && FormDesignerUtils.isAppRelayout(designer)) { embeddedPropertyUIProviders = ArrayUtils.insert(0, embeddedPropertyUIProviders, new MobileBookMarkPropertyUI(xCreator)); } if (xCreator.supportMobileStyle()) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java index 34f6a7adf..542641c24 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java @@ -1,40 +1,14 @@ package com.fr.design.widget.ui.designer.mobile; -import com.fr.design.constants.LayoutConstants; -import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.creator.XCreator; -import com.fr.design.dialog.FineJOptionPane; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.WidgetPropertyPane; -import com.fr.form.main.Form; -import com.fr.form.ui.FormWidgetHelper; -import com.fr.form.ui.Widget; -import com.fr.form.ui.container.WLayout; -import com.fr.form.ui.container.WSortLayout; -import com.fr.form.ui.mobile.MobileBookMark; -import com.fr.form.ui.widget.CRBoundsWidget; -import com.fr.general.ComparatorUtils; -import com.fr.general.IOUtils; -import com.fr.stable.StringUtils; +import com.fr.design.widget.ui.designer.mobile.component.MobileAdvanceInnerPane; import javax.swing.*; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; import java.awt.*; -import java.awt.event.FocusAdapter; -import java.awt.event.FocusEvent; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.util.Iterator; -import java.util.List; /** * @author hades @@ -44,8 +18,7 @@ import java.util.List; public class MobileAdvanceDefinePane extends MobileWidgetDefinePane { private XCreator xCreator; - private UICheckBox useBookMarkCheck; - private UITextField bookMarkNameField; + private MobileAdvanceInnerPane innerPane; public MobileAdvanceDefinePane(XCreator xCreator) { this.xCreator = xCreator; @@ -54,71 +27,13 @@ public class MobileAdvanceDefinePane extends MobileWidgetDefinePane { @Override public void initPropertyGroups(Object source) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - this.useBookMarkCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Use_BookMark"), false); - this.bookMarkNameField = new UITextField() { - @Override - protected void initListener() { - if (shouldResponseChangeListener()) { - addFocusListener(new FocusAdapter() { - @Override - public void focusLost(FocusEvent e) { - attributeChange(); - } - }); - addKeyListener(new KeyAdapter() { - @Override - public void keyTyped(KeyEvent e) { - if (e.getKeyCode() == KeyEvent.VK_ENTER) { - attributeChange(); - } - } - }); - } - } - }; - JPanel useBookMarkPane = TableLayoutHelper.createGapTableLayoutPane( - new Component[][]{new Component[]{useBookMarkCheck}}, - TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.HGAP_LARGE); - final JPanel bookMarkNamePane = TableLayoutHelper.createGapTableLayoutPane( - new Component[][]{new Component[]{new UILabel( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark_Name")), bookMarkNameField}}, - TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.HGAP_LARGE); - this.useBookMarkCheck.addChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - boolean selected = MobileAdvanceDefinePane.this.useBookMarkCheck.isSelected(); - Widget widget = MobileAdvanceDefinePane.this.xCreator.toData(); - MobileBookMark bookMark = widget.getMobileBookMark(); - bookMarkNamePane.setVisible(selected); - if (selected && StringUtils.isEmpty(bookMark.getBookMarkName())) { - String name = widget.getWidgetName(); - MobileAdvanceDefinePane.this.bookMarkNameField.setText(name); - bookMark.setBookMarkName(name); - } - } - }); - bookMarkNamePane.setVisible(xCreator.toData().getMobileBookMark().isUseBookMark()); - contentPane.add(useBookMarkPane, BorderLayout.NORTH); - contentPane.add(bookMarkNamePane, BorderLayout.CENTER); - UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark"), 280, 20, contentPane); + this.innerPane = new MobileAdvanceInnerPane(xCreator); + UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark"), 280, 20, innerPane); JPanel wrapPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); wrapPane.add(uiExpandablePane, BorderLayout.NORTH); this.add(wrapPane, BorderLayout.NORTH); - initData(); } - private void initData() { - MobileBookMark bookMark = xCreator.toData().getMobileBookMark(); - String bookMarkName = bookMark.getBookMarkName(); - if (StringUtils.isEmpty(bookMarkName)) { - String widgetName = xCreator.toData().getWidgetName(); - this.bookMarkNameField.setText(widgetName); - bookMark.setBookMarkName(widgetName); - } else { - this.bookMarkNameField.setText(bookMarkName); - } - } private void bindListeners2Widgets() { reInitAllListeners(); @@ -147,53 +62,13 @@ public class MobileAdvanceDefinePane extends MobileWidgetDefinePane { @Override public void populate(FormDesigner designer) { - MobileBookMark bookMark = xCreator.toData().getMobileBookMark(); - this.bookMarkNameField.setText(bookMark.getBookMarkName()); - if (bookMark.isFrozen()) { - this.useBookMarkCheck.setSelected(false); - this.useBookMarkCheck.setEnabled(false); - } else { - this.useBookMarkCheck.setSelected(bookMark.isUseBookMark()); - } + this.innerPane.populate(); this.bindListeners2Widgets(); } @Override public void update() { - MobileBookMark bookMark = xCreator.toData().getMobileBookMark(); - bookMark.setUseBookMark(this.useBookMarkCheck.isSelected()); - String newBookMarkName = this.bookMarkNameField.getText(); - DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); - if (ComparatorUtils.equals(newBookMarkName, bookMark.getBookMarkName())) { - return; - } - if (!isExist(newBookMarkName)) { - bookMark.setBookMarkName(newBookMarkName); - } else { - FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark_Rename_Failure"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"), - JOptionPane.ERROR_MESSAGE, IOUtils.readIcon("com/fr/design/form/images/joption_failure.png")); - this.bookMarkNameField.setText(bookMark.getBookMarkName()); - } - } - - private boolean isExist(String name) { - Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget(); - WLayout container = form.getContainer(); - WSortLayout wSortLayout = (WSortLayout) container.getWidget(container.getWidgetCount() - 1); - List list = wSortLayout.getOrderedMobileWidgetList(); - for (String value : list) { - Widget widget = form.getWidgetByName(value); - if (widget != null && ComparatorUtils.equals(widget.getMobileBookMark().getBookMarkName(), name)) { - return true; - } - CRBoundsWidget boundsWidget = (CRBoundsWidget) wSortLayout.getWidget(value); - if (boundsWidget != null && ComparatorUtils.equals(boundsWidget.getWidget().getMobileBookMark().getBookMarkName(), name)) { - return true; - } - } - return false; + this.innerPane.update(); } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java index 3f3d34eaf..d4f1c0a11 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java @@ -15,6 +15,7 @@ import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.widget.accessibles.AccessibleTemplateStyleEditor; import com.fr.design.mainframe.widget.accessibles.MobileTemplateStylePane; +import com.fr.design.widget.ui.designer.mobile.component.MobileAdvanceInnerPane; import com.fr.design.widget.ui.designer.mobile.component.MobileBookMarkUsePane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentMarginPane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentLayoutIntervalPane; @@ -33,6 +34,7 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { private MobileComponentMarginPane marginPane; private MobileComponentLayoutIntervalPane intervalPane; private MobileBookMarkUsePane mobileBookMarkUsePane; + private MobileAdvanceInnerPane mobileAdvanceInnerPane; public TabMobileWidgetDefinePane(XCreator xCreator) { this.xCreator = xCreator; @@ -70,9 +72,12 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { intervalPane = new MobileComponentLayoutIntervalPane(FormTabPaddingAttrMark.XML_TAG); if (FormDesignerUtils.isAppRelayout(designer)) { mobileBookMarkUsePane = new MobileBookMarkUsePane(); - innerAdvancePane.add(mobileBookMarkUsePane, BorderLayout.SOUTH); + mobileAdvanceInnerPane = new MobileAdvanceInnerPane(xCreator); + innerAdvancePane.add(mobileBookMarkUsePane, BorderLayout.CENTER); + innerAdvancePane.add(mobileAdvanceInnerPane, BorderLayout.SOUTH); + } - innerAdvancePane.add(marginPane, BorderLayout.CENTER); + innerAdvancePane.add(marginPane, BorderLayout.NORTH); UIExpandablePane advancePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, innerAdvancePane); UIExpandablePane layoutPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"), 280, 20, intervalPane); //高级 @@ -100,6 +105,9 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { if (mobileBookMarkUsePane != null) { mobileBookMarkUsePane.populate(xCreator); } + if (mobileAdvanceInnerPane != null) { + mobileAdvanceInnerPane.populate(); + } } @Override @@ -116,5 +124,8 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { if (mobileBookMarkUsePane != null) { mobileBookMarkUsePane.update(xCreator); } + if (mobileAdvanceInnerPane != null) { + this.mobileAdvanceInnerPane.update(); + } } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileAdvanceInnerPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileAdvanceInnerPane.java new file mode 100644 index 000000000..33a957479 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileAdvanceInnerPane.java @@ -0,0 +1,169 @@ +package com.fr.design.widget.ui.designer.mobile.component; + +import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.form.main.Form; +import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WLayout; +import com.fr.form.ui.container.WSortLayout; +import com.fr.form.ui.mobile.MobileBookMark; +import com.fr.form.ui.widget.CRBoundsWidget; +import com.fr.general.ComparatorUtils; +import com.fr.general.IOUtils; +import com.fr.stable.StringUtils; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.*; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.util.List; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/4/17 + */ +public class MobileAdvanceInnerPane extends BasicPane { + + private XCreator xCreator; + private UICheckBox useBookMarkCheck; + private UITextField bookMarkNameField; + + + public MobileAdvanceInnerPane(XCreator xCreator) { + this.xCreator = xCreator; + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + initComponent(); + } + + private void initComponent() { + JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + this.useBookMarkCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Use_BookMark"), false); + this.bookMarkNameField = new UITextField() { + @Override + protected void initListener() { + if (shouldResponseChangeListener()) { + addFocusListener(new FocusAdapter() { + @Override + public void focusLost(FocusEvent e) { + attributeChange(); + } + }); + addKeyListener(new KeyAdapter() { + @Override + public void keyTyped(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_ENTER) { + attributeChange(); + } + } + }); + } + } + }; + JPanel useBookMarkPane = TableLayoutHelper.createGapTableLayoutPane( + new Component[][]{new Component[]{useBookMarkCheck}}, + TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.HGAP_LARGE); + final JPanel bookMarkNamePane = TableLayoutHelper.createGapTableLayoutPane( + new Component[][]{new Component[]{new UILabel( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark_Name")), bookMarkNameField}}, + TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.HGAP_LARGE); + this.useBookMarkCheck.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + boolean selected = MobileAdvanceInnerPane.this.useBookMarkCheck.isSelected(); + Widget widget = MobileAdvanceInnerPane.this.xCreator.toData(); + MobileBookMark bookMark = widget.getMobileBookMark(); + bookMarkNamePane.setVisible(selected); + if (selected && StringUtils.isEmpty(bookMark.getBookMarkName())) { + String name = widget.getWidgetName(); + MobileAdvanceInnerPane.this.bookMarkNameField.setText(name); + bookMark.setBookMarkName(name); + } + } + }); + bookMarkNamePane.setVisible(xCreator.toData().getMobileBookMark().isUseBookMark()); + contentPane.add(useBookMarkPane, BorderLayout.NORTH); + contentPane.add(bookMarkNamePane, BorderLayout.CENTER); + this.add(contentPane); + initData(); + } + + private void initData() { + MobileBookMark bookMark = xCreator.toData().getMobileBookMark(); + String bookMarkName = bookMark.getBookMarkName(); + if (StringUtils.isEmpty(bookMarkName)) { + String widgetName = xCreator.toData().getWidgetName(); + this.bookMarkNameField.setText(widgetName); + bookMark.setBookMarkName(widgetName); + } else { + this.bookMarkNameField.setText(bookMarkName); + } + } + + public void populate() { + MobileBookMark bookMark = xCreator.toData().getMobileBookMark(); + this.bookMarkNameField.setText(bookMark.getBookMarkName()); + if (bookMark.isFrozen()) { + this.useBookMarkCheck.setSelected(false); + this.useBookMarkCheck.setEnabled(false); + } else { + this.useBookMarkCheck.setSelected(bookMark.isUseBookMark()); + } + } + + public void update() { + MobileBookMark bookMark = xCreator.toData().getMobileBookMark(); + bookMark.setUseBookMark(this.useBookMarkCheck.isSelected()); + String newBookMarkName = this.bookMarkNameField.getText(); + DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); + if (ComparatorUtils.equals(newBookMarkName, bookMark.getBookMarkName())) { + return; + } + if (!isExist(newBookMarkName)) { + bookMark.setBookMarkName(newBookMarkName); + } else { + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark_Rename_Failure"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"), + JOptionPane.ERROR_MESSAGE, IOUtils.readIcon("com/fr/design/form/images/joption_failure.png")); + this.bookMarkNameField.setText(bookMark.getBookMarkName()); + } + } + + private boolean isExist(String name) { + Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget(); + WLayout container = form.getContainer(); + WSortLayout wSortLayout = (WSortLayout) container.getWidget(container.getWidgetCount() - 1); + List list = wSortLayout.getOrderedMobileWidgetList(); + for (String value : list) { + Widget widget = form.getWidgetByName(value); + if (widget != null && ComparatorUtils.equals(widget.getMobileBookMark().getBookMarkName(), name)) { + return true; + } + CRBoundsWidget boundsWidget = (CRBoundsWidget) wSortLayout.getWidget(value); + if (boundsWidget != null && ComparatorUtils.equals(boundsWidget.getWidget().getMobileBookMark().getBookMarkName(), name)) { + return true; + } + } + return false; + } + + @Override + protected String title4PopupWindow() { + return "MobileAdvanceInnerPane"; + } +} diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java index 249265097..06e1c39d3 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java @@ -11,9 +11,12 @@ import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; +import com.fr.form.main.Form; import com.fr.form.ui.FormWidgetHelper; import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WSortLayout; +import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.stable.ArrayUtils; import javax.swing.BorderFactory; @@ -97,6 +100,22 @@ public class MobileComponentFrozenPane extends BasicPane { map.put(value, false); } uiComboCheckBox.setSelectedValues(map); + if (ArrayUtils.isEmpty(uiComboCheckBox.getSelectedValues()) || !uiComboCheckBox.isEnabled()) { + uiComboCheckBox.setEnabled(!shouldFrozen()); + } + } + + private boolean shouldFrozen() { + Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget(); + WLayout container = form.getContainer(); + WSortLayout wSortLayout = (WSortLayout) container.getWidget(container.getWidgetCount() - 1); + boolean frozen = false; + List list = wSortLayout.getOrderedMobileWidgetList(); + for (String value : list) { + CRBoundsWidget boundsWidget = (CRBoundsWidget) wSortLayout.getWidget(value); + frozen = frozen || boundsWidget.getWidget().getMobileBookMark().isUseBookMark(); + } + return frozen; } @Override From caeeffcf674e3be80b2a2a69e433424c83f15f71 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 17 Apr 2020 20:38:28 +0800 Subject: [PATCH 244/375] =?UTF-8?q?fix=20=E6=BC=8F=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/icombocheckbox/UIComboCheckBox.java | 8 ++++++++ .../com/fr/design/os/impl/MacOsAddListenerAction.java | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java index e2a5719d4..0652f9cf8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java @@ -360,6 +360,14 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam popup.setSelectedValue(map); } + @Override + public void setEnabled(boolean enabled) { + super.setEnabled(enabled); + this.popup.setEnabled(enabled); + this.editor.setEnabled(enabled); + this.arrowButton.setEnabled(enabled); + } + /** * 简单的测试demo * @param args diff --git a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java index f33527ccb..1ff796a1d 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java @@ -27,7 +27,7 @@ public class MacOsAddListenerAction implements OSBasedAction { Class quitHandler = Class.forName("com.apple.eawt.QuitHandler"); Object quitInstance = getProxy(quitHandler, "handleQuitRequestWith", new QuitAction()); Class aboutHandler = Class.forName("com.apple.eawt.AboutHandler"); - Object aboutInstance = getProxy(aboutHandler, "", new AboutAction()); + Object aboutInstance = getProxy(aboutHandler, "handleAbout", new AboutAction()); Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", quitInstance) .call("setAboutHandler", aboutInstance); } catch (ClassNotFoundException e) { From fddd95418ed168948795da459a02c03626ddd7de Mon Sep 17 00:00:00 2001 From: hades Date: Sat, 18 Apr 2020 13:43:02 +0800 Subject: [PATCH 245/375] =?UTF-8?q?MOBILE-26198=20&&=20MOBILE-26189=20?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cardlayout/XWCardMainBorderLayout.java | 4 +- .../MobileBookMarkCombinePropertyUI.java | 36 ++++++++++ .../design/mainframe/WidgetPropertyPane.java | 3 +- .../mobile/MobileBookMarkCombinePane.java | 69 +++++++++++++++++++ .../component/MobileComponentFrozenPane.java | 16 ++--- 5 files changed, 117 insertions(+), 11 deletions(-) create mode 100644 designer-form/src/main/java/com/fr/design/designer/properties/mobile/MobileBookMarkCombinePropertyUI.java create mode 100644 designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileBookMarkCombinePane.java diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java index c51fe491e..682b92e69 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java @@ -16,7 +16,7 @@ import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWBorderLayout; import com.fr.design.designer.creator.XWidgetCreator; -import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI; +import com.fr.design.designer.properties.mobile.MobileBookMarkCombinePropertyUI; import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.WidgetPropertyUIProvider; @@ -518,7 +518,7 @@ public class XWCardMainBorderLayout extends XWBorderLayout { @Override public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { if (FormDesignerUtils.isAppRelayout(WidgetPropertyPane.getInstance().getEditingFormDesigner())) { - return new WidgetPropertyUIProvider[] {new MobileBooKMarkUsePropertyUI(this)}; + return new WidgetPropertyUIProvider[] {new MobileBookMarkCombinePropertyUI(this)}; } else { return super.getWidgetPropertyUIProviders(); } diff --git a/designer-form/src/main/java/com/fr/design/designer/properties/mobile/MobileBookMarkCombinePropertyUI.java b/designer-form/src/main/java/com/fr/design/designer/properties/mobile/MobileBookMarkCombinePropertyUI.java new file mode 100644 index 000000000..29bc2fb9a --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/properties/mobile/MobileBookMarkCombinePropertyUI.java @@ -0,0 +1,36 @@ +package com.fr.design.designer.properties.mobile; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.dialog.BasicPane; +import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider; +import com.fr.design.gui.itable.AbstractPropertyTable; +import com.fr.design.widget.ui.designer.mobile.MobileBookMarkCombinePane; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/4/18 + */ +public class MobileBookMarkCombinePropertyUI extends AbstractWidgetPropertyUIProvider { + + private XCreator xCreator; + + public MobileBookMarkCombinePropertyUI(XCreator xCreator) { + this.xCreator = xCreator; + } + + @Override + public AbstractPropertyTable createWidgetAttrTable() { + return null; + } + + @Override + public BasicPane createWidgetAttrPane() { + return new MobileBookMarkCombinePane(xCreator); + } + + @Override + public String tableTitle() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr"); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java index 93533b772..7fb6f2014 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java @@ -6,6 +6,7 @@ import com.fr.design.constants.UIConstants; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.*; +import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.designer.properties.EventPropertyTable; import com.fr.design.designer.properties.mobile.MobileBookMarkPropertyUI; @@ -180,7 +181,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper if (selection != null && xCreator != null) { embeddedPropertyUIProviders = selection.getSelectedCreator().getWidgetPropertyUIProviders(); if(!designer.getDesignerMode().isFormParameterEditor()) { - if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class, XWCardTagLayout.class) && FormDesignerUtils.isAppRelayout(designer)) { + if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class, XWCardTagLayout.class, XWCardMainBorderLayout.class) && FormDesignerUtils.isAppRelayout(designer)) { embeddedPropertyUIProviders = ArrayUtils.insert(0, embeddedPropertyUIProviders, new MobileBookMarkPropertyUI(xCreator)); } if (xCreator.supportMobileStyle()) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileBookMarkCombinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileBookMarkCombinePane.java new file mode 100644 index 000000000..cd4602601 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileBookMarkCombinePane.java @@ -0,0 +1,69 @@ +package com.fr.design.widget.ui.designer.mobile; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.widget.ui.designer.mobile.component.MobileAdvanceInnerPane; +import com.fr.design.widget.ui.designer.mobile.component.MobileBookMarkUsePane; + +import javax.swing.*; +import java.awt.*; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/4/18 + */ +public class MobileBookMarkCombinePane extends MobileWidgetDefinePane { + + private MobileBookMarkUsePane mobileBookMarkUsePane; + private MobileAdvanceInnerPane mobileAdvanceInnerPane; + private XCreator xCreator; + + + public MobileBookMarkCombinePane(XCreator xCreator) { + this.xCreator = xCreator; + } + + @Override + public void initPropertyGroups(Object source) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + this.mobileAdvanceInnerPane = new MobileAdvanceInnerPane(xCreator); + this.mobileBookMarkUsePane = new MobileBookMarkUsePane(); + panel.add(this.mobileBookMarkUsePane, BorderLayout.NORTH); + panel.add(this.mobileAdvanceInnerPane, BorderLayout.CENTER); + UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, panel); + this.add(uiExpandablePane, BorderLayout.NORTH); + } + + private void bindListeners2Widgets() { + reInitAllListeners(); + AttributeChangeListener changeListener = new AttributeChangeListener() { + @Override + public void attributeChange() { + update(); + } + }; + this.addAttributeChangeListener(changeListener); + } + + private void reInitAllListeners() { + initListener(this); + } + + @Override + public void populate(FormDesigner designer) { + this.mobileBookMarkUsePane.populate(xCreator); + this.mobileAdvanceInnerPane.populate(); + this.bindListeners2Widgets(); + } + + @Override + public void update() { + this.mobileBookMarkUsePane.update(xCreator); + this.mobileAdvanceInnerPane.update(); + } +} diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java index 06e1c39d3..de86a07f2 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java @@ -61,6 +61,7 @@ public class MobileComponentFrozenPane extends BasicPane { } List widgetList = ((WSortLayout) selectedModel).getNonContainerWidgetList(); + widgetList.removeAll(frozenWidgets()); return widgetList.toArray(new String[0]); } @@ -100,22 +101,21 @@ public class MobileComponentFrozenPane extends BasicPane { map.put(value, false); } uiComboCheckBox.setSelectedValues(map); - if (ArrayUtils.isEmpty(uiComboCheckBox.getSelectedValues()) || !uiComboCheckBox.isEnabled()) { - uiComboCheckBox.setEnabled(!shouldFrozen()); - } } - private boolean shouldFrozen() { + private List frozenWidgets() { Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget(); WLayout container = form.getContainer(); WSortLayout wSortLayout = (WSortLayout) container.getWidget(container.getWidgetCount() - 1); - boolean frozen = false; - List list = wSortLayout.getOrderedMobileWidgetList(); + List list = wSortLayout.getNonContainerWidgetList(); + List widgets = new ArrayList<>(); for (String value : list) { CRBoundsWidget boundsWidget = (CRBoundsWidget) wSortLayout.getWidget(value); - frozen = frozen || boundsWidget.getWidget().getMobileBookMark().isUseBookMark(); + if (boundsWidget.getWidget().getMobileBookMark().isUseBookMark()) { + widgets.add(value); + } } - return frozen; + return widgets; } @Override From 9a0471d7aa241f628718e6dd7d347ac8641b0e98 Mon Sep 17 00:00:00 2001 From: hades Date: Sat, 18 Apr 2020 22:03:10 +0800 Subject: [PATCH 246/375] =?UTF-8?q?=20MOBILE-26189=20=E5=92=8C=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E7=90=86=E8=A7=A3=E6=9C=89=E5=87=BA=E5=85=A5=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/cardlayout/XWCardMainBorderLayout.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java index 682b92e69..c539f7044 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java @@ -16,7 +16,7 @@ import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWBorderLayout; import com.fr.design.designer.creator.XWidgetCreator; -import com.fr.design.designer.properties.mobile.MobileBookMarkCombinePropertyUI; +import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI; import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.WidgetPropertyUIProvider; @@ -518,7 +518,7 @@ public class XWCardMainBorderLayout extends XWBorderLayout { @Override public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { if (FormDesignerUtils.isAppRelayout(WidgetPropertyPane.getInstance().getEditingFormDesigner())) { - return new WidgetPropertyUIProvider[] {new MobileBookMarkCombinePropertyUI(this)}; + return new WidgetPropertyUIProvider[] {new MobileBooKMarkUsePropertyUI(this)}; } else { return super.getWidgetPropertyUIProviders(); } From 2df36513fb1344e150532dbb2fc90434ba8d9d6c Mon Sep 17 00:00:00 2001 From: hades Date: Sat, 18 Apr 2020 22:18:58 +0800 Subject: [PATCH 247/375] =?UTF-8?q?MOBILE-26189=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/cardlayout/XWCardMainBorderLayout.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java index 682b92e69..c51fe491e 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java @@ -16,7 +16,7 @@ import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWBorderLayout; import com.fr.design.designer.creator.XWidgetCreator; -import com.fr.design.designer.properties.mobile.MobileBookMarkCombinePropertyUI; +import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI; import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.WidgetPropertyUIProvider; @@ -518,7 +518,7 @@ public class XWCardMainBorderLayout extends XWBorderLayout { @Override public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { if (FormDesignerUtils.isAppRelayout(WidgetPropertyPane.getInstance().getEditingFormDesigner())) { - return new WidgetPropertyUIProvider[] {new MobileBookMarkCombinePropertyUI(this)}; + return new WidgetPropertyUIProvider[] {new MobileBooKMarkUsePropertyUI(this)}; } else { return super.getWidgetPropertyUIProviders(); } From 39a5781cae243738f10101a0cfc1421b26b3daae Mon Sep 17 00:00:00 2001 From: Tomorrow Date: Mon, 20 Apr 2020 10:43:37 +0800 Subject: [PATCH 248/375] =?UTF-8?q?CHART-13531:=20=E6=9B=B4=E6=8D=A2?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E7=9B=98=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E4=B8=AD=E7=9A=84=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/van/chart/gauge/images/cuvette.png | Bin 706 -> 574 bytes .../com/fr/van/chart/gauge/images/pointer.png | Bin 1495 -> 1581 bytes .../fr/van/chart/gauge/images/pointer_180.png | Bin 1078 -> 1164 bytes .../com/fr/van/chart/gauge/images/ring.png | Bin 1638 -> 1223 bytes .../com/fr/van/chart/gauge/images/slot.png | Bin 1484 -> 1113 bytes 5 files changed, 0 insertions(+), 0 deletions(-) diff --git a/designer-chart/src/main/resources/com/fr/van/chart/gauge/images/cuvette.png b/designer-chart/src/main/resources/com/fr/van/chart/gauge/images/cuvette.png index 5f68049e8b2258d16875a806d02f5697fbff22e9..39f034740e050c304fb21313a81f0f93d0ce370a 100644 GIT binary patch delta 541 zcmV+&0^B2$?rD-o$Rotpg>*LJ1;QgF4Siey1=XxX=Zce{rLYtcB#_XhnM0=#o7{Or zPV$Vj^7;49?0z@1qm|c+qF@#59xGxF>YxtlpbqMw4(gx|>VKgBvJgTqgwSic;9dFO zZ?M)2`}|Z2)9JJa(Cu~?YV-VS#<VMbs-@N*G@uzef+L1RSzw0`vgDx}?>4-?@s&?JH{{=jDWsL zk5qLgBFDf!FayS_Iu?-;uxs-Ms+x<)36QI5)^^a(Kn`R8sv1OOA2;1XTY|q&f0LPp9k3o68ow^5RpMen^dMJmff;+XMYAf28I@E5;Ln3>Z|h zH_tLF=iEjL1oO!%!0pPYZ4%q?q>`z!4Ey#QKv2~jcw^OYX3yoz%CEe<)}7IzWuya~ zs_LHUe>J0u&n_@h)$Iy&VohlfZF5CYL?3CIc5b58@n3fMUDrV!)IlB8K^@dV9n?V` f)IlAzRTg#$jL}@tl(kcu00000NkvXXu0mjfZQTc= delta 674 zcmV;T0$u&S1i}T7EPoRK01FcV0GgZ_0000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+ zQe|Oed2z{QJOBU!Pf0{URCwC#n9oZBK@`Vl&0PC|+7G%#p%4fi0zG&Lx@2_hQgp0K ze?gFWiw-ID57eoyb?FjBd5NwrbjlzUx^&762@DGDz2z+|rhn$HySCsPc+BkA`SCvU z-VB3MtyUAgP+X!%3WG8zgEAh;gA(`@EJ7|(Tff=qq>oKTNbI?|1d0_3`V7XcqUr>iez3O-V?Ndw-ev8e?4`Yr?(m^a1OIn_~FtKa> z^l{!T4+zhY-!y3P^+km|T%J;jfm(V-!SM)GDX>M7Mzh&$3G^dqZ-JG-(x9b5!+xvOFAiD(v@>WIpq+3! zXdWE}Qym3|70?h6LD#@=BX+PW{!AKvXTZ+EZt&5Bo8yE>eKSamVvs%&0wLo%Eu-rm zr08m?TYn&WAc}6v-(Yd%Tdd*6L(z!r}{S_LM&;dIuqU59?hcmiJX=%7f zzo~ukOhSE3*>FQ`ZLo9DPQxN^#4aLr|+N z5{ZnoqZt|Bsqqt#K^c@m8I(a8ltCGkK^c@m85`757fa5Xb+!jz88W!7(A< z6seHZl(wg;T&T!}3x^_ulEh;oUepJ+O&l?0jH5CJ2x8q3Z-4f;nwd9mo*5#-hafCI z5UGLIKx?2i&>CnprEWhbXBfr-zz)D_>e~8Y4FEX+YXCGN%Dz{i48yPhTmW46?%n(R z?Af#5dOV&_Z8qB%b#-+O8{=}hoT%%1B%MxAPfSew$}r3m05SlXh>VJp5>dsP3D`P0 zIeCNU`M9QOlz+?R^4j$DbiqAM(}?H!_~hi|4FIhGT$Ow;B0{AASpZGJV6d0x`M9p@ zr0Y6KlC&pKMNvr8G}3jQc%F|3gTY<^O#s*f18PDZ4Tr-+s;cI_d@`Bb6X?sAFDaAB zZ1z=ErEoYr1mI|;U@HO{jYb1oAvfCU>ME_Rt>xVlMSrnioFE7V<8)o8XfztA6l}Sm zO_50Cwx($`J3CA1bh-edl&0%CJ%9e36h)y(Byt--Q@NmQ8PT;q7!024>gw`YEEaTh zbl_EN7NRJY6&wx2z{0;zV6|Fdv)Rzq)#VEYgXb8Asjqs%z%Y!ZzrVk&r>AGcYPA9Y z>~=ejW`8qK|M{ydQ2x&lY^elVTU!ADR;v{~Jv}4+{rznW!&s`iyZ~@VB9Yt0%uam# zh*lonFUe$A9^NPM@uQ;8OcQpOYP!tZRv65Lpm}w5^*^W6*}yPN!5DG;M*u+mH{XNd zoV$N)RYB&rp8)_3m#-BaBg?XQ`0(LR0HjJuD1S;ZT}LPsy1;Q*-fTA&Cg8s)FOVhEOPU0f3`gK5FxNz2{k$MRRjA>~=d? zws0Ev)tj$mTuWcKnT^C|Fon*z6xae!Tji-QC@9HU7Ixm+;ds5AyoE ziPP!K)1zrx=>>rjf>Dbg2!9_sbm*;}OI1}QUcA7uj*e}k^-dy5Qrzu!e?>&g)qn8O zHCdLQmgK7(hwhUnOM*1Bqo-z#sVc!po1dTmeQV~jpCSkXR8<84n0mEpfo4ZXM?I<$6~Ru_V)HZmSthFSoRd5ySux$ zz1~gc=jQ__PMo+-L_#&!(agZWz<(`W*Tt=nhG9UGq(T$OW;gTI?XEW`&SVNU@3Jh5 z0|NuM0A#9~Fc8stAP`uZo143{v2!sD1BpbUD5%5XfWzU~@p^N|V6!2WN^Qa#hJm@c zxjTVCV2OySzqtV~r$ClS zB*uL{UvDKKD|RGd9wN1b!{MP!CL@$%wwX*uFpJkM0IUb|ip63N{C@u#0Pad2M}JflbPKQ@KvQ2|pLc3%YABgZPDqkOZ&vbERV7K1D49%7 zOifJ<_4W06&GQy}rQfOSV6gEPoRK01FcV0GgZ_0000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+ zQe|Oed2z{QJOBU%WJyFpRCwC#T3t+IMHD`5DYRYa77!?Z!i&V@IcL6m&YU@Or#e9p=t&?wJt3q4)qrY1HJ}<$HL0xF3UoT1 zk$+GO8M@jel4>^ULmpHcq zf;4flFDxv4w8s>UMumfegA`CGE|=?6TPPF~B9VxIaTpIdkXLd*nXa>ozR1>E1VCx> zUavPNpnkt!*x%n5pD`YCAP;g&1}I!@e0;nY)<_4yO@Bfx7E5VcU0po|ba!|66d&Y4 zF63W1P^N1V$o2JgL9%8c%GTBvUO+Gj_S%&J#g>8Kfk1+Zt*xyIfByPQLBOuL7KN3S z717F&pA1sQ%K+8odmiO2q0a4gf8Ns4(kHcfzyF4WM1mT7Z|A)WZ2s^qMI%vadhIsp z^(XlZzkkH<+S}Xj@m&3?W=0Is;&eJ+X>4rlQ?}b*?Wd}8Bkh0vMP8G^IE!AF0uls0 z&3`(%OD#`lB+Y}FMQQ+hEWw4>RK!3Zjgj`UUK!Oka7?&xb;iQ6~4|D^1Iin)$<^n(xlnW(0whB!|a zUw>v&Z(bI?aMWdRO`O`Tn@py2dAFkMqHBLq`DY(egst+p^ClhDHj;UJgKoHfB*A2+ z==~A0w6xJv<>$Y1ShljVvYF@nk1D4ZSTYyFI!xG~rr52!G(GthE&aC0t&1mHhQ5mK z+C7V<ddv;WYSZ8g`R9iom@~yd)YZ&i_8l_3HqQH`c+97lKWZ1 z#>R#d`6mJs(z9Zd-|wI0Q;dV>>wi=8bLalt+}y+d{{HTCka1pZzXJQ#h zoERAyd3SGb&m)1vKF98rnmDk9q&1xFSxI$ub>h18csydDgM8?LzAO1skAG_fwyLMM zw|Cg#a5&jrtCUud6_k~o`jJQ3mT2V$;rvV;o;#&&{Gmu5}7_==UYnl19rA6iF`no{FTH- zE}7DcT9-_^V*JnOqSuC_qc)>Ozc$nr`wvy6auKZ4{yC-r)qrY1HJ}<$4QSr{#2#g7kB!3BTNLh0L01FZT01FZU(%pXi000C&Nklw-iN@*4Ea3nw*?`1fT|>Oey`l zVU8kmLTAtO_)k8YNFsPy^N-~*@MWfLn0G>{ci&BbC z0dfF(6N$uZu~<}0)1;M3h3@X|9t*TkC{RUFsA-xsm&Ejs(qSvsBZxW?fZPy0WtJd4DHiJF$|NWLaL?54j)qpsrLZ z9m`JFbt=p9Qm0@~>*)frEZ+-8l_U{pkq4JKoEph4$M;5bsd|Vn+SzM(~=~8 z2q187;e`<5NhA{2MNypQI1b@(7`q#(L$D_mUDuIW{S(1p5Dtd}!^6Y(;_>(hA>=~W zK?xyTG=CZuM@L7$-9GKotm2Z z0)Xc7rF+zH><+Hz`)1VY89qwTF>CbB&b?N>3_SgLDd>uE*D%b7XUoBOx4<+eHFsQ z=vz;4|`dQ$1RuWlh`f# z^!}Ze?~BDE-Pzfps;bg>JpLvCSGT;bOBBUxHk%C|j|ahEu%&nP&&~k=a(8dT%x<;p z$bZakA$Rw-#lF>Qdc9uoJdg45@%I5ZyLCo+pU*dTDb1b~)PC0YKzpbko*Osu`?ud< z>6hP{`l#K3*KXWAHstdXkTVT0cKgZZr|0Sf@{tjXE*}{|&((>pUA)^`QI6v*!M?Ar zuVretUwngCfK}OAKSFA?8n(B$oApQ}(!Gl}AtYp)W~QBwegESlq+}V9%a`%)J8*BK z&E3@28Ep%+QmJH~1^aHwX`E3zXVgfi)3Jl;+gVDZ(SW9DNT<^=07kdAu5ItyB0 zq7Wf(q6-VWh*%;*H;N}##MVZL&b9OT?|px_xj7Hp#NP$q1Aj03{`Y^s!}EXN`+P40 zU|?WiU|?WiU^qX>&SO%^8ICPQQ>RRE1i=Ja3@x0pRtb#*n* zhlF{Gr+(Bw^?#wtHt(wE=jR`LJf6R_cw9KYy}ex!(cRr$!Kl5nvtyr~oxMxrrH+5u zfby?yV`JlWC=|*pJ{F7dPN!4Yt&@nlTrNI)_i3D^rKM-(M3#24&StaC1cSjtkK{q0 z&*#hY9d^W{(I`*jmJ8WxS_~};1%-FJ-FXWx#R7qVFn^xk@8?m_Msc31^Hg0O=H$K3 z&dw=?LO}`&&b1Y&YQ6%fvaq$a1w79ez7UB7YHDio#=(yW)6>(vLqkK~Ff4GIyRM`o zi|W|W*48#bBnfzZz{PkFqTj8;bDAU(COfX39UoZyB8)>M2}-3B`uqDQQc5fpo2YJl ze0)T!)qm=W6(`ceP938hl7SS({=6ID~igGW`^O%$L!vikcY zAn|$tW+tK5poiMpTES1hd2J$zaTHJe4g!S<@P9rAOcB%6)YP?9NhuCdD(hr28R&F6 zK|thkdA=MEKNbA4x38cw5y=qCHuBSZilg|WK>5mX9CUYg50D&)MN~nx>xn9=;lS`{ z6q4Z}xF?^3XLAkgp#=O2CWK#lCO^HWIEp_E6%`eNAQ6m4V=L*CSl3HE76;DsBS zvVRMNDF0U4@4z3G4(cL4xVrdJAZL6s4)S_)L1STI0VseC*mM=UX!%)J6htC+>mk@? z-@yB?3;TY#5-y{^P?Bj;68m~73bE^5@VotXj*p(nALl_7l)R&xo12-o$z%eJMssYu z>O$qA&+=oE2a9`fI2@VhmX;P#OTeOXlz*@tO@be{&N}}Y>_2~ix%m=w-RuP|vaC`T zcc@UIOUlubh+?trRI3ZW&XW8d*qci bp8x{@UVOgbo@<@z00000NkvXXu0mjfacBIX diff --git a/designer-chart/src/main/resources/com/fr/van/chart/gauge/images/ring.png b/designer-chart/src/main/resources/com/fr/van/chart/gauge/images/ring.png index beeaecbb54c650068196a5bf1e9f01d388c0c106..10d0b637ec168befd5be4eb42630d65d0c592f24 100644 GIT binary patch delta 1195 zcmV;c1XTOx495wOEPoOJ01FZU(%pXi000DeNkl=fa*$UX7(mUr3@_Gvn9$qS=Qn0eA>tp5wUnYORH+ zhBBI33Hx6qsf*FH&2Bbt0L``y0Jk`fyW7y9{?*XXi#WZI?Y$yFv%P$YF6;_Lf~X^JIsE#ATly zr`ikK*d<9qI2?weC}z_Ffc|oFwye;75vLc-AWwJFn1B4DxnM{DU|AO3-Q93Ho%zD} zZe4P8Y9;J9+jvfQ()ez`0XtQEx{@Rbuh*LocDS5;EgAGxlDcRXu4Dc7vNsO5+YO2` zjfU@Q3VP@9&IL0uaM@=s$&+TD^>{pHQ$C*O`)dZeCzDsrcGqHZvXGo*7{+Yse9b^( zY0_sLJAcP96_=7Om&a#O%aRFQviU)=PAr?idYKnKQEVpY0Pel z2ng!IywU7-dp^}vKM9yE1_FYLpH~xb(8K}MpU+Zo&;;hTBm@K%b6XPJP7=SpyBU#$ zmRnj;l}m-9LC5Y3M{3!nz<*x*`?ZX~t_mkjV1KxWK~mQ7^v%8~$iQWe|7A6C;PL-W z;q9aejP|k!2r3ftzWPeO`*b@<{P1}*dRlGx*kwas2Zg0z8hvgGi_cPx0Xp-wYxl^~ zqlZC4)-kswVfZ+M(Own_S;zE0N%XjE80ezmc97`npzu;qG1|+b$7RFQh=PGGx^W8c zv48tQ&PhLgb?i`{CS@H7S%=#}ntsndE|bfVq;_atQ4|D&!JO-J97oh7bURrk$E(}X z!(!Y)6NeUU{GL62pok3fqA2Do%4?IOZH%^I9DBf5eiIP{!EE?p%|KgdZQ3{%+*5PB zT8>GQl&?meuNmn0p!Z%oqvpibuNxvnrGNY$l%{D2hr_1Lvr;>SB|l!e9m?;YYSOX(;wu?Z(J`|wLY3ke`6!;V32_{Ew$!zjB^XXL z%Og!>?wxuPk}s}l3TshMw-82j1Qmu*9^)qeK z%}PL4%%d4A^p!**%Iie4JaXl;&Xu}q-9ke7eJ`2v*0hW&o;;TJj}LZUYY0(aOcTxQ zwV}~_ZH%_jLTl6GgWh}9S_@(Qp(M%zwLmRU3)BL&KrPUt>|dGn^U4su5TO77002ov JPDHLkV1oFxQ=0$) delta 1613 zcmV-T2D16b3FZutEPoRK01FcV0GgZ_0000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+ zQe|Oed2z{QJOBU%^GQTORCwC#SzAn8MHv3iW%sblwNQmxz~Y5kfs$gP!31p7L}P1> zx1=wcT779>>LtY(AAK^74}EEUsnNGaVoWNpZMZyC6Qxxk#($dFm|c|y7T9IW?%B&Z z&NpZ0?Cb(^?Ly<3WHQW|3-itQ|1;nGtJt+9yAt{$99ND;OeLTwDk+*qipom% zH_}J@BD}=^wtp;(GMNnJ)-lHN*^Z8m3)>p#`Qbl%Z^qP1U{BR_Qgt5#s4eRE@uQJN z-?G^(2aF7s*#;cz?Cktwv(~0=)4UeDdbMr@Nb{F1339o_OqUG9pt3SH zPEmSPRlPPoKK|;qViczOb3}a$ENVW3&8oO1hlS!JMo~BqV z#u=3Xo2JRZvJH8yy}kXLEdvUlgt?{_U6Da%(4KwCVW=1KjtJg@2E&l+Xu##kktqTF$hv0C8ZkbgHD+ z3ltB;0Pe}W$(nTHu^?NhW1{f6wO9-KVvI2H`uchfUS^%8j){qhu95+TtmBF&$0n|j z?%f)dX^zqne!12pd>L~fm6w+nu$uGvmrDi|+EtP7JqGmIJwDg;Hk!mdm6eqRrVmyb z*ng)=1{4wx+BJV?T2$>TWHKBl>i?bSO4#Xx67{Q-P8}uc=qK8XnH8tDyIALc_LTH6 z5(3>>m<6;hn^^pLCeH(U9@OQKQy;kLw4R%I7ZB*k^dfxbNutttKn z0J7O${U;Cb`V<2;PZVT*x_1#Jm?hqrbAQ?eIMM&}u{`7Qe4F78n0u){45 zdkZ-?OXSKrCZgUyK-5@C)Ko##TH^q0-ND!m(ISDNs%q(hUN~GmSNshCWCp+-z`;Db z8yvu>fAuQ^$AES2bie{&DDJf5`;A$rt(eg*d%e8b|Cg;X*{5pGJ(@`_&?ir1xqqLE zrxw5iTwPgyGvvCwNy3*SNv9nu2zMxa5^^vY3>F9rrjC@7m~KPBirUg{;{={dDXtn4 zek+42uFKy=6751Ifdu(AlVfozfr6$%M}WeuDQ zxeS#IXtkl7!<7Pk%O_z#f1J`NZGUTg*W>Z{sxBa06Xd;%BR8HZ9p9k2!``e@!?~C(s3?xD+ z$F_BFtZQe69oW`>yPM?@>Aql$p1Wsm>w{zK4R^{9 z10KOguv^pR=L-+ZVC=z$)S2TwEq&W2QV(XwBkE}c%Ziy<)8jj534X=0+v}_|rw%rK zc-Q_Uu^d1vljbZ!dBOir^xi+bts?bHneu=A$RxjGxk+;|U{Rf6Cq{5>eeiVC@y%Y- zmi%m3teYVzp|(!;HeS3_Yw>;v_JDdoJ)j;?52y#!1G-}RSAYQkgBuIrRB*GM00000 LNkvXXu0mjfi})7jRTnAwS!H!waY)-;)E#QDJxe!utf@;>wXy?^)ny_dRTv54@zCL|y)^@Raq{i6xJUjDZghP0Inxe-Va(`?}{q)yvUNSWmPcUFKAO??ris#pVl3;6lA&U&1_vC-_?lm zfAR?Je0!5pdUD-BONDDCA*YYo)n1QNyEo$Q(>yxJOMd_eQA&qx2aV38`yMVd-Zt7A zgkrI?HUDd+n@Dsf-S_G}xwU6o19|*9hu?Pmr#J1Pls>i<^z6h!hTmQHZ_b^l)=rsB zCc6Rr$(g4prQNnwMv>|C01w$A=Ht~&2b9uD03ptNguMWJK%ZyHIez1*RvO@7hXG7+ z=JU3IUVlrZ4)NY>cdHjHtR&Bycy)*6pvwi}44)_Y6e7t=t0XI}yp12r%vK_V=Q(qa z<)BJI@Ei5*ZuNm-;yy`M#sMq>SkyrzS-HyeMM+i$ne7sQN0O|}NwPwjZG_o*xxwk( zmV;(hK{V=3M2j2L5%#$kz}{Fu%t*2l1P}!93x9wpfJ>6B_y7z72m{Cf2r}DI07E7} zJIU!~hi=)&H2$bnFBHd^H;w|J%=`$ztRySP47LelL^41pap zox5#6cxI)`3AOU8<#n_bmJL8N8Qa4_H|G^uDox zn15uU47RSLhL@G(Uf%j&rCd*>ya2!^u6t=5z-TNW4#fgultGNJwlM3fZ(u(IpsepG zdr9LgbVpg0)Kcj@%Ps+b|6?(0T&Mef$c4<(ODrH}RPy0RhJ&o$pmx_FgYuzbIsr8|2R>Y@rq~*%JH)9rfa{$1RYMfqb`QY6N z;IDN(cmsfUliJVQ=HHP>6&-4JKeXn(V9lVx18sLY#C#m~NocM2MHN>@p~G8yX*E+} z&IZVvmD~VUv_`)*asD55KpjvA)B$xs9Z&~!Rrv^z#LV<>z(r>O0000% delta 1458 zcmV;j1x@+z z`@Hu$rTSN>{1JnRDKn+j>)BrU= z7Zpy=$`2m<^@#{$slFCt+`)+C^v5_e{XUD2hwUO8aPaa^q8w_h+4R77dbP!r>R8u= z<%7;MwHG78?tjTJ>tt9SF&tKwg}0j03X&xW$?+IYV<^`w1y+gC_jZ-9JD{YvVJQVY z)HV9z`Jn0JOA+45i5A52B9Jfb$G9C*EP~>Z5Xuo_fjjNWt5qAuzz-Xq97`pDuQul>-a3^nT|6F>xCjqC>9E$0&Dcocekv$d!<8p#h?ux z=X~cw=IfC3FwHZ^r}C}ww|1819$HF0pPZVk`g@jpb0W-Ts^aJlBu)t`%A570^(LrzJMwpw4nCU2wELJi-N&m zeQ9aw{EzH=%s=H znx39UGcz-8kH_q`9;l3cpC}?0t3ax z#bwFN*Q6pN*e5SbwggBRuBn0qak*T>IH^|iEZ&DL7K^91w|8UOLcocbWjDQrz`~R4 zoLmGJ7P3Ayk3o^c;dnhQpb*wwmaIp-FV>X*TU0q#kbO(jlmF0zmeNwxH zynoyo$O6^cv~|sAo5!msaWban1wlYgr?WzL(4Z{1>A4BP0M+m!tS9i}RZtZKr-w-% zw2s*J;bah}UaT%+J4)4jPg<2c3tAhsqu$>BFF(mOK5p;XCj%=rgc$ zVBH5Df>Qvl$Lfdo#I_#me0$}|gd-Qn6@TasIwc7Sfh>e|#2e5^7tukihlxjBq-ZzR zA$3F&Ky~Q)2{=I3;ol8vJUdK(ljr&S)3E9$o<`Kzm1;D2X#-Z(YYRy|@wAU<5$Ook z({-ftV4hBC_Hq3W-X@081`jOWza`3BMZ|lmr~Kr3J$VN*gom|{3}r;-^%1JGe1CN3 z!8g2KZ@NJfPbcrUoLY?&FEkuCxSn_fv<2JttBVwwzW`lNAk_tI8#s+B3!Mbu-PqOw zw&v#M+vsnyEW7-H2+`DXwD#L8vy~lFimC^W|6Z#tgY8*Mu`Q(9vVDDhPhyWMlnyVq z-OHY%R!$Dk`7jc|7ifQf{{|clA284Z-^x^GB|DpS@ARhC Date: Mon, 20 Apr 2020 11:55:30 +0800 Subject: [PATCH 249/375] =?UTF-8?q?CHART-13531:=20=E6=9B=B4=E6=8D=A2?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E7=BB=84=E5=90=88=E5=9B=BE=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E9=9D=A2=E6=9D=BF=E4=B8=AD=E7=9A=84=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E7=9B=98=E7=9A=84=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/images/custom/icon/cuvette.png | Bin 15846 -> 574 bytes .../custom/images/custom/icon/pointer_180.png | Bin 16361 -> 1164 bytes .../custom/images/custom/icon/pointer_360.png | Bin 16778 -> 1581 bytes .../chart/custom/images/custom/icon/ring.png | Bin 16824 -> 1223 bytes .../chart/custom/images/custom/icon/slot.png | Bin 16673 -> 1113 bytes 5 files changed, 0 insertions(+), 0 deletions(-) diff --git a/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/cuvette.png b/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/cuvette.png index 680f9ed18eda907e323e693eb257a15f5741f169..39f034740e050c304fb21313a81f0f93d0ce370a 100644 GIT binary patch delta 541 zcmV+&0^B2$?rD-o$Rotpg>*LJ1;QgF4Siey1=XxX=Zce{rLYtcB#_XhnM0=#o7{Or zPV$Vj^7;49?0z@1qm|c+qF@#59xGxF>YxtlpbqMw4(gx|>VKgBvJgTqgwSic;9dFO zZ?M)2`}|Z2)9JJa(Cu~?YV-VS#<VMbs-@N*G@uzef+L1RSzw0`vgDx}?>4-?@s&?JH{{=jDWsL zk5qLgBFDf!FayS_Iu?-;uxs-Ms+x<)36QI5)^^a(Kn`R8sv1OOA2;1XTY|q&f0LPp9k3o68ow^5RpMen^dMJmff;+XMYAf28I@E5;Ln3>Z|h zH_tLF=iEjL1oO!%!0pPYZ4%q?q>`z!4Ey#QKv2~jcw^OYX3yoz%CEe<)}7IzWuya~ zs_LHUe>J0u&n_@h)$Iy&VohlfZF5CYL?3CIc5b58@n3fMUDrV!)IlB8K^@dV9n?V` f)IlAzRTg#$jL}@tl(kcu00000NkvXXu0mjfvgimr literal 15846 zcmeI3dsGuw9>)hL@+eSjYm3%L496GiWF{dANeodWDzL^<%r1|*TPBkUOd*+&Odx=s zQmw64T^|dIfG%6hZo5U+Z40d^i|$Ira=OBbigN0@zG{6Os4wbz3VW0Ah!>dSIqjbP zXL1fqe)o63zu(N~{(d*}&)t~3Vp(YLlwbrwLK73TDd4ICf0Donu954lOTZ<_nviZs zkf)z>{rMmjRS^iHyhZEN*fia870H-Igpn~&BB$93W+RAtq0>r`ITR}}P+7DkR@if> zSty{5vBFfD4%b=Zscbr-$VRO!TA?S4a!937xKII$*^Lvsu=v!mxsZ0#QM}v;Sx+DLBR~v zUT9$nCu*@rdV&na(NcEOMq62$u?Spo2?OI`V}(LjqT$crbD6Efi7fU(c7P)0B&?WN zgkxigjO4J!>agXyZ_P+zR4!$vEUX>q#AE8L*$m6rvzc*H4!g%q4Aw-a8_qrE{hG~V zrna+7@&STDq+=@W`a&y(rBHUpVI!#}`QT9^$9j5}HjOOKW072*aqpdS(&NZn9*@jj z3Z4~GgJ)I6+bDu%YV$_QjDjBFp@y~Dts7kLOo|#Y#9b=?Tg>VcBu9D&^ag28iubFTR&_70kC7vjX z_gt?yMp9*BY-WPh&}Jfw!mO4oH8wKnHFLPCRPjtMV*|HEX`prlMJAt)kRZju>>5_tt1mFQ&~ z4fZ`E*K3aJS&SeVNy-(tjFO;)l%P-rB~_pX1$Zih++ZMN5|dG`6c42sBh08&3A7zl zYoS*agIad)Y%8g}$47@8xwLzSvJy5scdevX1{%EHxNo>1;t;|H-bCbodEQE^$ILY}1aJy9Q* z!Qs`I>$f16{vRxaoyh-j%kX4f^&^%6-l6_~%P>;KWHw>RqKq1BsDOtCo^0hj>-l(R z4R!12PE@;ooK&ETK}8Yn?g6bmYHTF4XMUQi8*?4*`7sh4d@!-=|De>{4NKFxrQU8> zI->lAg=RI9!EDg5m&)}E>e=2`f|or?BbUjdWoir_h84-Qlgdrg(qJF9yY>^AVo(D+ z#uTP|2>}pyGPlsnF(~vbmDg*Ty9Yg^;H3||Z(_qQoTJ)vco+LAzl=Q5PZ<@8#V3J) zaGN|XZa$Eg#{~i5HhEm!d>}863j)Gz^0>J9Kwcgf1cckZj;Bw%?I-GxF8_hCXb7o59H->K|r`o9v3$s$jjq`fN+~UE^a=Mm&XMG;Wl|( z+k_@xsujzz~N2-nUJDGkfK=#QnC&~9u9!(w+Q0E5#&ZD zI6PX8ATKgIUTay3Ab#MaRh-^={#JQh&P&UlFKON`&zKeZ@zr;QA&#ltGRJpEtHtHd zwzgQ#zZ#a9u!6=;%m_>iYLY6CO&IX$>%5R;|MsYVOkUXRT_st+zmk0Rd2G_$pz>p) zKP}pH_12Yb+tc;kX*(z7+?*C6eI#YBt$B1Uv}b>NhJ9*Cj(Yv`t*_T7si)7W{K~hwes9o%>-8ml4Ksa;ii;;MK2Tr3KK#<%1M41`EtVZC{&>Rl zNogDPR(MEANODx!+!r>b?euS-nBV@*U(z<)4la)>d+*Sp%DsE1N0kM)7`7WF>6NKr z3$9mD>CV0H+-x*TCaX{GOP>4GOrO2$r`@YNQ=t`tyQ!_MJhJ36+7rL9aq)(((=!ItS?A^?uD14G z>c9Wdi}wmQ>WP5C7 zsRXTAezq;YqCj7*Yx$s560qFo^3u+l((~I={^1)_5}KJYPlnc1`HCtFpG%sTn)ERG zVpPqY+hL8tpO-UrN%NK^75bI?*CEQxXSbC|K2FT^aUyEp|CFV?bbDK8&je-Iz1_?F z6)9hCEXkdTH=T5Tme0n7^h$C1Oh$H1R^`TyijKle;l-w}GcHWcI(u*G#fUwtk>tgl>^Asn$k@V!_k`6#xLr3T|LuuxM5RA;^pnq-bM2qEv*Cg$^NX! zZ)MVl{RsQJgQc@GUU)y_<{yehyMErY?97IKqHnJM=0%b1fl}Wso=a?gH4}gss&Dr_ UV1GHsbrL&q$qH@V;>@-G1&}t=_W%F@ diff --git a/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_180.png b/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_180.png index b20420280c86e2573cdf86681f99cdf631c7ca9d..213a052d4c6f169670a8d37e5b566fbb0ddf588f 100644 GIT binary patch delta 1135 zcmV-#1d#jbe~bx`EPoOJ01FZU(%pXi000C&Nklw-iN@*4Ea3nw*?`1fT|>Oey`l{ci&BbC0dfF(6N$uZ zu~<}0)1;M3h3@X|9t*TkC{RUFsA-xsm&Ejs(qSvsBZxW?fZPy0WtJc_(2zv67c$S$|&I54j)qpsrLZ9m`JFbt=p9 zQm0@~>*)frEZ+-8l_U{pkq4JKoEph4$M;5bsd|Vn+SzM(~=~82q187;e`<5 zNhA{2MNypQI1b@(7`q#(L$D_mUDuIW{S(1p5Dtd}!^6Y(;_>(hA>=~WK?xyTG#V90 zM@PTpd4C=N;B-3CtCeB=Az5rwsT5MF)C-9GKotm2Z0)Xc7rF+z zH><+Hz`)1VY89qwTF>CbB&b?N>ASB%)f!wb7k^wX7XUoBOx4<+eHFsQ=vz;4|`dQ$1RuWlh`f#^!}Ze?~BDE z-Pzfps;bg>JpLvCSGT;bOBBUxHk%C|j|ahEu%&nP&&~k=a(8dT%x<;p$jojbclWl% zzJJwfdc9uoJdg45@%I5ZyLCo+pU*dT6hP{`l#K3 z*KXWAHstdXkTVT0cKgZZr|0Sf@{tjXE*}{|&((>pUA)^`QI6v*!M?AruVretUwngC zfK}OAKSFA?8n(B$oApQ}(!Gl}AtYp)W~QBwegESlq+}V9%a`%)J8z@S-PG0@ZD$oi%>=cuH*=%Vi!mx6~HcPu?(FJ09;SC3=$^6N|FGMM-hqD5y zfihn>0r5|h!=Y)b!h~r_LU$3_lV`?NbI<@{SP7BT;$(?}qxK+c<8sj7nqiPk(oRt( zd62y|2}u!wK_p+P944_`SQH_ZP9wRwyU54wK2DQc0sP zGS3YC#g&WVI3fJyqv=q~gPfpL$~YjHnwsj8%5ag&<3XCcyE{mwgLFCtok3Bol_()K zMWV3N1sRLOhZRCOB2yw#2}u(d5=d1_4>DPkX#6#LU1HgIB8g&@9ZC^YLo$%&LItN1 ziG<@CnM$6lU7AP;!pX20mM9gdjy9!EmLOG16$#Rpq#Sp@G%>m-fq~<>r(CaCJY{Ny z(k}%?Fp6|ar6O#t3|s$+V@Q z+aWG`tsGxD3@N4ZFsU?|r>nA{F@z*vUu{*9mWCq|ku+7|$OW;IiT$342J;~$%tPzZ zl|p5r#TZ6ob699S(wwMlv?}$2=w@PK1WH9n+*)i5I#pBC^cQ02&BVq)`$q&Rp;wBc zKUXh~NXUtk%Ege9hlrtg7?erkx!}a0-pui;;`mCFrE+vxFpt3nryAB%X)BErAW^Qm>Vql=Yd{St> zRH)K)3mRH?u!y8WH2lP}Tv-r{&2pnrsIGJ&g+_y2DeermfFfkk=nxDsT;o`Ru|#^o zCM8-eN6>Q*O4ggBxfT(cjE%09DL_+*L{tWaE?}}KY$_e1Kmu2~8|;qehecy4rU)}B zl|Q0Dt97kj6{EGRJ=sFx4__P|b0j0$6G{fj6|koNJji1WIDVv!pI91=wvRcGP;<8N zgqrryEb)cWiDiu|M`g(5?R+%^y7+qXm*+@LfF*eCr3AowPM3!e|hOW?u)!8Zw9_m4g#m(Z61edBV7vq_3=n)17nj+@Bb=}VeQq-qeL$1*@1Y{};ZBm!KO_(U(v|=~ z)&>9=evW?k0f34M06)i~50CB#fVtA$F^$UsV0vl*-#bj*c|Sj9WoY<#H~yaG zz&%;4*eqJHIe4*c{!f?lj18nKq|)@hj%l0r<$3y5*53z*m)!j`P2MtmKr!%SWT5Qh zkYDNhPjyba*VmWt$jQE(ZC7s@Yje-|^s0RwHPRbTrw4ZQ*9Z1otB&x!=xNkFUE;CY zs9iO?4 ze}$P-P%!V?XmB$`Wit7}!9T35JD+A!S605PGGb?Tw!tzdr)`Y_ZpH}P)~YA>k>%5U zd#$!Kc+>O0sHn&dTDq~dk8k=(^kC~;<7FGw(cyXJ(?%?+{T)kZ`$6XzBv0dvDD(VJ zESA3WjcrhG8DqMAR>Z|U$eAwV6oVME#ob1(0O!G54=f(EKC}#S&g+l6^z*tBpg5~} z@JUTuTbpZQLEAkgr=RXrP~!e&|I@Cwa~F0cB1oU%VJ|kzz`S$&Pq#uYPG3L6>Cx~y zi@LhHxvHqlc{>`vfFl(nXE&Hc(ps6tNBdW&r>BEY*PY&cmG9B|d*1EKhULKg+S*#r zg8lo|iII6%RZ+Wk?dmn+@OUmwO-;pcWWAqBm=3+?Re=<6R@G<@vg;Su9(R6DQGtY?Oiq3sU|%5F;j8|GUYA}fba zsJRP2&Gsr3^4j+qMzy%FnQ3Zt`e9n#k+ZR{M_s?$^3iTebz@^=2fd;^pWIkq4=l_r zy*BtH6A1fuYXc|z8s(RPfsBf>va&8ojj+I>;U9yc--zETD4A)tDX(~!k7;>%c~$4O zrrRH!$@t?6y6#K^hwu=UA~Lw~?n80+@%YPdZ5MC7b&s;@!gj0Y-+SIQHQnU1(dUp~ zbKj#k2fLs>)_$!_V1cCx3b*b+$Sv#dJLSl~ej6EnSc+zJjembYe6G0N^v21&M?A`V zpI1J}Nt!()V5qy-eWR`s1=j#jY|5@l-|25p47kX1>(_GaXZNaP|bm(UCY405)8JS0lNXSsYqjX#3W|YaMs)*cTNQwg2+?)Z@pG-9jAU46mf5r1{okD* z$yrgJP`RUOR=oeY!#lr@iaq>%vA1yhnZuz*IgSob7tz~NvPI7CbZld66Jm#emKKbU0~)3hRxInVaE-n zAMRKavZ`Tu>7Pm0i&y$~@&~3h*Vr^}INP(N;(B_D`>h~{dhwnJd0K6`PwW!;qA+^C zz0GUUhPQ@0Po20Lzei~Oo1Nv(0LMMxg5REtT%)a=vgUZ17f!!om|##1tN|!v=DmWd cOcUVf&ZU=slsv4^Jd7XUw~Bw%C-$TN0zvNBmH+?% diff --git a/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_360.png b/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_360.png index d4058631fbdfac2c236c06670ddaa08e7bb93023..58b1f0a35bf9f878eddb1c6e943fa660c465de73 100644 GIT binary patch delta 1557 zcmV+w2I~2Wg8{7!kSu=^000XT0n*)m`~Uz2-$_J4RA}DqnoVpIR}jblyN*BBCc!Zw z-xR5k)ReZTs$8hZg$suwlvYHdkvJi7f`d;@azL_j0Vz^0L6taARmG8N4wX2#J)o*l z4y~1gp$ScFq1YjD4C`#x`{CUM z{OsAY-+DZrPi;2a7j<=Y4IATfxtyr$dL*4rPftut{K_!Q696&*nTU*vlM+$InhDrC zIXQWQ=lQs%X_SA<!j;CNs_cDP(@Kl(=^g`op_#)2ZO<008Iec0|RP89u0@XL#nFgy?ip6+!N@_moF)k z$!zvjRi$t^JOtoqrC=)p8I48*TOl{v>gp=3t*zzV6GeZqV4NTb1>>2$gPqLilVIz4~>oD@Z&NF;I_KvTJ(Y#GtDJ{Sz1>+0(ASu7TG zbadcVY!;#@mK7Wg!@$D7PhhoLVYAuL)z#$-27~7qhN-W5!oV<$rN6(wt*57F#A>wy z0PJ=EKvT>5NxRgT3cHI09LCNJv}`m{r&xI48vHey1W2zM~yS03Ic@$sXg&rB0`mukAq+g2FNgrIqKb@e}|)7ii5iHBX)N3y(fR^B+ z?XoPtu-o^hFSi&+dTba=s*Z768&+fmjV>oH>q}_kZ17zF0d?&k?P)Ge)8KNsI*4fT z!0kut+CM`5#VZKp>ailf_SY3zK_FL;`ip;8_6+%6Y`nQIzlK2hssv)8e0=)gZ@gz` zXE(1qJ3HZY?!1g}oCB(w&FdfWcy|1aq9|BcSlH|zKYqOWpxxcwZ#DkAOPBD|FAwti zyNT23%+sT3TImIW5`s~SAP9dSI&|o*ol8|!BwoD0v5t;yqxDWANmAVHc7H`g%hiAI z(KT6?pO)mS9Ea|cCrg4fv!kbGjj1ZZNSmLZ|9xxbvY#Rd0#sE60GN8UYJp})M@K`l zEQ_KjB9%%Zm&@%NsNHUdq9~AMSsWc54FSkj#Yas)b;n|{vG(@%K9*%+u~_yLp}V`g zx4qs?=I7@FCr+HWPDDaA*U`+tz`%bkUDw5}kcMGElB7Zt$YwY5)$Oh~C(dLFHt(`5 zivt4#w*X|SnlKR2dLR&3nwy)uv$1nA3SFAwBloNk78HTX} zII_IF{D;%&{H)YvqnNC(uR{=or!6fl=K=6Uv{uf1W#zi2a^C0j^)4?jkH5JAFQ-73 zNF>I6K3{JoAS-qxVICs2gu~&XOeQ0gW44)0Mlg%lEdZPTXX&$|77|Cv}U_Mq5t z#7<3;B#Omi5Bz@r8367|9!Gyv6m$!)9Y9lGU!QksYHBE%OioCWL~mB|RaGTPk|>!> zPE1Wr4fXZ)dCl_{d!^s0>|nH8?bj@1aR6+7zyH{&Q>QvNp3lt8EDR0~CIILFQ~=qs zmXH0&jLHDtx-HD@C)hg!eb-X^vqlZH23iBHf!09xLH-A~@8O0dEZ7aD00000NkvXX Hu0mjfbF=n# literal 16778 zcmeI4dpuP68^=$&xhK`8o5rMaY0Sk8W_CcGb2L^6;_GZbfuCl zVX1Usvvjeg^6M(A?Z$SYjZ#s+=;C(L{Gn)%P>(#h;0k}~$lL-H0H8NU{TTx6%rXH0daKaK zU+K?T$lyxFHXu(L3fZW{GI%xsFlVb|AU7OR;zA*TP~wPhD?f$D33-lqKN^R`k-0!& zLbqr+v^d(shZ`NvrStH!S-MOW0}ddDlpsze7D*Hgl_S0#Y0Aso$yM&ObtWSl+ShD@W`+f!!YC?qnKNFo!-wgfVrL8UTCBwXKtXX(Oc zOgWFw@Mh2LO9xwy_%NkX#vl?SBO`4hZEd7-0g+6n(}^SskwPKBGYE<(i4s&1B#LRh zK|aM{Lkg~3C{qfh5}Z0N7%GiWI^yx_MEytKeTilLi6n|Xb}&Vv3X~DaHYDO;PCRbE zk1Rqi>bW!?mk5aK|K{dQ8I|=4Jo7%axUb$626sbgWbJS$RAjo&myUnuUpHRY+Mk*|sM5N2WdJjZ{*q{<(!S!fI zAW`9B^dUPiXmCA}tw|1WRcZw3or#FSk@AH6C}a!@i9xkvP$-%)G-e`W!2QDmmEbo; z(VVLhhsR~`rE)Q-WC_Kf03ymH0w!@_P-A9)RWV$oBB>m{EQn>xBn~#L;nh=V40nk_ z2}-z-JDUX$*a(F@1}~IGrP3h^fg8%@63BcijR11_6aq-IqeEmmAA%^o5IG!8_b)=T zrQ8U0x4@x$Hx{0h3x^-LtWb)r9p3@oFi3V3I1w4LBhYOfLJ3?NnF2x}EYd=IRtrv~ z5$uaZo^m0)?|~wXIqG}i!O7@!9-nIqh7#y}9)-ZSquLWdTQZ$s%cD{4>>VIm_>MlM z7$nRWsoaDLxLTt$su-^2o}FzmwBqy8Pl8C;vqQ;1xdKx6pCkTL1NLue{X3T0r>Bn@ zAXmM&vAF8?fOt&eXQKm`)$iHoCj4?azYRfed=2-n=ZFl0Bxvo`8>(m4*Mlged}Smk zhnxg(g?vlr_eTBP4H=$ERR0!;g#UwuP=G7{-ZFe!SN)A;K<-fgzhxMxVs02H5kNc^ z@lyeR8u+%A>s`;!JL^-oe%Xmk^^X$+?qay2z@F}bTlSk}{ny`%6$AN;&Y?0?|= zqCNX}v48Sp;Ew*usEAlt5(E%*6T^kh2ccrP5J1pP3>P{dgo@!p06{k~T}M&`k^%Iv<3J;X(jGH!)o3d=M&z3jqY(#BibWL8urm1Q2u+ z!-dWVp<=iYK+sJL7djt=is3>4K{qj6=zI_=h6@1%-NbOA^FgQ>E(8#C6T^kh2ccrP z5J1pP3>P{dgo@!p06{k~Tf%r91EnCnSO2+l+)?&2mnx(d_^*UYZedZY}_fG;wD;`KWHU?g$ABtes-%*A*Gh>l{}d{K;)Y_Q6#A9qQD{ z4*$8Irnu6!ra7iLreU=A{7N0~((6OZ)_jPrd^(~lUebso8N_I1U91yIr41+d(&_p^ zTDytSkrsX)Kz017+3q7R&4}w5(rvYltsVc+!GCKV@ZP}TaGg`^@K%eYW3%*peRUF? z0XNIoa(K*}SD|G-Copi5v$p8YTYPqxUgU*|MCN04b6ObA+Hcw#JSjWOzuUOT z&u`@6)rIRktT(JJZh8A*&CXrB{wS4BJs>pRc zR+*u4d5MYf@>X}o=sG4z+bk$f&&#hfYxpe7{k|vC661;O;fv-c8)>;NGIAbUxTdtC z;=|L#XSvSWTh^Dyc7N=6T(j+vuGx&Zv3nO-9zCu9!o~7& zbwNQv)HO=ybXkPUEUWciK&-j3PBv?G*Sw;lqEjzAV^#&*_&LoqO&g;>LhtHU2sAl= z^U?K22|I@QkK7&+k00*EqzP%jGsx zIkl7>DK{g6Z=VSEK3`ouHCkYjxG=BQyOt^ziCQNcX)#+SRM$^zXW&Zb%nZk!PBxX62S_wLK(c2ROAqK>^d- zp5L!{XB37{SGjq@v6nC3tEVk;uy_$j# zXBGtj43?(Xk8^I#+P?iQcfo=M zkst51&fK;+)upWEc*OT-J7Z%O&dAQ`9C;|mA|yLF^vJD{JGXCpxLJ-bh_YH_71v>4 zU{GOfm{h*8A*nJpMf}=k>+CLB@DyTfhZ)Ot%N(usRewIu$;t6sZ&bN+t=1g|gK^)+ zbm6jzsmf`W$7RHJO}Rm}x^rdWw7gT!Rq2vTcYJ*_Q&Uq*>67tXy4Os!S~(Z=<ML`7{r zv2$f@z99dZ%<1a=xU5bt;i-dRspOs&v-H@p#`etOBlAa8Rvh`uDX-9^hNK^Q#Q)D< zjvqgMV(*51vKNhK=Go)tj2`uKbmI%X81lzcXa6%aDMWSc{zTgw&Fz^TKYHYa>n#;7 zf4+El^p#_Wx?4G{idR#;4p$pE|kp5xM<$q-hS)EhYQDVw=TN%c!_oyJEv7{OwPZ9+nV^`Ejbzxi}OTfwkdX(=gLvsbqI z3+Oz%U9P^q85eorC13oqL*q|1q>1lXZ19$^xxzo10#6&cwXn1O_o=F@S28a1|2Qfb zrBEmmI%dovnFJl(z3pCk2<3N*E`0U}(wqN%=X=zzCul86zlgG%OG1+jN>10v) z;l%oa@ikYnzh6;)Zy|?cwx118sI07vjALK+oJ*I6>zExldGe&kn>TL^^9xQE-O^1s z|MaP8AaR?Q1sk7!nw0YB+{W>qhK7b7nIVBU^{FGv@$1VBJ4|Pxs$3gNq*}=#5X^!;E@$a*OVS}Ce1*!HkXGHcDK)inS53nR;IYtUNmhMP({V61Hn#IP$l+BH*Or<; t;eVGP{ed}j^@uM0jtNf=Z0;Tf*jYP={4jTWgZjTExVw6=i=CIR{V&GYtAYRk diff --git a/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/ring.png b/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/ring.png index f3bf1b31d8bd3a46ad86605c78045ce58183f246..10d0b637ec168befd5be4eb42630d65d0c592f24 100644 GIT binary patch delta 1196 zcmV;d1XKICg8|10kSu=^000XT0n*)m`~Uz1c}YY;RA}Dqnr}!OcNoXNcey(+i8YEQ z(IIs`3PoQmw#b;^X2;80<}Ob&?*>J%^$z>c;~{NOkRzpNnc2!S~KI<`=Z&0Edh84V4mZ+^=hq! zsD?6{S_%7KC8>+iw9RfdZvf4<4FI<|j=S5?p#Ig+(2F>|knO!9L9@MliQ~AJ4VR<0 zAMM;&d&@2#1zCTf4Fg!`dH#GufljT2{cACHBBc>T1*6Rc;18bXFEvEy-hQ-mV=cx` zRZ$d(q6k3{kWQ!HcbRWEj+?I=sDCvywDy)=HuGeMgT!T@ z9jDq0+t?*ZLO2|Tq9|t50)YNu*uFUgZ;p7nSY?%=lg30x+jxY&34yfaU_;W zV`+)fg|y}KEa zgqB-cQI$)DqCv;*3rA|%rNDn)`}?(wz^)1>O<;exhe1--@$}8UD9FHNj{jvfap3X) zP2ugN35@o#2nZ??^1k{?zWa1LNc`}5GkRKW_}FDbUk8PyU>bdH3X9KDjR89IwQKjt z(xZn#Le??2C1LnDgVA0V30cSVKS}hsY#8XG;dYSd>!9#bP%+xeqQ_;!(};qBF1m3F z@3DXTLe5D)eRb?mo+f1-30a5RL7INgJ}#5Xk)(ELUQrYTgTb8Za~wz1By>AjCC97V z(ZgcgK@*1-ZTy}+exQg9^P(u`E6Qt=qiu|~VH|tFSAG)_1i@_hVa-5WXl>d!7Ti;F zyjqS)l9aDTov#___@MV*JEP{r)vp^OM5TZH9+akO2#3R_&9hQFg(W{;x*f{z#<4d^ z4KwRv*`Sd~Bwqo3t1cae>wiUK`D)U!{^BbcQPDB8E<%;!82Kokvk7q=ced2EmL(WY zG|MARWbU1M5|S~w94{(ox1$Osm*aR6lCinlgoW45##TyMO|rT+$D*Q!?WlqWd>Vhj zJvHatPg+wM&(^m&mfcp_*lilChNAh>ll<}9PrD`>LhD`|@?1I7Cfzg(<5I1O)b%rM z(#=XhR?MRrEA*8_AJ?>*;c z{u#bq;_0fZZJ-SRfUesjCvW(j3ICGEja83yoOOoZ#>XxSkO9C1ef94sAU6*O0E{l7 zufN=%*tEMqF|O#0$7;m_(}&;;K%MILQu zvQV86@6TC+ca%sWJk^Ry;1S6rJe^@hqEhK}vL&8OBw2$*5=f#DNDQX6HIqoh54=p+ z+VCfqlpn$Lc5)d=2U~U~0=Ybv34-zQ@mBE^D~U7`BrzBakVpo}WCA>cAWIO-xk`dq zX4)TQFpd)><4J|Fa-l?wSI6asOB8ZD6BBi!q1V85iDHKmiDd)qV2YrU8w--Gh~P+0 zeBO{xtU?;ow=_Nvgkm5OB$mryKhlVPu>y%)A`?hHk#b1>WMX(vIGmx}Bd%8@8Zos@ z?i>dr7(hCrr_47Y76QE?nM5JwLC$gTrI?O%^>Sgv@aB9FNv(Wx?T}LV2{*OU@77le z{X4{hua)U2g}8Ew)K?;jVfRbUKefj)1}m5fRpO0+$c*33L*J!U*R_ z@F_H#!4xBe`6$&Qp$x9p1dS?&Yq{@a^MO`;I65fA2>VW`SguqCsr%2)WUv8;jh^&6EbxQT;bjeZ4!8+F-pvsJ{nI((1&|o6z4}A-&H8i@ znIu9U&y_+8BjF19oX+o$`k@;#JPTBR7sLqv2OA;d#{Io*_`I(A8{2?9q5gl{FkHnv z0aqLe@!8;D0S^v*-p=*!=ZBp&*sULTB1`?{#Du#Tt|)F__rS;0M`Od8`{()5 zH=j->!Y`1d{yX5RDI;A2&|NiUr0cNfQn66ZCJ$so3~P9)zd`$tcOUp>4`S1(R0@>^ zB8QP4ON2@&#@|T@pTjcsc|wIxyFMSJFrs6Ch9eAQ*il0maO~eIjoY%m9_$~5Z~EZ- zO>pRj^P~10I>r9U55rgVPew(=!jd3>pqm&jbUp|b!-W8XZeqC5`5;sb7Xk>niQz)$ zgHSPC2q5Sth6|k!Ld9?)fS{WgE_6N!6~l!9f^K5C(D@)#3>N|jx{2XJ=Yvo&TnHfO zCWZ^04?@LoA%LKp7%p@^2o=MH0D^8}xX}3^R16ma2)c>kLg#}}Foex6A za3O%8n;0&1J_r@Vg#dzXVz|)xAXE$&0tmW^;X>zwP%&HxAm}EB3!M)_#c&~jpqm&j zbUp|b!-W8XZeqC5`5;sb7Xk>niQz)$gHSPC2q5StDlYBeM>rud{M=?d{D3B|?(j|c z;Z8hnkv9hb63qZ0H4Ok>zlYx+0DyuB01w09hex*qz;wx$(9t;xf$WGKhy&&Th3{_NJ~=}b!V-|&}KeZKvyl)6!0u9g5hQ(vyuuij_aI>XQ~sIove zVf1#u#YdJ!XWIiIz`I0{zG)J`r^i<6eq}r+FgmFf1X4!PtQ40*fwV`Pj(6|Q4i^Z< z0lW*69A?K$@8)mtqps}>&C*+gAE)QQI&x*FN7LhQ?zIX)y(U#a>q1 z$}A@o#H-SdgN3KcMTv=t{zu~orlzJgnT|(-i;9cqv+F}17U<_dUi+>eNqS9AOG~@b zsVEJp%1s|rp#8=wR(%@PImbDVk?72ixYc2>*zH9Mv@~ci##(m!FYEv}*xMX>Tv?vPaWG%Kmux#E0 zA*AQsBK;lA-+lzL(s5ja$B!GGN(tOtMYT{8EcpH zYj5+3h3S+I4#}wy6zlp z_pS!xUF~G{mitY$+DYY`PI{M|436ehh3xTGEh)Zw_P&%*UD|oZ`Q(HNg-wjrMn4>@ z?EDY4GaIzroUW6+&2?p)`Qp-_Hth@w?n%z~Rypa7;U8>@yODb>@ol;2rWJUO_Q;)M z^m5}AKic)Ry$_S3c{%MyL96xF5Oqjr^wN#FxbnPx*$#8J{+zLS^W=G3wXa5P4YsO` zpzSo%sWF;+zdLpLOGDrK)8L+&O~nT|`Ebq_LkjDt%GPtH^2haeZInN5t3H$8n|sZG zr=z8%)!WKYb{u{D8sNI( z`<^#%-+H;5P1F0*vh9B68lxSS-8)t|hXn4({;jg>Z8$y9wfR|c{%a>OPv>~Id2>ir zBDJ)WmOOVfA*50+bgf-bT-pS#^*E%eN&O+qqSBXNS{7QrEIjlY)7^2t-(EpOR89Md z7SbiS0G*lL>qdo!=DT@xhnO9&Keu&$kVoqQ%e8u;4{#laOjoYUR^_Q4)E$aC5K|NM ze%<%?JGOs+Uyu~XG|2xU^9*$K$gR>Qn<#Vpd6n%-*EFx-0#|#FG-1@in3{&UXM;Gu z=oboDE6f7(D@JQ2ymGwDyX+Kf6DZyK0&`_A1I+pAZUZxUbD%zS+FjBRF4+1N^ga+P)Ct-AD`jEoan%b%Q! z!-b6R)ZQ;#I;KK3$up;-uzHhsoKbH^`%1~7i;RWEW8+G{ZJSeCUB7GGs|eu4d%Di_ zu$y6HjtZw{cL|a!fbQj4*P5x7o5EY{rV7T)d%8^IK=i5=R}|RTOgpJ-?cVlc#ongm z(`S1_nd|+U)CC)>^cyx%RYJN`tLc`@!tf4-UA^GpSv{ex5P2)@|PG>x#SIS&6CL%eZOh?sQ+Da@VblY~qn zzgEtQlAkqYtnbcRl_&3lOXoK}S#~R{zP^4=dph?T-3$fJWo7T<&QkXMx8g>3uO=%`j|uO5wkE~5)c)(z=^hsA;_kqbRnkgt#;tiJ z1zmiv9bc!sslLB6TEx0ogY&r@c;eLpdTpG}*d$f!F2m_F%g0)%EX7;y2AkC$Js8k@ z^XJfx(x<(VV#`&suFK`NmkqUy%^U(2L50PW9qbc{i**y$zsSroQsUoK_K3n-%kD(^ zJNO9>LJMXkzE&yhQ^E{x^dy@-bxUPFY2a2b30dX}FE{xpn||cdzaQIGaiWudn?2dx zdCt6hgy#nu4D{1+yJwu85m^zI`BztQ=Zi+;fJ@iYA1P#^nH#DYEBNnAZ}a5-r)r)} oTDoPuQ_jL|LqF3Oyt4=1y$FxqxQC z-c4$M@Ic$0ngf5ma_`O96Q!Z2nqKG-^YPH(t-Un^dU5jYv*e2FN3*tOqN&^6>Vqbt z#p{LQ*eSnf9ssT!gv=n5y>&3fL?z~qz>`kYlD=0$9{RBw4x2^hHTl2AS;=fJc(7%t^9BnQesGdAY&q z-Ijx9RY5fBO+Vw6FQu(mMkt8ZXG1E8$$ zD0@lcEObX%mDEz{Jj*TtfB$1KYh0)Me#nK)(n~BLW>&M6627lVIrulFw9`_Lx{0P3 z^%Yh4ET@?PeJx~(zI;0Q*YeO6U0TAZzsP@*E*mcKPOg$}st?-i(k_2eDX9X9Os5B| zB4lCf<;-!*K~MWV_dSj3(wB;Si)-B}N~!gsYgWXka-`+Ty*FbPcyj>2k!qY?YWd*Z z3E;1FJ$M6vcaz%B+veYqNEIDwc0aV{ydY&_DN{1_eB*~Mxn!7ducUO zVa^7~o0Z%ER`F)>A%zf1P(Y3Hqc??=2}DRS#YB_^72OpT#e)s& ziWS_TpsXESS5a9(MMY^MBA_%;Towi0NoaAzIi9ooJHLM>97yi_zI*SR&%5_!{u$PL zE^r%WW?=>Zz%UPYS1;(D0sWFpjdde+H)ca`gJtf43IG@~TKD@6kg~@d0O$=Op8#b5 zXFh{3729wHQXXid5zC<20KjzA$hiDSP>JDz;Ub9xw)sL179$ckVEri^0!PLMBSh}e za?m?^fe$}Al1~?49a&~f4Fd`w29;clMjRzkFfkZbPI{s8o_QhD0Ee@dP5CXp1A#8DuhpK)`gruq-p^6H_h_ zGQ3>pbf<$X2W*5=DP!RAYPH%%ZEGWyhvSKKIvr0S;YlPMGy|ttE>UtdIEi9XSCF1K zuAqW17s-?&sRW~o%jHQ`N(U@fm#FvEeO+Q%Zz74Jn;k?Eui?t@L>mIWKPLgd*GHz3 zN9mU);N!t4Pz*|x3doPxub(VJs+1}sq+dwcD}OODv?m-+Z|;8AD;D>gTA`f13_{S2 zv|mq!&vF@v_W~7Cm7EXGUItytr2ej6DH8T=&L@#{$`{uTYD8af(hH9H~GgTn>*xA}}Z<28m=C!(b*n2Gl3YBWE9CQwc zD&%WAzbopeZt(C-yzaXoO7uV22nBc9Kih_{>#BdS4e%4{|F;c&Rm_jzO2R<_3*S?~ zJp*62b6xxSX=n9x>*t-w)O|TIpe}|gimUG)A`}1FSYPI@`2o6aj8f_6Q%MBqg(vF% zcDowNaMwU&S3?=@+UMyj5h+=u?rgAO125e-XxH)X4c+X4EISItmcqothv6QcA`KW7 z;3|U7VTJBIq0qX0;6lHSfd-Bc5PdSeqk+)v*tJy#w`KYs>>7n``k?zweD4kCXYJX0 ziv61(`mX5Tj0%f|CV>G#Hc?#2d|)by3kC$)L~$YWfvG4i7!YI=#f8iVrlPoDK#)xo z7cw81isFI+K{iob$b4WbiVFq=*+g+6^MR=-E*KDG6UBwh2d1L9U_g*f6c;idn2O?p z0YNrVT*!Q2DvApR1ldG!A@hN$C@vTfWD~`O%m=2TxL`n#O%xY0ADD{bf&oD`QC!G; zU@D3W1_aqeaUt`8sVFWO5M&d@h0F)0qPSo{kWCa9G9Q?V;(`G|Hc?#2d|)by3kC$) zL~$YWfvG4i7!YI=#f8iVrlPoDK#)yDTxNZbaDo!(xlJ|nfF@D9cp&s}Cx-9t#Q}im zDF6_+1_0VWLhmmCKt%w6mtoMuqdNiMd+FBDYjXg=IK#u$*+)~-urnsgyLfDFY+KB` z$5*Bf8L(sQC}!A$>vmI9HcsUQO(|KDUOZM5y2ziCaP-8z4_0h)VE)5p^$)!gDmQb2 zl1SoFzM}RuKbdDA$xYd$oG{VCB?^0@WxLJuNe5~8r9AuWC#8;sb?w`n<}^6nAOGUk z<=RD;R{YRhrf8=7Kgz!C=A0ZX&TV;?w;@&)Hslo;HsuvdX0EAdUlKr@N`jtzKoGu8QI)3=T zu+l&0Wld-uxuZ?%GT{D$2UhWz{e_d_Bla{NNLs&sa9Vo$;2*CZ@|qDp!aDTwo}{Fa z#wI5J9b<$cmpVV$F?qeu%-IBUK}*#&>qY02m5ke!l^E9k44Mt4)cIM$!7Voh?vqDZ z2b_$XKlN&EZk*+)%GM~8&Rycth?I3;VC&nrL^3&ETW@Mr_N+v@A)fnwRZ*L8N~&t| zG|HjOwVtG-$!Al8ZilBS9}i7?NGzY*{HV1u{9`rqJivq&?i{!sEX}?Y2RH&1yAoq~ zj2Q<;xLh=M%xZV>Tk+a!&Tx;+ghR*NGlyz6ojGM@bYkW3^ez0PjIfHI7k0c}UzaA% zOPr9kx4KdkhVvY_5r{R({w8*xM5rt}V1J>|;oai79nsU%*NrK6@>BhFa+(&G&9T}s zWj`m&vvAkE^oEI&i?PpVZQHnc_kfrtr_kcZBXKh$jT0pE^W#?9ak$vqi>|EyYrBbK z`-9Q}KBiXtNS%xkxvyeMq*o8fnK>f`q*#p_IfAKn*SD;Yd5 z%KiD_A5HSM9l3kaCzJZfZ&e6m_AjwjPjWO7*QPa?CHs8*zHYl#J-YdDOukQQnqb$u znD(brK6GSlrrMOyx3zWDG|sd9Xs>0)5L5razr397Ra@z(z0=Wh#oyAx;<6&&X}|rQ zVwJ>tgm34Yxvl9gj|(2EhEU7?sJ8z=I^DeSxMSIA*VJ}}@%uvXcz$cr+`}c7mX^O3 z(CP}B6r1EXsz{JY*Iku_$j~`Go$%M4Zmb$ zg!*eWm$<@KUdJCb`D>j9SEqSqXN7D5lH9Au+zD#P&)mp0=eQ+~KbI4tC>znrE707F ziI0Z>?A~qJ^i^Yhg?hnPWCg^s~j6rJPLd9`mSDz!S} z7%jq&6a@OtqEEZz=58(V%c~Ne@vn_3KBFvt^)fiu=~RZu;%CnY_BChk?GGyxZ`*ga zFW&JqlDG5?r_xMz*mTr}-FW-XS*OlEuBlrLEcm@j7;7z=Grqh&v0_$^A}>u_Uq5qr zN_O&r3!#St_G+8z3!2Mw%O~9RBz;E>j{B~1cdkw4+JLf8VC%KBB2d$&oq zCHp6M1uwnxbhY2s8%wrcDr~tPjj1|4IyXPjZBoG)TjhnO?+O~ z(K1C^+Phuj9;xP~C-ItIlFm;!`|b2-F-fFm?v<5T)UwAol-I0eVv}y1Y@2g(yuAFk zVE3)mXs$jLfrQj9*dlP zZnbdh02ki}d0KUu&miT#C1Q13o|v=z#kb*9U$fS_yQyuWl2dbN$>nYKqxn{Mr%N5vC2Mg9cQ%S>~VP9T`-j>l?qdnR}aDfBW9FBreF< z@_zf9+FFP8&gqJJLe>G`m-_D{Klwb@)(E#A98i5LjJ=?UtnTQjI43@6_62 From 467217870b2f9f2e645530ee1f2cc65e991e3ee3 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 22 Apr 2020 15:15:22 +0800 Subject: [PATCH 250/375] =?UTF-8?q?REPORT-30347=20=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/start/LifecycleFatalErrorHandler.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java b/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java index 252b01dc1..ef416416c 100644 --- a/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java +++ b/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java @@ -1,5 +1,6 @@ package com.fr.start; +import com.fr.common.report.ReportState; import com.fr.design.RestartHelper; import com.fr.design.dialog.ErrorDialog; import com.fr.design.dialog.FineJOptionPane; @@ -10,6 +11,9 @@ import com.fr.exit.DesignerExiter; import com.fr.general.IOUtils; import com.fr.io.utils.ResourceIOUtils; import com.fr.log.FineLoggerFactory; +import com.fr.process.ProcessEventPipe; +import com.fr.process.engine.core.CarryMessageEvent; +import com.fr.process.engine.core.FineProcessContext; import com.fr.stable.StableUtils; import com.fr.stable.lifecycle.ErrorType; import com.fr.stable.lifecycle.FineLifecycleFatalError; @@ -45,6 +49,10 @@ public class LifecycleFatalErrorHandler { public void handle(FineLifecycleFatalError fatal) { SplashContext.getInstance().hide(); + ProcessEventPipe eventPipe = FineProcessContext.getParentPipe(); + if (eventPipe != null) { + eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue())); + } map.get(fatal.getErrorType()).handle(fatal); } From 8f8228e8b26c9356183fefbeee1da7930861cfc5 Mon Sep 17 00:00:00 2001 From: Maksim Date: Wed, 22 Apr 2020 18:04:01 +0800 Subject: [PATCH 251/375] =?UTF-8?q?cpt=E4=B8=8Ecptx=E5=8F=A6=E5=AD=98?= =?UTF-8?q?=E4=B8=BA=E6=96=87=E4=BB=B6=E5=90=8D=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/file/FILEChooserPane.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 0ca481b09..96e722d11 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -505,12 +505,21 @@ public class FILEChooserPane extends BasicPane { if (StringUtils.isEmpty(fileName) || StringUtils.isEmpty(filterExtension) || fileFilter.containsExtension(fileExtension.getExtension())) { return fileName; } - if (!ComparatorUtils.equals(fileNameExtension, filterExtension)) { + if (!ComparatorUtils.equals(fileNameExtension, filterExtension) && !isMapping(fileNameExtension, filterExtension)) { return fileName + filterExtension; } return fileNameWithOutExtension + filterExtension; } + private boolean isMapping(String fromExtension, String toExtension){ + if(FileExtension.CPTX.matchExtension(fromExtension)){ + return FileExtension.CPT.matchExtension(toExtension); + }else if(FileExtension.CPT.matchExtension(fromExtension)){ + return FileExtension.CPTX.matchExtension(toExtension); + } + return false; + } + private void doCancel() { this.locationBtnPane.setPopDir(null); dialogExit(); From 7a5ed6513ff8d2ab094cda755b8327de4488a450 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 22 Apr 2020 22:20:20 +0800 Subject: [PATCH 252/375] =?UTF-8?q?REPORT-30369=20=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../creator/cardlayout/XWCardMainBorderLayout.java | 9 --------- .../designer/creator/cardlayout/XWTabFitLayout.java | 6 +----- .../com/fr/design/mainframe/WidgetPropertyPane.java | 2 +- .../ui/designer/mobile/TabMobileWidgetDefinePane.java | 10 ---------- 4 files changed, 2 insertions(+), 25 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java index c539f7044..25da3e775 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java @@ -514,13 +514,4 @@ public class XWCardMainBorderLayout extends XWBorderLayout { public boolean isSupportShared() { return true; } - - @Override - public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { - if (FormDesignerUtils.isAppRelayout(WidgetPropertyPane.getInstance().getEditingFormDesigner())) { - return new WidgetPropertyUIProvider[] {new MobileBooKMarkUsePropertyUI(this)}; - } else { - return super.getWidgetPropertyUIProviders(); - } - } } 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 f17ac0925..508f3f7df 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 @@ -593,11 +593,7 @@ public class XWTabFitLayout extends XWFitLayout { */ @Override public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { - if (FormDesignerUtils.isAppRelayout(WidgetPropertyPane.getInstance().getEditingFormDesigner())) { - return new WidgetPropertyUIProvider[] {new MobileBookMarkPropertyUI(this), new MobileBooKMarkUsePropertyUI(this)}; - } else { - return new WidgetPropertyUIProvider[0]; - } + return new WidgetPropertyUIProvider[0]; } @Override diff --git a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java index 7fb6f2014..c37b4ba9a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java @@ -181,7 +181,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper if (selection != null && xCreator != null) { embeddedPropertyUIProviders = selection.getSelectedCreator().getWidgetPropertyUIProviders(); if(!designer.getDesignerMode().isFormParameterEditor()) { - if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class, XWCardTagLayout.class, XWCardMainBorderLayout.class) && FormDesignerUtils.isAppRelayout(designer)) { + if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class, XWCardTagLayout.class) && FormDesignerUtils.isAppRelayout(designer)) { embeddedPropertyUIProviders = ArrayUtils.insert(0, embeddedPropertyUIProviders, new MobileBookMarkPropertyUI(xCreator)); } if (xCreator.supportMobileStyle()) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java index d4f1c0a11..5919985d5 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java @@ -34,7 +34,6 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { private MobileComponentMarginPane marginPane; private MobileComponentLayoutIntervalPane intervalPane; private MobileBookMarkUsePane mobileBookMarkUsePane; - private MobileAdvanceInnerPane mobileAdvanceInnerPane; public TabMobileWidgetDefinePane(XCreator xCreator) { this.xCreator = xCreator; @@ -72,10 +71,7 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { intervalPane = new MobileComponentLayoutIntervalPane(FormTabPaddingAttrMark.XML_TAG); if (FormDesignerUtils.isAppRelayout(designer)) { mobileBookMarkUsePane = new MobileBookMarkUsePane(); - mobileAdvanceInnerPane = new MobileAdvanceInnerPane(xCreator); innerAdvancePane.add(mobileBookMarkUsePane, BorderLayout.CENTER); - innerAdvancePane.add(mobileAdvanceInnerPane, BorderLayout.SOUTH); - } innerAdvancePane.add(marginPane, BorderLayout.NORTH); UIExpandablePane advancePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, innerAdvancePane); @@ -105,9 +101,6 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { if (mobileBookMarkUsePane != null) { mobileBookMarkUsePane.populate(xCreator); } - if (mobileAdvanceInnerPane != null) { - mobileAdvanceInnerPane.populate(); - } } @Override @@ -124,8 +117,5 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { if (mobileBookMarkUsePane != null) { mobileBookMarkUsePane.update(xCreator); } - if (mobileAdvanceInnerPane != null) { - this.mobileAdvanceInnerPane.update(); - } } } From b08c9f9ec17905a9c81d6e4203e51d58bd5181c0 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 22 Apr 2020 15:15:22 +0800 Subject: [PATCH 253/375] =?UTF-8?q?REPORT-30347=20=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/start/LifecycleFatalErrorHandler.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java b/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java index 252b01dc1..ef416416c 100644 --- a/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java +++ b/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java @@ -1,5 +1,6 @@ package com.fr.start; +import com.fr.common.report.ReportState; import com.fr.design.RestartHelper; import com.fr.design.dialog.ErrorDialog; import com.fr.design.dialog.FineJOptionPane; @@ -10,6 +11,9 @@ import com.fr.exit.DesignerExiter; import com.fr.general.IOUtils; import com.fr.io.utils.ResourceIOUtils; import com.fr.log.FineLoggerFactory; +import com.fr.process.ProcessEventPipe; +import com.fr.process.engine.core.CarryMessageEvent; +import com.fr.process.engine.core.FineProcessContext; import com.fr.stable.StableUtils; import com.fr.stable.lifecycle.ErrorType; import com.fr.stable.lifecycle.FineLifecycleFatalError; @@ -45,6 +49,10 @@ public class LifecycleFatalErrorHandler { public void handle(FineLifecycleFatalError fatal) { SplashContext.getInstance().hide(); + ProcessEventPipe eventPipe = FineProcessContext.getParentPipe(); + if (eventPipe != null) { + eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue())); + } map.get(fatal.getErrorType()).handle(fatal); } From 7f08ca3560099aa19dcfd6388e0ed85d9f4c20c0 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 22 Apr 2020 22:20:20 +0800 Subject: [PATCH 254/375] =?UTF-8?q?REPORT-30369=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../creator/cardlayout/XWCardMainBorderLayout.java | 9 --------- .../designer/creator/cardlayout/XWTabFitLayout.java | 6 +----- .../com/fr/design/mainframe/WidgetPropertyPane.java | 2 +- .../ui/designer/mobile/TabMobileWidgetDefinePane.java | 10 ---------- 4 files changed, 2 insertions(+), 25 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java index c51fe491e..25da3e775 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java @@ -514,13 +514,4 @@ public class XWCardMainBorderLayout extends XWBorderLayout { public boolean isSupportShared() { return true; } - - @Override - public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { - if (FormDesignerUtils.isAppRelayout(WidgetPropertyPane.getInstance().getEditingFormDesigner())) { - return new WidgetPropertyUIProvider[] {new MobileBooKMarkUsePropertyUI(this)}; - } else { - return super.getWidgetPropertyUIProviders(); - } - } } 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 f17ac0925..508f3f7df 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 @@ -593,11 +593,7 @@ public class XWTabFitLayout extends XWFitLayout { */ @Override public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { - if (FormDesignerUtils.isAppRelayout(WidgetPropertyPane.getInstance().getEditingFormDesigner())) { - return new WidgetPropertyUIProvider[] {new MobileBookMarkPropertyUI(this), new MobileBooKMarkUsePropertyUI(this)}; - } else { - return new WidgetPropertyUIProvider[0]; - } + return new WidgetPropertyUIProvider[0]; } @Override diff --git a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java index 7fb6f2014..c37b4ba9a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java @@ -181,7 +181,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper if (selection != null && xCreator != null) { embeddedPropertyUIProviders = selection.getSelectedCreator().getWidgetPropertyUIProviders(); if(!designer.getDesignerMode().isFormParameterEditor()) { - if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class, XWCardTagLayout.class, XWCardMainBorderLayout.class) && FormDesignerUtils.isAppRelayout(designer)) { + if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class, XWCardTagLayout.class) && FormDesignerUtils.isAppRelayout(designer)) { embeddedPropertyUIProviders = ArrayUtils.insert(0, embeddedPropertyUIProviders, new MobileBookMarkPropertyUI(xCreator)); } if (xCreator.supportMobileStyle()) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java index d4f1c0a11..5919985d5 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java @@ -34,7 +34,6 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { private MobileComponentMarginPane marginPane; private MobileComponentLayoutIntervalPane intervalPane; private MobileBookMarkUsePane mobileBookMarkUsePane; - private MobileAdvanceInnerPane mobileAdvanceInnerPane; public TabMobileWidgetDefinePane(XCreator xCreator) { this.xCreator = xCreator; @@ -72,10 +71,7 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { intervalPane = new MobileComponentLayoutIntervalPane(FormTabPaddingAttrMark.XML_TAG); if (FormDesignerUtils.isAppRelayout(designer)) { mobileBookMarkUsePane = new MobileBookMarkUsePane(); - mobileAdvanceInnerPane = new MobileAdvanceInnerPane(xCreator); innerAdvancePane.add(mobileBookMarkUsePane, BorderLayout.CENTER); - innerAdvancePane.add(mobileAdvanceInnerPane, BorderLayout.SOUTH); - } innerAdvancePane.add(marginPane, BorderLayout.NORTH); UIExpandablePane advancePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, innerAdvancePane); @@ -105,9 +101,6 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { if (mobileBookMarkUsePane != null) { mobileBookMarkUsePane.populate(xCreator); } - if (mobileAdvanceInnerPane != null) { - mobileAdvanceInnerPane.populate(); - } } @Override @@ -124,8 +117,5 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { if (mobileBookMarkUsePane != null) { mobileBookMarkUsePane.update(xCreator); } - if (mobileAdvanceInnerPane != null) { - this.mobileAdvanceInnerPane.update(); - } } } From 95279dbff846440e731f1ec0b4e3e03a96545c36 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 23 Apr 2020 14:51:17 +0800 Subject: [PATCH 255/375] =?UTF-8?q?REPORT-29118=20mac=E4=B8=8B=E5=B1=8F?= =?UTF-8?q?=E8=94=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/os/impl/SupportOSImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java index 5b8d4d2e8..d799d0046 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java @@ -88,7 +88,7 @@ public enum SupportOSImpl implements SupportOS { NON_GUARDIAN_START { @Override public boolean support() { - return OperatingSystem.isLinux() || Arch.getArch() == Arch.ARM; + return OperatingSystem.isLinux() || Arch.getArch() == Arch.ARM || OperatingSystem.isMacos(); } }, From c600b1ef2e99126657f464c61c9c229779502cde Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 23 Apr 2020 15:33:37 +0800 Subject: [PATCH 256/375] =?UTF-8?q?REPORT-29815=20=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E4=B8=8B=E6=8A=A5=E8=A1=A8=E5=92=8C=E8=A1=A8=E5=8D=95=E7=9A=84?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=B1=9E=E6=80=A7=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/actions/FormMobileAttrAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java index deec25c0b..6227c169b 100644 --- a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java @@ -112,7 +112,7 @@ public class FormMobileAttrAction extends JTemplateAction { private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() { @Override public char getMnemonic() { - return 'T'; + return 'P'; } @Override From 6a1934fd1b7597720e3dba9f9b4e316765f05912 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 23 Apr 2020 17:45:51 +0800 Subject: [PATCH 257/375] =?UTF-8?q?REPORT-29815=20=20=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/unit/UnitConvertUtil.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java b/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java index 406ddcfdd..520430d51 100644 --- a/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java +++ b/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java @@ -6,7 +6,11 @@ import com.fr.design.unit.impl.CMReportLengthUNIT; import com.fr.design.unit.impl.INCHReportLengthUNIT; import com.fr.design.unit.impl.MMReportLengthUNIT; import com.fr.design.unit.impl.PTReportLengthUNIT; - +import com.fr.general.GeneralContext; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -18,6 +22,23 @@ public class UnitConvertUtil { private static List lengthUNITList = new ArrayList(); static { + GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + @Override + public void on(PluginEvent pluginEvent) { + initSupportedReportLengthUNIT(); + } + }, new PluginFilter() { + @Override + public boolean accept(PluginContext pluginContext) { + return pluginContext.contain(ReportLengthUNITProvider.MARK_STRING); + } + }); + + initSupportedReportLengthUNIT(); + } + + private static void initSupportedReportLengthUNIT(){ + lengthUNITList.clear(); lengthUNITList.add(new MMReportLengthUNIT()); lengthUNITList.add(new CMReportLengthUNIT()); lengthUNITList.add(new INCHReportLengthUNIT()); From ad08ec0ec4fba0d7217aea72b82f09e9b9c8274c Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 23 Apr 2020 14:51:17 +0800 Subject: [PATCH 258/375] =?UTF-8?q?REPORT-29118=20mac=E4=B8=8B=E5=B1=8F?= =?UTF-8?q?=E8=94=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/os/impl/SupportOSImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java index 5b8d4d2e8..d799d0046 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java @@ -88,7 +88,7 @@ public enum SupportOSImpl implements SupportOS { NON_GUARDIAN_START { @Override public boolean support() { - return OperatingSystem.isLinux() || Arch.getArch() == Arch.ARM; + return OperatingSystem.isLinux() || Arch.getArch() == Arch.ARM || OperatingSystem.isMacos(); } }, From 0d02b5a02a50431737739edab2fa9e550a4f7ce5 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 24 Apr 2020 11:07:08 +0800 Subject: [PATCH 259/375] =?UTF-8?q?REPORT-30467=20=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E6=97=B6=E9=95=BF=E5=BB=B6=E9=95=BF=20=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E4=B8=8E=E7=A1=AE=E5=AE=9A=E5=AF=B9=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/DesignerSuperListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java b/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java index f6fa3c937..f5c917464 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java @@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit; public class DesignerSuperListener { private static final DesignerSuperListener INSTANCE = new DesignerSuperListener(); - private static final int ONCE_DELAY = 90; + private static final int ONCE_DELAY = 180; private static final int FIXED_DELAY = 0; private static final int FIXED_FREQ = 2; @@ -116,6 +116,7 @@ public class DesignerSuperListener { @Override protected void okEvent() { dispose(); + DesignerLauncher.getInstance().exit(); } @Override @@ -125,7 +126,6 @@ public class DesignerSuperListener { } }; dialog.setVisible(true); - DesignerLauncher.getInstance().exit(); } private void startFallBackListener() { From a95a41adcb75bad379730ac30f87cd5cb1188cbf Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 24 Apr 2020 11:07:08 +0800 Subject: [PATCH 260/375] =?UTF-8?q?REPORT-30467=20=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E6=97=B6=E9=95=BF=E5=BB=B6=E9=95=BF=20=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E4=B8=8E=E7=A1=AE=E5=AE=9A=E5=AF=B9=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/DesignerSuperListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java b/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java index f6fa3c937..f5c917464 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java @@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit; public class DesignerSuperListener { private static final DesignerSuperListener INSTANCE = new DesignerSuperListener(); - private static final int ONCE_DELAY = 90; + private static final int ONCE_DELAY = 180; private static final int FIXED_DELAY = 0; private static final int FIXED_FREQ = 2; @@ -116,6 +116,7 @@ public class DesignerSuperListener { @Override protected void okEvent() { dispose(); + DesignerLauncher.getInstance().exit(); } @Override @@ -125,7 +126,6 @@ public class DesignerSuperListener { } }; dialog.setVisible(true); - DesignerLauncher.getInstance().exit(); } private void startFallBackListener() { From bde8a6bf5f8cd59ea5572d70b112b42b485b75f9 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 24 Apr 2020 17:43:21 +0800 Subject: [PATCH 261/375] =?UTF-8?q?REPORT-29864=20=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E6=95=B0=E6=8D=AE=E9=9B=86=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/server/GlobalTableDataAction.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java b/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java index deef91f0c..84591579e 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java @@ -77,17 +77,7 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS } protected void renameConnection(final String oldName, final String newName) { - Configurations.update(new Worker() { - @Override - public void run() { - tableDataConfig.renameTableData(oldName, newName); - } - - @Override - public Class[] targets() { - return new Class[]{TableDataConfig.class, ProcedureConfig.class}; - } - }); + tableDataConfig.renameTableData(oldName, newName); } }; final BasicDialog globalTableDataDialog = globalTableDataPane.showLargeWindow(designerFrame, null); From 09941b786682b6e96a88cf59667295c5789b5b41 Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Sun, 26 Apr 2020 11:38:45 +0800 Subject: [PATCH 262/375] EPORT-28838 bugfix --- .../main/java/com/fr/design/gui/style/BorderPane.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java index da0cd32ed..0dcfe4c21 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java @@ -229,6 +229,16 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setHorizontalColor(lineColor); cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); + if (leftToggleButton.isSelected() && bottomToggleButton.isSelected() && rightToggleButton.isSelected() && topToggleButton.isSelected()) { + outerToggleButton.setSelected(true); + } else { + outerToggleButton.setSelected(false); + } + if (verticalToggleButton.isSelected() && horizontalToggleButton.isSelected()) { + innerToggleButton.setSelected(true); + } else { + innerToggleButton.setSelected(false); + } return cellBorderStyle; } From cd3447b80ee31e1c99e6e61621f53eb3f9d4d175 Mon Sep 17 00:00:00 2001 From: Bryant Date: Sun, 26 Apr 2020 15:44:08 +0800 Subject: [PATCH 263/375] =?UTF-8?q?REPORT-28922=20=E6=AD=A3=E5=A6=82zack?= =?UTF-8?q?=E6=89=80=E8=AF=B4=EF=BC=8C=E5=88=97=E6=95=B0=E8=BE=83=E5=B0=91?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5=E6=B2=A1=E6=9C=89=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java | 4 ++-- .../data/tabledata/tabledatapane/EmbeddedTableDataPane.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java index 6a3b707ab..ba5d42bd8 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java @@ -25,7 +25,7 @@ import java.util.Date; public class EmbeddedTableDataDefinedPane extends BasicPane{ - + private static final int MIN_CELL_WIDTH = 30; private EmbeddedTableData tableData; private JTable dataJTable; private UIButton add; @@ -64,7 +64,7 @@ public class EmbeddedTableDataDefinedPane extends BasicPane{ // 行号显示 TableColumn tableColumn = dataJTable.getColumnModel().getColumn(0); tableColumn.setCellRenderer(new CellRenderer()); - tableColumn.setMaxWidth(dataJTable.getColumnCount()); + tableColumn.setMaxWidth(Math.max(dataJTable.getColumnCount(), MIN_CELL_WIDTH)); // 控制按钮 add = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add")); diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java index afefe7264..8b47b222d 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java @@ -34,6 +34,7 @@ import java.util.Date; public class EmbeddedTableDataPane extends AbstractTableDataPane { + private static final int MIN_CELL_WIDTH = 30; private JTable dataJTable ; private JScrollPane scrollPane; private UILabel coordinatelabel; @@ -220,7 +221,7 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane Date: Sun, 26 Apr 2020 16:14:28 +0800 Subject: [PATCH 264/375] =?UTF-8?q?REPORT-28242=20=E3=80=90=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=B8=93=E9=A2=98=E3=80=91=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?-=E9=A2=84=E5=AE=9A=E4=B9=89=E6=A0=B7=E5=BC=8F-=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/server/StyleListAction.java | 5 ++- .../actions/server/StyleManagerPane.java | 4 ++ .../com/fr/design/present/StyleArrayPane.java | 43 +++++++++++++++++-- 3 files changed, 47 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/server/StyleListAction.java b/designer-realize/src/main/java/com/fr/design/actions/server/StyleListAction.java index 4f57bdc2a..ff16a3363 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/server/StyleListAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/server/StyleListAction.java @@ -40,10 +40,13 @@ public class StyleListAction extends UpdateAction { public void actionPerformed(ActionEvent evt) { DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); final StyleManagerPane styleListPane = new StyleManagerPane(); - BasicDialog styleListDialog = styleListPane.showWindow(designerFrame); + final BasicDialog styleListDialog = styleListPane.showWindow(designerFrame); styleListDialog.addDialogActionListener(new DialogActionAdapter() { @Override public void doOk() { + if (!styleListPane.isNamePermitted()) { + styleListDialog.setDoOKSucceed(false); + } Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { @Override public void run() { diff --git a/designer-realize/src/main/java/com/fr/design/actions/server/StyleManagerPane.java b/designer-realize/src/main/java/com/fr/design/actions/server/StyleManagerPane.java index 37e62cb70..51ca8a7d1 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/server/StyleManagerPane.java +++ b/designer-realize/src/main/java/com/fr/design/actions/server/StyleManagerPane.java @@ -34,4 +34,8 @@ public class StyleManagerPane extends BasicPane { public void update(ServerPreferenceConfig configManager) { this.styleArrayPane.update(configManager); } + + public boolean isNamePermitted() { + return styleArrayPane.isNamePermitted(); + } } diff --git a/designer-realize/src/main/java/com/fr/design/present/StyleArrayPane.java b/designer-realize/src/main/java/com/fr/design/present/StyleArrayPane.java index 76c1e7261..81eda0e7a 100644 --- a/designer-realize/src/main/java/com/fr/design/present/StyleArrayPane.java +++ b/designer-realize/src/main/java/com/fr/design/present/StyleArrayPane.java @@ -3,26 +3,31 @@ package com.fr.design.present; import com.fr.base.Style; import com.fr.config.ServerPreferenceConfig; import com.fr.config.StyleMap; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.controlpane.AbstractNameableCreator; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.UnrepeatedNameHelper; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ModNameActionListener; -import com.fr.design.mainframe.DesignerContext; +import com.fr.design.i18n.Toolkit; import com.fr.design.style.StylePane; +import com.fr.general.ComparatorUtils; import com.fr.general.NameObject; import com.fr.stable.Nameable; -import com.fr.transaction.Configurations; -import com.fr.transaction.WorkerAdaptor; +import com.fr.stable.StringUtils; +import javax.swing.*; import java.util.ArrayList; +import java.util.Arrays; import java.util.Iterator; import java.util.List; public class StyleArrayPane extends JListControlPane { - + + private boolean namePermitted = true; + /** * Constructor. */ @@ -30,11 +35,37 @@ public class StyleArrayPane extends JListControlPane { super(); this.addModNameActionListener(new ModNameActionListener() { public void nameModed(int index, String oldName, String newName) { + if (ComparatorUtils.equals(oldName, newName)) { + return; + } + namePermitted = true; + String[] allNames = nameableList.getAllNames(); + allNames[index] = StringUtils.EMPTY; + if (StringUtils.isEmpty(newName)) { + showTipDialogAndReset(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Empty_Name"), index); + return; + } + if (isNameRepeated(new List[] {Arrays.asList(allNames)}, newName)) { + showTipDialogAndReset(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Duplicate_Name", newName), index); + return; + } populateSelectedValue(); } }); } + + private void showTipDialogAndReset(String content, int index) { + nameableList.stopEditing(); + + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(StyleArrayPane.this), + content, + Toolkit.i18nText("Fine-Design_Basic_Alert"), + JOptionPane.WARNING_MESSAGE); + setIllegalIndex(index); + namePermitted = false; + } + /** * 创建样式设置组件 * @@ -105,4 +136,8 @@ public class StyleArrayPane extends JListControlPane { configManager.setStyleMap(styleMap); } + + public boolean isNamePermitted() { + return namePermitted; + } } From bd59cb594cbf1d0316cc4fe62b4f02ddb11d1b23 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 26 Apr 2020 20:14:03 +0800 Subject: [PATCH 265/375] =?UTF-8?q?CHART-3667=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=9B=9E=E9=80=80=EF=BC=8C=E7=BA=BF=E5=9E=8B=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=99=9A=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartLineTypePane.java | 50 ++--- .../component/VanChartLineWidthPane.java | 6 - .../component/VanChartTrendLinePane.java | 88 ++++---- .../background/VanChartAlertValuePane.java | 134 ++++++------ .../background/VanChartAxisAreaPane.java | 190 +++++++++--------- .../VanChartScatterLineTypePane.java | 21 +- 6 files changed, 224 insertions(+), 265 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java index f5adcf26d..4e8f762da 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java @@ -2,7 +2,6 @@ package com.fr.van.chart.designer.component; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.i18n.Toolkit; @@ -13,8 +12,6 @@ import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.base.VanChartAttrLine; import com.fr.plugin.chart.type.LineStyle; import com.fr.plugin.chart.type.LineType; -import com.fr.stable.Constants; -import com.fr.stable.CoreConstants; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; @@ -30,8 +27,10 @@ import java.util.Arrays; public class VanChartLineTypePane extends BasicPane { private static final long serialVersionUID = -6581862503009962973L; - //线型支持虚线 恢复用注释。下面1行删除。 - protected LineComboBox lineWidth;//线型 + + private static final double LINE_WIDTH_MIN_VALUE = 0.5; + private static final double LINE_WIDTH_DIERTA_VALUE = 0.5; + private static final double LINE_WIDTH_DEFAULT_VALUE = 2; private LineTypeComboBox lineTypeComboBox;//线型 private UISpinner lineWidthSpinner;//线宽 @@ -42,14 +41,14 @@ public class VanChartLineTypePane extends BasicPane { private JPanel lineStylePane; public VanChartLineTypePane() { - //线型支持虚线 恢复用注释。下面1行删除。 - lineWidth = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); JPanel typeAndWidthPane = createTypeAndWidthPane(); createLineStyle(); - nullValueBreak = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")}); + nullValueBreak = new UIButtonGroup(new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Open"), + Toolkit.i18nText("Fine-Design_Chart_Close")}); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -67,8 +66,7 @@ public class VanChartLineTypePane extends BasicPane { lineStylePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); this.setLayout(new BorderLayout(0, 6)); - //线型支持虚线 恢复用注释。取消注释。 - //this.add(typeAndWidthPane, BorderLayout.NORTH); + this.add(typeAndWidthPane, BorderLayout.NORTH); this.add(lineStylePane, BorderLayout.CENTER); } @@ -76,7 +74,7 @@ public class VanChartLineTypePane extends BasicPane { lineTypeComboBox = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH}); - lineWidthSpinner = new UISpinner(0.5, Integer.MAX_VALUE, 0.5, 2); + lineWidthSpinner = new UISpinner(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE); lineTypeComboBox.addActionListener(new ActionListener() { @Override @@ -117,12 +115,6 @@ public class VanChartLineTypePane extends BasicPane { protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) { return new Component[][]{ - //线型支持虚线 恢复用注释。下面5行删除。 - new Component[]{null, null}, - new Component[]{ - FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), - UIComponentUtils.wrapWithBorderLayoutPane(lineWidth) - }, lineStyleComponent, nullValueBreakComponent }; @@ -141,16 +133,10 @@ public class VanChartLineTypePane extends BasicPane { } public void checkLarge(boolean large) { - //线型支持虚线 恢复用注释。下面4行删除。 if (large) { - lineWidth.setSelectedLineStyle(Constants.LINE_NONE); + lineTypeComboBox.setSelectedItem(LineType.NONE); } - lineWidth.setEnabled(!large); - //线型支持虚线 恢复用注释。取消注释。 -// if (large) { -// lineTypeComboBox.setSelectedItem(LineType.NONE); -// } -// lineTypeComboBox.setEnabled(!large); + lineTypeComboBox.setEnabled(!large); lineStyle.setEnabled(!large); } @@ -162,11 +148,8 @@ public class VanChartLineTypePane extends BasicPane { if (line == null) { line = initVanChartAttrLine(); } - //线型支持虚线 恢复用注释。下面1行删除。 - lineWidth.setSelectedLineStyle(line.getLineWidth()); - //线型支持虚线 恢复用注释。取消注释。 -// lineTypeComboBox.setSelectedItem(line.getLineType()); -// lineWidthSpinner.setValue(line.getLineWidth()); + lineTypeComboBox.setSelectedItem(line.getLineType()); + lineWidthSpinner.setValue(line.getLineWidth()); lineStyle.setSelectedItem(line.getLineStyle()); nullValueBreak.setSelectedIndex(line.isNullValueBreak() ? 0 : 1); } @@ -177,11 +160,8 @@ public class VanChartLineTypePane extends BasicPane { public VanChartAttrLine update() { VanChartAttrLine line = new VanChartAttrLine(); - //线型支持虚线 恢复用注释。下面1行删除。 - line.setLineWidth(lineWidth.getSelectedLineStyle()); - //线型支持虚线 恢复用注释。取消注释。 -// line.setLineType((LineType) lineTypeComboBox.getSelectedItem()); -// line.setLineWidth(lineWidthSpinner.getValue()); + line.setLineType((LineType) lineTypeComboBox.getSelectedItem()); + line.setLineWidth(lineWidthSpinner.getValue()); line.setLineStyle(lineStyle.getSelectedItem()); line.setNullValueBreak(nullValueBreak.getSelectedIndex() == 0); return line; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java index ed06b3d4d..48f622654 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java @@ -1,8 +1,5 @@ package com.fr.van.chart.designer.component; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.i18n.Toolkit; - import java.awt.Component; /** @@ -14,9 +11,6 @@ public class VanChartLineWidthPane extends VanChartLineTypePane { @Override protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) { return new Component[][]{ - //线型支持虚线 恢复用注释。下面2行删除。 - new Component[]{null, null}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineWidth}, nullValueBreakComponent }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java index de01ab612..bfe2bbf5d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java @@ -4,7 +4,6 @@ import com.fr.chart.base.AttrColor; import com.fr.chart.base.AttrLineStyle; import com.fr.chart.base.LineStyleInfo; import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; @@ -17,7 +16,6 @@ import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.plugin.chart.base.TrendLineType; import com.fr.plugin.chart.base.VanChartAttrTrendLine; -import com.fr.plugin.chart.base.VanChartConstants; import com.fr.plugin.chart.type.LineType; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -34,14 +32,15 @@ import java.awt.event.ActionListener; public class VanChartTrendLinePane extends BasicPane{ private static final TrendLineType[] TYPES = new TrendLineType[] {TrendLineType.EXP, TrendLineType.LINE, TrendLineType.LOG, TrendLineType.POLY}; + private static final int PREFERRED_WIDTH = 100; + private static final double LINE_WIDTH_MIN_VALUE = 0.5; + private static final double LINE_WIDTH_DIERTA_VALUE = 0.5; + private static final double LINE_WIDTH_DEFAULT_VALUE = 2; + private UITextField trendLineName; private ColorSelectBox trendLineColor; - - //线型支持虚线 恢复用注释。下面1行删除。 - private LineComboBox trendLineStyle;//线型 - //线型支持虚线 恢复用注释。取消注释。 -// private LineTypeComboBox trendLineStyle;//线型 -// private UISpinner lineWidthSpinner;//线宽 + private LineTypeComboBox trendLineStyle;//线型 + private UISpinner lineWidthSpinner;//线宽 private UIComboBox trendLineType;//趋势线函数类型 private UISpinner prePeriod; @@ -58,15 +57,11 @@ public class VanChartTrendLinePane extends BasicPane{ double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] row = {p, p, p, p, p, p}; double[] col = {f, e}; trendLineName = new UITextField(); - trendLineColor = new ColorSelectBox(100); - //线型支持虚线 恢复用注释。下面1行删除。 - trendLineStyle = new LineComboBox(VanChartConstants.ALERT_LINE_STYLE); - //线型支持虚线 恢复用注释。取消注释。 -// trendLineStyle = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH}); -// lineWidthSpinner = new UISpinner(0.5, Integer.MAX_VALUE, 0.5, 2); + trendLineColor = new ColorSelectBox(PREFERRED_WIDTH); + trendLineStyle = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH}); + lineWidthSpinner = new UISpinner(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE); trendLineType = new UIComboBox(TYPES); prePeriod = new UISpinner(0, Integer.MAX_VALUE, 1, 0); afterPeriod = new UISpinner(0, Integer.MAX_VALUE, 1, 0); @@ -82,42 +77,26 @@ public class VanChartTrendLinePane extends BasicPane{ UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Period")); label.setVerticalAlignment(SwingConstants.TOP); - //线型支持虚线 恢复用注释。开始删除。 Component[][] components = new Component[][]{ new Component[]{null, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Name")), trendLineName}, new Component[]{ FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), UIComponentUtils.wrapWithBorderLayoutPane(trendLineStyle) - }, + } + }; + + Component[][] componentsMayHide = new Component[][]{ + new Component[]{ + FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")), + UIComponentUtils.wrapWithBorderLayoutPane(lineWidthSpinner)}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), trendLineColor}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), trendLineType}, new Component[]{label, periodPane} }; - //线型支持虚线 恢复用注释。结束删除。 - - //线型支持虚线 恢复用注释。取消注释。 -// Component[][] components = new Component[][]{ -// new Component[]{null, null}, -// new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Name")), trendLineName}, -// new Component[]{ -// FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), -// UIComponentUtils.wrapWithBorderLayoutPane(trendLineStyle) -// } -// }; -// -// Component[][] componentsMayHide = new Component[][]{ -// new Component[]{ -// FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")), -// UIComponentUtils.wrapWithBorderLayoutPane(lineWidthSpinner)}, -// new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), trendLineColor}, -// new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), trendLineType}, -// new Component[]{label, periodPane} -// }; -// trendLineHidePane = TableLayout4VanChartHelper.createGapTableLayoutPane(componentsMayHide, row, col); - - - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); + + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p,p,p}, col); + trendLineHidePane = TableLayout4VanChartHelper.createGapTableLayoutPane(componentsMayHide, new double[]{p,p,p,p}, col); trendLineStyle.addActionListener(new ActionListener() { @Override @@ -129,8 +108,7 @@ public class VanChartTrendLinePane extends BasicPane{ checkHidePaneVisible(); this.add(panel, BorderLayout.CENTER); - //线型支持虚线 恢复用注释。取消注释。 - //this.add(trendLineHidePane, BorderLayout.SOUTH); + this.add(trendLineHidePane, BorderLayout.SOUTH); } protected String title4PopupWindow(){ @@ -142,12 +120,14 @@ public class VanChartTrendLinePane extends BasicPane{ if(trendLine != null){ trendLineName.setText(trendLine.getTrendLineName()); LineStyleInfo lineStyleInfo = trendLine.getLineStyleInfo(); + AttrLineStyle attrLineStyle = lineStyleInfo.getAttrLineStyle(); + + if (attrLineStyle != null) { + trendLineStyle.setSelectedItem(attrLineStyle.getLineType()); + lineWidthSpinner.setValue(attrLineStyle.getLineWidth()); + } + trendLineColor.setSelectObject(lineStyleInfo.getAttrLineColor().getSeriesColor()); - //线型支持虚线 恢复用注释。下面1行删除。 - trendLineStyle.setSelectedLineStyle(lineStyleInfo.getAttrLineStyle().getLineStyle()); - //线型支持虚线 恢复用注释。取消注释。 -// trendLineStyle.setSelectedItem(lineStyleInfo.getAttrLineStyle().getLineType()); -// lineWidthSpinner.setValue(lineStyleInfo.getAttrLineStyle().getLineWidth()); trendLineType.setSelectedItem(trendLine.getTrendLineType()); prePeriod.setValue(trendLine.getPrePeriod()); afterPeriod.setValue(trendLine.getAfterPeriod()); @@ -159,11 +139,13 @@ public class VanChartTrendLinePane extends BasicPane{ trendLine.setTrendLineName(trendLineName.getText()); LineStyleInfo lineStyleInfo = trendLine.getLineStyleInfo(); - //线型支持虚线 恢复用注释。下面1行删除。 - lineStyleInfo.setAttrLineStyle(new AttrLineStyle(trendLineStyle.getSelectedLineStyle())); - //线型支持虚线 恢复用注释。取消注释。 -// lineStyleInfo.getAttrLineStyle().setLineWidth(lineWidthSpinner.getValue()); -// lineStyleInfo.getAttrLineStyle().setLineType((LineType) trendLineStyle.getSelectedItem()); + AttrLineStyle attrLineStyle = lineStyleInfo.getAttrLineStyle(); + + if (attrLineStyle != null) { + attrLineStyle.setLineWidth(lineWidthSpinner.getValue()); + attrLineStyle.setLineType((LineType) trendLineStyle.getSelectedItem()); + } + lineStyleInfo.setAttrLineColor(new AttrColor(trendLineColor.getSelectObject())); trendLine.setTrendLineType((TrendLineType) trendLineType.getSelectedItem()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java index 27336baf0..f82177054 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java @@ -2,12 +2,15 @@ package com.fr.van.chart.designer.style.background; import com.fr.base.BaseFormula; import com.fr.base.Utils; +import com.fr.chart.base.AttrColor; +import com.fr.chart.base.AttrLineStyle; import com.fr.design.beans.BasicBeanPane; import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.i18n.Toolkit; import com.fr.design.gui.style.FRFontPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; @@ -18,9 +21,10 @@ import com.fr.general.FRFont; import com.fr.general.GeneralUtils; import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.attr.axis.VanChartAlertValue; -import com.fr.plugin.chart.base.VanChartConstants; +import com.fr.plugin.chart.type.LineType; import com.fr.stable.Constants; import com.fr.stable.StableUtils; +import com.fr.van.chart.designer.component.LineTypeComboBox; import javax.swing.BoxLayout; import javax.swing.JPanel; @@ -39,13 +43,16 @@ public class VanChartAlertValuePane extends BasicBeanPane { private static final int VALUE_WD = 100; private static final int TEXT_WD = 200; private static final long serialVersionUID = -1208941770684286439L; + + private static final int PREFERRED_WIDTH = 100; + private static final double LINE_WIDTH_MIN_VALUE = 0.5; + private static final double LINE_WIDTH_DIERTA_VALUE = 0.5; + private static final double LINE_WIDTH_DEFAULT_VALUE = 2; + private UIButtonGroup alertAxis; protected TinyFormulaPane alertValue; - //线型支持虚线 恢复用注释。下面1行删除。 - protected LineComboBox alertLineStyle; - //线型支持虚线 恢复用注释。取消注释。 -// protected LineTypeComboBox alertLineStyle;//线型 -// private UISpinner lineWidthSpinner;//线宽 + protected LineTypeComboBox alertLineStyle;//线型 + private UISpinner lineWidthSpinner;//线宽 protected ColorSelectBox alertLineColor; private UIButtonGroup alertTextPosition; @@ -56,23 +63,20 @@ public class VanChartAlertValuePane extends BasicBeanPane { private VanChartAlertValue chartAlertValue; - public VanChartAlertValuePane(){ + public VanChartAlertValuePane() { initComponents(); } - private void initComponents(){ + private void initComponents() { alertValue = new TinyFormulaPane(); //設置大小,防止文本過長導致界面“變形” alertValue.setPreferredSize(new Dimension(VALUE_WD, HT)); - //线型支持虚线 恢复用注释。下面1行删除。 - alertLineStyle = new LineComboBox(VanChartConstants.ALERT_LINE_STYLE); - //线型支持虚线 恢复用注释。取消注释。 -// alertLineStyle = new LineTypeComboBox(new LineType[]{LineType.NORMAL, LineType.DASH}); -// lineWidthSpinner = new UISpinner(0.5, Integer.MAX_VALUE, 0.5, 2); - alertLineColor = new ColorSelectBox(100); - alertTextPosition = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Top"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Bottom")}); + alertLineStyle = new LineTypeComboBox(new LineType[]{LineType.NORMAL, LineType.DASH}); + lineWidthSpinner = new UISpinner(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE); + alertLineColor = new ColorSelectBox(PREFERRED_WIDTH); + alertTextPosition = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Axis_Top"), Toolkit.i18nText("Fine-Design_Chart_Axis_Bottom")}); alertText = new TinyFormulaPane(); //設置大小,防止文本過長導致界面“變形” alertText.setPreferredSize(new Dimension(TEXT_WD, HT)); @@ -83,26 +87,25 @@ public class VanChartAlertValuePane extends BasicBeanPane { } - private void doLayoutPane(){ + private void doLayoutPane() { this.removeAll(); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); //警戒线设置 JPanel top = FRGUIPaneFactory.createBorderLayout_L_Pane(); this.add(top); - top.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alert_Set") + ":", null)); + top.setBorder(GUICoreUtils.createTitledBorder(Toolkit.i18nText("Fine-Design_Chart_Alert_Set") + ":", null)); top.add(createTopPane()); //提示文字 JPanel bottom = FRGUIPaneFactory.createBorderLayout_L_Pane(); this.add(bottom); - bottom.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alert_Text") + ":", null)); + bottom.setBorder(GUICoreUtils.createTitledBorder(Toolkit.i18nText("Fine-Design_Chart_Alert_Text") + ":", null)); bottom.add(createBottomPane()); } - protected JPanel createTopPane() - { + protected JPanel createTopPane() { double p = TableLayout.PREFERRED; - double[] columnSize = {p,p}; - double[] rowSize = {p,p,p,p,p}; + double[] columnSize = {p, p}; + double[] rowSize = {p, p, p, p, p}; Component[][] components = getTopPaneComponents(); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); @@ -110,26 +113,25 @@ public class VanChartAlertValuePane extends BasicBeanPane { protected Component[][] getTopPaneComponents() { return new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Position")),alertAxis}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Value")),alertValue}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")),alertLineStyle}, - //线型支持虚线 恢复用注释。取消注释。 - //new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Width")), lineWidthSpinner}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),alertLineColor}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")), alertAxis}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Use_Value")), alertValue}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), alertLineStyle}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")), lineWidthSpinner}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), alertLineColor}, }; } - private JPanel createBottomPane(){ + private JPanel createBottomPane() { alertTextPosition.setSelectedIndex(0); double p = TableLayout.PREFERRED; - double[] columnSize = {p,p}; - double[] rowSize = {p,p,p,p,p}; + double[] columnSize = {p, p}; + double[] rowSize = {p, p, p, p, p}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Position")),alertTextPosition}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")),alertText}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font")),fontName}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_FRFont_Size")),fontSize}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),fontColor}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")), alertTextPosition}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Content")), alertText}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Form_Font")), fontName}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Form_FRFont_Size")), fontSize}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), fontColor}, }; return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); @@ -137,20 +139,20 @@ public class VanChartAlertValuePane extends BasicBeanPane { private void checkPositionPane() { boolean selectXAxis = VanChartAttrHelper.isXAxis(alertAxis.getSelectedItem().toString()); - if(selectXAxis){ - alertTextPosition = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Top"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Bottom")}); + if (selectXAxis) { + alertTextPosition = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Axis_Top"), Toolkit.i18nText("Fine-Design_Chart_Axis_Bottom")}); } else { - alertTextPosition = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alert_Left"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alert_Right")}); + alertTextPosition = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Alert_Left"), Toolkit.i18nText("Fine-Design_Chart_Alert_Right")}); } doLayoutPane(); } - protected String title4PopupWindow(){ - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alert_Line"); + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Chart_Alert_Line"); } - public void populateBean(VanChartAlertValue chartAlertValue){ - this.chartAlertValue =chartAlertValue; + public void populateBean(VanChartAlertValue chartAlertValue) { + this.chartAlertValue = chartAlertValue; alertAxis = new UIButtonGroup(chartAlertValue.getAxisNamesArray(), chartAlertValue.getAxisNamesArray()); alertAxis.setSelectedItem(chartAlertValue.getAxisName()); alertAxis.addChangeListener(new ChangeListener() { @@ -163,14 +165,20 @@ public class VanChartAlertValuePane extends BasicBeanPane { checkPositionPane(); alertValue.populateBean(Utils.objectToString(chartAlertValue.getAlertValueFormula())); - //线型支持虚线 恢复用注释。下面1行删除。 - alertLineStyle.setSelectedLineStyle(chartAlertValue.getLineStyle().getLineStyle()); - //线型支持虚线 恢复用注释。取消注释。 -// alertLineStyle.setSelectedItem(chartAlertValue.getLineStyle().getLineType()); -// lineWidthSpinner.setValue(chartAlertValue.getLineStyle().getLineWidth()); - alertLineColor.setSelectObject(chartAlertValue.getLineColor().getSeriesColor()); - - if(VanChartAttrHelper.isXAxis(chartAlertValue.getAxisName())){ + + AttrColor attrColor = chartAlertValue.getLineColor(); + AttrLineStyle attrLineStyle = chartAlertValue.getLineStyle(); + + if (attrColor != null) { + alertLineColor.setSelectObject(attrColor.getSeriesColor()); + } + + if (attrLineStyle != null) { + alertLineStyle.setSelectedItem(attrLineStyle.getLineType()); + lineWidthSpinner.setValue(attrLineStyle.getLineWidth()); + } + + if (VanChartAttrHelper.isXAxis(chartAlertValue.getAxisName())) { alertTextPosition.setSelectedIndex(chartAlertValue.getAlertPosition() == Constants.BOTTOM ? 1 : 0); } else { alertTextPosition.setSelectedIndex(chartAlertValue.getAlertPosition() == Constants.LEFT ? 0 : 1); @@ -186,16 +194,22 @@ public class VanChartAlertValuePane extends BasicBeanPane { fontColor.setSelectObject(chartAlertValue.getAlertFont().getForeground()); } - public VanChartAlertValue updateBean(){ + public VanChartAlertValue updateBean() { chartAlertValue.setAxisName(alertAxis.getSelectedItem().toString()); chartAlertValue.setAlertValueFormula(BaseFormula.createFormulaBuilder().build(alertValue.updateBean())); - chartAlertValue.getLineColor().setSeriesColor(alertLineColor.getSelectObject()); - //线型支持虚线 恢复用注释。下面1行删除。 - chartAlertValue.getLineStyle().setLineStyle(alertLineStyle.getSelectedLineStyle()); - //线型支持虚线 恢复用注释。取消注释。 -// chartAlertValue.getLineStyle().setLineType((LineType) alertLineStyle.getSelectedItem()); -// chartAlertValue.getLineStyle().setLineWidth(lineWidthSpinner.getValue()); + + AttrColor attrColor = chartAlertValue.getLineColor(); + AttrLineStyle attrLineStyle = chartAlertValue.getLineStyle(); + + if (attrColor != null) { + attrColor.setSeriesColor(alertLineColor.getSelectObject()); + } + + if (attrLineStyle != null) { + attrLineStyle.setLineType((LineType) alertLineStyle.getSelectedItem()); + attrLineStyle.setLineWidth(lineWidthSpinner.getValue()); + } String contentString = alertText.updateBean(); Object contentObj; @@ -210,7 +224,7 @@ public class VanChartAlertValuePane extends BasicBeanPane { int size = Utils.objectToNumber(fontSize.getSelectedItem(), true).intValue(); Color color = fontColor.getSelectObject(); chartAlertValue.setAlertFont(FRFont.getInstance(name, Font.PLAIN, size, color)); - if(VanChartAttrHelper.isXAxis(Utils.objectToString(alertAxis.getSelectedItem()))){ + if (VanChartAttrHelper.isXAxis(Utils.objectToString(alertAxis.getSelectedItem()))) { chartAlertValue.setAlertPosition(alertTextPosition.getSelectedIndex() == 0 ? Constants.TOP : Constants.BOTTOM); } else { chartAlertValue.setAlertPosition(alertTextPosition.getSelectedIndex() == 0 ? Constants.LEFT : Constants.RIGHT); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java index 7e09e987c..c9319495e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java @@ -10,8 +10,11 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.color.ColorSelectBox; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.VanChartAttrHelper; +import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; +import com.fr.plugin.chart.type.LineType; import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.LineTypeComboBox; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -20,7 +23,6 @@ import java.awt.CardLayout; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.Arrays; /** * 样式-背景-绘图区背景-坐标轴图表特有(间隔背景、网格线、警戒线) @@ -28,6 +30,8 @@ import java.util.Arrays; public class VanChartAxisAreaPane extends BasicBeanPane { private static final long serialVersionUID = -1880497996650835504L; + private static final int PREFERRED_WIDTH = 100; + protected ColorSelectBox horizontalGridLine; protected ColorSelectBox verticalGridLine; @@ -40,22 +44,20 @@ public class VanChartAxisAreaPane extends BasicBeanPane { private ColorSelectBox verticalColorBackground; protected BackgroundListControlPane customIntervalBackground; - //线型支持虚线 恢复用注释。取消注释。 -// private LineTypeComboBox horizonLineType;//横向线型 -// private LineTypeComboBox verticalLineType;//纵向线型 -// private JPanel horizontalColorPane; -// private JPanel verticalColorPane; + private LineTypeComboBox horizonLineType;//横向线型 + private LineTypeComboBox verticalLineType;//纵向线型 + private JPanel horizontalColorPane; + private JPanel verticalColorPane; public VanChartAxisAreaPane() { initComponents(); } protected void initComponents() { - horizontalGridLine = new ColorSelectBox(100); - verticalGridLine = new ColorSelectBox(100); - //线型支持虚线 恢复用注释。取消注释。 -// horizonLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH}); -// verticalLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH}); + horizontalGridLine = new ColorSelectBox(PREFERRED_WIDTH); + verticalGridLine = new ColorSelectBox(PREFERRED_WIDTH); + horizonLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH}); + verticalLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH}); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -74,78 +76,58 @@ public class VanChartAxisAreaPane extends BasicBeanPane { this.add(panel, BorderLayout.CENTER); } - //线型支持虚线 恢复用注释。删除下面方法。 protected JPanel createGridLinePane() { - horizontalGridLine = new ColorSelectBox(100); - verticalGridLine = new ColorSelectBox(100); - Component[][] components = new Component[][]{ + + Component[][] upComponent = new Component[][]{ new Component[]{null, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal")), horizontalGridLine}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical")), verticalGridLine}, + new Component[]{null, horizontalGridLine} }; - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] row = new double[components.length]; - Arrays.fill(row, p); - double[] col = {f, e}; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel); - } + horizontalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(upComponent); + + Component[][] downComponent = new Component[][]{ + new Component[]{null, null}, + new Component[]{null, verticalGridLine} + }; + verticalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(downComponent); + + horizonLineType.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (horizontalGridLine == null || horizonLineType == null) { + return; + } + horizontalColorPane.setVisible(horizonLineType.getSelectedItem() != LineType.NONE); + } + }); + + verticalLineType.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (verticalGridLine == null || verticalLineType == null) { + return; + } + verticalColorPane.setVisible(verticalLineType.getSelectedItem() != LineType.NONE); + } + }); + + checkColorBoxVisible(); + + JPanel horizonLineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), horizonLineType); + JPanel horizontal = new JPanel(new BorderLayout()); + horizontal.add(horizonLineTypePane, BorderLayout.NORTH); + horizontal.add(horizontalColorPane, BorderLayout.CENTER); + + JPanel verticalLineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), verticalLineType); + JPanel vertical = new JPanel(new BorderLayout()); + vertical.add(verticalLineTypePane, BorderLayout.NORTH); + vertical.add(verticalColorPane, BorderLayout.CENTER); - //线型支持虚线 恢复用注释。取消注释。 -// protected JPanel createGridLinePane() { -// -// Component[][] upComponent = new Component[][]{ -// new Component[]{null, null}, -// new Component[]{null, horizontalGridLine} -// }; -// horizontalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(upComponent); -// -// Component[][] downComponent = new Component[][]{ -// new Component[]{null,null}, -// new Component[]{null, verticalGridLine} -// }; -// verticalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(downComponent); -// -// horizonLineType.addActionListener(new ActionListener() { -// @Override -// public void actionPerformed(ActionEvent e) { -// if (horizontalGridLine == null || horizonLineType == null){ -// return; -// } -// horizontalColorPane.setVisible(horizonLineType.getSelectedItem() != LineType.NONE); -// } -// }); -// -// verticalLineType.addActionListener(new ActionListener() { -// @Override -// public void actionPerformed(ActionEvent e) { -// if (verticalGridLine == null || verticalLineType == null){ -// return; -// } -// verticalColorPane.setVisible(verticalLineType.getSelectedItem() != LineType.NONE); -// } -// }); -// -// checkColorBoxVisible(); -// -// JPanel horizonLineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), horizonLineType); -// JPanel horizontal = new JPanel(new BorderLayout()); -// horizontal.add(horizonLineTypePane, BorderLayout.NORTH); -// horizontal.add(horizontalColorPane, BorderLayout.CENTER); -// -// JPanel verticalLineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), verticalLineType); -// JPanel vertical = new JPanel(new BorderLayout()); -// vertical.add(verticalLineTypePane, BorderLayout.NORTH); -// vertical.add(verticalColorPane, BorderLayout.CENTER); -// -// JPanel panel = new JPanel(new BorderLayout(0, 4)); -// panel.add(horizontal, BorderLayout.NORTH); -// panel.add(vertical, BorderLayout.CENTER); -// -// return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel); -// } + JPanel panel = new JPanel(new BorderLayout(0, 4)); + panel.add(horizontal, BorderLayout.NORTH); + panel.add(vertical, BorderLayout.CENTER); + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel); + } protected JPanel createAlertLinePane() { alertLine = getAlertLinePane(); @@ -227,13 +209,19 @@ public class VanChartAxisAreaPane extends BasicBeanPane { } private void populateGridLine(VanChartRectanglePlot rectanglePlot) { - horizontalGridLine.setSelectObject(rectanglePlot.getDefaultYAxis().getMainGridColor()); - verticalGridLine.setSelectObject(rectanglePlot.getDefaultXAxis().getMainGridColor()); -//线型支持虚线 恢复用注释。取消注释。 -// horizonLineType.setSelectedItem(rectanglePlot.getDefaultYAxis().getGridLineType()); -// verticalLineType.setSelectedItem(rectanglePlot.getDefaultXAxis().getGridLineType()); - } + VanChartAxis defaultXAxis = rectanglePlot.getDefaultXAxis(); + VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis(); + if (defaultXAxis != null) { + verticalGridLine.setSelectObject(defaultXAxis.getMainGridColor()); + verticalLineType.setSelectedItem(defaultXAxis.getGridLineType()); + } + + if (defaultYAxis != null) { + horizontalGridLine.setSelectObject(defaultYAxis.getMainGridColor()); + horizonLineType.setSelectedItem(defaultYAxis.getGridLineType()); + } + } public void updateBean(Plot plot) { VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; @@ -254,11 +242,18 @@ public class VanChartAxisAreaPane extends BasicBeanPane { } private void updateGirdLine(VanChartRectanglePlot rectanglePlot) { - rectanglePlot.getDefaultYAxis().setMainGridColor(horizontalGridLine.getSelectObject()); - rectanglePlot.getDefaultXAxis().setMainGridColor(verticalGridLine.getSelectObject()); - //线型支持虚线 恢复用注释。取消注释。 -// rectanglePlot.getDefaultYAxis().setGridLineType((LineType)horizonLineType.getSelectedItem()); -// rectanglePlot.getDefaultXAxis().setGridLineType((LineType)verticalLineType.getSelectedItem()); + VanChartAxis defaultXAxis = rectanglePlot.getDefaultXAxis(); + VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis(); + + if (defaultXAxis != null) { + defaultXAxis.setMainGridColor(verticalGridLine.getSelectObject()); + defaultXAxis.setGridLineType((LineType) verticalLineType.getSelectedItem()); + } + + if (defaultYAxis != null) { + defaultYAxis.setMainGridColor(horizontalGridLine.getSelectObject()); + defaultYAxis.setGridLineType((LineType) horizonLineType.getSelectedItem()); + } } /** @@ -278,13 +273,12 @@ public class VanChartAxisAreaPane extends BasicBeanPane { } private void checkColorBoxVisible() { -//线型支持虚线 恢复用注释。取消注释。 -// if (horizontalColorPane != null && horizonLineType != null){ -// horizontalColorPane.setVisible(horizonLineType.getSelectedItem() != LineType.NONE); -// } -// -// if (verticalColorPane != null && verticalLineType != null){ -// verticalColorPane.setVisible(verticalLineType.getSelectedItem() != LineType.NONE); -// } + if (horizontalColorPane != null && horizonLineType != null) { + horizontalColorPane.setVisible(horizonLineType.getSelectedItem() != LineType.NONE); + } + + if (verticalColorPane != null && verticalLineType != null) { + verticalColorPane.setVisible(verticalLineType.getSelectedItem() != LineType.NONE); + } } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java index 8808a78e3..100b111a5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java @@ -1,11 +1,10 @@ package com.fr.van.chart.scatter.component; import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.base.VanChartAttrLine; import com.fr.plugin.chart.type.LineStyle; -import com.fr.stable.Constants; +import com.fr.plugin.chart.type.LineType; +import com.fr.design.i18n.Toolkit; import com.fr.van.chart.designer.component.VanChartLineTypePane; import java.awt.Component; @@ -17,17 +16,16 @@ public class VanChartScatterLineTypePane extends VanChartLineTypePane { @Override protected void createLineStyle() { - String[] textArray = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Normal_Line"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_CurveLine")}; - lineStyle = new UIButtonGroup(textArray, new LineStyle[]{LineStyle.NORMAL, LineStyle.CURVE}); + String[] textArray = new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Normal_Line"), + Toolkit.i18nText("Fine-Design_Chart_CurveLine")}; + + lineStyle = new UIButtonGroup<>(textArray, new LineStyle[]{LineStyle.NORMAL, LineStyle.CURVE}); } @Override protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) { return new Component[][]{ - //线型支持虚线 恢复用注释。下面2行删除。 - new Component[]{null, null}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineWidth}, lineStyleComponent }; } @@ -36,10 +34,7 @@ public class VanChartScatterLineTypePane extends VanChartLineTypePane { protected VanChartAttrLine initVanChartAttrLine() { VanChartAttrLine attrLine = new VanChartAttrLine(); //默认为无线型,且默認空值不斷開 - //线型支持虚线 恢复用注释。下面1行删除。 - attrLine.setLineWidth(Constants.LINE_NONE); - //线型支持虚线 恢复用注释。取消注释。 - //attrLine.setLineType(LineType.NONE); + attrLine.setLineType(LineType.NONE); attrLine.setNullValueBreak(false); return attrLine; } From 0c3d167b0fc076c69a039935ae89c6b1bc91e2e2 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 27 Apr 2020 15:54:06 +0800 Subject: [PATCH 266/375] =?UTF-8?q?REPORT-26837=20=E9=9D=9E=E6=B3=95?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/TableDataSourceAction.java | 6 ++- .../design/data/BasicTableDataTreePane.java | 2 + .../fr/design/data/BasicTableDataUtils.java | 36 +++++++++++++++ .../data/datapane/ReportTableDataPane.java | 4 ++ .../data/datapane/TableDataPaneListPane.java | 9 ++++ .../java/com/fr/design/dialog/UIDialog.java | 5 ++- .../design/data/BasicTableDataUtilsTest.java | 44 +++++++++++++++++++ 7 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java create mode 100644 designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java diff --git a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java index ff62c6fb8..600f9721e 100644 --- a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java @@ -42,11 +42,15 @@ public class TableDataSourceAction extends TemplateComponentAction getDsNameChangedMap() { return tdPane.getDsNameChangedMap(); } + + public boolean isNamePermitted() { + return tdPane.isNamePermitted(); + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java index d2fdc3229..4c081a66d 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java @@ -4,6 +4,7 @@ import com.fr.base.TableData; import com.fr.data.TableDataSource; import com.fr.data.api.StoreProcedureAssist; import com.fr.data.impl.storeproc.StoreProcedure; +import com.fr.design.data.BasicTableDataUtils; import com.fr.design.data.DesignTableDataManager; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.controlpane.JListControlPane; @@ -47,6 +48,14 @@ public class TableDataPaneListPane extends JListControlPane implements TableData allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY; String tempName = getEditingName(); Object editingType = getEditingType(); + + if (!BasicTableDataUtils.checkName(tempName)) { + isNamePermitted = false; + nameableList.stopEditing(); + setIllegalIndex(editingIndex); + return; + } + if (StringUtils.isEmpty(tempName)) { isNamePermitted = false; nameableList.stopEditing(); diff --git a/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java b/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java index a885c5188..8f2021c69 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java +++ b/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java @@ -123,8 +123,11 @@ public abstract class UIDialog extends JDialog { // transfer focus to CurrentEditor inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "dialogOK"); actionMap.put("dialogOK", new AbstractAction() { - + @Override public void actionPerformed(ActionEvent evt) { + if (!okButton.isEnabled()) { + return; + } doOK(); } }); diff --git a/designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java b/designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java new file mode 100644 index 000000000..acd47a3c1 --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java @@ -0,0 +1,44 @@ +package com.fr.design.data; + +import junit.framework.TestCase; +import org.junit.Assert; +import org.junit.Test; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/4/27 + */ +public class BasicTableDataUtilsTest extends TestCase { + + @Test + public void testIsInValidName() { + + boolean result1 = BasicTableDataUtils.isInValidName("a.b"); + boolean result2 = BasicTableDataUtils.isInValidName("a.b.c"); + boolean result3 = BasicTableDataUtils.isInValidName("a..b"); + boolean result4 = BasicTableDataUtils.isInValidName("a."); + boolean result5 = BasicTableDataUtils.isInValidName("a.b."); + boolean result6 = BasicTableDataUtils.isInValidName("abc"); + boolean result7 = BasicTableDataUtils.isInValidName(".abc"); + boolean result8 = BasicTableDataUtils.isInValidName(".ab.c"); + boolean result9 = BasicTableDataUtils.isInValidName("ab.c."); + boolean result10 = BasicTableDataUtils.isInValidName(".abc."); + boolean result11 = BasicTableDataUtils.isInValidName(".ab.c."); + boolean result12 = BasicTableDataUtils.isInValidName(".."); + + Assert.assertTrue(result1); + Assert.assertFalse(result2); + Assert.assertFalse(result3); + Assert.assertFalse(result4); + Assert.assertTrue(result5); + Assert.assertFalse(result6); + Assert.assertTrue(result7); + Assert.assertFalse(result8); + Assert.assertTrue(result9); + Assert.assertTrue(result10); + Assert.assertFalse(result11); + Assert.assertFalse(result12); + } + +} \ No newline at end of file From 7907472eca2425d507a4369d96b9250db71f0c44 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 27 Apr 2020 15:57:40 +0800 Subject: [PATCH 267/375] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/van/chart/designer/component/LineTypeComboBox.java | 4 ++-- .../fr/van/chart/designer/component/VanChartLineTypePane.java | 2 +- .../van/chart/designer/component/VanChartTrendLinePane.java | 2 +- .../designer/style/background/VanChartAlertValuePane.java | 2 +- .../chart/designer/style/background/VanChartAxisAreaPane.java | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/LineTypeComboBox.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/LineTypeComboBox.java index 0b3bc7571..8502888bd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/LineTypeComboBox.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/LineTypeComboBox.java @@ -59,10 +59,10 @@ public class LineTypeComboBox extends UIComboBox { FontMetrics fm = GraphHelper.getFontMetrics(rfont); GraphHelper.drawString(g2d, Toolkit.i18nText("Fine-Design_Report_None"), 4, (d.height - fm.getHeight()) / 2 + fm.getAscent()); break; - case NORMAL: + case SOLID: GraphHelper.drawLine(g2d, 4, d.height / 2, d.width - 8, d.height / 2); break; - case DASH: + case DASHED: GraphHelper.drawLine(g2d, 4, d.height / 2, d.width - 8, d.height / 2, Constants.LINE_DASH); break; default: diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java index 4e8f762da..022102909 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java @@ -72,7 +72,7 @@ public class VanChartLineTypePane extends BasicPane { private JPanel createTypeAndWidthPane() { - lineTypeComboBox = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH}); + lineTypeComboBox = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); lineWidthSpinner = new UISpinner(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java index bfe2bbf5d..8f6d3456f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java @@ -60,7 +60,7 @@ public class VanChartTrendLinePane extends BasicPane{ double[] col = {f, e}; trendLineName = new UITextField(); trendLineColor = new ColorSelectBox(PREFERRED_WIDTH); - trendLineStyle = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH}); + trendLineStyle = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); lineWidthSpinner = new UISpinner(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE); trendLineType = new UIComboBox(TYPES); prePeriod = new UISpinner(0, Integer.MAX_VALUE, 1, 0); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java index f82177054..6f88e586c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java @@ -73,7 +73,7 @@ public class VanChartAlertValuePane extends BasicBeanPane { //設置大小,防止文本過長導致界面“變形” alertValue.setPreferredSize(new Dimension(VALUE_WD, HT)); - alertLineStyle = new LineTypeComboBox(new LineType[]{LineType.NORMAL, LineType.DASH}); + alertLineStyle = new LineTypeComboBox(new LineType[]{LineType.SOLID, LineType.DASHED}); lineWidthSpinner = new UISpinner(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE); alertLineColor = new ColorSelectBox(PREFERRED_WIDTH); alertTextPosition = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Axis_Top"), Toolkit.i18nText("Fine-Design_Chart_Axis_Bottom")}); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java index c9319495e..795dc3ce2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java @@ -56,8 +56,8 @@ public class VanChartAxisAreaPane extends BasicBeanPane { protected void initComponents() { horizontalGridLine = new ColorSelectBox(PREFERRED_WIDTH); verticalGridLine = new ColorSelectBox(PREFERRED_WIDTH); - horizonLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH}); - verticalLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH}); + horizonLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); + verticalLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; From f5a1be953803e77875f1018c0fa088c1da1420f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 27 Apr 2020 16:25:23 +0800 Subject: [PATCH 268/375] =?UTF-8?q?CHART-13610=20=E5=9F=8B=E7=82=B9?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/info/ChartInfo.java | 46 +++++++++++-- .../chart/info/ChartInfoCollector.java | 68 +++++++++++++------ .../mainframe/chart/gui/ChartDataPane.java | 30 ++++++-- .../mainframe/chart/gui/ChartOtherPane.java | 8 ++- .../gui/style/series/ChartSeriesPane.java | 4 ++ .../chart/custom/VanChartCustomDataPane.java | 1 + ...VanChartCustomPlotDataContentsTabPane.java | 4 +- .../chart/custom/VanChartCustomPlotPane.java | 3 +- .../component/VanChartCustomPlotAxisPane.java | 5 ++ .../custom/style/VanChartCustomAxisPane.java | 4 ++ .../custom/style/VanChartCustomLabelPane.java | 4 ++ .../style/VanChartCustomSeriesPane.java | 4 ++ .../style/VanChartCustomTooltipPane.java | 6 +- .../designer/style/VanChartLegendPane.java | 5 ++ .../designer/style/VanChartTitlePane.java | 5 ++ .../designer/style/axis/VanChartAxisPane.java | 12 +++- .../style/background/VanChartAreaPane.java | 8 ++- .../datasheet/VanChartDataSheetPane.java | 6 +- .../style/label/VanChartLabelPane.java | 4 ++ .../style/tooltip/VanChartTooltipPane.java | 5 +- .../type/AbstractVanChartTypePane.java | 2 +- .../designer/data/VanChartMapDataPane.java | 25 +++++++ .../style/label/VanChartMapLabelPane.java | 5 ++ .../style/tooltip/VanChartMapTooltipPane.java | 5 +- 24 files changed, 220 insertions(+), 49 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java index 69e2c0802..57bec3c45 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java @@ -1,6 +1,10 @@ package com.fr.design.mainframe.chart.info; 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.ChartConfigInfo; +import com.fr.chartx.config.info.constant.ConfigType; import com.fr.config.MarketConfig; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; @@ -26,7 +30,7 @@ import java.util.Map; public class ChartInfo extends AbstractPointInfo { public static final String XML_TAG = "ChartInfo"; private static final String CHART_CONSUMING_URL = CloudCenter.getInstance().acquireUrlByKind("chartinfo.consuming") + "/single"; - + private static final String CHART_FUNCTION_URL = CloudCenter.getInstance().acquireUrlByKind("chart.info.function") + "/single"; private static final String XML_CHART_CONSUMING_MAP = "chartConsumingMap"; private static final String ATTR_TEST_TEMPLATE = "testTemplate"; @@ -59,6 +63,8 @@ public class ChartInfo extends AbstractPointInfo { private Map chartConsumingMap = new HashMap<>(); + private ChartConfigInfo chartConfigInfo = new ChartConfigInfo(); + private BaseBook book; private boolean testTemplate; @@ -93,7 +99,6 @@ public class ChartInfo extends AbstractPointInfo { this.chartConsumingMap.put(ATTR_TEMPLATE_ID, templateId); } - public BaseBook getBook() { return book; } @@ -117,17 +122,19 @@ public class ChartInfo extends AbstractPointInfo { return chartInfo; } - public static ChartInfo newInstance(String chartId, String chartType) { - return newInstance(chartId, chartType, null, false, false); + public static ChartInfo newInstance(ChartProvider chartProvider) { + return newInstance(chartProvider, null, false, false); } - public static ChartInfo newInstance(String chartId, String chartType, String createTime, boolean isNew, boolean isReuse) { + public static ChartInfo newInstance(ChartProvider chartProvider, String createTime, boolean isNew, boolean isReuse) { HashMap chartConsumingMap = new HashMap<>(); String username = MarketConfig.getInstance().getBbsUsername(); String userId = String.valueOf(MarketConfig.getInstance().getBbsUid()); String uuid = DesignerEnvManager.getEnvManager().getUUID(); String activityKey = DesignerEnvManager.getEnvManager().getActivationKey(); + String chartId = chartProvider.getChartUuid(); + String chartType = chartProvider.getID(); BaseBook book = DesignModelAdapter.getCurrentModelAdapter().getBook(); String templateId = book.getTemplateID(); @@ -160,6 +167,7 @@ public class ChartInfo extends AbstractPointInfo { ChartInfo chartInfo = new ChartInfo(chartId, templateId, book); chartInfo.chartConsumingMap = chartConsumingMap; + chartProvider.initChartConfigInfo(chartInfo.chartConfigInfo); return chartInfo; } @@ -196,6 +204,8 @@ public class ChartInfo extends AbstractPointInfo { writer.attr(ATTR_IS_NEW, chartConsumingMap.get(ATTR_IS_NEW)); writer.attr(ATTR_IS_REUSE, chartConsumingMap.get(ATTR_IS_REUSE)); writer.end(); + + chartConfigInfo.writeXML(writer); writer.end(); } @@ -230,6 +240,9 @@ public class ChartInfo extends AbstractPointInfo { chartConsumingMap.put(ATTR_IS_NEW, reader.getAttrAsString(ATTR_IS_NEW, StringUtils.EMPTY)); chartConsumingMap.put(ATTR_IS_REUSE, reader.getAttrAsString(ATTR_IS_REUSE, StringUtils.EMPTY)); } + if (ChartConfigInfo.XML_TAG.equals(name)) { + this.chartConfigInfo = (ChartConfigInfo) reader.readXMLObject(new ChartConfigInfo()); + } } } @@ -243,9 +256,17 @@ public class ChartInfo extends AbstractPointInfo { public Map getSendInfo() { Map sendMap = new HashMap<>(); sendMap.put(CHART_CONSUMING_URL, new JSONObject(chartConsumingMap).toString()); + sendMap.put(CHART_FUNCTION_URL, getFunctionJson()); return sendMap; } + private String getFunctionJson() { + JSONObject jsonObject = JSONObject.create(); + jsonObject.put("chartID", this.chartId); + chartConfigInfo.toJSONObject(jsonObject); + return jsonObject.toString(); + } + public void updatePropertyTime() { String propertyTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); @@ -255,22 +276,32 @@ public class ChartInfo extends AbstractPointInfo { chartConsumingMap.put(ATTR_CHART_PROPERTY_END_TIME, propertyTime); } - public void updateChartType(String chartType) { + public void updateChartType(ChartProvider chartProvider) { String typeTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); chartConsumingMap.put(ATTR_CHART_TYPE_TIME, typeTime); - chartConsumingMap.put(ATTR_CHART_TYPE, chartType); + chartConsumingMap.put(ATTR_CHART_TYPE, chartProvider.getID()); chartConsumingMap.put(ATTR_CHART_PROPERTY_FIRST_TIME, ""); chartConsumingMap.put(ATTR_CHART_PROPERTY_END_TIME, ""); String count = chartConsumingMap.get(ATTR_OVER_CHART_TYPE_COUNT); count = StringUtils.isEmpty(count) ? "1" : String.valueOf(Integer.parseInt(count) + 1); chartConsumingMap.put(ATTR_OVER_CHART_TYPE_COUNT, count); + + resetChartConfigInfo(chartProvider); + } + + public void resetChartConfigInfo(ChartProvider chartProvider) { + chartConfigInfo.reset(); + chartProvider.initChartConfigInfo(chartConfigInfo); } public void updateFirstType(String chartType) { chartConsumingMap.put(ATTR_FIRST_CHART_TYPE, chartType); } + public void updateChartConfig(ConfigType configType, AbstractConfig config) { + chartConfigInfo.updateChartConfig(configType, config); + } @Override public ChartInfo clone() { @@ -284,6 +315,7 @@ public class ChartInfo extends AbstractPointInfo { chartConsumingMap.put(entry.getKey(), entry.getValue()); } chartInfo.chartConsumingMap = chartConsumingMap; + chartInfo.chartConfigInfo = chartConfigInfo.clone(); return chartInfo; } } 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 5b76b197c..04c4c80d3 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 @@ -2,6 +2,8 @@ package com.fr.design.mainframe.chart.info; 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.AbstractPointCollector; import com.fr.design.mainframe.template.info.TemplateInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo; @@ -55,63 +57,89 @@ public class ChartInfoCollector extends AbstractPointCollector { collection(chartProvider, createTime, false); } - public void collection(ChartProvider chartProvider, String createTime, boolean isReuse) { - collection(chartProvider.getChartUuid(), chartProvider.getID(), createTime, isReuse); - } - /** * 新建图表,保存状态 */ - public void collection(String chartId, String chartType, String createTime, boolean isReuse) { + public void collection(ChartProvider chartProvider, String createTime, boolean isReuse) { + String chartId = chartProvider.getChartUuid(); if (!shouldCollectInfo() || StringUtils.isEmpty(chartId)) { return; } - ChartInfo chartInfo = ChartInfo.newInstance(chartId, chartType, createTime, true, isReuse); + ChartInfo chartInfo = ChartInfo.newInstance(chartProvider, createTime, true, isReuse); chartInfoCacheMap.put(chartId, chartInfo); } + /** + * 图表编辑,更新编辑时间 + */ public void updateChartPropertyTime(ChartProvider chartProvider) { - updateChartPropertyTime(chartProvider.getChartUuid(), chartProvider.getID()); + if (!shouldCollectInfo() || StringUtils.isEmpty(chartProvider.getChartUuid())) { + return; + } + ChartInfo chartInfo = getOrCreateChartInfo(chartProvider); + + //更新编辑时间 + chartInfo.updatePropertyTime(); + + //重置计数 + chartInfo.resetIdleDayCount(); } /** * 图表编辑,更新编辑时间 */ - public void updateChartPropertyTime(String chartId, String chartType) { - if (!shouldCollectInfo() || StringUtils.isEmpty(chartId)) { + public void updateChartConfig(ChartProvider chartProvider, ConfigType configType, AbstractConfig config) { + if (!shouldCollectInfo() || StringUtils.isEmpty(chartProvider.getChartUuid())) { return; } - ChartInfo chartInfo = getOrCreateChartInfo(chartId, chartType, null); + ChartInfo chartInfo = getOrCreateChartInfo(chartProvider); - //更新编辑时间 - chartInfo.updatePropertyTime(); + //更新对应的配置 + chartInfo.updateChartConfig(configType, config); //重置计数 chartInfo.resetIdleDayCount(); } - public void updateChartTypeTime(ChartProvider chartProvider, String oldType) { - updateChartTypeTime(chartProvider.getChartUuid(), chartProvider.getID(), oldType); + /** + * 图表子类型更新 + */ + public void updateChartMiniType(ChartProvider chartProvider) { + if (!shouldCollectInfo() || StringUtils.isEmpty(chartProvider.getChartUuid())) { + return; + } + ChartInfo chartInfo = getOrCreateChartInfo(chartProvider); + + //图表子类型更新 + chartInfo.resetChartConfigInfo(chartProvider); + + //重置计数 + chartInfo.resetIdleDayCount(); } /** * 图表类型变化,更新类型和类型确认时间 */ - public void updateChartTypeTime(String chartId, String chartType, String oldType) { - if (!shouldCollectInfo() || StringUtils.isEmpty(chartId)) { + public void updateChartTypeTime(ChartProvider chartProvider, String oldType) { + if (!shouldCollectInfo() || StringUtils.isEmpty(chartProvider.getChartUuid())) { return; } - ChartInfo chartInfo = getOrCreateChartInfo(chartId, chartType, oldType); + ChartInfo chartInfo = getOrCreateChartInfo(chartProvider, oldType); //更新类型确认时间和类型 - chartInfo.updateChartType(chartType); + chartInfo.updateChartType(chartProvider); //重置计数 chartInfo.resetIdleDayCount(); } - private ChartInfo getOrCreateChartInfo(String chartId, String chartType, String oldType) { + private ChartInfo getOrCreateChartInfo(ChartProvider chartProvider) { + return getOrCreateChartInfo(chartProvider, null); + } + + private ChartInfo getOrCreateChartInfo(ChartProvider chartProvider, String oldType) { + String chartId = chartProvider.getChartUuid(); //缓存中有从缓存中拿 if (chartInfoCacheMap.containsKey(chartId)) { return chartInfoCacheMap.get(chartId); @@ -123,7 +151,7 @@ public class ChartInfoCollector extends AbstractPointCollector { return chartInfo; } //都没有的话创建一个并加入到缓存中 - ChartInfo chartInfo = ChartInfo.newInstance(chartId, chartType); + ChartInfo chartInfo = ChartInfo.newInstance(chartProvider); if (StringUtils.isNotEmpty(oldType)) { chartInfo.updateFirstType(oldType); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java index ad549c5af..2fac3287a 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.chart.gui; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.GisMapPlot; import com.fr.chart.chartattr.MapPlot; +import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.chart.report.GisMapDataPane; import com.fr.design.chart.report.MapDataPane; import com.fr.design.gui.frpane.AttributeChangeListener; @@ -10,6 +11,9 @@ import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.data.DataContentsPane; import com.fr.design.mainframe.chart.gui.data.NormalChartDataPane; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.vanchart.VanChart; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -18,12 +22,12 @@ public class ChartDataPane extends AbstractChartAttrPane { public static final int LABEL_WIDTH = 85; public static final int LABEL_HEIGHT = 20; - + protected DataContentsPane contentsPane; protected AttributeChangeListener listener; - + private boolean supportCellData = true; - + public ChartDataPane(AttributeChangeListener listener) { super(); this.listener = listener; @@ -55,7 +59,7 @@ public class ChartDataPane extends AbstractChartAttrPane { if(contentsPane != null) { this.remove(contentsPane); } - + this.setLayout(new BorderLayout(0, 0)); if (collection == null) { throw new IllegalArgumentException("ChartCollection can not be null!"); @@ -69,7 +73,7 @@ public class ChartDataPane extends AbstractChartAttrPane { }else { contentsPane = new NormalChartDataPane(listener, ChartDataPane.this); } - + if(contentsPane != null) { contentsPane.setSupportCellData(supportCellData); } @@ -88,7 +92,7 @@ public class ChartDataPane extends AbstractChartAttrPane { contentsPane.setSupportCellData(supportCellData); } } - + /** * 更新界面 数据内容 */ @@ -106,11 +110,23 @@ public class ChartDataPane extends AbstractChartAttrPane { * 保存 数据界面内容 */ public void update(ChartCollection collection) { - if(contentsPane != null) { + if (contentsPane != null) { contentsPane.update(collection); + updateBuryingPoint(collection); } } + protected void updateBuryingPoint(ChartCollection collection){ + VanChart vanchart = collection.getSelectedChartProvider(VanChart.class); + if (vanchart != null) { + VanChartPlot plot = vanchart.getPlot(); + if( !plot.isInCustom()) { + ChartInfoCollector.getInstance().updateChartConfig(vanchart, ConfigType.DATA, + vanchart.getFilterDefinition().getBuryingPointDataConfig()); + } + } + } + /** * 刷新图表数据界面 * @param collection 图表收集器 diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartOtherPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartOtherPane.java index 90f896c75..9b494a1a4 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartOtherPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartOtherPane.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.chart.gui; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.Plot; +import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.BasicPane; import com.fr.design.mainframe.chart.AbstractChartAttrPane; @@ -11,11 +12,12 @@ import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.other.ChartConditionAttrPane; import com.fr.design.mainframe.chart.gui.other.ChartInteractivePane; import com.fr.design.mainframe.chart.gui.type.ChartTabPane; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; import java.util.ArrayList; import java.util.List; +import java.awt.BorderLayout; public class ChartOtherPane extends AbstractChartAttrPane { private static final long serialVersionUID = -5612046386597783406L; @@ -121,6 +123,8 @@ public class ChartOtherPane extends AbstractChartAttrPane { if (ChartOtherPane.this.isHaveCondition()) { conditionAttrPane.updateBean(chart); } + //特效埋点 + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.EFFECT, chart.getBuryingPointEffectConfig()); } /** diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java index 32fe831ff..48ea41ec1 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java @@ -2,9 +2,11 @@ package com.fr.design.mainframe.chart.gui.style.series; import com.fr.chart.chartattr.Chart; +import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.van.chart.designer.AbstractVanChartScrollPane; import javax.swing.JPanel; @@ -60,6 +62,8 @@ public class ChartSeriesPane extends AbstractVanChartScrollPane { if(seriesStyleContentPane != null) { seriesStyleContentPane.setCurrentChart(chart); seriesStyleContentPane.updateBean(chart.getPlot()); + //系列埋点 + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.SERIES, chart.getPlot().getBuryingPointSeriesConfig()); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomDataPane.java index c49a1e211..6c5f714bf 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomDataPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomDataPane.java @@ -62,6 +62,7 @@ public class VanChartCustomDataPane extends ChartDataPane { public void update(ChartCollection collection){ if(contentsTabPane != null) { contentsTabPane.updateBean(collection); + updateBuryingPoint(collection); } } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java index 68949897b..e8f6f3a0a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java @@ -14,7 +14,7 @@ import com.fr.van.chart.custom.component.VanChartDataPane; import javax.swing.JPanel; import java.util.ArrayList; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -118,7 +118,7 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab } try { - Map definitionMap = new HashMap(); + Map definitionMap = new LinkedHashMap(); //已经有的数据配置不允许重置 diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java index 5e6953746..a4b43843e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java @@ -29,6 +29,7 @@ import com.fr.van.chart.designer.type.AbstractVanChartTypePane; import javax.swing.JPanel; import javax.swing.JSeparator; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; import java.awt.CardLayout; import java.awt.Component; @@ -192,7 +193,7 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane { return; } - Map newDefinitionMap = new HashMap(); + Map newDefinitionMap = new LinkedHashMap(); VanChartCustomPlot customPlot = (VanChartCustomPlot) chart.getPlot(); for (int i = 0; i < customPlot.getCustomPlotList().size(); i++) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotAxisPane.java index 86a1a7b53..46ee566a2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotAxisPane.java @@ -7,6 +7,7 @@ import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.base.AttrSeriesStackAndAxis; import com.fr.plugin.chart.custom.VanChartCustomPlot; +import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.custom.CustomPlotDesignerPaneFactory; import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.axis.VanChartAxisPane; @@ -52,4 +53,8 @@ public class VanChartCustomPlotAxisPane extends VanChartAxisPane { } } } + + @Override + protected void updateBuryingPoint(VanChart chart) { + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomAxisPane.java index 0eb6278e4..d145283f6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomAxisPane.java @@ -1,8 +1,10 @@ package com.fr.van.chart.custom.style; import com.fr.chart.chartattr.Chart; +import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.dialog.BasicScrollPane; import com.fr.design.mainframe.chart.PaneTitleConstants; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.style.VanChartStylePane; @@ -63,6 +65,8 @@ public class VanChartCustomAxisPane extends BasicScrollPane { } VanChartCustomPlot plot = (VanChartCustomPlot) chart.getPlot(); axisPane.updateBean(plot); + //坐标轴埋点 + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.AXIS, chart.getPlot().getBuryingPointAxisConfig()); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomLabelPane.java index a666d992e..74f3875bf 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomLabelPane.java @@ -2,8 +2,10 @@ package com.fr.van.chart.custom.style; import com.fr.chart.chartattr.Chart; +import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.dialog.BasicScrollPane; import com.fr.design.mainframe.chart.PaneTitleConstants; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.van.chart.designer.style.VanChartStylePane; @@ -63,6 +65,8 @@ public class VanChartCustomLabelPane extends BasicScrollPane { } labelPane.updateBean((VanChartCustomPlot)chart.getPlot()); + //标签埋点 + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.LABEL, chart.getPlot().getBuryingPointLabelConfig()); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomSeriesPane.java index 2cd3d74e1..8fa1d224a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomSeriesPane.java @@ -1,10 +1,12 @@ package com.fr.van.chart.custom.style; import com.fr.chart.chartattr.Chart; +import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.style.series.ChartSeriesPane; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.van.chart.designer.component.VanChartBeautyPane; @@ -112,6 +114,8 @@ public class VanChartCustomSeriesPane extends ChartSeriesPane { if (seriesPane != null){ plotSeriesPane.updateBean(plot); } + //系列埋点 + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.SERIES, chart.getPlot().getBuryingPointSeriesConfig()); } /** diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomTooltipPane.java index d27b95f3b..6331707ca 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomTooltipPane.java @@ -1,8 +1,9 @@ package com.fr.van.chart.custom.style; import com.fr.chart.chartattr.Chart; +import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.dialog.BasicScrollPane; - +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.van.chart.designer.style.VanChartStylePane; @@ -63,7 +64,8 @@ public class VanChartCustomTooltipPane extends BasicScrollPane { } tooltipPane.updateBean((VanChartCustomPlot)chart.getPlot()); - + //提示埋点 + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.TOOLTIP, chart.getPlot().getBuryingPointTooltipConfig()); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartLegendPane.java index 8fb3aed22..d0537ce4f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartLegendPane.java @@ -2,7 +2,9 @@ package com.fr.van.chart.designer.style; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; +import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.mainframe.chart.PaneTitleConstants; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.plugin.chart.attr.VanChartLegend; import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.AbstractVanChartScrollPane; @@ -52,6 +54,9 @@ public class VanChartLegendPane extends AbstractVanChartScrollPane { } VanChartLegend legend = (VanChartLegend) plot.getLegend(); legendContent.updateBean(legend); + + //图例埋点 + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.LEGEND, legend.getBuryingPointLegendConfig()); } @Override 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 6a7987bcd..3c62d4408 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 @@ -5,6 +5,7 @@ import com.fr.base.BaseUtils; import com.fr.base.Style; import com.fr.base.Utils; import com.fr.chart.base.TextAttr; +import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.frpane.UIBubbleFloatPane; import com.fr.design.gui.ibutton.UIButtonGroup; @@ -16,6 +17,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.info.ChartInfoCollector; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.attr.VanChartTitle; import com.fr.plugin.chart.vanchart.VanChart; @@ -362,6 +364,9 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { title.setFloatPercentY(customFloatPositionPane.getFloatPosition_y()); textAttrPane.update(textAttr); backgroundPane.update(title); + + //标题埋点 + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.TITLE, title.getBuryingPointTitleConfig()); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPane.java index 232143496..d0a4da4c1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPane.java @@ -3,8 +3,10 @@ package com.fr.van.chart.designer.style.axis; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; +import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.beans.BasicBeanPane; import com.fr.design.mainframe.chart.PaneTitleConstants; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; @@ -16,12 +18,12 @@ import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.axis.component.VanChartAxisButtonPane; import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.awt.CardLayout; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.awt.BorderLayout; +import java.awt.CardLayout; /** * 样式-坐标轴界面 @@ -237,6 +239,12 @@ public class VanChartAxisPane extends BasicBeanPane { updateBean(plot); + updateBuryingPoint(chart); + } + + protected void updateBuryingPoint(VanChart chart) { + //坐标轴埋点 + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.AXIS, chart.getPlot().getBuryingPointAxisConfig()); } public void updateBean(Plot plot){ diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java index 2aca9e886..86b7d896f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java @@ -1,20 +1,22 @@ package com.fr.van.chart.designer.style.background; import com.fr.chart.chartattr.Plot; +import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.ThirdTabPane; import com.fr.design.mainframe.chart.gui.style.legend.AutoSelectedPane; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.BorderFactory; import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.awt.FlowLayout; import java.util.ArrayList; import java.util.List; +import java.awt.BorderLayout; +import java.awt.FlowLayout; /** * 属性表, 图表样式-背景界面. @@ -94,6 +96,8 @@ public class VanChartAreaPane extends ThirdTabPane implements AutoSele public void updateBean(VanChart chart) { areaPane.updateBean(chart); plotPane.updateBean(chart); + //背景埋点 + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.BACKGROUND, chart.getPlot().getBuryingPointBackGroundConfig()); } /** 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 81451cbe7..f3e181bdf 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 @@ -4,15 +4,16 @@ import com.fr.base.FRContext; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.DataSheet; +import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.style.FormatPane; 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.info.ChartInfoCollector; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; - import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.base.VanChartConstants; @@ -135,6 +136,9 @@ public class VanChartDataSheetPane extends AbstractVanChartScrollPane { if(isShowDataSheet.isSelected()){ update(dataSheet); } + + //数据表埋点 + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.DATA_TABLE, chart.getPlot().getDataSheet().getBuryingPointDataTableConfig()); // plot.setDataSheet2PlotList(); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartLabelPane.java index 174f9cf93..8963884c0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartLabelPane.java @@ -4,7 +4,9 @@ import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; +import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.mainframe.chart.PaneTitleConstants; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.AttrLabel; import com.fr.van.chart.designer.AbstractVanChartScrollPane; @@ -70,6 +72,8 @@ public class VanChartLabelPane extends AbstractVanChartScrollPane { if (attrLabel != null) { attrList.addDataSeriesCondition(attrLabel); } + //标签埋点 + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.LABEL, chart.getPlot().getBuryingPointLabelConfig()); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartTooltipPane.java index 14fa52a2c..945bf1f85 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartTooltipPane.java @@ -4,7 +4,8 @@ import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; - +import com.fr.chartx.config.info.constant.ConfigType; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.AttrTooltip; import com.fr.van.chart.designer.AbstractVanChartScrollPane; @@ -67,6 +68,8 @@ public class VanChartTooltipPane extends AbstractVanChartScrollPane { if (attrTooltip != null) { attrList.addDataSeriesCondition(attrTooltip); } + //提示埋点 + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.TOOLTIP, chart.getPlot().getBuryingPointTooltipConfig()); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index e9395ccb5..c2406e0d2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -105,6 +105,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane { } defaultAttr.addDataSeriesCondition(attrMapLabel); + + //标签埋点 + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.LABEL, chart.getPlot().getBuryingPointLabelConfig()); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipPane.java index b13599304..84e44e3d6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipPane.java @@ -3,7 +3,8 @@ package com.fr.van.chart.map.designer.style.tooltip; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; - +import com.fr.chartx.config.info.constant.ConfigType; +import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.attr.AttrMapTooltip; import com.fr.van.chart.designer.AbstractVanChartScrollPane; @@ -119,6 +120,8 @@ public class VanChartMapTooltipPane extends AbstractVanChartScrollPane { attrMapTooltip.setLineTooltip(lineTooltipPane.update()); } defaultAttr.addDataSeriesCondition(attrMapTooltip); + //提示埋点 + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.TOOLTIP, chart.getPlot().getBuryingPointTooltipConfig()); } @Override From c4fa07bf10e8cf30776f139dd09980e58505b4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 27 Apr 2020 17:47:32 +0800 Subject: [PATCH 269/375] =?UTF-8?q?CHART-13610=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/chart/gui/ChartDataPane.java | 2 +- .../com/fr/van/chart/custom/style/VanChartCustomAxisPane.java | 2 +- .../com/fr/van/chart/custom/style/VanChartCustomLabelPane.java | 2 +- .../com/fr/van/chart/custom/style/VanChartCustomSeriesPane.java | 2 +- .../fr/van/chart/custom/style/VanChartCustomTooltipPane.java | 2 +- .../com/fr/van/chart/designer/style/VanChartLegendPane.java | 2 +- .../java/com/fr/van/chart/designer/style/VanChartTitlePane.java | 2 +- .../com/fr/van/chart/designer/style/axis/VanChartAxisPane.java | 2 +- .../van/chart/designer/style/background/VanChartAreaPane.java | 2 +- .../chart/designer/style/datasheet/VanChartDataSheetPane.java | 2 +- .../fr/van/chart/designer/style/label/VanChartLabelPane.java | 2 +- .../van/chart/designer/style/tooltip/VanChartTooltipPane.java | 2 +- .../chart/map/designer/style/label/VanChartMapLabelPane.java | 2 +- .../map/designer/style/tooltip/VanChartMapTooltipPane.java | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java index 2fac3287a..67e7fc72b 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java @@ -122,7 +122,7 @@ public class ChartDataPane extends AbstractChartAttrPane { VanChartPlot plot = vanchart.getPlot(); if( !plot.isInCustom()) { ChartInfoCollector.getInstance().updateChartConfig(vanchart, ConfigType.DATA, - vanchart.getFilterDefinition().getBuryingPointDataConfig()); + vanchart.getBuryingPointDataConfig()); } } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomAxisPane.java index d145283f6..35b6d63e7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomAxisPane.java @@ -66,7 +66,7 @@ public class VanChartCustomAxisPane extends BasicScrollPane { VanChartCustomPlot plot = (VanChartCustomPlot) chart.getPlot(); axisPane.updateBean(plot); //坐标轴埋点 - ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.AXIS, chart.getPlot().getBuryingPointAxisConfig()); + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.AXIS, chart.getBuryingPointAxisConfig()); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomLabelPane.java index 74f3875bf..3192299ea 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomLabelPane.java @@ -66,7 +66,7 @@ public class VanChartCustomLabelPane extends BasicScrollPane { labelPane.updateBean((VanChartCustomPlot)chart.getPlot()); //标签埋点 - ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.LABEL, chart.getPlot().getBuryingPointLabelConfig()); + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.LABEL, chart.getBuryingPointLabelConfig()); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomSeriesPane.java index 8fa1d224a..80685b4b4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomSeriesPane.java @@ -115,7 +115,7 @@ public class VanChartCustomSeriesPane extends ChartSeriesPane { plotSeriesPane.updateBean(plot); } //系列埋点 - ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.SERIES, chart.getPlot().getBuryingPointSeriesConfig()); + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.SERIES, chart.getBuryingPointSeriesConfig()); } /** diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomTooltipPane.java index 6331707ca..2e05b4f51 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomTooltipPane.java @@ -65,7 +65,7 @@ public class VanChartCustomTooltipPane extends BasicScrollPane { tooltipPane.updateBean((VanChartCustomPlot)chart.getPlot()); //提示埋点 - ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.TOOLTIP, chart.getPlot().getBuryingPointTooltipConfig()); + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.TOOLTIP, chart.getBuryingPointTooltipConfig()); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartLegendPane.java index d0537ce4f..52bf9e92b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartLegendPane.java @@ -56,7 +56,7 @@ public class VanChartLegendPane extends AbstractVanChartScrollPane { legendContent.updateBean(legend); //图例埋点 - ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.LEGEND, legend.getBuryingPointLegendConfig()); + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.LEGEND, chart.getBuryingPointLegendConfig()); } @Override 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 3c62d4408..908a75d21 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 @@ -366,7 +366,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { backgroundPane.update(title); //标题埋点 - ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.TITLE, title.getBuryingPointTitleConfig()); + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.TITLE, chart.getBuryingPointTitleConfig()); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPane.java index d0a4da4c1..5c71317f2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPane.java @@ -244,7 +244,7 @@ public class VanChartAxisPane extends BasicBeanPane { protected void updateBuryingPoint(VanChart chart) { //坐标轴埋点 - ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.AXIS, chart.getPlot().getBuryingPointAxisConfig()); + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.AXIS, chart.getBuryingPointAxisConfig()); } public void updateBean(Plot plot){ diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java index 86b7d896f..dcc43e045 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java @@ -97,7 +97,7 @@ public class VanChartAreaPane extends ThirdTabPane implements AutoSele areaPane.updateBean(chart); plotPane.updateBean(chart); //背景埋点 - ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.BACKGROUND, chart.getPlot().getBuryingPointBackGroundConfig()); + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.BACKGROUND, chart.getBuryingPointBackGroundConfig()); } /** 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 f3e181bdf..884a1e1c4 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 @@ -138,7 +138,7 @@ public class VanChartDataSheetPane extends AbstractVanChartScrollPane { } //数据表埋点 - ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.DATA_TABLE, chart.getPlot().getDataSheet().getBuryingPointDataTableConfig()); + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.DATA_TABLE, chart.getBuryingPointDataTableConfig()); // plot.setDataSheet2PlotList(); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartLabelPane.java index 8963884c0..dfcd1a644 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartLabelPane.java @@ -73,7 +73,7 @@ public class VanChartLabelPane extends AbstractVanChartScrollPane { attrList.addDataSeriesCondition(attrLabel); } //标签埋点 - ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.LABEL, chart.getPlot().getBuryingPointLabelConfig()); + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.LABEL, chart.getBuryingPointLabelConfig()); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartTooltipPane.java index 945bf1f85..491de9c41 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartTooltipPane.java @@ -69,7 +69,7 @@ public class VanChartTooltipPane extends AbstractVanChartScrollPane { attrList.addDataSeriesCondition(attrTooltip); } //提示埋点 - ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.TOOLTIP, chart.getPlot().getBuryingPointTooltipConfig()); + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.TOOLTIP, chart.getBuryingPointTooltipConfig()); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelPane.java index 21c3e7dcb..6d22d9700 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelPane.java @@ -120,7 +120,7 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane { defaultAttr.addDataSeriesCondition(attrMapLabel); //标签埋点 - ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.LABEL, chart.getPlot().getBuryingPointLabelConfig()); + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.LABEL, chart.getBuryingPointLabelConfig()); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipPane.java index 84e44e3d6..204fecaa9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipPane.java @@ -121,7 +121,7 @@ public class VanChartMapTooltipPane extends AbstractVanChartScrollPane { } defaultAttr.addDataSeriesCondition(attrMapTooltip); //提示埋点 - ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.TOOLTIP, chart.getPlot().getBuryingPointTooltipConfig()); + ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.TOOLTIP, chart.getBuryingPointTooltipConfig()); } @Override From d27b65f39ccac6308c1db3593e970353ebd94f75 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 27 Apr 2020 18:30:59 +0800 Subject: [PATCH 270/375] =?UTF-8?q?REPORT-29867=20=20=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=E6=9D=A1=E5=BC=B9=E7=AA=97=E4=B8=8D=E8=B7=9F=E9=9A=8F=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=9B=BD=E9=99=85=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/DesignerFrame.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 2cf8d8c35..9ab4cfd32 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -117,6 +117,11 @@ import java.util.Set; public class DesignerFrame extends JFrame implements JTemplateActionListener, TargetModifiedListener { + static { + UIManager.put("ProgressMonitor.progressText", Toolkit.i18nText("Fine-Design_Basic_ProgressBar_Title")); + UIManager.put("OptionPane.cancelButtonText", Toolkit.i18nText("Fine-Design_Basic_Cancel")); + } + private static final String DESIGNER_FRAME_NAME = "designer_frame"; private static final Dimension MIN_SIZE = new Dimension(100, 100); From fb5474e816871dc8ded7b1e890b75e647284d588 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 27 Apr 2020 18:41:44 +0800 Subject: [PATCH 271/375] =?UTF-8?q?REPORT-29867=20fix=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/gui/UILookAndFeel.java | 10 ++++++++-- .../java/com/fr/design/mainframe/DesignerFrame.java | 5 ----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java b/designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java index f02715716..dc9cea2bd 100644 --- a/designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java +++ b/designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java @@ -29,11 +29,11 @@ import com.fr.design.gui.itoolbar.UIToolBarBorder; import com.fr.design.gui.itoolbar.UIToolBarSeparatorUI; import com.fr.design.gui.itooltip.UIToolTipBorder; import com.fr.design.gui.itree.UITreeUI; +import com.fr.design.i18n.Toolkit; import com.fr.log.FineLoggerFactory; import com.fr.general.IOUtils; -import javax.swing.ImageIcon; -import javax.swing.UIDefaults; +import javax.swing.*; import javax.swing.border.Border; import javax.swing.border.EmptyBorder; import javax.swing.plaf.BorderUIResource; @@ -52,6 +52,12 @@ import java.net.URL; */ public class UILookAndFeel extends MetalLookAndFeel { + + static { + UIManager.put("ProgressMonitor.progressText", Toolkit.i18nText("Fine-Design_Basic_ProgressBar_Title")); + UIManager.put("OptionPane.cancelButtonText", Toolkit.i18nText("Fine-Design_Basic_Cancel")); + } + public static boolean CONTROL_PANEL_INSTANTIATED = false; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 9ab4cfd32..2cf8d8c35 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -117,11 +117,6 @@ import java.util.Set; public class DesignerFrame extends JFrame implements JTemplateActionListener, TargetModifiedListener { - static { - UIManager.put("ProgressMonitor.progressText", Toolkit.i18nText("Fine-Design_Basic_ProgressBar_Title")); - UIManager.put("OptionPane.cancelButtonText", Toolkit.i18nText("Fine-Design_Basic_Cancel")); - } - private static final String DESIGNER_FRAME_NAME = "designer_frame"; private static final Dimension MIN_SIZE = new Dimension(100, 100); From 301ba7755911952ecce1799e900f785fd0aa3452 Mon Sep 17 00:00:00 2001 From: Maksim Date: Tue, 28 Apr 2020 11:12:28 +0800 Subject: [PATCH 272/375] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f16cdd504..2e5ea8bf6 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -359,7 +359,7 @@ public class EnvChangeEntrance { */ private String formatBranch(String branch){ if(branch.contains("#")){ - return branch.substring(branch.lastIndexOf("#") + 1, branch.length() - 13); + return branch.substring(branch.lastIndexOf("-") + 1, branch.length() - 13); } return branch; } From c17a088c673b899c17f2fbe9799b733ad6d002cd Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 28 Apr 2020 15:31:27 +0800 Subject: [PATCH 273/375] =?UTF-8?q?CHART-13031=20=E9=9B=B7=E8=BE=BE?= =?UTF-8?q?=E5=9B=BE=E3=80=81=E9=9D=A2=E7=A7=AF=E5=9B=BE=E7=9A=84=E7=B3=BB?= =?UTF-8?q?=E5=88=97=E7=BA=BF=E5=9E=8B=E5=92=8C=E6=9D=A1=E4=BB=B6=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E7=BA=BF=E5=9E=8B=E4=B8=8D=E6=94=AF=E6=8C=81=E8=99=9A?= =?UTF-8?q?=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/area/VanChartAreaConditionPane.java | 4 +-- .../chart/area/VanChartAreaSeriesPane.java | 6 ++++ .../component/VanChartLineTypePane.java | 30 ++++++++++++------- .../VanChartLineTypePaneWithoutDashed.java | 11 +++++++ .../component/VanChartLineWidthPane.java | 2 +- ...artLineTypeConditionPaneWithoutDashed.java | 16 ++++++++++ .../VanChartScatterLineTypePane.java | 4 +-- 7 files changed, 57 insertions(+), 16 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePaneWithoutDashed.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineTypeConditionPaneWithoutDashed.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaConditionPane.java index c2de07ada..f0ec07136 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaConditionPane.java @@ -20,7 +20,7 @@ import com.fr.van.chart.designer.other.condition.item.VanChartAreaFillColorCondi import com.fr.van.chart.designer.other.condition.item.VanChartDataSheetContentPane; import com.fr.van.chart.designer.other.condition.item.VanChartEffectConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; -import com.fr.van.chart.designer.other.condition.item.VanChartLineTypeConditionPane; +import com.fr.van.chart.designer.other.condition.item.VanChartLineTypeConditionPaneWithoutDashed; import com.fr.van.chart.designer.other.condition.item.VanChartMarkerConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartTooltipConditionPane; @@ -50,7 +50,7 @@ public class VanChartAreaConditionPane extends DataSeriesConditionPane { classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this)); classPaneMap.put(VanChartAttrTrendLine.class, new VanChartTrendLineConditionPane(this)); classPaneMap.put(AttrAreaSeriesFillColorBackground.class, new VanChartAreaFillColorConditionPane(this, plot)); - classPaneMap.put(VanChartAttrLine.class, new VanChartLineTypeConditionPane(this)); + classPaneMap.put(VanChartAttrLine.class, new VanChartLineTypeConditionPaneWithoutDashed(this)); classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot)); //是否使用数据表 if (plot.getDataSheet().isVisible()) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java index d3b511b1f..97c1c89fe 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java @@ -7,6 +7,8 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.van.chart.column.VanChartCustomStackAndAxisConditionPane; import com.fr.van.chart.designer.component.VanChartBeautyPane; +import com.fr.van.chart.designer.component.VanChartLineTypePane; +import com.fr.van.chart.designer.component.VanChartLineTypePaneWithoutDashed; import com.fr.van.chart.line.VanChartLineSeriesPane; import javax.swing.JPanel; @@ -49,4 +51,8 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane { protected VanChartBeautyPane createStylePane() { return new VanChartBeautyPane(); } + + protected VanChartLineTypePane getLineTypePane() { + return new VanChartLineTypePaneWithoutDashed(); + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java index 022102909..10c3308b3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java @@ -34,7 +34,7 @@ public class VanChartLineTypePane extends BasicPane { private LineTypeComboBox lineTypeComboBox;//线型 private UISpinner lineWidthSpinner;//线宽 - protected UIButtonGroup lineStyle;//形态 + private UIButtonGroup lineStyle;//形态 private UIButtonGroup nullValueBreak;//空值断开 private JPanel lineWidthPane; @@ -44,7 +44,7 @@ public class VanChartLineTypePane extends BasicPane { JPanel typeAndWidthPane = createTypeAndWidthPane(); - createLineStyle(); + lineStyle = createLineStyle(); nullValueBreak = new UIButtonGroup(new String[]{ Toolkit.i18nText("Fine-Design_Chart_Open"), @@ -72,7 +72,7 @@ public class VanChartLineTypePane extends BasicPane { private JPanel createTypeAndWidthPane() { - lineTypeComboBox = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); + lineTypeComboBox = createLineType(); lineWidthSpinner = new UISpinner(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE); @@ -85,6 +85,7 @@ public class VanChartLineTypePane extends BasicPane { }); Component[][] lineTypeComps = new Component[][]{ + new Component[]{null, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineTypeComboBox} }; Component[][] lineWidthComps = new Component[][]{ @@ -94,10 +95,10 @@ public class VanChartLineTypePane extends BasicPane { }; double p = TableLayout.PREFERRED, f = TableLayout.FILL, e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] row = {p}, col = {f, e}; + double[] col = {f, e}; - JPanel lineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineTypeComps, row, col); - lineWidthPane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineWidthComps, row, col); + JPanel lineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineTypeComps, new double[]{p, p}, col); + lineWidthPane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineWidthComps, new double[]{p}, col); JPanel contentPane = new JPanel(new BorderLayout(0, 6)); @@ -107,10 +108,17 @@ public class VanChartLineTypePane extends BasicPane { return contentPane; } - protected void createLineStyle() { - String[] textArray = new String[]{Toolkit.i18nText("Fine-Design_Chart_Normal_Line"), - Toolkit.i18nText("Fine-Design_Chart_StepLine"), Toolkit.i18nText("Fine-Design_Chart_CurveLine")}; - lineStyle = new UIButtonGroup(textArray, LineStyle.values()); + protected LineTypeComboBox createLineType() { + return new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); + } + + protected UIButtonGroup createLineStyle() { + String[] textArray = new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Normal_Line"), + Toolkit.i18nText("Fine-Design_Chart_StepLine"), + Toolkit.i18nText("Fine-Design_Chart_CurveLine")}; + + return new UIButtonGroup<>(textArray, LineStyle.values()); } protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) { @@ -128,7 +136,7 @@ public class VanChartLineTypePane extends BasicPane { private void checkLineStyle() { if (lineStylePane != null && lineTypeComboBox != null) { - lineStylePane.setVisible(!ComparatorUtils.equals(lineTypeComboBox.getSelectedItem(),LineType.NONE)); + lineStylePane.setVisible(!ComparatorUtils.equals(lineTypeComboBox.getSelectedItem(), LineType.NONE)); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePaneWithoutDashed.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePaneWithoutDashed.java new file mode 100644 index 000000000..55e75f88b --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePaneWithoutDashed.java @@ -0,0 +1,11 @@ +package com.fr.van.chart.designer.component; + +import com.fr.plugin.chart.type.LineType; + +public class VanChartLineTypePaneWithoutDashed extends VanChartLineTypePane{ + + @Override + protected LineTypeComboBox createLineType() { + return new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID}); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java index 48f622654..46f461e69 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java @@ -5,7 +5,7 @@ import java.awt.Component; /** * 线型+线宽+空值断开 */ -public class VanChartLineWidthPane extends VanChartLineTypePane { +public class VanChartLineWidthPane extends VanChartLineTypePaneWithoutDashed { private static final long serialVersionUID = 4537158946119294689L; @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineTypeConditionPaneWithoutDashed.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineTypeConditionPaneWithoutDashed.java new file mode 100644 index 000000000..f9ec11dbc --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineTypeConditionPaneWithoutDashed.java @@ -0,0 +1,16 @@ +package com.fr.van.chart.designer.other.condition.item; + +import com.fr.design.condition.ConditionAttributesPane; +import com.fr.van.chart.designer.component.VanChartLineTypePane; +import com.fr.van.chart.designer.component.VanChartLineTypePaneWithoutDashed; + +public class VanChartLineTypeConditionPaneWithoutDashed extends VanChartLineTypeConditionPane { + + public VanChartLineTypeConditionPaneWithoutDashed(ConditionAttributesPane conditionAttributesPane) { + super(conditionAttributesPane); + } + + protected VanChartLineTypePane createLinePane() { + return new VanChartLineTypePaneWithoutDashed(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java index 100b111a5..340b93f14 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java @@ -15,12 +15,12 @@ import java.awt.Component; public class VanChartScatterLineTypePane extends VanChartLineTypePane { @Override - protected void createLineStyle() { + protected UIButtonGroup createLineStyle() { String[] textArray = new String[]{ Toolkit.i18nText("Fine-Design_Chart_Normal_Line"), Toolkit.i18nText("Fine-Design_Chart_CurveLine")}; - lineStyle = new UIButtonGroup<>(textArray, new LineStyle[]{LineStyle.NORMAL, LineStyle.CURVE}); + return new UIButtonGroup<>(textArray, new LineStyle[]{LineStyle.NORMAL, LineStyle.CURVE}); } @Override From 08f6abaf605a67670a57999d48176ec6a2eb276c Mon Sep 17 00:00:00 2001 From: yaohwu Date: Tue, 28 Apr 2020 14:36:14 +0800 Subject: [PATCH 274/375] =?UTF-8?q?REPORT-27222=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=8D=95=E5=85=83=E6=A0=BC=E6=89=A9=E5=B1=95=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/fun/CellExpandAttrProvider.java | 18 +++ .../impl/AbstractCellExpandAttrProvider.java | 39 ++++++ .../cell/settingpane/CellExpandAttrPane.java | 81 ++++++----- .../settingpane/CellExpandExtraAttrPane.java | 132 ++++++++++++++++++ 4 files changed, 237 insertions(+), 33 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/CellExpandAttrProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellExpandAttrProvider.java create mode 100644 designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandExtraAttrPane.java diff --git a/designer-base/src/main/java/com/fr/design/fun/CellExpandAttrProvider.java b/designer-base/src/main/java/com/fr/design/fun/CellExpandAttrProvider.java new file mode 100644 index 000000000..9e0c37355 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/CellExpandAttrProvider.java @@ -0,0 +1,18 @@ +package com.fr.design.fun; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.report.cell.TemplateCellElement; +import com.fr.stable.fun.mark.Mutable; + +/** + * @author yaohwu + * created by yaohwu at 2020/4/26 15:50 + */ +public interface CellExpandAttrProvider extends Mutable { + + String MARK_STRING = "CellExpandAttrProvider"; + + int CURRENT_LEVEL = 1; + + BasicBeanPane createPanel(); +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellExpandAttrProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellExpandAttrProvider.java new file mode 100644 index 000000000..57f54db6c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellExpandAttrProvider.java @@ -0,0 +1,39 @@ +package com.fr.design.fun.impl; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.fun.CellExpandAttrProvider; +import com.fr.report.cell.TemplateCellElement; +import com.fr.stable.fun.mark.API; + +/** + * @author yaohwu + * created by yaohwu at 2020/4/26 16:08 + */ +@API(level = CellExpandAttrProvider.CURRENT_LEVEL) +public class AbstractCellExpandAttrProvider implements CellExpandAttrProvider { + + /** + * 当前接口的API等级,用于判断是否需要升级插件 + * + * @return API等级 + */ + @Override + public int currentAPILevel() { + return CellExpandAttrProvider.CURRENT_LEVEL; + } + + /** + * 获取当前provider的标记(可以使用类路径保证唯一)以避免provider的重复加载 + * + * @return 当前provider的标记 + */ + @Override + public String mark4Provider() { + return null; + } + + @Override + public BasicBeanPane createPanel() { + return null; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java index f6e272217..0f7466af0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe.cell.settingpane; -import com.fr.base.BaseUtils; import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.UIConstants; import com.fr.design.expand.ExpandLeftFatherPane; @@ -10,18 +9,23 @@ import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.ComparatorUtils; - +import com.fr.general.IOUtils; import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.elementcase.TemplateElementCase; import com.fr.stable.Constants; -import javax.swing.*; -import java.awt.*; +import javax.swing.Icon; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Rectangle; /** * 单元格扩展属性面板,是属性表面板的一个种类 @@ -38,58 +42,66 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { private JPanel layoutPane; private JPanel basicPane; private JPanel seniorPane; + private CellExpandExtraAttrPane extraPane; + /** - * @return + * @return content panel */ public JPanel createContentPane() { - String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Not_Expand"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Top_To_Bottom"), com.fr.design.i18n.Toolkit.i18nText("FIne-Design_Report_Utils_Left_To_Right")}; + String[] nameArray = {Toolkit.i18nText("Fine-Design_Report_ExpandD_Not_Expand"), Toolkit.i18nText("Fine-Design_Report_Utils_Top_To_Bottom"), Toolkit.i18nText("FIne-Design_Report_Utils_Left_To_Right")}; Icon[][] iconArray = { - {BaseUtils.readIcon("/com/fr/design/images/expand/none16x16.png"), BaseUtils.readIcon("/com/fr/design/images/expand/none16x16_selected@1x.png")}, - {BaseUtils.readIcon("/com/fr/design/images/expand/vertical.png"), BaseUtils.readIcon("/com/fr/design/images/expand/vertical_selected@1x.png")}, - {BaseUtils.readIcon("/com/fr/design/images/expand/landspace.png"), BaseUtils.readIcon("/com/fr/design/images/expand/landspace_selected@1x.png")} + {IOUtils.readIcon("/com/fr/design/images/expand/none16x16.png"), IOUtils.readIcon("/com/fr/design/images/expand/none16x16_selected@1x.png")}, + {IOUtils.readIcon("/com/fr/design/images/expand/vertical.png"), IOUtils.readIcon("/com/fr/design/images/expand/vertical_selected@1x.png")}, + {IOUtils.readIcon("/com/fr/design/images/expand/landspace.png"), IOUtils.readIcon("/com/fr/design/images/expand/landspace_selected@1x.png")} }; Byte[] valueArray = {Constants.NONE, Constants.TOP_TO_BOTTOM, Constants.LEFT_TO_RIGHT}; expandDirectionButton = new UIButtonGroup(iconArray, valueArray); expandDirectionButton.setAllToolTips(nameArray); leftFatherPane = new ExpandLeftFatherPane(); rightFatherPane = new ExpandUpFatherPane(); - horizontalExpandableCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Horizontal_Extendable")); - verticalExpandableCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Vertical_Extendable")); + horizontalExpandableCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_ExpandD_Horizontal_Extendable")); + verticalExpandableCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_ExpandD_Vertical_Extendable")); sortAfterExpand = new SortExpandAttrPane(); initAllNames(); return layoutPane(); } private void initAllNames() { - expandDirectionButton.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction")); - leftFatherPane.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LeftParent")); - rightFatherPane.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Up_Father_Cell")); - horizontalExpandableCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expandable")); - verticalExpandableCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expandable")); + expandDirectionButton.setGlobalName(Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction")); + leftFatherPane.setGlobalName(Toolkit.i18nText("Fine-Design_Report_LeftParent")); + rightFatherPane.setGlobalName(Toolkit.i18nText("Fine-Design_Report_ExpandD_Up_Father_Cell")); + horizontalExpandableCheckBox.setGlobalName(Toolkit.i18nText("Fine-Design_Report_ExpandD_Expandable")); + verticalExpandableCheckBox.setGlobalName(Toolkit.i18nText("Fine-Design_Report_ExpandD_Expandable")); } private JPanel layoutPane() { layoutPane = new JPanel(new BorderLayout()); basicPane = new JPanel(); seniorPane = new JPanel(); - basicPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic"), 223, 24, basicPane()); - seniorPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 223, 24, seniorPane()); + basicPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Basic"), 223, 24, basicPane()); + seniorPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Advanced"), 223, 24, seniorPane()); layoutPane.add(basicPane, BorderLayout.NORTH); layoutPane.add(seniorPane, BorderLayout.CENTER); - return layoutPane; + + extraPane = CellExpandExtraAttrPane.getInstance(); + + JPanel content = new JPanel(new BorderLayout()); + content.add(layoutPane, BorderLayout.NORTH); + content.add(extraPane, BorderLayout.CENTER); + return content; } private JPanel basicPane() { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; - UILabel direction = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction"), SwingConstants.LEFT); + UILabel direction = new UILabel(Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction"), SwingConstants.LEFT); JPanel directionPane = new JPanel(new BorderLayout()); directionPane.add(direction, BorderLayout.NORTH); - UILabel left = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LeftParent"), SwingConstants.LEFT); + UILabel left = new UILabel(Toolkit.i18nText("Fine-Design_Report_LeftParent"), SwingConstants.LEFT); JPanel leftPane = new JPanel(new BorderLayout()); leftPane.add(left, BorderLayout.NORTH); - UILabel up = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Up_Father_Cell"), SwingConstants.LEFT); + UILabel up = new UILabel(Toolkit.i18nText("Fine-Design_Report_ExpandD_Up_Father_Cell"), SwingConstants.LEFT); JPanel upPane = new JPanel(new BorderLayout()); upPane.add(up, BorderLayout.NORTH); Component[][] components = new Component[][]{ @@ -107,7 +119,7 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { private JPanel seniorPane() { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; - UILabel expendSort = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Expend_Sort"), SwingConstants.LEFT); + UILabel expendSort = new UILabel(Toolkit.i18nText("Fine-Design_Report_Expend_Sort"), SwingConstants.LEFT); JPanel expendSortPane = new JPanel(new BorderLayout()); expendSortPane.add(expendSort, BorderLayout.NORTH); horizontalExpandableCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); @@ -118,9 +130,9 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { new Component[]{verticalExpandableCheckBox, null}, new Component[]{expendSortPane, sortAfterExpand}, }; - double[] rowSize = {p, p, p, p, p, p, p, p}; + double[] rowSize = {p, p, p, p, p}; double[] columnSize = {p, f}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 3}, {1, 3}}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, SENIOR_HORIZONTAL_GAP, LayoutConstants.VGAP_LARGE); } @@ -158,13 +170,15 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { } sortAfterExpand.populate(cellExpandAttr); + + extraPane.populate(cellElement); } @Override public String getIconPath() { // return "com/fr/design/images/expand/cellAttr.gif"; - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Expand"); + return Toolkit.i18nText("Fine-Design_Report_Expand"); } @@ -175,19 +189,19 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { cellExpandAttr = new CellExpandAttr(); cellElement.setCellExpandAttr(cellExpandAttr); } - if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction"))) { + if (ComparatorUtils.equals(getGlobalName(), Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction"))) { cellExpandAttr.setDirection(expandDirectionButton.getSelectedItem()); } - if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LeftParent"))) { + if (ComparatorUtils.equals(getGlobalName(), Toolkit.i18nText("Fine-Design_Report_LeftParent"))) { this.leftFatherPane.update(cellExpandAttr); } - if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Up_Father_Cell"))) { + if (ComparatorUtils.equals(getGlobalName(), Toolkit.i18nText("Fine-Design_Report_ExpandD_Up_Father_Cell"))) { this.rightFatherPane.update(cellExpandAttr); } // extendable - if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expandable"))) { + if (ComparatorUtils.equals(getGlobalName(), Toolkit.i18nText("Fine-Design_Report_ExpandD_Expandable"))) { if (horizontalExpandableCheckBox.isSelected()) { if (verticalExpandableCheckBox.isSelected()) { cellExpandAttr.setExtendable(CellExpandAttr.Both_EXTENDABLE); @@ -203,10 +217,11 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { } } - if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ExpandD_Sort_After_Expand"))) { + if (ComparatorUtils.equals(getGlobalName(), Toolkit.i18nText("Fine-Design_Basic_ExpandD_Sort_After_Expand"))) { sortAfterExpand.update(cellExpandAttr); } + extraPane.update(cellElement); } /** @@ -234,10 +249,10 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { } /** - * @return + * @return title */ public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Attribute"); + return Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Attribute"); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandExtraAttrPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandExtraAttrPane.java new file mode 100644 index 000000000..72427a156 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandExtraAttrPane.java @@ -0,0 +1,132 @@ +package com.fr.design.mainframe.cell.settingpane; + +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.fun.CellExpandAttrProvider; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.event.EventDispatcher; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.injectable.PluginModule; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; +import com.fr.report.cell.TemplateCellElement; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; + +import static com.fr.plugin.observer.PluginEventType.AfterActive; +import static com.fr.plugin.observer.PluginEventType.AfterInstall; +import static com.fr.plugin.observer.PluginEventType.AfterRun; +import static com.fr.plugin.observer.PluginEventType.AfterStop; +import static com.fr.plugin.observer.PluginEventType.AfterUpdate; + +/** + * @author yaohwu + * created by yaohwu at 2020/4/28 10:01 + */ +public class CellExpandExtraAttrPane extends JPanel { + + private static final double V_GAP = 5; + private static final double H_GAP = 0; + private static final int DEFAULT_COMPONENT_SIZE = 2; + + private List> extras = null; + private TemplateCellElement cellElement = null; + + + private static final class Holder { + private static final CellExpandExtraAttrPane INSTANCE = new CellExpandExtraAttrPane(); + } + + static { + PluginFilter filter = new PluginFilter() { + @Override + public boolean accept(PluginContext pluginContext) { + return pluginContext.contain(PluginModule.ExtraDesign, CellExpandAttrProvider.MARK_STRING); + } + }; + PluginEventListener listener = new PluginEventListener() { + @Override + public void on(PluginEvent event) { + CellExpandExtraAttrPane.getInstance().refresh(); + } + }; + EventDispatcher.listen(AfterRun, listener, filter); + EventDispatcher.listen(AfterStop, listener, filter); + EventDispatcher.listen(AfterInstall, listener, filter); + EventDispatcher.listen(AfterUpdate, listener, filter); + EventDispatcher.listen(AfterActive, listener, filter); + EventDispatcher.listen(AfterActive, listener, filter); + } + + public static CellExpandExtraAttrPane getInstance() { + return Holder.INSTANCE; + } + + /** + * Creates a new JPanel with a double buffer + * and a flow layout. + */ + private CellExpandExtraAttrPane() { + this.setBorder(null); + this.setLayout(new BorderLayout()); + } + + public void populate(TemplateCellElement cellElement) { + this.cellElement = cellElement; + if (extras != null) { + for (BasicBeanPane extra : extras) { + extra.populateBean(cellElement); + } + } + } + + public void update(TemplateCellElement cellElement) { + this.cellElement = cellElement; + if (extras != null) { + for (BasicBeanPane extra : extras) { + extra.updateBean(cellElement); + } + } + } + + private void refresh() { + this.removeAll(); + if (extras == null) { + extras = new ArrayList<>(); + } + extras.clear(); + Set attrProviders = ExtraDesignClassManager.getInstance().getArray(CellExpandAttrProvider.MARK_STRING); + if (attrProviders != null) { + for (CellExpandAttrProvider attrProvider : attrProviders) { + BasicBeanPane extra = attrProvider.createPanel(); + if (extra != null) { + extras.add(extra); + } + } + } + Component[][] components = new Component[extras.size()][DEFAULT_COMPONENT_SIZE]; + + for (int i = 0; i < extras.size(); i++) { + components[i] = new Component[]{extras.get(i), null}; + } + double[] rowSize = new double[extras.size()]; + Arrays.fill(rowSize, TableLayout.PREFERRED); + double[] columnSize = {TableLayout.PREFERRED, TableLayout.FILL}; + JPanel content = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, H_GAP, V_GAP); + this.add(content, BorderLayout.CENTER); + if (this.cellElement != null) { + this.populate(cellElement); + } + this.validate(); + this.repaint(); + } + +} From bb8323bc62c236d29f9348a6b7dcb89865fe8cd9 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 29 Apr 2020 11:32:05 +0800 Subject: [PATCH 275/375] =?UTF-8?q?REPORT-28242=20=E5=8A=A0=E4=B8=AA?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/present/StyleArrayPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/present/StyleArrayPane.java b/designer-realize/src/main/java/com/fr/design/present/StyleArrayPane.java index 81eda0e7a..87d78d690 100644 --- a/designer-realize/src/main/java/com/fr/design/present/StyleArrayPane.java +++ b/designer-realize/src/main/java/com/fr/design/present/StyleArrayPane.java @@ -4,6 +4,7 @@ import com.fr.base.Style; import com.fr.config.ServerPreferenceConfig; import com.fr.config.StyleMap; import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.NameInspector; import com.fr.design.gui.controlpane.AbstractNameableCreator; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameableCreator; @@ -35,7 +36,7 @@ public class StyleArrayPane extends JListControlPane { super(); this.addModNameActionListener(new ModNameActionListener() { public void nameModed(int index, String oldName, String newName) { - if (ComparatorUtils.equals(oldName, newName)) { + if (ComparatorUtils.equals(oldName, newName) || ComparatorUtils.equals(newName, NameInspector.ILLEGAL_NAME_HOLDER)) { return; } namePermitted = true; From c4af0657bf12e1c0a7674d64e555787d02f47be8 Mon Sep 17 00:00:00 2001 From: yaohwu Date: Wed, 29 Apr 2020 11:43:41 +0800 Subject: [PATCH 276/375] rename --- ...AttrProvider.java => CellExpandAttrPanelProvider.java} | 7 +++++-- ...ider.java => AbstractCellExpandAttrPanelProvider.java} | 8 ++++---- .../cell/settingpane/CellExpandExtraAttrPane.java | 8 ++++---- 3 files changed, 13 insertions(+), 10 deletions(-) rename designer-base/src/main/java/com/fr/design/fun/{CellExpandAttrProvider.java => CellExpandAttrPanelProvider.java} (60%) rename designer-base/src/main/java/com/fr/design/fun/impl/{AbstractCellExpandAttrProvider.java => AbstractCellExpandAttrPanelProvider.java} (74%) diff --git a/designer-base/src/main/java/com/fr/design/fun/CellExpandAttrProvider.java b/designer-base/src/main/java/com/fr/design/fun/CellExpandAttrPanelProvider.java similarity index 60% rename from designer-base/src/main/java/com/fr/design/fun/CellExpandAttrProvider.java rename to designer-base/src/main/java/com/fr/design/fun/CellExpandAttrPanelProvider.java index 9e0c37355..ec37e1600 100644 --- a/designer-base/src/main/java/com/fr/design/fun/CellExpandAttrProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/CellExpandAttrPanelProvider.java @@ -8,11 +8,14 @@ import com.fr.stable.fun.mark.Mutable; * @author yaohwu * created by yaohwu at 2020/4/26 15:50 */ -public interface CellExpandAttrProvider extends Mutable { +public interface CellExpandAttrPanelProvider extends Mutable { - String MARK_STRING = "CellExpandAttrProvider"; + String MARK_STRING = "CellExpandAttrPanelProvider"; int CURRENT_LEVEL = 1; + /** + * @return 创建单元格属性-扩展设置中的额外面板 + */ BasicBeanPane createPanel(); } diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellExpandAttrProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellExpandAttrPanelProvider.java similarity index 74% rename from designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellExpandAttrProvider.java rename to designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellExpandAttrPanelProvider.java index 57f54db6c..3ec730862 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellExpandAttrProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellExpandAttrPanelProvider.java @@ -1,7 +1,7 @@ package com.fr.design.fun.impl; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.fun.CellExpandAttrProvider; +import com.fr.design.fun.CellExpandAttrPanelProvider; import com.fr.report.cell.TemplateCellElement; import com.fr.stable.fun.mark.API; @@ -9,8 +9,8 @@ import com.fr.stable.fun.mark.API; * @author yaohwu * created by yaohwu at 2020/4/26 16:08 */ -@API(level = CellExpandAttrProvider.CURRENT_LEVEL) -public class AbstractCellExpandAttrProvider implements CellExpandAttrProvider { +@API(level = CellExpandAttrPanelProvider.CURRENT_LEVEL) +public class AbstractCellExpandAttrPanelProvider implements CellExpandAttrPanelProvider { /** * 当前接口的API等级,用于判断是否需要升级插件 @@ -19,7 +19,7 @@ public class AbstractCellExpandAttrProvider implements CellExpandAttrProvider { */ @Override public int currentAPILevel() { - return CellExpandAttrProvider.CURRENT_LEVEL; + return CellExpandAttrPanelProvider.CURRENT_LEVEL; } /** diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandExtraAttrPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandExtraAttrPane.java index 72427a156..e6a48bd65 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandExtraAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandExtraAttrPane.java @@ -2,7 +2,7 @@ package com.fr.design.mainframe.cell.settingpane; import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.fun.CellExpandAttrProvider; +import com.fr.design.fun.CellExpandAttrPanelProvider; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.event.EventDispatcher; @@ -49,7 +49,7 @@ public class CellExpandExtraAttrPane extends JPanel { PluginFilter filter = new PluginFilter() { @Override public boolean accept(PluginContext pluginContext) { - return pluginContext.contain(PluginModule.ExtraDesign, CellExpandAttrProvider.MARK_STRING); + return pluginContext.contain(PluginModule.ExtraDesign, CellExpandAttrPanelProvider.MARK_STRING); } }; PluginEventListener listener = new PluginEventListener() { @@ -103,9 +103,9 @@ public class CellExpandExtraAttrPane extends JPanel { extras = new ArrayList<>(); } extras.clear(); - Set attrProviders = ExtraDesignClassManager.getInstance().getArray(CellExpandAttrProvider.MARK_STRING); + Set attrProviders = ExtraDesignClassManager.getInstance().getArray(CellExpandAttrPanelProvider.MARK_STRING); if (attrProviders != null) { - for (CellExpandAttrProvider attrProvider : attrProviders) { + for (CellExpandAttrPanelProvider attrProvider : attrProviders) { BasicBeanPane extra = attrProvider.createPanel(); if (extra != null) { extras.add(extra); From 01ebd7c8e9b3cd76520ffd681793bbf052d70baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 29 Apr 2020 15:00:12 +0800 Subject: [PATCH 277/375] =?UTF-8?q?CHART-13744=20=E9=A2=84=E5=AE=9A?= =?UTF-8?q?=E9=85=8D=E8=89=B2=E6=96=B0=E5=A2=9E=E9=85=8D=E8=89=B2=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E9=A2=84=E8=A7=88=E4=B8=8D=E6=AD=A3=E5=B8=B8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/module/ChartPreFillStylePane.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java index de85cfcdb..d174340ca 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java @@ -12,6 +12,7 @@ import com.fr.design.style.background.gradient.FixedGradientBar; import javax.swing.JPanel; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.awt.BorderLayout; import java.awt.CardLayout; @@ -25,6 +26,7 @@ import java.awt.event.ActionListener; /** * 预定义的图表配色界面. + * * @author kunsnat E-mail:kunsnat@gmail.com * @version 创建时间:2013-8-21 下午03:16:27 */ @@ -78,7 +80,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { }; this.setLayout(new BorderLayout()); - this.add(TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize), BorderLayout.WEST); + this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.WEST); } private void initListener() { @@ -131,6 +133,11 @@ public class ChartPreFillStylePane extends BasicBeanPane { if (colorList.size() > 0) { colorAdjustPane.updateColor(colorList.toArray(new Color[colorList.size()])); + } else { + List resultList = new ArrayList<>(); + Collections.addAll(resultList, ChartColorAdjustPane.DEFAULT_COLORS); + condition.setColorList(resultList); + colorAdjustPane.updateColor(ChartColorAdjustPane.DEFAULT_COLORS); } } } @@ -141,7 +148,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { List colorList = new ArrayList(); - if(gradientButton.isSelected()) { + if (gradientButton.isSelected()) { chartColorMatching.setGradient(true); Color start = colorGradient.getSelectColorPointBtnP1().getColorInner(); @@ -152,7 +159,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { chartColorMatching.setGradient(false); Color[] colors = colorAdjustPane.getColors(); - for(Color color : colors) { + for (Color color : colors) { colorList.add(color); } } From 5d1d2ab1fc05b9e198d80d0899825b72c6347302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 29 Apr 2020 15:11:24 +0800 Subject: [PATCH 278/375] CHART-13744 --- .../main/java/com/fr/design/module/ChartPreFillStylePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java index d174340ca..9b821c8b0 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java @@ -131,7 +131,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { gradientButton.setSelected(false); cardLayout.show(changeColorSetPane, "acc"); - if (colorList.size() > 0) { + if (!colorList.isEmpty()) { colorAdjustPane.updateColor(colorList.toArray(new Color[colorList.size()])); } else { List resultList = new ArrayList<>(); From a6b812b0d21d774e135916433aebf29fc8d04bf2 Mon Sep 17 00:00:00 2001 From: yaohwu Date: Wed, 29 Apr 2020 15:13:29 +0800 Subject: [PATCH 279/375] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E9=9C=80?= =?UTF-8?q?=E7=9A=84=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cell/settingpane/CellExpandExtraAttrPane.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandExtraAttrPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandExtraAttrPane.java index e6a48bd65..58f11277c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandExtraAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandExtraAttrPane.java @@ -21,11 +21,8 @@ import java.util.Arrays; import java.util.List; import java.util.Set; -import static com.fr.plugin.observer.PluginEventType.AfterActive; -import static com.fr.plugin.observer.PluginEventType.AfterInstall; import static com.fr.plugin.observer.PluginEventType.AfterRun; import static com.fr.plugin.observer.PluginEventType.AfterStop; -import static com.fr.plugin.observer.PluginEventType.AfterUpdate; /** * @author yaohwu @@ -60,10 +57,6 @@ public class CellExpandExtraAttrPane extends JPanel { }; EventDispatcher.listen(AfterRun, listener, filter); EventDispatcher.listen(AfterStop, listener, filter); - EventDispatcher.listen(AfterInstall, listener, filter); - EventDispatcher.listen(AfterUpdate, listener, filter); - EventDispatcher.listen(AfterActive, listener, filter); - EventDispatcher.listen(AfterActive, listener, filter); } public static CellExpandExtraAttrPane getInstance() { From 618d5db5436ab3976c06cd50424599c0a8a40f58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 29 Apr 2020 15:16:49 +0800 Subject: [PATCH 280/375] CHART-13744 --- .../java/com/fr/design/module/ChartPreFillStylePane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java index 9b821c8b0..34f917f15 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java @@ -131,13 +131,13 @@ public class ChartPreFillStylePane extends BasicBeanPane { gradientButton.setSelected(false); cardLayout.show(changeColorSetPane, "acc"); - if (!colorList.isEmpty()) { - colorAdjustPane.updateColor(colorList.toArray(new Color[colorList.size()])); - } else { + if (colorList.isEmpty()) { List resultList = new ArrayList<>(); Collections.addAll(resultList, ChartColorAdjustPane.DEFAULT_COLORS); condition.setColorList(resultList); colorAdjustPane.updateColor(ChartColorAdjustPane.DEFAULT_COLORS); + } else { + colorAdjustPane.updateColor(colorList.toArray(new Color[colorList.size()])); } } } From 6452df94491e23a46682f61a92ef9cd9ec7c87ec Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Thu, 30 Apr 2020 11:22:14 +0800 Subject: [PATCH 281/375] REPORT-27998 bugfix --- .../datapane/TableDataCreatorProducer.java | 2 + .../datapane/TableDataNameObjectCreator.java | 50 +++++++++++++++---- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataCreatorProducer.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataCreatorProducer.java index 533139b37..d4e1c61b7 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataCreatorProducer.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataCreatorProducer.java @@ -60,6 +60,7 @@ public class TableDataCreatorProducer { "Proc", "/com/fr/design/images/data/store_procedure.png", StoreProcedure.class, ProcedureDataPane.class) { + @Override public boolean shouldInsertSeparator() { return true; } @@ -92,6 +93,7 @@ public class TableDataCreatorProducer { }; TableDataNameObjectCreator storeProcedure = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Stored_Procedure"), "/com/fr/design/images/data/store_procedure.png", StoreProcedure.class, ProcedureDataPane.class) { + @Override public boolean shouldInsertSeparator() { return true; } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java index a90f7a126..339eda7b9 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java @@ -1,14 +1,19 @@ package com.fr.design.data.datapane; import com.fr.base.BaseUtils; +import com.fr.data.TableDataSource; import com.fr.data.impl.DBTableData; import com.fr.design.actions.tabledata.TableDataAction; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.data.DesignTableDataManager; import com.fr.design.gui.controlpane.NameObjectCreator; +import com.fr.design.gui.controlpane.UnrepeatedNameHelper; import com.fr.design.icon.WarningIcon; import com.fr.general.ComparatorUtils; +import com.fr.general.NameObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; +import com.fr.stable.Nameable; import com.fr.stable.StringUtils; import javax.swing.Icon; @@ -32,6 +37,7 @@ public class TableDataNameObjectCreator extends NameObjectCreator { private boolean isNeedInsertSeparator = false; private String prefix = ""; private java.util.List names = new ArrayList(); + private String[] allDSNames; public TableDataNameObjectCreator(TableDataAction action) { super(action.getDisplayName(), action.getIconPath(), action.getTableDataClass(), action.getUpdateTableDataPaneClass()); @@ -90,11 +96,7 @@ public class TableDataNameObjectCreator extends NameObjectCreator { } } - /** - * 取得菜单的图片 - * - * @return 图片 - */ + @Override public Icon menuIcon() { return createMenuIcon(); } @@ -107,11 +109,7 @@ public class TableDataNameObjectCreator extends NameObjectCreator { return b ? new WarningIcon(this.menuImage) : this.menuIcon; } - /** - * 创建提示 - * - * @return 提示 - */ + @Override public String createTooltip() { return b ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connect_SQL_Cannot_Null") : null; } @@ -166,11 +164,43 @@ public class TableDataNameObjectCreator extends NameObjectCreator { return false; } + @Override public boolean equals(Object obj) { return obj instanceof TableDataNameObjectCreator && ComparatorUtils.equals(menuName, ((TableDataNameObjectCreator) obj).menuName); } + @Override + public Nameable createNameable(UnrepeatedNameHelper helper) { + try { + return new NameObject(this.createUnrepeatedName(this.getPrefix()), clazzOfInitCase.newInstance()); + } catch (InstantiationException | IllegalAccessException e) { + throw new RuntimeException(e); + } + } + + public String createUnrepeatedName(String prefix) { + int count = 1; + + while (isDsNameRepeated(prefix + count)) { + count++; + } + return prefix + count; + } + + private boolean isDsNameRepeated(String name) { + if (allDSNames == null) { + TableDataSource source = DesignTableDataManager.getEditingTableDataSource(); + allDSNames = DesignTableDataManager.getAllDSNames(source); + } + for (String allDSName : allDSNames) { + if (ComparatorUtils.equals(name, allDSName)) { + return true; + } + } + return false; + } + @Override public int hashCode() { return menuName == null ? 0 : menuName.hashCode(); From 649cd4590e03a19f2482dcd2ab40c187d01242f7 Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 30 Apr 2020 11:48:15 +0800 Subject: [PATCH 282/375] =?UTF-8?q?MOBILE-25666=20=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E6=8A=98=E5=8F=A0=E5=B1=95=E5=BC=80=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=A0=B7=E5=BC=8F=E4=B8=8D=E7=AC=A6=E5=90=88?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/MobileCollapsedStyleExpandPane.java | 50 +++--- .../mobile/ui/MobileCollapsedStylePane.java | 153 ++++++++++-------- .../mobile/ui/MobileComboBoxDialogEditor.java | 5 +- 3 files changed, 118 insertions(+), 90 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStyleExpandPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStyleExpandPane.java index 766f06d51..8fd34d452 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStyleExpandPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStyleExpandPane.java @@ -6,13 +6,12 @@ import com.fr.design.gui.itextfield.UIIntNumberField; import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.widget.UITitleSplitLine; +import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.mobile.MobileCollapsedStyle; import com.fr.form.ui.mobile.MobileFormCollapsedStyle; -import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.awt.Dimension; +import javax.swing.*; +import java.awt.*; /** * @author hades @@ -21,34 +20,45 @@ import java.awt.Dimension; */ public class MobileCollapsedStyleExpandPane extends MobileCollapsedStylePane { - private static final Dimension DEFAULT_SPINNER_SIZE = new Dimension(60, 24); - private UISpinner rowSpinner; public MobileCollapsedStyleExpandPane() { } - @Override - protected JPanel createLinePane() { - UITitleSplitLine splitLine = new UITitleSplitLine(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Line_Number"), 520); - splitLine.setPreferredSize(new Dimension(520, 20)); + protected void createConfigPanes(JPanel settingPane) { + JPanel lineNumberConfigPane = this.createLineNumberConfigPane(); + settingPane.add(lineNumberConfigPane); + super.createConfigPanes(settingPane); + } + + protected JPanel createLineNumberConfigPane() { + JPanel configPane = super.createTitleConfigPane(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Line_Number")); + + UILabel collapseLocationLabel = createLabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Show_Button")); this.rowSpinner = new UISpinner(1, Integer.MAX_VALUE, 1, 1) { @Override protected UINumberField initNumberField(){ return new UIIntNumberField(); } }; - rowSpinner.setPreferredSize(DEFAULT_SPINNER_SIZE); - JPanel panel = new JPanel(); - panel.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); - panel.add(new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Start_From"))); - panel.add(rowSpinner); - panel.add(new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Row_To_Fold"))); - JPanel linePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - linePane.add(splitLine, BorderLayout.NORTH); - linePane.add(panel, BorderLayout.CENTER); - return linePane; + this.rowSpinner.setPreferredSize(new Dimension(62, COMPONENT_HEIGHT)); + JPanel defaultCollapsedStatePanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + defaultCollapsedStatePanel.add(createLabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Start_From") + " ")); + defaultCollapsedStatePanel.add(rowSpinner); + defaultCollapsedStatePanel.add(createLabel(" " + Toolkit.i18nText("Fine-Design_Mobile_Collapse_Row_To_Fold"))); + + double[] rowSize = {COMPONENT_HEIGHT}; + double[] columnSize = {LABEL_WIDTH, COMPONENT_WIDTH}; + double[] verticalGaps = {0}; + JPanel navButtonSettingsPanel = TableLayoutHelper.createDiffVGapTableLayoutPane(new JComponent[][]{ + {collapseLocationLabel, defaultCollapsedStatePanel}, + }, rowSize, columnSize, 5, verticalGaps); + navButtonSettingsPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 15, 0)); + + configPane.add(navButtonSettingsPanel); + + return configPane; } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStylePane.java index 74538e77c..ae86e90ca 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileCollapsedStylePane.java @@ -1,8 +1,6 @@ package com.fr.design.mainframe.mobile.ui; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.constants.LayoutConstants; -import com.fr.design.designer.IntervalConstants; import com.fr.design.gui.ibutton.ModeButtonGroup; import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.icheckbox.UICheckBox; @@ -10,9 +8,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.mainframe.widget.UITitleSplitLine; import com.fr.design.style.color.NewColorSelectBox; import com.fr.design.utils.gui.GUICoreUtils; @@ -21,13 +17,7 @@ import com.fr.form.ui.mobile.MobileChartCollapsedStyle; import com.fr.form.ui.mobile.MobileCollapsedStyle; import javax.swing.*; -import javax.swing.border.TitledBorder; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.FlowLayout; +import java.awt.*; /** * @author hades @@ -36,6 +26,13 @@ import java.awt.FlowLayout; */ public class MobileCollapsedStylePane extends BasicBeanPane { + public final static Color THEME_COLOR = Color.decode("#2F8EF1"); + public final static Font TEXT_FONT = new Font("Default", Font.PLAIN, 12); + public final static Color TEXT_FONT_COLOR = Color.decode("#333334"); + public final static int LABEL_WIDTH = 96; + public final static int COMPONENT_HEIGHT = 20; + public final static int COMPONENT_WIDTH = 160; + private UICheckBox showButtonCheck; private NewColorSelectBox buttonColorBox; private UITextField foldedTextFiled; @@ -44,74 +41,94 @@ public class MobileCollapsedStylePane extends BasicBeanPane(); + + UILabel defaultCollapsedStateLabel = this.createLabel(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Default_State")); + JPanel defaultCollapsedStatePanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); UIRadioButton foldedButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Fold")); foldedButton.setSelected(true); + foldedButton.setPreferredSize(new Dimension(COMPONENT_WIDTH / 2, COMPONENT_HEIGHT)); + foldedButton.setForeground(TEXT_FONT_COLOR); + foldedButton.setFont(TEXT_FONT); UIRadioButton unfoldedButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Mobile_Collapse_Unfold")); + unfoldedButton.setPreferredSize(new Dimension(COMPONENT_WIDTH / 2, COMPONENT_HEIGHT)); + unfoldedButton.setForeground(TEXT_FONT_COLOR); + unfoldedButton.setFont(TEXT_FONT); + defaultCollapsedStatePanel.add(foldedButton); + defaultCollapsedStatePanel.add(unfoldedButton); + + buttonGroup = new ModeButtonGroup<>(); buttonGroup.put(CollapseState.FOLDED, foldedButton); buttonGroup.put(CollapseState.UNFOLDED, unfoldedButton); - JPanel flowLeftPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); - flowLeftPane.add(foldedButton); - flowLeftPane.add(unfoldedButton); - Component[][] northComponents = new Component[][] { - new Component[] {showButtonLabel, showButtonCheck} - }; - Component[][] southComponents = new Component[][] { - new Component[] {defaultStateLabel, flowLeftPane} - }; - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; - double[] rowSize = {p, p, p, p, p}; - double[] colSize = {p, f}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; - Component[][] centerComponents = new Component[][] { - new Component[] {buttonColorLabel, buttonColorBox}, - new Component[] {foldedLabel, foldedTextFiled}, - new Component[] {unfoldedLabel, unfoldedTextFiled}, - }; - JPanel northPane = TableLayoutHelper.createGapTableLayoutPane(northComponents, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1); - JPanel southPane = TableLayoutHelper.createGapTableLayoutPane(southComponents, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); - final JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(centerComponents, rowSize, colSize, rowCount, LayoutConstants.HGAP_LARGE, LayoutConstants.VGAP_SMALL); - JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - panel.add(northPane, BorderLayout.NORTH); - panel.add(centerPane, BorderLayout.CENTER); - panel.add(southPane, BorderLayout.SOUTH); - settingPane.add(splitLine); - settingPane.add(panel); - showButtonCheck.addChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - centerPane.setVisible(showButtonCheck.isSelected()); - } - }); - return settingPane; - } - protected JPanel createLinePane() { - return FRGUIPaneFactory.createBorderLayout_S_Pane(); + double[] rowSize = {COMPONENT_HEIGHT, COMPONENT_HEIGHT, COMPONENT_HEIGHT, COMPONENT_HEIGHT, COMPONENT_HEIGHT}; + double[] columnSize = {LABEL_WIDTH, COMPONENT_WIDTH}; + double[] verticalGaps = {10, 10, 10, 10, 10}; + JPanel contentPane = TableLayoutHelper.createDiffVGapTableLayoutPane(new JComponent[][]{ + {showButtonLabel, showButtonCheck}, + {buttonColorLabel, buttonColorBox}, + {foldedLabel, foldedTextFiled}, + {unfoldedLabel, unfoldedTextFiled}, + {defaultCollapsedStateLabel, defaultCollapsedStatePanel} + }, rowSize, columnSize, 5, verticalGaps); + contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 15, 0)); + + configPane.add(contentPane); + + return configPane; } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileComboBoxDialogEditor.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileComboBoxDialogEditor.java index 6e9b74a1d..7a8b82372 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileComboBoxDialogEditor.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileComboBoxDialogEditor.java @@ -9,8 +9,8 @@ import com.fr.design.i18n.Toolkit; import com.fr.form.ui.mobile.MobileCollapsedStyle; import com.fr.general.ComparatorUtils; -import javax.swing.SwingUtilities; -import java.awt.Dimension; +import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -33,6 +33,7 @@ public class MobileComboBoxDialogEditor extends BasicPane { private ActionListener listener; public MobileComboBoxDialogEditor(MobileCollapsedStylePane stylePane) { + this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); this.stylePane = stylePane; this.comboBox = new UIComboBox(new Object[] {NONE, CUSTOM}); this.comboBox.setPreferredSize(COMBOX_DIMENSION); From 4396d78c3377ac5d25767681684f987f92f45d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 30 Apr 2020 17:25:34 +0800 Subject: [PATCH 283/375] =?UTF-8?q?CHART-13598=20&&=20CHART-13604=20?= =?UTF-8?q?=E8=81=9A=E5=90=88=E6=8A=A5=E8=A1=A8=E8=B6=85=E9=93=BE=E6=82=AC?= =?UTF-8?q?=E6=B5=AE=E5=85=83=E7=B4=A0=E6=8A=A5=E9=94=99=20&&=20=E5=88=A0?= =?UTF-8?q?=E6=8E=89=E8=B6=85=E9=93=BE=E6=82=AC=E6=B5=AE=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E9=BB=98=E8=AE=A4=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ChartHyperPopAttrPane.java | 12 +++++------- .../impl/ChartHyperRelateFloatLinkPane.java | 14 +++++++++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPopAttrPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPopAttrPane.java index 4e1a4b2f4..ac30dbf3b 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPopAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPopAttrPane.java @@ -13,13 +13,14 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.utils.gui.GUICoreUtils; - import com.fr.stable.ParameterProvider; -import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import javax.swing.SwingConstants; import java.util.List; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; /** * 图表弹出超链, 悬浮窗属性设置界面. @@ -108,9 +109,6 @@ public class ChartHyperPopAttrPane extends AbstractChartAttrPane { */ public void updateBean(ChartHyperPoplink chartHyperlink) { String title = titleField.getText(); - if (StringUtils.isBlank(title)) { - title = "Chart"; - } chartHyperlink.setChartDigTitle(title); chartHyperlink.setWidth((int)widthField.getValue()); chartHyperlink.setHeight((int)heightField.getValue()); diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java index 96b157f10..15b2a4f6f 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java @@ -17,13 +17,13 @@ import javax.swing.JPanel; import javax.swing.border.Border; import javax.swing.border.LineBorder; import javax.swing.border.TitledBorder; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; /** * @author kunsnat E-mail:kunsnat@gmail.com @@ -84,8 +84,12 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane Date: Thu, 30 Apr 2020 17:34:27 +0800 Subject: [PATCH 284/375] =?UTF-8?q?REPORT-30947=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=96=87=E4=BB=B6-=E9=80=89=E9=A1=B9-=E9=AB=98?= =?UTF-8?q?=E7=BA=A7-=E4=BD=BF=E7=94=A8=E9=80=9A=E7=94=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=9E=E6=8E=A5=E7=AE=A1=E7=90=86=E5=99=A8=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/actions/file/PreferencePane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 387082ed0..57d9bbcb9 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -225,8 +225,8 @@ public class PreferencePane extends BasicPane { JPanel dbmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Database_Manager")); useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager")); - dbmSelectorPane.add(useUniverseDBMCheckbox); - advancePane.add(dbmSelectorPane); + //dbmSelectorPane.add(useUniverseDBMCheckbox); + //advancePane.add(dbmSelectorPane); JPanel improvePane = FRGUIPaneFactory.createVerticalTitledBorderPane(i18nText("Fine-Design_Basic_Product_Improve")); joinProductImproveCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Join_Product_Improve")); From 54bd1da0c7228be7de2490e09956b4545b1c96ab Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 30 Apr 2020 17:39:48 +0800 Subject: [PATCH 285/375] =?UTF-8?q?REPORT-30947=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=96=87=E4=BB=B6-=E9=80=89=E9=A1=B9-=E9=AB=98?= =?UTF-8?q?=E7=BA=A7-=E4=BD=BF=E7=94=A8=E9=80=9A=E7=94=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=9E=E6=8E=A5=E7=AE=A1=E7=90=86=E5=99=A8=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/actions/file/PreferencePane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 387082ed0..57d9bbcb9 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -225,8 +225,8 @@ public class PreferencePane extends BasicPane { JPanel dbmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Database_Manager")); useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager")); - dbmSelectorPane.add(useUniverseDBMCheckbox); - advancePane.add(dbmSelectorPane); + //dbmSelectorPane.add(useUniverseDBMCheckbox); + //advancePane.add(dbmSelectorPane); JPanel improvePane = FRGUIPaneFactory.createVerticalTitledBorderPane(i18nText("Fine-Design_Basic_Product_Improve")); joinProductImproveCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Join_Product_Improve")); From ff1e06b88fec1964590e0224791c1f741fd2b1e8 Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Wed, 6 May 2020 11:16:45 +0800 Subject: [PATCH 286/375] REPORT-27998 bugfix add comment --- .../data/datapane/TableDataNameObjectCreator.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java index 339eda7b9..20df61791 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java @@ -96,6 +96,11 @@ public class TableDataNameObjectCreator extends NameObjectCreator { } } + /** + * 取得菜单的图片 + * + * @return 图片 + */ @Override public Icon menuIcon() { return createMenuIcon(); @@ -109,6 +114,11 @@ public class TableDataNameObjectCreator extends NameObjectCreator { return b ? new WarningIcon(this.menuImage) : this.menuIcon; } + /** + * 创建提示 + * + * @return 提示 + */ @Override public String createTooltip() { return b ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connect_SQL_Cannot_Null") : null; From e1dfc732845e75c2669fa39d82fa8ad050a7c667 Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Wed, 6 May 2020 11:45:55 +0800 Subject: [PATCH 287/375] REPORT-27998 bugfix use ArrayUtils.contains to simply code. --- .../design/data/datapane/TableDataNameObjectCreator.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java index 20df61791..3ff2ed51b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java @@ -203,12 +203,7 @@ public class TableDataNameObjectCreator extends NameObjectCreator { TableDataSource source = DesignTableDataManager.getEditingTableDataSource(); allDSNames = DesignTableDataManager.getAllDSNames(source); } - for (String allDSName : allDSNames) { - if (ComparatorUtils.equals(name, allDSName)) { - return true; - } - } - return false; + return ArrayUtils.contains(allDSNames, name); } @Override From 7f8baa3369417478eb9430c8f1afb694649935dd Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 6 May 2020 15:20:32 +0800 Subject: [PATCH 288/375] =?UTF-8?q?CHART-13733=20=E6=8A=98=E7=BA=BF?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E8=AE=B0=E7=82=B9=E6=96=B0=E5=A2=9E=E8=87=AA?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/xcombox/MarkerComboBox.java | 12 ++- .../chart/area/VanChartAreaSeriesPane.java | 8 ++ .../component/VanChartMarkerPane.java | 17 ++-- .../marker/VanChartCommonMarkerPane.java | 97 +++++++++++++------ .../series/VanChartGanttCommonMarkerPane.java | 19 ++-- .../chart/line/VanChartLineSeriesPane.java | 19 ++++ .../series/VanChartMapScatterMarkerPane.java | 13 ++- 7 files changed, 137 insertions(+), 48 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/gui/xcombox/MarkerComboBox.java b/designer-chart/src/main/java/com/fr/design/gui/xcombox/MarkerComboBox.java index ef1976ce8..e5154ba5e 100644 --- a/designer-chart/src/main/java/com/fr/design/gui/xcombox/MarkerComboBox.java +++ b/designer-chart/src/main/java/com/fr/design/gui/xcombox/MarkerComboBox.java @@ -9,8 +9,10 @@ import com.fr.base.ScreenResolution; import com.fr.base.background.ColorBackground; import com.fr.chart.chartglyph.Marker; import com.fr.chart.chartglyph.NullMarker; +import com.fr.plugin.chart.glyph.marker.VanChartAutoMarker; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBoxRenderer; +import com.fr.design.i18n.Toolkit; import com.fr.general.FRFont; @@ -65,15 +67,21 @@ public class MarkerComboBox extends UIComboBox { g2d.setFont(FRContext.getDefaultValues().getFRFont()); if (marker != null) { - if (marker instanceof NullMarker) { + boolean isAutoMarker = marker instanceof VanChartAutoMarker; + boolean isNullMarker = marker instanceof NullMarker; + + if (isAutoMarker || isNullMarker) { g2d.setColor(Color.black); FRFont font = FRContext.getDefaultValues().getFRFont(); int resolution = ScreenResolution.getScreenResolution(); Font rfont = font.applyResolutionNP(resolution); g2d.setFont(rfont); FontMetrics fm = GraphHelper.getFontMetrics(rfont); + String text = isNullMarker + ?Toolkit.i18nText("Fine-Design_Report_None") + :Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto"); - GraphHelper.drawString(g2d, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None"), 12, (d.height - fm.getHeight()) / 2 + fm.getAscent()); + GraphHelper.drawString(g2d, text, 12, (d.height - fm.getHeight()) / 2 + fm.getAscent()); } else { if (marker.getBackground() == null) { marker.setBackground(ColorBackground.getInstance(Color.black)); diff --git a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java index 97c1c89fe..a006ce54f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java @@ -2,13 +2,16 @@ package com.fr.van.chart.area; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.van.chart.column.VanChartCustomStackAndAxisConditionPane; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartBeautyPane; import com.fr.van.chart.designer.component.VanChartLineTypePane; import com.fr.van.chart.designer.component.VanChartLineTypePaneWithoutDashed; +import com.fr.van.chart.designer.component.VanChartMarkerPane; import com.fr.van.chart.line.VanChartLineSeriesPane; import javax.swing.JPanel; @@ -55,4 +58,9 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane { protected VanChartLineTypePane getLineTypePane() { return new VanChartLineTypePaneWithoutDashed(); } + + protected JPanel createMarkerPane() { + markerPane = new VanChartMarkerPane(); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java index e2aff03f5..58d717af1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java @@ -1,6 +1,7 @@ package com.fr.van.chart.designer.component; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.i18n.Toolkit; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.plugin.chart.base.VanChartAttrMarker; @@ -25,13 +26,13 @@ public class VanChartMarkerPane extends BasicPane { private CardLayout cardLayout; private VanChartCommonMarkerPane commonMarkerPane; - + private BasicBeanPane imageMarkerPane; public VanChartMarkerPane() { this.setLayout(new BorderLayout(0, 4)); - String[] array = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Rule"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")}; + String[] array = new String[]{Toolkit.i18nText("Fine-Design_Chart_Rule"), Toolkit.i18nText("Fine-Design_Chart_Custom")}; commonORCustom = new UIButtonGroup(array, array); commonORCustom.addChangeListener(new ChangeListener() { @@ -56,8 +57,8 @@ public class VanChartMarkerPane extends BasicPane { } } }; - centerPane.add(commonMarkerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Rule")); - centerPane.add(imageMarkerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")); + centerPane.add(commonMarkerPane, Toolkit.i18nText("Fine-Design_Chart_Rule")); + centerPane.add(imageMarkerPane, Toolkit.i18nText("Fine-Design_Chart_Custom")); layoutComponents(); } @@ -75,8 +76,10 @@ public class VanChartMarkerPane extends BasicPane { } protected VanChartCommonMarkerPane createCommonMarkerPane() { + return new VanChartCommonMarkerPane(){ - protected double[] getcolumnSize () { + + protected double[] getColumnSize() { double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; return new double[] {d, s}; @@ -85,7 +88,7 @@ public class VanChartMarkerPane extends BasicPane { } protected void layoutComponents() { - this.add(TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Point_Style"), commonORCustom), BorderLayout.NORTH); + this.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Point_Style"), commonORCustom), BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); } @@ -98,7 +101,7 @@ public class VanChartMarkerPane extends BasicPane { } protected String title4PopupWindow(){ - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Marker"); + return Toolkit.i18nText("Fine-Design_Chart_Marker"); } public void populate(VanChartAttrMarker marker) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java index 7a03bd465..f62604501 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java @@ -1,6 +1,7 @@ package com.fr.van.chart.designer.component.marker; import com.fr.chart.chartglyph.Marker; +import com.fr.design.i18n.Toolkit; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; @@ -12,17 +13,23 @@ import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.background.VanChartMarkerBackgroundPane; import javax.swing.JPanel; +import java.awt.BorderLayout; import java.awt.Component; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; /** * Created by Mitisky on 16/5/19. * 通用标记点,标记点类型/颜色/半径 */ public class VanChartCommonMarkerPane extends BasicBeanPane { - private MarkerComboBox markerPane; + private MarkerComboBox markerTypeComboBox; private VanChartMarkerBackgroundPane markerFillColor; private UISpinner radius; + private JPanel markerTypePane; + private JPanel markerConfigPane; + private static final MarkerType[] NORMAL_TYPES = { MarkerType.MARKER_NULL, MarkerType.MARKER_CIRCLE, @@ -46,6 +53,20 @@ public class VanChartCommonMarkerPane extends BasicBeanPane return normalMarkers; } + protected static Marker[] getNormalMarkersWithAuto() { + if (normalMarkers == null) { + normalMarkers = new Marker[NORMAL_TYPES.length + 1]; + normalMarkers[0] = Marker.createMarker(MarkerType.MARKER_AUTO); + + int i = 1; + + for (MarkerType markerType : NORMAL_TYPES) { + normalMarkers[i++] = Marker.createMarker(markerType); + } + } + return normalMarkers; + } + //没有无这个选项 private static final MarkerType[] MAP_TYPES = { MarkerType.MARKER_CIRCLE, @@ -88,13 +109,16 @@ public class VanChartCommonMarkerPane extends BasicBeanPane return ganttMarkers; } + public MarkerComboBox getMarkerTypeComboBox() { + return markerTypeComboBox; + } - protected MarkerComboBox getMarkerPane(){ - return markerPane; + public UISpinner getRadius() { + return radius; } public VanChartCommonMarkerPane() { - markerPane = new MarkerComboBox(getMarkers()); + markerTypeComboBox = new MarkerComboBox(getMarkers()); markerFillColor = new VanChartMarkerBackgroundPane(){ protected Component[][] getPaneComponents() { return new Component[][]{ @@ -106,42 +130,55 @@ public class VanChartCommonMarkerPane extends BasicBeanPane radius = new UISpinner(0, 100, 0.5, 0); double p = TableLayout.PREFERRED; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; - double[] row = {p, p, p}; - Component[][] components = getUseComponent(); + markerTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(getMarkerTypeComponent(), new double[]{p}, getColumnSize()); + markerConfigPane = TableLayout4VanChartHelper.createGapTableLayoutPane(getMarkerConfigComponent(), new double[]{p, p}, getColumnSize()); - JPanel jPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, getcolumnSize()); + markerTypeComboBox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + checkMarkType(); + } + }); - this.add(jPanel); - } + JPanel contentPane = new JPanel(new BorderLayout(0, 6)); - protected double[] getcolumnSize () { - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; - return new double[] {d, e}; - } + contentPane.add(markerTypePane, BorderLayout.CENTER); + contentPane.add(markerConfigPane, BorderLayout.SOUTH); - protected Marker[] getMarkers() { - return getNormalMarkers(); + this.add(contentPane); } - protected Component[][] getUseComponent() { - return new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Type")), markerPane}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Fill_Color")), markerFillColor}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius")), radius}, + protected Component[][] getMarkerTypeComponent() { + return new Component[][]{ + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), markerTypeComboBox} }; } - protected Component[][] getUseComponentWithOutFillColor() { - return new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Type")), markerPane}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius")), radius}, + protected Component[][] getMarkerConfigComponent() { + return new Component[][]{ + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Fill_Color")), markerFillColor}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Radius")), radius} }; } + private void checkMarkType() { + if (markerConfigPane != null && markerTypeComboBox != null) { + MarkerType type = MarkerType.parse(markerTypeComboBox.getSelectedMarkder().getMarkerType()); + + markerConfigPane.setVisible(!(type == MarkerType.MARKER_AUTO || type == MarkerType.MARKER_NULL)); + } + } + + protected double[] getColumnSize() { + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; + return new double[] {d, e}; + } + + protected Marker[] getMarkers() { + return getNormalMarkers(); + } /** * title应该是一个属性,不只是对话框的标题时用到,与其他组件结合时,也会用得到 @@ -162,9 +199,11 @@ public class VanChartCommonMarkerPane extends BasicBeanPane marker = new VanChartAttrMarker(); marker.setCommon(true); } - markerPane.setSelectedMarker(Marker.createMarker(populateMarkType(marker))); + markerTypeComboBox.setSelectedMarker(Marker.createMarker(populateMarkType(marker))); populateColor(marker); radius.setValue(marker.getRadius()); + + checkMarkType(); } protected void populateColor(VanChartAttrMarker marker) { @@ -188,7 +227,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane marker.setCommon(true); updateColor(marker); marker.setRadius(radius.getValue()); - marker.setMarkerType(MarkerType.parse(markerPane.getSelectedMarkder().getMarkerType())); + marker.setMarkerType(MarkerType.parse(markerTypeComboBox.getSelectedMarkder().getMarkerType())); } protected void updateColor(VanChartAttrMarker marker){ diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttCommonMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttCommonMarkerPane.java index 04d4e46dc..ff7b04e6f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttCommonMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttCommonMarkerPane.java @@ -3,6 +3,7 @@ package com.fr.van.chart.gantt.designer.style.series; import com.fr.base.background.ColorBackground; import com.fr.chart.chartglyph.Marker; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent; import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.marker.type.MarkerType; @@ -15,6 +16,8 @@ import java.awt.Component; * Created by hufan on 2017/1/13. */ public class VanChartGanttCommonMarkerPane extends VanChartCommonMarkerPane { + private static final int PREFERRED_WIDTH = 100; + private ColorSelectBoxWithOutTransparent colorSelect; @Override @@ -22,13 +25,17 @@ public class VanChartGanttCommonMarkerPane extends VanChartCommonMarkerPane { return getGanttMarkers(); } - @Override - protected Component[][] getUseComponent() { - colorSelect = new ColorSelectBoxWithOutTransparent(100); + protected Component[][] getMarkerTypeComponent() { + return new Component[][]{ + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Shape")), getMarkerTypeComboBox()}, + }; + } + + protected Component[][] getMarkerConfigComponent() { + colorSelect = new ColorSelectBoxWithOutTransparent(PREFERRED_WIDTH); return new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Shape")), getMarkerPane()}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), colorSelect} + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), colorSelect} }; } @@ -52,7 +59,7 @@ public class VanChartGanttCommonMarkerPane extends VanChartCommonMarkerPane { @Override public void setDefaultValue() { - getMarkerPane().setSelectedMarker(Marker.createMarker(MarkerType.MARKER_STAR)); + getMarkerTypeComboBox().setSelectedMarker(Marker.createMarker(MarkerType.MARKER_STAR)); colorSelect.setSelectObject(new Color(248, 182, 44)); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java index 8300cac6b..974bc5e42 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java @@ -1,10 +1,15 @@ package com.fr.van.chart.line; import com.fr.chart.chartattr.Plot; +import com.fr.chart.chartglyph.Marker; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartBeautyPane; +import com.fr.van.chart.designer.component.VanChartMarkerPane; +import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane; import javax.swing.JPanel; @@ -44,4 +49,18 @@ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane { return null; } + protected JPanel createMarkerPane() { + markerPane = new VanChartMarkerPane() { + protected VanChartCommonMarkerPane createCommonMarkerPane() { + + return new VanChartCommonMarkerPane() { + protected Marker[] getMarkers() { + return getNormalMarkersWithAuto(); + } + }; + } + }; + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java index 7a0583ab9..4041152f4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java @@ -1,6 +1,8 @@ package com.fr.van.chart.map.designer.style.series; import com.fr.chart.chartglyph.Marker; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; @@ -11,9 +13,12 @@ import java.awt.Component; * 只有标记点类型和半径 */ public class VanChartMapScatterMarkerPane extends VanChartCommonMarkerPane { - @Override - protected Component[][] getUseComponent() { - return super.getUseComponentWithOutFillColor(); + + protected Component[][] getMarkerConfigComponent() { + + return new Component[][]{ + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Radius")), getRadius()} + }; } @Override @@ -22,7 +27,7 @@ public class VanChartMapScatterMarkerPane extends VanChartCommonMarkerPane { } @Override - protected double[] getcolumnSize () { + protected double[] getColumnSize() { double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; return new double[] {d, s}; From 9a68b44324045012480ccddcfa1785746f5acbb9 Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Wed, 6 May 2020 16:18:15 +0800 Subject: [PATCH 289/375] REPORT-27998 bugfix --- .../datapane/TableDataNameObjectCreator.java | 19 +-------- .../data/datapane/TableDataPaneListPane.java | 39 ++++++++----------- 2 files changed, 17 insertions(+), 41 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java index 3ff2ed51b..5c32b3cb5 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java @@ -183,29 +183,12 @@ public class TableDataNameObjectCreator extends NameObjectCreator { @Override public Nameable createNameable(UnrepeatedNameHelper helper) { try { - return new NameObject(this.createUnrepeatedName(this.getPrefix()), clazzOfInitCase.newInstance()); + return new NameObject(helper.createUnrepeatedName(this.getPrefix()), clazzOfInitCase.newInstance()); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException(e); } } - public String createUnrepeatedName(String prefix) { - int count = 1; - - while (isDsNameRepeated(prefix + count)) { - count++; - } - return prefix + count; - } - - private boolean isDsNameRepeated(String name) { - if (allDSNames == null) { - TableDataSource source = DesignTableDataManager.getEditingTableDataSource(); - allDSNames = DesignTableDataManager.getAllDSNames(source); - } - return ArrayUtils.contains(allDSNames, name); - } - @Override public int hashCode() { return menuName == null ? 0 : menuName.hashCode(); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java index d2fdc3229..35f6077b8 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java @@ -14,6 +14,7 @@ import com.fr.file.ProcedureConfig; import com.fr.file.TableDataConfig; import com.fr.general.ComparatorUtils; import com.fr.general.NameObject; +import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; @@ -133,36 +134,28 @@ public class TableDataPaneListPane extends JListControlPane implements TableData return super.createUnrepeatedName(prefix); } String[] allDsNames = DesignTableDataManager.getAllDSNames(source); + + // richer:生成的名字从1开始. kunsnat: 添加属性从0开始. + int count = 1; + while (isDsNameRepeated(prefix + count, allDsNames)) { + count++; + } + return prefix + count; + } + + private boolean isDsNameRepeated(String name, String[] allDsNames) { DefaultListModel model = this.getModel(); Nameable[] all = new Nameable[model.getSize()]; for (int i = 0; i < model.size(); i++) { all[i] = ((ListModelElement) model.get(i)).wrapper; } - // richer:生成的名字从1开始. kunsnat: 添加属性从0开始. - int count = all.length + 1; - while (true) { - String name_test = prefix + count; - boolean repeated = false; - for (int i = 0, len = model.size(); i < len; i++) { - Nameable nameable = all[i]; - if (ComparatorUtils.equals(nameable.getName(), name_test)) { - repeated = true; - break; - } - } - for (String dsname : allDsNames) { - if (ComparatorUtils.equals(dsname, name_test)) { - repeated = true; - break; - } + for (int i = 0, len = model.size(); i < len; i++) { + Nameable nameable = all[i]; + if (ComparatorUtils.equals(nameable.getName(), name)) { + return true; } - - if (!repeated) { - return name_test; - } - - count++; } + return ArrayUtils.contains(allDsNames, name); } @Override From ed3540a09a8ee525cdce463941d16a5a721550ca Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 6 May 2020 16:27:42 +0800 Subject: [PATCH 290/375] =?UTF-8?q?=E5=88=A0=E9=99=A4instanceof=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/xcombox/MarkerComboBox.java | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/gui/xcombox/MarkerComboBox.java b/designer-chart/src/main/java/com/fr/design/gui/xcombox/MarkerComboBox.java index e5154ba5e..5909437c7 100644 --- a/designer-chart/src/main/java/com/fr/design/gui/xcombox/MarkerComboBox.java +++ b/designer-chart/src/main/java/com/fr/design/gui/xcombox/MarkerComboBox.java @@ -8,8 +8,8 @@ import com.fr.base.GraphHelper; import com.fr.base.ScreenResolution; import com.fr.base.background.ColorBackground; import com.fr.chart.chartglyph.Marker; -import com.fr.chart.chartglyph.NullMarker; -import com.fr.plugin.chart.glyph.marker.VanChartAutoMarker; +import com.fr.general.ComparatorUtils; +import com.fr.plugin.chart.ConfigHelper; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.i18n.Toolkit; @@ -23,6 +23,8 @@ import java.awt.*; * Combobox for selecting marker. */ public class MarkerComboBox extends UIComboBox { + private static final double TEXT_X_COORDINATES = 12d; + /** * Constructor. * @@ -67,21 +69,15 @@ public class MarkerComboBox extends UIComboBox { g2d.setFont(FRContext.getDefaultValues().getFRFont()); if (marker != null) { - boolean isAutoMarker = marker instanceof VanChartAutoMarker; - boolean isNullMarker = marker instanceof NullMarker; + boolean isAutoMarker = ComparatorUtils.equals(marker.getMarkerType(), ConfigHelper.AUTO_M); + boolean isNullMarker = ComparatorUtils.equals(marker.getMarkerType(), ConfigHelper.NULL_M); if (isAutoMarker || isNullMarker) { - g2d.setColor(Color.black); - FRFont font = FRContext.getDefaultValues().getFRFont(); - int resolution = ScreenResolution.getScreenResolution(); - Font rfont = font.applyResolutionNP(resolution); - g2d.setFont(rfont); - FontMetrics fm = GraphHelper.getFontMetrics(rfont); String text = isNullMarker ?Toolkit.i18nText("Fine-Design_Report_None") :Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto"); - GraphHelper.drawString(g2d, text, 12, (d.height - fm.getHeight()) / 2 + fm.getAscent()); + paintTextMarker(g2d, d, text); } else { if (marker.getBackground() == null) { marker.setBackground(ColorBackground.getInstance(Color.black)); @@ -106,5 +102,16 @@ public class MarkerComboBox extends UIComboBox { private Marker marker = null; private boolean isSelected = false; + + private void paintTextMarker(Graphics2D g2d, Dimension d, String text) { + g2d.setColor(Color.black); + FRFont font = FRContext.getDefaultValues().getFRFont(); + int resolution = ScreenResolution.getScreenResolution(); + Font rfont = font.applyResolutionNP(resolution); + g2d.setFont(rfont); + FontMetrics fm = GraphHelper.getFontMetrics(rfont); + + GraphHelper.drawString(g2d, text, TEXT_X_COORDINATES, (d.height - fm.getHeight()) / 2 + fm.getAscent()); + } } } \ No newline at end of file From 04a30afae4e902b12158af465972d59e346e6b46 Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Wed, 6 May 2020 17:07:50 +0800 Subject: [PATCH 291/375] =?UTF-8?q?REPORT-27998=20bugfix=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E6=97=A0=E7=94=A8=E7=B1=BB=E5=92=8C=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/datapane/TableDataNameObjectCreator.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java index 5c32b3cb5..ce92574dc 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java @@ -1,11 +1,9 @@ package com.fr.design.data.datapane; import com.fr.base.BaseUtils; -import com.fr.data.TableDataSource; import com.fr.data.impl.DBTableData; import com.fr.design.actions.tabledata.TableDataAction; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.data.DesignTableDataManager; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.UnrepeatedNameHelper; import com.fr.design.icon.WarningIcon; @@ -16,8 +14,8 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; -import javax.swing.Icon; -import java.awt.Image; +import javax.swing.*; +import java.awt.*; import java.text.Collator; import java.util.ArrayList; import java.util.Arrays; @@ -37,7 +35,6 @@ public class TableDataNameObjectCreator extends NameObjectCreator { private boolean isNeedInsertSeparator = false; private String prefix = ""; private java.util.List names = new ArrayList(); - private String[] allDSNames; public TableDataNameObjectCreator(TableDataAction action) { super(action.getDisplayName(), action.getIconPath(), action.getTableDataClass(), action.getUpdateTableDataPaneClass()); From bd68a99584552b1ecc8a560f08ce0e52715a839c Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Wed, 6 May 2020 17:39:06 +0800 Subject: [PATCH 292/375] =?UTF-8?q?REPORT-27998=20bugfix=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/datapane/TableDataNameObjectCreator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java index ce92574dc..3f0f08f35 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java @@ -14,8 +14,8 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.Icon; +import java.awt.Image; import java.text.Collator; import java.util.ArrayList; import java.util.Arrays; From 42d9b9229f1a7142b5c1bbf5e40ee4141c9a6293 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 8 May 2020 13:44:18 +0800 Subject: [PATCH 293/375] =?UTF-8?q?REPORT-30031=E3=80=90=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=9F=8B=E7=82=B9=E3=80=91=E6=A8=A1=E6=9D=BF=E8=80=97?= =?UTF-8?q?=E6=97=B6=E5=92=8C=E6=A8=A1=E6=9D=BF=E5=88=B6=E4=BD=9C=E5=9F=8B?= =?UTF-8?q?=E7=82=B9=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 14 +- .../burying/point/AbstractPointInfo.java | 9 +- .../mainframe/template/info/TemplateInfo.java | 107 ++++++------- .../template/info/TemplateInfoCollector.java | 113 ++++++++++--- .../template/info/TemplateProcessInfo.java | 44 ++++++ .../info/TemplateInfoCollectorTest.java | 129 +++++++++------ .../template/info/TemplateInfoTest.java | 88 ++++++----- .../template/info/TemplateInfoTestHelper.java | 18 ++- .../design/mainframe/template/info/tpl.info | 44 +++--- .../designer/beans/models/SelectionModel.java | 4 + .../design/form/util/FormDesignerUtils.java | 24 ++- .../java/com/fr/design/mainframe/JForm.java | 21 +++ .../fr/design/mainframe/ToolBarButton.java | 8 +- .../template/info/ComponentProcessInfo.java | 73 +++++++++ .../template/info/JFormProcessInfo.java | 148 +++++++++++++++++ .../info/ComponentProcessInfoTest.java | 39 +++++ .../template/info/JFormProcessInfoTest.java | 149 ++++++++++++++++++ .../fr/design/mainframe/JPolyWorkBook.java | 12 ++ .../info/JPolyWorkBookProcessInfo.java | 77 +++++++++ .../template/info/JWorkBookProcessInfo.java | 83 ++++++++-- .../info/JWorkBookProcessInfoTest.java | 49 ++++++ 21 files changed, 1036 insertions(+), 217 deletions(-) create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentProcessInfo.java create mode 100644 designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentProcessInfoTest.java create mode 100644 designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java create mode 100644 designer-realize/src/main/java/com/fr/design/mainframe/template/info/JPolyWorkBookProcessInfo.java create mode 100644 designer-realize/src/test/java/com.fr/design/mainframe/template/info/JWorkBookProcessInfoTest.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 29c1dcb53..03248efb1 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 @@ -97,7 +97,7 @@ public abstract class JTemplate> private static short currentIndex = 0;// 此变量用于多次新建模板时,让名字不重复 private DesignModelAdapter designModel; private PreviewProvider previewType; - private TimeConsumeTimer consumeTimer = new TimeConsumeTimer(); + protected TimeConsumeTimer consumeTimer = new TimeConsumeTimer(); public int resolution = ScreenResolution.getScreenResolution(); public JTemplate() { @@ -266,7 +266,7 @@ public abstract class JTemplate> try { this.template = JTemplateFactory.asIOFile(this.editingFILE); setTarget(this.template); - + // 先移除旧的。 removeCenterPane(); // 加入新的 @@ -275,19 +275,19 @@ public abstract class JTemplate> FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - + private void addCenterPane() { - + this.centerPane = createCenterPane(); this.add(centerPane, BorderLayout.CENTER); } - + private void removeCenterPane() { - + JComponent centerPane = this.centerPane; this.remove(centerPane); } - + /** * 刷新容器 */ diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java index 6646bfd09..93ff42690 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java @@ -11,6 +11,9 @@ public abstract class AbstractPointInfo implements BasePointInfo { protected int idleDayCount; // 到现在为止,埋点闲置的天数 + //是否是测试模板 + protected boolean isTestTemplate; + @Override public void resetIdleDayCount() { this.idleDayCount = 0; @@ -38,10 +41,14 @@ public abstract class AbstractPointInfo implements BasePointInfo { } } + public void setTestTemplate(boolean testTemplate) { + isTestTemplate = testTemplate; + } + /** * 是否为测试模板 */ - protected abstract boolean isTestTemplate(); + public abstract boolean isTestTemplate(); /** * 是否已经制作完成 diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java index e233bc6e5..efd245bab 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java @@ -4,9 +4,7 @@ import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.burying.point.AbstractPointInfo; import com.fr.general.CloudCenter; -import com.fr.general.GeneralUtils; import com.fr.json.JSONObject; -import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; @@ -22,6 +20,7 @@ import java.util.Map; */ public class TemplateInfo extends AbstractPointInfo { static final String XML_TAG = "TemplateInfo"; + private static final String SIMPLE_DATE_PATTRN = "yyyy-MM-dd HH:mm"; private static final String CONSUMING_URL = CloudCenter.getInstance().acquireUrlByKind("tempinfo.consuming") + "/single"; private static final String PROCESS_URL = CloudCenter.getInstance().acquireUrlByKind("tempinfo.process") + "/single"; @@ -37,18 +36,17 @@ public class TemplateInfo extends AbstractPointInfo { private static final String ATTR_CELL_COUNT = "cell_count"; private static final String ATTR_BLOCK_COUNT = "block_count"; private static final String ATTR_REPORT_TYPE = "report_type"; - private static final String ATTR_ACTIVITYKEY = "activitykey"; - private static final String ATTR_JAR_TIME = "jar_time"; private static final String ATTR_CREATE_TIME = "create_time"; private static final String ATTR_UUID = "uuid"; - private static final String ATTR_TIME_CONSUME = "time_consume"; - private static final String ATTR_ORIGIN_TIME = "originTime"; - private static final String ATTR_VERSION = "version"; - private static final String ATTR_USERNAME = "username"; + private static final String ATTR_UID = "uid"; + private static final String ATTR_SAVE_RECORD = "saveRecord"; + private static final String ATTR_PARA_APPLY = "paraApply"; + private static final String ATTR_COMPONENTS_INFO = "components_info"; + + private static final String TEST_TEMPLATE_FLAG = "test_template"; private static final int VALID_CELL_COUNT = 5; // 有效报表模板的格子数 private static final int VALID_WIDGET_COUNT = 5; // 有效报表模板的控件数 - private static final int COMPLETE_DAY_COUNT = 15; // 判断模板是否完成的天数 private String templateID = StringUtils.EMPTY; private String originID = StringUtils.EMPTY; @@ -76,28 +74,25 @@ public class TemplateInfo extends AbstractPointInfo { } public static TemplateInfo newInstance(String templateID) { - return newInstance(templateID, StringUtils.EMPTY, 0); + return newInstance(templateID, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY); + } + + public static TemplateInfo newInstance(String templateID, String originID, String saveRecord) { + String createTime = new SimpleDateFormat(SIMPLE_DATE_PATTRN).format(Calendar.getInstance().getTime()); + return newInstance(templateID, originID, saveRecord, createTime); } - public static TemplateInfo newInstance(String templateID, String originID, int originTime) { + public static TemplateInfo newInstance(String templateID, String originID, String saveRecord, String createTime) { HashMap consumingMap = new HashMap<>(); - String username = MarketConfig.getInstance().getBbsUsername(); String uuid = DesignerEnvManager.getEnvManager().getUUID(); - String activitykey = DesignerEnvManager.getEnvManager().getActivationKey(); - String createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(Calendar.getInstance().getTime()); - String jarTime = GeneralUtils.readBuildNO(); - String version = ProductConstants.VERSION; - consumingMap.put(ATTR_USERNAME, username); + MarketConfig config = MarketConfig.getInstance(); consumingMap.put(ATTR_UUID, uuid); - consumingMap.put(ATTR_ACTIVITYKEY, activitykey); consumingMap.put(ATTR_TEMPLATE_ID, templateID); consumingMap.put(ATTR_ORIGIN_ID, originID); consumingMap.put(ATTR_CREATE_TIME, createTime); - consumingMap.put(ATTR_TIME_CONSUME, originTime); // timeConsume 在原来模版的基础上累加 - consumingMap.put(ATTR_ORIGIN_TIME, originTime); - consumingMap.put(ATTR_JAR_TIME, jarTime); - consumingMap.put(ATTR_VERSION, version); + consumingMap.put(ATTR_UID, config.getBBSAttr().getBbsUid()); + consumingMap.put(ATTR_SAVE_RECORD, saveRecord); TemplateInfo templateInfo = new TemplateInfo(templateID, originID); templateInfo.consumingMap = consumingMap; @@ -109,14 +104,21 @@ public class TemplateInfo extends AbstractPointInfo { return templateID; } - String getOriginID() { - return originID; + public String getTemplateInfoID() { + return templateID + "_" + getSaveTime(); } - int getTimeConsume() { - return (int) consumingMap.get(ATTR_TIME_CONSUME); + public long getSaveTime() { + String save_record = (String) consumingMap.get(ATTR_SAVE_RECORD); + JSONObject jo = new JSONObject(save_record); + return jo.optLong("time"); } + public String getTemplateCreateTime() { + return (String) consumingMap.get(ATTR_CREATE_TIME); + } + + @Override public void writeXML(XMLPrintWriter writer) { writer.startTAG(XML_TAG); @@ -129,6 +131,7 @@ public class TemplateInfo extends AbstractPointInfo { if (idleDayCount >= 0) { writer.attr(ATTR_DAY_COUNT, this.idleDayCount); } + writer.attr(TEST_TEMPLATE_FLAG, this.isTestTemplate); writeProcessMap(writer); writeConsumingMap(writer); @@ -143,19 +146,17 @@ public class TemplateInfo extends AbstractPointInfo { writer.attr(ATTR_CELL_COUNT, (int) processMap.get(ATTR_CELL_COUNT)); writer.attr(ATTR_BLOCK_COUNT, (int) processMap.get(ATTR_BLOCK_COUNT)); writer.attr(ATTR_REPORT_TYPE, (int) processMap.get(ATTR_REPORT_TYPE)); + writer.attr(ATTR_PARA_APPLY, (int) processMap.get(ATTR_PARA_APPLY)); + writer.attr(ATTR_COMPONENTS_INFO, (String) processMap.get(ATTR_COMPONENTS_INFO)); writer.end(); } private void writeConsumingMap(XMLPrintWriter writer) { writer.startTAG(XML_CONSUMING_MAP); - writer.attr(ATTR_ACTIVITYKEY, (String) consumingMap.get(ATTR_ACTIVITYKEY)); - writer.attr(ATTR_JAR_TIME, (String) consumingMap.get(ATTR_JAR_TIME)); writer.attr(ATTR_CREATE_TIME, (String) consumingMap.get(ATTR_CREATE_TIME)); writer.attr(ATTR_UUID, (String) consumingMap.get(ATTR_UUID)); - writer.attr(ATTR_TIME_CONSUME, (int) consumingMap.get(ATTR_TIME_CONSUME)); - writer.attr(ATTR_ORIGIN_TIME, (int) consumingMap.get(ATTR_ORIGIN_TIME)); - writer.attr(ATTR_VERSION, (String) consumingMap.get(ATTR_VERSION)); - writer.attr(ATTR_USERNAME, (String) consumingMap.get(ATTR_USERNAME)); + writer.attr(ATTR_UID, (int) consumingMap.get(ATTR_UID)); + writer.attr(ATTR_SAVE_RECORD, (String) consumingMap.get(ATTR_SAVE_RECORD)); writer.end(); } @@ -163,6 +164,7 @@ public class TemplateInfo extends AbstractPointInfo { public void readXML(XMLableReader reader) { if (!reader.isChildNode()) { idleDayCount = reader.getAttrAsInt(ATTR_DAY_COUNT, 0); + isTestTemplate = reader.getAttrAsBoolean(TEST_TEMPLATE_FLAG, false); templateID = reader.getAttrAsString(ATTR_TEMPLATE_ID, StringUtils.EMPTY); originID = reader.getAttrAsString(ATTR_ORIGIN_ID, StringUtils.EMPTY); } else { @@ -175,18 +177,16 @@ public class TemplateInfo extends AbstractPointInfo { processMap.put(ATTR_CELL_COUNT, reader.getAttrAsInt(ATTR_CELL_COUNT, 0)); processMap.put(ATTR_BLOCK_COUNT, reader.getAttrAsInt(ATTR_BLOCK_COUNT, 0)); processMap.put(ATTR_REPORT_TYPE, reader.getAttrAsInt(ATTR_REPORT_TYPE, 0)); + processMap.put(ATTR_PARA_APPLY, reader.getAttrAsInt(ATTR_PARA_APPLY, 0)); + processMap.put(ATTR_COMPONENTS_INFO, reader.getAttrAsString(ATTR_COMPONENTS_INFO, StringUtils.EMPTY)); processMap.put(ATTR_TEMPLATE_ID, templateID); } else if (XML_CONSUMING_MAP.equals(name)) { - consumingMap.put(ATTR_ACTIVITYKEY, reader.getAttrAsString(ATTR_ACTIVITYKEY, StringUtils.EMPTY)); - consumingMap.put(ATTR_JAR_TIME, reader.getAttrAsString(ATTR_JAR_TIME, StringUtils.EMPTY)); consumingMap.put(ATTR_CREATE_TIME, reader.getAttrAsString(ATTR_CREATE_TIME, StringUtils.EMPTY)); consumingMap.put(ATTR_TEMPLATE_ID, templateID); consumingMap.put(ATTR_ORIGIN_ID, originID); consumingMap.put(ATTR_UUID, reader.getAttrAsString(ATTR_UUID, StringUtils.EMPTY)); - consumingMap.put(ATTR_TIME_CONSUME, reader.getAttrAsInt(ATTR_TIME_CONSUME, 0)); - consumingMap.put(ATTR_ORIGIN_TIME, reader.getAttrAsInt(ATTR_ORIGIN_TIME, 0)); - consumingMap.put(ATTR_VERSION, reader.getAttrAsString(ATTR_VERSION, "8.0")); - consumingMap.put(ATTR_USERNAME, reader.getAttrAsString(ATTR_USERNAME, StringUtils.EMPTY)); + consumingMap.put(ATTR_UID, reader.getAttrAsInt(ATTR_UID, 0)); + consumingMap.put(ATTR_SAVE_RECORD, reader.getAttrAsString(ATTR_SAVE_RECORD, StringUtils.EMPTY)); } } catch (Exception ex) { // 什么也不做,使用默认值 @@ -195,17 +195,8 @@ public class TemplateInfo extends AbstractPointInfo { } @Override - protected boolean isTestTemplate() { - if (!isComplete()) { - return false; - } - - int reportType = (int) processMap.get(ATTR_REPORT_TYPE); - int cellCount = (int) processMap.get(ATTR_CELL_COUNT); - int floatCount = (int) processMap.get(ATTR_FLOAT_COUNT); - int blockCount = (int) processMap.get(ATTR_BLOCK_COUNT); - int widgetCount = (int) processMap.get(ATTR_WIDGET_COUNT); - return isTestTemplate(reportType, cellCount, floatCount, blockCount, widgetCount); + public boolean isTestTemplate() { + return isTestTemplate; } public static boolean isTestTemplate(int reportType, int cellCount, int floatCount, int blockCount, int widgetCount) { @@ -222,25 +213,17 @@ public class TemplateInfo extends AbstractPointInfo { @Override protected boolean isComplete() { - // 条件 1. 超过15天未编辑 - // 条件 2. 设计器在这段未编辑的时间内启动超过 X 次(目前定的 X = 3)。即"设计器最近 X 次启动的时间跨度" < "未编辑时间"; - - return idleDayCount > COMPLETE_DAY_COUNT - && DesignerOpenHistory.getInstance().isOpenEnoughTimesInPeriod(idleDayCount); + return true; } @Override public Map getSendInfo() { Map sendMap = new HashMap<>(); sendMap.put(CONSUMING_URL, new JSONObject(consumingMap).toString()); - sendMap.put(PROCESS_URL, new JSONObject(processMap).toString()); + sendMap.put(PROCESS_URL, new JSONObject(processMap).toString()); return sendMap; } - void addTimeConsume(int timeConsume) { - timeConsume += (int) consumingMap.get(ATTR_TIME_CONSUME); // 加上之前的累计编辑时间 - consumingMap.put(ATTR_TIME_CONSUME, timeConsume); - } void updateProcessMap(TemplateProcessInfo processInfo) { HashMap processMap = new HashMap<>(); @@ -253,11 +236,13 @@ public class TemplateInfo extends AbstractPointInfo { processMap.put(ATTR_FLOAT_COUNT, processInfo.getFloatCount()); processMap.put(ATTR_BLOCK_COUNT, processInfo.getBlockCount()); processMap.put(ATTR_WIDGET_COUNT, processInfo.getWidgetCount()); - + processMap.put(ATTR_PARA_APPLY, processInfo.useParaPane() ? 1 : 0); + processMap.put(ATTR_COMPONENTS_INFO, processInfo.getComponentsInfo().toString()); this.processMap = processMap; } + int getIdleDayCount() { return this.idleDayCount; } -} \ No newline at end of file +} 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 8c4e7f18d..bdc853796 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,6 +1,8 @@ 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.json.JSONObject; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; @@ -8,6 +10,10 @@ import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; /** * 做模板的过程和耗时收集,辅助类 @@ -19,8 +25,11 @@ public class TemplateInfoCollector extends AbstractPointCollector private static final String XML_FILE_NAME = "tpl.info"; private static TemplateInfoCollector instance; private DesignerOpenHistory designerOpenHistory; + //记录指定模板最新的模板耗时信息ID + private Map latestTemplateInfo; private TemplateInfoCollector() { + super(); } public static TemplateInfoCollector getInstance() { @@ -34,7 +43,7 @@ public class TemplateInfoCollector extends AbstractPointCollector * 根据模板ID是否在收集列表中,判断是否需要收集当前模板的信息 */ public boolean contains(String templateID) { - return StringUtils.isNotEmpty(templateID) && pointInfoMap.containsKey(templateID); + return StringUtils.isNotEmpty(templateID) && latestTemplateInfo.containsKey(templateID); } /** @@ -51,27 +60,43 @@ public class TemplateInfoCollector extends AbstractPointCollector if (!shouldCollectInfo()) { return; } + long saveTime = System.currentTimeMillis(); - TemplateInfo templateInfo; - if (this.contains(templateID)) { - templateInfo = pointInfoMap.get(templateID); - } else { - int originTime = this.contains(originID) ? pointInfoMap.get(originID).getTimeConsume() : 0; - templateInfo = TemplateInfo.newInstance(templateID, originID, originTime); - pointInfoMap.put(templateID, templateInfo); - } + TemplateInfo templateInfo = createTemplateInfo(templateID, originID, saveTime, timeConsume); + + pointInfoMap.put(templateInfo.getTemplateInfoID(), templateInfo); + + //更新下此模板最新保存记录 + updateLatestTemplateInfo(templateID, saveTime); - // 收集制作耗时 - templateInfo.addTimeConsume(timeConsume); // 收集模版基本信息 templateInfo.updateProcessMap(processInfo); + //设置是否是测试模板 + templateInfo.setTestTemplate(processInfo.isTestTemplate()); // 刷新闲置日计数器 templateInfo.resetIdleDayCount(); + // 每次更新之后,都同步到暂存文件中 saveInfo(); } + private TemplateInfo createTemplateInfo(String templateID, String originID, long saveTime, int timeConsume){ + JSONObject saveRecord = new JSONObject(); + saveRecord.put("time", saveTime); + saveRecord.put("consume", timeConsume); + if (this.contains(templateID)){ + return TemplateInfo.newInstance(templateID, originID, saveRecord.toString(), getTemplateCreateTime(templateID)); + } + return TemplateInfo.newInstance(templateID, originID, saveRecord.toString()); + } + + private String getTemplateCreateTime(String templateID) { + long latestSaveTime = latestTemplateInfo.get(templateID); + TemplateInfo latestTemplateInfo = pointInfoMap.get(templateID + "_" + latestSaveTime); + return latestTemplateInfo.getTemplateCreateTime(); + } + /** * 获取缓存文件存放路径 */ @@ -80,15 +105,6 @@ public class TemplateInfoCollector extends AbstractPointCollector return new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), XML_FILE_NAME)); } - TemplateInfo getOrCreateTemplateInfoByID(String templateID) { - if (pointInfoMap.containsKey(templateID)) { - return pointInfoMap.get(templateID); - } - TemplateInfo templateInfo = TemplateInfo.newInstance(templateID); - pointInfoMap.put(templateID, templateInfo); - return templateInfo; - } - /** * 更新 day_count:打开设计器却未编辑模板的连续日子 */ @@ -104,6 +120,20 @@ public class TemplateInfoCollector extends AbstractPointCollector designerOpenHistory.update(); } + private void updateLatestTemplateInfo(TemplateInfo templateInfo) { + String templateID = templateInfo.getTemplateID(); + if (latestTemplateInfo.containsKey(templateID)) { + long latestSaveTime = latestTemplateInfo.get(templateID); + updateLatestTemplateInfo(templateID, Math.max(latestSaveTime, templateInfo.getSaveTime())); + } else { + updateLatestTemplateInfo(templateID, templateInfo.getSaveTime()); + } + } + + private void updateLatestTemplateInfo(String templateID, long saveTime) { + latestTemplateInfo.put(templateID, saveTime); + } + @Override public void readXML(XMLableReader reader) { if (reader.isChildNode()) { @@ -116,7 +146,8 @@ public class TemplateInfoCollector extends AbstractPointCollector reader.readXMLObject(designerOpenHistory); } else if (TemplateInfo.XML_TAG.equals(name)) { TemplateInfo templateInfo = TemplateInfo.newInstanceByRead(reader); - pointInfoMap.put(templateInfo.getTemplateID(), templateInfo); + updateLatestTemplateInfo(templateInfo); + pointInfoMap.put(templateInfo.getTemplateInfoID(), templateInfo); } } catch (Exception ex) { // 什么也不做,使用默认值 @@ -138,4 +169,44 @@ public class TemplateInfoCollector extends AbstractPointCollector writer.end(); } + + + @Override + public void sendPointInfo() { + addIdleDayCount(); + List removeList = new ArrayList<>(); + List sendList = new ArrayList<>(); + for (String latestTemplateInfokey : latestTemplateInfo.keySet()) { + AbstractPointInfo pointInfo = pointInfoMap.get(latestTemplateInfokey + "_" + latestTemplateInfo.get(latestTemplateInfokey)); + if (pointInfo.isTestTemplate()) { + continue; + } + for (String key : pointInfoMap.keySet()) { + if (key.startsWith(latestTemplateInfokey)) { + sendList.add(key); + } + } + } + // 发送记录 + for (String key : sendList) { + if (SendHelper.sendPointInfo(pointInfoMap.get(key))) { + removeList.add(key); + } + } + + // 清空记录 + for (String key : removeList) { + pointInfoMap.remove(key); + } + + saveInfo(); + } + + + @Override + protected void loadFromFile() { + latestTemplateInfo = new ConcurrentHashMap<>(); + super.loadFromFile(); + } + } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java index 427d48c73..e5872ae1d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java @@ -1,6 +1,10 @@ package com.fr.design.mainframe.template.info; +import com.fr.base.Style; import com.fr.base.io.BaseBook; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.chartx.attr.ChartProvider; +import com.fr.json.JSONArray; /** * Created by plough on 2017/3/17. @@ -19,12 +23,52 @@ public abstract class TemplateProcessInfo { // 获取模板类型。0 代表普通报表,1 代表聚合报表,2 代表表单 public abstract int getReportType(); + // 获取模板格子数 public abstract int getCellCount(); + // 获取模板悬浮元素个数 public abstract int getFloatCount(); + // 获取模板聚合块个数 public abstract int getBlockCount(); + // 获取模板控件数 public abstract int getWidgetCount(); + + //是否是测试模板 + public abstract boolean isTestTemplate(); + + //是否使用参数面板 + public abstract boolean useParaPane(); + + //获取组件信息 + public abstract JSONArray getComponentsInfo(); + + + + protected boolean isTestCell(Object value, Style style) { + if (value instanceof ChartCollection && isTestChartCollection((ChartCollection) value)) { + return true; + } + if (value == null && Style.getInstance().equals(style)) { + return true; + } + return false; + } + + protected boolean isTestChartCollection(ChartCollection chartCollection) { + int chartCount = chartCollection.getChartCount(); + if (chartCount == 0) { + return true; + } + for (int i = 0; i < chartCount; i++) { + ChartProvider chart = chartCollection.getChart(i, ChartProvider.class); + if (chart.isTestChart()) { + return true; + } + } + return false; + } + } diff --git a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java index 3235473c6..73109f340 100644 --- a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java +++ b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java @@ -1,14 +1,16 @@ package com.fr.design.mainframe.template.info; import com.fr.config.MarketConfig; -import com.fr.general.GeneralUtils; +import com.fr.design.DesignerEnvManager; import com.fr.invoke.Reflect; +import com.fr.json.JSONArray; import com.fr.json.JSONObject; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; 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; @@ -29,7 +31,7 @@ import static org.junit.Assert.assertTrue; * Created by plough on 2019/4/18. */ @RunWith(PowerMockRunner.class) -@PrepareForTest({ProductConstants.class, MarketConfig.class, ProductConstants.class, GeneralUtils.class}) +@PrepareForTest({ProductConstants.class, MarketConfig.class, DesignerEnvManager.class}) public class TemplateInfoCollectorTest { private String filePath; private String initialFileContent; @@ -51,6 +53,9 @@ public class TemplateInfoCollectorTest { EasyMock.expect(mockProcessInfo.getFloatCount()).andReturn(1).anyTimes(); EasyMock.expect(mockProcessInfo.getReportType()).andReturn(0).anyTimes(); EasyMock.expect(mockProcessInfo.getWidgetCount()).andReturn(0).anyTimes(); + EasyMock.expect(mockProcessInfo.useParaPane()).andReturn(false).anyTimes(); + EasyMock.expect(mockProcessInfo.getComponentsInfo()).andReturn(new JSONArray()).anyTimes(); + EasyMock.expect(mockProcessInfo.isTestTemplate()).andReturn(true).anyTimes(); EasyMock.replay(mockProcessInfo); // 缓存 tpl.info @@ -72,36 +77,36 @@ public class TemplateInfoCollectorTest { assertEquals(",,", DesignerOpenHistory.getInstance().toString()); TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); - assertEquals(7, ((Map) Reflect.on(collector).field("pointInfoMap").get()).size()); - assertEquals("2019-04-08,2019-04-03,2019-03-29", DesignerOpenHistory.getInstance().toString()); + assertEquals("2020-05-07,2020-05-06,2020-04-30", DesignerOpenHistory.getInstance().toString()); } @Test - public void testCollectInfo() { + public void testCollectInfo() throws Exception { + setUpMockForNewInstance(); TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); - String templateID = "16a988ce-8529-42f5-b17c-2ee849355071"; + String templateID = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffa"; int timeConsume = 200; collector.collectInfo(templateID, StringUtils.EMPTY, mockProcessInfo, timeConsume); // 检查是否写入成功 Reflect.on(collector).call("loadFromFile"); - TemplateInfo templateInfo = collector.getOrCreateTemplateInfoByID(templateID); + TemplateInfo templateInfo = getTemplateInfoByID(templateID); Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); Map processMap = Reflect.on(templateInfo).field("processMap").get(); assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + - "\"cell_count\":13,\"block_count\":3,\"report_type\":0," + - "\"templateID\":\"16a988ce-8529-42f5-b17c-2ee849355071\"}", new JSONObject(processMap).toString()); - - assertJsonStringEquals("{\"activitykey\":\"2e0ea413-fa9c241e0-9723-4354fce51e81\"," + - "\"jar_time\":\"不是安装版本\",\"create_time\":\"2019-03-26 16:13\"," + - "\"templateID\":\"16a988ce-8529-42f5-b17c-2ee849355071\",\"originID\":\"\"," + - "\"uuid\":\"476ca2cc-f789-4c5d-8e89-ef146580775c\",\"time_consume\":329,\"originTime\":0," + - "\"version\":\"10.0\",\"username\":\"plough\"}", new JSONObject(consumingMap).toString()); + "\"cell_count\":13,\"paraApply\":0,\"block_count\":3,\"report_type\":0,\"components_info\":\"[]\"," + + "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\"}", + new JSONObject(processMap).toString()); + + Assert.assertEquals(71113, consumingMap.get("uid")); + Assert.assertEquals("2020-05-07 17:25", consumingMap.get("create_time")); + Assert.assertEquals("e5d7dbb2-d1df-43d4-b974-67acb5ecbffa", consumingMap.get("templateID")); + Assert.assertEquals("6b6699ff-ec63-43b0-9deb-b580a5f10411", consumingMap.get("uuid")); } @Test @@ -110,7 +115,7 @@ public class TemplateInfoCollectorTest { TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); - String templateID = "73a97777-8jnk-47cd-b57c-2ee89991279796"; + String templateID = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffa"; int timeConsume = 200; collector.collectInfo(templateID, StringUtils.EMPTY, mockProcessInfo, timeConsume); @@ -119,20 +124,20 @@ public class TemplateInfoCollectorTest { Reflect.on(collector).call("loadFromFile"); assertTrue(collector.contains(templateID)); - TemplateInfo templateInfo = collector.getOrCreateTemplateInfoByID(templateID); + TemplateInfo templateInfo = getTemplateInfoByID(templateID); Map processMap = Reflect.on(templateInfo).field("processMap").get(); assertEquals(templateID, templateInfo.getTemplateID()); assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + - "\"cell_count\":13,\"block_count\":3,\"report_type\":0," + - "\"templateID\":\"73a97777-8jnk-47cd-b57c-2ee89991279796\"}", new JSONObject(processMap).toString()); + "\"cell_count\":13,\"paraApply\":0,\"block_count\":3,\"report_type\":0,\"components_info\":\"[]\"," + + "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\"}", new JSONObject(processMap).toString()); Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); - assertEquals(templateID, consumingMap.get("templateID")); - assertEquals(StringUtils.EMPTY, consumingMap.get("originID")); - assertEquals(200, consumingMap.get("time_consume")); - assertEquals(0, consumingMap.get("originTime")); + Assert.assertEquals(71113, consumingMap.get("uid")); + Assert.assertEquals("2020-05-07 17:25", consumingMap.get("create_time")); + Assert.assertEquals("e5d7dbb2-d1df-43d4-b974-67acb5ecbffa", consumingMap.get("templateID")); + Assert.assertEquals("6b6699ff-ec63-43b0-9deb-b580a5f10411", consumingMap.get("uuid")); } @Test @@ -141,7 +146,7 @@ public class TemplateInfoCollectorTest { TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); - String templateID = "423238d4-5223-22vj-vlsj-42jc49245iw3"; + String templateID = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffa"; String originID = "16a988ce-8529-42f5-b17c-2ee849355071"; int timeConsume = 200; @@ -149,18 +154,19 @@ public class TemplateInfoCollectorTest { // 检查是否写入成功 Reflect.on(collector).call("loadFromFile"); - TemplateInfo templateInfo = collector.getOrCreateTemplateInfoByID(templateID); + TemplateInfo templateInfo = getTemplateInfoByID(templateID); Map processMap = Reflect.on(templateInfo).field("processMap").get(); - assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + - "\"cell_count\":13,\"block_count\":3,\"report_type\":0," + - "\"templateID\":\"423238d4-5223-22vj-vlsj-42jc49245iw3\"}", new JSONObject(processMap).toString()); + assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0,\"cell_count\":13," + + "\"paraApply\":0,\"block_count\":3,\"report_type\":0,\"components_info\":\"[]\"," + + "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\"}", new JSONObject(processMap).toString()); Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); - assertEquals(templateID, consumingMap.get("templateID")); - assertEquals(originID, consumingMap.get("originID")); - assertEquals(329, consumingMap.get("time_consume")); - assertEquals(129, consumingMap.get("originTime")); + Assert.assertEquals(71113, consumingMap.get("uid")); + Assert.assertEquals("2020-05-07 17:25", consumingMap.get("create_time")); + Assert.assertEquals("e5d7dbb2-d1df-43d4-b974-67acb5ecbffa", consumingMap.get("templateID")); + Assert.assertEquals("6b6699ff-ec63-43b0-9deb-b580a5f10411", consumingMap.get("uuid")); + Assert.assertEquals("16a988ce-8529-42f5-b17c-2ee849355071", consumingMap.get("originID")); } @Test @@ -169,36 +175,71 @@ public class TemplateInfoCollectorTest { TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); - String templateID = "423238d4-5223-22vj-vlsj-42jc49245iw3"; + String templateID = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffa"; String originID = "3kha8jcs-31xw-42f5-h2ww-2ee84935312z"; int timeConsume = 200; collector.collectInfo(templateID, originID, mockProcessInfo, timeConsume); - TemplateInfo templateInfo = collector.getOrCreateTemplateInfoByID(templateID); + TemplateInfo templateInfo = getTemplateInfoByID(templateID); assertEquals(templateID, templateInfo.getTemplateID()); - assertEquals(originID, templateInfo.getOriginID()); Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); - assertEquals(templateID, consumingMap.get("templateID")); - assertEquals(originID, consumingMap.get("originID")); - assertEquals(200, consumingMap.get("time_consume")); - assertEquals(0, consumingMap.get("originTime")); + Assert.assertEquals(71113, consumingMap.get("uid")); + Assert.assertEquals("2020-05-07 17:25", consumingMap.get("create_time")); + Assert.assertEquals("e5d7dbb2-d1df-43d4-b974-67acb5ecbffa", consumingMap.get("templateID")); + Assert.assertEquals("6b6699ff-ec63-43b0-9deb-b580a5f10411", consumingMap.get("uuid")); + Assert.assertEquals("3kha8jcs-31xw-42f5-h2ww-2ee84935312z", consumingMap.get("originID")); } @Test public void testAddIdleDateCount() { - String templateID = "16a988ce-8529-42f5-b17c-2ee849355071"; + String templateID = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffa"; TemplateInfoCollector collecter = TemplateInfoCollector.getInstance(); - TemplateInfo templateInfo = collecter.getOrCreateTemplateInfoByID(templateID); + TemplateInfo templateInfo = getTemplateInfoByID(templateID); - assertEquals(9, templateInfo.getIdleDayCount()); + assertEquals(0, templateInfo.getIdleDayCount()); Reflect.on(collecter).call("addIdleDayCount"); - assertEquals(10, templateInfo.getIdleDayCount()); + assertEquals(1, templateInfo.getIdleDayCount()); // 同一天内多次调用无效 Reflect.on(collecter).call("addIdleDayCount"); - assertEquals(10, templateInfo.getIdleDayCount()); + assertEquals(1, templateInfo.getIdleDayCount()); + } + + @Test + public void testContains() { + TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); + String templateID1 = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffa"; + Assert.assertTrue(collector.contains(templateID1)); + String templateID2 = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffb"; + Assert.assertFalse(collector.contains(templateID2)); + } + + @Test + public void testGetTemplateCreateTime() throws Exception { + setUpMockForNewInstance(); + TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); + String templateID = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffa"; + String createTime = Reflect.on(collector).call("getTemplateCreateTime", templateID).get(); + Assert.assertEquals("2020-05-07 17:25", createTime); + + templateID = "2521d03c-b238-41a5-9a1d-2498efff3a97"; + createTime = Reflect.on(collector).call("getTemplateCreateTime", templateID).get(); + Assert.assertEquals("2020-05-07 17:45", createTime); + } + + + private TemplateInfo getTemplateInfoByID(String templateID) { + TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); + Map latestTemplateInfo = Reflect.on(collector).field("latestTemplateInfo").get(); + Map pointInfoMap = Reflect.on(collector).field("pointInfoMap").get(); + if (latestTemplateInfo.containsKey(templateID)) { + long latestSaveTime = latestTemplateInfo.get(templateID); + return pointInfoMap.get(templateID + "_" + latestSaveTime); + } else { + return TemplateInfo.newInstance(templateID); + } } } diff --git a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java index 7f0ddd0bc..cf2fff3be 100644 --- a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java +++ b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java @@ -1,13 +1,13 @@ package com.fr.design.mainframe.template.info; import com.fr.config.MarketConfig; -import com.fr.general.GeneralUtils; +import com.fr.design.DesignerEnvManager; import com.fr.invoke.Reflect; import com.fr.json.JSONObject; -import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLableReader; import com.fr.third.javax.xml.stream.XMLStreamException; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -25,17 +25,17 @@ import static org.junit.Assert.assertEquals; * Created by plough on 2019/4/19. */ @RunWith(PowerMockRunner.class) -@PrepareForTest({MarketConfig.class, ProductConstants.class, GeneralUtils.class}) +@PrepareForTest({MarketConfig.class, DesignerEnvManager.class}) public class TemplateInfoTest { - private static final String NORMAL_INFO = "\n" + - "\n" + - "\n" + + private static final String NORMAL_INFO = "\n" + + "\n" + + "\n" + ""; - private static final String SAVE_AS_INFO = "\n" + - "\n" + - "\n" + + private static final String SAVE_AS_INFO = "\n" + + "\n" + + "\n" + ""; private TemplateInfo templateInfo; @@ -56,15 +56,14 @@ public class TemplateInfoTest { assertEquals(templateID, templateInfo.getTemplateID()); assertEquals(StringUtils.EMPTY, Reflect.on(templateInfo).field("originID").get()); assertEquals(0, (int) Reflect.on(templateInfo).field("idleDayCount").get()); + assertEquals(false, templateInfo.isTestTemplate()); Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); assertEquals(templateID, consumingMap.get("templateID")); - assertEquals(0, consumingMap.get("originTime")); assertEquals(StringUtils.EMPTY, consumingMap.get("originID")); - assertEquals(0, consumingMap.get("time_consume")); - assertEquals("不是安装版本", consumingMap.get("jar_time")); - assertEquals("plough", consumingMap.get("username")); - assertEquals("10.0", consumingMap.get("version")); + assertEquals("6b6699ff-ec63-43b0-9deb-b580a5f10411", consumingMap.get("uuid")); + assertEquals(71113, consumingMap.get("uid")); + assertEquals(StringUtils.EMPTY, consumingMap.get("saveRecord")); } @Test @@ -73,26 +72,27 @@ public class TemplateInfoTest { String templateID = "24121212-u2c8-ncd2-82nx-8ud0i8138888"; String originID = "24avc8n2-1iq8-iuj2-wx24-8yy0i8132302"; - int originTime = 100; - TemplateInfo templateInfo = TemplateInfo.newInstance(templateID, originID, originTime); + String saveRecord = "{\"time\";:1588843629000,\"consume\":81}"; + String createTime = "2020-05-07 17:25"; + TemplateInfo templateInfo = TemplateInfo.newInstance(templateID, originID, saveRecord, createTime); assertEquals(templateID, templateInfo.getTemplateID()); assertEquals(originID, Reflect.on(templateInfo).field("originID").get()); assertEquals(0, (int) Reflect.on(templateInfo).field("idleDayCount").get()); + assertEquals(false, templateInfo.isTestTemplate()); Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); assertEquals(templateID, consumingMap.get("templateID")); - assertEquals(originTime, consumingMap.get("originTime")); assertEquals(originID, consumingMap.get("originID")); - assertEquals(originTime, consumingMap.get("time_consume")); - assertEquals("不是安装版本", consumingMap.get("jar_time")); - assertEquals("plough", consumingMap.get("username")); - assertEquals("10.0", consumingMap.get("version")); + assertEquals("6b6699ff-ec63-43b0-9deb-b580a5f10411", consumingMap.get("uuid")); + assertEquals(71113, consumingMap.get("uid")); + assertEquals(saveRecord, consumingMap.get("saveRecord")); + assertEquals(createTime, consumingMap.get("create_time")); } @Test public void testGetTemplateID() { - assertEquals("16a988ce-8529-42f5-b17c-2ee849355071", templateInfo.getTemplateID()); - assertEquals("49avd2c4-1104-92j2-wx24-3dd0k2136080", templateInfoSaveAs.getTemplateID()); + assertEquals("aac1139e-018b-4481-867a-a18fc6d6f3e6", templateInfo.getTemplateID()); + assertEquals("2521d03c-b238-41a5-9a1d-2498efff3a97", templateInfoSaveAs.getTemplateID()); } @Test @@ -102,19 +102,21 @@ public class TemplateInfoTest { Map processMap = Reflect.on(templateInfo).field("processMap").get(); Map consumingMap1 = Reflect.on(templateInfoSaveAs).field("consumingMap").get(); Map processMap1 = Reflect.on(templateInfoSaveAs).field("processMap").get(); - assertJsonStringEquals("{\"activitykey\":\"2e0ea413-fa9c241e0-9723-4354fce51e81\",\"jar_time\":\"不是安装版本\"," + - "\"create_time\":\"2019-03-26 16:13\",\"templateID\":\"16a988ce-8529-42f5-b17c-2ee849355071\",\"originID\":\"\"," + - "\"uuid\":\"476ca2cc-f789-4c5d-8e89-ef146580775c\",\"time_consume\":129,\"originTime\":0,\"version\":\"10.0\"," + - "\"username\":\"plough\"}", new JSONObject(consumingMap).toString()); - - assertJsonStringEquals("{\"activitykey\":\"2e0ea413-fa9c241e0-9723-4354fce51e81\",\"jar_time\":\"不是安装版本\"," + - "\"create_time\":\"2019-03-26 16:13\",\"templateID\":\"49avd2c4-1104-92j2-wx24-3dd0k2136080\",\"originID\":\"16a988ce-8529-42f5-b17c-2ee849355071\"," + - "\"uuid\":\"476ca2cc-f789-4c5d-8e89-ef146580775c\",\"time_consume\":429,\"originTime\":129,\"version\":\"10.0\"," + - "\"username\":\"plough\"}", new JSONObject(consumingMap1).toString()); - assertJsonStringEquals("{\"process\":\"\",\"float_count\":0,\"widget_count\":0,\"cell_count\":1," + - "\"block_count\":0,\"report_type\":0,\"templateID\":\"16a988ce-8529-42f5-b17c-2ee849355071\"}", new JSONObject(processMap).toString()); - assertJsonStringEquals("{\"process\":\"\",\"float_count\":0,\"widget_count\":0,\"cell_count\":1," + - "\"block_count\":0,\"report_type\":0,\"templateID\":\"49avd2c4-1104-92j2-wx24-3dd0k2136080\"}", new JSONObject(processMap1).toString()); + assertJsonStringEquals("{\"uid\":71113,\"originID\":\"\",\"create_time\":\"2020-05-07 17:28\"," + + "\"saveRecord\":\"{\\\"time\\\":1588843693000,\\\"consume\\\":4}\"," + + "\"templateID\":\"aac1139e-018b-4481-867a-a18fc6d6f3e6\"," + + "\"uuid\":\"6b6699ff-ec63-43b0-9deb-b580a5f10411\"}", new JSONObject(consumingMap).toString()); + + assertJsonStringEquals("{\"uid\":71113,\"originID\":\"aac1139e-018b-4481-867a-a18fc6d6f3e6\"," + + "\"create_time\":\"2020-05-07 17:45\",\"saveRecord\":\"{\\\"time\\\":1588844751000,\\\"consume\\\":1058}\"," + + "\"templateID\":\"2521d03c-b238-41a5-9a1d-2498efff3a97\"," + + "\"uuid\":\"6b6699ff-ec63-43b0-9deb-b580a5f10411\"}", new JSONObject(consumingMap1).toString()); + assertJsonStringEquals("{\"process\":\"\",\"float_count\":0,\"widget_count\":0,\"cell_count\":3," + + "\"paraApply\":0,\"block_count\":0,\"report_type\":0,\"components_info\":\"[]\"," + + "\"templateID\":\"aac1139e-018b-4481-867a-a18fc6d6f3e6\"}", new JSONObject(processMap).toString()); + assertJsonStringEquals("{\"process\":\"\",\"float_count\":0,\"widget_count\":0,\"cell_count\":3," + + "\"paraApply\":0,\"block_count\":0,\"report_type\":0,\"components_info\":\"[]\"," + + "\"templateID\":\"2521d03c-b238-41a5-9a1d-2498efff3a97\"}", new JSONObject(processMap1).toString()); } private TemplateInfo createTemplateInfo(String xmlContent) throws XMLStreamException { @@ -122,4 +124,18 @@ public class TemplateInfoTest { XMLableReader xmlReader = XMLableReader.createXMLableReader(sr); return TemplateInfo.newInstanceByRead(xmlReader); } + + @Test + public void testGetSaveTime(){ + Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); + String saveRecord = (String) consumingMap.get("saveRecord"); + JSONObject object = new JSONObject(saveRecord); + Assert.assertEquals(1588843693000L, object.optLong("time")); + } + + @Test + public void testGetTemplateCreateTime(){ + Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); + Assert.assertEquals("2020-05-07 17:28", (String)consumingMap.get("create_time")); + } } diff --git a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTestHelper.java b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTestHelper.java index be2b58989..8ba027872 100644 --- a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTestHelper.java +++ b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTestHelper.java @@ -1,10 +1,10 @@ package com.fr.design.mainframe.template.info; +import com.fr.config.BBSAttr; import com.fr.config.MarketConfig; +import com.fr.design.DesignerEnvManager; import com.fr.general.ComparatorUtils; -import com.fr.general.GeneralUtils; import com.fr.json.JSONObject; -import com.fr.stable.ProductConstants; import org.easymock.EasyMock; import org.powermock.api.easymock.PowerMock; @@ -33,17 +33,21 @@ class TemplateInfoTestHelper { static void setUpMockForNewInstance() throws Exception { MarketConfig mockMarketConfig = EasyMock.mock(MarketConfig.class); - EasyMock.expect(mockMarketConfig.getBbsUsername()).andReturn("plough").anyTimes(); + BBSAttr bbsAttr = EasyMock.mock(BBSAttr.class); + EasyMock.expect(bbsAttr.getBbsUid()).andReturn(71113).anyTimes(); + EasyMock.expect(mockMarketConfig.getBBSAttr()).andReturn(bbsAttr).anyTimes(); PowerMock.mockStatic(MarketConfig.class); EasyMock.expect(MarketConfig.getInstance()).andReturn(mockMarketConfig).anyTimes(); - PowerMock.mockStatic(GeneralUtils.class); - EasyMock.expect(GeneralUtils.readBuildNO()).andReturn("不是安装版本").anyTimes(); + PowerMock.mockStatic(DesignerEnvManager.class); + DesignerEnvManager envManager = EasyMock.mock( DesignerEnvManager.class); + EasyMock.expect(envManager.getUUID()).andReturn("6b6699ff-ec63-43b0-9deb-b580a5f10411").anyTimes(); + EasyMock.expect(envManager.isJoinProductImprove()).andReturn(true).anyTimes(); + EasyMock.expect(DesignerEnvManager.getEnvManager()).andReturn(envManager).anyTimes(); + EasyMock.replay(mockMarketConfig, bbsAttr, envManager); - setFinalStatic(ProductConstants.class.getDeclaredField("VERSION"), "10.0"); - EasyMock.replay(mockMarketConfig); PowerMock.replayAll(); } } diff --git a/designer-base/src/test/resources/com/fr/design/mainframe/template/info/tpl.info b/designer-base/src/test/resources/com/fr/design/mainframe/template/info/tpl.info index eae77630f..ff65b74e9 100644 --- a/designer-base/src/test/resources/com/fr/design/mainframe/template/info/tpl.info +++ b/designer-base/src/test/resources/com/fr/design/mainframe/template/info/tpl.info @@ -1,35 +1,35 @@ - + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index 052ae0539..33312483e 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -10,6 +10,7 @@ import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.cardlayout.XWCardLayout; import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; +import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormSelection; @@ -261,8 +262,11 @@ public class SelectionModel { creator.removeAll(); // 清除被选中的组件 selection.reset(); + FormDesignerUtils.removeWidgetProcessInfo(creator.toData()); } + + setSelectedCreator(isInPara ? designer.getParaComponent() : designer.getRootComponent()); // 触发事件 designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_DELETED); diff --git a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java index d976816f5..532f04c16 100644 --- a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java +++ b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java @@ -1,8 +1,14 @@ package com.fr.design.form.util; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.JForm; +import com.fr.design.mainframe.JTemplate; +import com.fr.form.ui.Widget; import com.fr.form.ui.container.WFitLayout; +import java.util.UUID; + public class FormDesignerUtils { /** * body布局是否设置了手机重布局 @@ -25,4 +31,20 @@ public class FormDesignerUtils { return root.getBodyLayoutType() == com.fr.form.ui.container.WBodyLayoutType.ABSOLUTE; } -} \ No newline at end of file + + public static void addWidgetProcessInfo(Widget widget) { + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (jTemplate instanceof JForm) { + widget.setWidgetID(UUID.randomUUID().toString()); + ((JForm) jTemplate).addWidgetProcessInfo(widget); + } + } + + public static void removeWidgetProcessInfo(Widget widget) { + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (jTemplate instanceof JForm) { + ((JForm) jTemplate).removeWidgetProcessInfo(widget); + } + } + +} 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 5502274bc..ac237848a 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 @@ -133,6 +133,13 @@ public class JForm extends JTemplate implements BaseJForm implements BaseJForm { + + private static final String REGEX = "^" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Title") + "\\d+$"; + + private static final Pattern PATTERN = Pattern.compile(REGEX); + + private Map componentProcessInfoMap = new ConcurrentHashMap(); + public JFormProcessInfo(Form form) { super(form); } @@ -20,14 +43,17 @@ public class JFormProcessInfo extends TemplateProcessInfo { public int getCellCount() { return 0; } + // 获取模板悬浮元素个数 public int getFloatCount() { return 0; } + // 获取模板聚合块个数 public int getBlockCount() { return 0; } + // 获取模板控件数 public int getWidgetCount() { int widgetCount = 0; @@ -37,4 +63,126 @@ public class JFormProcessInfo extends TemplateProcessInfo { } return widgetCount; } + + @Override + public boolean isTestTemplate() { + Iterator it = this.template.getTableDataNameIterator(); + if (!it.hasNext() || getWidgetCount() <= 1 || + hasEmptyParaPane() || hasTestAbsolutePane() + || hasTestTabLayout() || hasTestECReport() || hasTestChart()) { + return true; + } + return false; + } + + private boolean hasTestECReport() { + ElementCaseEditorProvider[] elementCaseEditorProviders = this.template.getElementCases(); + for (ElementCaseEditorProvider elementCaseEditorProvider : elementCaseEditorProviders) { + FormElementCaseProvider elementCase = elementCaseEditorProvider.getElementCase(); + Iterator it = elementCase.cellIterator(); + if (!it.hasNext()) { + return true; + } + while (it.hasNext()) { + DefaultTemplateCellElement ce = (DefaultTemplateCellElement) it.next(); + Object value = ce.getValue(); + if (isTestCell(value, ce.getStyle())) { + return true; + } + } + + } + return false; + } + + private boolean hasTestChart() { + final boolean[] hasTestChart = {false}; + Form.traversalWidget(this.template.getContainer(), new WidgetGather() { + @Override + public void dealWith(Widget widget) { + ChartCollection chartCollection = (ChartCollection) ((BaseChartEditor) widget).getChartCollection(); + if (isTestChartCollection(chartCollection)) { + hasTestChart[0] = true; + } + } + + @Override + public boolean dealWithAllCards() { + return true; + } + }, BaseChartEditor.class); + return hasTestChart[0]; + } + + + private boolean hasTestTabLayout() { + final boolean[] hasTestTabLayout = {false}; + Form.traversalWidget(this.template.getContainer(), new WidgetGather() { + @Override + public void dealWith(Widget widget) { + String title = ((CardSwitchButton) widget).getText(); + Matcher matcher = PATTERN.matcher(title); + if (matcher.find()) { + hasTestTabLayout[0] = true; + } + } + + @Override + public boolean dealWithAllCards() { + return true; + } + }, CardSwitchButton.class); + return hasTestTabLayout[0]; + } + + private boolean hasTestAbsolutePane() { + final boolean[] hasTestAbsolutePane = {false}; + Form.traversalWidget(this.template.getContainer(), new WidgetGather() { + @Override + public void dealWith(Widget widget) { + if (((WAbsoluteLayout) widget).getWidgetCount() == 0) { + hasTestAbsolutePane[0] = true; + } + } + + @Override + public boolean dealWithAllCards() { + return true; + } + }, WAbsoluteLayout.class); + return hasTestAbsolutePane[0]; + } + + private boolean hasEmptyParaPane() { + WLayout paraContainer = this.template.getParaContainer(); + return paraContainer != null && paraContainer.getWidgetCount() == 0; + } + + @Override + public boolean useParaPane() { + return this.template.getParaContainer() != null; + } + + @Override + public JSONArray getComponentsInfo() { + JSONArray ja = new JSONArray(); + for (ComponentProcessInfo value : componentProcessInfoMap.values()) { + ja.put(value.toJSONObject()); + } + this.componentProcessInfoMap.clear(); + return ja; + } + + public void addComponentCreateInfo(Widget widget) { + componentProcessInfoMap.put(widget.getWidgetID(), new ComponentProcessInfo(widget, System.currentTimeMillis())); + } + + public void addComponentRemoveInfo(Widget widget) { + ComponentProcessInfo info = componentProcessInfoMap.get(widget.getWidgetID()); + if (info == null) { + info = new ComponentProcessInfo(widget); + componentProcessInfoMap.put(widget.getWidgetID(), info); + } + info.updateDeleteTime(System.currentTimeMillis()); + } } diff --git a/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentProcessInfoTest.java b/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentProcessInfoTest.java new file mode 100644 index 000000000..abed86959 --- /dev/null +++ b/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentProcessInfoTest.java @@ -0,0 +1,39 @@ +package com.fr.design.mainframe.template.info; + +import com.fr.form.ui.ChartEditor; +import com.fr.form.ui.ElementCaseEditor; +import com.fr.form.ui.FreeButton; +import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WAbsoluteLayout; +import com.fr.form.ui.container.WCardLayout; +import com.fr.json.JSONObject; +import org.junit.Assert; +import org.junit.Test; + +/** + * Created by kerry on 2020-05-08 + */ +public class ComponentProcessInfoTest { + @Test + public void testToJSONObject() { + Widget button = new FreeButton(); + button.setWidgetName("button1"); + button.setWidgetID("xxxxxxx"); + ComponentProcessInfo info = new ComponentProcessInfo(button); + JSONObject jo = info.toJSONObject(); + Assert.assertEquals("xxxxxxx", jo.optString("componentID")); + Assert.assertEquals("button1", jo.optString("componentName")); + Assert.assertEquals("Widget", jo.optString("componentType")); + Assert.assertEquals("0", jo.optString("createTime")); + Assert.assertEquals("0", jo.optString("deleteTime")); + } + + @Test + public void testComponentType() { + Assert.assertEquals(ComponentProcessInfo.ComponentType.Widget, ComponentProcessInfo.ComponentType.parseType(new FreeButton())); + Assert.assertEquals(ComponentProcessInfo.ComponentType.Report, ComponentProcessInfo.ComponentType.parseType(new ElementCaseEditor())); + Assert.assertEquals(ComponentProcessInfo.ComponentType.Chart, ComponentProcessInfo.ComponentType.parseType(new ChartEditor())); + Assert.assertEquals(ComponentProcessInfo.ComponentType.Absolute, ComponentProcessInfo.ComponentType.parseType(new WAbsoluteLayout())); + Assert.assertEquals(ComponentProcessInfo.ComponentType.TabLayout, ComponentProcessInfo.ComponentType.parseType(new WCardLayout())); + } +} diff --git a/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java b/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java new file mode 100644 index 000000000..ee366cc7d --- /dev/null +++ b/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java @@ -0,0 +1,149 @@ +package com.fr.design.mainframe.template.info; + +import com.fr.chart.chartattr.ChartCollection; +import com.fr.form.main.Form; +import com.fr.form.ui.CardSwitchButton; +import com.fr.form.ui.ChartEditor; +import com.fr.form.ui.ElementCaseEditor; +import com.fr.form.ui.FreeButton; +import com.fr.form.ui.container.WAbsoluteLayout; +import com.fr.form.ui.container.WBorderLayout; +import com.fr.form.ui.container.WCardLayout; +import com.fr.form.ui.container.WFitLayout; +import com.fr.form.ui.container.WParameterLayout; +import com.fr.form.ui.container.cardlayout.WCardTagLayout; +import com.fr.invoke.Reflect; +import com.fr.json.JSONArray; +import com.fr.plugin.chart.vanchart.VanChart; +import com.fr.report.cell.DefaultTemplateCellElement; +import com.fr.report.worksheet.FormElementCase; +import org.junit.Assert; +import org.junit.Test; + +/** + * Created by kerry on 2020-05-08 + */ +public class JFormProcessInfoTest { + @Test + public void testHasTestECReport() { + Form form = new Form(); + WFitLayout wFitLayout = new WFitLayout(); + ElementCaseEditor editor = new ElementCaseEditor(); + FormElementCase elementCase = new FormElementCase(); + editor.setElementCase(elementCase); + wFitLayout.addWidget(editor); + form.setContainer(wFitLayout); + JFormProcessInfo jFormProcessInfo = new JFormProcessInfo(form); + boolean result1 = Reflect.on(jFormProcessInfo).call("hasTestECReport").get(); + Assert.assertTrue(result1); + + elementCase.addCellElement(new DefaultTemplateCellElement()); + boolean result2 = Reflect.on(jFormProcessInfo).call("hasTestECReport").get(); + Assert.assertTrue(result2); + } + + @Test + public void testHasTestChart() { + Form form = new Form(); + WFitLayout wFitLayout = new WFitLayout(); + ChartEditor editor = new ChartEditor(); + ChartCollection collection = new ChartCollection(); + editor.resetChangeChartCollection(collection); + wFitLayout.addWidget(editor); + form.setContainer(wFitLayout); + JFormProcessInfo jFormProcessInfo = new JFormProcessInfo(form); + boolean result1 = Reflect.on(jFormProcessInfo).call("hasTestChart").get(); + Assert.assertTrue(result1); + + collection.addChart(new VanChart()); + boolean result2 = Reflect.on(jFormProcessInfo).call("hasTestChart").get(); + Assert.assertTrue(result2); + + } + + @Test + public void testHasTestTabLayout() { + Form form = new Form(); + WFitLayout wFitLayout = new WFitLayout(); + WCardLayout editor = new WCardLayout(); + wFitLayout.addWidget(editor); + form.setContainer(wFitLayout); + JFormProcessInfo jFormProcessInfo = new JFormProcessInfo(form); + boolean result1 = Reflect.on(jFormProcessInfo).call("hasTestTabLayout").get(); + Assert.assertFalse(result1); + + WCardTagLayout tagLayout = new WCardTagLayout(); + CardSwitchButton button = new CardSwitchButton(); + button.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Title") + "0"); + tagLayout.addWidget(button); + editor.addWidget(tagLayout); + boolean result2 = Reflect.on(jFormProcessInfo).call("hasTestTabLayout").get(); + Assert.assertTrue(result2); + + button.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Title") + "test"); + boolean result3 = Reflect.on(jFormProcessInfo).call("hasTestTabLayout").get(); + Assert.assertFalse(result3); + + } + + @Test + public void testHasTestAbsolutePane() { + Form form = new Form(); + WFitLayout wFitLayout = new WFitLayout(); + WAbsoluteLayout editor = new WAbsoluteLayout(); + wFitLayout.addWidget(editor); + form.setContainer(wFitLayout); + JFormProcessInfo jFormProcessInfo = new JFormProcessInfo(form); + boolean result1 = Reflect.on(jFormProcessInfo).call("hasTestAbsolutePane").get(); + Assert.assertTrue(result1); + + editor.addWidget(new FreeButton()); + boolean result2 = Reflect.on(jFormProcessInfo).call("hasTestAbsolutePane").get(); + Assert.assertFalse(result2); + } + + @Test + public void testHasEmptyParaPane() { + Form form = new Form(); + WBorderLayout borderLayout = new WBorderLayout(); + form.setContainer(borderLayout); + JFormProcessInfo jFormProcessInfo = new JFormProcessInfo(form); + boolean result1 = Reflect.on(jFormProcessInfo).call("hasEmptyParaPane").get(); + Assert.assertFalse(result1); + + borderLayout.addNorth(new WParameterLayout()); + boolean result2 = Reflect.on(jFormProcessInfo).call("hasEmptyParaPane").get(); + Assert.assertTrue(result2); + } + + @Test + public void testUseParaPane() { + Form form = new Form(); + WBorderLayout borderLayout = new WBorderLayout(); + form.setContainer(borderLayout); + JFormProcessInfo jFormProcessInfo = new JFormProcessInfo(form); + Assert.assertFalse(jFormProcessInfo.useParaPane()); + + borderLayout.addNorth(new WParameterLayout()); + Assert.assertTrue(jFormProcessInfo.useParaPane()); + + } + + @Test + public void testGetComponentsInfo() { + Form form = new Form(); + JFormProcessInfo jFormProcessInfo = new JFormProcessInfo(form); + FreeButton button1 = new FreeButton(); + FreeButton button2 = new FreeButton(); + button1.setWidgetID("xxxx1"); + button2.setWidgetID("xxxx2"); + jFormProcessInfo.addComponentCreateInfo(button1); + jFormProcessInfo.addComponentRemoveInfo(button2); + JSONArray ja = jFormProcessInfo.getComponentsInfo(); + Assert.assertEquals(2, ja.size()); + + + ja = jFormProcessInfo.getComponentsInfo(); + Assert.assertEquals(0, ja.size()); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java index b68e49e16..48ddb6a05 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java @@ -3,6 +3,8 @@ */ package com.fr.design.mainframe; +import com.fr.design.mainframe.template.info.JPolyWorkBookProcessInfo; +import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.file.FILEChooserPane; import com.fr.main.impl.WorkBook; import com.fr.report.poly.PolyWorkSheet; @@ -49,4 +51,14 @@ public class JPolyWorkBook extends JWorkBook { protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser) { } + + + @Override + public TemplateProcessInfo getProcessInfo() { + if (processInfo == null) { + processInfo = new JPolyWorkBookProcessInfo(template); + } + return processInfo; + } + } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JPolyWorkBookProcessInfo.java b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JPolyWorkBookProcessInfo.java new file mode 100644 index 000000000..ec5d05c7f --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JPolyWorkBookProcessInfo.java @@ -0,0 +1,77 @@ +package com.fr.design.mainframe.template.info; + +import com.fr.chart.chartattr.ChartCollection; +import com.fr.main.impl.WorkBook; +import com.fr.report.block.Block; +import com.fr.report.poly.PolyChartBlock; +import com.fr.report.poly.PolyWorkSheet; +import com.fr.report.report.Report; + +import java.util.Iterator; + +/** + * Created by kerry on 2020-05-06 + */ +public class JPolyWorkBookProcessInfo extends JWorkBookProcessInfo { + public JPolyWorkBookProcessInfo(WorkBook template) { + super(template); + } + + @Override + public int getReportType() { + return 1; + } + + @Override + public int getCellCount() { + return 0; + } + + @Override + public int getFloatCount() { + return 0; + } + + @Override + public int getBlockCount() { + int blockCount = 0; + if (!template.isElementCaseBook()) { // 如果是聚合报表 + for (int i = 0; i < template.getReportCount(); i++) { + Report report = template.getReport(i); + // 考虑多个sheet下 包含WorkSheet的情况 需要判断下 + if (report instanceof PolyWorkSheet) { + PolyWorkSheet r = (PolyWorkSheet) report; + blockCount += r.getBlockCount(); + } + } + } + return blockCount; + } + + + @Override + public boolean isTestTemplate() { + Iterator it = this.template.getTableDataNameIterator(); + if (!it.hasNext() || getBlockCount() <= 1 || isTestECReport() || isTestChartBlock()) { + return true; + } + return false; + } + + + private boolean isTestChartBlock() { + int count = this.template.getReportCount(); + for (int m = 0; m < count; m++) { + PolyWorkSheet report = (PolyWorkSheet) this.template.getReport(m); + int blockCount = report.getBlockCount(); + for (int i = 0; i < blockCount; i++) { + Block block = report.getBlock(i); + if (block instanceof PolyChartBlock && isTestChartCollection((ChartCollection) ((PolyChartBlock) block).getChartCollection())) { + return true; + } + } + } + return false; + } + +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java index 85266b7cd..a4b86b189 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java @@ -1,10 +1,15 @@ package com.fr.design.mainframe.template.info; + +import com.fr.base.Style; import com.fr.base.parameter.ParameterUI; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.json.JSONArray; import com.fr.main.impl.WorkBook; import com.fr.main.parameter.ReportParameterAttr; +import com.fr.report.cell.TemplateCellElement; import com.fr.report.cellcase.CellCase; -import com.fr.report.poly.PolyWorkSheet; +import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.report.Report; import com.fr.report.worksheet.WorkSheet; @@ -34,7 +39,7 @@ public class JWorkBookProcessInfo extends TemplateProcessInfo { for (int j = 0; j < cc.getRowCount(); j++) { Iterator iter = cc.getRow(j); while (iter.hasNext()) { - cellCount ++; + cellCount++; iter.next(); } } @@ -42,6 +47,7 @@ public class JWorkBookProcessInfo extends TemplateProcessInfo { } return cellCount; } + // 获取模板悬浮元素个数 public int getFloatCount() { int chartCount = 0; @@ -50,28 +56,19 @@ public class JWorkBookProcessInfo extends TemplateProcessInfo { WorkSheet r = (WorkSheet) template.getReport(i); Iterator fiter = r.getBlock().floatIterator(); while (fiter.hasNext()) { - chartCount ++; + chartCount++; fiter.next(); } } } return chartCount; } + // 获取模板聚合块个数 public int getBlockCount() { - int blockCount = 0; - if (!template.isElementCaseBook()) { // 如果是聚合报表 - for (int i = 0; i < template.getReportCount(); i++) { - Report report = template.getReport(i); - // 考虑多个sheet下 包含WorkSheet的情况 需要判断下 - if (report instanceof PolyWorkSheet) { - PolyWorkSheet r = (PolyWorkSheet) report; - blockCount += r.getBlockCount(); - } - } - } - return blockCount; + return 0; } + // 获取模板控件数 public int getWidgetCount() { ReportParameterAttr attr = template.getReportParameterAttr(); @@ -82,4 +79,60 @@ public class JWorkBookProcessInfo extends TemplateProcessInfo { ParameterUI pui = attr.getParameterUI(); return pui == null ? 0 : (pui.getAllWidgets().length - 1); } + + @Override + public boolean isTestTemplate() { + Iterator it = this.template.getTableDataNameIterator(); + if (!it.hasNext() || isTestECReport() || getCellCount() <= 5) { + return true; + } + return false; + } + + protected boolean isTestECReport() { + int count = this.template.getReportCount(); + for (int m = 0; m < count; m++) { + Report report = this.template.getReport(m); + Iterator iterator = report.iteratorOfElementCase(); + while (iterator.hasNext()) { + TemplateElementCase templateElementCase = (TemplateElementCase) iterator.next(); + int columnLength = templateElementCase.getColumnCount(); + int rowLength = templateElementCase.getRowCount(); + for (int i = 0; i < columnLength; i++) { + for (int j = 0; j < rowLength; j++) { + TemplateCellElement templateCellElement = templateElementCase.getTemplateCellElement(i, j); + Object value = templateCellElement.getValue(); + if (isTestCell(value, templateCellElement.getStyle())) { + return true; + } + + } + } + } + } + return false; + } + + protected boolean isTestCell(Object value, Style style) { + if (value instanceof ChartCollection && isTestChartCollection((ChartCollection) value)) { + return true; + } + return false; + } + + + @Override + public boolean useParaPane() { + ReportParameterAttr parameterAttr = this.template.getReportParameterAttr(); + if (parameterAttr == null) { + return false; + } + return parameterAttr.getParameterUI() != null; + } + + + @Override + public JSONArray getComponentsInfo() { + return new JSONArray(); + } } diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/template/info/JWorkBookProcessInfoTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/template/info/JWorkBookProcessInfoTest.java new file mode 100644 index 000000000..2629fc462 --- /dev/null +++ b/designer-realize/src/test/java/com.fr/design/mainframe/template/info/JWorkBookProcessInfoTest.java @@ -0,0 +1,49 @@ +package com.fr.design.mainframe.template.info; + +import com.fr.base.Style; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.form.main.parameter.FormParameterUI; +import com.fr.invoke.Reflect; +import com.fr.json.JSONArray; +import com.fr.main.impl.WorkBook; +import com.fr.main.parameter.ReportParameterAttr; +import com.fr.plugin.chart.vanchart.VanChart; +import org.junit.Assert; +import org.junit.Test; + +/** + * Created by kerry on 2020-05-08 + */ +public class JWorkBookProcessInfoTest { + + @Test + public void testIsTestCell() { + ChartCollection chartCollection = new ChartCollection(); + chartCollection.addChart(new VanChart()); + JWorkBookProcessInfo processInfo = new JWorkBookProcessInfo(new WorkBook()); + boolean result = Reflect.on(processInfo).call("isTestCell", chartCollection, Style.getInstance()).get(); + Assert.assertTrue(result); + } + + + @Test + public void testUseParaPane(){ + WorkBook workBook = new WorkBook(); + JWorkBookProcessInfo processInfo = new JWorkBookProcessInfo(workBook); + Assert.assertFalse(processInfo.useParaPane()); + + ReportParameterAttr attr = new ReportParameterAttr(); + workBook.setReportParameterAttr(attr); + Assert.assertFalse(processInfo.useParaPane()); + + attr.setParameterUI(new FormParameterUI()); + Assert.assertTrue(processInfo.useParaPane()); + } + + @Test + public void testGetComponentsInfo() { + JWorkBookProcessInfo processInfo = new JWorkBookProcessInfo(new WorkBook()); + JSONArray ja = processInfo.getComponentsInfo(); + Assert.assertEquals(0, ja.size()); + } +} From 901faae84c406c64ae1d500f1cf82a19d6a0d5d0 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 8 May 2020 14:32:16 +0800 Subject: [PATCH 294/375] =?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/mainframe/JTemplate.java | 10 +++- .../template/info/TemplateProcessInfo.java | 6 +++ .../design/form/util/FormDesignerUtils.java | 11 +--- .../java/com/fr/design/mainframe/JForm.java | 6 ++- .../template/info/ComponentProcessInfo.java | 52 +++++++++++++------ 5 files changed, 58 insertions(+), 27 deletions(-) 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 03248efb1..b780f5be0 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 @@ -130,7 +130,7 @@ public abstract class JTemplate> consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile)); } - + void onGetFocus() { consumeTimer.start(); } @@ -1262,6 +1262,14 @@ public abstract class JTemplate> template.setTemplateID(templateId); } + public void addWidgetProcessInfo(Widget widget) { + + } + + public void removeWidgetProcessInfo(Widget widget) { + + } + public abstract String route(); public String getTemplateName() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java index e5872ae1d..eb1404ab0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java @@ -4,6 +4,7 @@ import com.fr.base.Style; import com.fr.base.io.BaseBook; import com.fr.chart.chartattr.ChartCollection; import com.fr.chartx.attr.ChartProvider; +import com.fr.form.ui.Widget; import com.fr.json.JSONArray; /** @@ -45,7 +46,12 @@ public abstract class TemplateProcessInfo { //获取组件信息 public abstract JSONArray getComponentsInfo(); + public void addComponentCreateInfo(Widget widget) { + } + + public void addComponentRemoveInfo(Widget widget) { + } protected boolean isTestCell(Object value, Style style) { if (value instanceof ChartCollection && isTestChartCollection((ChartCollection) value)) { diff --git a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java index 532f04c16..d5dad2e89 100644 --- a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java +++ b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java @@ -2,12 +2,10 @@ package com.fr.design.form.util; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JTemplate; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WFitLayout; -import java.util.UUID; public class FormDesignerUtils { /** @@ -34,17 +32,12 @@ public class FormDesignerUtils { public static void addWidgetProcessInfo(Widget widget) { JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (jTemplate instanceof JForm) { - widget.setWidgetID(UUID.randomUUID().toString()); - ((JForm) jTemplate).addWidgetProcessInfo(widget); - } + jTemplate.addWidgetProcessInfo(widget); } public static void removeWidgetProcessInfo(Widget widget) { JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (jTemplate instanceof JForm) { - ((JForm) jTemplate).removeWidgetProcessInfo(widget); - } + jTemplate.removeWidgetProcessInfo(widget); } } 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 ac237848a..8ca0252b9 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 @@ -105,6 +105,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Set; +import java.util.UUID; public class JForm extends JTemplate implements BaseJForm { private static final String FORM_CARD = "FORM"; @@ -223,14 +224,15 @@ public class JForm extends JTemplate implements BaseJForm Date: Fri, 8 May 2020 14:42:28 +0800 Subject: [PATCH 295/375] =?UTF-8?q?CHART-13740=20=E9=9B=B7=E8=BE=BE?= =?UTF-8?q?=E5=9B=BE=E7=BD=91=E6=A0=BC=E7=BA=BF=E6=94=AF=E6=8C=81=E7=BA=BF?= =?UTF-8?q?=E5=9E=8B=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../background/VanChartAxisAreaPane.java | 63 ++++++++++--------- .../radar/VanChartRadarAxisAreaPane.java | 21 +++---- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java index 795dc3ce2..fc17554c2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java @@ -32,9 +32,6 @@ public class VanChartAxisAreaPane extends BasicBeanPane { private static final int PREFERRED_WIDTH = 100; - protected ColorSelectBox horizontalGridLine; - protected ColorSelectBox verticalGridLine; - protected AlertLineListControlPane alertLine; private UIButtonGroup isDefaultIntervalBackground; @@ -44,8 +41,10 @@ public class VanChartAxisAreaPane extends BasicBeanPane { private ColorSelectBox verticalColorBackground; protected BackgroundListControlPane customIntervalBackground; - private LineTypeComboBox horizonLineType;//横向线型 - private LineTypeComboBox verticalLineType;//纵向线型 + private LineTypeComboBox horizonLineType; + private LineTypeComboBox verticalLineType; + private ColorSelectBox horizontalColorBox; + private ColorSelectBox verticalColorBox; private JPanel horizontalColorPane; private JPanel verticalColorPane; @@ -53,9 +52,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane { initComponents(); } - protected void initComponents() { - horizontalGridLine = new ColorSelectBox(PREFERRED_WIDTH); - verticalGridLine = new ColorSelectBox(PREFERRED_WIDTH); + private void initComponents() { + horizontalColorBox = new ColorSelectBox(PREFERRED_WIDTH); + verticalColorBox = new ColorSelectBox(PREFERRED_WIDTH); horizonLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); verticalLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); @@ -77,23 +76,33 @@ public class VanChartAxisAreaPane extends BasicBeanPane { } protected JPanel createGridLinePane() { + initGridLineComponents(); + + JPanel panel = new JPanel(new BorderLayout(0, 4)); + panel.add(createSingleGridLinePane(Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), true), BorderLayout.NORTH); + panel.add(createSingleGridLinePane(Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), false), BorderLayout.CENTER); + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel); + } + + protected void initGridLineComponents() { Component[][] upComponent = new Component[][]{ new Component[]{null, null}, - new Component[]{null, horizontalGridLine} + new Component[]{null, horizontalColorBox} }; horizontalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(upComponent); Component[][] downComponent = new Component[][]{ new Component[]{null, null}, - new Component[]{null, verticalGridLine} + new Component[]{null, verticalColorBox} }; verticalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(downComponent); horizonLineType.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - if (horizontalGridLine == null || horizonLineType == null) { + if (horizontalColorBox == null || horizonLineType == null) { return; } horizontalColorPane.setVisible(horizonLineType.getSelectedItem() != LineType.NONE); @@ -103,7 +112,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane { verticalLineType.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - if (verticalGridLine == null || verticalLineType == null) { + if (verticalColorBox == null || verticalLineType == null) { return; } verticalColorPane.setVisible(verticalLineType.getSelectedItem() != LineType.NONE); @@ -111,22 +120,20 @@ public class VanChartAxisAreaPane extends BasicBeanPane { }); checkColorBoxVisible(); + } - JPanel horizonLineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), horizonLineType); - JPanel horizontal = new JPanel(new BorderLayout()); - horizontal.add(horizonLineTypePane, BorderLayout.NORTH); - horizontal.add(horizontalColorPane, BorderLayout.CENTER); + protected JPanel createSingleGridLinePane(String title, boolean isHorizontal) { + LineTypeComboBox lineTypeComboBox = isHorizontal ? horizonLineType : verticalLineType; + JPanel colorSelectPane = isHorizontal ? horizontalColorPane : verticalColorPane; - JPanel verticalLineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), verticalLineType); - JPanel vertical = new JPanel(new BorderLayout()); - vertical.add(verticalLineTypePane, BorderLayout.NORTH); - vertical.add(verticalColorPane, BorderLayout.CENTER); + JPanel lineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(title, lineTypeComboBox); - JPanel panel = new JPanel(new BorderLayout(0, 4)); - panel.add(horizontal, BorderLayout.NORTH); - panel.add(vertical, BorderLayout.CENTER); + JPanel horizontalGridLinePane = new JPanel(new BorderLayout()); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel); + horizontalGridLinePane.add(lineTypePane, BorderLayout.NORTH); + horizontalGridLinePane.add(colorSelectPane, BorderLayout.CENTER); + + return horizontalGridLinePane; } protected JPanel createAlertLinePane() { @@ -213,12 +220,12 @@ public class VanChartAxisAreaPane extends BasicBeanPane { VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis(); if (defaultXAxis != null) { - verticalGridLine.setSelectObject(defaultXAxis.getMainGridColor()); + verticalColorBox.setSelectObject(defaultXAxis.getMainGridColor()); verticalLineType.setSelectedItem(defaultXAxis.getGridLineType()); } if (defaultYAxis != null) { - horizontalGridLine.setSelectObject(defaultYAxis.getMainGridColor()); + horizontalColorBox.setSelectObject(defaultYAxis.getMainGridColor()); horizonLineType.setSelectedItem(defaultYAxis.getGridLineType()); } } @@ -246,12 +253,12 @@ public class VanChartAxisAreaPane extends BasicBeanPane { VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis(); if (defaultXAxis != null) { - defaultXAxis.setMainGridColor(verticalGridLine.getSelectObject()); + defaultXAxis.setMainGridColor(verticalColorBox.getSelectObject()); defaultXAxis.setGridLineType((LineType) verticalLineType.getSelectedItem()); } if (defaultYAxis != null) { - defaultYAxis.setMainGridColor(horizontalGridLine.getSelectObject()); + defaultYAxis.setMainGridColor(horizontalColorBox.getSelectObject()); defaultYAxis.setGridLineType((LineType) horizonLineType.getSelectedItem()); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/radar/VanChartRadarAxisAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/radar/VanChartRadarAxisAreaPane.java index 687516c35..790b6e93f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/radar/VanChartRadarAxisAreaPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/radar/VanChartRadarAxisAreaPane.java @@ -3,15 +3,14 @@ package com.fr.van.chart.designer.style.background.radar; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.style.background.AlertLineListControlPane; import com.fr.van.chart.designer.style.background.BackgroundListControlPane; import com.fr.van.chart.designer.style.background.VanChartAxisAreaPane; import javax.swing.JPanel; +import java.awt.BorderLayout; import java.awt.Component; -import java.util.Arrays; /** * 样式-背景-绘图区背景-雷达图只有Y轴的配置(间隔背景、网格线、警戒线) @@ -23,24 +22,18 @@ public class VanChartRadarAxisAreaPane extends VanChartAxisAreaPane { //雷达图只有横向的y轴的网格线配置 @Override protected JPanel createGridLinePane() { + initGridLineComponents(); + + JPanel panel = new JPanel(new BorderLayout(0, 4)); + + panel.add(createSingleGridLinePane(Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), true), BorderLayout.CENTER); - Component[][] components = new Component[][]{ - new Component[]{null,null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),horizontalGridLine}, - }; - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] row = new double[components.length]; - Arrays.fill(row, p); - double[] col = {f, e}; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel); } protected Component[][] getIntervalPaneComponents() { return new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),horizontalColorBackground}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), horizontalColorBackground}, }; } From 6b1f8a513df8e915c60ccb6f9eb4ddad01bd916e Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 8 May 2020 14:50:08 +0800 Subject: [PATCH 296/375] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/style/background/VanChartAxisAreaPane.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java index fc17554c2..b781d0bb6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java @@ -128,12 +128,12 @@ public class VanChartAxisAreaPane extends BasicBeanPane { JPanel lineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(title, lineTypeComboBox); - JPanel horizontalGridLinePane = new JPanel(new BorderLayout()); + JPanel singleGridLinePane = new JPanel(new BorderLayout()); - horizontalGridLinePane.add(lineTypePane, BorderLayout.NORTH); - horizontalGridLinePane.add(colorSelectPane, BorderLayout.CENTER); + singleGridLinePane.add(lineTypePane, BorderLayout.NORTH); + singleGridLinePane.add(colorSelectPane, BorderLayout.CENTER); - return horizontalGridLinePane; + return singleGridLinePane; } protected JPanel createAlertLinePane() { From 3f974adefdbde52aa78e03561b3522d5284ea2d5 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 8 May 2020 15:37:17 +0800 Subject: [PATCH 297/375] =?UTF-8?q?CHART-13786=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E5=85=B1=E7=94=A8=E9=9D=99=E6=80=81=E5=8F=98=E9=87=8F=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E8=87=AA=E5=8A=A8=E6=A0=87=E8=AE=B0=E7=82=B9?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/marker/VanChartCommonMarkerPane.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java index f62604501..746e0e401 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java @@ -53,18 +53,19 @@ public class VanChartCommonMarkerPane extends BasicBeanPane return normalMarkers; } + private static Marker[] normalMarkersWithAuto = null; protected static Marker[] getNormalMarkersWithAuto() { - if (normalMarkers == null) { - normalMarkers = new Marker[NORMAL_TYPES.length + 1]; - normalMarkers[0] = Marker.createMarker(MarkerType.MARKER_AUTO); + if (normalMarkersWithAuto == null) { + normalMarkersWithAuto = new Marker[NORMAL_TYPES.length + 1]; + normalMarkersWithAuto[0] = Marker.createMarker(MarkerType.MARKER_AUTO); int i = 1; for (MarkerType markerType : NORMAL_TYPES) { - normalMarkers[i++] = Marker.createMarker(markerType); + normalMarkersWithAuto[i++] = Marker.createMarker(markerType); } } - return normalMarkers; + return normalMarkersWithAuto; } //没有无这个选项 From 3b6ff4723792c6abfaa34f20efe49808f6c1d8cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 8 May 2020 17:15:11 +0800 Subject: [PATCH 298/375] =?UTF-8?q?CHART-13810=20=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=BB=84=E5=90=88=E5=9B=BE=E4=B8=AD=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E7=9A=84=E5=9B=BE=E7=89=87=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/images/custom/icon/cuvette.png | Bin 574 -> 739 bytes .../custom/images/custom/icon/pointer_180.png | Bin 1164 -> 1340 bytes .../custom/images/custom/icon/pointer_360.png | Bin 1581 -> 1745 bytes .../chart/custom/images/custom/icon/ring.png | Bin 1223 -> 1387 bytes .../images/custom/icon/selected/cuvette.png | Bin 15905 -> 771 bytes .../custom/icon/selected/pointer_180.png | Bin 16412 -> 1360 bytes .../custom/icon/selected/pointer_360.png | Bin 16831 -> 1768 bytes .../images/custom/icon/selected/ring.png | Bin 16874 -> 1405 bytes .../images/custom/icon/selected/slot.png | Bin 16717 -> 1299 bytes .../chart/custom/images/custom/icon/slot.png | Bin 1113 -> 1274 bytes 10 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/cuvette.png mode change 100644 => 100755 designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_180.png mode change 100644 => 100755 designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_360.png mode change 100644 => 100755 designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/ring.png mode change 100644 => 100755 designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/selected/cuvette.png mode change 100644 => 100755 designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/selected/pointer_180.png mode change 100644 => 100755 designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/selected/pointer_360.png mode change 100644 => 100755 designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/selected/ring.png mode change 100644 => 100755 designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/selected/slot.png mode change 100644 => 100755 designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/slot.png diff --git a/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/cuvette.png b/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/cuvette.png old mode 100644 new mode 100755 index 39f034740e050c304fb21313a81f0f93d0ce370a..c2220b4b5246f694144a454d7c77642f846ca439 GIT binary patch delta 695 zcmV;o0!aP71mgveIDZ0_NklljQ5P-iH1Vd4!AhQBVr%b7o^U?v9WN(M| zC-f&Y*+{ko@dwIJphLSi12C}UERiWw6Tyn5NDUwb37O>?nKlV=>K2>6ldSli@15W0 zyLa!Dl^_VX4RSZ_3+#5g+du;-Mbtf@;kxe0qJCCW4%q;XFMmK{#>eLQLb8(9)HRVj zUchu`k;tYwqBEoAI1c%I{;zgf0WHmg9FNCy?J@z{?RKAr_xXGt$8r9E91e&0zCYDI zi+ePP!uh_B<2aWf0bJKz$@1~i14<#(v`9wmGJTGQM+?61GaiqbOeV34Rwjy(IWn5z zcm`y1(WW8Q4S$2{x(#4wN_zIp`I-HOA!%9VmWTzlpceE$0rfm@)APK|Wnc8K=f~-c zw$1OyP|@%AHvx*p;#}RV`7wP=oqtn*rA&Ky+yy1!!|u^#B6@NKU0i(}zqSR89nn|s zzr5|A-+P|K3m>oF0pQ8~uRMG7eHj0NHG$TGSC7lM)got zM;og9t*UJiX#u;&uBxg75qSd)RJERV&@*5F)B#l06On!35ZD9CKn)N;jjjfC zfFs}(*nd#fQ5u^1S&$W=V1^2KB2ta$IuY}NiEfy>BLmz9YQ|URIwG6I9t{^=2da_i z&62uF=YhG(fM@2^Bf#m3s97Xt!JSB?!ZfUyX8@k64uIDt8&1uA_^}2TK3?kfXw5_< z2OO#Dp3z?_Mv*zYKuc9OBG3g>l&Xnu(jW*DyD-Y-a&8e_ocT#zw%4_w7Sw`TPz!27 dEvN+zB2$?rD-o z$Rotpg>*LJ1;QgF4Siey1=XxX=Zce{rLYtcB#_XhnM0=#o7{OrPV$Vj^7;49?0z@1 zqm|c+qF@#59xGxF>YxtlpbqMw4(gx|>Y)F!5JE46&}+KjU4QxCZ?M)2`}|Z2)9JJa z(Cu~?YV-VS#<eut% zy!v?Yr*s?Ik$*QMzw0`vgDx}?>4-?@s&?JH{{=jDWsLk5qLgBFDf!FayS_ zIu?-;uxs-Ms+x<)36QI5)^^a(Kn`R8sv1OOA2;1XTY|q&f0LP zp9k3o68ow^5RpMen^dMJmff;+X9he5h8AlQGqW+zXn(os3>Z|hH_tLF=iEjL1oO!% z!0pPYZ4%q?q>`z!4Ey#QKv2~jcw^OYX3yoz%CEe<)}7IzWuya~s_LHUe>J0u&n_@h z)$Iy&VohlfZF5CYL?3CIc5b58@n3fMUDrV!)IlB8K^@dV9n?V`)IlAzRdxxC(Ol7# TwNsh^015yANkvXXu0mjf$@>Iq diff --git a/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_180.png b/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_180.png old mode 100644 new mode 100755 index 213a052d4c6f169670a8d37e5b566fbb0ddf588f..a0fa2b2147b92dd1fefe4793d1b777a339077b95 GIT binary patch delta 1300 zcmV+v1?&2Z3A_rBIe+d+L_t(&-tCx8NMlzN$Nx89#y2K$LQIFmj|PS)WkAG9nTjsD zXl67bNoYnf!CjLeAsS%|~)ZgXvAJkv*>w-8WhehXWpu=TN(9 z0qr~pGL=dlXjc`Wb8~aA?usdmsV8=kt+j zE-woJI(MK-MSrr$uBz+kPH6$haY&_7kR++Bq*WEkC|@$}?acRqyjM=saBdq0pU*c2 z;AV;Axsb1))!#6jhUoB;NDZ`HA%y4%Aq*kJP6&C05aJ?)xQ2#?I(Ei+y*+PN(M>+~ z9VLY50aySqEX&?F@7<3Lpz0MJfIF)JZ9& zNB#k@`2GHl#l^)5p67WbSy}m7 z5QM_wbAP!UjYgwXmgPf1W3d<&MX@j!1cA=a&wp{6ut$mHrBEm|RSa1SyIYq`CN!2s_V#`VpsrGP)M&HWdJa9}^$Z$^N3bnq5uY4~y!uS_ zTwZ;K_~baYg)AC}M?mVCl71M5fyre0zn0nUuK_Ssq^T!_xH6ecw60Fu#wxKj#D6Ep zLB%X0J=gJ%*#@V`qmBIu#LU3{=_m}YR!zP{QA9&SgPT$sJ1*#ne;hNoT4A|y8-ITH zEvA0^qoDU2OnCjqZOxGTH6W*2UJQov_M`r4AL8CFl`ih>LjBdgGkfvYM4;E}RmHx! zxw&L(S1h*nE5K4nJwHUU*(}!A*MAFhuh(0-7jHs{OHq{QQJnwy^HT&vA$Tue#(VF+ zbF@ep3@36&HG!tn>F7?eucVx0GSYHK0rlX0NeycN0000< KMNUMnLSTZa+Iv(0 delta 1122 zcmV-o1fBc53XBPmIe$J$L_t(&-tCx8Xd6cq$N!_%O7ccu5m*gc%f1BJlz=e~B{lY; zht@5r$)PQln~R}P=&6QYf=Mqq_#$Xhaxg9E&_k$u@Flb~P(*v$mSTEP!Lh{}BV!4t zu|8H``=PC-hdQd)R$^P0Xmlub%WW+$FTV$%7l7@50}6l#aA|#g{VP>fn}e^{>ok+eP{S~e1kGl% zRMWI(T~$@Ova<4dCt*9Wl9yyzUfK`2ANHWGR4N_IPJh>RD$DXxr(jR(=>oDW-wTJs z)9G{?rBdmjV>;A85QJ6^%u?5N9h;k*2!%q^k|ccyAaHKsg%ILNBofy}QJm&D4&iVZ zyBn!PuqPE=*O6KM6Tx5*4u=E7!^8LD@%RWK@=Y5cv?Y{q)!dQ zpoKz#X0zFrUi0bwJM>BH7Oj^Lds&OeEtlw%*e&|>{+*WZi^U?{+1a70s?vBo{w4rd zx4f=P6vb;cn++b12f<*lrFZqu&H(^&cW=YYZnf;l%x)of_qN5p)oOaZUhq7R@$vEZ z0e?8Vbw+ug&o_4D7Vi<@pPfTPts%d-0Au5^<-M`-82QBoG}IdWvvVLlLd$*xL4d>I z_&1gX0OE#wy$K(!juW7qMQ%ZH$*U_kl-#3dl`$vo_# z{$ur}X&T&aw@4|?o)px6*7rbrs2`piH-GW_x8Gptm*1NDsNI3rZrnUJ)GD87Ko~pbV6O oGEfG}Kp7|lWuOd{f&M4|0JvPJyT%sjHvj+t07*qoM6N<$f-oyF`2YX_ diff --git a/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_360.png b/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_360.png old mode 100644 new mode 100755 index 58b1f0a35bf9f878eddb1c6e943fa660c465de73..f7c3f25b25206e0e618d583d0af3b2a5a6e97950 GIT binary patch delta 1709 zcmV;e22%O04ABjcIDZC%Nkl=1-M5`dBNRc8%$|*T;Dj)^P;*v;6T!<>=kg95oR3}xX9NZqFs)$3ekm96}f-M9l zU>w^l`{`ZGP7hg-jSbkwwm`{~Mw;23otfXxdv9jmP=pY?3x86+p9eQSKK>1WI{?lk zJ$?@0PFq{sZ@IKZ?_g8-_cE8T(wzK7MIMCG8 zv}?VC0(xdANS^0+tal(l$H&J%+{iaIHNoLZImR#MIsS69F8TX^2&{Ri9~`^Rn-@Z#U@8bM}NJ3{rU?4A^?#PqJI@#O$Z@*CmpbMY;5dSG#Z^( z6on)biIg-sIhpoMQ4|u5M(4-I#%=+q1z_FFII-F{lIDc9!*t{V9e!nXjawDy-u9CI2wUlQZ$EDR{SvIYns;b2A_q&P(n=7cp=kwiF z6opJrPm@?ImIjeeQdO1A&dw4^l8Ddey9>ZkXiz!_?^@w@yU#Z_H+Pqnm7$@b0g=Eo zIF8$sGt@K<3;(`=!C-*VXhd^!bGO^=K2K3pMSmfkE}bQ0SyxwAU3+``puu1O0GLcB z9F6mk$N%2b0HS|+UguYaD5|Wa%L@RT&*!_FN$t32Psz&T zhk2>&%HxNGd-gQrJ6(lsg;L#JHw^lQpn7$6^*@WnQb|$ihXrorM*u*@*WZI;EW7_) zS$_im`_BM?$}2ZA))7UKJAC-?#{j~G*idAnx@M2ZbCF?~%5XRgmSv%7sr^=7xq!>VyB$?kRiJ4adcUTE95}MD(Rxu7 zUz<$X^_N(jM{IZiOR|a)V;xpR2~}1LuBc0>V~nuh`~l_lA7s^*qA0Lhtqp{b#eb44 zFF8fT>pwunrK@lyDzGBHwbvC1YH@fBE-+B8dONFSZv|5p;z z)6<*z#>PfiEIThF3}c2Y$5YBj?DieMkt7KV3k#d&tHP17ICbM0AJD#10iJH<#H{}%*@=|IJsz=hF~z55!7rp!)!M1nBP1x7>x*r!<(?0reS7g z=AO&tS|Wt3mprbk|CAcP-+%8?6omu=0kW{LP>`6BD2n9Ot5-x6#i9ksa*EVb6lDN# zWO;e{Pm9I!X}-%wCRtx!2g|ZAYiepP0EiMo)(Yw5=p1K%4M4QJySrm~d3j{(0emk3 zvS2Vc(%s$NQ4GkuuO#$Kq#Cc++sE@fyBD?Pd7jmS*EIkP`|3&}$$w^TPN(y1AP{(z z={jPkBnSct1OktoPUl$wwqjmK>3WY`mK_FWr`LZk%K@dnN z6dIkFnCR>5>}=KVTTI2iV9MDU?H2ph16d3Jqtod;cIwor#*Oz=Q&S7Qy}dyIDgYTk zyr9cRDKCOEfF~aV6DFkuD;em16B_S`ya#;`dO+oW|8ziHQ3mWU00000NkvXXu0mjf DR+KOH delta 1544 zcmV+j2KV{V4Xq52IDZA-Nkl7fa5Xb+!jz88W!7(A<6seHZl(wg;T&T!} z3x^_ulEh;oUepJ+O&l?0jH5CJ2x8q3Z}zvEnKy5q86v`mAb%`A5UGLIKx?2i&>Cnp zrEWhbXBfr-zz)D_>e~8Y4FEX+YXCGN%Dz{i48yPhTmW46?%n(R?Af#5dOV&_Z8qB% zb#-+O8{=}hoT%%1B%MxAPfSew$}r3m05SlXh>VJp5>dsP3D`P0IeCNU`M9QOl*{Gv z+Vu2v!97jWh=1q#_~hi|4FIhGT$Ow;B0{AASpZGJV6d0x`M9p@r0Y6KlC&pKMNvr8 zG}3jQc%F|3gTY<^O#s*f18PDZ4Tr-+s;cI_d@`Bb6X?sAFDaABZ1z=ErEoYr1mI|; zU@HO{jYb1oAvfCU>ME_Rt>xVlMX_Lgw`YEEaThbl_EN7NRJY6&wx2 zz{0;zV6|Fdv)Rzq)#VEYgXb8Asjqs%z%Y!ZzrVk&r>AGcYPA9Y>~=ejW;0O#`Kv5Y z{?8C>sec4oTU!ADR;v{~Jv}4+{rznW!&s`iyZ~@VB9Yt0%uam#h*lonFUe$A9^NPM z@uQ;8OcQpOYP!tZRv65Lpm}w5^*^W6*}yPN!5DG;M*u+mH{XNdoV$N)RYB&rp8)_3 zm#-BaBg?XQ`0(LR0HjJuC`vJ1M<^7!z;RqdDu0!NAP6vwe7y~quVFp?3hBGUAXV8F zGJSU#>*-fTA&Cg8s)FOVhEOPU0f3`gK5FxNz2{k$MRRjA>~=d?ws0Ev)tj$go$`|3>?s)F>` zFn{#eOx|-nHiPuoFbq|J`|8bYP2A)0ps}$LEX%^wYcDB)mf)l9vMj%_+xMm~w-`ry zY#2+bj&WNXR%8W@E+;PQOK9V4@Lc}^b?qPRX)aCE;BvV-h-mS^?MLg{KSKS*D+uK3 zu_C|r*A-boAXkt2i&ypx`Ce?ixi7zlK!5qF1Y)6leEQ&Tyk}=;H?KQ8JK=Qhyo_+1 z1FD+M>mTuWcKnT^C|Fon*z6xae!Tji-QC@9HU7Ixm+;ds5AyoEiPP!K)1zrx=>>rj zf>Dbg2!9_sbm*;}OI1}QUcA7uj*e}k^-dy5Qrzu!e?>&g)$q|ZS(cxcI<$6~Ru_V)HZmSthFSoRd5ySux$z1~gc=jQ__PMo+- zL_#&!(agZWz%5v@SzqtV~r$ClSB*uL{UvDKKD|RGd z9wN1b!{MP!CL@$%wwX*uFpJkM0IUb|ip63N{C@u# z0Pad2M^qGa3$PtPQ(s@7cYkVXYABgZPDqkOZ&vbERV7K1D49%7OifJ<_4W06&GQy} zrQfOSV6%&4pP_V2I-G?fc3Sq7Bp(3=g38iR$ zs-sC}l9@^N!Nkqaj7~Hr6ZE_!bMHxVzxmF&_d91oq*5uI1b@@2eSvPbyB~lPfIVy2 z1HkEUIHr_-52s2Mps+mz)wk#G4Y&P40e$@ih zz8}b)ot=ICssgCn?LMD*Z?oB8u~>3IuC1*h6becDS7VN*vcZKyAy_Py0+0aUa5#u+ zK3+Tk>={r}On+wiRrNWVIa&}3g|M@;gLph%)TUJxn^F46xR<$>0eMfUXi&9aa5x-J z09Pf#(~~|wDlzuLIA&6Bq`6Qq5e)7E9i?{p9eIbnTIq@KT$PM*TQphE~^m9^7T8t!a+6}nSpiF~s z9EU(40DnOcq^21Fou$m#qC$5qLQPA7yx2^^`Aw~2kN}|9>(ScU3X{ns7sgL2lA|N@ z0hiRqbFrDik6lI>w8f_@Ns?%4YLWxnTgrS@4D>@xdtEAA2RjW%UWC6;OZCJVa& z+JEEg0~`o+@ELQUmYwze&zk!q58svu6Gfo6O@|nt!kf^pD9C`z`2W5T-DCW?tz?C_ zi6Su2u7{5i5#@K)RxJH$HIn%G>sqwcX>i`GL5D?)S$_f@RxM`U#?=9I?0fUpfu%>A z4pBaZi4_jL=X4lo*CWcOF#2x{ZDtL+T7M{5jU+lOTD)gO47BUfX4c?MP(W7;rJllj z@EKF!^y_zLa`H6Brx4{+uo_9p>ukSFE(c@DoOwYI;P?9rexIgkqAa1?tQQJcT@B}o zaU(_KEIR)>dwfq3<;}A!D_4}4Cr9gb$%5YLb8qQ45r$!;hF_Eo=vgW`nm^{>7Jmy^ zJ&JK0Cs(6Rl?~`nchl1bomdc8e|T81!qJ;+$z&3NKtQs2R;o^+;^U>&DEyT_7K$Y? zw!|KJ5y4jSb%dbf`8ZRJeId=F#WMMzm-zbCRtgVV_`Ol)v$o)-UR&H zV!>y>sEcQqt!#5FyRG8csu?^E1@moV?3W+DY#COC*1glyc=fa*$UX7(mUr3@_Gvn9$qS=Qn0eA>tp5wUnYORH+hBBI33Hx6qsf*FH z&2Bbt0L``y0Jk`fyW7y9{?*XXi#WZI?Y$yFv%P$YF6;_Lf~X^JIsE#ATlyr`ikK*d<9qI2?we zC}z_Ffc|oFwye;75vLc-AWwJFnEax-U`PO9Sr*;h-G6X8o%zD}Ze4P8Y9;J9+jvfQ z()ez`0XtQEx{@Rbuh*LocDS5;EgAGxlDcRXu4Dc7vNsO5+YO2`jfU@Q3VP@9&IL0u zaM@=s$&+TD^>{pHQ$C*O`)dZeCzDsrcGqHZvXGo*7{+Yse9b^(Y0_sLJI65a#O%aRFQviU)=PAr?idYKnKQEVpY0Pel2ng!IywU7-dp^}v zKM9yE1_FYLpH~xb(8K}MpU+Zo&;;hTBm@K%b6XPJP7=SpyBU#$mRnj;l}m-9LC5Y3 zM{3!nz<*x*`?ZX~t_mkjV7P}tQr7YG&Auqez<*_q|7A6C;PL-W;q9aejP|k!2r3ft zzWPeO`*b@<{P1}*dRlGx*kwas2Zg0z8hvgGi_cPx0Xp-wYxl^~qlZC4)-kswVfZ+M z(Own_S;zE0N%XjE80ezmc97`npzu;qG1|+b$7RFQh=PGGx^W8cvHL>KNk4sc>`GQl&?meuNmn0 zp!Z%oqvpibuNxvnrTiY0rfCR=!=}x%Qhz&zB|l!e9m?;YYSOX(;wu?Z(J`|wLY3ke`6!;V32_{Ew$!zjB^XXL%Og!>?wxuPk}s}l3TshMw-82j1Qmu*9^)qeK%}PL4%%d4A^p!** z%Iie4JaXl;&Xu}q-9ke7eJ`2v*0hW&o;;TJj}LZUYY0(aOcTxQwV}~_ZH%_jLTl6G xgWh}9S_@(Qp~?caKrK)U)B?3YEf~|dGn^U4su5TO77002ovPDHLkV1lieP(=U$ diff --git a/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/selected/cuvette.png b/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/selected/cuvette.png old mode 100644 new mode 100755 index 57847bc24a74fae1196c796b27b282a0d0790489..d0125c71c70a7ac9dc99d8eeea9bdd4a0e46f730 GIT binary patch delta 739 zcmV<90v!FJe1is%EPoOJ01FZU(%pXi0008DNkl6f1Q9sCsBae9b z>BXUOrvh|fCvnrgUKv?sc5vENZM?5(tz+5xxBGPecAs9{ThLl-z43ls zYpwO--hy`TxqmH4zBqrqRDn@fxpqo=;?B;lJ9K4;#<#}V+jY(4i*DZsvKaKx5bFcO z{zS6?OtmS`s!{Uv9~h#xZqA8WPz!27&j_gFIAf0EjCJ~;|2;m;5pdFczIGk8T5Sv< zl}a7z^BW&BN89ly^;1f_hlia|6glh~?L^V7BlyDl!++$pN5IgEK6w7|Y3<-yJDQWTTPWZ_uWXq1pk<2@{m_werf)lSpgvzyUTOE=Z~<5?7{HV%Gr z|J9e@rQ4wu?Pg?4*MeHmLrp1_P)a3QeeL2-8Z?s4NGX*DmVu0MT@#U}QfdvD2bw@h zL`q7jWq)AW#AQXKu9SKL)I}s8chI*$9moTSh@+I62iAZYAPwXI1&HzGfC{h)>;l6g z(u~8Q-VZVZBu!TUM=6!{_$r?8q*2!`-KGI90XdVaavaJ=u}0lV=Ygz8JwMBva;}?} z1{^ac?*WdNqGpnq30FKyxn-C!_W&FbsRNHqHC*hPYxiZ0?pPv_Vkc-+8_P z(8i)r2$DS^bt(1~&4(yXnIbVgl}1E5O%{4K1j#2kEf}6j*g0uLI%!sLpH&{`a!9>` zn=IBK8cQsZL8@I=BFUAg!(ExUOwXO943Rrg+JT9%V;rZ+XttqF1=s5rrT=?|VJ^oz z#h$6)#&`m9QZ&;zv6PkIh$F>391-w2QduNlES5?I6F35dFM<(1%op zZKHioTK%X98*U{nc9Jr4Jbtk>D$B0may^0CJ}vt)S=s`bZ7u9*im(&2!2C!A?#f7y zx7k>-tVZwB^f*iy2@_$q+h{v}mv)v6%1+rbsBS{Gsk;qKpNU4(7Q4&!noM1Ww%Oyd zX#_1uyR@|Fax4U_C2Uld6({1d>8*_JYWH^1(0(`_Jb5(TuAOj_-I#eaJ~MAB_)bVp z?-h-;5}2K`>L|*n^kvz!R)n0`SZ`Kw#wC+xJ>{^Cm&2e*`+2u}BUG53P}2D*;UOYA z8Fl<9R7~e1KLUxOv(nFrZzkYFL+MFF4(LOGpdthncJSdh6ZApXj~=sQZ{@{*uAd)0 zjv6Sd39~Cn6P8ZE7IV5BZXfiU*_KskEM=su^s)%0P!4xB>}Tc8G&J69vtwqQh*v4; zfk=|nqXt4C6$&sZPaK6s@uVUV#!Ex=BA!?rMes!;L?+P-ybv`SfAdbRRTQ4(sTSI` zud(PUoOa*7EWN=XL@+7NLnMMU9-mK0crsyB8V?uq1sH(|B?fU?Yal;oodSJiCF#D0 z8U5yX_M)eQiP9v9Okfc6B%(AaPlAaMo=i%Ih>{5q0l}v?Clj}Z=)z5>P-@afXKRjM z7Sp-x?QBWJf{vrD3M1+5P!`N;BRut|;I1|5fQyzp~4tE%B zUsjuCiy7JZINuI|&%d8}_c0t9gqf+le6GB+x_4ru40Z=*C1TR)40)T%_j&DT2D+ES zo_m3j{2v^I4a@#@$MAMl^(&46>`?!|V`$G}JOeYQ6M7}wn!v3CZ+CLO^Xynzt<~DO z66Kzo6G~Sxol%&#diZj<(^z|C-~1F$H5#+L^Q8iW{=j_CZ;PqF8Z@2BZ0fHDP1`M} zn@PKp?x)^`0>ge*o;#?oy(iHRdxTOV77OXl1rCE2(?};_Oi__^AGUe=i8!jo22^xu zIMdIN2I39oHS|-o82XON@3G8VgT7Jvp^tvvgxelCJC$c!7yB*$wD0J*^a}W5g8)F7 zMHUw`A3)3E0)Q}!EG}j~fR@Dt0AUtcT+Dm`EsF~P!Ys15nE3!&78d}7S!8iB^8vIh zE&vF#$l_w=187-X01#%8#l_4A(6YDyAj~3*iS{4@ogjr;9G4lbmEG_^Dv&iCN<^yP1TmTSe zk;TQ#2hg&(03ggFi;I~Lpk;9ZK$t}q7c(C~%i;onFpDfMWT<<}Udnp9HenVd$LQob0L67Fq zFOP13pkdUy)KgO+C~$wgDn{qL_GE*`I3jL{`}oy4={NV5jY!Ik-g+TLSKc`4tSz`i z3-`%QC~$2ZS~RXCWbo{WQ>EpquyyLj&$n3eMr zc)e`Yg2_+rRfU#L9(-!SjVt;y!*l+Ved}mb<0h#K|2`*t#kQHf8>1JFnepzms@_$Z zRq_7}c+Nw1p1Hf?%ZbBuhm)#?SgOZ<9Mg2zeL43lL%&cHbhUr2DevUKpomLDLmn3g z=aIS2V;5ug2cD7t^7^|`eKX^>ZwpQS?D*1q%dR|^n6uFbo0cObx`-i{YeK8Hmd`zT z@^1a^KV9M0{^05pn_oC_!%G*_aQxm z^>w=Ly-aldCN~of^#z58`av|9o~+5H;!gl~>weetkp361?H?zJb-wJF8Rw zG3&=c6-D2qJ}q3lM9mGqe}B)JfO5$F<|SRJcZ#*R2aXIQj#A zWi{_=Lglia`BQdWIdpSl(&ZONuYHA|o_!!XyJWTTSoOh&r)PCP)OA$+WC_cWCLbj zco9^fm5slb9Gy76!0b3bVQt_AC}DhZf~?<%JqmM&AU)L4uwvAlX z+{o$ep8IoBz`pg?^J6!?(mcCVS4!Q?3)&1#c{%Gq=^CR@Hp_wb@7KKj@SLfS8;dR~ zdX>)_+ZbrxpFe+W-GFn=-02O=1DpTg-m|`D+nf9^wYM(aY5umx?ih`76;-C< z?+D(TbJ*RBM|!S_C?2eQFn7_o{)Z;SE6!zB?9%SueDmz^x`t=r>)inv&~SIq)|ShP e0WY5gK*qnmNqV__E#`TNJ3cN^wQusgy#E5Awd?2r diff --git a/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/selected/pointer_180.png b/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/selected/pointer_180.png old mode 100644 new mode 100755 index 2c9cc913394f20e7c38c0527dc860abc57f83be9..8a4f9a333b894d767b387fbd4f03a79a99e9aa0d GIT binary patch delta 1334 zcmV-61*trbDM}(1$%}y9aT|#?(=^ zhwW~RA~cTLhKQszq0TnRO_SW4o4fw@uq5QRX?t6nG}Zjzz&U@v^Sg)hIlps$=XWk6 zBD@Gx@WfB^vQ1?q7C19L~B->+vZT?Io90JyaT64~~xY`gp5s|hZvTX#6r#fm zB301!3S&&i7~>dY4#wC^j4>Bu%+=G=)0(Si^^UAvSr>o#na?O=Ob@^Ufa7`oeYe|v z&}Oq8G8&CdOKmfm%(Nf~{N&{1&z+r}cL1aSED+JZB`1BB3-Dz!e7-?J5QKC( zO^TwZ%EZLPGMy~TBnX1w^Z5q7UT-S^OR2N1jRNWc>>eE*?Ty7^f}$vtNF-=(ZcY0wbk@U2o)b1OkCejg5`n z!C(;aczkJKTJ{0Qam50ds+~@!@%Zs$xLmGop67p00B~&C^}-mljE;^Tb-Uf&dc7Wv zjg6Rl)`YZ3%9T5b&@1OlB8AZdC1$>!RZ<5JC3OIcDuce=lN~`JIV%{T~)5Rx%tCn zG6_Xd)Mv1x6C@@P|Lz-*n1b1ChS_WefEDW`rn2@)a2=h?C#BP&rKRPw%>>mFX*r(f zKb2*fqR}XY!{MS)^XcXD^knc1Wfqo4Syg|;U5L|@!87#q^7*3uu~>{|XJ<(iMH(6! zdINyDTv6BTcDoPibUIip7C4>GqS4jf+Xn!czjzi(xadO}N_ZOc7tgBfi+R&(wZdpL z;_%_a?*XVO*BLe1Y_>ydZt+?U_TD}$iYY{{U4Z=Pp{ieg^bnD27qBR%VDIe%tL1-+ zj>B;rOeWL+cbUWS3IJ1Cl6uCNE167&YHGACtP-9^(QT$`J!6^x7=6?h; zb8vjr4}+^o(^!%up{}mZO+?{m1>N+&fCg6+EXPjbuiauTWXegT66^gB;4VVb1+iOTF zmBP%-Oup^$c*^(iW{kNMMG0+W@E?A<1Aia@&)&Uw`>i)O<_UvgQ_iR+&_p5;%3b#5 zl+6rATF$5(3VMrT sXce>yS_Q3wRza(vRnRJE6?ALmKgXAyo*CrT5&!@I07*qoM6N<$fjNv$svuOVwH2%aS_@dw?M@ONalkpA)9%@SX3l}+{=UC^ z?{7Z8dw-dKW?M+`lF8O{tN{R+92npmihuI)Kh{J`{Yd9|Km5Z=9T2Gn0Gk>5zi~kB zzS#i4yN`$?un18QUxq5(Byv;=yXll_d^P|G7V6Xz*%}z5N#S@zmxfea$ zUBncrec%KnAVmW&PYD*wQr5_La{5A{wLr(m11MokLenV~DlK2#JAjD=sJU)lRXEJGn z7hPzLe-mirar{tU|G{*)M2#V+il&b%k)ny17oDz8G<*%-mr^~PNTnTQhf@S~5;X|9F~PB% zza;!t9LKtQ42c`roaZ9xl^3oZ)*&x&(G@G33d2$LkSV!1Tnc(j zCUN94ejKV%N-!a!l*GfJS`{wswXGSPL!GfahGLe^k5!mx>#{uk7Eyf4Qe_F$ohyF1%m01}6Z9wCShRz&zB_&KcA zpC|74$!+i<3S&A(nmFP>MjTCqK}X|OnLL&mdeAtEKlI_xo8a&R=cx7^KE?jZFC%yK zS4JhoqLL7Rked`Pay|r=!bJc=Zc@0&`4ChJ7Xb*lN#P>rLr^JP1R&%lg^QdIL8WjJ zfRLLME^~~ zQn<+Z5L5~m0SLKC;UeclP$^slAmk>6i<}QZrEn2|ked`Pay|r=!bJc=Zc@0&`4ChJ z7Xb*lN#P>rLr^JP1R&%lDK6`gS2$r6{@!LX{(|N&_YR)HU+$#I0zyRqkm3XYX&C_U z`ycq{T>waA0>Ce^_{*c&0APn^t~%=v02YOTzTRS8>;3FiK`X-S&n@g|5;eLH*3dZ<2Tp8xH7PE*AfzA%&uv2C`cLa8l5x{&4E zlfH+tOG=iOPRzAz)!6j+ebnYK*CoPbSKXQ9JoKas^+NE*3za4?-uTu`9|7Xewj^O<^|Xs zKg-=eUf67&u&Zp@%2Q74`GMa?MMoA)eqh&lU{+4)l81Rbfi4W(p8wP0QyBl% zTyJb_EJUJ;>VICnvZe9FQAu<&7+sarB~48ou&4!WuiG8ZKi2lG?PAxv3$np!6FL3; z{d1cW*VA)?tlP>ue!p52{^%FidfUq4WxwIdRCBX$uG=LpzrAAD50j3ViTitdt7q>% z_nM+@R%P*yl9G~5i)1C)ThB_rDpNv2p@T5F`}-M-dP7r6-pZSj*ZrjT-oc#Dc-+T# z?;;S3MR%=_nvP+Z_@~RKklY_HW-UM&7FE;ptV8UqH>XUli{LofU30SC_GRVSP(jwx zZ6PjKs%GC$NiV)r8#2>+v+&n}XZvrdXGb@8)L1yJN~o`|e+0*b*=_%ukB`rlt5*{( zGfsD;6|N{*Wmi~v3cn8bb+sk8-crX#&T<@Ib7FnRjf7nPdA5;R{H2+`B9SO&VS#x2 z$@m7LrnB*1J?RC#;v0+O#8&2J19dpAhnxgj$itU z9_75U(=XeyyR7eN+KC{o_R$_`#zz(zr-S#_e>%?hP?I2{>uy~@ihWAzkz-em96M%_ zS61dxqsVD&%g8_1bU?VzPO*CR_L36Fe#(;DcfUK_)8O#>j`6Mf`f#xp9^9Rqn=80# zex#efy|BQ_ql@=0bMl581D+eJ)?JCT>K?cy2(9?IFud}ud(SL- zvx1x-rc{^Pyz0-rVNn*<6aSk{uesDl%&*I5Ozc}P(sgp5zR@H9qi*-jFsHIN!uKvJEG%xD6FnW%Xf*jpk3Q&f zb&QMM^;^xe%B;T!M9yCqdv?|#v8Vli8hiTZM(*+yFTI&%QI;JT9+r9hu+3bt^9Qfm zPuVyze|uJ?rtjp1ig8c&n0>N%>m|m7XJF2yKh7-8b856ruqri=GGnBFwCK$tv$Ej+ b!Eu1=WBzNcTOQ`>-`@}P3-&Eu9J}ei6K(u@ diff --git a/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/selected/pointer_360.png b/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/selected/pointer_360.png old mode 100644 new mode 100755 index db13dc1a26e921c3effe5ffa31b398a1953c461f..c2f0933d84dd10bc70974976b70534712cbd87d1 GIT binary patch delta 1745 zcmV;?1}^!(g8}FbkSu=^000XT0n*)m`~Uz3nn^@KRA}DqnoVpIM-<2ZyNN&6Cc!a* zgoKZ(kTkTkT&ng$)m-R-Ln)#a0UC)DQd=rGH$c zfU2fBv{obxB{Z>xVu#=uyxFYx!@F_z^}sr^iIdogZ5i4pjWmC=^LA!`o;Ppa%$Ok} z{1>FQnm?}bM#Fmm&H>n$_4pQmbC2Jd{kfR7*eZrR2jJRMkTA>F%=&_bsYcT^NAg+$ zs)q|5*=ilpWk>5+%W-_U_v=;lo)yr2%Rzpz_bdFt53i{AOn^4tXm}x$|8nowIM#AJ z2lCT9pI~VEN?w2c6@`eZE^YF=Xp`SXr*D5uL_|Xmt`HH?>DwPurY@5TZL?aJms4-86V+UXZU@@bv>>ttqkOnXh zKqI15B_pHS62P$loB*7cFJFFj|Ni~&yWQ@Wtyb%6wY7h>^%=c%IxXtD9^`rc?(p#N zj|{`y1|S2FiO5)CWPdKnD6Gdjnt;tCBO_-Li9|%xG)kw_IqB}*yGx#FnnsC4A~G^E zat1&%0B5;9`C0*40F6GM??@t%i0Habx~`KXNd`!D2hw;1VLD$r|UX}LLqOtV2cH93P7qn=@yB|75OZvg;x?|uk|bFBX3stS_7`~U!`KYA*!jx5XK#*G_a z0uWy=peVKJ+Wmh2L5}0<#{rgQv1Q8^*ld3`uUx zj{eia^E^_iCt+|$N5=sG)=GieoKEK}rWu3dxcny0Ip8{Z7KW;Tzcc_nJeE_hhsVHQ z8i1iHaGgB6tcknbZZtGBfMr>j{n|>h;V58^w#c&lz-B9~zw~qj{G|arRCQdnZpDAB ztf0Z^z)}4nwsKauKl%){EjtQoOVczsoz7Mwny$$5Qq*>+We4gGoq#u8hgtc_e4UjQ zc++*LJ9MI8$WlvLHs0LpZ$Y5krUhc5y!cA>UrCIQk1yu8ZQBNiW94OpQCs)#;#fbFfV%X;gTM3SV4%jJ55h-NA=N9Sc(zO$ye%5iAly?afNW^{DN zJY%YeGtwp}CvRj&F69(K5TL3m0Kn{5s}yKzaB$Es%d#knBI5Bl(&=>BKy80E8x%!> zEX(5H;GiEssv>jLoTsjEIDDz4rKO8yS=7|j6y%}X+uN7TuO^d|lippsc6~%dLM7MH zWN&Zpd0p4VY)Hc}AW70v6G){NFIwtQVz&9UrCsk zNKJu2pg);R3hOc3WHKq3hu2L2ELC+Sku_&s9*^hEa5y}a?>b_oBuNs5!{H&1$MYrt zS2?dE)&-gcYy;5P)z#H8Iy%}Pi^YZ|NusAu@>NwONs=fQiw%#Cj`nwTb#<8cEw)Ph zU7%$5qvjc`9RLTw>hVcra;66LB$S=fG8Gh zpr5W$P(ei(>;){KqN}1PE*$|8kyZ4Ygce7f<2k$E`Tm(XCnWdXckg}g_wKzj{|xK> zW=uEG|3x2z!5DaXGW?-$I`kpw>8eI*Zg@angTi3-5J&)tgokF}rOSjemI5!7PUv#d z2&70E=>P|lFz44K0;OD2*8ibUZqU0LSWgAnWPuFfi~qJFXpp%Vyyn$aX9|i9)90*;IQfoUDK0*ysdLu4{F&A)NY z5OL(HYJpsLH5RUj1G(>87R#Q^=CC;&Jb_B$;E6<#il^B*u<;xUk;DR7c2pjP-4jT| z**Ae^O88LUV})zXQSF5b1tW7Dctkdjh9{Guj>2V=?eQ#o9v4rgfdn?sfd$fNU{8pC z+*kY z>TNC@Re6A1C*Z5mzGd}VcAN3PJQ;0fG&Wj z`rB=)sfL>dBb#cf;ii3-K|;RF1?s2jg~En4tW; z1sFb;!H4>=RMk%?4&63zMZbo@8io)MbuhJ|hN9cB>!>sy%hWa4H3~iSLC>2&?*r#I z<=NZC{>>kKJNh@h!hE4YU_g*X6c;idm=?ta1A;7~xRCk4v?wkZ5M&X>h0F)0MRCD^ zAd4t2WIix0iVFq=SwwLm^MPqmTreQWB8m%{4@`^Vf&oDmQC!G;U|JLx3<$D_;zH&F z)1tUwK#)Zg7cw817R3bvf-IuAkomy0C@vTfWD&)M%m=1LalwEfizqH+J}@nc3kC#P zL~$YWfoV}(Fd)bxiVK+!OpD@z0YMf~T*!Q2S`-%y2(pOcLgoY0qPSo{kVO<1G9Q>0 z#RUU`ETXuO`M|U&E*KDG5ygef2c|`F!GIu(h`99oUf~3V(0iMa&CdwRxiCu-kbbNunYcUu(0fVVq0=+!C9fKJy+Pe7aGz?}C(~B`RQ1PT;$3ou) z*GI(`>?q1{EzFq`evAZt!y92zB_wRr&aToSMLFB zn(6%(`s8KVp9iH_4)RL<)B&jy4YwX1=dl@&jc07G4-GwE@G>Z^SsIns@E#otdHk> z0FygYKc3BPc8!rY+C0x8O&l4&AzZ$3ktMKHTK;Ku#?a2~ArUT@nPIDwzeMleKpJMg zf1+LFpr*_b*?Ww2%~orRF;7Ux1=xKl-ZsJ0I|~n`Z&{r@9%9`wjqO?PoH(a z_LqV2IX686%Rvh+E;;eC;^L~!bAo~z=N++kb#;wtd3CkOZQTg0J|o4SO3*UN392h6 z9rKlX8JjV9XLz4KPpEjiW^SOKnU)AU{IK)VS6A}t>g!k3v?wARO%i{fVQIKOD{Ion zU7iyOOzFF-+dB(r^1276%cG(u#fcv-e;ybmZMLgex>r|E+f@5dTtRvL9lgv4)iYv; z93E$4;v^WeX2j;}K@&&Ly2&L02E&HEn8i!a+HjS9i!hWU7B`dqhMXxY-F)|9HD$_d z-BlN_XJuurdDWuGZB0&2)``1QTzoh_UMJOeQjpX5IROCy?iZId6ZcB)#}4@8&6_ty zmkFCPF>6?d8Mvf55tY{x9H+<^7P#Lf3_XyapRdy_aIo~-7H48=I%jN{a(epi-9hJ+ zYww=`jdk@M2E-Nq;b$qc-r;*BJDb>c^ZJ(sqaSC#G?RD!El>5F7-(sDZj|1@_gaZ< zy7(LQ`ewNan>Kw?LKh`~+Hp}QaB_UXUw={@FV(sh_&6DbRNH5G+X~#YR{|M_9&*3Fe>vWqvy+(GYx?At<>>WZ?RgRVpfESL`}(V zdNXHDjoSbLNRv1wC%x4^W*L^$+_WMgr})w~yCUCuz&~bhYG&K7>C*xN?)yyfD47yJ zJaGx(aYbuK`k_OIO60o(C#N2&jQ%|4{WBYB$l{_)>A7w*59ZuF6=WoN(-8JpdQy?$ zn%j^r3^sDfI8GZglzK2P#UuOhp<~C6mA@39i2fL{YlcNpa9Mk2C8l^!E&J6qz5CgQ zQEuRUna$NJ2_txSWq;KIsb|m9_Lo?uXO)zdmF-D%G1Pf53tCZ1uB|X{`Ld#XXT@d{ z3lNWcPG4_wcI%59H%48VZ{ZcZ5gML;Car0OTuuoJ3i7n_%F7oTT{!w^lv~3l2CmXJ zE$rb2UZquW_Rf^g@8#?gOH<1D!Xqt}KQWuHG%xnEwQm_sZ+Y;r)vvZrY4%Hk|Dr{I z_*k{^XI_a?yqKXywtPmn&~(aN=d>bB_Fd za#|X38$W$hLIRjkUthm*$mC3J)AI|F#~HDP8Nu?Il`%?#FBTtTW>$XQrD)WDQ(k#9 z%))5nsL`kHtvWmXXGUpO^qb{Cb4g~w&!=q`2<;aOK1c0Yw6FR#d*!tWNjJ>XiXNV? z8@IuI*0mpw4cpRgoKtb;P1GXe2)P`8 zfoiiM{DVjHwt?lvxQ>-KwC@etJ8X(+tWY1i&pv9O+3Bt{X;A%(1uu^o45izWmH!1d CJ=gF6 diff --git a/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/selected/ring.png b/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/selected/ring.png old mode 100644 new mode 100755 index 88a25aa89839fd60b05ba583406ba73cba751819..2a89fb345485c154afc2d72cc836132901fb3d57 GIT binary patch delta 1379 zcmV-p1)Tcog8}^tkSu=^000XT0n*)m`~Uz2FG)l}RA}DqT5m`jXBhwGl8Z^SjS}NO zMB8If6j^MMF~QA_(SDj>K`51eD76UfT-isVFw#%$#sOaUZw!pqRdG#8RPfy z?7C&fGPpR`$G7W77Jof@E(7wqQqiDl!LW4NYX@*fB0Q%eOlC$f+%TJOePmFwA7SZdyu!c8t2a-}`mVo}ho$C^a7kG@hAT48z=0HPG(y z`MS4j^k6J|Ndk>!`2xc*@AeAlj&rngY~jYlvSDO9kP59Hz@)?BXjB!@j!}2_gxAm> z2x~McT#Fe%zr*3Upo-A#99y_C;Wf0&&6ge4;uNFDF^dis#Ij*TiphKvg^M;Lj#-q6EuQD$cDo^pqSQ1CpgNT~n^fq&U84u3 zKpromVgE8mF-QO~7z`*aEk$;AwpxRFzS*|SBj!gSXd|r zwmy~lsu<{dzphy-TwAJ*yIzFVYK2ZG84cg373hE6=L=`0#K1+HaYsx_F;eLc8J=qfhy>&TKYI4WCRKP^nEQo=qnk zLhm$(p*H~lz|fljdZ#%IyVjqV!>%BDr#U#;(8hec8I49c)s#627%K*xYzRM(`(UCq z8=!ywcpZR=)}U{Ohm#GVZ-$38o5Jsro3ZE%CtOozLrTwP)bfbkR?7}M|7Y#5IRVa< z5VC0v>dW=;3k0v0)d|FKue)u8> z<+)lMF>6toufwn_h)SytL$3qs0NV47d1Zgw(xY4tpFq$z!=t`TkERL(d;&q&-+q*v zwWukkVKq^x%-7)^8$wfs0p(^bUM-5KDW=s^c(*)a6P$kf`p~94^$P?(fxv2_B+q00 zqPe{24{w?mMG-DnVsD6H7)@G2x5ywSusZA6EXGZ=X49hM&tu0o6j9tf$8mB+d3t|x zG*2H+=$$@wq<#}&SypQJS=xXero&zFW3JUu0;{_*p6BIi)Pb}CZLKYQXwiof;_A04 z4xG6A=2|!$hTH9yY@Vg6Q>ggyQfd+t-UTfA!|0jhcD;zj#YMRS{8mOf4A=hjc;#x+ zmg?jy8BQeVndA`S*U(V1maqvi40C@nRX~#x3`cW>hAb-a&b*ixU>{jaDraXsBJ3k; zcrhc5Ec2#KIt91pJPUP`7rNVfpmPHYAB9Fhh7a(`cXw;Oxl2D?&j^C+|^oJ_z-C_&3^eW lAccKm2S5*i9spIh{Rgsl=&Sydc%c9Q002ovPDHLkV1kB4pf~^k literal 16874 zcmeI4dpuP68^=c}#jmuo5~*oQmW;WW!AxV6Tam#sl}PQFIXH}&F&8uGM@S{8Q1Bg^Xm25{k?wwoZ~f@=lgs=&vVZE`#j${ z{~XEQo=c}_8);)Om?>_{oPD5AI`kq>ny4Ci{HqJ}F1wFHCFnXY~X88EFw$f z1cZXiqQ!u3v?rSz9nPika1KmuhJp?ShybJHw~||13B@4<5{*V95Xl5G84u0COV$gd90gt= znKu|@IF2(Q;fg_#6ch@us<@mWp-gIz!>JOD97ER?AsR^}kPNYdC=wJL5rJeyB#b5E zaYr;FnV3ItYCJ9h-~$nWKq`TBq%n1(P@z;P2^D@K<%s)}iJ>)Nu|{%_dA<=5W2Tl! zU7{caLrBL|O4#c~0Ko^42xVd};1UI0%Dl0zUJ3?}F3ty$RGv?sJD>nRAyatr4OAN4 zO(2nS1YE$)nF$S8fgq30vmsIJI7B-DAh7h0#)mJwJL^cd0=Pr1tLEj9d_`+fgMW35laA7|Jmb)8*pSx8`-f` znt?v1bGWL#jmcHD2f$+xJ{TQ6tr6vr4E%UGKM%oRd^P!}bI3yh0aAMnh8mdl=^zqe zuvE?w14}}n3i+JQAB_5;3?80AQ2iG0!T-TRNH|e{Zy7$XtNz9^z;~$s-!hC=F*lSW z2myFZ!f*i(4}9Lr4X)>hoi*I8A9o@{_2Wc`x)`b`&OrB&7=(|;Ml%o2_fvHvUp6q` zmP~{W0!j5gBvp6ArK^#p>TbAnRJlR`N}1%LY_MT9mFgFCaC`TKZuS7C4V7vQ?OgC- zxWXG$0DM1Z5ZZ?&s{Mp&H>80(#uTnr6GA`+k_`ye97DpvrBb^s8|cBoQRt=*y5A&> z+;D!>o+G>1Klx?!ivG!{uvlmk7!YI=#f8iV=0$PAfFPSFE@VD1FNzBW1ldG!A@hNG zQCu(}$R>&lnGej1;(`G|Hc?#2d|+M_7YqopiQ+=$1M{M|U_g*f6c;idm>0zb1A=U# zxRCk4yeKXh5M&d@h0F)$MRCD^Ae$&IWIix2iVFq=*+g+6^MQF$TreQWCW;H056p|= zf&oD`QC!G;U|tj#3<$D`;zH&F^P;$5K#)xo7cw817sUkwf^4F=komy8C@vTfWD~`O z%m?O0alwEfnqii^xUQ#dO))dJ1-Y{ zxD(4==EK5ZqD?WFO$iuG-+Sn@9fOe(F_?~Tpod5IU@$X;>FX}JVlY|?H|Hg6#qF+r z0et<&nN=Gf?QaS^`SZ(omd^ZdFD7H}7GRI~?_5^g?viU7m$$;=dQzVGk`o7YLEl7+ zupA37(0P4p);2aSti?OqLa#9Ip@!x|4O}6m+~sR09T%mW$?4Lr0!37C$kq0WuFF@A z#@Vz|4VVpK@~eBBg{8H92ZWX>q~CR~?CUmu9BXF$&O?JRzD0B8xH%eCn^tv}&HTe> zpYq^~A|pf0UqLZxjSdc&OpQAw-|PIk0aIXNN1Lo?K7aZ7e|CQcX*; z=Ek}A_gH(b!qw&{MFs8E%#o)Kd5H>0 z$n+8C7sz^7#@;x$b$f55{^UEio=*I6>D8yrI$EGt(OmB)+7Gh0G)v$`se{eMg~!(3 zy`4S%cy<2W3pY1P9$)B`%B0xsh8{qEfE3Hk?Ynl-C6;_PDMFWjui)*vwQpM+rBP?O zlNYA^A(4x}h_uzLC@;V8T{`z=3hlUY5pX|Q(tbJ0(-nBF-V(-ox zNB_y2*^S+=YH!YKe9>2$_GrB#Q%mF?{LQu)bEgmLzZXTH`trEB<;FF=W? z8*ldP0={vHd*HMOGaE}oJm!=p|62s*BWJ1_km#Y7als&_q}g2deVNK;|^r$ znNPzR)t4sq+NU%aW@iMkC&l?_*A{r^^?s8=D$Y0dm#?zgy@=6yP|NfFy8iwzOIBIv z?Bs|4e*9%`VA7S^@A)y76(QD>EpP6>T-d-qwqnaA+yn7mw#7}&F1x9jkLGSx1Ru6s zWLoExu)F`-+S8slHk-C>i@kDpyVdLV={mpW9JVoS45L2lV`M(s?yPZ0b49hQ$6wT>?uB~%z^2(Oll;!0W}Ey@ z*Hd@Rn1>514V}EabOQqep$ongX%hXsuC7jk*TSKYNyCmtmx{zkl+cT6)*JHH-YU8uD(2d6-Fz zxkqk>Z7-ZbSetUsF4a$avEju*K%f;&8*=^${G)a1#$F z6B85G$`e&@&IL@QKRo4m@sWMYy>MMKT%)qyAoIsFXUdoC1H?^6(Fel~8 z-hKQ-P3ei+Kgl${n-L!ay}Iiw%3rqM{YL2xrg#h#`fcU-4nO9t*~R)Px@+PyDQ`}{Bf54O2T*5^!yPUTp7m!*+;8#KG2qq(=j`8> zO>Et;>Y(V$+xS~&_4&HYS-O=@#iI9(Nk#@~2YLjXD*^))NloOlii^WW{!1?rg3l)L17d!abh ziFN0@S5@UsbLT8L^g8UY;I1!zeBhq8{mHp8S(cs#9y$NvH!xE)y+D~V69 z35wSb*gl;BD8 z2Co~k9|L|VJ=&JH!Oc!TlF!fz2K(X$FgG5Ou@j8&fl8luN)|L z_5O0#b>vGg3a%U7>o?49cbloS<$m|(&BEHK-wxSipPXXW`7qJ^D&X7Jn)&X|ytBp0 r{SW5k&41;Vq4mS)U);<08W^|zA74KQP5gfW#6Q>Q diff --git a/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/selected/slot.png b/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/selected/slot.png old mode 100644 new mode 100755 index 920cf6cc0b302c92b40187d5f803785f1c3a286a..4cb26a2e4c5a6003179fbb50c842ace5a9215d9f GIT binary patch delta 1272 zcmVYofMtF%vJ-p&47Qq*{-ji$NF*~__bdv>Eqy*G_*esD?7@0@>}oX`FK&N;txaww&E z6HLtH!Ick}wgBh_P^)v#0_a^h685Fimyp4by#Tx%Bv{$Y>XWvdOblJ7q&JDCt;s5z zsfs34t9{o|T(V!@wB2?AtxW{^t^GSpE=_FMZd-ts50}t+*5yctAv)_Dxs(DourgfdgJkRN-3qM?wzDso%ST#XQpm1vjA!}<&2cn zwR?S5-93eS@L=u1>$mE%!S`w91dx5HBn=sxFf1Gi_X21&2+vujfm8vFfU9??ogMotZe|?lh1*ZP_m%t>GY4ds zqCVHbovj%I`pwwFAM$GMyGC`zVqD#AQzwhWxGztj-s26G^8j!)5UhS4&uLv%g_cJV zv2jHe4A*}MQWTpz(_H@ED+f&knd*Eqn%AFvP=Jv?qj0^yaE%ah?3IBg3fHZKoYrS! zRUVGl7UJjMqp*vQ0l-BFxtMlP_jIW3*TsUL^uBz7(z?=U`&Jhb_jIW3$(s1%-golF zyMM3ai<*D5s=b7eyJ-bIGrAb&SJ#iq);~9ErIdeVxemZ@oO_%Q(!ABalTHB#rb1mj zq+N>o%-jx`axTu@B+GL8Kp#fLv;4wi#Wuj^#$bOgPQ&ll&Iq^ed%Kzf#Kk_`ZyM2C9w$nCILrmV+uWp+R5XZBr+81Fv`bl@S0- z0G59=5T{@Ho|TuJex;lF&H=dN^eb~tze1RAkokH0fh#v#4jNGfNnb7!dAp6`0 zV4ue!g`Iw-13(9W&j7dqoOAk>dH~%3dH{q0bTHo`0R0AkJI0l_6uLuc2Gka}1>zjxMJt|)I>?y4Jf4}ik} zG}RJW4^vuZPd$JcozfaG2qDXvbnu>GpY=NR!t4PH%X+P?$05lql)>h;TlcbL?&XA-NgEAgk+PZM6mLQvigu9bzwOgoW-9%aTgW1WkV` z1^jw=DWadJAHKcrGTL4|4k^5uFOl(WSvK^G{!)w(QfH~6HZiW~%d4vJzdg+eC|Sq^ zZTaowFUvz$%8du~Jm9P~s( zFa^dz2Y0rTqS#y-Ag`Hq1DNt0-OeW94Y4d} i7BmZ*1+Mu|2h z{Um82Qo5x=bi1XHN?i$|P)h1|#yXvJUcFxT{$9U-&dh6;=ll6S&vVZE`#j%s{yE!R zoEDANn5F>$z-R}1TUYp(34bV~ROKTLHx|M_>LPn@2>@tLkbjhbr2SI>fYHo#_mX-! zE@85Td_#~U^o0yV_#${V0GL^Xh(LBAB*pnc{#=1MzV%`u9>?XF<2`APBu9}A6u`9) z6GLucPVVfmKsJMew_s_Qg)rd&d`Jr7Lijv^gc)Lv?~TiZ|I3GocwFxkX`ngYN}dqs z<>-R55sD!k&5%Z5lPF}IF~g8dqZu1h3~&?@nMx#)iDV-JnZcw|nIsaf|Al91!2is| z96zS3tzCaQ*fPflNTnhsktmbN3}r@!La{%Q%wRBxBnpv2A;2>Tl2CyZ3?T?4KlB9| zh+_*$*kZ0o$`uN5^0=U{Fi2{S$IBB9zWUFLFB(iFko2>IDH20K5s_?2A`a)oVGsI< zg2cSuL*uZC5D(%*0;vS{BM<8*3J^+#k^td1QVz=BOboAyqvK%iVUL&3A2zi_x-b|< z(2sOjPl-4J{0YPvwW<&R)v(8(N$%BFU9+9y=7m{f3)d>2vEXg}xOs zgU^*|BZfe!Q0y)g@>qRU<}!c~XJgY_Rk*pHTmeTYlgu+CB3*{odng)Y3rZmtT#s}D zi3%5^JK2OugX@vJfMfz!r9zOtnTQyULJrq26d8j;V$vu~@)t1_W+G$2{lfvJ;CDq) zoU0Ir!)E#k#e7i8;_^X%h$s^Hn-PZw6=n`r71Kt@6N=%(f>=go#Nmb&ym~8*=^&6u zK>-_buw}smhFmU(Nh6Vbjg1+;1PB5lf-y+-BbY$O5WyER_N7uOWY7qr_d;}ZRCNC; zw5^aGB<~hDbl=9p5whX%Lx*KTp^)hm(1bvuQ#b@N8KM&yMkc-lHjPXHA<&5KNAn#> zq!8?@M9yL^yzhZLg*ozb;lRmAMidi}L}C!&Z(jn5P4y)(K#CE;m~2e-Wpn5xkOmE; z7$(eDsqDEDxLQLMsu-^2-kr@2`uWSz0fEQu-JwLFSOUrW&m2F{fP-7w;EpBt>Fr}C z$d>PIEVjHoAdVUFi_xLO8uaXU<9@xI--nZyAQFm>mEL{2>mD zI8eX?1K+oDee3yUXAN}g*PUo4zc?}BE`}=#?Cl=18S$&Jq0D{rz2x1<3+kP3Od-K9 zB3b_3@2V&xUA@s=6=kIBkmoW1SIVOFXG07tc*(DzecQVme6t6!=ro!U&5Vc~MtZn# zLm-})Ef?O0CG!1*X43D26oz&5R&a!Y^d{?dR1o?d`<6=Kwyd`Y`$plLKKOok7qatEqNf1ELO$--0AB2kGLI6QGF}M&`k^%Iv<3J;X(jGH!)o3d=M&z3jqY(#BibWL8urm1Q2u+!-dWV zp<=iYK+sJL7djt=is3>4K{qj6=zI_=h6@1%-NbOA^FgQ>E(8#C6T^kh2ccrP5J1pP z3>P{dgo@!p06{k~T!L#i+fOey479F75HB?&mEt(O?lT|s(tuTuKUejYmUF)`0Lh3o9I@Knwz}Z z4s%DwANDvjU)>_B&3fZVYL3Z4!ttFIyDRf%>zm=*S~>$$WWvY}!@P^vp46=}^;qw5 zxIp69lKj5DG?8IcbdJx`KD0xomeyh{j%8+PcWIE+x&V_=Jkf!dtNff+x-4o@DY|U1 zr)B1k;gh?jWkpg)+s{(6pC!5gjCZit^0u*c3x`J4j@|lj!iMpUeOCXOp zapgpk-NY68Z2#3s4XLpX)_72VtA2OfCR+m?8@seuwRGvzD@!_Ot1mUaW3|yQJLT_X zCETR5+nY{Lq0FytslIMn8T;lz9)~E6=t8G77+O?u%)&0m|^Nq4Gjq)Sf@|<>#AF8M2b$z$}7=b>v&x+>~8h2CLVmg{@wF{ zY2%*FAT4<$T%u-p)A|tcuJf(z-}T!{B8>Ge*VRJxcYaRE6wuy%OlxW@l=F=Z%*FP=)TstpM%iv6NGpn$9k9mCbSiJEn$*IUOCQQL3 z9qX-=uO7R<+G%b1O2-?U^)l?YZ`Ui?F!wk=;jBS+BGr3=0{Kk<&K@5Oe^nfQ}eUdFLJ>`6+wW{hSMpXYWXTx=lR`L+52SUl8VH?!U1Ai79PPPfw4Q zw)Xw|m6e~NQp@PEb!r#O7aewue){$%(PPdf+VUIwJ32Z_W#`5N1|>z*vX*Gg$%gZG z7uM31*OS+;eMKutQDce_@cE6=PCEk2xhsr1A6mZtKHMl)lNUCPJ^ z48CcV5P#m=<7|F-wn$Swx@^14gOhXr(urvD%iHJGNqAyyc#1o1GkDT~(O~J35!79; zwI;3l-fNYES?}jmXm-?FT7!~(39X}}%O)*4Kh9*5#=bb02U^U$${FDYKi+zkk(WuF z#|SXXP_B7T(XW1b>r%_d$75<9*ZSDnfM?VLMqE|ZBFng{?puP`4cVM+kX;nKN+W`%2w$P zS?ZCyVrG7{o{s96Y<~6blI5DZO@ABc1RdDJgn;7e={sin&wtj{8C>bpc|py2)a*t0 zxYMd-7RkH^oo`oJ9x1re0ORr~#uF}QzEx$r3F5>bjWu$ZzvrqnH(6FJdk3`55v3Mf zd7zRdd2u_vg${We-o6f1zs=&l`qX3-lT0?}eUCiOTb6e;_QOtI?W2Vwdg6+huSVNR_41w`$;vE$(d}xr>)lV6rc7N+Z?$f8 zwO*yS{cq}3U7Y)}@H&rbM+eK2d%S(77M#FaiwjK)(%e%Q{iYl0ayKVYrSZ4;jhV~c z!;e%YeR#irx5%6<7qoP>}p$cRMXOTJx*&YI1!fRR zj9feJL#k6EMc-}g6sqZYZMLRHMLwtMmXG%bJKmgm^DXm6h1&-v)xS+yV|sq{GubKA nxP^6Wd_wA%@AJDpYXRxZ>C;LtL|=t3iGagGC)-SGpI`n9WeB9; diff --git a/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/slot.png b/designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/slot.png old mode 100644 new mode 100755 index e900e4ba89c965974e2b23c8944675ccfd31f4ed..6dc29a8dfaa09c659d7260185619798302707fec GIT binary patch delta 1233 zcmV;?1TOp82>J<-Ie)B4L_t(&-tCxAOdCfO#y_@eAP#7uv4SfF8BhP5kRWobl9C7x z$<0#np`|@kisA@y#EKLwVj}K;!Xvm-@HU>4eQ@dku1ZeI1e{>5i|(HCoWZNsYXk<%Ub zst)w#{b%9d<)$GcAE;Z%M*L@wd#eWY+Xd-QamVtZUSBJpS58=!hb??Q(#RFU7yIlR z0B|RkaJRZ za^bCk7Jm!Z!-SkVXMblSF7_P3Pk&_5&HoJmenQBtih~B1lf%DmHvg#gHF1SPZ+rIZ z!)_wM<>c@`FZmx%e$d1}{&yGObUjzQP7*>MR}}Q>{AP;XT|Ygx`;}2Ur6`KM0DfcK zi-eHD!_HlD2{^r!9AhE7g>1ygbU>B!GwuOV6n`rR`Xs|&V>cc%(g0nPiw8ZW918Sy zEOCZav(u_fR`AYfKorF;(?QcY?lPMv*%ac7%I&_W+|K&gx%7NGsxAQ7VBABdgUUIs zPuo6WRUT>{+~tePa{#sgY^fl=sQevmZ~3C~IQ3lz@W>aH*L+c#P~Qyov-UmH9yA>^ zqknLMw%x+#wFllA`h5z(sgOrV`J(a&fDr&+0tf=Q?u*JU0OJ4x08#)(sP7zrDV=}2 zz_bq)x+NXc*rQe>R|r!z&H*6Q{RqH{FDjqc_~x|{NdeW+O;PYE0ONG7`H)8l(0(>| z_L#0HYijMPdFTLu^8i%UidldvEz*w*z<-KHX%!fRknL(Zc(2fJmqxu5{eXt0OC1~X z2qFz-&~+WuyeyGAcdHreE~XF-N3#8K(u@Ju3s;`ggioOKVLCp$I@!(7wx4OA*9z-MSrb) zUe>mE6z+|jrUz6iWRbCKI{C}=&=oBCn6~{i!}nLBe}_R!jcIYn771@zYDm zF|!D1*g6<@#B|V0ef9_TW@US?BH!d%caacce(35I@rhl&?dJVwVH4CG12ACp>7{<~ z)-%UZWt8=8yx^w|6jbki$dJ9DEK1Ok(;fG^g=_?sGrtk{MF*;k{AZ7QNlR|60+4r& vx&bVEjn=Ypct@-bS_iFz)VB01>5QoMJ00000NkvXXu0mjf76xPg delta 1071 zcmV+~1kn5X3E2pcIe!aDL_t(&-tC!BXcJi+$G;t4+8SG?UByPQMBc8R3Ra>Rtzr*) z3)miZ>mC-wk4oFg_>NG?{6{`N0r=zxVR;KJ)v%_xrt2fvm`9a=63XOx2A&#HpB@L|J7WBca%|KGcbrid;r(d^PLpZ0t1TQ!$DD{9@y zbb8=jo( z*b}9prb^hiwOq&ZPSuE`K!MHrg75VzIL||7)e2NOUIM z_v$^lwP#xcdHgzu-*)_`H|?R6KDHI~?8HKb-(B}_&Yh^%PMJ(5y8-;knWreF-L_Rm zk?HgR57{B+0vO<|{gxPty!Rg(WgJxAhH0n)6iyPDt z_PH0p-dI4)NU{ZrR5){-{+i z6vvo1jsl>}{0P9TBrC@Zwh3cIGC)0aGYotPz#toIA{G$CtewxDyKO&s>$R(4(qRC{ z0O(#TC1K|2Bzt@SW(}U!fk7!zOjIqWT6bUuA_#RmE>OD z`hQ=gTu-FD0Kg`$dubfNXe=NO#R6iKL5#4rFzc&tU_S$(tnVm$N#iVZM_HBBQt3R) zE&+f4V=-%7r~7`$h0M}REFfl9vy~FQuSq%hH>I@GQjfZcrWo}VRroBYnE`z*WQo3f zI{DY~&=p-;!l=KpZFf4vd>r;kXs!1}6<0=~!&`f4Q(?{q$eWei09Ld{zbG|v p{vUNf9Z(0<0d+tfPzQ8X`3R82%=B--MP~p2002ovPDHLkV1h@O8;1Y@ From c1c7e06f284f08e8e588779af92b01a7ef41bd10 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 8 May 2020 18:11:31 +0800 Subject: [PATCH 299/375] =?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/mainframe/JTemplate.java | 7 +--- .../template/info/TemplateOperate.java | 20 +++++++++ .../template/info/TemplateProcessInfo.java | 6 +-- .../design/form/util/FormDesignerUtils.java | 6 ++- .../java/com/fr/design/mainframe/JForm.java | 17 ++------ .../template/info/ComponentCreateOperate.java | 36 ++++++++++++++++ .../template/info/ComponentDeleteOperate.java | 29 +++++++++++++ ...ProcessInfo.java => ComponentOperate.java} | 41 ++++++------------- .../template/info/JFormProcessInfo.java | 33 ++++++++++----- ...t.java => ComponentCreateOperateTest.java} | 15 ++++--- .../template/info/JFormProcessInfoTest.java | 4 +- .../template/info/JWorkBookProcessInfo.java | 5 +++ 12 files changed, 145 insertions(+), 74 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateOperate.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentCreateOperate.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentDeleteOperate.java rename designer-form/src/main/java/com/fr/design/mainframe/template/info/{ComponentProcessInfo.java => ComponentOperate.java} (63%) rename designer-form/src/test/java/com/fr/design/mainframe/template/info/{ComponentProcessInfoTest.java => ComponentCreateOperateTest.java} (52%) 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 b780f5be0..db72357a3 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 @@ -38,6 +38,7 @@ 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.template.info.TemplateInfoCollector; +import com.fr.design.mainframe.template.info.TemplateOperate; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.template.info.TimeConsumeTimer; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; @@ -1262,11 +1263,7 @@ public abstract class JTemplate> template.setTemplateID(templateId); } - public void addWidgetProcessInfo(Widget widget) { - - } - - public void removeWidgetProcessInfo(Widget widget) { + public void updateTemplateOperationInfo(TemplateOperate operateInfo) { } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateOperate.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateOperate.java new file mode 100644 index 000000000..5c2cfb071 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateOperate.java @@ -0,0 +1,20 @@ +package com.fr.design.mainframe.template.info; + +import com.fr.json.JSONObject; + +/** + * Created by kerry on 2020-05-08 + */ +public interface TemplateOperate { + /** + * 获取模板操作类型 + * @return 操作类型 + */ + String getOperateType(); + + /** + * 将模板操作信息转换成json格式 + * @return jsonObject + */ + JSONObject toJSONObject(); +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java index eb1404ab0..fc1defcdf 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java @@ -4,7 +4,6 @@ import com.fr.base.Style; import com.fr.base.io.BaseBook; import com.fr.chart.chartattr.ChartCollection; import com.fr.chartx.attr.ChartProvider; -import com.fr.form.ui.Widget; import com.fr.json.JSONArray; /** @@ -46,12 +45,9 @@ public abstract class TemplateProcessInfo { //获取组件信息 public abstract JSONArray getComponentsInfo(); - public void addComponentCreateInfo(Widget widget) { - } - public void addComponentRemoveInfo(Widget widget) { + public abstract void updateTemplateOperationInfo(TemplateOperate templateOption); - } protected boolean isTestCell(Object value, Style style) { if (value instanceof ChartCollection && isTestChartCollection((ChartCollection) value)) { diff --git a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java index d5dad2e89..d6931db5e 100644 --- a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java +++ b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java @@ -3,6 +3,8 @@ package com.fr.design.form.util; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.template.info.ComponentCreateOperate; +import com.fr.design.mainframe.template.info.ComponentDeleteOperate; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WFitLayout; @@ -32,12 +34,12 @@ public class FormDesignerUtils { public static void addWidgetProcessInfo(Widget widget) { JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - jTemplate.addWidgetProcessInfo(widget); + jTemplate.updateTemplateOperationInfo(new ComponentCreateOperate(widget)); } public static void removeWidgetProcessInfo(Widget widget) { JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - jTemplate.removeWidgetProcessInfo(widget); + jTemplate.updateTemplateOperationInfo(new ComponentDeleteOperate(widget)); } } 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 8ca0252b9..01c70cb28 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 @@ -45,6 +45,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.template.info.JFormProcessInfo; +import com.fr.design.mainframe.template.info.TemplateOperate; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.toolbar.ToolBarMenuDock; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; @@ -105,7 +106,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Set; -import java.util.UUID; public class JForm extends JTemplate implements BaseJForm { private static final String FORM_CARD = "FORM"; @@ -214,25 +214,14 @@ public class JForm extends JTemplate implements BaseJForm getProcessInfo() { - if (processInfo == null) { - processInfo = new JFormProcessInfo(template); - } return processInfo; } - public void addWidgetProcessInfo(Widget widget) { - if (processInfo == null) { - return; - } - widget.setWidgetID(UUID.randomUUID().toString()); - processInfo.addComponentCreateInfo(widget); - } - - public void removeWidgetProcessInfo(Widget widget) { + public void updateTemplateOperationInfo(TemplateOperate operateInfo) { if (processInfo == null) { return; } - processInfo.addComponentRemoveInfo(widget); + processInfo.updateTemplateOperationInfo(operateInfo); } public FormECCompositeProvider getReportComposite() { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentCreateOperate.java b/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentCreateOperate.java new file mode 100644 index 000000000..d83a6c2fa --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentCreateOperate.java @@ -0,0 +1,36 @@ +package com.fr.design.mainframe.template.info; + +import com.fr.form.ui.Widget; +import com.fr.json.JSONObject; + +import java.util.UUID; + +/** + * Created by kerry on 2020-05-08 + */ +public class ComponentCreateOperate extends ComponentOperate { + public static final String OPERATE_TYPE = "componentCreate"; + private static final String ATTR_CREATE_TIME = "createTime"; + private long createTime = 0L; + + + public ComponentCreateOperate(Widget widget) { + super(widget); + widget.setWidgetID(UUID.randomUUID().toString()); + this.createTime = System.currentTimeMillis(); + } + + + @Override + public String getOperateType() { + return OPERATE_TYPE; + } + + @Override + public JSONObject toJSONObject() { + JSONObject jo = super.toJSONObject(); + jo.put(ATTR_CREATE_TIME, createTime); + return jo; + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentDeleteOperate.java b/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentDeleteOperate.java new file mode 100644 index 000000000..e49618164 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentDeleteOperate.java @@ -0,0 +1,29 @@ +package com.fr.design.mainframe.template.info; + +import com.fr.form.ui.Widget; +import com.fr.json.JSONObject; + +/** + * Created by kerry on 2020-05-08 + */ +public class ComponentDeleteOperate extends ComponentOperate { + public static final String OPERATE_TYPE = "componentDelete"; + private long deleteTime = 0L; + + public ComponentDeleteOperate(Widget widget) { + super(widget); + this.deleteTime = System.currentTimeMillis(); + } + + @Override + public String getOperateType() { + return OPERATE_TYPE; + } + + @Override + public JSONObject toJSONObject() { + JSONObject jo = super.toJSONObject(); + jo.put(ATTR_DELETE_TIME, deleteTime); + return jo; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentProcessInfo.java b/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentOperate.java similarity index 63% rename from designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentProcessInfo.java rename to designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentOperate.java index 50e632a6c..9ca2cdba9 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentProcessInfo.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentOperate.java @@ -8,44 +8,29 @@ import com.fr.form.ui.container.WCardLayout; import com.fr.json.JSONObject; /** - * Created by kerry on 2020-05-07 + * Created by kerry on 2020-05-08 */ -public class ComponentProcessInfo { +public abstract class ComponentOperate implements TemplateOperate { private static final String ATTR_COMPONENT_ID = "componentID"; private static final String ATTR_COMPONENT_NAME = "componentName"; private static final String ATTR_COMPONENT_TYPE = "componentType"; - private static final String ATTR_CREATE_TIME = "createTime"; - private static final String ATTR_DELETE_TIME = "deleteTime"; - private String componentID; - private String componentName; - private String componentType; - private long createTime = 0L; - private long deleteTime = 0L; + protected static final String ATTR_CREATE_TIME = "createTime"; + protected static final String ATTR_DELETE_TIME = "deleteTime"; + private Widget widget; - public ComponentProcessInfo(Widget widget) { - this(widget, 0L); + public ComponentOperate(Widget widget) { + this.widget = widget; } - public ComponentProcessInfo(Widget widget, long createTime) { - this.componentID = widget.getWidgetID(); - this.componentName = widget.getWidgetName(); - this.componentType = ComponentType.parseType(widget).name(); - this.createTime = createTime; - } - - public void updateDeleteTime(long deleteTime) { - this.deleteTime = deleteTime; - } - - + @Override public JSONObject toJSONObject() { JSONObject jo = new JSONObject(); - jo.put(ATTR_COMPONENT_ID, componentID) - .put(ATTR_COMPONENT_NAME, componentName) - .put(ATTR_COMPONENT_TYPE, componentType) - .put(ATTR_CREATE_TIME, createTime) - .put(ATTR_DELETE_TIME, deleteTime); + jo.put(ATTR_COMPONENT_ID, widget.getWidgetID()) + .put(ATTR_COMPONENT_NAME, widget.getWidgetName()) + .put(ATTR_COMPONENT_TYPE, ComponentType.parseType(widget).name()) + .put(ATTR_CREATE_TIME, 0L) + .put(ATTR_DELETE_TIME, 0L); return jo; } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java index 5486ef82a..a77a0f58a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java @@ -10,7 +10,9 @@ import com.fr.form.ui.ElementCaseEditorProvider; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WLayout; +import com.fr.general.ComparatorUtils; import com.fr.json.JSONArray; +import com.fr.json.JSONObject; import com.fr.report.cell.DefaultTemplateCellElement; import java.util.Iterator; @@ -28,7 +30,7 @@ public class JFormProcessInfo extends TemplateProcessInfo { private static final Pattern PATTERN = Pattern.compile(REGEX); - private Map componentProcessInfoMap = new ConcurrentHashMap(); + private Map componentProcessInfoMap = new ConcurrentHashMap(); public JFormProcessInfo(Form form) { super(form); @@ -166,23 +168,34 @@ public class JFormProcessInfo extends TemplateProcessInfo { @Override public JSONArray getComponentsInfo() { JSONArray ja = new JSONArray(); - for (ComponentProcessInfo value : componentProcessInfoMap.values()) { - ja.put(value.toJSONObject()); + for (JSONObject value : componentProcessInfoMap.values()) { + ja.put(value); } this.componentProcessInfoMap.clear(); return ja; } - public void addComponentCreateInfo(Widget widget) { - componentProcessInfoMap.put(widget.getWidgetID(), new ComponentProcessInfo(widget, System.currentTimeMillis())); + @Override + public void updateTemplateOperationInfo(TemplateOperate templateOperate) { + if (ComparatorUtils.equals(ComponentCreateOperate.OPERATE_TYPE, templateOperate.getOperateType())) { + addComponentCreateInfo(templateOperate.toJSONObject()); + } + if (ComparatorUtils.equals(ComponentDeleteOperate.OPERATE_TYPE, templateOperate.getOperateType())) { + addComponentRemoveInfo(templateOperate.toJSONObject()); + } + } + private void addComponentCreateInfo(JSONObject jsonObject) { + String componentID = jsonObject.optString("componentID"); + componentProcessInfoMap.put(componentID, jsonObject); } - public void addComponentRemoveInfo(Widget widget) { - ComponentProcessInfo info = componentProcessInfoMap.get(widget.getWidgetID()); + private void addComponentRemoveInfo(JSONObject jsonObject) { + String componentID = jsonObject.optString("componentID"); + JSONObject info = componentProcessInfoMap.get(componentID); if (info == null) { - info = new ComponentProcessInfo(widget); - componentProcessInfoMap.put(widget.getWidgetID(), info); + info = jsonObject; + componentProcessInfoMap.put(componentID, jsonObject); } - info.updateDeleteTime(System.currentTimeMillis()); + info.put("deleteTime", System.currentTimeMillis()); } } diff --git a/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentProcessInfoTest.java b/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentCreateOperateTest.java similarity index 52% rename from designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentProcessInfoTest.java rename to designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentCreateOperateTest.java index abed86959..1bebd0be7 100644 --- a/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentProcessInfoTest.java +++ b/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentCreateOperateTest.java @@ -13,27 +13,26 @@ import org.junit.Test; /** * Created by kerry on 2020-05-08 */ -public class ComponentProcessInfoTest { +public class ComponentCreateOperateTest { @Test public void testToJSONObject() { Widget button = new FreeButton(); button.setWidgetName("button1"); + ComponentCreateOperate info = new ComponentCreateOperate(button); button.setWidgetID("xxxxxxx"); - ComponentProcessInfo info = new ComponentProcessInfo(button); JSONObject jo = info.toJSONObject(); Assert.assertEquals("xxxxxxx", jo.optString("componentID")); Assert.assertEquals("button1", jo.optString("componentName")); Assert.assertEquals("Widget", jo.optString("componentType")); - Assert.assertEquals("0", jo.optString("createTime")); Assert.assertEquals("0", jo.optString("deleteTime")); } @Test public void testComponentType() { - Assert.assertEquals(ComponentProcessInfo.ComponentType.Widget, ComponentProcessInfo.ComponentType.parseType(new FreeButton())); - Assert.assertEquals(ComponentProcessInfo.ComponentType.Report, ComponentProcessInfo.ComponentType.parseType(new ElementCaseEditor())); - Assert.assertEquals(ComponentProcessInfo.ComponentType.Chart, ComponentProcessInfo.ComponentType.parseType(new ChartEditor())); - Assert.assertEquals(ComponentProcessInfo.ComponentType.Absolute, ComponentProcessInfo.ComponentType.parseType(new WAbsoluteLayout())); - Assert.assertEquals(ComponentProcessInfo.ComponentType.TabLayout, ComponentProcessInfo.ComponentType.parseType(new WCardLayout())); + Assert.assertEquals(ComponentOperate.ComponentType.Widget, ComponentOperate.ComponentType.parseType(new FreeButton())); + Assert.assertEquals(ComponentOperate.ComponentType.Report, ComponentOperate.ComponentType.parseType(new ElementCaseEditor())); + Assert.assertEquals(ComponentOperate.ComponentType.Chart, ComponentOperate.ComponentType.parseType(new ChartEditor())); + Assert.assertEquals(ComponentOperate.ComponentType.Absolute, ComponentOperate.ComponentType.parseType(new WAbsoluteLayout())); + Assert.assertEquals(ComponentOperate.ComponentType.TabLayout, ComponentOperate.ComponentType.parseType(new WCardLayout())); } } diff --git a/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java b/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java index ee366cc7d..4db78a271 100644 --- a/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java +++ b/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java @@ -137,8 +137,8 @@ public class JFormProcessInfoTest { FreeButton button2 = new FreeButton(); button1.setWidgetID("xxxx1"); button2.setWidgetID("xxxx2"); - jFormProcessInfo.addComponentCreateInfo(button1); - jFormProcessInfo.addComponentRemoveInfo(button2); + Reflect.on(jFormProcessInfo).call("addComponentCreateInfo", new ComponentCreateOperate(button1).toJSONObject()); + Reflect.on(jFormProcessInfo).call("addComponentRemoveInfo", new ComponentDeleteOperate(button2).toJSONObject()); JSONArray ja = jFormProcessInfo.getComponentsInfo(); Assert.assertEquals(2, ja.size()); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java index a4b86b189..a058f7019 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java @@ -135,4 +135,9 @@ public class JWorkBookProcessInfo extends TemplateProcessInfo { public JSONArray getComponentsInfo() { return new JSONArray(); } + + @Override + public void updateTemplateOperationInfo(TemplateOperate templateOption) { + + } } From 61d773eb84b01719472e692ce9dd62a85492a41a Mon Sep 17 00:00:00 2001 From: kerry Date: Sat, 9 May 2020 09:27:23 +0800 Subject: [PATCH 300/375] =?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 --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 5 ----- .../java/com/fr/design/form/util/FormDesignerUtils.java | 4 ++-- .../src/main/java/com/fr/design/mainframe/JForm.java | 7 ------- 3 files changed, 2 insertions(+), 14 deletions(-) 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 db72357a3..66d7216c9 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 @@ -38,7 +38,6 @@ 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.template.info.TemplateInfoCollector; -import com.fr.design.mainframe.template.info.TemplateOperate; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.template.info.TimeConsumeTimer; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; @@ -1263,10 +1262,6 @@ public abstract class JTemplate> template.setTemplateID(templateId); } - public void updateTemplateOperationInfo(TemplateOperate operateInfo) { - - } - public abstract String route(); public String getTemplateName() { diff --git a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java index d6931db5e..85ec9474d 100644 --- a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java +++ b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java @@ -34,12 +34,12 @@ public class FormDesignerUtils { public static void addWidgetProcessInfo(Widget widget) { JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - jTemplate.updateTemplateOperationInfo(new ComponentCreateOperate(widget)); + jTemplate.getProcessInfo().updateTemplateOperationInfo(new ComponentCreateOperate(widget)); } public static void removeWidgetProcessInfo(Widget widget) { JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - jTemplate.updateTemplateOperationInfo(new ComponentDeleteOperate(widget)); + jTemplate.getProcessInfo().updateTemplateOperationInfo(new ComponentDeleteOperate(widget)); } } 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 01c70cb28..c538d55ef 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 @@ -45,7 +45,6 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.template.info.JFormProcessInfo; -import com.fr.design.mainframe.template.info.TemplateOperate; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.toolbar.ToolBarMenuDock; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; @@ -217,12 +216,6 @@ public class JForm extends JTemplate implements BaseJForm Date: Sat, 9 May 2020 09:51:14 +0800 Subject: [PATCH 301/375] =?UTF-8?q?CHART-13814=20=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=E7=82=B9=E9=85=8D=E7=BD=AE=E9=9D=A2=E6=9D=BF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../marker/VanChartCommonMarkerPane.java | 50 +++++++++++++------ 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java index f62604501..d4f7834a2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java @@ -1,12 +1,14 @@ package com.fr.van.chart.designer.component.marker; import com.fr.chart.chartglyph.Marker; -import com.fr.design.i18n.Toolkit; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.xcombox.MarkerComboBox; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -42,11 +44,12 @@ public class VanChartCommonMarkerPane extends BasicBeanPane MarkerType.MARKER_TRIANGLE_HOLLOW }; private static Marker[] normalMarkers = null; + protected static Marker[] getNormalMarkers() { - if(normalMarkers == null){ + if (normalMarkers == null) { normalMarkers = new Marker[NORMAL_TYPES.length]; int i = 0; - for(MarkerType markerType : NORMAL_TYPES){ + for (MarkerType markerType : NORMAL_TYPES) { normalMarkers[i++] = Marker.createMarker(markerType); } } @@ -79,11 +82,12 @@ public class VanChartCommonMarkerPane extends BasicBeanPane MarkerType.MARKER_TRIANGLE_HOLLOW }; private static Marker[] mapMarkers = null; + protected static Marker[] getMapScatterMarkers() { - if(mapMarkers == null){ + if (mapMarkers == null) { mapMarkers = new Marker[MAP_TYPES.length]; int i = 0; - for(MarkerType markerType : MAP_TYPES){ + for (MarkerType markerType : MAP_TYPES) { mapMarkers[i++] = Marker.createMarker(markerType); } } @@ -98,11 +102,12 @@ public class VanChartCommonMarkerPane extends BasicBeanPane MarkerType.MARKER_STAR }; private static Marker[] ganttMarkers = null; + protected static Marker[] getGanttMarkers() { - if(ganttMarkers == null){ + if (ganttMarkers == null) { ganttMarkers = new Marker[GANTT_TYPES.length]; int i = 0; - for(MarkerType markerType : GANTT_TYPES){ + for (MarkerType markerType : GANTT_TYPES) { ganttMarkers[i++] = Marker.createMarker(markerType); } } @@ -119,11 +124,23 @@ public class VanChartCommonMarkerPane extends BasicBeanPane public VanChartCommonMarkerPane() { markerTypeComboBox = new MarkerComboBox(getMarkers()); - markerFillColor = new VanChartMarkerBackgroundPane(){ + markerFillColor = new VanChartMarkerBackgroundPane() { + protected JPanel initContentPanel() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double[] columnSize = {f, e}; + double[] rowSize = {p, p, p}; + + return TableLayoutHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize, 0, LayoutConstants.VGAP_MEDIUM); + } + protected Component[][] getPaneComponents() { - return new Component[][]{ - new Component[]{typeComboBox, null}, - new Component[]{centerPane, null}, + return new Component[][]{ + new Component[]{null, null}, + new Component[]{null, typeComboBox}, + new Component[]{null, centerPane}, }; } }; @@ -173,7 +190,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane protected double[] getColumnSize() { double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; - return new double[] {d, e}; + return new double[]{d, e}; } protected Marker[] getMarkers() { @@ -195,7 +212,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane @Override public void populateBean(VanChartAttrMarker marker) { - if(marker == null){ + if (marker == null) { marker = new VanChartAttrMarker(); marker.setCommon(true); } @@ -210,9 +227,10 @@ public class VanChartCommonMarkerPane extends BasicBeanPane markerFillColor.populate(marker.getColorBackground()); } - protected MarkerType populateMarkType(VanChartAttrMarker marker){ + protected MarkerType populateMarkType(VanChartAttrMarker marker) { return marker.getMarkerType(); } + /** * Update. */ @@ -223,14 +241,14 @@ public class VanChartCommonMarkerPane extends BasicBeanPane return marker; } - public void updateBean(VanChartAttrMarker marker){ + public void updateBean(VanChartAttrMarker marker) { marker.setCommon(true); updateColor(marker); marker.setRadius(radius.getValue()); marker.setMarkerType(MarkerType.parse(markerTypeComboBox.getSelectedMarkder().getMarkerType())); } - protected void updateColor(VanChartAttrMarker marker){ + protected void updateColor(VanChartAttrMarker marker) { marker.setColorBackground(markerFillColor.update()); } } From 4c219d51dde6bed3c89b491c827703dafa240e4d Mon Sep 17 00:00:00 2001 From: kerry Date: Sat, 9 May 2020 10:28:52 +0800 Subject: [PATCH 302/375] =?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 --- .../src/main/java/com/fr/design/mainframe/JForm.java | 4 ++++ 1 file changed, 4 insertions(+) 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 c538d55ef..ed695ea94 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 @@ -213,6 +213,10 @@ public class JForm extends JTemplate implements BaseJForm getProcessInfo() { + //这边需要判空,图表的埋点信息收集时可能没有初始化processInfo + if (processInfo == null) { + processInfo = new JFormProcessInfo(template); + } return processInfo; } From 7e020fd047387a2770e661340f8388310b2033dd Mon Sep 17 00:00:00 2001 From: kerry Date: Sat, 9 May 2020 11:24:33 +0800 Subject: [PATCH 303/375] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../burying/point/AbstractPointInfo.java | 4 ++-- .../mainframe/chart/info/ChartInfo.java | 1 - .../mainframe/template/info/TemplateInfo.java | 24 +++++++++---------- .../template/info/TemplateInfoCollector.java | 4 +++- .../info/TemplateInfoCollectorTest.java | 8 ++++--- .../template/info/TemplateInfoTest.java | 18 +++++++------- .../template/info/JFormProcessInfo.java | 4 ++-- 7 files changed, 34 insertions(+), 29 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java index 93ff42690..394691d57 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java @@ -12,7 +12,7 @@ public abstract class AbstractPointInfo implements BasePointInfo { protected int idleDayCount; // 到现在为止,埋点闲置的天数 //是否是测试模板 - protected boolean isTestTemplate; + protected boolean testTemplate; @Override public void resetIdleDayCount() { @@ -42,7 +42,7 @@ public abstract class AbstractPointInfo implements BasePointInfo { } public void setTestTemplate(boolean testTemplate) { - isTestTemplate = testTemplate; + testTemplate = testTemplate; } /** diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java index 57bec3c45..4c546c4cd 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java @@ -67,7 +67,6 @@ public class ChartInfo extends AbstractPointInfo { private BaseBook book; - private boolean testTemplate; private boolean testChart; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java index efd245bab..8faa727fe 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java @@ -4,15 +4,15 @@ import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.burying.point.AbstractPointInfo; import com.fr.general.CloudCenter; +import com.fr.json.JSON; +import com.fr.json.JSONFactory; import com.fr.json.JSONObject; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; - -import java.text.SimpleDateFormat; -import java.util.Calendar; import java.util.HashMap; import java.util.Map; +import com.fr.third.joda.time.DateTime; /** * 对应一张模版的记录 @@ -78,7 +78,7 @@ public class TemplateInfo extends AbstractPointInfo { } public static TemplateInfo newInstance(String templateID, String originID, String saveRecord) { - String createTime = new SimpleDateFormat(SIMPLE_DATE_PATTRN).format(Calendar.getInstance().getTime()); + String createTime = DateTime.now().toString(SIMPLE_DATE_PATTRN); return newInstance(templateID, originID, saveRecord, createTime); } @@ -109,9 +109,9 @@ public class TemplateInfo extends AbstractPointInfo { } public long getSaveTime() { - String save_record = (String) consumingMap.get(ATTR_SAVE_RECORD); - JSONObject jo = new JSONObject(save_record); - return jo.optLong("time"); + String saveRecord = (String) consumingMap.get(ATTR_SAVE_RECORD); + JSONObject jo = JSONFactory.createJSON(JSON.OBJECT, saveRecord); + return jo.getLong("time"); } public String getTemplateCreateTime() { @@ -131,7 +131,7 @@ public class TemplateInfo extends AbstractPointInfo { if (idleDayCount >= 0) { writer.attr(ATTR_DAY_COUNT, this.idleDayCount); } - writer.attr(TEST_TEMPLATE_FLAG, this.isTestTemplate); + writer.attr(TEST_TEMPLATE_FLAG, this.testTemplate); writeProcessMap(writer); writeConsumingMap(writer); @@ -164,7 +164,7 @@ public class TemplateInfo extends AbstractPointInfo { public void readXML(XMLableReader reader) { if (!reader.isChildNode()) { idleDayCount = reader.getAttrAsInt(ATTR_DAY_COUNT, 0); - isTestTemplate = reader.getAttrAsBoolean(TEST_TEMPLATE_FLAG, false); + testTemplate = reader.getAttrAsBoolean(TEST_TEMPLATE_FLAG, false); templateID = reader.getAttrAsString(ATTR_TEMPLATE_ID, StringUtils.EMPTY); originID = reader.getAttrAsString(ATTR_ORIGIN_ID, StringUtils.EMPTY); } else { @@ -196,7 +196,7 @@ public class TemplateInfo extends AbstractPointInfo { @Override public boolean isTestTemplate() { - return isTestTemplate; + return testTemplate; } public static boolean isTestTemplate(int reportType, int cellCount, int floatCount, int blockCount, int widgetCount) { @@ -219,8 +219,8 @@ public class TemplateInfo extends AbstractPointInfo { @Override public Map getSendInfo() { Map sendMap = new HashMap<>(); - sendMap.put(CONSUMING_URL, new JSONObject(consumingMap).toString()); - sendMap.put(PROCESS_URL, new JSONObject(processMap).toString()); + sendMap.put(CONSUMING_URL, JSONFactory.createJSON(JSON.OBJECT, consumingMap).toString()); + sendMap.put(PROCESS_URL, JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); return sendMap; } 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 bdc853796..42e7acce6 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 @@ -2,6 +2,8 @@ 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.json.JSON; +import com.fr.json.JSONFactory; import com.fr.json.JSONObject; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; @@ -82,7 +84,7 @@ public class TemplateInfoCollector extends AbstractPointCollector } private TemplateInfo createTemplateInfo(String templateID, String originID, long saveTime, int timeConsume){ - JSONObject saveRecord = new JSONObject(); + JSONObject saveRecord = JSONFactory.createJSON(JSON.OBJECT); saveRecord.put("time", saveTime); saveRecord.put("consume", timeConsume); if (this.contains(templateID)){ diff --git a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java index 73109f340..bd25f7368 100644 --- a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java +++ b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java @@ -3,7 +3,9 @@ package com.fr.design.mainframe.template.info; import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.invoke.Reflect; +import com.fr.json.JSON; import com.fr.json.JSONArray; +import com.fr.json.JSONFactory; import com.fr.json.JSONObject; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; @@ -101,7 +103,7 @@ public class TemplateInfoCollectorTest { assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + "\"cell_count\":13,\"paraApply\":0,\"block_count\":3,\"report_type\":0,\"components_info\":\"[]\"," + "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\"}", - new JSONObject(processMap).toString()); + JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); Assert.assertEquals(71113, consumingMap.get("uid")); Assert.assertEquals("2020-05-07 17:25", consumingMap.get("create_time")); @@ -131,7 +133,7 @@ public class TemplateInfoCollectorTest { assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + "\"cell_count\":13,\"paraApply\":0,\"block_count\":3,\"report_type\":0,\"components_info\":\"[]\"," + - "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\"}", new JSONObject(processMap).toString()); + "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\"}", JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); Assert.assertEquals(71113, consumingMap.get("uid")); @@ -159,7 +161,7 @@ public class TemplateInfoCollectorTest { assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0,\"cell_count\":13," + "\"paraApply\":0,\"block_count\":3,\"report_type\":0,\"components_info\":\"[]\"," + - "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\"}", new JSONObject(processMap).toString()); + "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\"}", JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); Assert.assertEquals(71113, consumingMap.get("uid")); diff --git a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java index cf2fff3be..1808736f3 100644 --- a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java +++ b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java @@ -3,6 +3,8 @@ package com.fr.design.mainframe.template.info; import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.invoke.Reflect; +import com.fr.json.JSON; +import com.fr.json.JSONFactory; import com.fr.json.JSONObject; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLableReader; @@ -105,18 +107,18 @@ public class TemplateInfoTest { assertJsonStringEquals("{\"uid\":71113,\"originID\":\"\",\"create_time\":\"2020-05-07 17:28\"," + "\"saveRecord\":\"{\\\"time\\\":1588843693000,\\\"consume\\\":4}\"," + "\"templateID\":\"aac1139e-018b-4481-867a-a18fc6d6f3e6\"," + - "\"uuid\":\"6b6699ff-ec63-43b0-9deb-b580a5f10411\"}", new JSONObject(consumingMap).toString()); + "\"uuid\":\"6b6699ff-ec63-43b0-9deb-b580a5f10411\"}", JSONFactory.createJSON(JSON.OBJECT, consumingMap).toString()); assertJsonStringEquals("{\"uid\":71113,\"originID\":\"aac1139e-018b-4481-867a-a18fc6d6f3e6\"," + "\"create_time\":\"2020-05-07 17:45\",\"saveRecord\":\"{\\\"time\\\":1588844751000,\\\"consume\\\":1058}\"," + "\"templateID\":\"2521d03c-b238-41a5-9a1d-2498efff3a97\"," + - "\"uuid\":\"6b6699ff-ec63-43b0-9deb-b580a5f10411\"}", new JSONObject(consumingMap1).toString()); + "\"uuid\":\"6b6699ff-ec63-43b0-9deb-b580a5f10411\"}", JSONFactory.createJSON(JSON.OBJECT, consumingMap1).toString()); assertJsonStringEquals("{\"process\":\"\",\"float_count\":0,\"widget_count\":0,\"cell_count\":3," + "\"paraApply\":0,\"block_count\":0,\"report_type\":0,\"components_info\":\"[]\"," + - "\"templateID\":\"aac1139e-018b-4481-867a-a18fc6d6f3e6\"}", new JSONObject(processMap).toString()); + "\"templateID\":\"aac1139e-018b-4481-867a-a18fc6d6f3e6\"}", JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); assertJsonStringEquals("{\"process\":\"\",\"float_count\":0,\"widget_count\":0,\"cell_count\":3," + "\"paraApply\":0,\"block_count\":0,\"report_type\":0,\"components_info\":\"[]\"," + - "\"templateID\":\"2521d03c-b238-41a5-9a1d-2498efff3a97\"}", new JSONObject(processMap1).toString()); + "\"templateID\":\"2521d03c-b238-41a5-9a1d-2498efff3a97\"}", JSONFactory.createJSON(JSON.OBJECT, processMap1).toString()); } private TemplateInfo createTemplateInfo(String xmlContent) throws XMLStreamException { @@ -126,16 +128,16 @@ public class TemplateInfoTest { } @Test - public void testGetSaveTime(){ + public void testGetSaveTime() { Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); String saveRecord = (String) consumingMap.get("saveRecord"); - JSONObject object = new JSONObject(saveRecord); + JSONObject object = JSONFactory.createJSON(JSON.OBJECT, saveRecord); Assert.assertEquals(1588843693000L, object.optLong("time")); } @Test - public void testGetTemplateCreateTime(){ + public void testGetTemplateCreateTime() { Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); - Assert.assertEquals("2020-05-07 17:28", (String)consumingMap.get("create_time")); + Assert.assertEquals("2020-05-07 17:28", (String) consumingMap.get("create_time")); } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java index a77a0f58a..8496e2592 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java @@ -185,12 +185,12 @@ public class JFormProcessInfo extends TemplateProcessInfo { } } private void addComponentCreateInfo(JSONObject jsonObject) { - String componentID = jsonObject.optString("componentID"); + String componentID = jsonObject.getString("componentID"); componentProcessInfoMap.put(componentID, jsonObject); } private void addComponentRemoveInfo(JSONObject jsonObject) { - String componentID = jsonObject.optString("componentID"); + String componentID = jsonObject.getString("componentID"); JSONObject info = componentProcessInfoMap.get(componentID); if (info == null) { info = jsonObject; From 262f967fcbf0b3c9389d658a1d1edf372a8232f5 Mon Sep 17 00:00:00 2001 From: kerry Date: Sat, 9 May 2020 13:35:30 +0800 Subject: [PATCH 304/375] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JForm.java | 6 ------ 1 file changed, 6 deletions(-) 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 ed695ea94..ff59a52d4 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 @@ -133,14 +133,8 @@ public class JForm extends JTemplate implements BaseJForm Date: Sat, 9 May 2020 15:18:03 +0800 Subject: [PATCH 305/375] =?UTF-8?q?REPORT-30735=E3=80=9010.0.6=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=86=85=E6=94=B9=E5=8A=A8=E3=80=91frm?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=90=8D=E7=A7=B0=E8=A7=84=E8=8C=83=E7=BB=9F?= =?UTF-8?q?=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EastRegionContainerPane.java | 54 +++++++++---------- .../mainframe/widget/BasicPropertyPane.java | 2 +- .../widget/WidgetBoundsPaneFactory.java | 8 +-- .../designer/creator/XWBorderLayout.java | 10 ++-- .../design/form/util/XCreatorConstants.java | 4 +- 5 files changed, 39 insertions(+), 39 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index cf8f4f74d..a1f88d77c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -130,13 +130,13 @@ public class EastRegionContainerPane extends UIEastResizableContainer { defaultAuthorityPane = getDefaultPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Not_Support_Authority_Edit")); switchMode(PropertyMode.REPORT); setContainerWidth(CONTAINER_WIDTH); - + initPluginPane(); listenPlugin(); } - + private void listenPlugin() { - + PluginFilter filter = new PluginFilter() { @Override public boolean accept(PluginContext context) { @@ -167,15 +167,15 @@ public class EastRegionContainerPane extends UIEastResizableContainer { Set providers = runtime.get(PropertyItemPaneProvider.XML_TAG); for (PropertyItemPaneProvider provider : providers) { removePropertyItem(provider); - + } updateAllPropertyPane(); } }, filter); } - + private void removePropertyItem(PropertyItemPaneProvider provider) { - + propertyItemMap.remove(provider.key()); String replaceKey = provider.replaceKey(); if (replaceKey == null) { @@ -186,18 +186,18 @@ public class EastRegionContainerPane extends UIEastResizableContainer { replaceItem.setReplace(false); } } - + private void initPluginPane() { - + ExtraDesignClassManager classManager = PluginModule.getAgent(PluginModule.ExtraDesign); Set providers = classManager.getArray(PropertyItemPaneProvider.XML_TAG); for (PropertyItemPaneProvider provider : providers) { addPropertyItem(provider); } } - + private void addPropertyItem(PropertyItemPaneProvider provider) { - + String key = provider.key(); PropertyItemBean itemBean = provider.getItem(); PropertyItem propertyItem = new PropertyItem(itemBean.getName(), @@ -212,7 +212,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { button.addActionListener(buttonListener); } propertyItemMap.put(key, propertyItem); - + String replaceKey = provider.replaceKey(); if (replaceKey == null) { return; @@ -221,11 +221,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer { if (replaceItem != null) { replaceItem.setReplace(true); } - + } - + private void initPropertyItemList() { - + propertyItemMap = new LinkedHashMap<>(); // 有序map // 单元格元素 PropertyItem cellElement = new PropertyItem(KEY_CELL_ELEMENT, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell_Element"), @@ -240,7 +240,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { "floatelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.POLY_REPORT}); // 控件设置 - PropertyItem widgetSettings = new PropertyItem(KEY_WIDGET_SETTINGS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Settings"), + PropertyItem widgetSettings = new PropertyItem(KEY_WIDGET_SETTINGS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Settings"), "widgetsettings", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.FORM, PropertyMode.POLY}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.FORM, PropertyMode.POLY_REPORT, PropertyMode.POLY_CHART}); // 条件属性 @@ -482,9 +482,9 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void replaceConfiguredRolesPane(JComponent pane) { propertyItemMap.get(KEY_CONFIGURED_ROLES).replaceContentPane(pane); } - + public void replaceKeyPane(String key, JComponent pane) { - + propertyItemMap.get(key).replaceContentPane(pane); } @@ -653,8 +653,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private String iconSuffix = ICON_SUFFIX_NORMAL; // normal, diabled, selected, 三者之一 private final Color selectedBtnBackground = new Color(0xF5F5F7); private Color originBtnBackground; - - + + public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes) { this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes); } @@ -705,12 +705,12 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void setVisible(boolean isVisible) { this.isVisible = isVisible; } - + public void setReplace(boolean replace) { - + this.replace = replace; } - + public boolean isEnabled() { return isEnabled; } @@ -720,16 +720,16 @@ public class EastRegionContainerPane extends UIEastResizableContainer { this.isEnabled = isEnabled; button.setEnabled(isEnabled); } - + public void setIconBaseDir(String iconBaseDir) { this.iconBaseDir = iconBaseDir; } - + private String getIconBaseDir() { - + return StringUtils.isEmpty(iconBaseDir) ? ICON_BASE_DIR : iconBaseDir; } - + private void initPropertyPanel() { propertyPanel = new JPanel(); propertyPanel.setBackground(Color.pink); @@ -810,7 +810,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } private String getBtnIconUrl() { - + return getIconBaseDir() + btnIconName + iconSuffix; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/BasicPropertyPane.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/BasicPropertyPane.java index d675aceb2..099684a81 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/BasicPropertyPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/BasicPropertyPane.java @@ -63,7 +63,7 @@ public class BasicPropertyPane extends BasicPane { double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Name")), widgetName}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Name")), widgetName}, }; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); diff --git a/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java b/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java index 5476cb3a1..c4c840227 100644 --- a/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java @@ -25,7 +25,7 @@ public class WidgetBoundsPaneFactory { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ - new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Size")), createRightPane(width, height)}, + new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Size")), createRightPane(width, height)}, new Component[]{null, createRightPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))}, }; double[] rowSize = {p, p}; @@ -53,11 +53,11 @@ public class WidgetBoundsPaneFactory { double p = TableLayout.PREFERRED; Component[][] northComponents = new Component[][]{ - new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Position")), createRightPane(x, y)}, + new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Position")), createRightPane(x, y)}, new Component[]{null, createRightPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_X_Coordinate"), SwingConstants.CENTER), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Y_Coordinate"), SwingConstants.CENTER))}, }; Component[][] centerComponents = new Component[][]{ - new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Size")), createRightPane(width, height)}, + new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Size")), createRightPane(width, height)}, new Component[]{null, createRightPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))}, }; double[] rowSize = {p, p}; @@ -79,7 +79,7 @@ public class WidgetBoundsPaneFactory { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Size")), width}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Size")), width}, }; double[] rowSize = {p}; double[] columnSize = {p, f}; diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWBorderLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWBorderLayout.java index ff67634e4..6d2003e21 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWBorderLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWBorderLayout.java @@ -28,7 +28,7 @@ public class XWBorderLayout extends XLayoutContainer { public XWBorderLayout(){ super(new WBorderLayout(),new Dimension(WBorderLayout.DEFAULT_WIDTH, WBorderLayout.DEFAULT_HEIGHT)); } - + public XWBorderLayout(WBorderLayout widget, Dimension initSize) { super(widget, initSize); } @@ -77,7 +77,7 @@ public class XWBorderLayout extends XLayoutContainer { @Override public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { return new CRPropertyDescriptor[] { - new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Toolkit.i18nText("Fine-Design_Form_Form_Widget_Name")), + new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Toolkit.i18nText("Fine-Design_Basic_Component_Name")), new CRPropertyDescriptor("customTitleName", this.data.getClass()).setI18NName(Toolkit.i18nText("Fine-Design_Form_Title")) }; } @@ -101,7 +101,7 @@ public class XWBorderLayout extends XLayoutContainer { } isRefreshing = false; } - + /** * 设计界面中有组件添加时,要通知WLayout容器重新paint @@ -202,9 +202,9 @@ public class XWBorderLayout extends XLayoutContainer { creator.setDirections(new int[]{Direction.RIGHT}); } } - + @Override public LayoutAdapter getLayoutAdapter() { return new FRBorderLayoutAdapter(this); } -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/form/util/XCreatorConstants.java b/designer-form/src/main/java/com/fr/design/form/util/XCreatorConstants.java index 54b32ca6c..71ab3c002 100644 --- a/designer-form/src/main/java/com/fr/design/form/util/XCreatorConstants.java +++ b/designer-form/src/main/java/com/fr/design/form/util/XCreatorConstants.java @@ -19,7 +19,7 @@ public class XCreatorConstants { public static final String WIDGETNAME = "widgetName"; // 描述属性的分类 public static final String PROPERTY_CATEGORY = "category"; - public static final String DEFAULT_GROUP_NAME = "Fine-Design_Basic_Form_Basic_Properties"; + public static final String DEFAULT_GROUP_NAME = "Fine-Design_Report_Basic"; public static final String PROPERTY_VALIDATE = "Fine-Design_Basic_Validate"; public static final Color FORM_BG = new Color(255, 255, 255); // 拖拽标识块的大小 @@ -52,4 +52,4 @@ public class XCreatorConstants { // 不同粗细的线 public static final BasicStroke STROKE = new BasicStroke(2); -} \ No newline at end of file +} From 7a58515a00e4c8a2cc4b039719640525b689c7de Mon Sep 17 00:00:00 2001 From: Bruce Date: Sat, 9 May 2020 16:17:08 +0800 Subject: [PATCH 306/375] =?UTF-8?q?REPORT-31219=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=89=93=E5=8D=B0=E8=BE=B9=E8=B7=9D=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=B4=9F=E6=95=B0=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/report/UnitFieldPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java b/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java index 4a6984d0f..6da8957b2 100644 --- a/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java @@ -67,7 +67,7 @@ public class UnitFieldPane extends JPanel { this.unitType = unitType; - valueSpinner = new UIBasicSpinner(new SpinnerNumberModel(0.0, 0.0, Double.MAX_VALUE, 1.0)); + valueSpinner = new UIBasicSpinner(new SpinnerNumberModel(0.0, Integer.MIN_VALUE, Double.MAX_VALUE, 1.0)); textField = ((JSpinner.DefaultEditor) valueSpinner.getEditor()).getTextField(); textField.setColumns(OperatingSystem.isWindows() ? TEXT_FIELD_COLUMNS_WINDOWS : TEXT_FIELD_COLUMNS); InputEventBaseOnOS.addBasicEditInputMap(textField); From cfdae7ac2256f85d671042acf8d67c13980aaa8d Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Mon, 11 May 2020 10:15:04 +0800 Subject: [PATCH 307/375] REPORT-30922 bugfix --- .../design/headerfooter/HFAttributesEditDialog.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java b/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java index 152f8fd28..2b81db2b9 100644 --- a/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java +++ b/designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java @@ -26,12 +26,14 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.style.FRFontPane; import com.fr.design.style.FormatPane; import com.fr.general.ComparatorUtils; +import com.fr.general.date.FineDateFormat; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.text.Format; import java.util.ArrayList; /** @@ -274,10 +276,16 @@ public class HFAttributesEditDialog extends BasicPane { ((NumberOfPageHFElement) hfElement).setFRFont(this.frFontPane.update()); } else if (ComparatorUtils.equals(this.hfElement.getClass(),DateHFElement.class)) { ((DateHFElement) hfElement).setFRFont(this.frFontPane.update()); - ((DateHFElement) hfElement).setFormat(this.formatPane.update()); + Format format = this.formatPane.update(); + if (format instanceof FineDateFormat) { + ((DateHFElement) hfElement).setFormat(format); + } } else if (ComparatorUtils.equals(this.hfElement.getClass(),TimeHFElement.class)) { ((TimeHFElement) hfElement).setFRFont(this.frFontPane.update()); - ((TimeHFElement) hfElement).setFormat(this.formatPane.update()); + Format format = this.formatPane.update(); + if (format instanceof FineDateFormat) { + ((TimeHFElement) hfElement).setFormat(format); + } } else if (ComparatorUtils.equals(this.hfElement.getClass(),ImageHFElement.class)) { ((ImageHFElement) hfElement).setImage(this.imagePane.update()); } else if (ComparatorUtils.equals(this.hfElement.getClass(),NewLineHFElement.class)) { From b6052c4af2ea525d8f530706362c61869fed114d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 11 May 2020 10:39:53 +0800 Subject: [PATCH 308/375] =?UTF-8?q?CHART-13814=20=20=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=E7=82=B9=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/marker/VanChartCommonMarkerPane.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java index bda44ccf3..15cba5c8d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java @@ -2,7 +2,6 @@ package com.fr.van.chart.designer.component.marker; import com.fr.chart.chartglyph.Marker; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.xcombox.MarkerComboBox; @@ -57,6 +56,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane } private static Marker[] normalMarkersWithAuto = null; + protected static Marker[] getNormalMarkersWithAuto() { if (normalMarkersWithAuto == null) { normalMarkersWithAuto = new Marker[NORMAL_TYPES.length + 1]; @@ -130,17 +130,17 @@ public class VanChartCommonMarkerPane extends BasicBeanPane double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double e = getColumnSize()[1]; double[] columnSize = {f, e}; double[] rowSize = {p, p, p}; - return TableLayoutHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize, 0, LayoutConstants.VGAP_MEDIUM); + return TableLayoutHelper.createTableLayoutPane(getPaneComponents(), rowSize, columnSize); } protected Component[][] getPaneComponents() { return new Component[][]{ new Component[]{null, null}, - new Component[]{null, typeComboBox}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Fill_Color")), typeComboBox}, new Component[]{null, centerPane}, }; } @@ -175,7 +175,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane protected Component[][] getMarkerConfigComponent() { return new Component[][]{ - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Fill_Color")), markerFillColor}, + new Component[]{markerFillColor, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Radius")), radius} }; } From 6604b77e8145d069c53219ad7350e44fcf2eadee Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 11 May 2020 11:36:57 +0800 Subject: [PATCH 309/375] =?UTF-8?q?CHART-13833=20=E6=95=A3=E7=82=B9?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E8=AE=B0=E7=82=B9=E5=88=A0=E9=99=A4=E6=97=A0?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8=EF=BC=8C=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=A0=87=E8=AE=B0=E7=82=B9=E7=95=8C=E9=9D=A2=E4=BA=A4?= =?UTF-8?q?=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../marker/VanChartCommonMarkerPane.java | 79 ++++++++++--------- .../chart/line/VanChartLineSeriesPane.java | 2 +- .../series/VanChartMapScatterMarkerPane.java | 2 +- .../scatter/VanChartScatterSeriesPane.java | 21 ++++- 4 files changed, 63 insertions(+), 41 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java index 746e0e401..b46e0b789 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java @@ -31,7 +31,6 @@ public class VanChartCommonMarkerPane extends BasicBeanPane private JPanel markerConfigPane; private static final MarkerType[] NORMAL_TYPES = { - MarkerType.MARKER_NULL, MarkerType.MARKER_CIRCLE, MarkerType.MARKER_SQUARE, MarkerType.MARKER_DIAMOND, @@ -42,53 +41,57 @@ public class VanChartCommonMarkerPane extends BasicBeanPane MarkerType.MARKER_TRIANGLE_HOLLOW }; private static Marker[] normalMarkers = null; + private static Marker[] normalMarkersWithNull = null; + private static Marker[] normalMarkersWithAuto = null; + private static Marker[] normalMarkersWithAutoAndNull = null; + + private static Marker[] getNormalMarkersWithCustom(MarkerType[] types) { + MarkerType[] customTypes = types == null ? new MarkerType[0] : types; + Marker[] result = new Marker[customTypes.length + NORMAL_TYPES.length]; + + int i = 0; + + for (MarkerType markerType : customTypes) { + result[i++] = Marker.createMarker(markerType); + } + + for (MarkerType markerType : NORMAL_TYPES) { + result[i++] = Marker.createMarker(markerType); + } + + return result; + } + protected static Marker[] getNormalMarkers() { - if(normalMarkers == null){ - normalMarkers = new Marker[NORMAL_TYPES.length]; - int i = 0; - for(MarkerType markerType : NORMAL_TYPES){ - normalMarkers[i++] = Marker.createMarker(markerType); - } + if (normalMarkers == null) { + normalMarkers = getNormalMarkersWithCustom(new MarkerType[0]); } + return normalMarkers; } - private static Marker[] normalMarkersWithAuto = null; - protected static Marker[] getNormalMarkersWithAuto() { - if (normalMarkersWithAuto == null) { - normalMarkersWithAuto = new Marker[NORMAL_TYPES.length + 1]; - normalMarkersWithAuto[0] = Marker.createMarker(MarkerType.MARKER_AUTO); + protected static Marker[] getNormalMarkersWithNull() { + if (normalMarkersWithNull == null) { + normalMarkersWithNull = getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_NULL}); + } - int i = 1; + return normalMarkersWithNull; + } - for (MarkerType markerType : NORMAL_TYPES) { - normalMarkersWithAuto[i++] = Marker.createMarker(markerType); - } + protected static Marker[] getNormalMarkersWithAuto() { + if (normalMarkersWithAuto == null) { + normalMarkersWithAuto = getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO}); } + return normalMarkersWithAuto; } - //没有无这个选项 - private static final MarkerType[] MAP_TYPES = { - MarkerType.MARKER_CIRCLE, - MarkerType.MARKER_SQUARE, - MarkerType.MARKER_DIAMOND, - MarkerType.MARKER_TRIANGLE, - MarkerType.MARKER_CIRCLE_HOLLOW, - MarkerType.MARKER_SQUARE_HOLLOW, - MarkerType.MARKER_DIAMOND_HOLLOW, - MarkerType.MARKER_TRIANGLE_HOLLOW - }; - private static Marker[] mapMarkers = null; - protected static Marker[] getMapScatterMarkers() { - if(mapMarkers == null){ - mapMarkers = new Marker[MAP_TYPES.length]; - int i = 0; - for(MarkerType markerType : MAP_TYPES){ - mapMarkers[i++] = Marker.createMarker(markerType); - } + protected static Marker[] getNormalMarkersWithAutoAndNull() { + if (normalMarkersWithAutoAndNull == null) { + normalMarkersWithAutoAndNull = getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO, MarkerType.MARKER_NULL}); } - return mapMarkers; + + return normalMarkersWithAutoAndNull; } //甘特图的菱形是实心的,之前写的空心。 @@ -167,7 +170,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane if (markerConfigPane != null && markerTypeComboBox != null) { MarkerType type = MarkerType.parse(markerTypeComboBox.getSelectedMarkder().getMarkerType()); - markerConfigPane.setVisible(!(type == MarkerType.MARKER_AUTO || type == MarkerType.MARKER_NULL)); + markerConfigPane.setVisible(type != MarkerType.MARKER_NULL); } } @@ -178,7 +181,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane } protected Marker[] getMarkers() { - return getNormalMarkers(); + return getNormalMarkersWithNull(); } /** diff --git a/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java index 974bc5e42..49a4f4465 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java @@ -55,7 +55,7 @@ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane { return new VanChartCommonMarkerPane() { protected Marker[] getMarkers() { - return getNormalMarkersWithAuto(); + return getNormalMarkersWithAutoAndNull(); } }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java index 4041152f4..175cc8e25 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java @@ -23,7 +23,7 @@ public class VanChartMapScatterMarkerPane extends VanChartCommonMarkerPane { @Override protected Marker[] getMarkers() { - return getMapScatterMarkers(); + return getNormalMarkers(); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java index c6d7f8af6..938f21da1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java @@ -1,13 +1,17 @@ package com.fr.van.chart.scatter; import com.fr.chart.chartattr.Plot; +import com.fr.chart.chartglyph.Marker; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.van.chart.custom.component.VanChartCustomAxisConditionPane; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartLineTypePane; +import com.fr.van.chart.designer.component.VanChartMarkerPane; +import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane; import com.fr.van.chart.designer.style.series.VanChartStackedAndAxisListControlPane; import com.fr.van.chart.scatter.component.VanChartScatterLineTypePane; @@ -63,7 +67,7 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane { @Override public String getPaneTitle() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Axis"); + return Toolkit.i18nText("Fine-Design_Chart_Custom_Axis"); } }; stackAndAxisEditExpandablePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane); @@ -81,4 +85,19 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane { checkLinePane(); } + + protected JPanel createMarkerPane() { + markerPane = new VanChartMarkerPane() { + protected VanChartCommonMarkerPane createCommonMarkerPane() { + + return new VanChartCommonMarkerPane() { + protected Marker[] getMarkers() { + return getNormalMarkersWithAuto(); + } + }; + } + }; + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); + } } From b0abfb372bf6ca10ceb911e1c4ebec53f710404c Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 11 May 2020 14:08:22 +0800 Subject: [PATCH 310/375] =?UTF-8?q?=E6=95=A3=E7=82=B9=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E8=AE=B0=E7=82=B9=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scatter/VanChartScatterConditionPane.java | 4 +-- .../VanChartScatterMarkerConditionPane.java | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterMarkerConditionPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java index 10b762350..ce91afe7e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java @@ -17,10 +17,10 @@ import com.fr.plugin.chart.scatter.attr.ScatterAttrTooltip; import com.fr.van.chart.bubble.VanChartBubbleConditionSelectionPane; import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.other.condition.item.VanChartEffectConditionPane; -import com.fr.van.chart.designer.other.condition.item.VanChartMarkerConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartTrendLineConditionPane; import com.fr.van.chart.scatter.component.VanChartScatterLineTypeConditionPane; +import com.fr.van.chart.scatter.component.VanChartScatterMarkerConditionPane; import com.fr.van.chart.scatter.component.label.VanChartScatterLabelConditionPane; import com.fr.van.chart.scatter.component.tooltip.VanChartScatterTooltipConditionPane; import com.fr.van.chart.scatter.large.VanChartLargeModelMarkerConditionPane; @@ -56,7 +56,7 @@ public class VanChartScatterConditionPane extends DataSeriesConditionPane { classPaneMap.put(VanChartAttrMarker.class, new VanChartLargeModelMarkerConditionPane(this)); } else { classPaneMap.put(VanChartAttrLine.class, new VanChartScatterLineTypeConditionPane(this)); - classPaneMap.put(VanChartAttrMarker.class, new VanChartMarkerConditionPane(this)); + classPaneMap.put(VanChartAttrMarker.class, new VanChartScatterMarkerConditionPane(this)); classPaneMap.put(ScatterAttrLabel.class, new VanChartScatterLabelConditionPane(this, plot)); classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getScatterPlotDefaultEffect())); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterMarkerConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterMarkerConditionPane.java new file mode 100644 index 000000000..4ac8543a6 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterMarkerConditionPane.java @@ -0,0 +1,27 @@ +package com.fr.van.chart.scatter.component; + +import com.fr.chart.chartglyph.Marker; +import com.fr.design.condition.ConditionAttributesPane; +import com.fr.van.chart.designer.component.VanChartMarkerPane; +import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; +import com.fr.van.chart.designer.other.condition.item.VanChartMarkerConditionPane; + +public class VanChartScatterMarkerConditionPane extends VanChartMarkerConditionPane { + + public VanChartScatterMarkerConditionPane(ConditionAttributesPane conditionAttributesPane) { + super(conditionAttributesPane); + } + + protected void initMarkerPane() { + markerPane = new VanChartMarkerPane() { + protected VanChartCommonMarkerPane createCommonMarkerPane() { + + return new VanChartCommonMarkerPane() { + protected Marker[] getMarkers() { + return getNormalMarkersWithAuto(); + } + }; + } + }; + } +} From 818fde9b2f6497bb567daea3d579dbc2c8c2113a Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 11 May 2020 15:52:35 +0800 Subject: [PATCH 311/375] =?UTF-8?q?REPORT-30557=20=E3=80=9010.0.6=E3=80=91?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=90=AF=E5=8A=A8=E7=B1=BB=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/fun/DesignerTransform.java | 23 +++++++++++++++++++ .../fun/impl/AbstractDesignerTransform.java | 23 +++++++++++++++++++ .../java/com/fr/start/DesignerInitial.java | 12 ++++++++-- 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/DesignerTransform.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerTransform.java diff --git a/designer-base/src/main/java/com/fr/design/fun/DesignerTransform.java b/designer-base/src/main/java/com/fr/design/fun/DesignerTransform.java new file mode 100644 index 000000000..cb408e6fe --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/DesignerTransform.java @@ -0,0 +1,23 @@ +package com.fr.design.fun; + +import com.fr.stable.fun.mark.Mutable; +import com.fr.start.BaseDesigner; + +/** + * 设计器启动类替换接口 + * + * @author hades + * @version 10.0 + * Created by hades on 2020/5/7 + */ + +public interface DesignerTransform extends Mutable { + + String MARK_STRING = "DesignerTransform"; + + int CURRENT_LEVEL = 1; + + + Class transform(); + +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerTransform.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerTransform.java new file mode 100644 index 000000000..0f4d44d2d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerTransform.java @@ -0,0 +1,23 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.DesignerTransform; +import com.fr.stable.fun.mark.API; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/5/7 + */ +@API(level = DesignerTransform.CURRENT_LEVEL) +public abstract class AbstractDesignerTransform implements DesignerTransform { + + @Override + public String mark4Provider() { + return getClass().getName(); + } + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } +} diff --git a/designer-realize/src/main/java/com/fr/start/DesignerInitial.java b/designer-realize/src/main/java/com/fr/start/DesignerInitial.java index 856208f40..5df71cdbf 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerInitial.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerInitial.java @@ -1,12 +1,15 @@ package com.fr.start; import com.fr.design.constants.DesignerLaunchStatus; +import com.fr.design.fun.DesignerTransform; import com.fr.design.mainframe.DesignerContext; import com.fr.design.ui.util.UIUtil; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.event.Null; +import com.fr.invoke.Reflect; +import com.fr.stable.bridge.StableFactory; /** * Created by juhaoyu on 2019-06-14. @@ -14,13 +17,18 @@ import com.fr.event.Null; */ public class DesignerInitial { - private static volatile MainDesigner designer; + private static volatile BaseDesigner designer; public static void init(final String... args) { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - designer = new MainDesigner(args); + DesignerTransform transform = StableFactory.getMarkedInstanceObjectFromClass(DesignerTransform.MARK_STRING, DesignerTransform.class); + if (transform != null) { + designer = Reflect.on(transform.transform()).create(args).get(); + } else { + designer = new MainDesigner(args); + } } }); } From ebebf3673dc16ed0833bab23432b9762d14155fa Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 11 May 2020 16:35:39 +0800 Subject: [PATCH 312/375] REPORT-30557 fix name --- .../{DesignerTransform.java => DesignerProcessor.java} | 4 ++-- ...ignerTransform.java => AbstractDesignerProcessor.java} | 6 +++--- .../src/main/java/com/fr/start/DesignerInitial.java | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) rename designer-base/src/main/java/com/fr/design/fun/{DesignerTransform.java => DesignerProcessor.java} (74%) rename designer-base/src/main/java/com/fr/design/fun/impl/{AbstractDesignerTransform.java => AbstractDesignerProcessor.java} (65%) diff --git a/designer-base/src/main/java/com/fr/design/fun/DesignerTransform.java b/designer-base/src/main/java/com/fr/design/fun/DesignerProcessor.java similarity index 74% rename from designer-base/src/main/java/com/fr/design/fun/DesignerTransform.java rename to designer-base/src/main/java/com/fr/design/fun/DesignerProcessor.java index cb408e6fe..aa9de716b 100644 --- a/designer-base/src/main/java/com/fr/design/fun/DesignerTransform.java +++ b/designer-base/src/main/java/com/fr/design/fun/DesignerProcessor.java @@ -11,9 +11,9 @@ import com.fr.start.BaseDesigner; * Created by hades on 2020/5/7 */ -public interface DesignerTransform extends Mutable { +public interface DesignerProcessor extends Mutable { - String MARK_STRING = "DesignerTransform"; + String MARK_STRING = "DesignerProcessor"; int CURRENT_LEVEL = 1; diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerTransform.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerProcessor.java similarity index 65% rename from designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerTransform.java rename to designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerProcessor.java index 0f4d44d2d..1398a522f 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerTransform.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerProcessor.java @@ -1,6 +1,6 @@ package com.fr.design.fun.impl; -import com.fr.design.fun.DesignerTransform; +import com.fr.design.fun.DesignerProcessor; import com.fr.stable.fun.mark.API; /** @@ -8,8 +8,8 @@ import com.fr.stable.fun.mark.API; * @version 10.0 * Created by hades on 2020/5/7 */ -@API(level = DesignerTransform.CURRENT_LEVEL) -public abstract class AbstractDesignerTransform implements DesignerTransform { +@API(level = DesignerProcessor.CURRENT_LEVEL) +public abstract class AbstractDesignerProcessor implements DesignerProcessor { @Override public String mark4Provider() { diff --git a/designer-realize/src/main/java/com/fr/start/DesignerInitial.java b/designer-realize/src/main/java/com/fr/start/DesignerInitial.java index 5df71cdbf..464e774ca 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerInitial.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerInitial.java @@ -1,7 +1,7 @@ package com.fr.start; import com.fr.design.constants.DesignerLaunchStatus; -import com.fr.design.fun.DesignerTransform; +import com.fr.design.fun.DesignerProcessor; import com.fr.design.mainframe.DesignerContext; import com.fr.design.ui.util.UIUtil; import com.fr.event.Event; @@ -23,9 +23,9 @@ public class DesignerInitial { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - DesignerTransform transform = StableFactory.getMarkedInstanceObjectFromClass(DesignerTransform.MARK_STRING, DesignerTransform.class); - if (transform != null) { - designer = Reflect.on(transform.transform()).create(args).get(); + DesignerProcessor processor = StableFactory.getMarkedInstanceObjectFromClass(DesignerProcessor.MARK_STRING, DesignerProcessor.class); + if (processor != null) { + designer = Reflect.on(processor.transform()).create(args).get(); } else { designer = new MainDesigner(args); } From 651b1dbb3e2cfe285897cfb3908c9c3bf2b57a7a Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 11 May 2020 16:56:36 +0800 Subject: [PATCH 313/375] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=9D=99=E6=80=81?= =?UTF-8?q?=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../marker/VanChartCommonMarkerPane.java | 60 +------------------ .../series/VanChartGanttCommonMarkerPane.java | 18 +++++- .../chart/line/VanChartLineSeriesPane.java | 3 +- .../series/VanChartMapScatterMarkerPane.java | 3 +- .../scatter/VanChartScatterSeriesPane.java | 3 +- .../VanChartScatterMarkerConditionPane.java | 3 +- 6 files changed, 27 insertions(+), 63 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java index a35b8b64a..444bebfaa 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java @@ -41,12 +41,8 @@ public class VanChartCommonMarkerPane extends BasicBeanPane MarkerType.MARKER_DIAMOND_HOLLOW, MarkerType.MARKER_TRIANGLE_HOLLOW }; - private static Marker[] normalMarkers = null; - private static Marker[] normalMarkersWithNull = null; - private static Marker[] normalMarkersWithAuto = null; - private static Marker[] normalMarkersWithAutoAndNull = null; - private static Marker[] getNormalMarkersWithCustom(MarkerType[] types) { + protected Marker[] getNormalMarkersWithCustom(MarkerType[] types) { MarkerType[] customTypes = types == null ? new MarkerType[0] : types; Marker[] result = new Marker[customTypes.length + NORMAL_TYPES.length]; @@ -63,58 +59,6 @@ public class VanChartCommonMarkerPane extends BasicBeanPane return result; } - protected static Marker[] getNormalMarkers() { - if (normalMarkers == null) { - normalMarkers = getNormalMarkersWithCustom(new MarkerType[0]); - } - - return normalMarkers; - } - - protected static Marker[] getNormalMarkersWithNull() { - if (normalMarkersWithNull == null) { - normalMarkersWithNull = getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_NULL}); - } - - return normalMarkersWithNull; - } - - protected static Marker[] getNormalMarkersWithAuto() { - if (normalMarkersWithAuto == null) { - normalMarkersWithAuto = getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO}); - } - - return normalMarkersWithAuto; - } - - protected static Marker[] getNormalMarkersWithAutoAndNull() { - if (normalMarkersWithAutoAndNull == null) { - normalMarkersWithAutoAndNull = getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO, MarkerType.MARKER_NULL}); - } - - return normalMarkersWithAutoAndNull; - } - - //甘特图的菱形是实心的,之前写的空心。 - //兼容:模板属性不做兼容。只是之前空心做界面兼容。前台展现实心空心一样的效果,所以不用做什么 - private static final MarkerType[] GANTT_TYPES = { - MarkerType.MARKER_TRIANGLE, - MarkerType.MARKER_DIAMOND, - MarkerType.MARKER_STAR - }; - private static Marker[] ganttMarkers = null; - - protected static Marker[] getGanttMarkers() { - if (ganttMarkers == null) { - ganttMarkers = new Marker[GANTT_TYPES.length]; - int i = 0; - for (MarkerType markerType : GANTT_TYPES) { - ganttMarkers[i++] = Marker.createMarker(markerType); - } - } - return ganttMarkers; - } - public MarkerComboBox getMarkerTypeComboBox() { return markerTypeComboBox; } @@ -195,7 +139,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane } protected Marker[] getMarkers() { - return getNormalMarkersWithNull(); + return getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_NULL}); } /** diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttCommonMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttCommonMarkerPane.java index ff7b04e6f..1a438d6d4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttCommonMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttCommonMarkerPane.java @@ -18,11 +18,27 @@ import java.awt.Component; public class VanChartGanttCommonMarkerPane extends VanChartCommonMarkerPane { private static final int PREFERRED_WIDTH = 100; + //甘特图的菱形是实心的,之前写的空心。 + //兼容:模板属性不做兼容。只是之前空心做界面兼容。前台展现实心空心一样的效果,所以不用做什么 + private static final MarkerType[] GANTT_TYPES = { + MarkerType.MARKER_TRIANGLE, + MarkerType.MARKER_DIAMOND, + MarkerType.MARKER_STAR + }; + private ColorSelectBoxWithOutTransparent colorSelect; @Override protected Marker[] getMarkers() { - return getGanttMarkers(); + Marker[] result = new Marker[GANTT_TYPES.length]; + + int i = 0; + + for (MarkerType markerType : GANTT_TYPES) { + result[i++] = Marker.createMarker(markerType); + } + + return result; } protected Component[][] getMarkerTypeComponent() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java index 49a4f4465..5b0999ca3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java @@ -6,6 +6,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartBeautyPane; import com.fr.van.chart.designer.component.VanChartMarkerPane; @@ -55,7 +56,7 @@ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane { return new VanChartCommonMarkerPane() { protected Marker[] getMarkers() { - return getNormalMarkersWithAutoAndNull(); + return getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO, MarkerType.MARKER_NULL}); } }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java index 175cc8e25..2c70860c7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java @@ -3,6 +3,7 @@ package com.fr.van.chart.map.designer.style.series; import com.fr.chart.chartglyph.Marker; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; @@ -23,7 +24,7 @@ public class VanChartMapScatterMarkerPane extends VanChartCommonMarkerPane { @Override protected Marker[] getMarkers() { - return getNormalMarkers(); + return getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_NULL}); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java index 938f21da1..1bbb71e4d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java @@ -7,6 +7,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.van.chart.custom.component.VanChartCustomAxisConditionPane; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartLineTypePane; @@ -92,7 +93,7 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane { return new VanChartCommonMarkerPane() { protected Marker[] getMarkers() { - return getNormalMarkersWithAuto(); + return getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO}); } }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterMarkerConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterMarkerConditionPane.java index 4ac8543a6..06b617401 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterMarkerConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterMarkerConditionPane.java @@ -2,6 +2,7 @@ package com.fr.van.chart.scatter.component; import com.fr.chart.chartglyph.Marker; import com.fr.design.condition.ConditionAttributesPane; +import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.van.chart.designer.component.VanChartMarkerPane; import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; import com.fr.van.chart.designer.other.condition.item.VanChartMarkerConditionPane; @@ -18,7 +19,7 @@ public class VanChartScatterMarkerConditionPane extends VanChartMarkerConditionP return new VanChartCommonMarkerPane() { protected Marker[] getMarkers() { - return getNormalMarkersWithAuto(); + return getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO}); } }; } From ee953baced5538c00de1ddec79d8e8273bdf209a Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 11 May 2020 17:05:33 +0800 Subject: [PATCH 314/375] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E6=95=A3=E7=82=B9=E6=A0=87=E8=AE=B0=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../map/designer/style/series/VanChartMapScatterMarkerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java index 2c70860c7..8d8c16eba 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java @@ -24,7 +24,7 @@ public class VanChartMapScatterMarkerPane extends VanChartCommonMarkerPane { @Override protected Marker[] getMarkers() { - return getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_NULL}); + return getNormalMarkersWithCustom(new MarkerType[0]); } @Override From 23c25894ed5d0478c8cb07aefcfe3046774b7cbb Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 11 May 2020 17:20:49 +0800 Subject: [PATCH 315/375] =?UTF-8?q?REPORT-31315=20=20=E6=96=B0=E5=BB=BAcpt?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=8C=E9=9A=8F=E4=BE=BF=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E4=BA=86=E5=9B=9B=E4=B8=AA=E6=A0=BC=E5=AD=90=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=EF=BC=8C=E4=BD=86=E6=98=AF=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/burying/point/AbstractPointInfo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java index 394691d57..11058af5c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java @@ -42,7 +42,7 @@ public abstract class AbstractPointInfo implements BasePointInfo { } public void setTestTemplate(boolean testTemplate) { - testTemplate = testTemplate; + this.testTemplate = testTemplate; } /** From 3e2daccbbc6e164112323f606258a7a2e33fbcc2 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 11 May 2020 17:22:36 +0800 Subject: [PATCH 316/375] REPORT-30557 fix name --- ...ignerProcessor.java => DesignerStartClassProcessor.java} | 4 ++-- ...va => AbstractDesignerStartClassProcessorProcessor.java} | 6 +++--- .../src/main/java/com/fr/start/DesignerInitial.java | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) rename designer-base/src/main/java/com/fr/design/fun/{DesignerProcessor.java => DesignerStartClassProcessor.java} (71%) rename designer-base/src/main/java/com/fr/design/fun/impl/{AbstractDesignerProcessor.java => AbstractDesignerStartClassProcessorProcessor.java} (59%) diff --git a/designer-base/src/main/java/com/fr/design/fun/DesignerProcessor.java b/designer-base/src/main/java/com/fr/design/fun/DesignerStartClassProcessor.java similarity index 71% rename from designer-base/src/main/java/com/fr/design/fun/DesignerProcessor.java rename to designer-base/src/main/java/com/fr/design/fun/DesignerStartClassProcessor.java index aa9de716b..4874be802 100644 --- a/designer-base/src/main/java/com/fr/design/fun/DesignerProcessor.java +++ b/designer-base/src/main/java/com/fr/design/fun/DesignerStartClassProcessor.java @@ -11,9 +11,9 @@ import com.fr.start.BaseDesigner; * Created by hades on 2020/5/7 */ -public interface DesignerProcessor extends Mutable { +public interface DesignerStartClassProcessor extends Mutable { - String MARK_STRING = "DesignerProcessor"; + String MARK_STRING = "DesignerStartClassProcessor"; int CURRENT_LEVEL = 1; diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerProcessor.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerStartClassProcessorProcessor.java similarity index 59% rename from designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerProcessor.java rename to designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerStartClassProcessorProcessor.java index 1398a522f..7c94ffe37 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerProcessor.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractDesignerStartClassProcessorProcessor.java @@ -1,6 +1,6 @@ package com.fr.design.fun.impl; -import com.fr.design.fun.DesignerProcessor; +import com.fr.design.fun.DesignerStartClassProcessor; import com.fr.stable.fun.mark.API; /** @@ -8,8 +8,8 @@ import com.fr.stable.fun.mark.API; * @version 10.0 * Created by hades on 2020/5/7 */ -@API(level = DesignerProcessor.CURRENT_LEVEL) -public abstract class AbstractDesignerProcessor implements DesignerProcessor { +@API(level = DesignerStartClassProcessor.CURRENT_LEVEL) +public abstract class AbstractDesignerStartClassProcessorProcessor implements DesignerStartClassProcessor { @Override public String mark4Provider() { diff --git a/designer-realize/src/main/java/com/fr/start/DesignerInitial.java b/designer-realize/src/main/java/com/fr/start/DesignerInitial.java index 464e774ca..39c702af5 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerInitial.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerInitial.java @@ -1,7 +1,7 @@ package com.fr.start; import com.fr.design.constants.DesignerLaunchStatus; -import com.fr.design.fun.DesignerProcessor; +import com.fr.design.fun.DesignerStartClassProcessor; import com.fr.design.mainframe.DesignerContext; import com.fr.design.ui.util.UIUtil; import com.fr.event.Event; @@ -23,7 +23,7 @@ public class DesignerInitial { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - DesignerProcessor processor = StableFactory.getMarkedInstanceObjectFromClass(DesignerProcessor.MARK_STRING, DesignerProcessor.class); + DesignerStartClassProcessor processor = StableFactory.getMarkedInstanceObjectFromClass(DesignerStartClassProcessor.MARK_STRING, DesignerStartClassProcessor.class); if (processor != null) { designer = Reflect.on(processor.transform()).create(args).get(); } else { From e580d48e62967b86fb0fab0719b3be1d839817a6 Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 12 May 2020 09:05:07 +0800 Subject: [PATCH 317/375] =?UTF-8?q?REPORT-27207=20=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E5=A1=AB=E6=8A=A5=EF=BC=8C=E5=85=A5=E5=BA=93=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=89=E4=B8=AA=E7=B1=BB=E5=9E=8B=EF=BC=8C=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/editor/editor/WidgetNameEditor.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/editor/editor/WidgetNameEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/WidgetNameEditor.java index 80c545e92..bb5353f13 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/WidgetNameEditor.java +++ b/designer-base/src/main/java/com/fr/design/editor/editor/WidgetNameEditor.java @@ -4,6 +4,7 @@ import com.fr.design.DesignModelAdapter; import com.fr.design.gui.icombobox.FilterComboBox; import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.stable.StringUtils; import com.fr.stable.js.WidgetName; import javax.swing.JList; @@ -19,6 +20,8 @@ import java.awt.Component; * @since 2012-3-29下午6:04:37 */ public class WidgetNameEditor extends Editor { + static final WidgetName EMPTY_WIDGET_NAME = new WidgetName(StringUtils.EMPTY); + private FilterComboBox comb; @@ -79,7 +82,8 @@ public class WidgetNameEditor extends Editor { @Override public WidgetName getValue() { - return (WidgetName) comb.getSelectedItem(); + WidgetName widgetName = (WidgetName) comb.getSelectedItem(); + return widgetName == null ? EMPTY_WIDGET_NAME : widgetName; } @Override From 92f454fb39d70489181093a71bf1756ea1555abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 12 May 2020 14:15:03 +0800 Subject: [PATCH 318/375] =?UTF-8?q?CHART-13535=20=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E9=A2=84=E5=AE=9A=E4=B9=89=E6=A0=B7=E5=BC=8F=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E5=88=B7=E6=96=B0=E9=85=8D=E8=89=B2=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../combobox/ColorSchemeComboBox.java | 5 +++ .../fr/design/module/ChartPreStyleAction.java | 8 ++++- .../component/VanChartFillStylePane.java | 34 +++++++++++++++++-- 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java index 4358a728d..db59179a3 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java @@ -82,6 +82,11 @@ public class ColorSchemeComboBox extends UIComboBox { return colorSchemes; } + public void refresh() { + this.colorSchemes = getColorSchemesFromConfig(); + this.setModel(new DefaultComboBoxModel(colorSchemes.keySet().toArray())); + } + public ColorInfo getSelectColorInfo() { String selectedItem = (String) getSelectedItem(); return colorSchemes.get(selectedItem); diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java index e0dbd8ba0..2efe12ca1 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java @@ -54,6 +54,12 @@ public class ChartPreStyleAction extends UpdateAction { if (frame != null) { frame.repaint(); } + new Thread() { + @Override + public void run() { + DesignerContext.getDesignerBean("vanChartFillStyle").refreshBeanElement(); + } + }.start(); } })); } @@ -61,7 +67,7 @@ public class ChartPreStyleAction extends UpdateAction { pane.populateBean(); dialog.setVisible(true); - + } public static final MenuKeySet CHART_DEFAULT_STYLE = new MenuKeySet() { 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 63c24a221..be40fd59a 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 @@ -13,13 +13,17 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; +import com.fr.design.mainframe.DesignerBean; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.chart.gui.style.ChartColorAdjustPane; import com.fr.design.style.background.gradient.FixedGradientBar; +import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.StringUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.BorderFactory; import javax.swing.JPanel; +import java.util.List; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Color; @@ -31,7 +35,7 @@ import java.awt.event.ActionListener; /** * Created by mengao on 2017/8/17. */ -public class VanChartFillStylePane extends BasicBeanPane { +public class VanChartFillStylePane extends BasicBeanPane implements DesignerBean { protected ColorSchemeComboBox styleSelectBox; @@ -124,6 +128,8 @@ public class VanChartFillStylePane extends BasicBeanPane { VanChartFillStylePane.this.revalidate(); } }); + + DesignerContext.setDesignerBean("vanChartFillStyle", this); } protected void initLayout() { @@ -231,7 +237,31 @@ public class VanChartFillStylePane extends BasicBeanPane { def.setFillStyleName(Utils.objectToString(styleSelectBox.getSelectedItem())); return def; } else { - return updateDefaultColor(); + return updateModifyColor(); } } + + private AttrFillStyle updateModifyColor() { + AttrFillStyle condition = new AttrFillStyle(); + condition.clearColors(); + ColorSchemeComboBox.ColorInfo selectColorInfo = styleSelectBox.getSelectColorInfo(); + boolean isGradient = selectColorInfo.isGradient(); + List colors = selectColorInfo.getColors(); + condition.setColorList(colors); + condition.setCustomFillStyle(true); + condition.setColorStyle(isGradient ? ChartConstants.COLOR_GRADIENT : ChartConstants.COLOR_ACC); + return condition; + } + + /** + * 刷新组件对象 + */ + public void refreshBeanElement() { + AttrFillStyle attrFillStyle = updateBean(); + + styleSelectBox.refresh(); + + populateBean(attrFillStyle); + GUICoreUtils.repaint(this); + } } From 6f345858e9f7bf879b7f25a3a1b677e0dd657299 Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Tue, 12 May 2020 14:19:43 +0800 Subject: [PATCH 319/375] REPORT-28817 bugfix --- .../java/com/fr/design/parameter/ParameterPropertyPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java b/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java index b8bfe4e0b..7c967efed 100644 --- a/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java +++ b/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java @@ -124,7 +124,7 @@ public class ParameterPropertyPane extends JPanel{ hideInJForm = jt instanceof JForm && !(creator instanceof XWParameterLayout || creator.getParent() instanceof XWParameterLayout); } catch (NullPointerException ex) { - hideInJForm = true; + hideInJForm = toolbarPane.updateBean().length <= 0; } if (isVisible && toolbarPane.hasSelectedLabelItem() && !hideInJForm) { addParaPane.setVisible(true); From 39e5bcf935f9ccfa3c6ff18ddfec86cb6c8304db Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 12 May 2020 14:19:54 +0800 Subject: [PATCH 320/375] =?UTF-8?q?REPORT-30889=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=A4=8D=E7=94=A8=E7=9A=84=E5=9F=8B=E7=82=B9?= =?UTF-8?q?=20=E5=9F=8B=E7=82=B9=E8=BF=81=E7=A7=BB=E8=87=B3=E4=B8=BB=20jar?= =?UTF-8?q?=20=E4=B8=AD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/template/info/TemplateInfo.java | 7 ++++- .../template/info/TemplateProcessInfo.java | 17 ++++++----- .../info/TemplateInfoCollectorTest.java | 29 +++++++++++-------- .../template/info/JFormProcessInfo.java | 28 ++++++++++++++++-- .../template/info/JWorkBookProcessInfo.java | 13 ++++++--- 5 files changed, 68 insertions(+), 26 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java index 8faa727fe..78eddb00f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java @@ -10,9 +10,10 @@ import com.fr.json.JSONObject; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; +import com.fr.third.joda.time.DateTime; + import java.util.HashMap; import java.util.Map; -import com.fr.third.joda.time.DateTime; /** * 对应一张模版的记录 @@ -42,6 +43,7 @@ public class TemplateInfo extends AbstractPointInfo { private static final String ATTR_SAVE_RECORD = "saveRecord"; private static final String ATTR_PARA_APPLY = "paraApply"; private static final String ATTR_COMPONENTS_INFO = "components_info"; + private static final String ATTR_REUSE_CMP_LIST = "reuseCmptList"; private static final String TEST_TEMPLATE_FLAG = "test_template"; @@ -148,6 +150,7 @@ public class TemplateInfo extends AbstractPointInfo { writer.attr(ATTR_REPORT_TYPE, (int) processMap.get(ATTR_REPORT_TYPE)); writer.attr(ATTR_PARA_APPLY, (int) processMap.get(ATTR_PARA_APPLY)); writer.attr(ATTR_COMPONENTS_INFO, (String) processMap.get(ATTR_COMPONENTS_INFO)); + writer.attr(ATTR_REUSE_CMP_LIST, (String) processMap.get(ATTR_REUSE_CMP_LIST)); writer.end(); } @@ -179,6 +182,7 @@ public class TemplateInfo extends AbstractPointInfo { processMap.put(ATTR_REPORT_TYPE, reader.getAttrAsInt(ATTR_REPORT_TYPE, 0)); processMap.put(ATTR_PARA_APPLY, reader.getAttrAsInt(ATTR_PARA_APPLY, 0)); processMap.put(ATTR_COMPONENTS_INFO, reader.getAttrAsString(ATTR_COMPONENTS_INFO, StringUtils.EMPTY)); + processMap.put(ATTR_REUSE_CMP_LIST, reader.getAttrAsString(ATTR_REUSE_CMP_LIST, StringUtils.EMPTY)); processMap.put(ATTR_TEMPLATE_ID, templateID); } else if (XML_CONSUMING_MAP.equals(name)) { consumingMap.put(ATTR_CREATE_TIME, reader.getAttrAsString(ATTR_CREATE_TIME, StringUtils.EMPTY)); @@ -238,6 +242,7 @@ public class TemplateInfo extends AbstractPointInfo { processMap.put(ATTR_WIDGET_COUNT, processInfo.getWidgetCount()); processMap.put(ATTR_PARA_APPLY, processInfo.useParaPane() ? 1 : 0); processMap.put(ATTR_COMPONENTS_INFO, processInfo.getComponentsInfo().toString()); + processMap.put(ATTR_REUSE_CMP_LIST, processInfo.getReuseCmpList().toString()); this.processMap = processMap; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java index fc1defcdf..ea484e532 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java @@ -35,20 +35,23 @@ public abstract class TemplateProcessInfo { // 获取模板控件数 public abstract int getWidgetCount(); - + //是否是测试模板 public abstract boolean isTestTemplate(); - + //是否使用参数面板 public abstract boolean useParaPane(); - + //获取组件信息 public abstract JSONArray getComponentsInfo(); - - + + //获取重用组件数 + public abstract JSONArray getReuseCmpList(); + + public abstract void updateTemplateOperationInfo(TemplateOperate templateOption); - - + + protected boolean isTestCell(Object value, Style style) { if (value instanceof ChartCollection && isTestChartCollection((ChartCollection) value)) { return true; diff --git a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java index bd25f7368..9395ef5b3 100644 --- a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java +++ b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java @@ -6,7 +6,6 @@ import com.fr.invoke.Reflect; import com.fr.json.JSON; import com.fr.json.JSONArray; import com.fr.json.JSONFactory; -import com.fr.json.JSONObject; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.third.org.apache.commons.io.FileUtils; @@ -18,6 +17,7 @@ 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; @@ -34,6 +34,7 @@ import static org.junit.Assert.assertTrue; */ @RunWith(PowerMockRunner.class) @PrepareForTest({ProductConstants.class, MarketConfig.class, DesignerEnvManager.class}) +@SuppressStaticInitializationFor({"com.fr.jvm.assist.FineAssist"}) public class TemplateInfoCollectorTest { private String filePath; private String initialFileContent; @@ -58,6 +59,7 @@ public class TemplateInfoCollectorTest { EasyMock.expect(mockProcessInfo.useParaPane()).andReturn(false).anyTimes(); EasyMock.expect(mockProcessInfo.getComponentsInfo()).andReturn(new JSONArray()).anyTimes(); EasyMock.expect(mockProcessInfo.isTestTemplate()).andReturn(true).anyTimes(); + EasyMock.expect(mockProcessInfo.getReuseCmpList()).andReturn(JSONArray.create().add("reuse-id-1")).anyTimes(); EasyMock.replay(mockProcessInfo); // 缓存 tpl.info @@ -99,10 +101,11 @@ public class TemplateInfoCollectorTest { Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); Map processMap = Reflect.on(templateInfo).field("processMap").get(); - + assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + "\"cell_count\":13,\"paraApply\":0,\"block_count\":3,\"report_type\":0,\"components_info\":\"[]\"," + - "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\"}", + "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\",\"reuseCmptList\":\"[\\\"reuse-id-1\\\"]\"" + + "}", JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); Assert.assertEquals(71113, consumingMap.get("uid")); @@ -130,10 +133,11 @@ public class TemplateInfoCollectorTest { Map processMap = Reflect.on(templateInfo).field("processMap").get(); assertEquals(templateID, templateInfo.getTemplateID()); - + assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + "\"cell_count\":13,\"paraApply\":0,\"block_count\":3,\"report_type\":0,\"components_info\":\"[]\"," + - "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\"}", JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); + "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\",\"reuseCmptList\":\"[\\\"reuse-id-1\\\"]\"" + + "}", JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); Assert.assertEquals(71113, consumingMap.get("uid")); @@ -151,18 +155,19 @@ public class TemplateInfoCollectorTest { String templateID = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffa"; String originID = "16a988ce-8529-42f5-b17c-2ee849355071"; int timeConsume = 200; - + collector.collectInfo(templateID, originID, mockProcessInfo, timeConsume); - + // 检查是否写入成功 Reflect.on(collector).call("loadFromFile"); TemplateInfo templateInfo = getTemplateInfoByID(templateID); Map processMap = Reflect.on(templateInfo).field("processMap").get(); - - assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0,\"cell_count\":13," + - "\"paraApply\":0,\"block_count\":3,\"report_type\":0,\"components_info\":\"[]\"," + - "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\"}", JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); - + + assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + + "\"cell_count\":13,\"paraApply\":0,\"block_count\":3,\"report_type\":0,\"components_info\":\"[]\"," + + "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\",\"reuseCmptList\":\"[\\\"reuse-id-1\\\"]\"" + + "}", JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); + Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); Assert.assertEquals(71113, consumingMap.get("uid")); Assert.assertEquals("2020-05-07 17:25", consumingMap.get("create_time")); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java index 8496e2592..da64e78e4 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java @@ -1,9 +1,12 @@ package com.fr.design.mainframe.template.info; +import com.fr.base.iofile.attr.ExtendSharableAttrMark; import com.fr.chart.chartattr.ChartCollection; import com.fr.form.FormElementCaseProvider; import com.fr.form.main.Form; import com.fr.form.main.WidgetGather; +import com.fr.form.main.WidgetUtil; +import com.fr.form.ui.AbstractBorderStyleWidget; import com.fr.form.ui.BaseChartEditor; import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.ElementCaseEditorProvider; @@ -164,7 +167,7 @@ public class JFormProcessInfo extends TemplateProcessInfo { public boolean useParaPane() { return this.template.getParaContainer() != null; } - + @Override public JSONArray getComponentsInfo() { JSONArray ja = new JSONArray(); @@ -174,7 +177,27 @@ public class JFormProcessInfo extends TemplateProcessInfo { this.componentProcessInfoMap.clear(); return ja; } - + + @Override + public JSONArray getReuseCmpList() { + + final JSONArray jo = JSONArray.create(); + WLayout container = this.template.getContainer(); + WidgetUtil.bfsTraversalWidget(container, new WidgetUtil.BfsWidgetGather() { + @Override + public boolean dealWith(AbstractBorderStyleWidget styleWidget) { + ExtendSharableAttrMark widgetAttrMark = styleWidget.getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG); + if (widgetAttrMark != null) { + String shareId = widgetAttrMark.getShareId(); + jo.add(shareId); + return true; + } + return false; + } + }, AbstractBorderStyleWidget.class); + return jo; + } + @Override public void updateTemplateOperationInfo(TemplateOperate templateOperate) { if (ComparatorUtils.equals(ComponentCreateOperate.OPERATE_TYPE, templateOperate.getOperateType())) { @@ -184,6 +207,7 @@ public class JFormProcessInfo extends TemplateProcessInfo { addComponentRemoveInfo(templateOperate.toJSONObject()); } } + private void addComponentCreateInfo(JSONObject jsonObject) { String componentID = jsonObject.getString("componentID"); componentProcessInfoMap.put(componentID, jsonObject); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java index a058f7019..6f589b001 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java @@ -129,15 +129,20 @@ public class JWorkBookProcessInfo extends TemplateProcessInfo { } return parameterAttr.getParameterUI() != null; } - - + + @Override public JSONArray getComponentsInfo() { return new JSONArray(); } - + + @Override + public JSONArray getReuseCmpList() { + return JSONArray.create(); + } + @Override public void updateTemplateOperationInfo(TemplateOperate templateOption) { - + } } From 7d04bddf9459a58c28ce93ba91fa87977ab9e75a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 12 May 2020 16:44:40 +0800 Subject: [PATCH 321/375] =?UTF-8?q?CHART-13857=20=E8=AD=A6=E6=88=92?= =?UTF-8?q?=E7=BA=BF=E3=80=81=E8=B6=8B=E5=8A=BF=E7=BA=BF=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=BA=BF=E5=AE=BD=E5=BA=94=E4=B8=BA1px?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/component/VanChartTrendLinePane.java | 2 +- .../chart/designer/style/background/VanChartAlertValuePane.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java index 8f6d3456f..eb8bd0f16 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java @@ -35,7 +35,7 @@ public class VanChartTrendLinePane extends BasicPane{ private static final int PREFERRED_WIDTH = 100; private static final double LINE_WIDTH_MIN_VALUE = 0.5; private static final double LINE_WIDTH_DIERTA_VALUE = 0.5; - private static final double LINE_WIDTH_DEFAULT_VALUE = 2; + private static final double LINE_WIDTH_DEFAULT_VALUE = 1; private UITextField trendLineName; private ColorSelectBox trendLineColor; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java index 6f88e586c..85aff8362 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java @@ -47,7 +47,7 @@ public class VanChartAlertValuePane extends BasicBeanPane { private static final int PREFERRED_WIDTH = 100; private static final double LINE_WIDTH_MIN_VALUE = 0.5; private static final double LINE_WIDTH_DIERTA_VALUE = 0.5; - private static final double LINE_WIDTH_DEFAULT_VALUE = 2; + private static final double LINE_WIDTH_DEFAULT_VALUE = 1; private UIButtonGroup alertAxis; protected TinyFormulaPane alertValue; From a84c814f206e29110c1af20a34f1fed2d17a82d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 12 May 2020 17:32:20 +0800 Subject: [PATCH 322/375] =?UTF-8?q?CHART-13535=20=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/module/ChartPreStyleAction.java | 25 +++++++++++++++---- .../component/VanChartFillStylePane.java | 5 ++-- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java index 2efe12ca1..5d7a9e67d 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java @@ -1,6 +1,7 @@ package com.fr.design.module; import com.fr.base.ChartPreStyleConfig; +import com.fr.concurrent.NamedThreadFactory; import com.fr.design.actions.UpdateAction; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; @@ -8,11 +9,14 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrame; import com.fr.design.menu.MenuKeySet; import com.fr.general.IOUtils; +import com.fr.module.ModuleContext; import com.fr.transaction.CallBackAdaptor; import com.fr.transaction.Configurations; import com.fr.transaction.WorkerFacade; +import com.fr.van.chart.designer.component.VanChartFillStylePane; import javax.swing.KeyStroke; +import java.util.concurrent.ExecutorService; import java.awt.event.ActionEvent; /** @@ -22,6 +26,9 @@ import java.awt.event.ActionEvent; */ public class ChartPreStyleAction extends UpdateAction { + private static ExecutorService refreshDesignPool = ModuleContext.getExecutor().newFixedThreadPool( + 10, new NamedThreadFactory("refreshChartStylePane")); + public ChartPreStyleAction() { this.setMenuKeySet(CHART_DEFAULT_STYLE); this.setName(getMenuKeySet().getMenuKeySetName()+ "..."); @@ -54,12 +61,20 @@ public class ChartPreStyleAction extends UpdateAction { if (frame != null) { frame.repaint(); } - new Thread() { - @Override + if (refreshDesignPool.isTerminated()) { + synchronized (refreshDesignPool) { + if (refreshDesignPool.isTerminated()) { + refreshDesignPool = ModuleContext.getExecutor().newFixedThreadPool( + 10, new NamedThreadFactory("refreshChartStylePane")); + } + } + } + refreshDesignPool.execute(new Runnable() { + @Override public void run() { - DesignerContext.getDesignerBean("vanChartFillStyle").refreshBeanElement(); - } - }.start(); + DesignerContext.getDesignerBean(VanChartFillStylePane.name).refreshBeanElement(); + } + }); } })); } 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 be40fd59a..7173f9678 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 @@ -37,6 +37,7 @@ import java.awt.event.ActionListener; */ public class VanChartFillStylePane extends BasicBeanPane implements DesignerBean { + public static final String name = "vanChartFillStyle"; protected ColorSchemeComboBox styleSelectBox; protected JPanel customPane; @@ -75,6 +76,8 @@ public class VanChartFillStylePane extends BasicBeanPane implemen customPane.add(changeColorSetPane, BorderLayout.CENTER); initListener(); initLayout(); + DesignerContext.setDesignerBean(name, this); + } private void initListener() { @@ -128,8 +131,6 @@ public class VanChartFillStylePane extends BasicBeanPane implemen VanChartFillStylePane.this.revalidate(); } }); - - DesignerContext.setDesignerBean("vanChartFillStyle", this); } protected void initLayout() { From 386446f865c490cae243d0ea8f12b7cd89d5cd18 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 13 May 2020 10:11:21 +0800 Subject: [PATCH 323/375] =?UTF-8?q?REPORT-31399=20&&=20REPORT-30691=20?= =?UTF-8?q?=E6=96=B0=E8=87=AA=E9=80=82=E5=BA=94-=E8=A1=A8=E5=8D=95-web?= =?UTF-8?q?=E7=AB=AF=E5=B1=95=E7=A4=BA-=E6=8F=92=E4=BB=B6=E5=90=AF?= =?UTF-8?q?=E7=94=A8=E5=92=8C=E7=A6=81=E7=94=A8;=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=88=B6=E4=BD=9C=E4=BC=98=E5=8C=96=E3=80=91@kerry?= =?UTF-8?q?=EF=BC=8Ccpt=E6=A8=A1=E6=9D=BF=E6=B7=BB=E5=8A=A0=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E6=97=B6=EF=BC=8C=E5=8F=91=E7=8E=B0=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/creator/XWAbsoluteLayout.java | 4 ++-- .../com/fr/design/designer/creator/XWFitLayout.java | 4 ++-- .../com/fr/design/mainframe/CoverReportPane.java | 2 +- .../main/java/com/fr/design/mainframe/FormArea.java | 2 +- .../template/info/JWorkBookProcessInfo.java | 13 ++++++++----- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 22d702dfd..7c852f282 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -111,7 +111,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { private void initPercent(WAbsoluteLayout widget) { Toolkit toolkit = Toolkit.getDefaultToolkit(); Dimension scrnsize = toolkit.getScreenSize(); - double screenValue = FRScreen.getByDimension(scrnsize).getValue(); + double screenValue = FRScreen.getDesignScreenByDimension(scrnsize).getValue(); if (!AssistUtils.equals(screenValue, FormArea.DEFAULT_SLIDER)) { this.setContainerPercent(screenValue / FormArea.DEFAULT_SLIDER); } @@ -247,7 +247,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { */ @Override public void updateChildBound(int minHeight) { - double prevContainerPercent = FRScreen.getByDimension(toData().getDesigningResolution()).getValue() / FormArea.DEFAULT_SLIDER; + double prevContainerPercent = FRScreen.getDesignScreenByDimension(toData().getDesigningResolution()).getValue() / FormArea.DEFAULT_SLIDER; if (toData().getCompState() == 0 && !AssistUtils.equals(containerPercent, prevContainerPercent)) { for (int i = 0; i < this.getComponentCount(); i++) { XCreator creator = getXCreator(i); 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 3fb0b5f96..352899bcb 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 @@ -72,7 +72,7 @@ public class XWFitLayout extends XLayoutContainer { private void initPercent(){ Toolkit toolkit = Toolkit.getDefaultToolkit(); Dimension scrnsize = toolkit.getScreenSize(); - double screenValue = FRScreen.getByDimension(scrnsize).getValue(); + double screenValue = FRScreen.getDesignScreenByDimension(scrnsize).getValue(); if (!AssistUtils.equals(FormArea.DEFAULT_SLIDER, screenValue)) { this.setContainerPercent(screenValue / FormArea.DEFAULT_SLIDER); } @@ -1331,4 +1331,4 @@ public class XWFitLayout extends XLayoutContainer { } } } -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/CoverReportPane.java b/designer-form/src/main/java/com/fr/design/mainframe/CoverReportPane.java index a6ec28abb..d976691c6 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/CoverReportPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/CoverReportPane.java @@ -63,7 +63,7 @@ public class CoverReportPane extends CoverPane implements HelpDialogHandler{ // controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_CLOSE_ICON_PATH); controlButton.setVisible(false); helpDialog = new WidgetHelpDialog(DesignerContext.getDesignerFrame(), helpMsg); - double screenValue = FRScreen.getByDimension(Toolkit.getDefaultToolkit().getScreenSize()).getValue(); + double screenValue = FRScreen.getDesignScreenByDimension(Toolkit.getDefaultToolkit().getScreenSize()).getValue(); int offsetX = 0; if (screenValue < FormArea.DEFAULT_SLIDER) { offsetX = (int) ((1 - screenValue / FormArea.DEFAULT_SLIDER) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index ee1b1976c..fe692388b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -220,7 +220,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { private void initCalculateSize() { Toolkit toolkit = Toolkit.getDefaultToolkit(); Dimension scrnsize = toolkit.getScreenSize(); - this.screenValue = FRScreen.getByDimension(scrnsize).getValue(); + this.screenValue = FRScreen.getDesignScreenByDimension(scrnsize).getValue(); XLayoutContainer root = FormArea.this.designer.getRootComponent(); // 7.1.1不放缩放滑块,但表单大小仍按屏幕分辨率调整 // slidePane.populateBean(screenValue); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java index 6f589b001..c23a03f1c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java @@ -101,6 +101,9 @@ public class JWorkBookProcessInfo extends TemplateProcessInfo { for (int i = 0; i < columnLength; i++) { for (int j = 0; j < rowLength; j++) { TemplateCellElement templateCellElement = templateElementCase.getTemplateCellElement(i, j); + if (templateCellElement == null) { + continue; + } Object value = templateCellElement.getValue(); if (isTestCell(value, templateCellElement.getStyle())) { return true; @@ -129,20 +132,20 @@ public class JWorkBookProcessInfo extends TemplateProcessInfo { } return parameterAttr.getParameterUI() != null; } - - + + @Override public JSONArray getComponentsInfo() { return new JSONArray(); } - + @Override public JSONArray getReuseCmpList() { return JSONArray.create(); } - + @Override public void updateTemplateOperationInfo(TemplateOperate templateOption) { - + } } From 4317149adfefa7475808b62fdcaf12b8f3b5bc4c Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 13 May 2020 15:20:33 +0800 Subject: [PATCH 324/375] =?UTF-8?q?REPORT-31267=20&&=20=20REPORT-31413=20?= =?UTF-8?q?=E3=80=90=E6=A8=A1=E6=9D=BF=E5=88=B6=E4=BD=9C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91@kerry=EF=BC=8C=E5=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=88=B6=E4=BD=9C=E8=87=AA=E9=80=82=E5=BA=94=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E4=B8=8B=EF=BC=8C=E5=9F=8B=E7=82=B9=E7=9A=84widget=5Fcount?= =?UTF-8?q?=E4=B8=80=E5=BC=80=E5=A7=8B=E6=98=BE=E7=A4=BA1=EF=BC=8C?= =?UTF-8?q?=E5=90=8E=E9=9D=A2=E5=8A=A0=E4=B8=80=E4=B8=AA=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../burying/point/AbstractPointCollector.java | 17 +++++++++- .../chart/info/ChartInfoCollector.java | 17 ++-------- .../template/info/TemplateInfoCollector.java | 20 +++++------- .../template/info/ComponentOperate.java | 19 ++++++++++- .../template/info/JFormProcessInfo.java | 32 ++++++++++++------- .../info/ComponentCreateOperateTest.java | 15 +++++++++ .../template/info/JFormProcessInfoTest.java | 26 +++++++++++++++ 7 files changed, 106 insertions(+), 40 deletions(-) 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 a3665b77b..d9ab7cf9b 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 @@ -5,6 +5,8 @@ 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; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLableReader; @@ -121,10 +123,23 @@ public abstract class AbstractPointCollector implem } } + + private File getInfoFile() { + File file = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), getInfoFilePath())); + try { + if (!file.exists()) { + file.createNewFile(); + } + } catch (Exception ex) { + FineLoggerFactory.getLogger().error(ex.getMessage(), ex); + } + return file; + } + /** * 获取缓存文件存放路径 */ - protected abstract File getInfoFile(); + protected abstract String getInfoFilePath(); protected abstract void addIdleDayCount(); } 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 04c4c80d3..87dc8ca40 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 @@ -8,15 +8,10 @@ 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; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.ProductConstants; -import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; import com.fr.third.joda.time.DateTime; - -import java.io.File; import java.util.HashMap; import java.util.Map; @@ -235,16 +230,8 @@ public class ChartInfoCollector extends AbstractPointCollector { * 获取缓存文件存放路径 */ @Override - protected File getInfoFile() { - File file = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), XML_FILE_NAME)); - try { - if (!file.exists()) { - file.createNewFile(); - } - } catch (Exception ex) { - FineLoggerFactory.getLogger().error(ex.getMessage(), ex); - } - return file; + protected String getInfoFilePath() { + return XML_FILE_NAME; } @Override 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 42e7acce6..23c07ea3a 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 @@ -5,13 +5,10 @@ import com.fr.design.mainframe.burying.point.AbstractPointInfo; import com.fr.json.JSON; import com.fr.json.JSONFactory; import com.fr.json.JSONObject; -import com.fr.stable.ProductConstants; -import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; -import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -26,7 +23,7 @@ public class TemplateInfoCollector extends AbstractPointCollector private static final String XML_TEMPLATE_INFO_LIST = "TemplateInfoList"; private static final String XML_FILE_NAME = "tpl.info"; private static TemplateInfoCollector instance; - private DesignerOpenHistory designerOpenHistory; + private DesignerOpenHistory designerOpenHistory = DesignerOpenHistory.getInstance(); //记录指定模板最新的模板耗时信息ID private Map latestTemplateInfo; @@ -99,14 +96,6 @@ public class TemplateInfoCollector extends AbstractPointCollector return latestTemplateInfo.getTemplateCreateTime(); } - /** - * 获取缓存文件存放路径 - */ - @Override - protected File getInfoFile() { - return new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), XML_FILE_NAME)); - } - /** * 更新 day_count:打开设计器却未编辑模板的连续日子 */ @@ -172,6 +161,13 @@ public class TemplateInfoCollector extends AbstractPointCollector writer.end(); } + /** + * 获取缓存文件存放路径 + */ + @Override + protected String getInfoFilePath() { + return XML_FILE_NAME; + } @Override public void sendPointInfo() { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentOperate.java b/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentOperate.java index 9ca2cdba9..d82bc1688 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentOperate.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentOperate.java @@ -1,10 +1,13 @@ package com.fr.design.mainframe.template.info; +import com.fr.design.gui.core.WidgetOption; import com.fr.form.ui.ChartEditor; import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WCardLayout; +import com.fr.general.ComparatorUtils; import com.fr.json.JSONObject; /** @@ -50,6 +53,11 @@ public abstract class ComponentOperate implements TemplateOperate { Widget { @Override protected boolean acceptType(Widget widget) { + for (WidgetOption widgetOption : WidgetOption.getFormWidgetIntance()) { + if (ComparatorUtils.equals(widget.getClass(), widgetOption.widgetClass())) { + return true; + } + } return false; } }, @@ -62,7 +70,7 @@ public abstract class ComponentOperate implements TemplateOperate { Absolute { @Override protected boolean acceptType(Widget widget) { - return widget.acceptType(WAbsoluteLayout.class); + return widget.acceptType(WAbsoluteLayout.class) && !widget.acceptType(WAbsoluteBodyLayout.class); } }; @@ -76,5 +84,14 @@ public abstract class ComponentOperate implements TemplateOperate { } return Widget; } + + public static boolean supportComponent(Widget widget) { + for (ComponentType componentType : values()) { + if (componentType.acceptType(widget)) { + return true; + } + } + return false; + } } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java index da64e78e4..344bdab09 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.template.info; import com.fr.base.iofile.attr.ExtendSharableAttrMark; + import com.fr.chart.chartattr.ChartCollection; import com.fr.form.FormElementCaseProvider; import com.fr.form.main.Form; @@ -61,12 +62,21 @@ public class JFormProcessInfo extends TemplateProcessInfo { // 获取模板控件数 public int getWidgetCount() { - int widgetCount = 0; - for (int i = 0; i < template.getContainer().getWidgetCount(); i++) { - WLayout wl = (WLayout) template.getContainer().getWidget(i); - widgetCount += wl.getWidgetCount(); - } - return widgetCount; + final int[] widgetCount = {0}; + Form.traversalWidget(this.template.getContainer(), new WidgetGather() { + @Override + public void dealWith(Widget widget) { + if (ComponentOperate.ComponentType.supportComponent(widget)) { + widgetCount[0]++; + } + } + + @Override + public boolean dealWithAllCards() { + return true; + } + }, null); + return widgetCount[0]; } @Override @@ -167,7 +177,7 @@ public class JFormProcessInfo extends TemplateProcessInfo { public boolean useParaPane() { return this.template.getParaContainer() != null; } - + @Override public JSONArray getComponentsInfo() { JSONArray ja = new JSONArray(); @@ -177,10 +187,10 @@ public class JFormProcessInfo extends TemplateProcessInfo { this.componentProcessInfoMap.clear(); return ja; } - + @Override public JSONArray getReuseCmpList() { - + final JSONArray jo = JSONArray.create(); WLayout container = this.template.getContainer(); WidgetUtil.bfsTraversalWidget(container, new WidgetUtil.BfsWidgetGather() { @@ -197,7 +207,7 @@ public class JFormProcessInfo extends TemplateProcessInfo { }, AbstractBorderStyleWidget.class); return jo; } - + @Override public void updateTemplateOperationInfo(TemplateOperate templateOperate) { if (ComparatorUtils.equals(ComponentCreateOperate.OPERATE_TYPE, templateOperate.getOperateType())) { @@ -207,7 +217,7 @@ public class JFormProcessInfo extends TemplateProcessInfo { addComponentRemoveInfo(templateOperate.toJSONObject()); } } - + private void addComponentCreateInfo(JSONObject jsonObject) { String componentID = jsonObject.getString("componentID"); componentProcessInfoMap.put(componentID, jsonObject); diff --git a/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentCreateOperateTest.java b/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentCreateOperateTest.java index 1bebd0be7..2a6ec4ba6 100644 --- a/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentCreateOperateTest.java +++ b/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentCreateOperateTest.java @@ -1,9 +1,12 @@ package com.fr.design.mainframe.template.info; +import com.fr.form.ui.CardAddButton; +import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.ChartEditor; import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.FreeButton; import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WCardLayout; import com.fr.json.JSONObject; @@ -35,4 +38,16 @@ public class ComponentCreateOperateTest { Assert.assertEquals(ComponentOperate.ComponentType.Absolute, ComponentOperate.ComponentType.parseType(new WAbsoluteLayout())); Assert.assertEquals(ComponentOperate.ComponentType.TabLayout, ComponentOperate.ComponentType.parseType(new WCardLayout())); } + + @Test + public void testSupportComponent() { + Assert.assertTrue(ComponentOperate.ComponentType.supportComponent(new FreeButton())); + Assert.assertTrue(ComponentOperate.ComponentType.supportComponent(new ElementCaseEditor())); + Assert.assertTrue(ComponentOperate.ComponentType.supportComponent(new ChartEditor())); + Assert.assertTrue(ComponentOperate.ComponentType.supportComponent(new WAbsoluteLayout())); + Assert.assertTrue(ComponentOperate.ComponentType.supportComponent(new WCardLayout())); + Assert.assertFalse(ComponentOperate.ComponentType.supportComponent(new CardSwitchButton())); + Assert.assertFalse(ComponentOperate.ComponentType.supportComponent(new CardAddButton())); + Assert.assertFalse(ComponentOperate.ComponentType.supportComponent(new WAbsoluteBodyLayout())); + } } diff --git a/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java b/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java index 4db78a271..2d25c64c9 100644 --- a/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java +++ b/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java @@ -6,6 +6,7 @@ import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.ChartEditor; import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.FreeButton; +import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WCardLayout; @@ -146,4 +147,29 @@ public class JFormProcessInfoTest { ja = jFormProcessInfo.getComponentsInfo(); Assert.assertEquals(0, ja.size()); } + + @Test + public void testGetWidgetCount() { + Form form = new Form(); + WBorderLayout borderLayout = new WBorderLayout(); + form.setContainer(borderLayout); + WFitLayout fitLayout = new WFitLayout(); + borderLayout.addCenter(fitLayout); + fitLayout.addWidget(new FreeButton()); + fitLayout.addWidget(new ElementCaseEditor()); + JFormProcessInfo jFormProcessInfo = new JFormProcessInfo(form); + Assert.assertEquals(2, jFormProcessInfo.getWidgetCount()); + + fitLayout.addWidget(new ChartEditor()); + Assert.assertEquals(3, jFormProcessInfo.getWidgetCount()); + + fitLayout.addWidget(new WAbsoluteBodyLayout()); + Assert.assertEquals(3, jFormProcessInfo.getWidgetCount()); + + fitLayout.addWidget(new CardSwitchButton()); + Assert.assertEquals(3, jFormProcessInfo.getWidgetCount()); + + fitLayout.addWidget(new ChartEditor()); + Assert.assertEquals(4, jFormProcessInfo.getWidgetCount()); + } } From 449969f7c38629707dddeddbe3b12edd79cce58f Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 13 May 2020 17:28:05 +0800 Subject: [PATCH 325/375] =?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 --- .../mainframe/burying/point/AbstractPointCollector.java | 2 +- .../design/mainframe/template/info/JFormProcessInfo.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) 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 d9ab7cf9b..15291211c 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 @@ -128,7 +128,7 @@ public abstract class AbstractPointCollector implem File file = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), getInfoFilePath())); try { if (!file.exists()) { - file.createNewFile(); + StableUtils.makesureFileExist(file); } } catch (Exception ex) { FineLoggerFactory.getLogger().error(ex.getMessage(), ex); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java index 344bdab09..c9f7d761e 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java @@ -22,6 +22,7 @@ import com.fr.report.cell.DefaultTemplateCellElement; import java.util.Iterator; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -62,12 +63,12 @@ public class JFormProcessInfo extends TemplateProcessInfo { // 获取模板控件数 public int getWidgetCount() { - final int[] widgetCount = {0}; + final AtomicInteger widgetCount = new AtomicInteger(); Form.traversalWidget(this.template.getContainer(), new WidgetGather() { @Override public void dealWith(Widget widget) { if (ComponentOperate.ComponentType.supportComponent(widget)) { - widgetCount[0]++; + widgetCount.incrementAndGet(); } } @@ -76,7 +77,7 @@ public class JFormProcessInfo extends TemplateProcessInfo { return true; } }, null); - return widgetCount[0]; + return widgetCount.get(); } @Override From 0c4282585dae52d52bc1e144d9f6ff3d79cfb4e7 Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Wed, 13 May 2020 19:39:49 +0800 Subject: [PATCH 326/375] REPORT-28813 bugfix --- .../mainframe/ElementCasePaneDelegate.java | 62 ++++++++++++++++- .../form/FormElementCasePaneDelegate.java | 67 +++++++++++++++++-- 2 files changed, 123 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java index d4767e4d3..0976e8444 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -15,6 +15,7 @@ import com.fr.design.actions.edit.HyperlinkAction; import com.fr.design.actions.edit.merge.MergeCellAction; import com.fr.design.actions.edit.merge.UnmergeCellAction; import com.fr.design.actions.utils.DeprecatedActionManager; +import com.fr.design.base.mode.DesignModeContext; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListPane; @@ -35,8 +36,12 @@ import com.fr.page.ReportSettingsProvider; import com.fr.report.worksheet.WorkSheet; import com.fr.stable.ArrayUtils; -import javax.swing.JPanel; +import javax.swing.*; import java.awt.BorderLayout; +import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; + +import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; /** * 类说明: 设计面板中最上方的"插入" "单元格"下拉列表Menu模块. @@ -113,6 +118,61 @@ public class ElementCasePaneDelegate extends ElementCasePane { } } + @Override + protected void initInputActionMap() { + InputMap inputMapAncestor = this.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); + ActionMap actionMap = this.getActionMap(); + inputMapAncestor.clear(); + actionMap.clear(); + + if (!DesignModeContext.isBanCopyAndCut()) { + inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER), "cut"); + actionMap.put("cut", new AbstractAction() { + @Override + public void actionPerformed(ActionEvent evt) { + if (cut()) { + fireTargetModified(); + } + } + }); + inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), "copy"); + actionMap.put("copy", new AbstractAction() { + @Override + public void actionPerformed(ActionEvent evt) { + copy(); + } + }); + } + inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER), "paste"); + actionMap.put("paste", new AbstractAction() { + @Override + public void actionPerformed(ActionEvent evt) { + if (paste()) { + refreshPropertyPanes(); + repaint(); + } + } + }); + inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "delete_content"); + actionMap.put("delete_content", new AbstractAction() { + @Override + public void actionPerformed(ActionEvent evt) { + if (clearContents()) { + fireTargetModified(); + } + } + }); + inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, DEFAULT_MODIFIER), "delete_all"); + actionMap.put("delete_all", new AbstractAction() { + @Override + public void actionPerformed(ActionEvent evt) { + if (clearAll()) { + fireTargetModified(); + } + } + }); + } + @Override protected boolean supportRepeatedHeaderFooter() { return true; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java index d2740d681..1a2a988e0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe.form; -import javax.swing.JComponent; -import javax.swing.JPanel; +import javax.swing.*; import com.fr.design.DesignState; import com.fr.design.actions.UpdateAction; @@ -9,9 +8,9 @@ import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.form.FormECBackgroundAction; import com.fr.design.actions.form.FormECColumnsAction; import com.fr.design.actions.form.FormECFrozenAction; +import com.fr.design.base.mode.DesignModeContext; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; -import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.mainframe.*; import com.fr.design.mainframe.cell.QuickEditorRegion; @@ -22,13 +21,16 @@ import com.fr.design.menu.ToolBarDef; import com.fr.design.present.ConditionAttributesGroupPane; import com.fr.form.main.Form; import com.fr.grid.Grid; -import com.fr.js.NameJavaScriptGroup; import com.fr.page.ReportSettingsProvider; -import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.worksheet.FormElementCase; import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionListener; +import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; + +import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; + /** */ public class FormElementCasePaneDelegate extends ElementCasePane{ @@ -72,6 +74,61 @@ public class FormElementCasePaneDelegate extends ElementCasePane Date: Wed, 13 May 2020 19:44:58 +0800 Subject: [PATCH 327/375] =?UTF-8?q?REPORT-31412=20=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=88=B6=E4=BD=9C=E4=BC=98=E5=8C=96=E3=80=91@kerry?= =?UTF-8?q?=EF=BC=8C=E5=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8=E5=88=B6=E4=BD=9C?= =?UTF-8?q?=E7=BB=9D=E5=AF=B9=E5=B8=83=E5=B1=80=E4=B8=8B=EF=BC=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=BB=84=E4=BB=B6=E6=B2=A1=E6=9C=89=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/beans/models/SelectionModel.java | 2 +- .../template/info/ComponentOperate.java | 7 ++++++- .../info/ComponentCreateOperateTest.java | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index 33312483e..a8adfeb27 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -258,11 +258,11 @@ public class SelectionModel { designer.removeParaComponent(); } removeCreatorFromContainer(creator, creator.getWidth(), creator.getHeight()); + FormDesignerUtils.removeWidgetProcessInfo(creator.toData()); creator.deleteRelatedComponent(creator, designer); creator.removeAll(); // 清除被选中的组件 selection.reset(); - FormDesignerUtils.removeWidgetProcessInfo(creator.toData()); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentOperate.java b/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentOperate.java index d82bc1688..b6fd79d27 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentOperate.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentOperate.java @@ -7,6 +7,7 @@ import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WCardLayout; +import com.fr.form.ui.container.WTitleLayout; import com.fr.general.ComparatorUtils; import com.fr.json.JSONObject; @@ -23,7 +24,11 @@ public abstract class ComponentOperate implements TemplateOperate { private Widget widget; public ComponentOperate(Widget widget) { - this.widget = widget; + if (widget.acceptType(WTitleLayout.class)) { + this.widget = ((WTitleLayout) widget).getBodyBoundsWidget().getWidget(); + }else { + this.widget = widget; + } } @Override diff --git a/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentCreateOperateTest.java b/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentCreateOperateTest.java index 2a6ec4ba6..e11c33c55 100644 --- a/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentCreateOperateTest.java +++ b/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentCreateOperateTest.java @@ -9,14 +9,31 @@ import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WCardLayout; +import com.fr.form.ui.container.WTitleLayout; +import com.fr.general.ComparatorUtils; import com.fr.json.JSONObject; import org.junit.Assert; import org.junit.Test; +import java.awt.Rectangle; + /** * Created by kerry on 2020-05-08 */ public class ComponentCreateOperateTest { + + @Test + public void testConstructor(){ + ElementCaseEditor caseEditor = new ElementCaseEditor(); + caseEditor.setWidgetName("report0"); + caseEditor.setWidgetID("xxxx0"); + WTitleLayout wTitleLayout = new WTitleLayout(); + wTitleLayout.addBody(caseEditor, new Rectangle()); + ComponentOperate componentOperate0 = new ComponentCreateOperate(caseEditor); + ComponentOperate componentOperate1 = new ComponentCreateOperate(wTitleLayout); + ComparatorUtils.equals(componentOperate0.toJSONObject(), componentOperate1.toJSONObject()); + } + @Test public void testToJSONObject() { Widget button = new FreeButton(); From 1291d9c21547edd385983962b2e09d070bc4b78d Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Wed, 13 May 2020 19:51:11 +0800 Subject: [PATCH 328/375] =?UTF-8?q?REPORT-28813=20bugfix=20=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/ElementCasePaneDelegate.java | 9 +++++++-- .../mainframe/form/FormElementCasePaneDelegate.java | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java index 0976e8444..a41060e99 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -36,9 +36,14 @@ import com.fr.page.ReportSettingsProvider; import com.fr.report.worksheet.WorkSheet; import com.fr.stable.ArrayUtils; -import javax.swing.*; -import java.awt.BorderLayout; +import javax.swing.AbstractAction; +import javax.swing.ActionMap; +import javax.swing.InputMap; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.KeyStroke; import java.awt.event.ActionEvent; +import java.awt.BorderLayout; import java.awt.event.KeyEvent; import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java index 1a2a988e0..b8baf53dc 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java @@ -1,7 +1,5 @@ package com.fr.design.mainframe.form; -import javax.swing.*; - import com.fr.design.DesignState; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.core.ActionFactory; @@ -26,6 +24,12 @@ import com.fr.report.worksheet.FormElementCase; import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionListener; +import javax.swing.AbstractAction; +import javax.swing.ActionMap; +import javax.swing.InputMap; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.KeyStroke; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; From 68be58f8ce79fbc3b76cebb09d2a054a9361bb14 Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Thu, 14 May 2020 10:01:50 +0800 Subject: [PATCH 329/375] =?UTF-8?q?REPORT-28813=20bugfix=20=E6=B6=88?= =?UTF-8?q?=E9=99=A4=E8=BF=87=E5=A4=9A=E9=87=8D=E5=A4=8D=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/ElementCasePane.java | 10 ++- .../mainframe/ElementCasePaneDelegate.java | 64 ------------------- .../form/FormElementCasePaneDelegate.java | 64 +------------------ 3 files changed, 10 insertions(+), 128 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java index 85dbd4eb3..c9c906618 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java @@ -918,9 +918,7 @@ public abstract class ElementCasePane extends Tar actionMap.put("paste", new AbstractAction() { public void actionPerformed(ActionEvent evt) { if (paste()) { - QuickEditorRegion.getInstance().populate(getCurrentEditor()); - fireTargetModified(); - QuickEditorRegion.getInstance().populate(getCurrentEditor()); + afterPasteAction(); } } }); @@ -942,6 +940,12 @@ public abstract class ElementCasePane extends Tar }); } + protected void afterPasteAction() { + QuickEditorRegion.getInstance().populate(getCurrentEditor()); + fireTargetModified(); + QuickEditorRegion.getInstance().populate(getCurrentEditor()); + } + /** * 是否列表头可见 * diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java index a41060e99..ca95f6463 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -15,7 +15,6 @@ import com.fr.design.actions.edit.HyperlinkAction; import com.fr.design.actions.edit.merge.MergeCellAction; import com.fr.design.actions.edit.merge.UnmergeCellAction; import com.fr.design.actions.utils.DeprecatedActionManager; -import com.fr.design.base.mode.DesignModeContext; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListPane; @@ -36,17 +35,9 @@ import com.fr.page.ReportSettingsProvider; import com.fr.report.worksheet.WorkSheet; import com.fr.stable.ArrayUtils; -import javax.swing.AbstractAction; -import javax.swing.ActionMap; -import javax.swing.InputMap; -import javax.swing.JComponent; import javax.swing.JPanel; -import javax.swing.KeyStroke; -import java.awt.event.ActionEvent; import java.awt.BorderLayout; -import java.awt.event.KeyEvent; -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; /** * 类说明: 设计面板中最上方的"插入" "单元格"下拉列表Menu模块. @@ -123,61 +114,6 @@ public class ElementCasePaneDelegate extends ElementCasePane { } } - @Override - protected void initInputActionMap() { - InputMap inputMapAncestor = this.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); - ActionMap actionMap = this.getActionMap(); - inputMapAncestor.clear(); - actionMap.clear(); - - if (!DesignModeContext.isBanCopyAndCut()) { - inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER), "cut"); - actionMap.put("cut", new AbstractAction() { - @Override - public void actionPerformed(ActionEvent evt) { - if (cut()) { - fireTargetModified(); - } - } - }); - inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), "copy"); - actionMap.put("copy", new AbstractAction() { - @Override - public void actionPerformed(ActionEvent evt) { - copy(); - } - }); - } - inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER), "paste"); - actionMap.put("paste", new AbstractAction() { - @Override - public void actionPerformed(ActionEvent evt) { - if (paste()) { - refreshPropertyPanes(); - repaint(); - } - } - }); - inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "delete_content"); - actionMap.put("delete_content", new AbstractAction() { - @Override - public void actionPerformed(ActionEvent evt) { - if (clearContents()) { - fireTargetModified(); - } - } - }); - inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, DEFAULT_MODIFIER), "delete_all"); - actionMap.put("delete_all", new AbstractAction() { - @Override - public void actionPerformed(ActionEvent evt) { - if (clearAll()) { - fireTargetModified(); - } - } - }); - } - @Override protected boolean supportRepeatedHeaderFooter() { return true; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java index b8baf53dc..1108c4741 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java @@ -6,7 +6,6 @@ import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.form.FormECBackgroundAction; import com.fr.design.actions.form.FormECColumnsAction; import com.fr.design.actions.form.FormECFrozenAction; -import com.fr.design.base.mode.DesignModeContext; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; import com.fr.design.gui.frpane.HyperlinkGroupPane; @@ -24,16 +23,8 @@ import com.fr.report.worksheet.FormElementCase; import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionListener; -import javax.swing.AbstractAction; -import javax.swing.ActionMap; -import javax.swing.InputMap; import javax.swing.JComponent; import javax.swing.JPanel; -import javax.swing.KeyStroke; -import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; - -import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; /** */ @@ -79,58 +70,9 @@ public class FormElementCasePaneDelegate extends ElementCasePane Date: Thu, 14 May 2020 10:04:26 +0800 Subject: [PATCH 330/375] =?UTF-8?q?REPORT-28813=20bugfix=20=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E5=AD=90=E7=B1=BB=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/ElementCasePaneDelegate.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java index ca95f6463..696c732f3 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -114,6 +114,12 @@ public class ElementCasePaneDelegate extends ElementCasePane { } } + @Override + protected void afterPasteAction() { + refreshPropertyPanes(); + repaint(); + } + @Override protected boolean supportRepeatedHeaderFooter() { return true; From 233b692e038224475e244d984968766402aba2b1 Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 14 May 2020 15:00:37 +0800 Subject: [PATCH 331/375] =?UTF-8?q?REPORT-30068=E3=80=90=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E3=80=91=E6=97=A5=E5=BF=97=E7=95=8C=E9=9D=A2=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=98=BE=E7=A4=BA=E9=81=AE=E6=8C=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../loghandler/DesignerLogHandler.java | 2 +- .../mainframe/loghandler/LogHandlerBar.java | 318 ++++++++---------- .../mainframe/loghandler/LogHandlerBarUI.java | 9 +- 3 files changed, 151 insertions(+), 178 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java index 5937770c4..b935eb11e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java @@ -45,7 +45,7 @@ public class DesignerLogHandler { private final SimpleDateFormat LOG_SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - private static final int GAP_X = -150; + private static final int GAP_X = -75; private static final int INFO_GAP_Y = -60; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java index ddb16de04..f86cb22ef 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java @@ -2,183 +2,161 @@ package com.fr.design.mainframe.loghandler; import com.fr.base.BaseUtils; import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.ui.util.UIUtil; import javax.swing.*; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import java.util.concurrent.atomic.AtomicBoolean; -public class LogHandlerBar extends JPanel implements ItemSelectable { - - private static final long serialVersionUID = 1L; - private ItemListener listeners; - private UIButton clear; - private UIButton selectedall; - private UIButton set; - - private String text; - private int INFONUM = 0; - private int ERRORNUM = 0; - private int SERVERNUM = 0; - - private boolean isWithSerious; - - public LogHandlerBar() { - this(null); - } - - public LogHandlerBar(String text) { - this.setLayout(new CaptionLayout()); - this.setUI(new LogHandlerBarUI()); - this.text = text; - clear = new UIButton(BaseUtils.readIcon("com/fr/design/images/log/clear.png")); - clear.setMargin(null); - clear.setOpaque(false); - clear.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - clear.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_All")); - selectedall = new UIButton(BaseUtils.readIcon("com/fr/design/images/log/selectedall.png")); - selectedall.setMargin(null); - selectedall.setOpaque(false); - selectedall.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - selectedall.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select_All")); - set = new UIButton(BaseUtils.readIcon("com/fr/design/images/log/setting.png")); - set.setMargin(null); - set.setOpaque(false); - set.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - set.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set")); - - this.add(clear); - this.add(selectedall); - this.add(set); - } - - public void clearMessage() { - INFONUM = ERRORNUM = SERVERNUM = 0; - repaint(); - } - - public boolean IsWithSerious() { - return isWithSerious; - } - - public void setWithSerious(boolean b) { - this.isWithSerious = b; - } - - public void infoAdd() { - INFONUM++; - repaint(); - } - - public void errorAdd() { - ERRORNUM++; - timerPaint(); - } - - public void serverAdd() { - SERVERNUM++; - timerPaint(); - } - - private AtomicBoolean painting = new AtomicBoolean(false); - - public void timerPaint() { - if(!painting.get()) { - painting.set(true); - repaint(); - painting.set(false); - } - } - - public int getInfo() { - return INFONUM; - } - - public int getError() { - return ERRORNUM; - } - - public int getServer() { - return SERVERNUM; - } - - public void addItemListener(ItemListener l) { - listeners = l; - } - - public void removeItemListener(ItemListener l) { - listeners = null; - } - - protected void fireItemStateChanged(ItemEvent e) { - listeners.itemStateChanged(e); - } - - public Object[] getSelectedObjects() { - return new Object[] { text }; - } - - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - repaint(); - } - - public void addClearListener(ActionListener l) { - clear.addActionListener(l); - } - - public void addSelectedListener(ActionListener l) { - selectedall.addActionListener(l); - } - - public void addSetListener(ActionListener l) { - set.addActionListener(l); - } - - private class CaptionLayout implements LayoutManager { - - @Override - public void addLayoutComponent(String name, Component comp) { - - } - - @Override - public void removeLayoutComponent(Component comp) { - - } - - @Override - public Dimension preferredLayoutSize(Container parent) { - return new Dimension(120, 24); - } +import static com.fr.design.i18n.Toolkit.i18nText; - @Override - public Dimension minimumLayoutSize(Container parent) { - return new Dimension(0, 0); - } - - @Override - public void layoutContainer(Container target) { - Insets insets = target.getInsets(); - int top = insets.top; - int right = target.getWidth() - insets.right; - clear.setBounds(right - CLEAR_OFFSET, top + TOP_OFFSET, clear.getPreferredSize().width, clear.getPreferredSize().height); - selectedall.setBounds(right - SELECT_OFFSET, top + TOP_OFFSET, selectedall.getPreferredSize().width, selectedall.getPreferredSize().height); - set.setBounds(right - SET_OFFSET, top + TOP_OFFSET, set.getPreferredSize().width, set.getPreferredSize().height); - - } - - private static final int CLEAR_OFFSET = 130; - private static final int TOP_OFFSET = 4; - private static final int SELECT_OFFSET = 100; - private static final int SET_OFFSET = 70; - } +public class LogHandlerBar extends JPanel implements ItemSelectable { + private static final long serialVersionUID = 1L; + private ItemListener listeners; + private UIButton clear; + private UIButton selectedall; + private UIButton set; + private UILabel normalLabel; + private UILabel alertLabel; + private UILabel seriouslyLabel; + + private String text; + private int INFONUM = 0; + private int ERRORNUM = 0; + private int SERVERNUM = 0; + private static final int FLOW_LAYOUT_HGAP = 10; + private static final int FLOW_LAYOUT_VGAP = 5; + + private boolean isWithSerious; + + public LogHandlerBar() { + this(null); + } + + public LogHandlerBar(String text) { + this.setLayout(new FlowLayout(FlowLayout.RIGHT, FLOW_LAYOUT_HGAP, FLOW_LAYOUT_VGAP)); + this.setUI(new LogHandlerBarUI()); + this.text = text; + clear = new UIButton(BaseUtils.readIcon("com/fr/design/images/log/clear.png")); + clear.setMargin(null); + clear.setOpaque(false); + clear.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + clear.setToolTipText(i18nText("Fine-Design_Basic_Clear_All")); + selectedall = new UIButton(BaseUtils.readIcon("com/fr/design/images/log/selectedall.png")); + selectedall.setMargin(null); + selectedall.setOpaque(false); + selectedall.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + selectedall.setToolTipText(i18nText("Fine-Design_Basic_Select_All")); + set = new UIButton(BaseUtils.readIcon("com/fr/design/images/log/setting.png")); + set.setMargin(null); + set.setOpaque(false); + set.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + set.setToolTipText(i18nText("Fine-Design_Report_Set")); + normalLabel = new UILabel(i18nText("Fine-Design_Basic_NNormal") + "(0)"); + alertLabel = new UILabel(i18nText("Fine-Design_Basic_Alert") + "(0)"); + seriouslyLabel = new UILabel(i18nText("Fine-Design_Basic_Seriously") + "(0)"); + + this.add(normalLabel); + this.add(alertLabel); + this.add(seriouslyLabel); + this.add(clear); + this.add(selectedall); + this.add(set); + } + + /** + * 更新日志数量统计标签 + */ + private void changeLabel() { + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + normalLabel.setText(i18nText("Fine-Design_Basic_NNormal") + '(' + getInfo() + ')'); + alertLabel.setText(i18nText("Fine-Design_Basic_Alert") + '(' + getError() + ')'); + seriouslyLabel.setText(i18nText("Fine-Design_Basic_Seriously") + '(' + getServer() + ')'); + } + }); + } + + public void clearMessage() { + INFONUM = ERRORNUM = SERVERNUM = 0; + changeLabel(); + } + + public boolean IsWithSerious() { + return isWithSerious; + } + + public void setWithSerious(boolean b) { + this.isWithSerious = b; + } + + public void infoAdd() { + INFONUM++; + changeLabel(); + } + + public void errorAdd() { + ERRORNUM++; + changeLabel(); + } + + public void serverAdd() { + SERVERNUM++; + changeLabel(); + } + + public int getInfo() { + return INFONUM; + } + + public int getError() { + return ERRORNUM; + } + + public int getServer() { + return SERVERNUM; + } + + public void addItemListener(ItemListener l) { + listeners = l; + } + + public void removeItemListener(ItemListener l) { + listeners = null; + } + + protected void fireItemStateChanged(ItemEvent e) { + listeners.itemStateChanged(e); + } + + public Object[] getSelectedObjects() { + return new Object[]{text}; + } + + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + repaint(); + } + + public void addClearListener(ActionListener l) { + clear.addActionListener(l); + } + + public void addSelectedListener(ActionListener l) { + selectedall.addActionListener(l); + } + + public void addSetListener(ActionListener l) { + set.addActionListener(l); + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java index bbb9eed34..d11881708 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java @@ -1,5 +1,7 @@ package com.fr.design.mainframe.loghandler; +import javax.swing.JComponent; +import javax.swing.plaf.ComponentUI; import java.awt.Color; import java.awt.Cursor; import java.awt.FontMetrics; @@ -11,9 +13,6 @@ import java.awt.event.FocusListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; -import javax.swing.JComponent; -import javax.swing.plaf.ComponentUI; - public class LogHandlerBarUI extends ComponentUI implements MouseListener, FocusListener { @@ -99,10 +98,6 @@ public class LogHandlerBarUI extends ComponentUI implements MouseListener, Focus if (button.getText() != null) { g.drawString(button.getText(), textLeadingGap, y); } - - g.drawString(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_NNormal") + '(' + button.getInfo() + ')', button.getWidth() - 310, y); - g.drawString(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert") + '(' + button.getError() + ')', button.getWidth() - 250, y); - g.drawString(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Seriously") + '(' + button.getServer() + ')', button.getWidth() - 190, y); } /** From 5b730fa256181661e2318c5cbc32326f0eb39cf5 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 14 May 2020 15:46:05 +0800 Subject: [PATCH 332/375] =?UTF-8?q?REPORT-30739=E3=80=9010.0.6=E5=BC=80?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E3=80=91=E5=AD=97=E4=BD=93=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E6=94=B9=E6=88=90=E5=83=8F=E7=B4=A0=E7=9A=84=E5=8F=AF=E8=A1=8C?= =?UTF-8?q?=E6=80=A7=E7=A0=94=E7=A9=B6=EF=BC=8C=E5=8F=8A=E5=BC=80=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/FormAdaptiveConfigUIProcessor.java | 7 + .../fr/design/designer/creator/XButton.java | 30 +-- .../fr/design/designer/creator/XLabel.java | 5 +- .../design/form/util/FontTransformUtil.java | 46 +++++ .../form/util/FontTransformUtilTest.java | 68 +++++++ .../design/cell/editor/RichTextToolBar.java | 180 +++++++++--------- 6 files changed, 225 insertions(+), 111 deletions(-) create mode 100644 designer-form/src/main/java/com/fr/design/form/util/FontTransformUtil.java create mode 100644 designer-form/src/test/java/com/fr/design/form/util/FontTransformUtilTest.java diff --git a/designer-base/src/main/java/com/fr/design/fun/FormAdaptiveConfigUIProcessor.java b/designer-base/src/main/java/com/fr/design/fun/FormAdaptiveConfigUIProcessor.java index 1f2853b91..ebe0e8c3d 100644 --- a/designer-base/src/main/java/com/fr/design/fun/FormAdaptiveConfigUIProcessor.java +++ b/designer-base/src/main/java/com/fr/design/fun/FormAdaptiveConfigUIProcessor.java @@ -32,5 +32,12 @@ public interface FormAdaptiveConfigUIProcessor extends Immutable { */ BufferedImage paintFormElementCaseImage(Dimension size, JComponent elementCasePane); + + /** + * 获取新自适应下字体显示的dpi + * @return dpi + */ + int fontResolution(); + } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java index e94022ebe..44996df8c 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java @@ -3,8 +3,8 @@ */ package com.fr.design.designer.creator; -import com.fr.base.ScreenResolution; import com.fr.base.background.GradientBackground; +import com.fr.design.form.util.FontTransformUtil; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.widget.editors.ButtonTypeEditor; @@ -40,13 +40,13 @@ import java.beans.IntrospectionException; * @since 6.5.3 */ public class XButton extends XWidgetCreator { - + public final static Background DEFAULTBG = new GradientBackground(new Color(247,247,247),new Color(210,210,210), GradientBackground.TOP2BOTTOM); public final static Font DEFAULTFT = new Font("Song_TypeFace",0,12); public final static Color DEFAULTFOREGROUNDCOLOR = Color.BLACK; private Background bg; private UILabel contentLabel; - + public XButton(Button widget, Dimension initSize) { this(new FreeButton(widget),initSize); } @@ -54,11 +54,11 @@ public class XButton extends XWidgetCreator { public XButton(FreeButton widget, Dimension initSize) { super(widget, initSize); } - + public XButton(FormSubmitButton widget, Dimension initSize) { super(widget, initSize); } - + public Background getContentBackground() { return bg; } @@ -74,7 +74,7 @@ public class XButton extends XWidgetCreator { public void setContentLabel(UILabel contentLabel) { this.contentLabel = contentLabel; } - + /** *根据下拉框选择返回按钮样式的默认设置或自定义设置列表 * @return 列表 @@ -148,7 +148,7 @@ public class XButton extends XWidgetCreator { FreeButton button = (FreeButton) data; if (button.getFont() != null) { contentLabel.setFont(button.getFont().applyResolutionNP( - ScreenResolution.getScreenResolution())); + FontTransformUtil.getDesignerFontResolution())); contentLabel.setForeground(button.getFont().getForeground()); } } @@ -205,7 +205,7 @@ public class XButton extends XWidgetCreator { protected UILabel initContentLabel() { return new UILabel(); } - + @Override public void paintComponent(Graphics g) { super.paintComponent(g); @@ -218,15 +218,15 @@ public class XButton extends XWidgetCreator { bg.paint(g, new Rectangle2D.Double(0, 0, panelSize.getWidth(), panelSize.getHeight())); } } - + public void setButtonText(String text) { contentLabel.setText(text); } - + private void checkButonType() { UILabel l = contentLabel; FreeButton button = (FreeButton) data; - + if (!button.isCustomStyle()) { l.setBorder(BorderFactory.createLineBorder(new Color(148, 148, 148))); bg = DEFAULTBG; @@ -240,7 +240,7 @@ public class XButton extends XWidgetCreator { editor.add(l,BorderLayout.CENTER); if (button.getFont() != null) { contentLabel.setFont(button.getFont().applyResolutionNP( - ScreenResolution.getScreenResolution())); + FontTransformUtil.getDesignerFontResolution())); contentLabel.setForeground(button.getFont().getForeground()); } l.setBounds(0, 0, button.getButtonWidth() == 0 ? this.getWidth() : button.getButtonWidth(), button @@ -248,7 +248,7 @@ public class XButton extends XWidgetCreator { bg = button.getInitialBackground(); } } - + @Override protected void initXCreatorProperties() { super.initXCreatorProperties(); @@ -257,7 +257,7 @@ public class XButton extends XWidgetCreator { FreeButton button = (FreeButton) data; l.setText(button.getText()); if (button.isCustomStyle() && button.getFont() != null) { - l.setFont(button.getFont().applyResolutionNP(ScreenResolution.getScreenResolution())); + l.setFont(button.getFont().applyResolutionNP(FontTransformUtil.getDesignerFontResolution())); l.setForeground(button.getFont().getForeground()); } @@ -303,7 +303,7 @@ public class XButton extends XWidgetCreator { checkButonType(); if (button.getFont() != null) { contentLabel.setFont(button.getFont().applyResolutionNP( - ScreenResolution.getScreenResolution())); + FontTransformUtil.getDesignerFontResolution())); contentLabel.setForeground(button.getFont().getForeground()); } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XLabel.java b/designer-form/src/main/java/com/fr/design/designer/creator/XLabel.java index 233c369c4..df2252c7a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XLabel.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XLabel.java @@ -4,9 +4,9 @@ package com.fr.design.designer.creator; import com.fr.base.BaseUtils; -import com.fr.base.ScreenResolution; import com.fr.base.Style; import com.fr.design.border.UIRoundedBorder; +import com.fr.design.form.util.FontTransformUtil; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.widget.editors.FontEditor; @@ -98,7 +98,8 @@ public class XLabel extends XWidgetCreator { .toString(), Style.getInstance(label.getFont()).deriveHorizontalAlignment(label.getTextalign()) .deriveVerticalAlignment(label.isVerticalCenter() ? SwingConstants.CENTER : SwingConstants.TOP) .deriveTextStyle(label.isWrap() ? Style.TEXTSTYLE_WRAPTEXT : Style.TEXTSTYLE_SINGLELINE), - ScreenResolution.getScreenResolution()); + FontTransformUtil.getDesignerFontResolution()); + } } diff --git a/designer-form/src/main/java/com/fr/design/form/util/FontTransformUtil.java b/designer-form/src/main/java/com/fr/design/form/util/FontTransformUtil.java new file mode 100644 index 000000000..769707ebe --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/form/util/FontTransformUtil.java @@ -0,0 +1,46 @@ +package com.fr.design.form.util; + + +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.fun.FormAdaptiveConfigUIProcessor; +import com.fr.stable.Constants; +import com.fr.stable.unit.PT; + + +/** + * Created by kerry on 2020-04-16 + */ +public class FontTransformUtil { + + /** + * 获取设计器字体显示dpi + * @return dpi + */ + public static int getDesignerFontResolution() { + int dpi = Constants.FR_PAINT_RESOLUTION; + FormAdaptiveConfigUIProcessor adaptiveConfigUI = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUIProcessor.MARK_STRING); + if (adaptiveConfigUI != null) { + dpi = adaptiveConfigUI.fontResolution(); + } + return dpi; + } + + /** + * pt值转px + * @param value pt值 + * @return px值 + */ + public static double pt2px(double value) { + return PT.pt2pix(value, getDesignerFontResolution()); + } + + /** + * px值转pt + * @param value px值 + * @return pt值 + */ + public static double px2pt(double value) { + return value * (double) Constants.DEFAULT_FONT_PAINT_RESOLUTION / (double) getDesignerFontResolution(); + } + +} diff --git a/designer-form/src/test/java/com/fr/design/form/util/FontTransformUtilTest.java b/designer-form/src/test/java/com/fr/design/form/util/FontTransformUtilTest.java new file mode 100644 index 000000000..224ca551c --- /dev/null +++ b/designer-form/src/test/java/com/fr/design/form/util/FontTransformUtilTest.java @@ -0,0 +1,68 @@ +package com.fr.design.form.util; + +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.fun.FormAdaptiveConfigUIProcessor; +import com.fr.stable.Constants; +import org.easymock.EasyMock; +import org.junit.Assert; +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.modules.junit4.PowerMockRunner; + +/** + * Created by kerry on 2020-05-14 + */ +@RunWith(PowerMockRunner.class) +@PrepareForTest(ExtraDesignClassManager.class) +public class FontTransformUtilTest { + + @Test + public void testGetDesignerFontResolution() { + mockEnvironment(Constants.DEFAULT_FONT_PAINT_RESOLUTION); + Assert.assertEquals(Constants.DEFAULT_FONT_PAINT_RESOLUTION, FontTransformUtil.getDesignerFontResolution()); + + mockEnvironment(Constants.DEFAULT_WEBWRITE_AND_SCREEN_RESOLUTION); + Assert.assertEquals(Constants.DEFAULT_WEBWRITE_AND_SCREEN_RESOLUTION, FontTransformUtil.getDesignerFontResolution()); + + } + + @Test + public void testPt2px() { + mockEnvironment(Constants.DEFAULT_FONT_PAINT_RESOLUTION); + Assert.assertEquals(12, (int) FontTransformUtil.pt2px(12)); + + mockEnvironment(Constants.DEFAULT_WEBWRITE_AND_SCREEN_RESOLUTION); + Assert.assertEquals(16, (int) FontTransformUtil.pt2px(12)); + } + + @Test + public void testPx2pt() { + mockEnvironment(Constants.DEFAULT_FONT_PAINT_RESOLUTION); + Assert.assertEquals(12, (int) FontTransformUtil.px2pt(12)); + + mockEnvironment(Constants.DEFAULT_WEBWRITE_AND_SCREEN_RESOLUTION); + Assert.assertEquals(9, (int) FontTransformUtil.px2pt(12)); + } + + + private void mockEnvironment(int dpi) { + ExtraDesignClassManager mockDesignManager = EasyMock.mock(ExtraDesignClassManager.class); + EasyMock.expect(mockDesignManager.getSingle(FormAdaptiveConfigUIProcessor.MARK_STRING)) + .andReturn(mockProcessor(dpi)).anyTimes(); + EasyMock.replay(mockDesignManager); + + PowerMock.mockStatic(ExtraDesignClassManager.class); + EasyMock.expect(ExtraDesignClassManager.getInstance()).andReturn(mockDesignManager).once(); + PowerMock.replayAll(ExtraDesignClassManager.class); + } + + private FormAdaptiveConfigUIProcessor mockProcessor(int dpi) { + FormAdaptiveConfigUIProcessor processor = EasyMock.mock(FormAdaptiveConfigUIProcessor.class); + EasyMock.expect(processor.fontResolution()).andReturn(dpi).once(); + EasyMock.replay(processor); + return processor; + } + +} diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java index 5fc09d53f..37e6cd9db 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java @@ -1,5 +1,5 @@ /** - * + * */ package com.fr.design.cell.editor; @@ -8,6 +8,7 @@ import com.fr.base.BaseUtils; import com.fr.base.Utils; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.form.util.FontTransformUtil; import com.fr.design.formula.FormulaFactory; import com.fr.design.formula.UIFormula; import com.fr.design.gui.ibutton.UIButton; @@ -21,7 +22,6 @@ import com.fr.design.style.color.UIToolbarColorButton; import com.fr.general.FRFont; import com.fr.log.FineLoggerFactory; import com.fr.report.cell.cellattr.core.RichTextConverter; -import com.fr.stable.Constants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; @@ -71,17 +71,17 @@ public class RichTextToolBar extends BasicPane{ private UIToggleButton superPane; private UIToggleButton subPane; private UIToggleButton formulaPane; - + //外部传进来的 private RichTextEditingPane textPane; public RichTextToolBar() { this.initComponents(); } - + public RichTextToolBar(RichTextEditingPane textPane) { this.textPane = textPane; - + this.initComponents(); } @@ -96,14 +96,14 @@ public class RichTextToolBar extends BasicPane{ //添加到工具栏 addToToolBar(); } - + private void initAllButton(){ fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); fontNameComboBox.setPreferredSize(new Dimension(144, 20)); fontSizeComboBox = new UIComboBox(FRFontPane.getFontSizes()); colorSelectPane = new UIToolbarColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/foreground.png")); colorSelectPane.set4Toolbar(); - + bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); underline = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png")); @@ -120,7 +120,7 @@ public class RichTextToolBar extends BasicPane{ //绑定监听器 bindListener(); } - + private void setAllButtonStyle(){ setButtonStyle(bold); setButtonStyle(italic); @@ -129,7 +129,7 @@ public class RichTextToolBar extends BasicPane{ setButtonStyle(superPane); setButtonStyle(formulaPane); } - + private void setButtonStyle(UIButton button){ button.setNormalPainted(false); button.setBackground(null); @@ -137,10 +137,10 @@ public class RichTextToolBar extends BasicPane{ button.setPreferredSize(BUTTON_SIZE); button.setBorderPaintedOnlyWhenPressed(true); } - + private void addToToolBar(){ this.setLayout(new FlowLayout(FlowLayout.LEFT)); - + this.add(fontNameComboBox); this.add(fontSizeComboBox); this.add(bold); @@ -151,14 +151,14 @@ public class RichTextToolBar extends BasicPane{ this.add(subPane); this.add(formulaPane); } - + private void bindListener(){ FRFont defaultFont = (this.textPane != null) ? FRFont.getInstance(this.textPane.getFont()) : RichTextPane.DEFAUL_FONT; fontNameComboBox.addItemListener(fontNameItemListener); fontNameComboBox.setSelectedItem(defaultFont.getFontName()); fontSizeComboBox.addItemListener(fontSizeItemListener); fontSizeComboBox.setSelectedItem(scaleDown(defaultFont.getSize())); - + bold.addActionListener(blodChangeAction); italic.addActionListener(itaChangeAction); underline.addActionListener(underlineChangeAction); @@ -166,7 +166,7 @@ public class RichTextToolBar extends BasicPane{ superPane.addActionListener(superChangeAction); colorSelectPane.addColorChangeListener(colorChangeAction); formulaPane.addActionListener(formulaActionListener); - + //选中文字的监听器 textPane.addCaretListener(textCareListener); textPane.addMouseListener(setMouseCurrentStyle); @@ -192,32 +192,32 @@ public class RichTextToolBar extends BasicPane{ subPane.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sub_Script")); formulaPane.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula")); } - + /** * 移除输入监听 * 用于populate时, 插入字符串, 那时不需要插入监听 - * + * * * @date 2015-1-5-下午5:13:04 - * + * */ public void removeInputListener(){ this.textPane.getDocument().removeDocumentListener(inputListener); } - + /** * 增加输入监听事件 - * + * * * @date 2015-1-5-下午5:13:26 - * + * */ public void addInputListener(){ this.textPane.getDocument().addDocumentListener(inputListener); } - + private ActionListener blodChangeAction = new ActionListener() { - + @Override public void actionPerformed(ActionEvent e) { boolean isBold = RichTextToolBar.this.bold.isSelected(); @@ -227,9 +227,9 @@ public class RichTextToolBar extends BasicPane{ setCharacterAttributes(RichTextToolBar.this.textPane, attr, false); } }; - + private ActionListener itaChangeAction = new ActionListener() { - + @Override public void actionPerformed(ActionEvent e) { boolean isIta = RichTextToolBar.this.italic.isSelected(); @@ -239,9 +239,9 @@ public class RichTextToolBar extends BasicPane{ setCharacterAttributes(RichTextToolBar.this.textPane, attr, false); } }; - + private ActionListener underlineChangeAction = new ActionListener() { - + @Override public void actionPerformed(ActionEvent e) { boolean isUnder = RichTextToolBar.this.underline.isSelected(); @@ -252,7 +252,7 @@ public class RichTextToolBar extends BasicPane{ } }; private ActionListener subChangeAction = new ActionListener() { - + @Override public void actionPerformed(ActionEvent e) { boolean isSub = RichTextToolBar.this.subPane.isSelected(); @@ -263,7 +263,7 @@ public class RichTextToolBar extends BasicPane{ } }; private ActionListener superChangeAction = new ActionListener() { - + @Override public void actionPerformed(ActionEvent e) { boolean isSuper = RichTextToolBar.this.superPane.isSelected(); @@ -273,7 +273,7 @@ public class RichTextToolBar extends BasicPane{ setCharacterAttributes(RichTextToolBar.this.textPane, attr, false); } }; - + private ChangeListener colorChangeAction = new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { @@ -285,13 +285,13 @@ public class RichTextToolBar extends BasicPane{ setCharacterAttributes(RichTextToolBar.this.textPane, attr, false); } }; - + // 设置文本区选择文本的样式 private void setCharacterAttributes(JEditorPane editor, AttributeSet attr, boolean replace) { //注意不要失焦 textPane.requestFocus(); - + // 取得选择文本的起始位置和结束位置 int start = editor.getSelectionStart(); int end = editor.getSelectionEnd(); @@ -303,19 +303,19 @@ public class RichTextToolBar extends BasicPane{ doc.setCharacterAttributes(start, end - start, attr, replace); } } - + private ItemListener fontSizeItemListener = new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { int fontSize = (Integer) RichTextToolBar.this.fontSizeComboBox.getSelectedItem(); - fontSize = scaleUp(fontSize); + fontSize= scaleUp(fontSize); // 调用setCharacterAttributes函数设置文本区选择文本的字体 MutableAttributeSet attr = new SimpleAttributeSet(); StyleConstants.setFontSize(attr, fontSize); setCharacterAttributes(RichTextToolBar.this.textPane, attr, false); } }; - + private ItemListener fontNameItemListener = new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { @@ -326,7 +326,7 @@ public class RichTextToolBar extends BasicPane{ setCharacterAttributes(RichTextToolBar.this.textPane, attr, false); } }; - + private ActionListener formulaActionListener = new ActionListener() { public void actionPerformed(ActionEvent evt) { final UIFormula formulaPane = FormulaFactory.createFormulaPane(); @@ -348,7 +348,7 @@ public class RichTextToolBar extends BasicPane{ }).setVisible(true); } }; - + private int roundUp(double num){ String numStr = Double.toString(num); numStr = new BigDecimal(numStr).setScale(0, BigDecimal.ROUND_HALF_UP).toString(); @@ -356,7 +356,7 @@ public class RichTextToolBar extends BasicPane{ } private CaretListener textCareListener = new CaretListener() { - + //根据选中部分的文字样式, 来动态显示工具栏上按钮的状态 private void setSelectedCharStyle(int start, int end, StyledDocument doc){ boolean isBold = true; @@ -367,11 +367,11 @@ public class RichTextToolBar extends BasicPane{ String fontName_1st = null; int fontSize_1st = 0; Color fontColor_1st = null; - + for (int i = start; i < end; i++) { Element ele = doc.getCharacterElement(i); AttributeSet attrs = ele.getAttributes(); - + //粗体 isBold = isBold && StyleConstants.isBold(attrs); //斜体 @@ -382,22 +382,22 @@ public class RichTextToolBar extends BasicPane{ isSubscript = isSubscript && StyleConstants.isSubscript(attrs); //上标 isSuperscript = isSuperscript && StyleConstants.isSuperscript(attrs); - + if(i == start){ - fontName_1st = (String) attrs.getAttribute(StyleConstants.FontFamily); - fontSize_1st = (Integer) attrs.getAttribute(StyleConstants.FontSize); + fontName_1st = (String) attrs.getAttribute(StyleConstants.FontFamily); + fontSize_1st = (Integer) attrs.getAttribute(StyleConstants.FontSize); fontColor_1st = (Color) attrs.getAttribute(StyleConstants.Foreground); fontColor_1st = fontColor_1st == null ? Color.BLACK : fontColor_1st; } } - setButtonSelected(isBold, isItalic, isUnderline, isSubscript, isSuperscript, + setButtonSelected(isBold, isItalic, isUnderline, isSubscript, isSuperscript, fontName_1st, fontSize_1st, fontColor_1st); } - + //动态显示工具栏上按钮的状态 - private void setButtonSelected(boolean isBold, boolean isItalic, boolean isUnderline, - boolean isSubscript, boolean isSuperscript, String fontName_1st, + private void setButtonSelected(boolean isBold, boolean isItalic, boolean isUnderline, + boolean isSubscript, boolean isSuperscript, String fontName_1st, int fontSize_1st, Color fontColor_1st){ bold.setSelected(isBold); italic.setSelected(isItalic); @@ -412,75 +412,75 @@ public class RichTextToolBar extends BasicPane{ fontSizeComboBox.addItemListener(fontSizeItemListener); selectColorPane(fontColor_1st); } - + private void selectColorPane(Color color){ colorSelectPane.removeColorChangeListener(colorChangeAction); colorSelectPane.setColor(color); colorSelectPane.addColorChangeListener(colorChangeAction); } - + @Override public void caretUpdate(CaretEvent e) { StyledDocument doc = (StyledDocument) textPane.getDocument(); - + // 取得选择文本的起始位置和结束位置 int start = textPane.getSelectionStart(); int end = textPane.getSelectionEnd(); - + //如果没有选定字符 if(end == start){ return; } - + setSelectedCharStyle(start, end, doc); } }; - + //设置当前光标位样式 private MouseListener setMouseCurrentStyle = new MouseAdapter() { - + @Override public void mouseClicked(MouseEvent e) { StyledDocument doc = (StyledDocument) textPane.getDocument(); - + // 取得选择文本的起始位置和结束位置 int start = textPane.getSelectionStart(); int end = textPane.getSelectionEnd(); - + if(start != end){ return; } - + setToLastCharStyle(end, doc); } - + //如果默认不选字符, 那么设置为最后一个字符的样式 private void setToLastCharStyle(int end, StyledDocument doc){ if(textPane.isUpdating()){ return; } - + //取前一个字符的样式 Element ele = doc.getCharacterElement(end - 1); AttributeSet attrs = ele.getAttributes(); populateToolBar(attrs); } }; - + /** * 从样式中更新工具栏上的按钮状态 - * + * * @param attrs 样式 - * + * * * @date 2015-1-5-下午5:12:33 - * + * */ public void populateToolBar(AttributeSet attrs){ int size = scaleDown(StyleConstants.getFontSize(attrs)); fontNameComboBox.setSelectedItem(StyleConstants.getFontFamily(attrs)); fontSizeComboBox.setSelectedItem(size); - + bold.setSelected(StyleConstants.isBold(attrs)); italic.setSelected(StyleConstants.isItalic(attrs)); underline.setSelected(StyleConstants.isUnderline(attrs)); @@ -491,31 +491,23 @@ public class RichTextToolBar extends BasicPane{ colorSelectPane.setColor(foreGround); colorSelectPane.repaint(); } - + //pt转为px =*4/3 - private int scaleUp(int fontSize){ - return scale(fontSize, true); + private int scaleUp(int fontSize) { + return (int) FontTransformUtil.pt2px(fontSize); } - + //px转pt = *3/4 - private int scaleDown(int fontSize){ - return scale(fontSize, false); - } - - private int scale(int fontSize, boolean isUp){ - double dpi96 = Constants.FR_PAINT_RESOLUTION; - double dpi72 = Constants.DEFAULT_FONT_PAINT_RESOLUTION; - double scale = isUp ? (dpi96 / dpi72) : (dpi72 / dpi96); - - return roundUp(fontSize * scale); + private int scaleDown(int fontSize) { + return (int) FontTransformUtil.px2pt(fontSize); } - + private DocumentListener inputListener = new DocumentListener() { - + @Override public void removeUpdate(DocumentEvent e) { } - + @Override public void insertUpdate(DocumentEvent e) { //标志正在更新内容 @@ -523,7 +515,7 @@ public class RichTextToolBar extends BasicPane{ final MutableAttributeSet attr = updateStyleFromToolBar(); final int start = textPane.getSelectionStart(); int end = textPane.getSelectionEnd(); - + if (start != end) { textPane.finishUpdating(); return; @@ -538,19 +530,19 @@ public class RichTextToolBar extends BasicPane{ } }); } - + //根据Style来显示populate按钮 private void changeContentStyle(int start, MutableAttributeSet attr){ changeContentStyle(start, attr, 1); } - + private void changeContentStyle(int start, MutableAttributeSet attr, int contentLength){ // 将所选文本设置为新的样式,replace为false表示不覆盖原有的样式 StyledDocument doc = (StyledDocument) textPane.getDocument(); doc.setCharacterAttributes(start, contentLength, attr, false); textPane.finishUpdating(); } - + //将界面上的设置赋值给输入的字符 private MutableAttributeSet updateStyleFromToolBar(){ final boolean isBold = bold.isSelected(); @@ -561,7 +553,7 @@ public class RichTextToolBar extends BasicPane{ final String fontName = (String) fontNameComboBox.getSelectedItem(); final int fontSize = scaleUp((Integer) fontSizeComboBox.getSelectedItem()); final Color foreGround = colorSelectPane.getColor() == null ? Color.BLACK : colorSelectPane.getColor(); - + MutableAttributeSet attr = new SimpleAttributeSet(); StyleConstants.setBold(attr, isBold); StyleConstants.setItalic(attr, isItalic); @@ -571,7 +563,7 @@ public class RichTextToolBar extends BasicPane{ StyleConstants.setForeground(attr, foreGround); StyleConstants.setFontFamily(attr, fontName); StyleConstants.setFontSize(attr, fontSize); - + return attr; } @@ -581,7 +573,7 @@ public class RichTextToolBar extends BasicPane{ private int inputStart = NOT_INITED; private static final int JDK_6 = 6; private static final int JDK_7 = 7; - + @Override public void changedUpdate(DocumentEvent e) { //这边需要注意, jdk1.6和1.7对于输入法的处理逻辑不一样, jdk6时直接在输入法中输入一大段中文 @@ -595,7 +587,7 @@ public class RichTextToolBar extends BasicPane{ StyledDocument doc = (StyledDocument) textPane.getDocument(); final String content; initFlag(doc); - + final int start = textPane.getSelectionStart(); final int inputLen = start - inputStart; //检测输入内容 @@ -604,7 +596,7 @@ public class RichTextToolBar extends BasicPane{ } catch (BadLocationException e1) { return; } - + //中文输入法, 默认输入字符会被输入法的框截取住, jtextpane得到是一个空格, 此时不做处理 if(StringUtils.isBlank(content) || inputLen <= 0){ return; @@ -613,7 +605,7 @@ public class RichTextToolBar extends BasicPane{ setContentStyle(inputLen); } } - + private void setContentStyle(final int inputLen){ //缓存下Start, 下面要用来设置样式 final int _start = inputStart; @@ -632,15 +624,15 @@ public class RichTextToolBar extends BasicPane{ } }); } - + private boolean isUpdating(){ return inputStart == UPDATING; } - + private void startUpdating(){ inputStart = UPDATING; } - + //初始标记状态, 用于记录中文输入法多个字符同时输入的问题 private void initFlag(StyledDocument doc){ if(inputStart != NOT_INITED){ @@ -648,7 +640,7 @@ public class RichTextToolBar extends BasicPane{ } inputStart = textPane.getSelectionStart() - 1; } - + //重置标记状态 private void resetFlag(){ inputStart = NOT_INITED; From 8c6d591ffb458fcdae72cc201340fa7c4204c55a Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 14 May 2020 16:16:29 +0800 Subject: [PATCH 333/375] =?UTF-8?q?REPORT-31475=20=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/info/ComponentOperate.java | 18 +++++++++++---- .../template/info/JFormProcessInfo.java | 3 +++ .../info/ComponentCreateOperateTest.java | 22 ++++++++++++++++++- .../template/info/JFormProcessInfoTest.java | 4 ++++ 4 files changed, 42 insertions(+), 5 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentOperate.java b/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentOperate.java index b6fd79d27..0791e42d4 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentOperate.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/template/info/ComponentOperate.java @@ -7,7 +7,10 @@ import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WCardLayout; +import com.fr.form.ui.container.WScaleLayout; import com.fr.form.ui.container.WTitleLayout; +import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; +import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.general.ComparatorUtils; import com.fr.json.JSONObject; @@ -24,13 +27,20 @@ public abstract class ComponentOperate implements TemplateOperate { private Widget widget; public ComponentOperate(Widget widget) { - if (widget.acceptType(WTitleLayout.class)) { - this.widget = ((WTitleLayout) widget).getBodyBoundsWidget().getWidget(); - }else { - this.widget = widget; + Widget innerWidget = widget; + if (innerWidget.acceptType(WScaleLayout.class)) { + Widget crBoundsWidget = ((WScaleLayout) innerWidget).getBoundsWidget(); + innerWidget = ((CRBoundsWidget) crBoundsWidget).getWidget(); + } else if (innerWidget.acceptType(WTitleLayout.class)) { + CRBoundsWidget crBoundsWidget = ((WTitleLayout) innerWidget).getBodyBoundsWidget(); + innerWidget = crBoundsWidget.getWidget(); + } else if (innerWidget.acceptType(WCardMainBorderLayout.class)){ + innerWidget = ((WCardMainBorderLayout) widget).getCardPart(); } + this.widget = innerWidget; } + @Override public JSONObject toJSONObject() { JSONObject jo = new JSONObject(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java index c9f7d761e..180215a24 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java @@ -226,6 +226,9 @@ public class JFormProcessInfo extends TemplateProcessInfo { private void addComponentRemoveInfo(JSONObject jsonObject) { String componentID = jsonObject.getString("componentID"); + if (componentID == null){ + return; + } JSONObject info = componentProcessInfoMap.get(componentID); if (info == null) { info = jsonObject; diff --git a/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentCreateOperateTest.java b/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentCreateOperateTest.java index e11c33c55..474f580e3 100644 --- a/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentCreateOperateTest.java +++ b/designer-form/src/test/java/com/fr/design/mainframe/template/info/ComponentCreateOperateTest.java @@ -5,11 +5,15 @@ import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.ChartEditor; import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.FreeButton; +import com.fr.form.ui.TextEditor; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WCardLayout; +import com.fr.form.ui.container.WScaleLayout; import com.fr.form.ui.container.WTitleLayout; +import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; +import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.general.ComparatorUtils; import com.fr.json.JSONObject; import org.junit.Assert; @@ -23,7 +27,7 @@ import java.awt.Rectangle; public class ComponentCreateOperateTest { @Test - public void testConstructor(){ + public void testConstructor() { ElementCaseEditor caseEditor = new ElementCaseEditor(); caseEditor.setWidgetName("report0"); caseEditor.setWidgetID("xxxx0"); @@ -32,6 +36,22 @@ public class ComponentCreateOperateTest { ComponentOperate componentOperate0 = new ComponentCreateOperate(caseEditor); ComponentOperate componentOperate1 = new ComponentCreateOperate(wTitleLayout); ComparatorUtils.equals(componentOperate0.toJSONObject(), componentOperate1.toJSONObject()); + + WScaleLayout scaleLayout = new WScaleLayout(); + TextEditor textEditor = new TextEditor(); + scaleLayout.addWidget(new CRBoundsWidget(textEditor, new Rectangle())); + ComponentOperate componentOperate3 = new ComponentCreateOperate(scaleLayout); + ComponentOperate componentOperate4 = new ComponentCreateOperate(textEditor); + ComparatorUtils.equals(componentOperate3.toJSONObject(), componentOperate4.toJSONObject()); + + + WCardMainBorderLayout wCardMainBorderLayout = new WCardMainBorderLayout(); + WCardLayout wCardLayout = new WCardLayout(); + wCardMainBorderLayout.addCenter(wCardLayout); + ComponentOperate componentOperate5 = new ComponentCreateOperate(wCardMainBorderLayout); + ComponentOperate componentOperate6 = new ComponentCreateOperate(wCardLayout); + ComparatorUtils.equals(componentOperate5.toJSONObject(), componentOperate6.toJSONObject()); + } @Test diff --git a/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java b/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java index 2d25c64c9..663be8758 100644 --- a/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java +++ b/designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java @@ -143,6 +143,10 @@ public class JFormProcessInfoTest { JSONArray ja = jFormProcessInfo.getComponentsInfo(); Assert.assertEquals(2, ja.size()); + Reflect.on(jFormProcessInfo).call("addComponentCreateInfo", new ComponentCreateOperate(button1).toJSONObject()); + FreeButton button3 = new FreeButton(); + Reflect.on(jFormProcessInfo).call("addComponentRemoveInfo", new ComponentDeleteOperate(button3).toJSONObject()); + Assert.assertEquals(1, jFormProcessInfo.getComponentsInfo().size()); ja = jFormProcessInfo.getComponentsInfo(); Assert.assertEquals(0, ja.size()); From fa45ecfd1dbea4817a3f260c85b44b666e00a4f4 Mon Sep 17 00:00:00 2001 From: lucian Date: Thu, 14 May 2020 17:33:09 +0800 Subject: [PATCH 334/375] =?UTF-8?q?REPORT-31261=20WangEditor=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=8E=A7=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/start/server/FineEmbedServerActivator.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java index a67b7e55a..33232c660 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java @@ -62,6 +62,7 @@ public class FineEmbedServerActivator extends Activator { tomcat.setPort(DesignerEnvManager.getEnvManager().getEmbedServerPort()); // 设置解码uri使用的字符编码 tomcat.getConnector().setURIEncoding(EncodeConstants.ENCODING_UTF_8); + setMaxPostSize(); String docBase = new File(WorkContext.getCurrent().getPath()).getParent(); //内置的上下文使用工程目录比如webroot @@ -79,6 +80,18 @@ public class FineEmbedServerActivator extends Activator { context.addServletContainerInitializer(initializer, classes); } + // tomcat的maxPostSize会影响到post参数获取,默认2M + private void setMaxPostSize() { + + if (System.getProperty("tomcat-maxPostSize") != null) { + try { + tomcat.getConnector().setMaxPostSize(Integer.parseInt(System.getProperty("tomcat-maxPostSize"))); + } catch (Exception e) { + FineLoggerFactory.getLogger().error("maxPostSize error: " + e.getMessage(), e); + } + } + } + private void stopServerActivator() { From 05ea8e9600dfb2454296263f9dff6dd53637de72 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 15 May 2020 10:21:09 +0800 Subject: [PATCH 335/375] REPORT-31003 && REPORT-31236 && REPORT-31508 --- .../src/main/java/com/fr/design/DesignerEnvManager.java | 5 ++++- .../com/fr/design/update/ui/dialog/UpdateMainDialog.java | 6 +++++- .../src/main/java/com/fr/design/utils/DesignUtils.java | 4 +--- .../src/main/java/com/fr/design/report/RichTextPane.java | 3 ++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 9cb45918c..88d2625d0 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -58,6 +58,7 @@ import javax.swing.SwingWorker.StateValue; import java.awt.Color; import java.awt.Rectangle; import java.io.File; +import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; @@ -206,9 +207,11 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { GeneralContext.setLocale(designerEnvManager.getLanguage()); try { XMLTools.readFileXML(designerEnvManager, designerEnvManager.getDesignerEnvFile()); - } catch (Exception e) { + } catch (FileNotFoundException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); XmlHandler.Self.handle(e); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); } // james:如果没有env定义,要设置一个默认的 diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java index 78df599c5..d8a4c32a9 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java @@ -30,6 +30,7 @@ import com.fr.general.http.HttpToolbox; import com.fr.json.JSONArray; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; +import com.fr.process.ProcessEventPipe; import com.fr.process.engine.core.FineProcessContext; import com.fr.process.engine.core.FineProcessEngineEvent; import com.fr.stable.*; @@ -600,7 +601,10 @@ public class UpdateMainDialog extends UIDialog { final String installLib = StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LOGS_NAME, UpdateConstants.INSTALL_LIB); final JFrame frame = DesignerContext.getDesignerFrame(); final RestartHelper helper = new RestartHelper(); - FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY); + ProcessEventPipe pipe = FineProcessContext.getParentPipe(); + if (pipe != null) { + pipe.fire(FineProcessEngineEvent.DESTROY); + } new FileProcess(callBack) { @Override public void onDownloadSuccess() { 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 09a5b683d..2bf64642f 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 @@ -291,10 +291,8 @@ public class DesignUtils { if (isDisplaySimSun(defaultLocale)) { guiFRFont = getNamedFont("SimSun"); - } else if (isDisplayDialog(defaultLocale)) { + } else { guiFRFont = getNamedFont("Dialog"); - } else { - guiFRFont = getNamedFont("Tahoma"); } //先初始化的设计器locale, 后初始化lookandfeel.如果顺序改了, 这边也要调整. diff --git a/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java b/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java index d2cb19e86..fa19c38f8 100644 --- a/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java @@ -1,6 +1,7 @@ package com.fr.design.report; import com.fr.base.BaseFormula; +import com.fr.base.FRContext; import com.fr.base.Style; import com.fr.design.cell.editor.RichTextToolBar; import com.fr.design.dialog.BasicPane; @@ -36,7 +37,7 @@ public class RichTextPane extends BasicPane { //12号字体有个奇怪的bug, 字体下部分渲染会截断一部分, 换其他字体没问题, 字体改大小也没问题. //直接弄个jtexarea放到jframe里也有同样问题, 不知道是字体渲染bug还是jdk问题 - public static final FRFont DEFAUL_FONT = FRFont.getInstance().applySize(13); + public static final FRFont DEFAUL_FONT = FRContext.getDefaultValues().getFRFont().applySize(13); private RichTextEditingPane textPane; //用于populate时动态更新按钮 From d07bc875271393e699a5a528bed385779b3868f7 Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Fri, 15 May 2020 12:13:41 +0800 Subject: [PATCH 336/375] REPORT-27141 bugfix --- .../design/data/datapane/TreeTableDataComboBox.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java b/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java index 1e0d2c77e..8b5c62657 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java @@ -2,6 +2,7 @@ package com.fr.design.data.datapane; import com.fr.data.TableDataSource; import com.fr.data.impl.RecursionTableData; +import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.tabledata.wrapper.ServerTableDataWrapper; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; @@ -70,8 +71,14 @@ public class TreeTableDataComboBox extends UIComboBox { } public void setSelectedTableDataByName(String name) { - TableDataWrapper tableDataWrappe = res_map.get(name); - this.getModel().setSelectedItem(tableDataWrappe); + TableDataWrapper tableDataWrapper; + if (res_map.get(name) != null) { + tableDataWrapper = res_map.get(name); + } else { + String changeName = DesignTableDataManager.getChangedDsNameByOldDsName(name); + tableDataWrapper = res_map.get(changeName); + } + this.getModel().setSelectedItem(tableDataWrapper); } @Override From 77ae394443799931f2a33f7e2e08b110766914fc Mon Sep 17 00:00:00 2001 From: Harrison Date: Fri, 15 May 2020 15:44:58 +0800 Subject: [PATCH 337/375] =?UTF-8?q?REPORT-29912=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=8A=A0=E5=AF=86=201=E3=80=81=E4=BC=98=E5=8C=96=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=B0=B4=E5=8D=B0=E6=8E=A5=E5=8F=A3=202=E3=80=81?= =?UTF-8?q?=E4=B8=BA=E5=A4=8D=E5=88=B6=E7=B2=98=E8=B4=B4=E5=BC=80=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E6=8E=A5=E5=8F=A3=203=E3=80=81=E4=B8=BA=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=BB=84=E4=BB=B6=EF=BC=8C=E5=88=A0=E9=99=A4=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=8A=A0=E4=BA=8B=E4=BB=B6=E7=9B=91=E5=90=AC=E7=9A=84?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/clipboard/ClipboardFilter.java | 53 +++++++++ .../base/clipboard/DesignerClipboard.java | 68 ++++++++++++ .../design/fun/ClipboardHandlerProvider.java | 45 ++++++++ .../AbstractClipboardHandlerProvider.java | 17 +++ .../fr/design/mainframe/DesignerContext.java | 83 ++++++++------ .../base/clipboard/ClipboardFilterTest.java | 62 +++++++++++ .../base/clipboard/DesignerClipboardTest.java | 75 +++++++++++++ .../TestClipboardHandlerProvider.java | 29 +++++ .../events/CreatorEventListenerTable.java | 13 +++ .../designer/beans/models/SelectionModel.java | 30 ++++-- .../fun/DesignerEditListenerProvider.java | 22 ++++ .../AbstractDesignerEditListenerProvider.java | 17 +++ .../beans/models/SelectionModelTest.java | 102 ++++++++++++++++++ 13 files changed, 574 insertions(+), 42 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java create mode 100644 designer-base/src/main/java/com/fr/design/base/clipboard/DesignerClipboard.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/ClipboardHandlerProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractClipboardHandlerProvider.java create mode 100644 designer-base/src/test/java/com/fr/design/base/clipboard/ClipboardFilterTest.java create mode 100644 designer-base/src/test/java/com/fr/design/base/clipboard/DesignerClipboardTest.java create mode 100644 designer-base/src/test/java/com/fr/design/base/clipboard/TestClipboardHandlerProvider.java create mode 100644 designer-form/src/main/java/com/fr/design/fun/DesignerEditListenerProvider.java create mode 100644 designer-form/src/main/java/com/fr/design/fun/impl/AbstractDesignerEditListenerProvider.java create mode 100644 designer-form/src/test/java/com/fr/design/designer/beans/models/SelectionModelTest.java diff --git a/designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java b/designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java new file mode 100644 index 000000000..377a57e46 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java @@ -0,0 +1,53 @@ +package com.fr.design.base.clipboard; + +import com.fr.design.fun.ClipboardHandlerProvider; +import com.fr.form.main.ExtraFormClassManager; +import com.fr.plugin.injectable.PluginModule; + +import java.util.Set; + +/** + * created by Harrison on 2020/05/14 + **/ +@SuppressWarnings({"rawtypes", "unchecked"}) +public abstract class ClipboardFilter { + + public static T cut(T selection) { + + Class clazz = selection.getClass(); + ExtraFormClassManager manager = PluginModule.getAgent(PluginModule.ExtraForm); + Set providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); + for (ClipboardHandlerProvider provider : providers) { + if (provider.support(clazz)) { + selection = ((ClipboardHandlerProvider) provider).cut(selection); + } + } + return selection; + } + + public static T copy(T selection) { + + Class clazz = selection.getClass(); + ExtraFormClassManager manager = PluginModule.getAgent(PluginModule.ExtraForm); + Set providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); + for (ClipboardHandlerProvider provider : providers) { + if (provider.support(clazz)) { + selection = ((ClipboardHandlerProvider) provider).copy(selection); + } + } + return selection; + } + + public static T paste(T selection) { + + Class clazz = selection.getClass(); + ExtraFormClassManager manager = PluginModule.getAgent(PluginModule.ExtraForm); + Set providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); + for (ClipboardHandlerProvider provider : providers) { + if (provider.support(clazz)) { + selection = ((ClipboardHandlerProvider) provider).paste(selection); + } + } + return selection; + } +} diff --git a/designer-base/src/main/java/com/fr/design/base/clipboard/DesignerClipboard.java b/designer-base/src/main/java/com/fr/design/base/clipboard/DesignerClipboard.java new file mode 100644 index 000000000..76ae081d7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/base/clipboard/DesignerClipboard.java @@ -0,0 +1,68 @@ +package com.fr.design.base.clipboard; + +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.ClipboardOwner; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.FlavorListener; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.io.IOException; + +/** + * created by Harrison on 2020/05/11 + **/ +public class DesignerClipboard extends Clipboard { + + private Clipboard clipboard; + + public DesignerClipboard(Clipboard clipboard) { + super(clipboard.getName()); + this.clipboard = clipboard; + } + + @Override + public synchronized void setContents(Transferable contents, ClipboardOwner owner) { + //处理 contents/owner + Transferable filtered = ClipboardFilter.copy(contents); + clipboard.setContents(filtered, owner); + } + + @Override + public synchronized Transferable getContents(Object requestor) { + Transferable contents = clipboard.getContents(requestor); + //处理 contents + Transferable filtered = ClipboardFilter.paste(contents); + return filtered; + } + + @Override + public DataFlavor[] getAvailableDataFlavors() { + return clipboard.getAvailableDataFlavors(); + } + + @Override + public boolean isDataFlavorAvailable(DataFlavor flavor) { + return clipboard.isDataFlavorAvailable(flavor); + } + + @Override + public Object getData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { + return clipboard.getData(flavor); + } + + @Override + public synchronized void addFlavorListener(FlavorListener listener) { + clipboard.addFlavorListener(listener); + } + + @Override + public synchronized void removeFlavorListener(FlavorListener listener) { + clipboard.removeFlavorListener(listener); + } + + @Override + public synchronized FlavorListener[] getFlavorListeners() { + return clipboard.getFlavorListeners(); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/fun/ClipboardHandlerProvider.java b/designer-base/src/main/java/com/fr/design/fun/ClipboardHandlerProvider.java new file mode 100644 index 000000000..fbbdacaad --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/ClipboardHandlerProvider.java @@ -0,0 +1,45 @@ +package com.fr.design.fun; + +import com.fr.stable.fun.mark.Mutable; + +/** + * created by Harrison on 2020/05/14 + **/ +public interface ClipboardHandlerProvider extends Mutable { + + String XML_TAG = "ClipboardHandlerProvider"; + + int CURRENT_LEVEL = 1; + + /** + * 剪切 + * + * @param selection 选中 + * @return 处理后的内容 + */ + T cut(T selection); + + /** + * 复制 + * + * @param selection 选中 + * @return 处理后的内容 + */ + T copy(T selection); + + /** + * 粘贴 + * + * @param selection 选中 + * @return 处理后的内容 + */ + T paste(T selection); + + /** + * 支持的类型 + * + * @param selection 内容 + * @return 是否 + */ + boolean support(Object selection); +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractClipboardHandlerProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractClipboardHandlerProvider.java new file mode 100644 index 000000000..da1861916 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractClipboardHandlerProvider.java @@ -0,0 +1,17 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.ClipboardHandlerProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +/** + * created by Harrison on 2020/05/14 + **/ +@API(level = ClipboardHandlerProvider.CURRENT_LEVEL) +public abstract class AbstractClipboardHandlerProvider extends AbstractProvider implements ClipboardHandlerProvider { + + @Override + public int currentAPILevel() { + return ClipboardHandlerProvider.CURRENT_LEVEL; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerContext.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerContext.java index 9362f37c5..49fffa6ce 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerContext.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerContext.java @@ -4,6 +4,7 @@ package com.fr.design.mainframe; import com.fr.base.Style; +import com.fr.design.base.clipboard.DesignerClipboard; import com.fr.design.designer.TargetComponent; import com.fr.design.dialog.BasicDialog; import com.fr.log.FineLoggerFactory; @@ -56,41 +57,53 @@ public class DesignerContext { public static DesignerBean getDesignerBean(String name) { return beans.get(name) == null ? DesignerBean.NULL : beans.get(name); } - - public static void setDesignerBean(String name, DesignerBean bean) { - beans.put(name, bean); - } - - /** - * Gets the Clipboard. - */ - public static Clipboard getClipboard(JComponent comp) { - if (DesignerContext.clipboard == null) { - try { - Action transferAction = TransferHandler.getCutAction(); - Method clipMethod = StableUtils.getDeclaredMethod(transferAction.getClass(), "getClipboard", new Class[]{JComponent.class}); - clipMethod.setAccessible(true); - - return (Clipboard) clipMethod.invoke(transferAction, new Object[]{comp}); - } catch (Exception securityException) { - FineLoggerFactory.getLogger().error(securityException.getMessage(), securityException); - //用反射机制,获得TransferHandler的getClipboard - //这样可以保证和TextField直接的copy paste - try { - //控件的Clipboard. - DesignerContext.clipboard = comp.getToolkit().getSystemClipboard(); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - DesignerContext.clipboard = new Clipboard("FR"); - } - } - } - - return DesignerContext.clipboard; - } - - - public static void setFormatState(int setformatState) { + + public static void setDesignerBean(String name, DesignerBean bean) { + beans.put(name, bean); + } + + /** + * get this custom clipboard + */ + public static Clipboard getClipboard(JComponent comp) { + + if (DesignerContext.clipboard == null) { + + Clipboard clipboard = getClipboard0(comp); + return new DesignerClipboard(clipboard); + } + return DesignerContext.clipboard; + } + + /** + * Gets the system Clipboard. + */ + private static Clipboard getClipboard0(JComponent comp) { + + Clipboard clipboard = null; + try { + Action transferAction = TransferHandler.getCutAction(); + Method clipMethod = StableUtils.getDeclaredMethod(transferAction.getClass(), "getClipboard", new Class[]{JComponent.class}); + clipMethod.setAccessible(true); + + return (Clipboard) clipMethod.invoke(transferAction, new Object[]{comp}); + } catch (Exception securityException) { + FineLoggerFactory.getLogger().error(securityException.getMessage(), securityException); + //用反射机制,获得TransferHandler的getClipboard + //这样可以保证和TextField直接的copy paste + try { + //控件的Clipboard. + clipboard = comp.getToolkit().getSystemClipboard(); + } catch (Exception exp) { + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + clipboard = new Clipboard("FR"); + } + } + return clipboard; + } + + + public static void setFormatState(int setformatState) { formatState = setformatState; } diff --git a/designer-base/src/test/java/com/fr/design/base/clipboard/ClipboardFilterTest.java b/designer-base/src/test/java/com/fr/design/base/clipboard/ClipboardFilterTest.java new file mode 100644 index 000000000..f6b9190eb --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/base/clipboard/ClipboardFilterTest.java @@ -0,0 +1,62 @@ +package com.fr.design.base.clipboard; + +import com.fr.design.fun.ClipboardHandlerProvider; +import com.fr.form.main.ExtraFormClassManager; +import com.fr.plugin.injectable.PluginModule; +import com.fr.stable.fun.mark.Mutable; +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.modules.junit4.PowerMockRunner; + +import java.util.HashSet; +import java.util.Set; + +@PrepareForTest(PluginModule.class) +@RunWith(PowerMockRunner.class) +public class ClipboardFilterTest { + + + @Before + public void setUp() throws Exception { + + Set providers = new HashSet<>(); + providers.add(new TestClipboardHandlerProvider()); + + ExtraFormClassManager formClassManager = EasyMock.mock(ExtraFormClassManager.class); + EasyMock.expect(formClassManager.getArray(ClipboardHandlerProvider.XML_TAG)) + .andReturn(providers) + .anyTimes(); + EasyMock.replay(formClassManager); + + PowerMock.mockStatic(PluginModule.class); + EasyMock.expect(PluginModule.getAgent(PluginModule.ExtraForm)) + .andReturn(formClassManager) + .anyTimes(); + PowerMock.replayAll(); + } + + @After + public void tearDown() throws Exception { + + PowerMock.resetAll(); + } + + @Test + public void testClipboard() { + + ClipboardFilter.cut("cut"); + String paste1 = ClipboardFilter.paste("paste"); + Assert.assertNull(paste1); + + ClipboardFilter.copy("copy"); + String paste2 = ClipboardFilter.paste("paste"); + Assert.assertNull(paste2); + } + +} \ No newline at end of file diff --git a/designer-base/src/test/java/com/fr/design/base/clipboard/DesignerClipboardTest.java b/designer-base/src/test/java/com/fr/design/base/clipboard/DesignerClipboardTest.java new file mode 100644 index 000000000..36cdc54f0 --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/base/clipboard/DesignerClipboardTest.java @@ -0,0 +1,75 @@ +package com.fr.design.base.clipboard; + +import com.fr.design.fun.ClipboardHandlerProvider; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.dnd.ArrayListTransferable; +import com.fr.form.main.ExtraFormClassManager; +import com.fr.plugin.injectable.PluginModule; +import com.fr.stable.fun.mark.Mutable; +import com.fr.third.guava.collect.Lists; +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.PowerMockIgnore; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; + +import javax.swing.JPanel; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.Transferable; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Set; + +@PrepareForTest(PluginModule.class) +@RunWith(PowerMockRunner.class) +@PowerMockIgnore("javax.swing.*") +public class DesignerClipboardTest { + + @Before + public void setUp() throws Exception { + + Set providers = new HashSet<>(); + + ExtraFormClassManager formClassManager = EasyMock.mock(ExtraFormClassManager.class); + EasyMock.expect(formClassManager.getArray(ClipboardHandlerProvider.XML_TAG)) + .andReturn(providers) + .anyTimes(); + EasyMock.replay(formClassManager); + + PowerMock.mockStatic(PluginModule.class); + EasyMock.expect(PluginModule.getAgent(PluginModule.ExtraForm)) + .andReturn(formClassManager) + .anyTimes(); + PowerMock.replayAll(); + } + + @After + public void tearDown() throws Exception { + + PowerMock.resetAll(); + } + + @Test + public void testClipboard() throws Exception { + + JPanel panel = new JPanel(); + Clipboard clipboard = DesignerContext.getClipboard(panel); + + ArrayList transferData = Lists.newArrayList("test", "test2"); + ArrayListTransferable transferable = new ArrayListTransferable(transferData); + clipboard.setContents(transferable, null); + + Transferable filterTransferable = clipboard.getContents(null); + DataFlavor[] flavors = transferable.getTransferDataFlavors(); + ArrayList transferData2 = (ArrayList) filterTransferable.getTransferData(flavors[0]); + + Assert.assertEquals(transferData.get(0), transferData2.get(0)); + } + +} \ No newline at end of file diff --git a/designer-base/src/test/java/com/fr/design/base/clipboard/TestClipboardHandlerProvider.java b/designer-base/src/test/java/com/fr/design/base/clipboard/TestClipboardHandlerProvider.java new file mode 100644 index 000000000..3282f257e --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/base/clipboard/TestClipboardHandlerProvider.java @@ -0,0 +1,29 @@ +package com.fr.design.base.clipboard; + +import com.fr.design.fun.impl.AbstractClipboardHandlerProvider; + +/** + * created by Harrison on 2020/05/15 + **/ +class TestClipboardHandlerProvider extends AbstractClipboardHandlerProvider { + + @Override + public T cut(T selection) { + return selection; + } + + @Override + public T copy(T selection) { + return selection; + } + + @Override + public T paste(T selection) { + return null; + } + + @Override + public boolean support(Object selection) { + return true; + } +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/events/CreatorEventListenerTable.java b/designer-form/src/main/java/com/fr/design/designer/beans/events/CreatorEventListenerTable.java index 2c0c28504..aa0ea1c9a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/events/CreatorEventListenerTable.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/events/CreatorEventListenerTable.java @@ -1,10 +1,14 @@ package com.fr.design.designer.beans.events; import com.fr.design.designer.creator.XComponent; +import com.fr.design.fun.DesignerEditListenerProvider; +import com.fr.form.main.ExtraFormClassManager; import com.fr.general.ComparatorUtils; +import com.fr.plugin.injectable.PluginModule; import javax.swing.SwingUtilities; import java.util.ArrayList; +import java.util.Set; public class CreatorEventListenerTable { @@ -28,6 +32,7 @@ public class CreatorEventListenerTable { } private void fireCreatorModified(final DesignerEvent evt) { + for (int i = 0; i < listeners.size(); i++) { final DesignerEditListener listener = listeners.get(i); SwingUtilities.invokeLater(new Runnable() { @@ -37,6 +42,14 @@ public class CreatorEventListenerTable { } }); } + + //触发插件的事件 + ExtraFormClassManager manager = PluginModule.getAgent(PluginModule.ExtraForm); + Set providers = manager.getArray(DesignerEditListenerProvider.XML_TAG); + for (DesignerEditListenerProvider provider : providers) { + provider.fireCreatorModified(evt); + } + } public void fireCreatorModified(XComponent creator, int eventID) { diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index a8adfeb27..dd964e4ab 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -1,12 +1,19 @@ package com.fr.design.designer.beans.models; import com.fr.common.inputevent.InputEventBaseOnOS; +import com.fr.design.base.clipboard.ClipboardFilter; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.location.Location; -import com.fr.design.designer.creator.*; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWAbsoluteBodyLayout; +import com.fr.design.designer.creator.XWAbsoluteLayout; +import com.fr.design.designer.creator.XWFitLayout; +import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.cardlayout.XWCardLayout; import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; @@ -19,7 +26,9 @@ import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.LayoutUtils; import com.fr.stable.ArrayUtils; -import java.awt.*; +import java.awt.LayoutManager; +import java.awt.Rectangle; +import java.awt.Toolkit; import java.awt.event.MouseEvent; import java.util.ArrayList; @@ -110,9 +119,12 @@ public class SelectionModel { */ public void cutSelectedCreator2ClipBoard() { if (hasSelectionComponent()) { - selection.cut2ClipBoard(clipboard); - designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_CUTED); - designer.repaint(); + FormSelection cutSelection = ClipboardFilter.cut(selection); + if (cutSelection != null) { + cutSelection.cut2ClipBoard(clipboard); + designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_CUTED); + designer.repaint(); + } } } @@ -121,7 +133,10 @@ public class SelectionModel { */ public void copySelectedCreator2ClipBoard() { if (!selection.isEmpty()) { - selection.copy2ClipBoard(clipboard); + FormSelection copySelection = ClipboardFilter.copy(selection); + if (copySelection != null) { + copySelection.copy2ClipBoard(clipboard); + } } } @@ -131,7 +146,8 @@ public class SelectionModel { * @return 否 */ public boolean pasteFromClipBoard() { - if (!clipboard.isEmpty()) { + FormSelection pasteSelection = ClipboardFilter.paste(clipboard); + if (pasteSelection != null && !pasteSelection.isEmpty()) { if (!hasSelectedPasteSource()) { //未选 unselectedPaste(); diff --git a/designer-form/src/main/java/com/fr/design/fun/DesignerEditListenerProvider.java b/designer-form/src/main/java/com/fr/design/fun/DesignerEditListenerProvider.java new file mode 100644 index 000000000..f7f1cbe52 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/fun/DesignerEditListenerProvider.java @@ -0,0 +1,22 @@ +package com.fr.design.fun; + +import com.fr.design.designer.beans.events.DesignerEvent; +import com.fr.stable.fun.mark.Mutable; + +/** + * created by Harrison on 2020/05/14 + **/ +public interface DesignerEditListenerProvider extends Mutable { + + String XML_TAG = "DesignerEditListenerProvider"; + + int CURRENT_LEVEL = 1; + + /** + * 触发设计器事件 + * + * @param evt 事件 + */ + void fireCreatorModified(DesignerEvent evt); + +} diff --git a/designer-form/src/main/java/com/fr/design/fun/impl/AbstractDesignerEditListenerProvider.java b/designer-form/src/main/java/com/fr/design/fun/impl/AbstractDesignerEditListenerProvider.java new file mode 100644 index 000000000..c34ca98b1 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/fun/impl/AbstractDesignerEditListenerProvider.java @@ -0,0 +1,17 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.DesignerEditListenerProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +/** + * created by Harrison on 2020/05/14 + **/ +@API(level = DesignerEditListenerProvider.CURRENT_LEVEL) +public abstract class AbstractDesignerEditListenerProvider extends AbstractProvider implements DesignerEditListenerProvider { + + @Override + public int currentAPILevel() { + return DesignerEditListenerProvider.CURRENT_LEVEL; + } +} diff --git a/designer-form/src/test/java/com/fr/design/designer/beans/models/SelectionModelTest.java b/designer-form/src/test/java/com/fr/design/designer/beans/models/SelectionModelTest.java new file mode 100644 index 000000000..921133a21 --- /dev/null +++ b/designer-form/src/test/java/com/fr/design/designer/beans/models/SelectionModelTest.java @@ -0,0 +1,102 @@ +package com.fr.design.designer.beans.models; + +import com.fr.design.designer.beans.events.CreatorEventListenerTable; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.fun.ClipboardHandlerProvider; +import com.fr.design.fun.impl.AbstractClipboardHandlerProvider; +import com.fr.design.mainframe.FormDesigner; +import com.fr.form.main.ExtraFormClassManager; +import com.fr.plugin.injectable.PluginModule; +import com.fr.stable.fun.mark.Mutable; +import org.easymock.EasyMock; +import org.easymock.IAnswer; +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.PowerMockIgnore; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor; +import org.powermock.modules.junit4.PowerMockRunner; +import org.powermock.reflect.Whitebox; + +import java.util.HashSet; +import java.util.Set; + +@PrepareForTest(PluginModule.class) +@SuppressStaticInitializationFor({"com.fr.design.mainframe.FormDesigner"}) +@PowerMockIgnore("javax.swing.*") +@RunWith(PowerMockRunner.class) +public class SelectionModelTest { + + @Before + public void setUp() throws Exception { + + AbstractClipboardHandlerProvider provider = EasyMock.mock(AbstractClipboardHandlerProvider.class); + EasyMock.expect(provider.cut(EasyMock.anyObject())).andAnswer(new IAnswer() { + @Override + public Object answer() throws Throwable { + return null; + } + }).anyTimes(); + EasyMock.expect(provider.copy(EasyMock.anyObject())).andAnswer(new IAnswer() { + @Override + public Object answer() throws Throwable { + return EasyMock.getCurrentArguments()[0]; + } + }).anyTimes(); + EasyMock.expect(provider.support(EasyMock.anyObject())).andReturn(true).anyTimes(); + EasyMock.expect(provider.paste(EasyMock.anyObject())).andReturn(null).anyTimes(); + EasyMock.replay(provider); + + Set providers = new HashSet<>(); + providers.add(provider); + + ExtraFormClassManager formClassManager = EasyMock.mock(ExtraFormClassManager.class); + EasyMock.expect(formClassManager.getArray(ClipboardHandlerProvider.XML_TAG)) + .andReturn(providers) + .anyTimes(); + EasyMock.expect(formClassManager.getArray("DesignerEditListenerProvider")) + .andReturn(new HashSet()) + .anyTimes(); + + + EasyMock.replay(formClassManager); + + PowerMock.mockStatic(PluginModule.class); + EasyMock.expect(PluginModule.getAgent(PluginModule.ExtraForm)) + .andReturn(formClassManager) + .anyTimes(); + PowerMock.replayAll(); + } + + @After + public void tearDown() throws Exception { + + PowerMock.resetAll(); + } + + @Test + public void testPaste() { + + FormDesigner formDesigner = EasyMock.partialMockBuilder(FormDesigner.class).createMock(); + XCreator xCreator = EasyMock.mock(XCreator.class); + EasyMock.expect(xCreator.acceptType(EasyMock.anyObject(Class[].class))).andReturn(true).anyTimes(); + CreatorEventListenerTable table = new CreatorEventListenerTable(); + Whitebox.setInternalState(formDesigner, "edit", table); + EasyMock.replay(formDesigner, xCreator); + + SelectionModel model = new SelectionModel(formDesigner); + model.cutSelectedCreator2ClipBoard(); + boolean paste1 = model.pasteFromClipBoard(); + Assert.assertFalse(paste1); + + model.setSelectedCreator(xCreator); + model.copySelectedCreator2ClipBoard(); + boolean paste2 = model.pasteFromClipBoard(); + Assert.assertFalse(paste2); + } + +} \ No newline at end of file From 93ad4774f6d65411f539109c78a20778f24b3285 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Mon, 18 May 2020 11:39:39 +0800 Subject: [PATCH 338/375] =?UTF-8?q?MOBILE-27000=20=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E6=8E=A7=E4=BB=B6=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/ui/MobileStyleDefinePane.java | 91 +++++++++++++++--- .../mobile/ui/MobileStyleFontConfigPane.java | 95 +++++++++++++++++++ 2 files changed, 171 insertions(+), 15 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java index 93c24ad69..b700f758c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java @@ -2,15 +2,22 @@ package com.fr.design.mainframe.mobile.ui; import com.fr.base.background.ColorBackground; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.color.ColorSelectBox; +import com.fr.design.style.color.NewColorSelectBox; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.Widget; import com.fr.form.ui.mobile.MobileStyle; import com.fr.general.FRFont; import com.fr.invoke.Reflect; +import com.fr.stable.Constants; import javax.swing.*; import javax.swing.border.TitledBorder; @@ -19,12 +26,23 @@ import javax.swing.event.ChangeListener; import java.awt.*; public class MobileStyleDefinePane extends BasicBeanPane { - + private final static int[] BORDER_LINE_STYLE_ARRAY = new int[]{ + Constants.LINE_NONE, + Constants.LINE_THIN, //1px + Constants.LINE_MEDIUM, //2px + Constants.LINE_THICK, //3px + }; + private static final int NORMAL_COMBO_WIDTH = 152; private Widget widget; private MobileStyleCustomDefinePane customBeanPane; private Class mobileStyleClazz; private ColorSelectBox colorSelectBox; private Color titleColor = new Color(47, 142, 241); + private JPanel commomPane; + private LineComboBox borderType; + private NewColorSelectBox borderColor; + private UISpinner borderRadius; + private MobileStyleFontConfigPane fontConfigPane; MobileStyleDefinePane(Widget widget, Class customBeanPaneClass, Class mobileStyleClazz) { @@ -40,6 +58,14 @@ public class MobileStyleDefinePane extends BasicBeanPane { if(ob.getBackground() != null) { colorSelectBox.setSelectObject(((ColorBackground)ob.getBackground()).getColor()); } + borderType.setSelectedLineStyle(ob.getBorderType()); + if (ob.getBorderColor() != null) { + borderColor.setSelectObject(ob.getBorderColor()); + } + borderRadius.setValue(ob.getBorderRadius()); + if (ob.getFont() != null) { + fontConfigPane.populateBean(ob.getFont()); + } } @Override @@ -48,6 +74,10 @@ public class MobileStyleDefinePane extends BasicBeanPane { this.widget.setMobileStyle(mobileStyle); this.customBeanPane.updateBean(); mobileStyle.setBackground(ColorBackground.getInstance(colorSelectBox.getSelectObject())); + mobileStyle.setBorderType(borderType.getSelectedLineStyle()); + mobileStyle.setBorderColor(borderColor.getSelectObject()); + mobileStyle.setBorderRadius(borderRadius.getValue()); + mobileStyle.setFont(fontConfigPane.updateBean()); return mobileStyle; } @@ -64,7 +94,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { private void createGeneralPane() { createPreviewPane(); - createBackgroundPane(); + createCommonPane(); } private void createPreviewPane() { @@ -79,29 +109,49 @@ public class MobileStyleDefinePane extends BasicBeanPane { } } - private void createBackgroundPane() { - - JPanel backgroundPane = new JPanel(); - backgroundPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 5)); - backgroundPane.setPreferredSize(new Dimension(500, 65)); - + private void createCommonPane() { TitledBorder titledBorder = createTitledBorder(Toolkit.i18nText("Fine-Design_Mobile_Common_Attribute")); - backgroundPane.setBorder(titledBorder); + commomPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 10); + commomPane.setBorder(titledBorder); + this.add(commomPane, BorderLayout.NORTH); - UILabel colorSelectLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Widget_Background"), UILabel.RIGHT); - colorSelectLabel.setPreferredSize(new Dimension(65, 20)); + createBackgroundPane(); + createBorderPane(); + createFontPane(); + } - colorSelectBox = new ColorSelectBox(152); + private void createBackgroundPane() { + colorSelectBox = new ColorSelectBox(NORMAL_COMBO_WIDTH); colorSelectBox.addSelectChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { } }); - backgroundPane.add(colorSelectLabel); - backgroundPane.add(colorSelectBox); + JPanel backgroundPane = createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Background")), colorSelectBox); + commomPane.add(backgroundPane); + } - this.add(backgroundPane, BorderLayout.NORTH); + private void createBorderPane() { + borderType = new LineComboBox(BORDER_LINE_STYLE_ARRAY); + borderType.setSelectedLineStyle(Constants.LINE_THIN); + borderType.setPreferredSize(new Dimension(NORMAL_COMBO_WIDTH + 15, 20)); + borderColor = new NewColorSelectBox(NORMAL_COMBO_WIDTH); + borderColor.addSelectChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + } + }); + borderRadius = new UISpinner(0, Integer.MAX_VALUE, 1, 2); + borderRadius.setPreferredSize(new Dimension(NORMAL_COMBO_WIDTH + 20, 20)); + commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderType")), borderType)); + commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderColor")), borderColor)); + commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderRadius")), borderRadius)); + } + + private void createFontPane() { + fontConfigPane = new MobileStyleFontConfigPane(); + commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Font")), fontConfigPane)); } private void createCustomPane() { @@ -109,6 +159,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { TitledBorder titledBorder = createTitledBorder(Toolkit.i18nText("Fine-Design_Report_Set")); configPane.setBorder(titledBorder); + JPanel container = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 10); configPane.add(this.customBeanPane, BorderLayout.CENTER); this.add(configPane, BorderLayout.CENTER); @@ -119,4 +170,14 @@ public class MobileStyleDefinePane extends BasicBeanPane { titledBorder.setTitleFont(FRFont.getInstance("PingFangSC-Regular", Font.PLAIN, 12)); return titledBorder; } + + private UILabel createConfigLabel(String title) { + UILabel label = new UILabel(title + ":", UILabel.RIGHT); + label.setPreferredSize(new Dimension(75, 20)); + return label; + } + + private JPanel createLeftRightComponentsPane(Component... components) { + return TableLayoutHelper.createGapTableLayoutPane(new Component[][]{components}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java new file mode 100644 index 000000000..dedd06c86 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java @@ -0,0 +1,95 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.base.BaseUtils; +import com.fr.design.constants.LayoutConstants; +import com.fr.design.gui.ibutton.UIColorButton; +import com.fr.design.gui.ibutton.UIToggleButton; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.i18n.Toolkit; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.FRFont; +import com.fr.stable.Constants; + +import javax.swing.*; +import java.awt.*; +import java.util.Vector; + +public class MobileStyleFontConfigPane extends JPanel { + private static final int MAX_FONT_SIZE = 18; + private static final int MIN_FONT_SIZE = 12; + private static final Dimension BUTTON_SIZE = new Dimension(20, 18); + + public static Vector getFontSizes() { + Vector FONT_SIZES = new Vector(); + for (int i = MIN_FONT_SIZE; i <= MAX_FONT_SIZE; i++) { + FONT_SIZES.add(i); + } + return FONT_SIZES; + } + + private UIComboBox fontSizeComboBox; + private UIToggleButton underline; + private UIToggleButton italic; + private UIToggleButton bold; + + public MobileStyleFontConfigPane() { + this.initComponent(); + } + + private void initComponent() { + + fontSizeComboBox = new UIComboBox(getFontSizes()); + fontSizeComboBox.setSelectedItem(16); + fontSizeComboBox.setPreferredSize(new Dimension(60, 20)); + fontSizeComboBox.setEditable(true); + underline = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png")); + italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); + bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); + + this.setButtonsTips(); + this.setButtonsSize(BUTTON_SIZE); + + Component[] components_font = new Component[]{ + fontSizeComboBox, underline, italic, bold + }; + + JPanel buttonPane = new JPanel(new BorderLayout()); + buttonPane.add(GUICoreUtils.createFlowPane(components_font, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE)); + + this.setLayout(new BorderLayout(0,0)); + this.add(buttonPane, BorderLayout.CENTER); + } + + private void setButtonsTips() { + underline.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Underline")); + italic.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Italic")); + bold.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bold")); + } + + private void setButtonsSize(Dimension size) { + underline.setPreferredSize(size); + italic.setPreferredSize(size); + bold.setPreferredSize(size); + } + + + public void populateBean(FRFont frFont) { + fontSizeComboBox.setSelectedItem(frFont.getSize()); + bold.setSelected(frFont.isBold()); + italic.setSelected(frFont.isItalic()); + underline.setSelected(frFont.getUnderline() != Constants.LINE_NONE); + } + + public FRFont updateBean() { + int style = Font.PLAIN; + style += this.bold.isSelected() ? Font.BOLD : Font.PLAIN; + style += this.italic.isSelected() ? Font.ITALIC : Font.PLAIN; + return FRFont.getInstance( + FRFont.DEFAULT_FONTNAME, + style, + Float.parseFloat(fontSizeComboBox.getSelectedItem().toString()), + Color.BLACK, + underline.isSelected() ? Constants.LINE_THIN : Constants.LINE_NONE + ); + } +} From ced2a315e8ce51d1b46b4a33e612732ba799a904 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 18 May 2020 12:25:29 +0800 Subject: [PATCH 339/375] fix --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 5 +---- .../java/com/fr/design/env/DesignerWorkspaceGenerator.java | 5 +---- .../com/fr/design/update/ui/dialog/UpdateMainDialog.java | 5 +---- .../src/main/java/com/fr/design/utils/DesignerPort.java | 5 +---- .../main/java/com/fr/start/LifecycleFatalErrorHandler.java | 5 +---- 5 files changed, 5 insertions(+), 20 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 2e5ea8bf6..595f812af 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -415,10 +415,7 @@ public class EnvChangeEntrance { @Override public void doOk() { - ProcessEventPipe pipe = FineProcessContext.getParentPipe(); - if (FineProcessContext.getParentPipe() != null) { - pipe.fire(new CarryMessageEvent(ReportState.ACTIVE.getValue())); - } + FineProcessContext.getParentPipe().fire(new CarryMessageEvent(ReportState.ACTIVE.getValue())); if (!envListOkAction(envListPane, PopTipStrategy.NOW)) { DesignerExiter.getInstance().execute(); } diff --git a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java index 288f6baa3..15b0e191e 100644 --- a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java +++ b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java @@ -72,10 +72,7 @@ public class DesignerWorkspaceGenerator { enum RemoteHandler { SELF; public static void handle(DesignerWorkspaceInfo config) { - ProcessEventPipe eventPipe = FineProcessContext.getParentPipe(); - if (eventPipe != null) { - eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue())); - } + FineProcessContext.getParentPipe().fire(new CarryMessageEvent(ReportState.STOP.getValue())); StartErrorMessageCollector.getInstance().record(DesignerErrorMessage.REMOTE_DESIGN_NO_RESPONSE.getId(), DesignerErrorMessage.REMOTE_DESIGN_NO_RESPONSE.getMessage(), StringUtils.EMPTY); diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java index d8a4c32a9..b71805802 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java @@ -601,10 +601,7 @@ public class UpdateMainDialog extends UIDialog { final String installLib = StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LOGS_NAME, UpdateConstants.INSTALL_LIB); final JFrame frame = DesignerContext.getDesignerFrame(); final RestartHelper helper = new RestartHelper(); - ProcessEventPipe pipe = FineProcessContext.getParentPipe(); - if (pipe != null) { - pipe.fire(FineProcessEngineEvent.DESTROY); - } + FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY); new FileProcess(callBack) { @Override public void onDownloadSuccess() { diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignerPort.java b/designer-base/src/main/java/com/fr/design/utils/DesignerPort.java index 254cc5e91..1ad1948bf 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignerPort.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignerPort.java @@ -90,10 +90,7 @@ public class DesignerPort implements XMLReadable, XMLWriter { } public void resetPort() { - ProcessEventPipe eventPipe = FineProcessContext.getParentPipe(); - if (eventPipe != null) { - eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue())); - } + FineProcessContext.getParentPipe().fire(new CarryMessageEvent(ReportState.STOP.getValue())); TipDialog dialog = new TipDialog(null, StringUtils.EMPTY, Toolkit.i18nText("Fine-Design_Port_Found_Port_Conflict"), diff --git a/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java b/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java index ef416416c..a59d15faf 100644 --- a/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java +++ b/designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java @@ -49,10 +49,7 @@ public class LifecycleFatalErrorHandler { public void handle(FineLifecycleFatalError fatal) { SplashContext.getInstance().hide(); - ProcessEventPipe eventPipe = FineProcessContext.getParentPipe(); - if (eventPipe != null) { - eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue())); - } + FineProcessContext.getParentPipe().fire(new CarryMessageEvent(ReportState.STOP.getValue())); map.get(fatal.getErrorType()).handle(fatal); } From 9da47c5434085f35e00f6eed12824ea612d4828d Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 18 May 2020 12:27:39 +0800 Subject: [PATCH 340/375] fix import --- .../java/com/fr/design/update/ui/dialog/UpdateMainDialog.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java index b71805802..78df599c5 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java @@ -30,7 +30,6 @@ import com.fr.general.http.HttpToolbox; import com.fr.json.JSONArray; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; -import com.fr.process.ProcessEventPipe; import com.fr.process.engine.core.FineProcessContext; import com.fr.process.engine.core.FineProcessEngineEvent; import com.fr.stable.*; From f03d6b65fd86e48af75eedfd8a029dfc72ac1476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 18 May 2020 14:16:31 +0800 Subject: [PATCH 341/375] =?UTF-8?q?CHART-13958=20=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E7=82=B9=E5=87=BBgis=E9=80=89=E6=8B=A9=E4=BC=9A=E8=BF=98?= =?UTF-8?q?=E5=8E=9F=E7=BC=A9=E6=94=BE=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../type/VanChartMapSourceChoosePane.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) 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 f609debe9..e58797dca 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 @@ -42,7 +42,7 @@ import com.fr.van.chart.drillmap.designer.data.comp.MapDataTree; import com.fr.workspace.WorkContext; import javax.swing.BorderFactory; -import javax.swing.JOptionPane; +import javax.swing.DefaultComboBoxModel; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.SwingWorker; @@ -51,6 +51,8 @@ import javax.swing.event.PopupMenuListener; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; +import java.util.ArrayList; +import java.util.List; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; @@ -61,8 +63,6 @@ import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; -import java.util.ArrayList; -import java.util.List; /** * Created by Mitisky on 16/5/11. @@ -280,14 +280,12 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { public void popupMenuWillBecomeVisible(PopupMenuEvent e) { String selected = Utils.objectToString(gisLayer.getSelectedItem()); + ZoomLevel zoomSelected = (ZoomLevel) zoomLevel.getSelectedItem(); - gisLayer.removeAllItems(); - - for (String item : MapLayerConfigManager.getLayerItems()) { - gisLayer.addItem(item); - } + gisLayer.setModel(new DefaultComboBoxModel(MapLayerConfigManager.getLayerItems())); gisLayer.setSelectedItem(selected); + zoomLevel.setSelectedItem(zoomSelected); } }); @@ -346,10 +344,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { } else { levels = ZOOM_LEVELS; } - zoomLevel.removeAllItems(); - for (int i = 0; i < levels.length; i++) { - zoomLevel.addItem(levels[i]); - } + zoomLevel.setModel(new DefaultComboBoxModel(levels)); } From 3f0db7cd7a138fce57817a6b04a8c19199022455 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Mon, 18 May 2020 14:29:33 +0800 Subject: [PATCH 342/375] =?UTF-8?q?import=20=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/mobile/ui/MobileStyleDefinePane.java | 10 ++++++++-- .../mobile/ui/MobileStyleFontConfigPane.java | 12 ++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java index b700f758c..c729b5fc0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java @@ -19,11 +19,17 @@ import com.fr.general.FRFont; import com.fr.invoke.Reflect; import com.fr.stable.Constants; -import javax.swing.*; +import javax.swing.JPanel; import javax.swing.border.TitledBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; + public class MobileStyleDefinePane extends BasicBeanPane { private final static int[] BORDER_LINE_STYLE_ARRAY = new int[]{ diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java index dedd06c86..7ea91353a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java @@ -2,7 +2,6 @@ package com.fr.design.mainframe.mobile.ui; import com.fr.base.BaseUtils; import com.fr.design.constants.LayoutConstants; -import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.i18n.Toolkit; @@ -10,11 +9,16 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.stable.Constants; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; import java.util.Vector; -public class MobileStyleFontConfigPane extends JPanel { +public class MobileStyleFontConfigPane extends JPanel { private static final int MAX_FONT_SIZE = 18; private static final int MIN_FONT_SIZE = 12; private static final Dimension BUTTON_SIZE = new Dimension(20, 18); From 6740020f6576e88b62547a58a4e663c2fbcca0d6 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 18 May 2020 16:26:37 +0800 Subject: [PATCH 343/375] =?UTF-8?q?REPORT-31291=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/datapane/ChoosePane.java | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java index eda641467..52ed6861b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java @@ -1,12 +1,10 @@ package com.fr.design.data.datapane; -import com.fr.base.BaseUtils; import com.fr.base.TableData; import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.DBUtils; import com.fr.data.core.db.TableProcedure; import com.fr.data.core.db.dialect.DialectFactory; -import com.fr.data.impl.Connection; import com.fr.data.impl.DBTableData; import com.fr.data.operator.DataOperator; import com.fr.design.DesignerEnvManager; @@ -37,6 +35,7 @@ import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; +import com.fr.workspace.server.connection.DBConnectAuth; import javax.swing.JList; import javax.swing.JOptionPane; @@ -61,9 +60,10 @@ import java.awt.event.FocusEvent; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.ArrayList; +import java.util.Collection; import java.util.Enumeration; import java.util.List; -import java.util.Map; +import java.util.Set; /** * @author zhou @@ -210,10 +210,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha @SuppressWarnings("unchecked") protected void initDsNameComboBox() { dsNameComboBox.setRefreshingModel(true); - ConnectionConfig connectionConfig = ConnectionConfig.getInstance(); - List dsList = new ArrayList<>(); - dsList.addAll(connectionConfig.getConnections().keySet()); - FilterableComboBoxModel dsNameComboBoxModel = new FilterableComboBoxModel(dsList); + FilterableComboBoxModel dsNameComboBoxModel = new FilterableComboBoxModel(getHasAuthConnections()); dsNameComboBox.setModel(dsNameComboBoxModel); dsNameComboBox.setRefreshingModel(false); } @@ -322,14 +319,31 @@ public class ChoosePane extends BasicBeanPane implements Refresha return null; // peter:选中了当前的零长度的节点,直接返回. } ConnectionConfig connectionConfig = ConnectionConfig.getInstance(); - for (Map.Entry entry : connectionConfig.getConnections().entrySet()) { - if (ComparatorUtils.equals(selectedDSName, entry.getKey())) { - return entry.getValue(); + List authConnections = getHasAuthConnections(); + for (String name : authConnections) { + if (ComparatorUtils.equals(selectedDSName, name)) { + return connectionConfig.getConnection(name); } } return null; } + private List getHasAuthConnections() { + List authConnections = new ArrayList<>(); + Set allConnections = ConnectionConfig.getInstance().getConnections().keySet(); + Collection noAuthConnections = WorkContext.getCurrent().get(DBConnectAuth.class).getNoAuthConnections(); + if (noAuthConnections == null) { + return authConnections; + } + + for (String name : allConnections) { + if (!noAuthConnections.contains(name)) { + authConnections.add(name); + } + } + return authConnections; + } + /** * 刷新没多大用。而且要刷新也不是这儿刷新。 */ From df549e1f6d9ebb9805a3bf8606107e4ceb05d0d4 Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Tue, 19 May 2020 09:32:41 +0800 Subject: [PATCH 344/375] =?UTF-8?q?REPORT-31827=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=87=8D=E5=81=9A=E6=8C=89=E9=92=AE=E6=97=A0=E6=95=88?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/ElementCasePaneDelegate.java | 1 + .../fr/design/mainframe/form/FormElementCasePaneDelegate.java | 1 + 2 files changed, 2 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java index 696c732f3..22ab32344 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -117,6 +117,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { @Override protected void afterPasteAction() { refreshPropertyPanes(); + fireTargetModified(); repaint(); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java index 1108c4741..55d11fe7d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java @@ -72,6 +72,7 @@ public class FormElementCasePaneDelegate extends ElementCasePane Date: Tue, 19 May 2020 10:32:13 +0800 Subject: [PATCH 345/375] =?UTF-8?q?REPORT-29409=20=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=92=8C=E5=9B=BE=E8=A1=A8=E7=99=BE=E5=88=86=E6=AF=94=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E8=BF=91=E4=BC=BC=E7=BB=93=E6=9E=9C=E4=B8=8D?= =?UTF-8?q?=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/style/FormatPane.java | 43 +++++++++++++++++-- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java b/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java index cf362f7f5..22f0a3647 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java @@ -6,6 +6,7 @@ import com.fr.base.Style; import com.fr.base.TextFormat; import com.fr.data.core.FormatField; import com.fr.data.core.FormatField.FormatContents; +import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.i18n.Toolkit; import com.fr.design.border.UIRoundedBorder; import com.fr.design.constants.LayoutConstants; @@ -22,6 +23,8 @@ import com.fr.general.ComparatorUtils; import com.fr.stable.StringUtils; +import java.math.BigDecimal; +import java.math.RoundingMode; import javax.swing.*; import javax.swing.border.Border; import javax.swing.border.TitledBorder; @@ -63,6 +66,8 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse private JPanel contentPane; private JPanel txtCenterPane; private JPanel centerPane; + private JPanel optionPane; + private UICheckBox roundingBox; private JPanel formatFontPane; private FRFontPane frFontPane; private boolean isRightFormat; @@ -123,7 +128,23 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse // centerPane.setBorder(LEFT_BORDER); frFontPane.setBorder(LEFT_BORDER); - Component[][] components = getComponent(fontPane, centerPane, typePane); + JPanel option = new JPanel(new BorderLayout()); + option.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Option"), SwingConstants.LEFT), BorderLayout.WEST); + roundingBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Base_Option_Half_Up")); + roundingBox.setBorder(BorderFactory.createEmptyBorder(0, 40, 0, 0)); + roundingBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + } + }); + roundingBox.setGlobalName("roundingBox"); + option.add(roundingBox, BorderLayout.CENTER); + optionPane = new JPanel(new CardLayout()); + optionPane.add(new JPanel(), "hide"); + optionPane.setPreferredSize(new Dimension(0, 0)); + optionPane.add(option, "show"); + + Component[][] components = getComponent(fontPane, centerPane, typePane, optionPane); this.add(createContentPane(components), BorderLayout.CENTER); } @@ -137,11 +158,12 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse } - protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { + protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane, JPanel optionPane) { return new Component[][]{ new Component[]{null, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Format"), SwingConstants.LEFT), typePane}, new Component[]{centerPane, null}, + new Component[]{optionPane, null}, new Component[]{fontPane, frFontPane}, }; } @@ -220,6 +242,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse setPatternComboBoxAndList(FormatContents.CURRENCY, pattern); } else if (pattern.indexOf("%") > 0) { setPatternComboBoxAndList(FormatContents.PERCENT, pattern); + this.roundingBox.setSelected(((CoreDecimalFormat) format).getRoundingMode().equals(RoundingMode.HALF_UP)); } else if (pattern.indexOf("E") > 0) { setPatternComboBoxAndList(FormatContents.SCIENTIFIC, pattern); } else { @@ -286,7 +309,8 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse } if (isRightFormat) { if (StringUtils.isNotEmpty(patternString)) { - return FormatField.getInstance().getFormat(getFormatContents(), patternString); + RoundingMode roundingMode = roundingBox.isSelected() ? RoundingMode.HALF_UP : RoundingMode.HALF_EVEN; + return FormatField.getInstance().getFormat(getFormatContents(), patternString, roundingMode); } } return null; @@ -342,6 +366,15 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse centerPane.setPreferredSize(new Dimension(270, 65)); cardLayout.show(centerPane, "show"); } + CardLayout optionLayout = ((CardLayout) optionPane.getLayout()); + if (getFormatContents() == FormatContents.PERCENT) { + optionPane.setPreferredSize(new Dimension(100, 20)); + optionLayout.show(optionPane, "show"); + } else { + optionPane.setPreferredSize(new Dimension(0, 0)); + optionLayout.show(optionPane, "hide"); + roundingBox.setSelected(false); + } } } @@ -370,7 +403,9 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse * update */ public Style update(Style style) { - if (ComparatorUtils.equals(globalNameListener.getGlobalName(), "textField") || ComparatorUtils.equals(globalNameListener.getGlobalName(), "typeComboBox")) { + if (ComparatorUtils.equals(globalNameListener.getGlobalName(), "textField") + || ComparatorUtils.equals(globalNameListener.getGlobalName(), "typeComboBox") + || ComparatorUtils.equals(globalNameListener.getGlobalName(), "roundingBox")) { return style.deriveFormat(this.update()); } else { return style.deriveFRFont(this.frFontPane.update(style.getFRFont())); From 9140d92ab2fd270a06381a14000b13d2c38b1cbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 19 May 2020 14:50:10 +0800 Subject: [PATCH 346/375] =?UTF-8?q?CHART-13926=20=20FR=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/chart/gui/style/ChartTextAttrPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index a6be91a24..9a906cc7c 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.chart.gui.style; import com.fr.base.BaseUtils; +import com.fr.base.FRContext; import com.fr.base.Utils; import com.fr.chart.base.TextAttr; import com.fr.design.constants.LayoutConstants; @@ -14,7 +15,6 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; - import com.fr.general.GeneralUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -202,7 +202,7 @@ public class ChartTextAttrPane extends BasicPane { this.setLayout(new BorderLayout()); this.add(getContentPane(buttonPane), BorderLayout.CENTER); - populate(FRFont.getInstance()); + populate(FRContext.getDefaultValues().getFRFont()); } protected JPanel getContentPane(JPanel buttonPane) { From 444d7093f6fb58f41fd5e9fc7526803a46739dd1 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 19 May 2020 16:04:36 +0800 Subject: [PATCH 347/375] =?UTF-8?q?REPORT-29815=20&&=20REPORT-29815=20?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E6=B7=BB=E5=8A=A0=E5=88=B0final=E7=9A=84?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=88=B0release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/unit/UnitConvertUtil.java | 23 ++++++++++++++++++- .../design/actions/FormMobileAttrAction.java | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java b/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java index 406ddcfdd..520430d51 100644 --- a/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java +++ b/designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java @@ -6,7 +6,11 @@ import com.fr.design.unit.impl.CMReportLengthUNIT; import com.fr.design.unit.impl.INCHReportLengthUNIT; import com.fr.design.unit.impl.MMReportLengthUNIT; import com.fr.design.unit.impl.PTReportLengthUNIT; - +import com.fr.general.GeneralContext; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -18,6 +22,23 @@ public class UnitConvertUtil { private static List lengthUNITList = new ArrayList(); static { + GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + @Override + public void on(PluginEvent pluginEvent) { + initSupportedReportLengthUNIT(); + } + }, new PluginFilter() { + @Override + public boolean accept(PluginContext pluginContext) { + return pluginContext.contain(ReportLengthUNITProvider.MARK_STRING); + } + }); + + initSupportedReportLengthUNIT(); + } + + private static void initSupportedReportLengthUNIT(){ + lengthUNITList.clear(); lengthUNITList.add(new MMReportLengthUNIT()); lengthUNITList.add(new CMReportLengthUNIT()); lengthUNITList.add(new INCHReportLengthUNIT()); diff --git a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java index deec25c0b..6227c169b 100644 --- a/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java @@ -112,7 +112,7 @@ public class FormMobileAttrAction extends JTemplateAction { private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() { @Override public char getMnemonic() { - return 'T'; + return 'P'; } @Override From 5104b8ddaff7dcb34d286342c9c2047fb443358e Mon Sep 17 00:00:00 2001 From: Harrison Date: Wed, 20 May 2020 09:15:19 +0800 Subject: [PATCH 348/375] =?UTF-8?q?REPORT-29912=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=8A=A0=E5=AF=86=201=E3=80=81=E5=A4=8D=E5=88=B6=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E7=9A=84=20support=20=E5=88=A4=E6=96=AD=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=202=E3=80=81XCreator=20=E7=9A=84=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/clipboard/ClipboardFilter.java | 23 ++++++------- .../base/clipboard/ClipboardFilterTest.java | 18 +++++----- .../designer/creator/XCreatorUtils.java | 34 ++++++++++++++++--- .../beans/models/SelectionModelTest.java | 24 +++++++------ .../designer/creator/XCreatorUtilsTest.java | 17 ++++++++++ 5 files changed, 78 insertions(+), 38 deletions(-) create mode 100644 designer-form/src/test/java/com/fr/design/designer/creator/XCreatorUtilsTest.java diff --git a/designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java b/designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java index 377a57e46..e9b6b3e0f 100644 --- a/designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java +++ b/designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java @@ -1,7 +1,7 @@ package com.fr.design.base.clipboard; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.fun.ClipboardHandlerProvider; -import com.fr.form.main.ExtraFormClassManager; import com.fr.plugin.injectable.PluginModule; import java.util.Set; @@ -13,12 +13,11 @@ import java.util.Set; public abstract class ClipboardFilter { public static T cut(T selection) { - - Class clazz = selection.getClass(); - ExtraFormClassManager manager = PluginModule.getAgent(PluginModule.ExtraForm); + + ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); Set providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); for (ClipboardHandlerProvider provider : providers) { - if (provider.support(clazz)) { + if (provider.support(selection)) { selection = ((ClipboardHandlerProvider) provider).cut(selection); } } @@ -26,12 +25,11 @@ public abstract class ClipboardFilter { } public static T copy(T selection) { - - Class clazz = selection.getClass(); - ExtraFormClassManager manager = PluginModule.getAgent(PluginModule.ExtraForm); + + ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); Set providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); for (ClipboardHandlerProvider provider : providers) { - if (provider.support(clazz)) { + if (provider.support(selection)) { selection = ((ClipboardHandlerProvider) provider).copy(selection); } } @@ -39,12 +37,11 @@ public abstract class ClipboardFilter { } public static T paste(T selection) { - - Class clazz = selection.getClass(); - ExtraFormClassManager manager = PluginModule.getAgent(PluginModule.ExtraForm); + + ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); Set providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); for (ClipboardHandlerProvider provider : providers) { - if (provider.support(clazz)) { + if (provider.support(selection)) { selection = ((ClipboardHandlerProvider) provider).paste(selection); } } diff --git a/designer-base/src/test/java/com/fr/design/base/clipboard/ClipboardFilterTest.java b/designer-base/src/test/java/com/fr/design/base/clipboard/ClipboardFilterTest.java index f6b9190eb..bb254e79c 100644 --- a/designer-base/src/test/java/com/fr/design/base/clipboard/ClipboardFilterTest.java +++ b/designer-base/src/test/java/com/fr/design/base/clipboard/ClipboardFilterTest.java @@ -1,7 +1,7 @@ package com.fr.design.base.clipboard; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.fun.ClipboardHandlerProvider; -import com.fr.form.main.ExtraFormClassManager; import com.fr.plugin.injectable.PluginModule; import com.fr.stable.fun.mark.Mutable; import org.easymock.EasyMock; @@ -24,19 +24,19 @@ public class ClipboardFilterTest { @Before public void setUp() throws Exception { - + Set providers = new HashSet<>(); providers.add(new TestClipboardHandlerProvider()); - - ExtraFormClassManager formClassManager = EasyMock.mock(ExtraFormClassManager.class); - EasyMock.expect(formClassManager.getArray(ClipboardHandlerProvider.XML_TAG)) + + ExtraDesignClassManager designClassManager = EasyMock.mock(ExtraDesignClassManager.class); + EasyMock.expect(designClassManager.getArray(ClipboardHandlerProvider.XML_TAG)) .andReturn(providers) .anyTimes(); - EasyMock.replay(formClassManager); - + EasyMock.replay(designClassManager); + PowerMock.mockStatic(PluginModule.class); - EasyMock.expect(PluginModule.getAgent(PluginModule.ExtraForm)) - .andReturn(formClassManager) + EasyMock.expect(PluginModule.getAgent(PluginModule.ExtraDesign)) + .andReturn(designClassManager) .anyTimes(); PowerMock.replayAll(); } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index f51f6710b..d14780054 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -67,6 +67,7 @@ import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.StringUtils; import com.fr.third.javax.annotation.Nonnull; +import org.jetbrains.annotations.Nullable; import javax.swing.Icon; import java.awt.Container; @@ -164,21 +165,44 @@ public class XCreatorUtils { } private static void reInitExtra() { - + extraObjectMap.clear(); extraObjectMap.putAll(ExtraDesignClassManager.getInstance().getParameterWidgetOptionsMap()); extraObjectMap.putAll(ExtraDesignClassManager.getInstance().getFormWidgetOptionsMap()); } - + private static void putExtraEditor() { if (DesignModuleFactory.getChartEditorClass() != null) { objectMap.put(DesignModuleFactory.getChartEditorClass(), XChartEditor.class); } } - + + /** + * 对于继承的子组件来说,可能并没有对应的 XCreator + * 这个时候,就需要递归的找父类 + * + * @param clazz 组件类 + * @return 创建类 + */ + @SuppressWarnings("unchecked") + @Nullable + private static Class similarXCreatorClass(Class clazz) { + + Class target = clazz; + Class xClazz = null; + //判断条件有两个 + //1.还没找到对应的 xClazz + //2.一直到 终极父类-Widget 都找不到 + while (xClazz == null && Widget.class.isAssignableFrom(target)) { + xClazz = searchXCreatorClass((Class) target); + target = target.getSuperclass(); + } + return xClazz; + } + @SuppressWarnings("unchecked") private static Class searchXCreatorClass(Class clazz) { - + Class xClazz = (Class) objectMap.get(clazz); if (xClazz == null) { xClazz = (Class) extraObjectMap.get(clazz); @@ -214,7 +238,7 @@ public class XCreatorUtils { clazz = NullCreator.class; } else { widgetClass = widget.getClass(); - clazz = XCreatorUtils.searchXCreatorClass(widgetClass); + clazz = XCreatorUtils.similarXCreatorClass(widgetClass); if (clazz == null) { FineLoggerFactory.getLogger().error(widget + "'s" + " xcreator doesn't exsit!"); clazz = NullCreator.class; diff --git a/designer-form/src/test/java/com/fr/design/designer/beans/models/SelectionModelTest.java b/designer-form/src/test/java/com/fr/design/designer/beans/models/SelectionModelTest.java index 921133a21..06f1be65c 100644 --- a/designer-form/src/test/java/com/fr/design/designer/beans/models/SelectionModelTest.java +++ b/designer-form/src/test/java/com/fr/design/designer/beans/models/SelectionModelTest.java @@ -1,5 +1,6 @@ package com.fr.design.designer.beans.models; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.beans.events.CreatorEventListenerTable; import com.fr.design.designer.creator.XCreator; import com.fr.design.fun.ClipboardHandlerProvider; @@ -50,25 +51,26 @@ public class SelectionModelTest { EasyMock.expect(provider.support(EasyMock.anyObject())).andReturn(true).anyTimes(); EasyMock.expect(provider.paste(EasyMock.anyObject())).andReturn(null).anyTimes(); EasyMock.replay(provider); - + Set providers = new HashSet<>(); providers.add(provider); - - ExtraFormClassManager formClassManager = EasyMock.mock(ExtraFormClassManager.class); - EasyMock.expect(formClassManager.getArray(ClipboardHandlerProvider.XML_TAG)) + + ExtraDesignClassManager designManager = EasyMock.mock(ExtraDesignClassManager.class); + EasyMock.expect(designManager.getArray(ClipboardHandlerProvider.XML_TAG)) .andReturn(providers) .anyTimes(); - EasyMock.expect(formClassManager.getArray("DesignerEditListenerProvider")) + ExtraFormClassManager formManager = EasyMock.mock(ExtraFormClassManager.class); + EasyMock.expect(formManager.getArray("DesignerEditListenerProvider")) .andReturn(new HashSet()) .anyTimes(); - - - EasyMock.replay(formClassManager); - + EasyMock.replay(designManager, formManager); + PowerMock.mockStatic(PluginModule.class); - EasyMock.expect(PluginModule.getAgent(PluginModule.ExtraForm)) - .andReturn(formClassManager) + EasyMock.expect(PluginModule.getAgent(PluginModule.ExtraDesign)) + .andReturn(designManager) .anyTimes(); + EasyMock.expect(PluginModule.getAgent(PluginModule.ExtraForm)) + .andReturn(formManager).anyTimes(); PowerMock.replayAll(); } diff --git a/designer-form/src/test/java/com/fr/design/designer/creator/XCreatorUtilsTest.java b/designer-form/src/test/java/com/fr/design/designer/creator/XCreatorUtilsTest.java new file mode 100644 index 000000000..1efd752d1 --- /dev/null +++ b/designer-form/src/test/java/com/fr/design/designer/creator/XCreatorUtilsTest.java @@ -0,0 +1,17 @@ +package com.fr.design.designer.creator; + +import com.fr.form.ui.EditorHolder; +import org.junit.Assert; +import org.junit.Test; + +public class XCreatorUtilsTest { + + @Test + public void testCreateXCreator() throws Exception { + + XCreator xCreator = XCreatorUtils.createXCreator(new EditorHolder() { + }); + + Assert.assertFalse(xCreator instanceof NullCreator); + } +} \ No newline at end of file From 16c7a6f4ddb6079424848a24d7301b86ab2c0b2e Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 20 May 2020 09:20:43 +0800 Subject: [PATCH 349/375] REPORT-31836 && REPORT-31874 --- .../java/com/fr/design/os/impl/PMDialogAction.java | 11 ++++++----- .../search/manager/impl/RecommendSearchManager.java | 8 +++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java b/designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java index 3f2f09728..7e6eccf74 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java @@ -21,10 +21,11 @@ public class PMDialogAction implements OSBasedAction { DesignUtils.visitEnvServerByParameters( PLUGIN_MANAGER_ROUTE,null,null); return; } - if (ServerPreferenceConfig.getInstance().isUseOptimizedUPM() && !OperatingSystem.isLinux()) { - UpmFinder.showUPMDialog(); - } else { - WebViewDlgHelper.createPluginDialog(); - } +// if (ServerPreferenceConfig.getInstance().isUseOptimizedUPM() && !OperatingSystem.isLinux()) { +// UpmFinder.showUPMDialog(); +// } else { +// } + // 直接这里屏蔽掉 防止有设置过 导致配置数据库值为true 即使设置界面屏蔽也没用 + WebViewDlgHelper.createPluginDialog(); } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index 05267220b..ce0d98776 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -10,6 +10,7 @@ import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; +import com.fr.general.ComparatorUtils; import com.fr.general.http.HttpToolbox; import com.fr.json.JSONArray; import com.fr.json.JSONObject; @@ -67,7 +68,12 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { if (jsonArray != null && jsonArray.length() > 0) { for (int i = 0; i < jsonArray.length(); i++) { AlphaFineHelper.checkCancel(); - AlphaCellModel alphaCellModel = CellModelHelper.getModelFromJson((JSONObject) jsonArray.get(i)); + JSONObject jo = jsonArray.getJSONObject(i); + JSONObject innerJo = jo.getJSONObject("result"); + if (innerJo != null && ComparatorUtils.equals("failed", innerJo.get("state"))) { + continue; + } + AlphaCellModel alphaCellModel = CellModelHelper.getModelFromJson(jo); if (alphaCellModel != null && !alreadyContain(alphaCellModel) && !this.recommendModelList.contains(alphaCellModel)) { this.recommendModelList.add(alphaCellModel); } From 24a569e172025aeb491ffcd33b305f2a51f3facf Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 20 May 2020 13:06:39 +0800 Subject: [PATCH 350/375] REPORT-31236 && REPORT-31801 --- .../actions/server/GlobalTableDataAction.java | 6 ++++-- .../tabledatapane/DBTableDataPane.java | 5 +---- .../tabledatapane/MaxMemRowCountPanel.java | 20 ++++++++++++++++--- .../design/cell/editor/RichTextToolBar.java | 2 +- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java b/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java index 84591579e..0e9db97c7 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java @@ -27,6 +27,7 @@ import com.fr.transaction.Worker; import com.fr.transaction.WorkerFacade; import javax.swing.KeyStroke; +import java.awt.*; import java.awt.event.ActionEvent; import java.util.HashMap; import java.util.Map; @@ -35,7 +36,8 @@ import java.util.Map; * Global TableData. */ public class GlobalTableDataAction extends UpdateAction implements ResponseDataSourceChange { - //private static TableDataManagerPane globalTableDataPane = new TableDataManagerPane(); + + private static final Dimension DEFAULT_DIMENSION = new Dimension(1000, 600); public GlobalTableDataAction() { this.setMenuKeySet(SERVER_TABLEDATA); @@ -80,7 +82,7 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS tableDataConfig.renameTableData(oldName, newName); } }; - final BasicDialog globalTableDataDialog = globalTableDataPane.showLargeWindow(designerFrame, null); + final BasicDialog globalTableDataDialog = globalTableDataPane.showWindowWithCustomSize(designerFrame, null, DEFAULT_DIMENSION); globalTableDataDialog.addDialogActionListener(new DialogActionAdapter() { diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java index 8b5a4e77f..6ad281e26 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java @@ -238,13 +238,10 @@ public class DBTableDataPane extends AbstractTableDataPane { isShareCheckBox.setBackground(Color.WHITE); maxPanel = new MaxMemRowCountPanel(); maxPanel.setBorder(null); - JPanel wrapMaxPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - wrapMaxPanel.add(maxPanel); - wrapMaxPanel.setPreferredSize(new Dimension(350, 20)); UIToolbar editToolBar = ToolBarDef.createJToolBar(); toolBarDef.updateToolBar(editToolBar); editToolBar.add(isShareCheckBox); - editToolBar.add(wrapMaxPanel); + editToolBar.add(maxPanel); return editToolBar; } diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java index dc37d14be..00bbcc995 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java @@ -4,6 +4,7 @@ import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import com.fr.base.GraphHelper; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ilable.UILabel; @@ -15,6 +16,20 @@ import com.fr.design.gui.itoolbar.UIToolbar; public class MaxMemRowCountPanel extends UIToolbar { private static final int ALL_IN_MEMORY = 0; private static final int MAX_IN_MEMORY = 1; + private static final String[] CACHE_LIST = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save_All_Records_In_Memory"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Max_Mem_Row_Count") }; + private static final int MAX_WIDTH = getMaxComBoBoxWidth() > 200 ? 350 : 250; + + private static int getMaxComBoBoxWidth() { + int maxWidth = GraphHelper.getWidth(CACHE_LIST[0]); + for (int i = 1; i < CACHE_LIST.length; i++) { + int width = GraphHelper.getWidth(CACHE_LIST[i]); + if (width > maxWidth) { + maxWidth = width; + } + } + return maxWidth; + } private UISpinner numberSpinner; private UIComboBox switchCache; @@ -44,7 +59,7 @@ public class MaxMemRowCountPanel extends UIToolbar { @Override public Dimension getPreferredSize() { Dimension dim = super.getPreferredSize(); - dim.width = 340; + dim.width = MAX_WIDTH; return dim; }; @@ -52,8 +67,7 @@ public class MaxMemRowCountPanel extends UIToolbar { this.setFloatable(false); this.setRollover(true); this.setBackground(UIConstants.NORMAL_BACKGROUND); - String[] cacheList = { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save_All_Records_In_Memory"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Max_Mem_Row_Count") }; - switchCache = new UIComboBox(cacheList); + switchCache = new UIComboBox(CACHE_LIST); switchCache.addActionListener(switchStateL); numberSpinner = new UISpinner(0, Integer.MAX_VALUE, 1); } diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java index 37e6cd9db..52a33ff12 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java @@ -155,7 +155,7 @@ public class RichTextToolBar extends BasicPane{ private void bindListener(){ FRFont defaultFont = (this.textPane != null) ? FRFont.getInstance(this.textPane.getFont()) : RichTextPane.DEFAUL_FONT; fontNameComboBox.addItemListener(fontNameItemListener); - fontNameComboBox.setSelectedItem(defaultFont.getFontName()); + fontNameComboBox.setSelectedItem(defaultFont.getFamily()); fontSizeComboBox.addItemListener(fontSizeItemListener); fontSizeComboBox.setSelectedItem(scaleDown(defaultFont.getSize())); From 3ea7e6e79b5eaab4ebb59b56a1a61609f27a31c0 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 20 May 2020 20:04:58 +0800 Subject: [PATCH 351/375] =?UTF-8?q?CHART-13988=20=E6=95=A3=E7=82=B9?= =?UTF-8?q?=E5=9B=BE=E5=A4=A7=E6=95=B0=E6=8D=AE=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E6=A0=87=E8=AE=B0=E7=82=B9=E7=89=B9=E6=AE=8A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scatter/VanChartScatterConditionPane.java | 4 +-- ...tScatterLargeModelMarkerConditionPane.java | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/scatter/large/VanChartScatterLargeModelMarkerConditionPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java index ce91afe7e..c1e7886c9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java @@ -23,7 +23,7 @@ import com.fr.van.chart.scatter.component.VanChartScatterLineTypeConditionPane; import com.fr.van.chart.scatter.component.VanChartScatterMarkerConditionPane; import com.fr.van.chart.scatter.component.label.VanChartScatterLabelConditionPane; import com.fr.van.chart.scatter.component.tooltip.VanChartScatterTooltipConditionPane; -import com.fr.van.chart.scatter.large.VanChartLargeModelMarkerConditionPane; +import com.fr.van.chart.scatter.large.VanChartScatterLargeModelMarkerConditionPane; import java.awt.Dimension; @@ -53,7 +53,7 @@ public class VanChartScatterConditionPane extends DataSeriesConditionPane { classPaneMap.put(VanChartAttrTrendLine.class, new VanChartTrendLineConditionPane(this)); classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this)); if(PlotFactory.largeDataModel(plot)){ - classPaneMap.put(VanChartAttrMarker.class, new VanChartLargeModelMarkerConditionPane(this)); + classPaneMap.put(VanChartAttrMarker.class, new VanChartScatterLargeModelMarkerConditionPane(this)); } else { classPaneMap.put(VanChartAttrLine.class, new VanChartScatterLineTypeConditionPane(this)); classPaneMap.put(VanChartAttrMarker.class, new VanChartScatterMarkerConditionPane(this)); diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/large/VanChartScatterLargeModelMarkerConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/large/VanChartScatterLargeModelMarkerConditionPane.java new file mode 100644 index 000000000..32dc88be1 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/large/VanChartScatterLargeModelMarkerConditionPane.java @@ -0,0 +1,29 @@ +package com.fr.van.chart.scatter.large; + +import com.fr.chart.chartglyph.Marker; +import com.fr.design.condition.ConditionAttributesPane; +import com.fr.plugin.chart.marker.type.MarkerType; +import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; +import com.fr.van.chart.designer.other.condition.item.VanChartMarkerConditionPane; + +public class VanChartScatterLargeModelMarkerConditionPane extends VanChartMarkerConditionPane { + + public VanChartScatterLargeModelMarkerConditionPane(ConditionAttributesPane conditionAttributesPane) { + super(conditionAttributesPane); + } + + protected void initMarkerPane() { + + markerPane = new VanChartLargeModelMarkerPane() { + protected VanChartCommonMarkerPane createCommonMarkerPane() { + + return new VanChartCommonMarkerPane() { + protected Marker[] getMarkers() { + return getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO}); + } + }; + } + + }; + } +} From 6b5301b490c10a8963311e5ce3dda72fade67770 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 20 May 2020 21:41:53 +0800 Subject: [PATCH 352/375] REPORT-31834 && REPORT-31874 --- .../com/fr/design/formula/FormulaPane.java | 34 ++++++++++++++++--- .../design/os/impl/DatabaseDialogAction.java | 12 ++++--- .../com/fr/design/os/impl/PMDialogAction.java | 11 +++--- .../fr/design/formula/FormulaPaneTest.java | 25 ++++++++++++++ 4 files changed, 67 insertions(+), 15 deletions(-) create mode 100644 designer-base/src/test/java/com/fr/design/formula/FormulaPaneTest.java diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index 32e7030bb..9259248ac 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -2,7 +2,6 @@ package com.fr.design.formula; import com.fr.base.BaseFormula; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.border.UIRoundedBorder; import com.fr.design.constants.UIConstants; @@ -25,7 +24,6 @@ import com.fr.log.FineLoggerFactory; import com.fr.parser.FRLexer; import com.fr.parser.FRParser; import com.fr.stable.EncodeConstants; -import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.stable.script.Expression; @@ -54,7 +52,10 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; -import java.util.Locale; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; /** * 公式编辑面板 @@ -413,14 +414,19 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { if (keyWord.length() != 0) { NameAndDescription[] descriptions = FunctionConstants.ALL.getDescriptions(); int lengthOfDes = descriptions.length; + List list = new ArrayList<>(); for (int i = 0; i < lengthOfDes; i++) { NameAndDescription and = descriptions[i]; String functionName = and.searchResult(keyWord, findDescription); if (StringUtils.isNotBlank(functionName)) { - listModel.addElement(functionName); + list.add(functionName); } } + Collections.sort(list, new SimilarComparator(keyWord)); + for (String name : list) { + listModel.addElement(name); + } if (!listModel.isEmpty()) { tipsList.setSelectedIndex(0); @@ -969,6 +975,26 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { } } + public static class SimilarComparator implements Comparator { + + private String searchKey; + + public SimilarComparator(String searchKey) { + this.searchKey = searchKey.toLowerCase(); + } + + @Override + public int compare(String o1, String o2) { + if (o1.toLowerCase().startsWith(searchKey)) { + return -1; + } + if (o2.toLowerCase().startsWith(searchKey)) { + return 1; + } + return o2.compareTo(o1); + } + } + public static class TextFolderUserObject { private String text; diff --git a/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java b/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java index 7db000493..acd906897 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java @@ -24,11 +24,13 @@ public class DatabaseDialogAction implements OSBasedAction { @Override public void execute(Object... objects) { - if (ServerPreferenceConfig.getInstance().isUseUniverseDBM() && !OperatingSystem.isLinux()) { - UniversalDatabaseOpener.showUniverseDatabaseDialog(); - } else { - openDesignDatabaseManager(); - } +// if (ServerPreferenceConfig.getInstance().isUseUniverseDBM() && !OperatingSystem.isLinux()) { +// UniversalDatabaseOpener.showUniverseDatabaseDialog(); +// } else { +// } + // 直接这里屏蔽掉 防止有设置过 导致配置数据库值为true 即使设置界面屏蔽也没用 + openDesignDatabaseManager(); + } private void openDesignDatabaseManager() { diff --git a/designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java b/designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java index 7e6eccf74..3f2f09728 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java @@ -21,11 +21,10 @@ public class PMDialogAction implements OSBasedAction { DesignUtils.visitEnvServerByParameters( PLUGIN_MANAGER_ROUTE,null,null); return; } -// if (ServerPreferenceConfig.getInstance().isUseOptimizedUPM() && !OperatingSystem.isLinux()) { -// UpmFinder.showUPMDialog(); -// } else { -// } - // 直接这里屏蔽掉 防止有设置过 导致配置数据库值为true 即使设置界面屏蔽也没用 - WebViewDlgHelper.createPluginDialog(); + if (ServerPreferenceConfig.getInstance().isUseOptimizedUPM() && !OperatingSystem.isLinux()) { + UpmFinder.showUPMDialog(); + } else { + WebViewDlgHelper.createPluginDialog(); + } } } diff --git a/designer-base/src/test/java/com/fr/design/formula/FormulaPaneTest.java b/designer-base/src/test/java/com/fr/design/formula/FormulaPaneTest.java new file mode 100644 index 000000000..c82423daa --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/formula/FormulaPaneTest.java @@ -0,0 +1,25 @@ +package com.fr.design.formula; + +import junit.framework.TestCase; +import org.junit.Assert; +import org.junit.Test; + +import java.util.Arrays; + + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/5/20 + */ +public class FormulaPaneTest extends TestCase { + + @Test + public void testSimilarComparator() { + String[] strs = new String[] {"ScriptEval", "SPLIT", "SUMPRECISE"}; + String[] result = new String[] {"SPLIT", "ScriptEval", "SUMPRECISE"}; + Arrays.sort(strs, new FormulaPane.SimilarComparator("sp")); + Assert.assertArrayEquals(result, strs); + } + +} \ No newline at end of file From 3328cf659495c0b0b1ce9a55d0c6816289512d68 Mon Sep 17 00:00:00 2001 From: "Java.Edge" Date: Thu, 21 May 2020 10:12:48 +0800 Subject: [PATCH 353/375] =?UTF-8?q?REPORT-31784=20=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E9=BB=98=E8=AE=A4=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=BC=A9=E7=95=A5=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/TableDataCreatorProducer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataCreatorProducer.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataCreatorProducer.java index d4e1c61b7..dcb38c14e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataCreatorProducer.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataCreatorProducer.java @@ -35,6 +35,7 @@ public class TableDataCreatorProducer { "ds", "/com/fr/design/images/data/database.png", DBTableData.class, DBTableDataPane.class); TableDataNameObjectCreator ds_Class = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Class"), + "Class", "/com/fr/design/images/data/source/classTableData.png", ClassTableData.class, ClassTableDataPane.class); TableDataNameObjectCreator table = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Embedded"), "Embedded", From e04740e1cfc85be5085daa11059649faa2421a1c Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 21 May 2020 13:35:34 +0800 Subject: [PATCH 354/375] =?UTF-8?q?REPORT-31866=E3=80=90=E5=86=92=E7=83=9F?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E3=80=91=E5=88=87=E6=8D=A2=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=EF=BC=8C=E6=96=B0=E5=BB=BA=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E9=9B=86=E5=B1=95=E7=A4=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=20&&=20REPORT-28701=20=E5=90=8C=E6=AD=A5release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 18 ++- .../gui/ifilechooser/AbstractFileChooser.java | 103 ++++++++++++ .../gui/ifilechooser/UINativeFileChooser.java | 153 ++++++++++++++++++ .../com/fr/design/os/impl/SupportOSImpl.java | 12 ++ .../mainframe/FormWidgetDetailPane.java | 34 +++- 5 files changed, 310 insertions(+), 10 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/gui/ifilechooser/AbstractFileChooser.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/ifilechooser/UINativeFileChooser.java diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index f8b089fe6..cb68bb6e4 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -2,6 +2,7 @@ package com.fr.design.file; import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.io.BaseBook; +import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.data.DesignTableDataManager; @@ -384,9 +385,14 @@ public class HistoryTemplateListCache implements CallbackEvent { historyList.set(i, template); // 替换当前正在编辑的模板,使用添加并激活的方式,以便使用统一的入口来处理监听事件 if (isCurrentEditingFile(template.getPath())) { - DesignerContext.getDesignerFrame().addAndActivateJTemplate(template); - setCurrentEditingTemplate(template); - FineLoggerFactory.getLogger().info("Env Change Current Editing Template."); + loadCurrentTemplate(template); + } + } else { + // 当模板为空时 说明是一个新建的未保存模板 但是内存中保存了该模板 可以从中获取 + JTemplate jt = historyList.get(i); + // 另外如果该模板是正在编辑的模板,需要要激活 + if (jt != null && isCurrentEditingFile(jt.getPath())) { + loadCurrentTemplate(jt); } } } catch (Exception e) { @@ -400,6 +406,12 @@ public class HistoryTemplateListCache implements CallbackEvent { FineLoggerFactory.getLogger().info("Env Change Template Loaded."); } + private void loadCurrentTemplate(JTemplate template) { + DesignerContext.getDesignerFrame().addAndActivateJTemplate(template); + setCurrentEditingTemplate(template); + FineLoggerFactory.getLogger().info("Env Change Current Editing Template " + template.getTemplateName()); + } + /** * 重新载入当前模板,刷新数据/对象 */ diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/AbstractFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/AbstractFileChooser.java new file mode 100644 index 000000000..ee61fd81f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/AbstractFileChooser.java @@ -0,0 +1,103 @@ +package com.fr.design.gui.ifilechooser; + +import javax.swing.filechooser.FileFilter; +import java.awt.*; +import java.io.File; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/3/31 + */ +public abstract class AbstractFileChooser { + + /** + * 返回当前目录 + * + */ + public abstract File getCurrentDirectory(); + + /** + * 返回当前的文件选择过滤器 + * + */ + public abstract FileFilter getFileFilter(); + + /** + * 返回选择的文件 + * + */ + public abstract File getSelectedFile(); + + /** + * 多文件选择模式下 返回选择的多个文件 + * + */ + public abstract File[] getSelectedFiles(); + + /** + * 是否可以选择多个文件 + * + */ + public abstract boolean isMultiSelectionEnabled(); + + /** + * 设置当前选择的目录 + * + */ + public abstract void setCurrentDirectory(File dir); + + /** + * 设置左上角标题 + * + */ + public abstract void setDialogTitle(String title); + + /** + * 设置当前的文件过滤器 + * + */ + public abstract void setFileFilter(final FileFilter filter); + + /** + * 设置文件选择器模式 + * + * JFileChooser.FILES_ONLY + * JFileChooser.DIRECTORIES_ONLY + * JFileChooser.FILES_AND_DIRECTORIES + */ + public abstract void setFileSelectionMode(int selectionMode); + + /** + * 设置是否允许选择多个文件 + * + */ + public abstract void setMultiSelectionEnabled(boolean multiple); + + /** + * 设置选择的文件 用于showSaveDialog + * + */ + public abstract void setSelectedFile(File file); + + /** + * 弹出文件选择器 打开文件 + * + */ + public abstract int showOpenDialog(Component parent); + + /** + * 弹出文件选择器 保存文件 + * + */ + public abstract int showSaveDialog(Component parent); + + + /** + * https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4031440 + * + * 设置文件名后缀 起到文件过滤的作用 形如 "*.jpg;*.jpeg" + * + */ + public abstract void setExtensionFilter(String file); +} diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/UINativeFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/UINativeFileChooser.java new file mode 100644 index 000000000..597f733f1 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/UINativeFileChooser.java @@ -0,0 +1,153 @@ +package com.fr.design.gui.ifilechooser; + +import com.fr.design.mainframe.DesignerContext; +import com.fr.stable.os.OperatingSystem; + +import javax.swing.*; +import javax.swing.filechooser.FileFilter; +import java.awt.*; +import java.io.File; +import java.io.FilenameFilter; + + +/** + * 系统原生风格的文件选择器 + * + * jdk问题: + * https://bugs.openjdk.java.net/browse/JDK-4811090 不支持文件扩展选择 + * https://stackoverflow.com/questions/40713398/filter-not-working-in-filedialog windows下 setFilenameFilter不work + * + * @author hades + * @version 10.0 + * Created by hades on 2020/3/31 + */ +public class UINativeFileChooser extends AbstractFileChooser { + + private final FileDialog fileDialog; + private FileFilter fileFilter; + private int selectionMode; + + public UINativeFileChooser(File file) { + fileDialog = new FileDialog(DesignerContext.getDesignerFrame()); + if (file != null) { + fileDialog.setDirectory(file.getAbsolutePath()); + fileDialog.setFile(file.toString()); + } + } + + public UINativeFileChooser() { + this(null); + } + + @Override + public File getCurrentDirectory() { + return new File(fileDialog.getDirectory()); + } + + @Override + public FileFilter getFileFilter() { + return fileFilter; + } + + @Override + public File getSelectedFile() { + return new File(fileDialog.getDirectory() + fileDialog.getFile()); + } + + @Override + public File[] getSelectedFiles() { + return fileDialog.getFiles(); + } + + @Override + public boolean isMultiSelectionEnabled() { + return fileDialog.isMultipleMode(); + } + + @Override + public void setCurrentDirectory(File f) { + fileDialog.setDirectory(f.toString()); + } + + @Override + public void setDialogTitle(String title) { + fileDialog.setTitle(title); + } + + @Override + public void setFileFilter(final FileFilter cff) { + FilenameFilter filter = new FilenameFilter() { + @Override + public boolean accept(File Directory, String fileName) { + return cff.accept(new File(Directory.getAbsolutePath() + fileName)); + } + }; + fileDialog.setFilenameFilter(filter); + fileFilter = cff; + } + + @Override + public void setFileSelectionMode(int selectionMode) { + this.selectionMode = selectionMode; + } + + @Override + public void setMultiSelectionEnabled(boolean multiple) { + fileDialog.setMultipleMode(multiple); + } + + @Override + public void setSelectedFile(File file) { + fileDialog.setDirectory(file.getAbsolutePath()); + fileDialog.setFile(file.getName()); + } + + @Override + public int showOpenDialog(Component parent) { + boolean appleProperty = OperatingSystem.isMacos() && selectionMode == JFileChooser.DIRECTORIES_ONLY; + if (appleProperty) { + System.setProperty("apple.awt.fileDialogForDirectories", "true"); + } + try { + fileDialog.setLocale(JComponent.getDefaultLocale()); + fileDialog.setMode(FileDialog.LOAD); + fileDialog.setVisible(true); + return fileDialog.getFile() == null ? JFileChooser.CANCEL_OPTION : JFileChooser.APPROVE_OPTION; + } finally { + if (appleProperty) { + System.setProperty("apple.awt.fileDialogForDirectories", "false"); + } + } + } + + @Override + public int showSaveDialog(Component parent) { + fileDialog.setLocale(JComponent.getDefaultLocale()); + fileDialog.setMode(FileDialog.SAVE); + fileDialog.setVisible(true); + return fileDialog.getFile() == null ? JFileChooser.CANCEL_OPTION : JFileChooser.APPROVE_OPTION; + } + + @Override + public void setExtensionFilter(String file) { + fileDialog.setFile(file); + } + + /** + * 确认本地文件选择器是否支持选择模式 + * @param selectionMode 选择模式 + * @return 是否支持选择模式 + */ + public static boolean supportsSelectionMode(int selectionMode) { + switch (selectionMode) { + case JFileChooser.FILES_AND_DIRECTORIES: + return false; + case JFileChooser.DIRECTORIES_ONLY: + return OperatingSystem.isMacos(); + case JFileChooser.FILES_ONLY: + default: + return true; + } + } + +} diff --git a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java index d799d0046..366e7d565 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java @@ -105,6 +105,18 @@ public enum SupportOSImpl implements SupportOS { public boolean support() { return OperatingSystem.isWindows(); } + }, + + /** + * 原生文件选择器弹窗 + * https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8019464 mac下原生弹窗国际化设置无效,jdk11中有修复 + * + */ + NATIVE_CHOOSER { + @Override + public boolean support() { + return OperatingSystem.isWindows(); + } } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index ecb3faa70..311ea4cb7 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -5,8 +5,10 @@ import com.fr.base.FRContext; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ifilechooser.UINativeFileChooser; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.widget.FRWidgetFactory; import com.fr.form.share.SharableWidgetProvider; import com.fr.form.share.ShareLoader; @@ -333,13 +335,31 @@ public class FormWidgetDetailPane extends FormDockView{ new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - JFileChooser fileChooser = new JFileChooser(); - fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); - fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu")); - int returnValue = fileChooser.showDialog(new UILabel(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); - if (returnValue == JFileChooser.APPROVE_OPTION) { - final File chosenFile = fileChooser.getSelectedFile(); - installFromDiskZipFile(chosenFile); + if (SupportOSImpl.NATIVE_CHOOSER.support()) { + UINativeFileChooser nativeFileChooser = new UINativeFileChooser(); + nativeFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); + nativeFileChooser.setMultiSelectionEnabled(true); + nativeFileChooser.setExtensionFilter("*.reu"); + nativeFileChooser.setDialogTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); + int returnValue = nativeFileChooser.showOpenDialog(new UILabel()); + if (returnValue == JFileChooser.APPROVE_OPTION) { + final File[] chosenFiles = nativeFileChooser.getSelectedFiles(); + for (File file : chosenFiles) { + installFromDiskZipFile(file); + } + } + } else { + JFileChooser fileChooser = new JFileChooser(); + fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); + fileChooser.setMultiSelectionEnabled(true); + fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu")); + int returnValue = fileChooser.showDialog(new UILabel(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); + if (returnValue == JFileChooser.APPROVE_OPTION) { + final File[] chosenFiles = fileChooser.getSelectedFiles(); + for (File file : chosenFiles) { + installFromDiskZipFile(file); + } + } } } } From ba5c403f7ac586d8e8393f7557d559c66dd36d99 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 21 May 2020 15:48:31 +0800 Subject: [PATCH 355/375] =?UTF-8?q?REPORT-32068=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=90=AF=E5=8A=A8=E9=BB=91=E5=B1=8F=EF=BC=8C=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E4=B8=80=E6=AC=A1=EF=BC=8C=E9=87=8D=E5=90=AF=E5=90=8E?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EastRegionContainerPane.java | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index a1f88d77c..622e9a59c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -11,6 +11,7 @@ import com.fr.design.gui.ibutton.UIButtonUI; import com.fr.design.gui.icontainer.UIEastResizableContainer; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.VerticalFlowLayout; +import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.general.FRFont; @@ -150,12 +151,18 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void on(PluginEvent event) { PluginContext context = event.getContext(); PluginRuntime runtime = context.getRuntime(); - Set providers = runtime.get(PropertyItemPaneProvider.XML_TAG); - for (PropertyItemPaneProvider provider : providers) { - addPropertyItem(provider); - } - updateAllPropertyPane(); - } + final Set providers = runtime.get(PropertyItemPaneProvider.XML_TAG); + // UI相关的逻辑 用UI线程执行 不走FinePluginController线程 走FinePluginController线程有几率出问题 + // 容易导致FinePluginController持有Swing内部的java.awt.Component$AWTTreeLock 这个锁不能被UI线程之外的线程持有 否则容易造成UI线程被Blocked住 + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + for (PropertyItemPaneProvider provider : providers) { + addPropertyItem(provider); + } + updateAllPropertyPane(); + } + }); } }, filter); PluginListenerRegistration.getInstance().listen( PluginEventType.BeforeStop, @@ -164,12 +171,16 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void on(PluginEvent event) { PluginContext context = event.getContext(); PluginRuntime runtime = context.getRuntime(); - Set providers = runtime.get(PropertyItemPaneProvider.XML_TAG); - for (PropertyItemPaneProvider provider : providers) { - removePropertyItem(provider); - - } - updateAllPropertyPane(); + final Set providers = runtime.get(PropertyItemPaneProvider.XML_TAG); + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + for (PropertyItemPaneProvider provider : providers) { + removePropertyItem(provider); + } + updateAllPropertyPane(); + } + }); } }, filter); } From ae745082ebcd19b4e0a597e9ba1cd19b1f13e915 Mon Sep 17 00:00:00 2001 From: Harrison Date: Thu, 21 May 2020 16:33:33 +0800 Subject: [PATCH 356/375] =?UTF-8?q?REPORT-32088=E3=80=90=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=8A=A0=E5=AF=86=E3=80=91@harrison=E9=9B=86=E7=BE=A4=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=87=BA=E7=8E=B0=E5=88=9D=E5=A7=8B=E5=8C=96=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=20=E6=8F=92=E4=BB=B6=E6=8E=A5=E5=8F=A3=E7=9A=84?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E6=9C=89=E7=82=B9=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=20=E4=B8=8D=E8=83=BD=E6=94=BE=E5=88=B0=20form=20=E4=B8=8B?= =?UTF-8?q?=EF=BC=8C=20=E8=A6=81=E6=94=BE=E5=88=B0=20design=20=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/beans/events/CreatorEventListenerTable.java | 4 ++-- .../design/designer/beans/models/SelectionModelTest.java | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/events/CreatorEventListenerTable.java b/designer-form/src/main/java/com/fr/design/designer/beans/events/CreatorEventListenerTable.java index aa0ea1c9a..d7f1a199c 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/events/CreatorEventListenerTable.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/events/CreatorEventListenerTable.java @@ -1,8 +1,8 @@ package com.fr.design.designer.beans.events; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.creator.XComponent; import com.fr.design.fun.DesignerEditListenerProvider; -import com.fr.form.main.ExtraFormClassManager; import com.fr.general.ComparatorUtils; import com.fr.plugin.injectable.PluginModule; @@ -44,7 +44,7 @@ public class CreatorEventListenerTable { } //触发插件的事件 - ExtraFormClassManager manager = PluginModule.getAgent(PluginModule.ExtraForm); + ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); Set providers = manager.getArray(DesignerEditListenerProvider.XML_TAG); for (DesignerEditListenerProvider provider : providers) { provider.fireCreatorModified(evt); diff --git a/designer-form/src/test/java/com/fr/design/designer/beans/models/SelectionModelTest.java b/designer-form/src/test/java/com/fr/design/designer/beans/models/SelectionModelTest.java index 06f1be65c..6ab4dd308 100644 --- a/designer-form/src/test/java/com/fr/design/designer/beans/models/SelectionModelTest.java +++ b/designer-form/src/test/java/com/fr/design/designer/beans/models/SelectionModelTest.java @@ -6,7 +6,6 @@ import com.fr.design.designer.creator.XCreator; import com.fr.design.fun.ClipboardHandlerProvider; import com.fr.design.fun.impl.AbstractClipboardHandlerProvider; import com.fr.design.mainframe.FormDesigner; -import com.fr.form.main.ExtraFormClassManager; import com.fr.plugin.injectable.PluginModule; import com.fr.stable.fun.mark.Mutable; import org.easymock.EasyMock; @@ -59,18 +58,15 @@ public class SelectionModelTest { EasyMock.expect(designManager.getArray(ClipboardHandlerProvider.XML_TAG)) .andReturn(providers) .anyTimes(); - ExtraFormClassManager formManager = EasyMock.mock(ExtraFormClassManager.class); - EasyMock.expect(formManager.getArray("DesignerEditListenerProvider")) + EasyMock.expect(designManager.getArray("DesignerEditListenerProvider")) .andReturn(new HashSet()) .anyTimes(); - EasyMock.replay(designManager, formManager); + EasyMock.replay(designManager); PowerMock.mockStatic(PluginModule.class); EasyMock.expect(PluginModule.getAgent(PluginModule.ExtraDesign)) .andReturn(designManager) .anyTimes(); - EasyMock.expect(PluginModule.getAgent(PluginModule.ExtraForm)) - .andReturn(formManager).anyTimes(); PowerMock.replayAll(); } From 9e55fcdc503485805ee952e2a5ce2181baf5d2cf Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 21 May 2020 17:07:30 +0800 Subject: [PATCH 357/375] =?UTF-8?q?REPORT-32073=E3=80=90=E5=86=92=E7=83=9F?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E3=80=91=E6=A8=A1=E6=9D=BFweb=E5=B1=9E?= =?UTF-8?q?=E6=80=A7-=E5=B7=A5=E5=85=B7=E6=A0=8F=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=EF=BC=8C=E7=82=B9=E7=A1=AE=E5=AE=9A=EF=BC=8C?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=97=A0=E6=B3=95=E7=BC=A9=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/webattr/EditToolBar.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java b/designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java index 9bb14d106..044c395e4 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java @@ -31,6 +31,7 @@ import com.fr.form.ui.Widget; import com.fr.form.ui.WidgetInfoConfig; import com.fr.general.Background; +import com.fr.log.FineLoggerFactory; import com.fr.report.web.button.Email; import com.fr.report.web.button.Export; import com.fr.report.web.button.write.AppendColumnRow; @@ -224,7 +225,11 @@ public class EditToolBar extends BasicPane { String iconname = ((Button) widget).getIconName(); if (StringUtils.isNotBlank(iconname)) { Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconname); - toolBarButton.setIcon(new ImageIcon(iimage)); + if (iimage != null) { + toolBarButton.setIcon(new ImageIcon(iimage)); + } else { + FineLoggerFactory.getLogger().warn(iconname + " can not find in finedb!"); + } } } } From 9870bc907fdcbca3ee9706dadd5664e1a0c7bce3 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 21 May 2020 17:30:55 +0800 Subject: [PATCH 358/375] =?UTF-8?q?REPORT-32073=20fix=20=E6=8D=A2=E4=B8=AA?= =?UTF-8?q?=E5=A5=BD=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/webattr/EditToolBar.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java b/designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java index 044c395e4..f1cd05a90 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java @@ -224,9 +224,9 @@ public class EditToolBar extends BasicPane { if (widget instanceof Button) { String iconname = ((Button) widget).getIconName(); if (StringUtils.isNotBlank(iconname)) { - Image iimage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconname); - if (iimage != null) { - toolBarButton.setIcon(new ImageIcon(iimage)); + Image iconImage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconname); + if (iconImage != null) { + toolBarButton.setIcon(new ImageIcon(iconImage)); } else { FineLoggerFactory.getLogger().warn(iconname + " can not find in finedb!"); } From 6a6469cb357c61865ae0df11e0e5c2d97bfbb6b1 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 21 May 2020 20:30:15 +0800 Subject: [PATCH 359/375] =?UTF-8?q?REPORT-32105=20=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=90=8E=20JForm=E5=AF=B9=E8=B1=A1=E6=9C=AA?= =?UTF-8?q?=E9=87=8A=E6=94=BE=20=E5=AF=BC=E8=87=B4=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=9C=80=E7=BB=88=E5=8F=91=E7=94=9Foom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/JForm.java | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) 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 ff59a52d4..e2112f4f3 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 @@ -128,6 +128,8 @@ public class JForm extends JTemplate implements BaseJForm implements BaseJForm providers = runtime.get(PropertyItemPaneProvider.XML_TAG); - for (PropertyItemPaneProvider provider : providers) { - addPane(provider); - } - } - }, filter); + this.pluginListener = new PluginEventListener(PropertyItemPaneProvider.LAST) { + @Override + public void on(PluginEvent event) { + PluginContext context = event.getContext(); + PluginRuntime runtime = context.getRuntime(); + Set providers = runtime.get(PropertyItemPaneProvider.XML_TAG); + for (PropertyItemPaneProvider provider : providers) { + addPane(provider); + } + } + }; + PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, this.pluginListener, filter); } private void initPluginPane() { @@ -1038,4 +1040,10 @@ public class JForm extends JTemplate implements BaseJForm Date: Thu, 21 May 2020 22:43:56 +0800 Subject: [PATCH 360/375] =?UTF-8?q?MOBILE-27000=20=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E6=8E=A7=E4=BB=B6=E5=9B=BE=E6=A0=87=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/ui/MobileStyleDefinePane.java | 16 ++++++++++ .../mobile/ui/MobileStyleFontConfigPane.java | 29 +++++++++++++++++-- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java index c729b5fc0..83223d1ee 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java @@ -48,6 +48,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { private LineComboBox borderType; private NewColorSelectBox borderColor; private UISpinner borderRadius; + private NewColorSelectBox iconColor; private MobileStyleFontConfigPane fontConfigPane; MobileStyleDefinePane(Widget widget, Class customBeanPaneClass, @@ -69,6 +70,9 @@ public class MobileStyleDefinePane extends BasicBeanPane { borderColor.setSelectObject(ob.getBorderColor()); } borderRadius.setValue(ob.getBorderRadius()); + if (ob.getIconColor() != null) { + iconColor.setSelectObject(ob.getIconColor()); + } if (ob.getFont() != null) { fontConfigPane.populateBean(ob.getFont()); } @@ -83,6 +87,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { mobileStyle.setBorderType(borderType.getSelectedLineStyle()); mobileStyle.setBorderColor(borderColor.getSelectObject()); mobileStyle.setBorderRadius(borderRadius.getValue()); + mobileStyle.setIconColor(iconColor.getSelectObject()); mobileStyle.setFont(fontConfigPane.updateBean()); return mobileStyle; } @@ -123,6 +128,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { createBackgroundPane(); createBorderPane(); + createIconSettingPane(); createFontPane(); } @@ -155,6 +161,16 @@ public class MobileStyleDefinePane extends BasicBeanPane { commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderRadius")), borderRadius)); } + private void createIconSettingPane() { + iconColor = new NewColorSelectBox(NORMAL_COMBO_WIDTH); + iconColor.addSelectChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + } + }); + commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Icon_Color")), iconColor)); + } + private void createFontPane() { fontConfigPane = new MobileStyleFontConfigPane(); commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Font")), fontConfigPane)); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java index 7ea91353a..2b47c82b9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java @@ -4,11 +4,15 @@ import com.fr.base.BaseUtils; import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.i18n.Toolkit; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.stable.Constants; +import javax.swing.DefaultComboBoxModel; +import javax.swing.JLabel; +import javax.swing.JList; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Color; @@ -19,12 +23,14 @@ import java.awt.Font; import java.util.Vector; public class MobileStyleFontConfigPane extends JPanel { + public static final int FONT_NONE = 0; private static final int MAX_FONT_SIZE = 18; private static final int MIN_FONT_SIZE = 12; private static final Dimension BUTTON_SIZE = new Dimension(20, 18); public static Vector getFontSizes() { Vector FONT_SIZES = new Vector(); + FONT_SIZES.add(FONT_NONE); for (int i = MIN_FONT_SIZE; i <= MAX_FONT_SIZE; i++) { FONT_SIZES.add(i); } @@ -42,10 +48,11 @@ public class MobileStyleFontConfigPane extends JPanel { private void initComponent() { - fontSizeComboBox = new UIComboBox(getFontSizes()); - fontSizeComboBox.setSelectedItem(16); + fontSizeComboBox = new UIComboBox(); + fontSizeComboBox.setSelectedItem(0); + fontSizeComboBox.setModel(new DefaultComboBoxModel(getFontSizes())); fontSizeComboBox.setPreferredSize(new Dimension(60, 20)); - fontSizeComboBox.setEditable(true); + fontSizeComboBox.setRenderer(new LineCellRenderer()); underline = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png")); italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); @@ -96,4 +103,20 @@ public class MobileStyleFontConfigPane extends JPanel { underline.isSelected() ? Constants.LINE_THIN : Constants.LINE_NONE ); } + + private class LineCellRenderer extends UIComboBoxRenderer { + public LineCellRenderer() { + super(); + } + + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + JLabel renderer =(JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + int currentValue = ((Integer) value).intValue(); + if (currentValue == MobileStyleFontConfigPane.FONT_NONE) { + renderer.setText(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None")); + } + return renderer; + } + } + } From 492800655568b999a1af945435dda4585e07199f Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 22 May 2020 10:22:06 +0800 Subject: [PATCH 361/375] =?UTF-8?q?REPORT-32043=2010.0=E5=86=92=E7=83=9F?= =?UTF-8?q?=EF=BC=9A=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=90=AF=E5=8A=A8=E7=BB=8F?= =?UTF-8?q?=E5=B8=B8=E7=99=BD=E5=B1=8F=EF=BC=8C=E5=8D=A1=E4=BD=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/loghandler/LogHandlerBar.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java index f86cb22ef..433d601c0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java @@ -15,6 +15,11 @@ import static com.fr.design.i18n.Toolkit.i18nText; public class LogHandlerBar extends JPanel implements ItemSelectable { + // 可以作为常量 提前初始化 不用每次都去实时频繁的读取 + private static final String NORMAL_MARK = i18nText("Fine-Design_Basic_NNormal"); + private static final String ALERT_MARK = i18nText("Fine-Design_Basic_Alert"); + private static final String SERIOUSLY_MARK = i18nText("Fine-Design_Basic_Seriously"); + private static final long serialVersionUID = 1L; private ItemListener listeners; private UIButton clear; @@ -75,9 +80,13 @@ public class LogHandlerBar extends JPanel implements ItemSelectable { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - normalLabel.setText(i18nText("Fine-Design_Basic_NNormal") + '(' + getInfo() + ')'); - alertLabel.setText(i18nText("Fine-Design_Basic_Alert") + '(' + getError() + ')'); - seriouslyLabel.setText(i18nText("Fine-Design_Basic_Seriously") + '(' + getServer() + ')'); + // 这块逻辑执行地很频繁 + // 容易造成 AWT 与 FinePluginController 发生死锁 + // in18Text每次读取 资源的时候 都会走下插件引擎逻辑去读取下插件的资源 + // 应该避免每次都去读取 可以作为常量提前初始化好 避免与FinePluginController的竞争 + normalLabel.setText(NORMAL_MARK + '(' + getInfo() + ')'); + alertLabel.setText(ALERT_MARK + '(' + getError() + ')'); + seriouslyLabel.setText(SERIOUSLY_MARK + '(' + getServer() + ')'); } }); } From 3be3844d98a062b5a52650814566faf3796dfa72 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Fri, 22 May 2020 11:32:22 +0800 Subject: [PATCH 362/375] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/ui/MobileStyleDefinePane.java | 15 --------------- .../mobile/ui/MobileStyleFontConfigPane.java | 5 +++-- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java index 83223d1ee..5f11e46db 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java @@ -134,11 +134,6 @@ public class MobileStyleDefinePane extends BasicBeanPane { private void createBackgroundPane() { colorSelectBox = new ColorSelectBox(NORMAL_COMBO_WIDTH); - colorSelectBox.addSelectChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - } - }); JPanel backgroundPane = createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Background")), colorSelectBox); commomPane.add(backgroundPane); @@ -149,11 +144,6 @@ public class MobileStyleDefinePane extends BasicBeanPane { borderType.setSelectedLineStyle(Constants.LINE_THIN); borderType.setPreferredSize(new Dimension(NORMAL_COMBO_WIDTH + 15, 20)); borderColor = new NewColorSelectBox(NORMAL_COMBO_WIDTH); - borderColor.addSelectChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - } - }); borderRadius = new UISpinner(0, Integer.MAX_VALUE, 1, 2); borderRadius.setPreferredSize(new Dimension(NORMAL_COMBO_WIDTH + 20, 20)); commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderType")), borderType)); @@ -163,11 +153,6 @@ public class MobileStyleDefinePane extends BasicBeanPane { private void createIconSettingPane() { iconColor = new NewColorSelectBox(NORMAL_COMBO_WIDTH); - iconColor.addSelectChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - } - }); commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Icon_Color")), iconColor)); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java index 2b47c82b9..f765e2584 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java @@ -9,6 +9,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.stable.Constants; +import com.fr.stable.StringUtils; import javax.swing.DefaultComboBoxModel; import javax.swing.JLabel; @@ -49,8 +50,8 @@ public class MobileStyleFontConfigPane extends JPanel { private void initComponent() { fontSizeComboBox = new UIComboBox(); - fontSizeComboBox.setSelectedItem(0); fontSizeComboBox.setModel(new DefaultComboBoxModel(getFontSizes())); + fontSizeComboBox.setSelectedItem(0); fontSizeComboBox.setPreferredSize(new Dimension(60, 20)); fontSizeComboBox.setRenderer(new LineCellRenderer()); underline = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png")); @@ -113,7 +114,7 @@ public class MobileStyleFontConfigPane extends JPanel { JLabel renderer =(JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); int currentValue = ((Integer) value).intValue(); if (currentValue == MobileStyleFontConfigPane.FONT_NONE) { - renderer.setText(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None")); + renderer.setText(StringUtils.BLANK + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None")); } return renderer; } From d11a8cd9ba66e70597976367807d94a5f47ce59e Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 22 May 2020 13:22:42 +0800 Subject: [PATCH 363/375] =?UTF-8?q?CHART-13962=20=E4=B8=BA=E8=B6=8B?= =?UTF-8?q?=E5=8A=BF=E7=BA=BF=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../item/VanChartTrendLineConditionPane.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartTrendLineConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartTrendLineConditionPane.java index 328d7fcac..bf81bdb37 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartTrendLineConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartTrendLineConditionPane.java @@ -2,7 +2,7 @@ package com.fr.van.chart.designer.other.condition.item; import com.fr.chart.base.DataSeriesCondition; import com.fr.design.condition.ConditionAttributesPane; - +import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.base.VanChartAttrTrendLine; import com.fr.van.chart.designer.component.VanChartTrendLinePane; @@ -16,7 +16,7 @@ public class VanChartTrendLineConditionPane extends AbstractNormalMultiLineCondi @Override protected String getItemLabelString() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TrendLine"); + return Toolkit.i18nText("Fine-Design_Chart_TrendLine"); } @Override @@ -34,7 +34,7 @@ public class VanChartTrendLineConditionPane extends AbstractNormalMultiLineCondi * @return item的名称 */ public String nameForPopupMenuItem() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TrendLine"); + return Toolkit.i18nText("Fine-Design_Chart_TrendLine"); } @Override @@ -42,6 +42,10 @@ public class VanChartTrendLineConditionPane extends AbstractNormalMultiLineCondi return nameForPopupMenuItem(); } + public void setDefault() { + trendLinePane.populate(new VanChartAttrTrendLine()); + } + public void populate(DataSeriesCondition condition) { if (condition instanceof VanChartAttrTrendLine) { this.trendLinePane.populate((VanChartAttrTrendLine) condition); @@ -53,5 +57,4 @@ public class VanChartTrendLineConditionPane extends AbstractNormalMultiLineCondi } - } \ No newline at end of file From a66f27f9866161c0ac4b10eac4808da38c7367fd Mon Sep 17 00:00:00 2001 From: Lanlan Date: Fri, 22 May 2020 16:31:52 +0800 Subject: [PATCH 364/375] =?UTF-8?q?CHART-14022=20=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E8=AE=BE=E7=BD=AE=E9=80=9A=E7=94=A8=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E7=9A=84=E9=9D=A2=E6=9D=BF=E6=8E=92=E5=B8=83=E9=83=BD?= =?UTF-8?q?=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/gui/style/FormatPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java b/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java index 22f0a3647..0b33b7adf 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java @@ -144,7 +144,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse optionPane.setPreferredSize(new Dimension(0, 0)); optionPane.add(option, "show"); - Component[][] components = getComponent(fontPane, centerPane, typePane, optionPane); + Component[][] components = getComponent(fontPane, centerPane, typePane); this.add(createContentPane(components), BorderLayout.CENTER); } @@ -158,7 +158,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse } - protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane, JPanel optionPane) { + protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { return new Component[][]{ new Component[]{null, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Format"), SwingConstants.LEFT), typePane}, From 6ae8ef494ef9e6d8fac1c5730d22b3327baaffd6 Mon Sep 17 00:00:00 2001 From: Harrison Date: Fri, 22 May 2020 16:58:03 +0800 Subject: [PATCH 365/375] =?UTF-8?q?REPORT-32162=20=E6=9B=BF=E6=8D=A2=20ui?= =?UTF-8?q?=20=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=9C=A8=E4=BA=8B=E4=BB=B6=E5=88=86=E5=8F=91=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EastRegionContainerPane.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 622e9a59c..394dfca1e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -485,24 +485,30 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void replaceAuthorityEditionPane(JComponent pane) { propertyItemMap.get(KEY_AUTHORITY_EDITION).replaceContentPane(pane); } - + public JComponent getAuthorityEditionPane() { return propertyItemMap.get(KEY_AUTHORITY_EDITION).getContentPane(); } - + public void replaceConfiguredRolesPane(JComponent pane) { propertyItemMap.get(KEY_CONFIGURED_ROLES).replaceContentPane(pane); } - - public void replaceKeyPane(String key, JComponent pane) { - - propertyItemMap.get(key).replaceContentPane(pane); + + public void replaceKeyPane(final String key, final JComponent pane) { + + //需要放到 ui 线程中处理 + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + propertyItemMap.get(key).replaceContentPane(pane); + } + }); } - + public JComponent getConfiguredRolesPane() { return propertyItemMap.get(KEY_CONFIGURED_ROLES).getContentPane(); } - + public void addParameterPane(JComponent paraPane) { propertyItemMap.get(KEY_WIDGET_SETTINGS).replaceHeaderPane(paraPane); } From 9c03a0c208a207cdbc14cb9d70a7c592e84431a4 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 15:42:27 +0800 Subject: [PATCH 366/375] =?UTF-8?q?=E5=90=88=E4=BB=A3=E7=A0=81=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/DesignerEnvManager.java | 43 +------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 88d2625d0..661b4fa5c 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -8,14 +8,12 @@ import com.fr.base.Utils; import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; -import com.fr.design.dialog.ErrorDialog; import com.fr.design.env.DesignerWorkspaceGenerator; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceType; import com.fr.design.env.LocalDesignerWorkspaceInfo; import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.i18n.Toolkit; import com.fr.design.locale.impl.ProductImproveMark; import com.fr.design.mainframe.vcs.VcsConfigManager; import com.fr.design.notification.SnapChatConfig; @@ -23,7 +21,6 @@ import com.fr.design.update.push.DesignerPushUpdateConfigManager; import com.fr.design.style.color.ColorSelectConfigManager; import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignerPort; -import com.fr.exit.DesignerExiter; import com.fr.file.FILEFactory; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogFormatter; @@ -58,7 +55,6 @@ import javax.swing.SwingWorker.StateValue; import java.awt.Color; import java.awt.Rectangle; import java.io.File; -import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; @@ -87,10 +83,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private static final String VERSION_80 = "80"; private static final int CACHINGTEMPLATE_LIMIT = 5; private static final String WEB_NAME = "webapps"; - /** - * 指定默认工作空间 - */ - public static final String DEFAULT_WORKSPACE_PATH = "fr.designer.workspace.default"; private static DesignerEnvManager designerEnvManager; // gui. private String activationKey = null; @@ -207,9 +199,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { GeneralContext.setLocale(designerEnvManager.getLanguage()); try { XMLTools.readFileXML(designerEnvManager, designerEnvManager.getDesignerEnvFile()); - } catch (FileNotFoundException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - XmlHandler.Self.handle(e); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } @@ -358,7 +347,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } catch (IOException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); - XmlHandler.Self.handle(e); } finally { if (null != fileWriter) { try { @@ -573,10 +561,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private String getDefaultenvPath(String installHome) { - String defaultWorkspacePath = System.getProperty(DEFAULT_WORKSPACE_PATH); - if (defaultWorkspacePath != null) { - return defaultWorkspacePath; - } //这里需要转成反斜杠和生成默认路径一致 return new File(StableUtils.pathJoin(installHome, WEB_NAME, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME)).getPath(); } @@ -1419,7 +1403,6 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { /** * 对国际化进行校验 * 非简繁英日韩的默认环境 设计器全部默认为英文版本 - * * @param locale * @return */ @@ -1571,7 +1554,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { readVcsAttr(reader); } else if (DesignerPort.XML_TAG.equals(name)) { readDesignerPort(reader); - }else if (name.equals(SnapChatConfig.XML_TAG)) { + } else if (name.equals(SnapChatConfig.XML_TAG)) { readSnapChatConfig(reader); } else { readLayout(reader, name); @@ -2067,28 +2050,4 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { public void setVcsConfigManager(VcsConfigManager vcsConfigManager) { this.vcsConfigManager = vcsConfigManager; } - - enum XmlHandler { - Self; - public void handle(Throwable throwable) { - ErrorDialog dialog = new ErrorDialog(null, - Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), - Toolkit.i18nText("Fine-Design_Error_Start_Report"), - throwable.getMessage()) { - @Override - protected void okEvent() { - dispose(); - DesignerExiter.getInstance().execute(); - } - - @Override - protected void restartEvent() { - dispose(); - RestartHelper.restart(); - } - }; - dialog.setVisible(true); - DesignerExiter.getInstance().execute(); - } - }; } From 711cbd62f1784f54bfad3000b49d6ee5f3aac527 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 15:44:32 +0800 Subject: [PATCH 367/375] =?UTF-8?q?=E5=90=88=E4=BB=A3=E7=A0=81=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/ifilechooser/UINativeFileChooser.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/UINativeFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/UINativeFileChooser.java index 597f733f1..c1418f834 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/UINativeFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/UINativeFileChooser.java @@ -1,5 +1,6 @@ package com.fr.design.gui.ifilechooser; +import com.fr.design.gui.ifilechooser.AbstractFileChooser; import com.fr.design.mainframe.DesignerContext; import com.fr.stable.os.OperatingSystem; From 7483d9d7c63524581fe40d960c62a5da6d74ff39 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 15:47:48 +0800 Subject: [PATCH 368/375] =?UTF-8?q?=E5=90=88=E4=BB=A3=E7=A0=81=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EastRegionContainerPane.java | 101 ++++++++---------- 1 file changed, 42 insertions(+), 59 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 394dfca1e..cf8f4f74d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -11,7 +11,6 @@ import com.fr.design.gui.ibutton.UIButtonUI; import com.fr.design.gui.icontainer.UIEastResizableContainer; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.VerticalFlowLayout; -import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.general.FRFont; @@ -131,13 +130,13 @@ public class EastRegionContainerPane extends UIEastResizableContainer { defaultAuthorityPane = getDefaultPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Not_Support_Authority_Edit")); switchMode(PropertyMode.REPORT); setContainerWidth(CONTAINER_WIDTH); - + initPluginPane(); listenPlugin(); } - + private void listenPlugin() { - + PluginFilter filter = new PluginFilter() { @Override public boolean accept(PluginContext context) { @@ -151,18 +150,12 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void on(PluginEvent event) { PluginContext context = event.getContext(); PluginRuntime runtime = context.getRuntime(); - final Set providers = runtime.get(PropertyItemPaneProvider.XML_TAG); - // UI相关的逻辑 用UI线程执行 不走FinePluginController线程 走FinePluginController线程有几率出问题 - // 容易导致FinePluginController持有Swing内部的java.awt.Component$AWTTreeLock 这个锁不能被UI线程之外的线程持有 否则容易造成UI线程被Blocked住 - UIUtil.invokeLaterIfNeeded(new Runnable() { - @Override - public void run() { - for (PropertyItemPaneProvider provider : providers) { - addPropertyItem(provider); - } - updateAllPropertyPane(); - } - }); } + Set providers = runtime.get(PropertyItemPaneProvider.XML_TAG); + for (PropertyItemPaneProvider provider : providers) { + addPropertyItem(provider); + } + updateAllPropertyPane(); + } }, filter); PluginListenerRegistration.getInstance().listen( PluginEventType.BeforeStop, @@ -171,22 +164,18 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void on(PluginEvent event) { PluginContext context = event.getContext(); PluginRuntime runtime = context.getRuntime(); - final Set providers = runtime.get(PropertyItemPaneProvider.XML_TAG); - UIUtil.invokeLaterIfNeeded(new Runnable() { - @Override - public void run() { - for (PropertyItemPaneProvider provider : providers) { - removePropertyItem(provider); - } - updateAllPropertyPane(); - } - }); + Set providers = runtime.get(PropertyItemPaneProvider.XML_TAG); + for (PropertyItemPaneProvider provider : providers) { + removePropertyItem(provider); + + } + updateAllPropertyPane(); } }, filter); } - + private void removePropertyItem(PropertyItemPaneProvider provider) { - + propertyItemMap.remove(provider.key()); String replaceKey = provider.replaceKey(); if (replaceKey == null) { @@ -197,18 +186,18 @@ public class EastRegionContainerPane extends UIEastResizableContainer { replaceItem.setReplace(false); } } - + private void initPluginPane() { - + ExtraDesignClassManager classManager = PluginModule.getAgent(PluginModule.ExtraDesign); Set providers = classManager.getArray(PropertyItemPaneProvider.XML_TAG); for (PropertyItemPaneProvider provider : providers) { addPropertyItem(provider); } } - + private void addPropertyItem(PropertyItemPaneProvider provider) { - + String key = provider.key(); PropertyItemBean itemBean = provider.getItem(); PropertyItem propertyItem = new PropertyItem(itemBean.getName(), @@ -223,7 +212,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { button.addActionListener(buttonListener); } propertyItemMap.put(key, propertyItem); - + String replaceKey = provider.replaceKey(); if (replaceKey == null) { return; @@ -232,11 +221,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer { if (replaceItem != null) { replaceItem.setReplace(true); } - + } - + private void initPropertyItemList() { - + propertyItemMap = new LinkedHashMap<>(); // 有序map // 单元格元素 PropertyItem cellElement = new PropertyItem(KEY_CELL_ELEMENT, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell_Element"), @@ -251,7 +240,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { "floatelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.POLY_REPORT}); // 控件设置 - PropertyItem widgetSettings = new PropertyItem(KEY_WIDGET_SETTINGS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Settings"), + PropertyItem widgetSettings = new PropertyItem(KEY_WIDGET_SETTINGS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Settings"), "widgetsettings", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.FORM, PropertyMode.POLY}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.FORM, PropertyMode.POLY_REPORT, PropertyMode.POLY_CHART}); // 条件属性 @@ -485,30 +474,24 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void replaceAuthorityEditionPane(JComponent pane) { propertyItemMap.get(KEY_AUTHORITY_EDITION).replaceContentPane(pane); } - + public JComponent getAuthorityEditionPane() { return propertyItemMap.get(KEY_AUTHORITY_EDITION).getContentPane(); } - + public void replaceConfiguredRolesPane(JComponent pane) { propertyItemMap.get(KEY_CONFIGURED_ROLES).replaceContentPane(pane); } - public void replaceKeyPane(final String key, final JComponent pane) { + public void replaceKeyPane(String key, JComponent pane) { - //需要放到 ui 线程中处理 - UIUtil.invokeLaterIfNeeded(new Runnable() { - @Override - public void run() { - propertyItemMap.get(key).replaceContentPane(pane); - } - }); + propertyItemMap.get(key).replaceContentPane(pane); } - + public JComponent getConfiguredRolesPane() { return propertyItemMap.get(KEY_CONFIGURED_ROLES).getContentPane(); } - + public void addParameterPane(JComponent paraPane) { propertyItemMap.get(KEY_WIDGET_SETTINGS).replaceHeaderPane(paraPane); } @@ -670,8 +653,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private String iconSuffix = ICON_SUFFIX_NORMAL; // normal, diabled, selected, 三者之一 private final Color selectedBtnBackground = new Color(0xF5F5F7); private Color originBtnBackground; - - + + public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes) { this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes); } @@ -722,12 +705,12 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void setVisible(boolean isVisible) { this.isVisible = isVisible; } - + public void setReplace(boolean replace) { - + this.replace = replace; } - + public boolean isEnabled() { return isEnabled; } @@ -737,16 +720,16 @@ public class EastRegionContainerPane extends UIEastResizableContainer { this.isEnabled = isEnabled; button.setEnabled(isEnabled); } - + public void setIconBaseDir(String iconBaseDir) { this.iconBaseDir = iconBaseDir; } - + private String getIconBaseDir() { - + return StringUtils.isEmpty(iconBaseDir) ? ICON_BASE_DIR : iconBaseDir; } - + private void initPropertyPanel() { propertyPanel = new JPanel(); propertyPanel.setBackground(Color.pink); @@ -827,7 +810,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } private String getBtnIconUrl() { - + return getIconBaseDir() + btnIconName + iconSuffix; } From 80c234165064566e59facff7550b463e50766e79 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 15:48:49 +0800 Subject: [PATCH 369/375] =?UTF-8?q?=E5=90=88=E4=BB=A3=E7=A0=81=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/menu/SnapChatMenuDef.java | 58 +------------------ 1 file changed, 1 insertion(+), 57 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java b/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java index 2ec3f6c7e..f3c5735f0 100644 --- a/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java +++ b/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java @@ -9,11 +9,6 @@ import com.fr.design.notification.SnapChatKey; import javax.swing.JMenu; import javax.swing.event.MenuEvent; import javax.swing.event.MenuListener; -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.Image; -import java.awt.geom.Ellipse2D; -import java.awt.image.BufferedImage; /** * created by Harrison on 2020/03/16 @@ -42,9 +37,7 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat { public boolean hasRead() { String calcKey = calcKey(); - Boolean val = SnapChatConfig.getInstance().hasRead(calcKey); - // 默认读过了。 - return val == null ? defaultStatus() : val; + return SnapChatConfig.getInstance().hasRead(calcKey); } @Override @@ -54,27 +47,6 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat { SnapChatConfig.getInstance().markRead(calcKey); } - @Override - public boolean defaultStatus() { - - return true; - } - - @Override - public void addShortCut(ShortCut shortCut) { - - addSnapChatNotification(shortCut); - super.addShortCut(shortCut); - } - - @Override - public void insertShortCut(int index, ShortCut shortCut) { - - addSnapChatNotification(shortCut); - super.insertShortCut(index, shortCut); - } - - @Override public SnapChatKey key() { @@ -87,22 +59,6 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat { return new SnapChatMenuListener(); } - /** - * 添加提醒 - * - * @param shortCut 快捷方式 - */ - private void addSnapChatNotification(ShortCut shortCut) { - - if (shortCut instanceof SnapChatUpdateAction) { - SnapChatUpdateAction action = (SnapChatUpdateAction) shortCut; - if (!action.hasRead()) { - String calcKey = calcKey(); - SnapChatConfig.getInstance().resetRead(calcKey); - } - } - } - private String calcKey() { return key().calc(); @@ -185,16 +141,4 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat { setUI(menuUI); } } - - public static void main(String[] args) { - - BufferedImage image = new BufferedImage(16, 16, Image.SCALE_DEFAULT); - Graphics2D g2d = image.createGraphics(); - g2d.setColor(Color.green); - Ellipse2D.Double shape = - new Ellipse2D.Double(2, 2, 1, 1); - g2d.fill(shape); - g2d.draw(shape); - System.out.println(); - } } From 05dc598bf9ae422870a7c51a65689d0e5b50a1ad Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 15:49:52 +0800 Subject: [PATCH 370/375] =?UTF-8?q?=E5=90=88=E4=BB=A3=E7=A0=81=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/menu/SnapChatUpdateAction.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java b/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java index 9ade76250..482954546 100644 --- a/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java +++ b/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java @@ -32,8 +32,7 @@ public abstract class SnapChatUpdateAction extends UpdateAction implements SnapC public boolean hasRead() { String calcKey = calcKey(); - Boolean val = SnapChatConfig.getInstance().hasRead(calcKey); - return val == null ? defaultStatus() : val; + return SnapChatConfig.getInstance().hasRead(calcKey); } @Override @@ -43,12 +42,6 @@ public abstract class SnapChatUpdateAction extends UpdateAction implements SnapC SnapChatConfig.getInstance().markRead(calcKey); } - @Override - public boolean defaultStatus() { - - return false; - } - @Override public SnapChatKey key() { From 7df731ed52b7c6031ff19d2cc25849ec834e47c7 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 15:50:55 +0800 Subject: [PATCH 371/375] =?UTF-8?q?=E5=90=88=E4=BB=A3=E7=A0=81=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/notification/SnapChat.java | 7 ------- .../java/com/fr/design/notification/SnapChatConfig.java | 8 ++------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/notification/SnapChat.java b/designer-base/src/main/java/com/fr/design/notification/SnapChat.java index 4f610c060..8dd6f8aa2 100644 --- a/designer-base/src/main/java/com/fr/design/notification/SnapChat.java +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChat.java @@ -7,13 +7,6 @@ package com.fr.design.notification; **/ public interface SnapChat { - /** - * 默认状态 - * - * @return 默认状态 - */ - boolean defaultStatus(); - /** * 已读 * diff --git a/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java b/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java index c192d054c..ed6b7a6d8 100644 --- a/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChatConfig.java @@ -31,7 +31,8 @@ public class SnapChatConfig implements XMLable { public Boolean hasRead(String key) { Map map = markReadMap; - return map.get(key); + Boolean val = map.get(key); + return val == null ? Boolean.FALSE : val; } public void markRead(String key) { @@ -39,11 +40,6 @@ public class SnapChatConfig implements XMLable { markReadMap.put(key, Boolean.TRUE); } - public void resetRead(String key) { - - markReadMap.put(key, Boolean.FALSE); - } - @Override public void readXML(XMLableReader reader) { From 231b41f01a73694777e340109cd40cd495b164aa Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 15:52:34 +0800 Subject: [PATCH 372/375] =?UTF-8?q?=E5=90=88=E4=BB=A3=E7=A0=81=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XCreatorUtils.java | 38 ++++--------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index d14780054..433f7c4f7 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -66,8 +66,7 @@ import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.StringUtils; -import com.fr.third.javax.annotation.Nonnull; -import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.NotNull; import javax.swing.Icon; import java.awt.Container; @@ -165,44 +164,21 @@ public class XCreatorUtils { } private static void reInitExtra() { - + extraObjectMap.clear(); extraObjectMap.putAll(ExtraDesignClassManager.getInstance().getParameterWidgetOptionsMap()); extraObjectMap.putAll(ExtraDesignClassManager.getInstance().getFormWidgetOptionsMap()); } - + private static void putExtraEditor() { if (DesignModuleFactory.getChartEditorClass() != null) { objectMap.put(DesignModuleFactory.getChartEditorClass(), XChartEditor.class); } } - - /** - * 对于继承的子组件来说,可能并没有对应的 XCreator - * 这个时候,就需要递归的找父类 - * - * @param clazz 组件类 - * @return 创建类 - */ - @SuppressWarnings("unchecked") - @Nullable - private static Class similarXCreatorClass(Class clazz) { - - Class target = clazz; - Class xClazz = null; - //判断条件有两个 - //1.还没找到对应的 xClazz - //2.一直到 终极父类-Widget 都找不到 - while (xClazz == null && Widget.class.isAssignableFrom(target)) { - xClazz = searchXCreatorClass((Class) target); - target = target.getSuperclass(); - } - return xClazz; - } - + @SuppressWarnings("unchecked") private static Class searchXCreatorClass(Class clazz) { - + Class xClazz = (Class) objectMap.get(clazz); if (xClazz == null) { xClazz = (Class) extraObjectMap.get(clazz); @@ -238,7 +214,7 @@ public class XCreatorUtils { clazz = NullCreator.class; } else { widgetClass = widget.getClass(); - clazz = XCreatorUtils.similarXCreatorClass(widgetClass); + clazz = XCreatorUtils.searchXCreatorClass(widgetClass); if (clazz == null) { FineLoggerFactory.getLogger().error(widget + "'s" + " xcreator doesn't exsit!"); clazz = NullCreator.class; @@ -310,7 +286,7 @@ public class XCreatorUtils { * @param creator 组件 * @return 返回顶层容器 */ - public static XLayoutContainer getHotspotContainer(@Nonnull XCreator creator) { + public static XLayoutContainer getHotspotContainer(@NotNull XCreator creator) { if (creator.isDedicateContainer()) { return (XLayoutContainer) creator.getParent(); } From 031b17b3dbbcdef6e8ae926f88587b71df2f5135 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 15:53:43 +0800 Subject: [PATCH 373/375] =?UTF-8?q?=E5=90=88=E4=BB=A3=E7=A0=81=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/FormCreatorDropTarget.java | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java index 06cb19d0a..0a6e692f4 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; -import com.fr.base.chart.BaseChartCollection; import com.fr.chart.chartattr.ChartCollection; import com.fr.chartx.attr.ChartProvider; import com.fr.design.DesignModelAdapter; @@ -28,12 +27,9 @@ import com.fr.form.share.ShareLoader; import com.fr.form.ui.ChartEditor; import com.fr.form.ui.Widget; import com.fr.stable.Constants; -import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.JWindow; -import java.util.List; -import java.util.Map; import java.awt.Color; import java.awt.Component; import java.awt.Point; @@ -97,7 +93,7 @@ public class FormCreatorDropTarget extends DropTarget { //SetSelection时要确保选中的是最顶层的布局 //tab布局添加的时候是初始化了XWCardLayout,实际上最顶层的布局是XWCardMainBorderLayout XCreator addingXCreator = addingModel.getXCreator(); - Widget widget = (addingXCreator.getBackupParent() != null && addingXCreator.getTopLayout() != null) ? (addingXCreator.getTopLayout().toData()) : addingXCreator.toData(); + Widget widget = (addingXCreator.getTopLayout() != null) ? (addingXCreator.getTopLayout().toData()) : addingXCreator.toData(); //图表埋点 dealChartBuryingPoint(widget); if (addingXCreator.isShared()) { @@ -288,16 +284,9 @@ public class FormCreatorDropTarget extends DropTarget { } private void dealChartBuryingPoint(Widget widget) { - List chartCollections = widget.getChartCollections(); - for (BaseChartCollection baseChartCollection : chartCollections) { - ChartCollection chartCollection = (ChartCollection) baseChartCollection; - for (int i = 0, size = chartCollection.getChartCount(); i < size; i++) { - ChartProvider chart = chartCollection.getChart(i, ChartProvider.class); - //是否是共享的复用组件 - boolean isReuse = StringUtils.isNotEmpty(this.addingModel.getXCreator().getShareId()); - ChartInfoCollector.getInstance().collection(chart, null, isReuse); - ChartInfoCollector.getInstance().checkTestChart(chart); - } + if (widget instanceof ChartEditor) { + ChartCollection chartCollection = (ChartCollection)((ChartEditor) widget).getChartCollection(); + ChartInfoCollector.getInstance().collection(chartCollection.getSelectedChartProvider(ChartProvider.class), null); } } } From 2e1f43c2a08bd8be235a741553d01253d7ade965 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 15:55:45 +0800 Subject: [PATCH 374/375] =?UTF-8?q?=E5=90=88=E4=BB=A3=E7=A0=81=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/FormWidgetDetailPane.java | 52 +++++-------------- 1 file changed, 14 insertions(+), 38 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index 311ea4cb7..3273e89dc 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -8,7 +8,6 @@ import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ifilechooser.UINativeFileChooser; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.widget.FRWidgetFactory; import com.fr.form.share.SharableWidgetProvider; import com.fr.form.share.ShareLoader; @@ -18,20 +17,9 @@ import com.fr.share.ShareConstants; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; -import javax.swing.BorderFactory; -import javax.swing.DefaultComboBoxModel; -import javax.swing.Icon; -import javax.swing.JFileChooser; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.SwingWorker; +import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Desktop; -import java.awt.Dimension; -import java.awt.FlowLayout; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; @@ -335,30 +323,18 @@ public class FormWidgetDetailPane extends FormDockView{ new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - if (SupportOSImpl.NATIVE_CHOOSER.support()) { - UINativeFileChooser nativeFileChooser = new UINativeFileChooser(); - nativeFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); - nativeFileChooser.setMultiSelectionEnabled(true); - nativeFileChooser.setExtensionFilter("*.reu"); - nativeFileChooser.setDialogTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); - int returnValue = nativeFileChooser.showOpenDialog(new UILabel()); - if (returnValue == JFileChooser.APPROVE_OPTION) { - final File[] chosenFiles = nativeFileChooser.getSelectedFiles(); - for (File file : chosenFiles) { - installFromDiskZipFile(file); - } - } - } else { - JFileChooser fileChooser = new JFileChooser(); - fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); - fileChooser.setMultiSelectionEnabled(true); - fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu")); - int returnValue = fileChooser.showDialog(new UILabel(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); - if (returnValue == JFileChooser.APPROVE_OPTION) { - final File[] chosenFiles = fileChooser.getSelectedFiles(); - for (File file : chosenFiles) { - installFromDiskZipFile(file); - } + UINativeFileChooser fileChooser = new UINativeFileChooser(); + fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); + fileChooser.setMultiSelectionEnabled(true); + FileNameExtensionFilter extensionFilter = new FileNameExtensionFilter(".reu", "reu"); + fileChooser.setFileFilter(extensionFilter); + fileChooser.setExtensionFilter("*.reu"); + fileChooser.setDialogTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); + int returnValue = fileChooser.showOpenDialog(new UILabel()); + if (returnValue == JFileChooser.APPROVE_OPTION) { + final File[] chosenFiles = fileChooser.getSelectedFiles(); + for (File file : chosenFiles) { + installFromDiskZipFile(file); } } } From c4d9d5213862f1acef4b738380025af8d42cc81c Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 15:58:04 +0800 Subject: [PATCH 375/375] =?UTF-8?q?=E5=90=88=E4=BB=A3=E7=A0=81=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/JForm.java | 74 +++++++------------ 1 file changed, 25 insertions(+), 49 deletions(-) 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 e2112f4f3..e464d7e05 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 @@ -5,7 +5,6 @@ import com.fr.base.PaperSize; import com.fr.base.Parameter; import com.fr.base.extension.FileExtension; import com.fr.base.vcs.DesignerMode; -import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.FormMobileAttrAction; @@ -14,7 +13,6 @@ import com.fr.design.actions.core.WorkBookSupportable; import com.fr.design.actions.file.export.EmbeddedFormExportExportAction; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.cell.FloatElementsProvider; -import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.designer.TargetComponent; import com.fr.design.designer.beans.actions.CopyAction; import com.fr.design.designer.beans.actions.CutAction; @@ -31,7 +29,6 @@ import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; -import com.fr.design.fun.FormAdaptiveConfigUIProcessor; import com.fr.design.fun.PreviewProvider; import com.fr.design.fun.PropertyItemPaneProvider; import com.fr.design.gui.frpane.HyperlinkGroupPane; @@ -128,63 +125,60 @@ public class JForm extends JTemplate implements BaseJForm providers = runtime.get(PropertyItemPaneProvider.XML_TAG); - for (PropertyItemPaneProvider provider : providers) { - addPane(provider); - } - } - }; - PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, this.pluginListener, filter); + PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, + new PluginEventListener(PropertyItemPaneProvider.LAST) { + @Override + public void on(PluginEvent event) { + PluginContext context = event.getContext(); + PluginRuntime runtime = context.getRuntime(); + Set providers = runtime.get(PropertyItemPaneProvider.XML_TAG); + for (PropertyItemPaneProvider provider : providers) { + addPane(provider); + } + } + }, filter); } - + private void initPluginPane() { - + ExtraDesignClassManager classManager = PluginModule.getAgent(PluginModule.ExtraDesign); Set providers = classManager.getArray(PropertyItemPaneProvider.XML_TAG); for (PropertyItemPaneProvider provider : providers) { addPane(provider); } } - + private void addPane(PropertyItemPaneProvider provider) { - + PaneHolder holder = provider.getPaneHolder(FormDesigner.class); if (holder != null) { JPanel panel = holder.getInstance(formDesign); EastRegionContainerPane.getInstance().replaceKeyPane(provider.key(), panel); } } - + @Override public void refreshEastPropertiesPane() { // 暂时用不到,遇到的时候再加刷新右侧tab面板的代码 @@ -209,14 +203,12 @@ public class JForm extends JTemplate implements BaseJForm getProcessInfo() { - //这边需要判空,图表的埋点信息收集时可能没有初始化processInfo if (processInfo == null) { processInfo = new JFormProcessInfo(template); } return processInfo; } - public FormECCompositeProvider getReportComposite() { return this.reportComposite; } @@ -567,19 +559,10 @@ public class JForm extends JTemplate implements BaseJForm implements BaseJForm implements BaseJForm implements BaseJForm implements BaseJForm implements BaseJForm