From 11d99d7f223165dd90bda3025598077e67d38f8b Mon Sep 17 00:00:00 2001 From: Harrison Date: Wed, 25 Mar 2020 14:43:34 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-27647=20=E6=A8=A1=E6=9D=BF=E7=BB=84?= =?UTF-8?q?=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=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=20=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E7=9B=91?= =?UTF-8?q?=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 74c14a604..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 @@ -148,7 +148,7 @@ public class JForm extends JTemplate implements BaseJForm Date: Wed, 25 Mar 2020 14:55:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-27647=20=E6=A8=A1=E6=9D=BF=E7=BB=84?= =?UTF-8?q?=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=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=20=E5=A4=84=E7=90=86=E4=B8=8B=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=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 2379bd527e5778ac60b58ceefdc0f07aebf6e236 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 26 Mar 2020 12:58:10 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A0jira=20=E5=90=8C=E6=AD=A5=E5=88=B0?= =?UTF-8?q?feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/start/DesignerLauncher.java | 16 +++++++++++++++- .../src/main/java/com/fr/start/FineDesigner.java | 14 ++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 designer-realize/src/main/java/com/fr/start/FineDesigner.java 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..48cf9e4d0 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,9 @@ 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; + +import java.io.File; /** * @author hades @@ -11,6 +14,10 @@ import com.fr.process.engine.core.FineProcessContext; */ public class DesignerLauncher { + 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(); private String[] args; @@ -19,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; } @@ -26,12 +38,14 @@ 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(). 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 { + +}