From 49a9e321720fa2ced48c097a6084b97c60d7fe19 Mon Sep 17 00:00:00 2001 From: richie Date: Thu, 7 Nov 2019 11:39:32 +0800 Subject: [PATCH 001/135] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E7=9F=AD=E4=BF=A1=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/designer/creator/XCreatorUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 f51f6710bc..433f7c4f70 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,7 +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.NotNull; import javax.swing.Icon; import java.awt.Container; @@ -286,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 c93febc5847b2a84189d2f179f2814dc5addb602 Mon Sep 17 00:00:00 2001 From: Maksim Date: Thu, 27 Feb 2020 16:16:13 +0800 Subject: [PATCH 002/135] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E5=90=8E=EF=BC=8C=E5=AF=B9=E5=88=9D=E5=A7=8B=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=81=9A=E4=B8=80=E6=AC=A1=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 78 ++++++++++++------- .../module/DesignerWorkspaceProvider.java | 16 ++++ 2 files changed, 64 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 a60791c6b6..e998ad9047 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); - } - } + serviceDialog(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 serviceDialog(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); 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 7d63571ad6..c8622d6797 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().serviceDialog(selectEnv); + } catch (Exception e) { + FineLoggerFactory.getLogger().warn("Check Service Failed"); + } + } + }); } } catch (Throwable e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); From f7a37afe40caba55bf2f005fc05fa3328461e9fb Mon Sep 17 00:00:00 2001 From: Maksim Date: Thu, 27 Feb 2020 17:59:04 +0800 Subject: [PATCH 003/135] =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=90=8D=E4=BF=AE?= =?UTF-8?q?=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 | 4 ++-- .../java/com/fr/start/module/DesignerWorkspaceProvider.java | 2 +- 2 files changed, 3 insertions(+), 3 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 e998ad9047..48c5576bcc 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -132,7 +132,7 @@ public class EnvChangeEntrance { if (template != null) { template.refreshToolArea(); } - serviceDialog(selectedEnv); + 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"); @@ -213,7 +213,7 @@ public class EnvChangeEntrance { * 对选择的环境做服务检测 * @param selectedEnv 选择的工作环境 */ - public void serviceDialog(DesignerWorkspaceInfo selectedEnv) throws Exception { + public void showServiceDialog(DesignerWorkspaceInfo selectedEnv) throws Exception { //是否需要做服务校验 if(needCheckBranch(selectedEnv)) { String localBranch; 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 c8622d6797..e0fc4dfe97 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 @@ -64,7 +64,7 @@ public class DesignerWorkspaceProvider extends Activator { @Override public void on(Event event, Null aNull) { try { - EnvChangeEntrance.getInstance().serviceDialog(selectEnv); + EnvChangeEntrance.getInstance().showServiceDialog(selectEnv); } catch (Exception e) { FineLoggerFactory.getLogger().warn("Check Service Failed"); } From b1a3ee6f1f725c6dfd9329e48fbf32a2d2aed801 Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 23 Mar 2020 10:59:47 +0800 Subject: [PATCH 004/135] =?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 | 25 +- .../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, 1230 insertions(+), 447 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 cb8634c002..661b4fa5c8 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -16,6 +16,7 @@ import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.file.HistoryTemplateListPane; 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; @@ -154,6 +155,11 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { * alphafine */ private AlphaFineConfigManager alphaFineConfigManager = AlphaFineConfigManager.getInstance(); + + /** + * 阅后即焚的配置项 + */ + private SnapChatConfig snapChatConfig = SnapChatConfig.getInstance(); private DesignerPushUpdateConfigManager designerPushUpdateConfigManager = DesignerPushUpdateConfigManager.getInstance(); @@ -1548,12 +1554,17 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { readVcsAttr(reader); } else if (DesignerPort.XML_TAG.equals(name)) { readDesignerPort(reader); - } - else { + } 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()); @@ -1770,9 +1781,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 0000000000..88385a11b1 --- /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 0000000000..f376ad7887 --- /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 37f1fe0528..3230dbda21 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 0000000000..0d883abfbf --- /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 cdafa8c410..bc4b85ced8 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 c18749c12c..f495e03f13 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 0000000000..473c17f251 --- /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 0000000000..c9ab8532d2 --- /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 0000000000..47bc3c6634 --- /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 0000000000..fe1088ea82 --- /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 0000000000..6eb648055a --- /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 0000000000..8dd6f8aa28 --- /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 0000000000..6aeb384df5 --- /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 0000000000..c9cc177640 --- /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 0000000000..fa316db350 --- /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 c32abb2ffc..7d00e367c1 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 0000000000..7cd5e6e825 --- /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 0000000000..97425fdb4f --- /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 0000000000..18148ce0d6 --- /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 1807f814ef3249652778872aa8ee02905d3b92de Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 23 Mar 2020 11:06:14 +0800 Subject: [PATCH 005/135] =?UTF-8?q?=E5=8E=BB=E6=8E=89=20main=20=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/menu/SnapChatMenuDef.java | 17 ----------------- 1 file changed, 17 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 473c17f251..f3c5735f01 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 @@ -146,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 f279194bba6b963ca30facc4e4c479efca434d83 Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 23 Mar 2020 14:12:58 +0800 Subject: [PATCH 006/135] =?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 88385a11b1..7b484b156d 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 c9cc177640..04170e3be8 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 97425fdb4f..8cb5d15334 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 5b0c5dc2998ac3ad2e69bb6a3ee9a0146cab7658 Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 24 Mar 2020 14:23:15 +0800 Subject: [PATCH 007/135] =?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 0000000000..2dbead9ed6 --- /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 0000000000..44e4abd4d1 --- /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 07191d536d..790c0eb39f 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 0000000000..aef5e0b137 --- /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 0000000000..f6a250defc --- /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 fe1088ea82..4829545468 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 7d00e367c1..f49f2859b2 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 ab19002c18..74c14a6046 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 @@ -6,6 +6,7 @@ import com.fr.base.Parameter; import com.fr.base.extension.FileExtension; import com.fr.base.vcs.DesignerMode; 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; @@ -29,6 +30,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; @@ -65,6 +67,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; @@ -91,6 +101,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"; @@ -116,12 +127,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面板的代码 @@ -765,7 +822,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 8cb5d15334..0000000000 --- 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 18148ce0d6..0000000000 --- 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 f89a5d3171f9de2a09101f06650e7155b4363a9b Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 24 Mar 2020 14:38:48 +0800 Subject: [PATCH 008/135] =?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 2dbead9ed6..2c5c3f2d48 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 f376ad7887..0000000000 --- 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 790c0eb39f..0c23e8658f 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 2a0bbc69bc773513d92b25dbb03b50fc1b4db77d Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 24 Mar 2020 14:46:47 +0800 Subject: [PATCH 009/135] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99?= =?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/ComponentLibraryPaneProcessor.java | 57 ------------------- 1 file changed, 57 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/fun/ComponentLibraryPaneProcessor.java 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 deleted file mode 100644 index 7b484b156d..0000000000 --- a/designer-base/src/main/java/com/fr/design/fun/ComponentLibraryPaneProcessor.java +++ /dev/null @@ -1,57 +0,0 @@ -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 = "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(); - -} From 713b72cded5d886b417e5d696f1fe3c3c24aeb6f Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 24 Mar 2020 18:08:10 +0800 Subject: [PATCH 010/135] =?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 --- .../fr/design/mainframe/FormCreatorDropTarget.java | 6 +++--- .../fr/design/mainframe/FormWidgetDetailPane.java | 4 ++-- .../com/fr/design/mainframe/ShareWidgetButton.java | 12 ++++++------ .../com/fr/design/mainframe/ShareWidgetPane.java | 7 ++++--- 4 files changed, 15 insertions(+), 14 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 756a89f564..0a6e692f49 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 @@ -22,15 +22,14 @@ 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.ChartEditor; -import com.fr.form.ui.SharableWidgetBindInfo; import com.fr.form.ui.Widget; import com.fr.stable.Constants; import javax.swing.BorderFactory; import javax.swing.JWindow; -import java.util.Map; import java.awt.Color; import java.awt.Component; import java.awt.Point; @@ -40,6 +39,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; /** * 添加模式下鼠标事件处理器。 @@ -99,7 +99,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 f49f2859b2..ecb3faa706 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/ShareWidgetButton.java b/designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetButton.java index a79ac17a5c..7e7d76d896 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; } 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 32ce586c72..549a4b174e 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 11d99d7f223165dd90bda3025598077e67d38f8b Mon Sep 17 00:00:00 2001 From: Harrison Date: Wed, 25 Mar 2020 14:43:34 +0800 Subject: [PATCH 011/135] =?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 2c5c3f2d48..4e5112d8cc 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 0c23e8658f..d73f36a7a8 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 f6a250defc..ee54364ba5 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 04170e3be8..ed6b7a6d8f 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 74c14a6046..e464d7e052 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 012/135] =?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 d73f36a7a8..9276bd5c62 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 013/135] =?UTF-8?q?=E6=97=A0jira=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=88=B0feature?= 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 38f28346aa..48cf9e4d06 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 0000000000..a3e202308b --- /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 455caa72fcdf5f86332d325bd64f1bdcc81c81a6 Mon Sep 17 00:00:00 2001 From: richie Date: Thu, 26 Mar 2020 14:49:12 +0800 Subject: [PATCH 014/135] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E6=96=B0=E7=9A=84JxBrowser+language=20level?= =?UTF-8?q?=E6=8F=90=E5=8D=87=E5=88=B01.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/bridge/exec/JSExecutor.java | 3 + .../fr/design/dcm/UniversalDatabasePane.java | 18 +- .../com/fr/design/dcm/UniversalDcmBridge.java | 12 +- .../main/java/com/fr/design/ui/Assistant.java | 68 ------ .../com/fr/design/ui/EmbProtocolHandler.java | 130 ---------- .../java/com/fr/design/ui/ModernUIPane.java | 147 ++++++----- .../ui/NxComplexInterceptRequestCallback.java | 85 +++++++ .../design/ui/NxInterceptRequestCallback.java | 134 ++++++++++ .../java/com/fr/design/upm/UpmBridge.java | 230 +++++++++++------- .../java/com/fr/design/upm/UpmFinder.java | 2 +- .../java/com/fr/design/upm/UpmShowPane.java | 15 +- .../design/upm/exec/UpmBrowserExecutor.java | 15 +- pom.xml | 4 +- 13 files changed, 471 insertions(+), 392 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/ui/Assistant.java delete mode 100644 designer-base/src/main/java/com/fr/design/ui/EmbProtocolHandler.java create mode 100644 designer-base/src/main/java/com/fr/design/ui/NxComplexInterceptRequestCallback.java create mode 100644 designer-base/src/main/java/com/fr/design/ui/NxInterceptRequestCallback.java diff --git a/designer-base/src/main/java/com/fr/design/bridge/exec/JSExecutor.java b/designer-base/src/main/java/com/fr/design/bridge/exec/JSExecutor.java index 9ded472eb3..1efa613abc 100644 --- a/designer-base/src/main/java/com/fr/design/bridge/exec/JSExecutor.java +++ b/designer-base/src/main/java/com/fr/design/bridge/exec/JSExecutor.java @@ -4,5 +4,8 @@ package com.fr.design.bridge.exec; * Created by ibm on 2017/6/21. */ public interface JSExecutor { + + String CALLBACK_FUNCTION_NAME = "action"; + void executor(String newValue); } diff --git a/designer-base/src/main/java/com/fr/design/dcm/UniversalDatabasePane.java b/designer-base/src/main/java/com/fr/design/dcm/UniversalDatabasePane.java index e29a9f6698..f16fa0b11d 100644 --- a/designer-base/src/main/java/com/fr/design/dcm/UniversalDatabasePane.java +++ b/designer-base/src/main/java/com/fr/design/dcm/UniversalDatabasePane.java @@ -2,9 +2,8 @@ package com.fr.design.dcm; import com.fr.design.dialog.BasicPane; import com.fr.design.ui.ModernUIPane; -import com.teamdev.jxbrowser.chromium.JSValue; -import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; -import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; +import com.teamdev.jxbrowser.browser.callback.InjectJsCallback; +import com.teamdev.jxbrowser.js.JsObject; import java.awt.*; @@ -26,14 +25,13 @@ public class UniversalDatabasePane extends BasicPane { setLayout(new BorderLayout()); modernUIPane = new ModernUIPane.Builder<>() .withComponent(UniversalDatabaseComponent.KEY) - .prepare(new ScriptContextAdapter() { - @Override - public void onScriptContextCreated(ScriptContextEvent event) { - JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window"); - window.asObject().setProperty("DcmHelper", UniversalDcmBridge.getBridge(event.getBrowser())); + .prepare(params -> { + JsObject window = params.frame().executeJavaScript("window"); + if (window != null) { + window.putProperty("DcmHelper", UniversalDcmBridge.getBridge()); } - }) - .build(); + return InjectJsCallback.Response.proceed(); + }).build(); add(modernUIPane, BorderLayout.CENTER); } } diff --git a/designer-base/src/main/java/com/fr/design/dcm/UniversalDcmBridge.java b/designer-base/src/main/java/com/fr/design/dcm/UniversalDcmBridge.java index 577acada97..db43c3c79d 100644 --- a/designer-base/src/main/java/com/fr/design/dcm/UniversalDcmBridge.java +++ b/designer-base/src/main/java/com/fr/design/dcm/UniversalDcmBridge.java @@ -2,8 +2,6 @@ package com.fr.design.dcm; import com.fr.decision.webservice.bean.BaseBean; import com.fr.design.bridge.exec.JSBridge; -import com.teamdev.jxbrowser.chromium.Browser; -import com.teamdev.jxbrowser.chromium.JSObject; /** * @author richie @@ -13,18 +11,18 @@ import com.teamdev.jxbrowser.chromium.JSObject; */ public class UniversalDcmBridge { - public static UniversalDcmBridge getBridge(Browser browser) { - return new UniversalDcmBridge(browser); + public static UniversalDcmBridge getBridge() { + return new UniversalDcmBridge(); } - private JSObject window; - private UniversalDcmBridge(Browser browser) { - this.window = browser.executeJavaScriptAndReturnValue("window").asObject(); + private UniversalDcmBridge() { + } /** * 获取所有的数据连接 + * * @return 数据连接集合 */ @JSBridge diff --git a/designer-base/src/main/java/com/fr/design/ui/Assistant.java b/designer-base/src/main/java/com/fr/design/ui/Assistant.java deleted file mode 100644 index 3962692c73..0000000000 --- a/designer-base/src/main/java/com/fr/design/ui/Assistant.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.fr.design.ui; - -import com.fr.stable.StringUtils; -import com.teamdev.jxbrowser.chromium.Browser; -import com.teamdev.jxbrowser.chromium.BrowserContext; -import com.teamdev.jxbrowser.chromium.ProtocolService; -import com.teamdev.jxbrowser.chromium.URLResponse; - -import javax.activation.MimetypesFileTypeMap; -import java.io.DataInputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; - -/** - * @author richie - * @version 10.0 - * Created by richie on 2019-03-07 - */ -public class Assistant { - - public static URLResponse inputStream2Response(InputStream inputStream, String filePath) throws Exception { - URLResponse response = new URLResponse(); - DataInputStream stream = new DataInputStream(inputStream); - byte[] data = new byte[stream.available()]; - stream.readFully(data); - response.setData(data); - String mimeType = getMimeType(filePath); - response.getHeaders().setHeader("Content-Type", mimeType); - return response; - } - - - private static String getMimeType(String path) { - if (StringUtils.isBlank(path)) { - return "text/html"; - } - if (path.endsWith(".html")) { - return "text/html"; - } - if (path.endsWith(".css")) { - return "text/css"; - } - if (path.endsWith(".js")) { - return "text/javascript"; - } - if (path.endsWith(".svg")) { - return "image/svg+xml"; - } - Path file = new File(path).toPath(); - try { - return Files.probeContentType(file); - } catch (IOException e) { - return "text/html"; - } - } - - public static void setEmbProtocolHandler(Browser browser, EmbProtocolHandler handler) { - BrowserContext browserContext = browser.getContext(); - ProtocolService protocolService = browserContext.getProtocolService(); - // 支持读取jar包中文件的自定义协议————emb:/com/fr/design/images/bbs.png - protocolService.setProtocolHandler("emb", handler); - protocolService.setProtocolHandler("file", handler); - } -} diff --git a/designer-base/src/main/java/com/fr/design/ui/EmbProtocolHandler.java b/designer-base/src/main/java/com/fr/design/ui/EmbProtocolHandler.java deleted file mode 100644 index 04d2f0f853..0000000000 --- a/designer-base/src/main/java/com/fr/design/ui/EmbProtocolHandler.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.fr.design.ui; - -import com.fr.base.TemplateUtils; -import com.fr.general.IOUtils; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.EncodeConstants; -import com.fr.stable.StringUtils; -import com.fr.third.org.apache.commons.codec.net.URLCodec; -import com.fr.third.org.apache.commons.io.FileUtils; -import com.fr.third.org.apache.commons.io.FilenameUtils; -import com.fr.web.struct.AssembleComponent; -import com.fr.web.struct.AtomBuilder; -import com.fr.web.struct.PathGroup; -import com.fr.web.struct.category.ScriptPath; -import com.fr.web.struct.category.StylePath; -import com.teamdev.jxbrowser.chromium.ProtocolHandler; -import com.teamdev.jxbrowser.chromium.URLRequest; -import com.teamdev.jxbrowser.chromium.URLResponse; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.StringReader; -import java.net.URI; -import java.nio.charset.StandardCharsets; -import java.util.Map; - -/** - * @author richie - * @version 10.0 - * Created by richie on 2019-03-07 - */ -public class EmbProtocolHandler implements ProtocolHandler { - - private AssembleComponent component; - private Map map; - - public EmbProtocolHandler() { - - } - - public EmbProtocolHandler(AssembleComponent component) { - this.component = component; - } - - public EmbProtocolHandler(AssembleComponent component, Map map) { - this.component = component; - this.map = map; - } - - public EmbProtocolHandler(Map map) { - this.map = map; - } - - @Override - public URLResponse onRequest(URLRequest req) { - InputStream inputStream = null; - try { - String path = req.getURL(); - if (path.startsWith("file:")) { - String url = new URLCodec().decode(path); - String filePath = TemplateUtils.renderParameter4Tpl(url, map); - File file = new File(URI.create(filePath).getPath()); - inputStream = IOUtils.readResource(file.getAbsolutePath()); - String text = IOUtils.inputStream2String(inputStream, EncodeConstants.ENCODING_UTF_8); - text = TemplateUtils.renderParameter4Tpl(text, map); - return Assistant.inputStream2Response(new ByteArrayInputStream(text.getBytes(StandardCharsets.UTF_8)), path); - } else if (path.startsWith("emb:dynamic")) { - URLResponse response = new URLResponse(); - response.setData(htmlText(map).getBytes()); - response.getHeaders().setHeader("Content-Type", "text/html"); - return response; - } else { - int index = path.indexOf("="); - if (index > 0) { - path = path.substring(index + 1); - } else { - path = path.substring(4); - } - inputStream = IOUtils.readResource(path); - return Assistant.inputStream2Response(inputStream, path); - } - } catch (Exception e) { - FineLoggerFactory.getLogger().info(e.getMessage()); - } finally { - if (inputStream != null) { - try { - inputStream.close(); - } catch (IOException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - } - return null; - } - - private String htmlText(Map map) { - PathGroup pathGroup = AtomBuilder.create().buildAssembleFilePath(ModernRequestClient.KEY, component); - StylePath[] stylePaths = pathGroup.toStylePathGroup(); - StringBuilder styleText = new StringBuilder(); - for (StylePath path : stylePaths) { - if (StringUtils.isNotBlank(path.toFilePath())) { - styleText.append(""); - } - } - String result = ModernUIConstants.HTML_TPL.replaceAll("##style##", styleText.toString()); - ScriptPath[] scriptPaths = pathGroup.toScriptPathGroup(); - StringBuilder scriptText = new StringBuilder(); - for (ScriptPath path : scriptPaths) { - if (StringUtils.isNotBlank(path.toFilePath())) { - scriptText.append(""); - } - } - result = result.replaceAll("##script##", scriptText.toString()); - if (map != null) { - for (Map.Entry entry : map.entrySet()) { - String key = entry.getKey(); - String value = entry.getValue(); - result = result.replaceAll("\\$\\{" + key + "}", value); - } - } - return result; - } -} diff --git a/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java b/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java index 4a92d3715c..5b53e2ba82 100644 --- a/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java +++ b/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java @@ -7,21 +7,18 @@ import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.i18n.Toolkit; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.web.struct.AssembleComponent; -import com.teamdev.jxbrowser.chromium.Browser; -import com.teamdev.jxbrowser.chromium.BrowserPreferences; -import com.teamdev.jxbrowser.chromium.JSValue; -import com.teamdev.jxbrowser.chromium.events.FinishLoadingEvent; -import com.teamdev.jxbrowser.chromium.events.LoadAdapter; -import com.teamdev.jxbrowser.chromium.events.LoadListener; -import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; -import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; -import com.teamdev.jxbrowser.chromium.events.ScriptContextListener; -import com.teamdev.jxbrowser.chromium.swing.BrowserView; +import com.teamdev.jxbrowser.browser.Browser; +import com.teamdev.jxbrowser.browser.callback.InjectJsCallback; +import com.teamdev.jxbrowser.engine.Engine; +import com.teamdev.jxbrowser.engine.EngineOptions; +import com.teamdev.jxbrowser.engine.RenderingMode; +import com.teamdev.jxbrowser.js.JsObject; +import com.teamdev.jxbrowser.net.Network; +import com.teamdev.jxbrowser.net.callback.InterceptRequestCallback; +import com.teamdev.jxbrowser.view.swing.BrowserView; import javax.swing.*; import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.util.Map; /** @@ -42,9 +39,8 @@ public class ModernUIPane extends BasicPane { } private void initialize() { + setLayout(new BorderLayout()); if (browser == null) { - setLayout(new BorderLayout()); - BrowserPreferences.setChromiumSwitches("--disable-google-traffic"); if (DesignerEnvManager.getEnvManager().isOpenDebug()) { UIToolbar toolbar = new UIToolbar(); add(toolbar, BorderLayout.NORTH); @@ -55,75 +51,67 @@ public class ModernUIPane extends BasicPane { UIButton closeButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Close_Window")); toolbar.add(closeButton); - openDebugButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - showDebuggerDialog(); - } - }); + openDebugButton.addActionListener(e -> showDebuggerDialog()); - reloadButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - browser.reloadIgnoringCache(); - } - }); + reloadButton.addActionListener(e -> browser.navigation().reloadIgnoringCache()); - closeButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - SwingUtilities.getWindowAncestor(ModernUIPane.this).setVisible(false); - } - }); - BrowserPreferences.setChromiumSwitches("--remote-debugging-port=9222"); + closeButton.addActionListener(e -> SwingUtilities.getWindowAncestor(ModernUIPane.this).setVisible(false)); initializeBrowser(); - add(new BrowserView(browser), BorderLayout.CENTER); + add(BrowserView.newInstance(browser), BorderLayout.CENTER); } else { initializeBrowser(); - add(new BrowserView(browser), BorderLayout.CENTER); + add(BrowserView.newInstance(browser), BorderLayout.CENTER); } } } private void showDebuggerDialog() { JDialog dialog = new JDialog(SwingUtilities.getWindowAncestor(this)); - Browser debugger = new Browser(); - BrowserView debuggerView = new BrowserView(debugger); + Engine engine = Engine.newInstance( + EngineOptions.newBuilder(RenderingMode.HARDWARE_ACCELERATED) + .addSwitch("--disable-google-traffic") + .remoteDebuggingPort(9222).build()); + Browser debugger = engine.newBrowser(); + BrowserView debuggerView = BrowserView.newInstance(debugger); dialog.add(debuggerView, BorderLayout.CENTER); dialog.setSize(new Dimension(800, 400)); GUICoreUtils.centerWindow(dialog); dialog.setVisible(true); dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - debugger.loadURL(browser.getRemoteDebuggingURL()); + browser.devTools().remoteDebuggingUrl().ifPresent(url -> { + debugger.navigation().loadUrl(url); + }); } private void initializeBrowser() { - browser = new Browser(); + Engine engine = Engine.newInstance(EngineOptions.newBuilder(RenderingMode.HARDWARE_ACCELERATED).addSwitch("--disable-google-traffic").build()); + browser = engine.newBrowser(); // 初始化的时候,就把命名空间对象初始化好,确保window.a.b.c("a.b.c"为命名空间)对象都是初始化过的 - browser.addScriptContextListener(new ScriptContextAdapter() { - @Override - public void onScriptContextCreated(ScriptContextEvent event) { - event.getBrowser().executeJavaScript(String.format(ModernUIConstants.SCRIPT_INIT_NAME_SPACE, namespace)); - } + browser.set(InjectJsCallback.class, params -> { + params.frame().executeJavaScript(String.format(ModernUIConstants.SCRIPT_INIT_NAME_SPACE, namespace)); + return InjectJsCallback.Response.proceed(); }); } /** * 转向一个新的地址,相当于重新加载 + * * @param url 新的地址 */ public void redirect(String url) { - browser.loadURL(url); + browser.navigation().loadUrl(url); } /** * 转向一个新的地址,相当于重新加载 + * * @param url 新的地址 * @param map 初始化参数 */ public void redirect(String url, Map map) { - Assistant.setEmbProtocolHandler(browser, new EmbProtocolHandler(map)); - browser.loadURL(url); + Network network = browser.engine().network(); + network.set(InterceptRequestCallback.class, new NxInterceptRequestCallback(network, map)); + browser.navigation().loadUrl(url); } @Override @@ -133,19 +121,18 @@ public class ModernUIPane extends BasicPane { public void populate(final T t) { - browser.addScriptContextListener(new ScriptContextAdapter() { - @Override - public void onScriptContextCreated(ScriptContextEvent event) { - JSValue ns = event.getBrowser().executeJavaScriptAndReturnValue("window." + namespace); - ns.asObject().setProperty(variable, t); + browser.set(InjectJsCallback.class, params -> { + JsObject ns = params.frame().executeJavaScript("window." + namespace); + if (ns != null) { + ns.putProperty(variable, t); } + return InjectJsCallback.Response.proceed(); }); } public T update() { - JSValue jsValue = browser.executeJavaScriptAndReturnValue("window." + namespace + "." + expression); - if (jsValue.isObject()) { - return (T)jsValue.asJavaObject(); + if (browser.mainFrame().isPresent()) { + return browser.mainFrame().get().executeJavaScript("window." + namespace + "." + expression); } return null; } @@ -154,79 +141,89 @@ public class ModernUIPane extends BasicPane { private ModernUIPane pane = new ModernUIPane<>(); - public Builder prepare(ScriptContextListener contextListener) { - pane.browser.addScriptContextListener(contextListener); - return this; - } - - public Builder prepare(LoadListener loadListener) { - pane.browser.addLoadListener(loadListener); + public Builder prepare(InjectJsCallback callback) { + pane.browser.set(InjectJsCallback.class, callback); return this; } /** * 加载jar包中的资源 + * * @param path 资源路径 */ public Builder withEMB(final String path) { - Assistant.setEmbProtocolHandler(pane.browser, new EmbProtocolHandler()); - pane.browser.loadURL("emb:" + path); + Network network = pane.browser.engine().network(); + network.set(InterceptRequestCallback.class, new NxInterceptRequestCallback(network)); + pane.browser.navigation().loadUrl("emb:" + path); return this; } /** * 加载url指向的资源 + * * @param url 文件的地址 */ public Builder withURL(final String url) { - Assistant.setEmbProtocolHandler(pane.browser, new EmbProtocolHandler()); - pane.browser.loadURL(url); + Network network = pane.browser.engine().network(); + network.set(InterceptRequestCallback.class, new NxInterceptRequestCallback(network)); + pane.browser.navigation().loadUrl(url); return this; } /** * 加载url指向的资源 + * * @param url 文件的地址 */ public Builder withURL(final String url, Map map) { - Assistant.setEmbProtocolHandler(pane.browser, new EmbProtocolHandler(map)); - pane.browser.loadURL(url); + Network network = pane.browser.engine().network(); + network.set(InterceptRequestCallback.class, new NxInterceptRequestCallback(network, map)); + pane.browser.navigation().loadUrl(url); return this; } /** * 加载Atom组件 + * * @param component Atom组件 */ public Builder withComponent(AssembleComponent component) { - Assistant.setEmbProtocolHandler(pane.browser, new EmbProtocolHandler(component)); - pane.browser.loadURL("emb:dynamic"); + Network network = pane.browser.engine().network(); + network.set(InterceptRequestCallback.class, new NxComplexInterceptRequestCallback(network, component)); + pane.browser.navigation().loadUrl("emb:dynamic"); return this; } /** * 加载Atom组件 + * * @param component Atom组件 */ public Builder withComponent(AssembleComponent component, Map map) { - Assistant.setEmbProtocolHandler(pane.browser, new EmbProtocolHandler(component, map)); - pane.browser.loadURL("emb:dynamic"); + Network network = pane.browser.engine().network(); + network.set(InterceptRequestCallback.class, new NxComplexInterceptRequestCallback(network, component, map)); + pane.browser.navigation().loadUrl("emb:dynamic"); return this; } /** * 加载html文本内容 + * * @param html 要加载html文本内容 */ public Builder withHTML(String html) { - Assistant.setEmbProtocolHandler(pane.browser, new EmbProtocolHandler()); - pane.browser.loadHTML(html); + Network network = pane.browser.engine().network(); + network.set(InterceptRequestCallback.class, new NxInterceptRequestCallback(network)); + pane.browser.mainFrame().ifPresent(frame -> { + frame.loadHtml(html); + }); return this; } /** * 设置该前端页面做数据交换所使用的对象 + * * @param namespace 对象名 */ public Builder namespace(String namespace) { @@ -236,6 +233,7 @@ public class ModernUIPane extends BasicPane { /** * java端往js端传数据时使用的变量名字 + * * @param name 变量的名字 */ public Builder variable(String name) { @@ -245,6 +243,7 @@ public class ModernUIPane extends BasicPane { /** * js端往java端传数据时执行的函数表达式 + * * @param expression 函数表达式 */ public Builder expression(String expression) { diff --git a/designer-base/src/main/java/com/fr/design/ui/NxComplexInterceptRequestCallback.java b/designer-base/src/main/java/com/fr/design/ui/NxComplexInterceptRequestCallback.java new file mode 100644 index 0000000000..9e9705695d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/ui/NxComplexInterceptRequestCallback.java @@ -0,0 +1,85 @@ +package com.fr.design.ui; + +import com.fr.general.IOUtils; +import com.fr.stable.StringUtils; +import com.fr.web.struct.AssembleComponent; +import com.fr.web.struct.AtomBuilder; +import com.fr.web.struct.PathGroup; +import com.fr.web.struct.category.ScriptPath; +import com.fr.web.struct.category.StylePath; +import com.teamdev.jxbrowser.net.Network; +import com.teamdev.jxbrowser.net.UrlRequest; +import com.teamdev.jxbrowser.net.callback.InterceptRequestCallback; + +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.Map; + +/** + * @author richie + * @version 10.0 + * Created by richie on 2020/3/25 + */ +public class NxComplexInterceptRequestCallback extends NxInterceptRequestCallback { + + private AssembleComponent component; + + public NxComplexInterceptRequestCallback(Network network, AssembleComponent component) { + super(network); + this.component = component; + } + + public NxComplexInterceptRequestCallback(Network network, AssembleComponent component, Map map) { + super(network, map); + this.component = component; + } + + @Override + protected Response next(UrlRequest urlRequest, String path) { + if (path.startsWith("emb:dynamic")) { + String text = htmlText(map); + return InterceptRequestCallback.Response.intercept(generateBasicUrlRequestJob(urlRequest, "text/html", text.getBytes(StandardCharsets.UTF_8))); + } else { + int index = path.indexOf("="); + if (index > 0) { + path = path.substring(index + 1); + } else { + path = path.substring(4); + } + InputStream inputStream = IOUtils.readResource(path); + return InterceptRequestCallback.Response.intercept(generateBasicUrlRequestJob(urlRequest, getMimeType(path), IOUtils.inputStream2Bytes(inputStream))); + } + } + + private String htmlText(Map map) { + PathGroup pathGroup = AtomBuilder.create().buildAssembleFilePath(ModernRequestClient.KEY, component); + StylePath[] stylePaths = pathGroup.toStylePathGroup(); + StringBuilder styleText = new StringBuilder(); + for (StylePath path : stylePaths) { + if (StringUtils.isNotBlank(path.toFilePath())) { + styleText.append(""); + } + } + String result = ModernUIConstants.HTML_TPL.replaceAll("##style##", styleText.toString()); + ScriptPath[] scriptPaths = pathGroup.toScriptPathGroup(); + StringBuilder scriptText = new StringBuilder(); + for (ScriptPath path : scriptPaths) { + if (StringUtils.isNotBlank(path.toFilePath())) { + scriptText.append(""); + } + } + result = result.replaceAll("##script##", scriptText.toString()); + if (map != null) { + for (Map.Entry entry : map.entrySet()) { + String key = entry.getKey(); + String value = entry.getValue(); + result = result.replaceAll("\\$\\{" + key + "}", value); + } + } + return result; + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/ui/NxInterceptRequestCallback.java b/designer-base/src/main/java/com/fr/design/ui/NxInterceptRequestCallback.java new file mode 100644 index 0000000000..ea921efe04 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/ui/NxInterceptRequestCallback.java @@ -0,0 +1,134 @@ +package com.fr.design.ui; + +import com.fr.base.TemplateUtils; +import com.fr.general.IOUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.ArrayUtils; +import com.fr.stable.EncodeConstants; +import com.fr.stable.StringUtils; +import com.fr.third.org.apache.commons.codec.net.URLCodec; +import com.teamdev.jxbrowser.net.HttpHeader; +import com.teamdev.jxbrowser.net.HttpStatus; +import com.teamdev.jxbrowser.net.Network; +import com.teamdev.jxbrowser.net.UrlRequest; +import com.teamdev.jxbrowser.net.UrlRequestJob; +import com.teamdev.jxbrowser.net.callback.InterceptRequestCallback; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Map; +import java.util.Optional; + +/** + * @author richie + * @version 10.0 + * Created by richie on 2020/3/25 + */ +public class NxInterceptRequestCallback implements InterceptRequestCallback { + + Network network; + Map map; + + public NxInterceptRequestCallback(Network network) { + this.network = network; + } + + public NxInterceptRequestCallback(Network network, Map map) { + this.network = network; + this.map = map; + } + + @Override + public Response on(Params params) { + UrlRequest urlRequest = params.urlRequest(); + String path = urlRequest.url(); + if (path.startsWith("file:")) { + Optional optional = generateFileProtocolUrlRequestJob(urlRequest, path); + if (optional.isPresent()) { + return InterceptRequestCallback.Response.intercept(optional.get()); + } + } else { + return next(urlRequest, path); + } + return Response.proceed(); + } + + Response next(UrlRequest urlRequest, String path) { + return Response.proceed(); + } + + private Optional generateFileProtocolUrlRequestJob(UrlRequest urlRequest, String path) { + try { + String url = new URLCodec().decode(path); + String filePath = TemplateUtils.renderParameter4Tpl(url, map); + File file = new File(URI.create(filePath).getPath()); + InputStream inputStream = IOUtils.readResource(file.getAbsolutePath()); + String mimeType = getMimeType(path); + byte[] bytes; + if (isPlainText(mimeType)) { + String text = IOUtils.inputStream2String(inputStream, EncodeConstants.ENCODING_UTF_8); + text = TemplateUtils.renderParameter4Tpl(text, map); + bytes = text.getBytes(StandardCharsets.UTF_8); + } else { + bytes = IOUtils.inputStream2Bytes(inputStream); + } + return Optional.of(generateBasicUrlRequestJob(urlRequest, mimeType, bytes)); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return Optional.empty(); + } + + private boolean isPlainText(String mimeType) { + return ArrayUtils.contains(new String[]{"text/html", "text/javascript", "text/css"}, mimeType); + } + + UrlRequestJob generateBasicUrlRequestJob(UrlRequest urlRequest, String mimeType, byte[] bytes) { + UrlRequestJob.Options options = UrlRequestJob.Options + .newBuilder(urlRequest.id(), HttpStatus.OK) + .addHttpHeader(HttpHeader.of("Content-Type", mimeType)) + .build(); + UrlRequestJob urlRequestJob = network.newUrlRequestJob(options); + urlRequestJob.write(bytes); + urlRequestJob.complete(); + return urlRequestJob; + } + + String getMimeType(String path) { + if (StringUtils.isBlank(path)) { + return "text/html"; + } + if (path.endsWith(".html")) { + return "text/html"; + } + if (path.endsWith(".css")) { + return "text/css"; + } + if (path.endsWith(".js")) { + return "text/javascript"; + } + if (path.endsWith(".svg")) { + return "image/svg+xml"; + } + if (path.endsWith(".png")) { + return "image/png"; + } + if (path.endsWith(".jpeg")) { + return "image/jpeg"; + } + if (path.endsWith(".gif")) { + return "image/gif"; + } + Path file = new File(path).toPath(); + try { + return Files.probeContentType(file); + } catch (IOException e) { + return "text/html"; + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java b/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java index e7d134808a..65b1c6b3b2 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java @@ -6,6 +6,7 @@ import com.fr.config.ServerPreferenceConfig; import com.fr.decision.webservice.v10.plugin.helper.category.impl.UpmResourceLoader; import com.fr.design.bridge.exec.JSBridge; import com.fr.design.bridge.exec.JSCallback; +import com.fr.design.bridge.exec.JSExecutor; import com.fr.design.extra.PluginOperateUtils; import com.fr.design.extra.PluginUtils; import com.fr.design.extra.exe.GetInstalledPluginsExecutor; @@ -28,10 +29,8 @@ import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginMarker; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; -import com.teamdev.jxbrowser.chromium.Browser; -import com.teamdev.jxbrowser.chromium.JSArray; -import com.teamdev.jxbrowser.chromium.JSFunction; -import com.teamdev.jxbrowser.chromium.JSObject; +import com.teamdev.jxbrowser.js.JsAccessible; +import com.teamdev.jxbrowser.js.JsObject; import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; @@ -52,42 +51,45 @@ import java.util.concurrent.RunnableFuture; */ public class UpmBridge { - public static UpmBridge getBridge(Browser browser) { - return new UpmBridge(browser); + public static UpmBridge getBridge() { + return new UpmBridge(); } - private JSObject window; - private UpmBridge(Browser browser) { - this.window = browser.executeJavaScriptAndReturnValue("window").asObject(); + private UpmBridge() { + } /** * 更新插件管理中心资源文件,这个方法仅仅是为了语义上的作用(更新) + * * @param callback 安装完成后的回调函数 */ @JSBridge - public void update(final JSFunction callback) { - callback.invoke(window, "start", Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Start")); + @JsAccessible + public void update(final JsObject callback) { + callback.call(JSExecutor.CALLBACK_FUNCTION_NAME, "start", Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Start")); try { UpmResourceLoader.INSTANCE.download(); UpmResourceLoader.INSTANCE.install(); - callback.invoke(window, "success", Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Success")); + callback.call(JSExecutor.CALLBACK_FUNCTION_NAME, "success", Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Success")); EventDispatcher.fire(DownloadEvent.UPDATE, "success"); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); - callback.invoke(window, "error", Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Error")); + callback.call(JSExecutor.CALLBACK_FUNCTION_NAME, "error", Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Error")); } } /** * 下载并安装插件管理中心的资源文件 + * * @param callback 安装完成后的回调函数 */ @JSBridge - public void startDownload(final JSFunction callback) { - callback.invoke(window, "start", Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Start")); - new SwingWorker(){ + @JsAccessible + public void startDownload(final JsObject callback) { + callback.call(JSExecutor.CALLBACK_FUNCTION_NAME, "start", Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Start")); + new SwingWorker() { @Override protected Void doInBackground() throws Exception { UpmResourceLoader.INSTANCE.download(); @@ -99,10 +101,10 @@ public class UpmBridge { protected void done() { try { get(); - callback.invoke(window, "success", Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Success")); + callback.call(JSExecutor.CALLBACK_FUNCTION_NAME, "success", Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Success")); EventDispatcher.fire(DownloadEvent.SUCCESS, "success"); } catch (Exception e) { - callback.invoke(window, "error", Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Error")); + callback.call(JSExecutor.CALLBACK_FUNCTION_NAME, "error", Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Error")); FineLoggerFactory.getLogger().error(e.getMessage(), e); EventDispatcher.fire(DownloadEvent.ERROR, "error"); } @@ -112,37 +114,44 @@ public class UpmBridge { /** * 获取upm的版本信息 + * * @return 版本信息 */ @JSBridge + @JsAccessible public String getVersion() { return ServerPreferenceConfig.getInstance().getOptimizedUPMVersion(); } @JSBridge + @JsAccessible public String i18nText(String key) { return Toolkit.i18nText(key); } @JSBridge + @JsAccessible public void closeWindow() { UpmFinder.closeWindow(); } @JSBridge + @JsAccessible public boolean isDesigner() { return true; } @JSBridge - public void getPackInfo(final JSFunction callback) { - callback.invoke(window, StringUtils.EMPTY); + @JsAccessible + public void getPackInfo(final JsObject callback) { + callback.call(JSExecutor.CALLBACK_FUNCTION_NAME, StringUtils.EMPTY); } @JSBridge - public void getPluginPrefix(final JSFunction callback) { - UpmTaskWorker task = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(window, callback)), new GetPluginPrefixExecutor()); + @JsAccessible + public void getPluginPrefix(final JsObject callback) { + UpmTaskWorker task = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(callback)), new GetPluginPrefixExecutor()); task.execute(); } @@ -152,8 +161,9 @@ public class UpmBridge { * @param callback 回调函数 */ @JSBridge - public void getPluginCategories(final JSFunction callback) { - UpmTaskWorker task = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(window, callback)), new GetPluginCategoriesExecutor()); + @JsAccessible + public void getPluginCategories(final JsObject callback) { + UpmTaskWorker task = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(callback)), new GetPluginCategoriesExecutor()); task.execute(); } @@ -164,8 +174,9 @@ public class UpmBridge { * @param callback 回调函数 */ @JSBridge - public void getPluginFromStoreNew(String info, final JSFunction callback) { - UpmTaskWorker task = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(window, callback)), new GetPluginFromStoreExecutor(new JSONObject(info))); + @JsAccessible + public void getPluginFromStoreNew(String info, final JsObject callback) { + UpmTaskWorker task = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(callback)), new GetPluginFromStoreExecutor(new JSONObject(info))); task.execute(); } @@ -173,8 +184,9 @@ public class UpmBridge { * 已安装插件检查更新 */ @JSBridge - public void readUpdateOnline(final JSFunction callback) { - UpmTaskWorker task = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(window, callback)), new ReadUpdateOnlineExecutor()); + @JsAccessible + public void readUpdateOnline(final JsObject callback) { + UpmTaskWorker task = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(callback)), new ReadUpdateOnlineExecutor()); task.execute(); } @@ -182,8 +194,9 @@ public class UpmBridge { * 获取已经安装的插件的数组 */ @JSBridge - public void getInstalledPlugins(final JSFunction callback) { - UpmTaskWorker task = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(window, callback)), new GetInstalledPluginsExecutor()); + @JsAccessible + public void getInstalledPlugins(final JsObject callback) { + UpmTaskWorker task = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(callback)), new GetInstalledPluginsExecutor()); task.execute(); } @@ -193,29 +206,36 @@ public class UpmBridge { * @param pluginIDs 插件集合 */ @JSBridge - public void updatePluginOnline(Object pluginIDs, final JSFunction callback) { - JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); + @JsAccessible + public void updatePluginOnline(JsObject pluginIDs, final JsObject callback) { + JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(callback)); List pluginMarkerList = new ArrayList<>(); - if (pluginIDs instanceof String) { - pluginMarkerList.add(PluginUtils.createPluginMarker(pluginIDs.toString())); - } else if (pluginIDs instanceof JSArray) { - JSArray pluginInfos = (JSArray) pluginIDs; - for (int i = 0, len = pluginInfos.length(); i < len; i++) { - String value = pluginInfos.get(i).asString().getValue(); - pluginMarkerList.add(PluginUtils.createPluginMarker(value)); - } + for (String key : pluginIDs.propertyNames()) { + pluginIDs.property(key).ifPresent(v -> { + pluginMarkerList.add(PluginUtils.createPluginMarker(GeneralUtils.objectToString(v))); + }); } PluginOperateUtils.updatePluginOnline(pluginMarkerList, jsCallback); } + @JSBridge + @JsAccessible + public void updatePluginOnline(String pluginID, final JsObject callback) { + JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(callback)); + List pluginMarkerList = new ArrayList<>(); + pluginMarkerList.add(PluginUtils.createPluginMarker(pluginID)); + PluginOperateUtils.updatePluginOnline(pluginMarkerList, jsCallback); + } + /** * 搜索在线插件 * * @param keyword 关键字 */ @JSBridge - public void searchPlugin(String keyword, final JSFunction callback) { - UpmTaskWorker worker = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(window, callback)), new SearchOnlineExecutor(keyword)); + @JsAccessible + public void searchPlugin(String keyword, final JsObject callback) { + UpmTaskWorker worker = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(callback)), new SearchOnlineExecutor(keyword)); worker.execute(); } @@ -225,8 +245,9 @@ public class UpmBridge { * @param filePath 插件包的路径 */ @JSBridge - public void installPluginFromDisk(final String filePath, final JSFunction callback) { - JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); + @JsAccessible + public void installPluginFromDisk(final String filePath, final JsObject callback) { + JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(callback)); File file = new File(filePath); PluginOperateUtils.installPluginFromDisk(file, jsCallback); } @@ -237,8 +258,9 @@ public class UpmBridge { * @param pluginInfo 插件信息 */ @JSBridge - public void uninstallPlugin(final String pluginInfo, final boolean isForce, final JSFunction callback) { - JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); + @JsAccessible + public void uninstallPlugin(final String pluginInfo, final boolean isForce, final JsObject callback) { + JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(callback)); PluginOperateUtils.uninstallPlugin(pluginInfo, isForce, jsCallback); } @@ -249,8 +271,9 @@ public class UpmBridge { * @param callback 回调函数 */ @JSBridge - public void installPluginOnline(final String pluginInfo, final JSFunction callback) { - JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); + @JsAccessible + public void installPluginOnline(final String pluginInfo, final JsObject callback) { + JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(callback)); PluginMarker pluginMarker = PluginUtils.createPluginMarker(pluginInfo); PluginOperateUtils.installPluginOnline(pluginMarker, jsCallback); } @@ -260,8 +283,10 @@ public class UpmBridge { * * @param filePath 插件包的路径 */ - public void updatePluginFromDisk(String filePath, final JSFunction callback) { - JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); + @JSBridge + @JsAccessible + public void updatePluginFromDisk(String filePath, final JsObject callback) { + JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(callback)); File file = new File(filePath); PluginOperateUtils.updatePluginFromDisk(file, jsCallback); } @@ -272,8 +297,9 @@ public class UpmBridge { * @param pluginID 插件ID */ @JSBridge - public void setPluginActive(String pluginID, final JSFunction callback) { - JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); + @JsAccessible + public void setPluginActive(String pluginID, final JsObject callback) { + JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(callback)); PluginOperateUtils.setPluginActive(pluginID, jsCallback); } @@ -283,6 +309,7 @@ public class UpmBridge { * @return 选择的文件的路径 */ @JSBridge + @JsAccessible public String showFileChooser() { return showFileChooserWithFilter(StringUtils.EMPTY, StringUtils.EMPTY); } @@ -296,6 +323,7 @@ public class UpmBridge { * 这里换用JFileChooser会卡死,不知道为什么 */ @JSBridge + @JsAccessible public String showFileChooserWithFilter(final String des, final String filter) { RunnableFuture future = new FutureTask<>(new Callable() { @Override @@ -318,7 +346,7 @@ public class UpmBridge { try { return future.get(); } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } return null; } @@ -331,31 +359,60 @@ public class UpmBridge { * @return 选择的文件的路径 */ @JSBridge - public String showFileChooserWithFilters(final String des, final Object args) { - RunnableFuture future = new FutureTask<>(new Callable() { - @Override - public String call() { - JFileChooser fileChooser = new JFileChooser(); - List filterList = new ArrayList<>(); - if (args instanceof String) { - filterList.add(GeneralUtils.objectToString(args)); - } else if (args instanceof JSArray) { - JSArray array = (JSArray)args; - for (int i = 0, len = array.length(); i < len; i ++) { - filterList.add(array.get(i).getStringValue()); - } - } - String[] filters = filterList.toArray(new String[0]); - if (ArrayUtils.isNotEmpty(filters)) { - FileNameExtensionFilter filter = new FileNameExtensionFilter(des, UpmUtils.findMatchedExtension(filters)); - fileChooser.setFileFilter(filter); - } - int result = fileChooser.showOpenDialog(UpmFinder.getDialog()); - if (result == JFileChooser.APPROVE_OPTION) { - return fileChooser.getSelectedFile().getAbsolutePath(); - } - return null; + @JsAccessible + public String showFileChooserWithFilters(final String des, final String args) { + RunnableFuture future = new FutureTask<>(() -> { + JFileChooser fileChooser = new JFileChooser(); + List filterList = new ArrayList<>(); + filterList.add(args); + String[] filters = filterList.toArray(new String[0]); + if (ArrayUtils.isNotEmpty(filters)) { + FileNameExtensionFilter filter = new FileNameExtensionFilter(des, UpmUtils.findMatchedExtension(filters)); + fileChooser.setFileFilter(filter); } + int result = fileChooser.showOpenDialog(UpmFinder.getDialog()); + if (result == JFileChooser.APPROVE_OPTION) { + return fileChooser.getSelectedFile().getAbsolutePath(); + } + return null; + }); + SwingUtilities.invokeLater(future); + try { + return future.get(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return null; + } + + /** + * 选择文件对话框 + * + * @param des 过滤文件描述 + * @param args 文件的后缀 + * @return 选择的文件的路径 + */ + @JSBridge + @JsAccessible + public String showFileChooserWithFilters(final String des, final JsObject args) { + RunnableFuture future = new FutureTask<>(() -> { + JFileChooser fileChooser = new JFileChooser(); + List filterList = new ArrayList<>(); + for (String key : args.propertyNames()) { + args.property(key).ifPresent(v -> { + filterList.add(GeneralUtils.objectToString(v)); + }); + } + String[] filters = filterList.toArray(new String[0]); + if (ArrayUtils.isNotEmpty(filters)) { + FileNameExtensionFilter filter = new FileNameExtensionFilter(des, UpmUtils.findMatchedExtension(filters)); + fileChooser.setFileFilter(filter); + } + int result = fileChooser.showOpenDialog(UpmFinder.getDialog()); + if (result == JFileChooser.APPROVE_OPTION) { + return fileChooser.getSelectedFile().getAbsolutePath(); + } + return null; }); SwingUtilities.invokeLater(future); try { @@ -372,7 +429,8 @@ public class UpmBridge { * 获取系统登录的用户名 */ @JSBridge - public String getLoginInfo(final JSFunction callback) { + @JsAccessible + public String getLoginInfo(final JsObject callback) { registerLoginInfo(callback); return MarketConfig.getInstance().getBbsUsername(); } @@ -383,8 +441,9 @@ public class UpmBridge { * @param callback 回调函数 */ @JSBridge - public void registerLoginInfo(final JSFunction callback) { - JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); + @JsAccessible + public void registerLoginInfo(final JsObject callback) { + JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(callback)); String username = MarketConfig.getInstance().getBbsUsername(); if (StringUtils.isEmpty(username)) { jsCallback.execute(StringUtils.EMPTY); @@ -404,14 +463,16 @@ public class UpmBridge { * @param callback 回调函数 */ @JSBridge - public void defaultLogin(String username, String password, final JSFunction callback) { - UpmTaskWorker worker = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(window, callback)), new PluginLoginExecutor(username, password)); + @JsAccessible + public void defaultLogin(String username, String password, final JsObject callback) { + UpmTaskWorker worker = new UpmTaskWorker<>(new JSCallback(UpmBrowserExecutor.create(callback)), new PluginLoginExecutor(username, password)); worker.execute(); } /** * 清除用户信息 */ + @JsAccessible public void clearUserInfo() { MarketConfig.getInstance().setInShowBBsName(StringUtils.EMPTY); FinePassportManager.getInstance().logout(); @@ -422,6 +483,7 @@ public class UpmBridge { * 打开论坛消息界面 */ @JSBridge + @JsAccessible public void getPriviteMessage() { try { String loginUrl = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); @@ -435,6 +497,7 @@ public class UpmBridge { * 忘记密码 */ @JSBridge + @JsAccessible public void forgetHref() { try { Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.reset"))); @@ -447,6 +510,7 @@ public class UpmBridge { * 立即注册 */ @JSBridge + @JsAccessible public void registerHref() { try { Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("bbs.register"))); @@ -457,9 +521,11 @@ public class UpmBridge { /** * 使用系统浏览器打开网页 + * * @param url 要打开的网页 */ @JSBridge + @JsAccessible public void openShopUrlAtWebBrowser(String url) { if (Desktop.isDesktopSupported()) { try { 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 4febad3a99..689c89942a 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 @@ -58,7 +58,7 @@ public class UpmFinder { public static void showUPMDialog() { boolean flag = true; try { - Class.forName("com.teamdev.jxbrowser.chromium.Browser"); + Class.forName("com.teamdev.jxbrowser.browser.Browser"); } catch (ClassNotFoundException e) { flag = false; } diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmShowPane.java b/designer-base/src/main/java/com/fr/design/upm/UpmShowPane.java index 1bc4b9e948..f4019cf060 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmShowPane.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmShowPane.java @@ -6,9 +6,8 @@ import com.fr.design.upm.event.DownloadEvent; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; -import com.teamdev.jxbrowser.chromium.JSValue; -import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; -import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; +import com.teamdev.jxbrowser.browser.callback.InjectJsCallback; +import com.teamdev.jxbrowser.js.JsObject; import java.awt.*; @@ -32,12 +31,10 @@ public class UpmShowPane extends BasicPane { // 先屏蔽掉这个判断,后续可能修改交互 // if (UpmFinder.checkUPMResourcesExist()) { modernUIPane = new ModernUIPane.Builder<>() - .prepare(new ScriptContextAdapter() { - @Override - public void onScriptContextCreated(ScriptContextEvent event) { - JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window"); - window.asObject().setProperty("PluginHelper", UpmBridge.getBridge(event.getBrowser())); - } + .prepare(params -> { + JsObject window = params.frame().executeJavaScript("window"); + window.putProperty("PluginHelper", UpmBridge.getBridge()); + return InjectJsCallback.Response.proceed(); }) .withURL(UpmFinder.getMainResourcePath(), UpmUtils.renderMap()) .build(); diff --git a/designer-base/src/main/java/com/fr/design/upm/exec/UpmBrowserExecutor.java b/designer-base/src/main/java/com/fr/design/upm/exec/UpmBrowserExecutor.java index 572f7b5f23..f2f10ffdfb 100644 --- a/designer-base/src/main/java/com/fr/design/upm/exec/UpmBrowserExecutor.java +++ b/designer-base/src/main/java/com/fr/design/upm/exec/UpmBrowserExecutor.java @@ -1,8 +1,7 @@ package com.fr.design.upm.exec; import com.fr.design.bridge.exec.JSExecutor; -import com.teamdev.jxbrowser.chromium.JSFunction; -import com.teamdev.jxbrowser.chromium.JSObject; +import com.teamdev.jxbrowser.js.JsObject; /** * @author richie @@ -11,20 +10,18 @@ import com.teamdev.jxbrowser.chromium.JSObject; */ public class UpmBrowserExecutor implements JSExecutor { - public static UpmBrowserExecutor create(JSObject window, JSFunction callback) { - return new UpmBrowserExecutor(window, callback); + public static UpmBrowserExecutor create(JsObject callback) { + return new UpmBrowserExecutor(callback); } - private JSObject window; - private JSFunction callback; + private JsObject callback; - private UpmBrowserExecutor(JSObject window, JSFunction callback) { - this.window = window; + private UpmBrowserExecutor(JsObject callback) { this.callback = callback; } @Override public void executor(String newValue) { - callback.invoke(window, newValue); + callback.call(JSExecutor.CALLBACK_FUNCTION_NAME, newValue); } } diff --git a/pom.xml b/pom.xml index 407f1fd17b..711751c9fb 100644 --- a/pom.xml +++ b/pom.xml @@ -28,8 +28,8 @@ maven-compiler-plugin 3.1 - 1.7 - 1.7 + 1.8 + 1.8 From c24078b110d2eec4077b2956150e4e84be8efa85 Mon Sep 17 00:00:00 2001 From: Harrison Date: Thu, 26 Mar 2020 15:33:40 +0800 Subject: [PATCH 015/135] =?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 9276bd5c62..cf8f4f74d4 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 bfe2d205322f0fd4fb8b5a684cacd710120c3775 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 1 Apr 2020 16:03:54 +0800 Subject: [PATCH 016/135] =?UTF-8?q?REPORT-28701=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8-=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=8C=E6=9B=BF=E6=8D=A2=E4=B8=BA=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=8E=9F=E7=94=9F=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/ifilechooser/AbstractFileChooser.java | 94 +++++++++++ .../gui/ifilechooser/UINativeFileChooser.java | 148 ++++++++++++++++++ 2 files changed, 242 insertions(+) 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/gui/ifilechooser/AbstractFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/AbstractFileChooser.java new file mode 100644 index 0000000000..ca460aa0f7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/AbstractFileChooser.java @@ -0,0 +1,94 @@ +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); +} 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 0000000000..9c956372d0 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/UINativeFileChooser.java @@ -0,0 +1,148 @@ +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; + } + + /** + * 确认本地文件选择器是否支持选择模式 + * @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; + } + } + +} From e0f894f244b99e6d19ba172e237bfc85aa27d7a1 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 3 Apr 2020 09:51:34 +0800 Subject: [PATCH 017/135] =?UTF-8?q?REPORT-29149=20=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6-=E5=A4=8D=E9=80=89=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=8F=AF=E4=B8=8D=E6=98=BE=E7=A4=BA=E2=80=9C?= =?UTF-8?q?=E5=85=A8=E9=80=89=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/icombocheckbox/UICheckListPopup.java | 16 ++++++++++++---- .../gui/icombocheckbox/UIComboCheckBox.java | 17 ++++++++++++++--- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java index b0b57f29c3..9592eb517e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java @@ -36,14 +36,20 @@ public class UICheckListPopup extends UIPopupMenu { private UIScrollPane jScrollPane; private Color mouseEnteredColor = UIConstants.CHECKBOX_HOVER_SELECTED; private int maxDisplayNumber = 8; + private boolean supportSelectAll = true; public static final String COMMIT_EVENT = "commit"; - public static final String SELECT_ALL = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Choose_All"); + private static final String SELECT_ALL = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Choose_All"); private static final int CHECKBOX_HEIGHT = 25; - public UICheckListPopup(Object[] value) { + public UICheckListPopup(Object[] values) { + this(values, true); + } + + public UICheckListPopup(Object[] value, boolean supportSelectAll) { super(); values = value; + this.supportSelectAll = supportSelectAll; initComponent(); } @@ -73,7 +79,9 @@ public class UICheckListPopup extends UIPopupMenu { checkBoxList.clear(); //全选加在第一个位置 - addOneCheckValue(SELECT_ALL); + if (supportSelectAll) { + addOneCheckValue(SELECT_ALL); + } for (Object checkValue : value) { addOneCheckValue(checkValue); } @@ -146,7 +154,7 @@ public class UICheckListPopup extends UIPopupMenu { private void addSelectListener() { for (int i = 0; i < checkBoxList.size(); i++) { JCheckBox checkBox = checkBoxList.get(i); - if (i == 0) { + if (supportSelectAll && i == 0) { checkBox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { 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 e2a5719d4b..6eba4a6da0 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 @@ -59,8 +59,18 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam private String multiComboName = StringUtils.EMPTY; private boolean showOmitText = true; + private boolean supportSelectAll = true; + public UIComboCheckBox(Object[] value) { - this(value, DEFAULT_VALUE_SPERATOR); + this(value, DEFAULT_VALUE_SPERATOR, true); + } + + public UIComboCheckBox(Object[] value, boolean supportSelectAll) { + this(value, DEFAULT_VALUE_SPERATOR, supportSelectAll); + } + + public UIComboCheckBox(Object[] values, String valueSperator) { + this(values, valueSperator, true); } /** @@ -69,8 +79,9 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam * @param value * @param valueSperator */ - public UIComboCheckBox(Object[] value, String valueSperator) { + public UIComboCheckBox(Object[] value, String valueSperator, boolean supportSelectAll) { values = value; + this.supportSelectAll = supportSelectAll; this.valueSperator = valueSperator; initComponent(); } @@ -102,7 +113,7 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam private void initComponent() { this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); - this.popup = new UICheckListPopup(values); + this.popup = new UICheckListPopup(values, supportSelectAll); this.popup.addActionListener(new PopupAction()); this.editor = createEditor(); this.arrowButton = createArrowButton(); From d5388b0040c7c991e6a48e321d22d9bcdb8c5074 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 3 Apr 2020 15:00:54 +0800 Subject: [PATCH 018/135] =?UTF-8?q?REPORT-29149=20=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6-=E5=A4=8D=E9=80=89=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=8F=AF=E4=B8=8D=E6=98=BE=E7=A4=BA=E2=80=9C?= =?UTF-8?q?=E5=85=A8=E9=80=89=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/icombocheckbox/UICheckListPopup.java | 15 ++++--- .../icombocheckbox/UICheckListPopupTest.java | 41 +++++++++++++++++++ 2 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 designer-base/src/test/java/com/fr/design/gui/icombocheckbox/UICheckListPopupTest.java diff --git a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java index 9592eb517e..66f4bfcbcb 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java @@ -192,7 +192,8 @@ public class UICheckListPopup extends UIPopupMenu { List allValue = Arrays.asList(values); for (Object value : selectedValues.keySet()) { int index = allValue.indexOf(value); - checkBoxList.get(index + 1).setSelected(selectedValues.get(value)); + index = supportSelectAll ? index + 1 : index; + checkBoxList.get(index).setSelected(selectedValues.get(value)); } } @@ -204,15 +205,19 @@ public class UICheckListPopup extends UIPopupMenu { public Object[] getSelectedValues() { List selectedValues = new ArrayList(); int selectCount = 0; - - for (int i = 1; i < checkBoxList.size(); i++) { + int startIndex = supportSelectAll ? 1 : 0; + for (int i = startIndex; i < checkBoxList.size(); i++) { if (checkBoxList.get(i).isSelected()) { - selectedValues.add(values[i - 1]); + int valueIndex = supportSelectAll ? i - 1 : i; + selectedValues.add(values[valueIndex]); selectCount++; } } + //全选半选切换 - switchSelectIcon(selectCount); + if (supportSelectAll) { + switchSelectIcon(selectCount); + } return selectedValues.toArray(new Object[selectedValues.size()]); } diff --git a/designer-base/src/test/java/com/fr/design/gui/icombocheckbox/UICheckListPopupTest.java b/designer-base/src/test/java/com/fr/design/gui/icombocheckbox/UICheckListPopupTest.java new file mode 100644 index 0000000000..33a98e078d --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/gui/icombocheckbox/UICheckListPopupTest.java @@ -0,0 +1,41 @@ +package com.fr.design.gui.icombocheckbox; + +import junit.framework.TestCase; +import org.junit.Assert; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/4/3 + */ +public class UICheckListPopupTest extends TestCase { + + @Test + public void testGetSelectedValues() { + Object[] values = new Object[]{"a", "b", "c"}; + Map map = new TreeMap<>(); + map.put("a", true); + map.put("b", false); + map.put("c", true); + List list = new ArrayList<>(); + for (Map.Entry entry : map.entrySet()) { + if (entry.getValue()) { + list.add(entry.getKey()); + } + } + Object[] selectValues = list.toArray(); + UICheckListPopup uiCheckListPopup1 = new UICheckListPopup(values); + uiCheckListPopup1.setSelectedValue(map); + Assert.assertArrayEquals(selectValues, uiCheckListPopup1.getSelectedValues()); + UICheckListPopup uiCheckListPopup2 = new UICheckListPopup(values, false); + uiCheckListPopup2.setSelectedValue(map); + Assert.assertArrayEquals(selectValues, uiCheckListPopup2.getSelectedValues()); + } + +} \ No newline at end of file From f1c2b334f1b8b512e0a0891e514910807717b35f Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 7 Apr 2020 10:52:19 +0800 Subject: [PATCH 019/135] =?UTF-8?q?REPORT-28701=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8-=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=8C=E6=9B=BF=E6=8D=A2=E4=B8=BA=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=8E=9F=E7=94=9F=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ifilechooser/FRFileChooserFactory.java | 27 ++ .../javafx/UINativeFileChooser.java | 348 ++++++++++++++++++ .../{ => swing}/AbstractFileChooser.java | 2 +- .../{ => swing}/UINativeFileChooser.java | 3 +- 4 files changed, 378 insertions(+), 2 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/gui/ifilechooser/FRFileChooserFactory.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/ifilechooser/javafx/UINativeFileChooser.java rename designer-base/src/main/java/com/fr/design/gui/ifilechooser/{ => swing}/AbstractFileChooser.java (97%) rename designer-base/src/main/java/com/fr/design/gui/ifilechooser/{ => swing}/UINativeFileChooser.java (97%) diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/FRFileChooserFactory.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/FRFileChooserFactory.java new file mode 100644 index 0000000000..0bc57dd438 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/FRFileChooserFactory.java @@ -0,0 +1,27 @@ +package com.fr.design.gui.ifilechooser; + +import com.fr.design.gui.ifilechooser.javafx.UINativeFileChooser; + +import javax.swing.*; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/4/7 + */ +public class FRFileChooserFactory { + + /** + * 默认提供原生风格 + * + * @return 文件选择器 + */ + public static JFileChooser createFileChooser() { + if (UINativeFileChooser.isAvailable()) { + return new UINativeFileChooser(); + } else { + return new JFileChooser(); + } + } + +} diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/javafx/UINativeFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/javafx/UINativeFileChooser.java new file mode 100644 index 0000000000..b1a1576af8 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/javafx/UINativeFileChooser.java @@ -0,0 +1,348 @@ +package com.fr.design.gui.ifilechooser.javafx; + +import java.awt.*; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CountDownLatch; +import javafx.application.Platform; +import javafx.embed.swing.JFXPanel; +import javafx.stage.DirectoryChooser; +import javafx.stage.FileChooser; + +import javax.swing.*; +import javax.swing.filechooser.FileFilter; +import javax.swing.filechooser.FileNameExtensionFilter; +import javax.swing.filechooser.FileSystemView; + + +/** + * 基于javafx的原生风格文件选择器 + * 解决swing原生文件选择器不支持文件过滤的问题 + * + * @author hades + * @version 10.0 + * Created by hades on 2020/4/2 + */ +public class UINativeFileChooser extends JFileChooser { + + private static final boolean FX_AVAILABLE; + private List currentFiles; + private FileChooser fileChooser; + private File currentFile; + private DirectoryChooser directoryChooser; + + static { + boolean isFx; + try { + Class.forName("javafx.stage.FileChooser"); + isFx = true; + JFXPanel jfxPanel = new JFXPanel(); + } catch (ClassNotFoundException e) { + isFx = false; + } + + FX_AVAILABLE = isFx; + } + + public static boolean isAvailable() { + return FX_AVAILABLE; + } + + public UINativeFileChooser() { + initFxFileChooser(null); + } + + public UINativeFileChooser(String currentDirectoryPath) { + super(currentDirectoryPath); + initFxFileChooser(new File(currentDirectoryPath)); + } + + public UINativeFileChooser(File currentDirectory) { + super(currentDirectory); + initFxFileChooser(currentDirectory); + } + + public UINativeFileChooser(FileSystemView fsv) { + super(fsv); + initFxFileChooser(fsv.getDefaultDirectory()); + } + + public UINativeFileChooser(File currentDirectory, FileSystemView fsv) { + super(currentDirectory, fsv); + initFxFileChooser(currentDirectory); + } + + public UINativeFileChooser(String currentDirectoryPath, FileSystemView fsv) { + super(currentDirectoryPath, fsv); + initFxFileChooser(new File(currentDirectoryPath)); + } + + @Override + public int showOpenDialog(final Component parent) throws HeadlessException { + if (!FX_AVAILABLE) { + return super.showOpenDialog(parent); + } + + final CountDownLatch latch = new CountDownLatch(1); + Platform.runLater(new Runnable() { + @Override + public void run() { + + if (parent != null) { + parent.setEnabled(false); + } + + if (DIRECTORIES_ONLY == getFileSelectionMode()) { + currentFile = directoryChooser.showDialog(null); + } else { + if (isMultiSelectionEnabled()) { + currentFiles = fileChooser.showOpenMultipleDialog(null); + } else { + currentFile = fileChooser.showOpenDialog(null); + } + } + latch.countDown(); + } + + }); + try { + latch.await(); + } catch (InterruptedException ex) { + throw new RuntimeException(ex); + } finally { + if (parent != null) { + parent.setEnabled(true); + } + } + + if (isMultiSelectionEnabled()) { + if (currentFiles != null) { + return JFileChooser.APPROVE_OPTION; + } else { + return JFileChooser.CANCEL_OPTION; + } + } else { + if (currentFile != null) { + return JFileChooser.APPROVE_OPTION; + } else { + return JFileChooser.CANCEL_OPTION; + } + } + + } + + @Override + public int showSaveDialog(final Component parent) throws HeadlessException { + if (!FX_AVAILABLE) { + return super.showSaveDialog(parent); + } + + final CountDownLatch latch = new CountDownLatch(1); + + Platform.runLater(new Runnable() { + @Override + public void run() { + + if (parent != null) { + parent.setEnabled(false); + } + + if (DIRECTORIES_ONLY == getFileSelectionMode()) { + currentFile = directoryChooser.showDialog(null); + } else { + currentFile = fileChooser.showSaveDialog(null); + } + latch.countDown(); + } + + }); + try { + latch.await(); + } catch (InterruptedException ex) { + throw new RuntimeException(ex); + } finally { + if (parent != null) { + parent.setEnabled(true); + } + } + + if (currentFile != null) { + return JFileChooser.APPROVE_OPTION; + } else { + return JFileChooser.CANCEL_OPTION; + } + } + + @Override + public int showDialog(Component parent, String approveButtonText) { + if (!FX_AVAILABLE) { + return super.showDialog(parent, approveButtonText); + } + return showOpenDialog(parent); + } + + @Override + public File[] getSelectedFiles() { + if (!FX_AVAILABLE) { + return super.getSelectedFiles(); + } + if (currentFiles == null) { + return null; + } + return currentFiles.toArray(new File[currentFiles.size()]); + } + + @Override + public File getSelectedFile() { + if (!FX_AVAILABLE) { + return super.getSelectedFile(); + } + return currentFile; + } + + @Override + public void setSelectedFiles(File[] selectedFiles) { + if (!FX_AVAILABLE) { + super.setSelectedFiles(selectedFiles); + return; + } + if (selectedFiles == null || selectedFiles.length == 0) { + currentFiles = null; + } else { + setSelectedFile(selectedFiles[0]); + currentFiles = new ArrayList<>(Arrays.asList(selectedFiles)); + } + } + + @Override + public void setSelectedFile(File file) { + if (!FX_AVAILABLE) { + super.setSelectedFile(file); + return; + } + currentFile = file; + if (file != null) { + if (file.isDirectory()) { + fileChooser.setInitialDirectory(file.getAbsoluteFile()); + + if (directoryChooser != null) { + directoryChooser.setInitialDirectory(file.getAbsoluteFile()); + } + } else if (file.isFile()) { + fileChooser.setInitialDirectory(file.getParentFile()); + fileChooser.setInitialFileName(file.getName()); + + if (directoryChooser != null) { + directoryChooser.setInitialDirectory(file.getParentFile()); + } + } + + } + } + + @Override + public void setFileSelectionMode(int mode) { + super.setFileSelectionMode(mode); + if (!FX_AVAILABLE) { + return; + } + if (mode == DIRECTORIES_ONLY) { + if (directoryChooser == null) { + directoryChooser = new DirectoryChooser(); + } + setSelectedFile(currentFile); + setDialogTitle(getDialogTitle()); + } + } + + @Override + public void setDialogTitle(String dialogTitle) { + if (!FX_AVAILABLE) { + super.setDialogTitle(dialogTitle); + return; + } + fileChooser.setTitle(dialogTitle); + if (directoryChooser != null) { + directoryChooser.setTitle(dialogTitle); + } + } + + @Override + public String getDialogTitle() { + if (!FX_AVAILABLE) { + return super.getDialogTitle(); + } + return fileChooser.getTitle(); + } + + @Override + public void changeToParentDirectory() { + if (!FX_AVAILABLE) { + super.changeToParentDirectory(); + return; + } + File parentDir = fileChooser.getInitialDirectory().getParentFile(); + if (parentDir.isDirectory()) { + fileChooser.setInitialDirectory(parentDir); + if (directoryChooser != null) { + directoryChooser.setInitialDirectory(parentDir); + } + } + } + + @Override + public void addChoosableFileFilter(FileFilter filter) { + super.addChoosableFileFilter(filter); + if (!FX_AVAILABLE || filter == null) { + return; + } + if (filter.getClass().equals(FileNameExtensionFilter.class)) { + FileNameExtensionFilter f = (FileNameExtensionFilter) filter; + + List ext = new ArrayList<>(); + for (String extension : f.getExtensions()) { + ext.add(extension.replaceAll("^\\*?\\.?(.*)$", "*.$1")); + } + fileChooser.getExtensionFilters() + .add(new FileChooser.ExtensionFilter(f.getDescription(), ext)); + } + } + + @Override + public void setAcceptAllFileFilterUsed(boolean bool) { + boolean differs = isAcceptAllFileFilterUsed() ^ bool; + super.setAcceptAllFileFilterUsed(bool); + if (!FX_AVAILABLE) { + return; + } + if (!differs) { + return; + } + if (bool) { + fileChooser.getExtensionFilters() + .add(new FileChooser.ExtensionFilter("All files", "*.*")); + } else { + for (Iterator it + = fileChooser.getExtensionFilters().iterator(); it.hasNext();) { + FileChooser.ExtensionFilter filter = it.next(); + if (filter.getExtensions().size() == 1 + && filter.getExtensions().contains("*.*")) { + it.remove(); + } + } + } + + } + + private void initFxFileChooser(File currentFile) { + if (FX_AVAILABLE) { + fileChooser = new FileChooser(); + this.currentFile = currentFile; + setSelectedFile(currentFile); + } + } + +} \ No newline at end of file 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/swing/AbstractFileChooser.java similarity index 97% rename from designer-base/src/main/java/com/fr/design/gui/ifilechooser/AbstractFileChooser.java rename to designer-base/src/main/java/com/fr/design/gui/ifilechooser/swing/AbstractFileChooser.java index ca460aa0f7..682f60e35c 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/AbstractFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/swing/AbstractFileChooser.java @@ -1,4 +1,4 @@ -package com.fr.design.gui.ifilechooser; +package com.fr.design.gui.ifilechooser.swing; import javax.swing.filechooser.FileFilter; import java.awt.*; 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/swing/UINativeFileChooser.java similarity index 97% rename from designer-base/src/main/java/com/fr/design/gui/ifilechooser/UINativeFileChooser.java rename to designer-base/src/main/java/com/fr/design/gui/ifilechooser/swing/UINativeFileChooser.java index 9c956372d0..dd2394f793 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/swing/UINativeFileChooser.java @@ -1,5 +1,6 @@ -package com.fr.design.gui.ifilechooser; +package com.fr.design.gui.ifilechooser.swing; +import com.fr.design.gui.ifilechooser.swing.AbstractFileChooser; import com.fr.design.mainframe.DesignerContext; import com.fr.stable.os.OperatingSystem; From 2f5f07cf2a960a8b51ce54e25cfe7eb5791b9622 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 7 Apr 2020 10:53:17 +0800 Subject: [PATCH 020/135] =?UTF-8?q?REPORT-28701=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8-=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=8C=E6=9B=BF=E6=8D=A2=E4=B8=BA=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=8E=9F=E7=94=9F=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/FormWidgetDetailPane.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 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 ecb3faa706..480a4b3db0 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,6 +5,7 @@ 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.FRFileChooserFactory; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.widget.FRWidgetFactory; @@ -16,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; @@ -333,7 +323,7 @@ public class FormWidgetDetailPane extends FormDockView{ new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - JFileChooser fileChooser = new JFileChooser(); + JFileChooser fileChooser = FRFileChooserFactory.createFileChooser(); 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")); From b68c0a25fa7295b37129c8f2d97061f620e94464 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 7 Apr 2020 14:08:59 +0800 Subject: [PATCH 021/135] fix --- .../{swing => }/AbstractFileChooser.java | 11 +- .../ifilechooser/FRFileChooserFactory.java | 27 -- .../{swing => }/UINativeFileChooser.java | 9 +- .../javafx/UINativeFileChooser.java | 348 ------------------ 4 files changed, 17 insertions(+), 378 deletions(-) rename designer-base/src/main/java/com/fr/design/gui/ifilechooser/{swing => }/AbstractFileChooser.java (87%) delete mode 100644 designer-base/src/main/java/com/fr/design/gui/ifilechooser/FRFileChooserFactory.java rename designer-base/src/main/java/com/fr/design/gui/ifilechooser/{swing => }/UINativeFileChooser.java (95%) delete mode 100644 designer-base/src/main/java/com/fr/design/gui/ifilechooser/javafx/UINativeFileChooser.java diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/swing/AbstractFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/AbstractFileChooser.java similarity index 87% rename from designer-base/src/main/java/com/fr/design/gui/ifilechooser/swing/AbstractFileChooser.java rename to designer-base/src/main/java/com/fr/design/gui/ifilechooser/AbstractFileChooser.java index 682f60e35c..ee61fd81f5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/swing/AbstractFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/AbstractFileChooser.java @@ -1,4 +1,4 @@ -package com.fr.design.gui.ifilechooser.swing; +package com.fr.design.gui.ifilechooser; import javax.swing.filechooser.FileFilter; import java.awt.*; @@ -91,4 +91,13 @@ public abstract class AbstractFileChooser { * */ 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/FRFileChooserFactory.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/FRFileChooserFactory.java deleted file mode 100644 index 0bc57dd438..0000000000 --- a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/FRFileChooserFactory.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.fr.design.gui.ifilechooser; - -import com.fr.design.gui.ifilechooser.javafx.UINativeFileChooser; - -import javax.swing.*; - -/** - * @author hades - * @version 10.0 - * Created by hades on 2020/4/7 - */ -public class FRFileChooserFactory { - - /** - * 默认提供原生风格 - * - * @return 文件选择器 - */ - public static JFileChooser createFileChooser() { - if (UINativeFileChooser.isAvailable()) { - return new UINativeFileChooser(); - } else { - return new JFileChooser(); - } - } - -} diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/swing/UINativeFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/UINativeFileChooser.java similarity index 95% rename from designer-base/src/main/java/com/fr/design/gui/ifilechooser/swing/UINativeFileChooser.java rename to designer-base/src/main/java/com/fr/design/gui/ifilechooser/UINativeFileChooser.java index dd2394f793..c1418f834b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/swing/UINativeFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/UINativeFileChooser.java @@ -1,6 +1,6 @@ -package com.fr.design.gui.ifilechooser.swing; +package com.fr.design.gui.ifilechooser; -import com.fr.design.gui.ifilechooser.swing.AbstractFileChooser; +import com.fr.design.gui.ifilechooser.AbstractFileChooser; import com.fr.design.mainframe.DesignerContext; import com.fr.stable.os.OperatingSystem; @@ -129,6 +129,11 @@ public class UINativeFileChooser extends AbstractFileChooser { return fileDialog.getFile() == null ? JFileChooser.CANCEL_OPTION : JFileChooser.APPROVE_OPTION; } + @Override + public void setExtensionFilter(String file) { + fileDialog.setFile(file); + } + /** * 确认本地文件选择器是否支持选择模式 * @param selectionMode 选择模式 diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/javafx/UINativeFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/javafx/UINativeFileChooser.java deleted file mode 100644 index b1a1576af8..0000000000 --- a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/javafx/UINativeFileChooser.java +++ /dev/null @@ -1,348 +0,0 @@ -package com.fr.design.gui.ifilechooser.javafx; - -import java.awt.*; -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.CountDownLatch; -import javafx.application.Platform; -import javafx.embed.swing.JFXPanel; -import javafx.stage.DirectoryChooser; -import javafx.stage.FileChooser; - -import javax.swing.*; -import javax.swing.filechooser.FileFilter; -import javax.swing.filechooser.FileNameExtensionFilter; -import javax.swing.filechooser.FileSystemView; - - -/** - * 基于javafx的原生风格文件选择器 - * 解决swing原生文件选择器不支持文件过滤的问题 - * - * @author hades - * @version 10.0 - * Created by hades on 2020/4/2 - */ -public class UINativeFileChooser extends JFileChooser { - - private static final boolean FX_AVAILABLE; - private List currentFiles; - private FileChooser fileChooser; - private File currentFile; - private DirectoryChooser directoryChooser; - - static { - boolean isFx; - try { - Class.forName("javafx.stage.FileChooser"); - isFx = true; - JFXPanel jfxPanel = new JFXPanel(); - } catch (ClassNotFoundException e) { - isFx = false; - } - - FX_AVAILABLE = isFx; - } - - public static boolean isAvailable() { - return FX_AVAILABLE; - } - - public UINativeFileChooser() { - initFxFileChooser(null); - } - - public UINativeFileChooser(String currentDirectoryPath) { - super(currentDirectoryPath); - initFxFileChooser(new File(currentDirectoryPath)); - } - - public UINativeFileChooser(File currentDirectory) { - super(currentDirectory); - initFxFileChooser(currentDirectory); - } - - public UINativeFileChooser(FileSystemView fsv) { - super(fsv); - initFxFileChooser(fsv.getDefaultDirectory()); - } - - public UINativeFileChooser(File currentDirectory, FileSystemView fsv) { - super(currentDirectory, fsv); - initFxFileChooser(currentDirectory); - } - - public UINativeFileChooser(String currentDirectoryPath, FileSystemView fsv) { - super(currentDirectoryPath, fsv); - initFxFileChooser(new File(currentDirectoryPath)); - } - - @Override - public int showOpenDialog(final Component parent) throws HeadlessException { - if (!FX_AVAILABLE) { - return super.showOpenDialog(parent); - } - - final CountDownLatch latch = new CountDownLatch(1); - Platform.runLater(new Runnable() { - @Override - public void run() { - - if (parent != null) { - parent.setEnabled(false); - } - - if (DIRECTORIES_ONLY == getFileSelectionMode()) { - currentFile = directoryChooser.showDialog(null); - } else { - if (isMultiSelectionEnabled()) { - currentFiles = fileChooser.showOpenMultipleDialog(null); - } else { - currentFile = fileChooser.showOpenDialog(null); - } - } - latch.countDown(); - } - - }); - try { - latch.await(); - } catch (InterruptedException ex) { - throw new RuntimeException(ex); - } finally { - if (parent != null) { - parent.setEnabled(true); - } - } - - if (isMultiSelectionEnabled()) { - if (currentFiles != null) { - return JFileChooser.APPROVE_OPTION; - } else { - return JFileChooser.CANCEL_OPTION; - } - } else { - if (currentFile != null) { - return JFileChooser.APPROVE_OPTION; - } else { - return JFileChooser.CANCEL_OPTION; - } - } - - } - - @Override - public int showSaveDialog(final Component parent) throws HeadlessException { - if (!FX_AVAILABLE) { - return super.showSaveDialog(parent); - } - - final CountDownLatch latch = new CountDownLatch(1); - - Platform.runLater(new Runnable() { - @Override - public void run() { - - if (parent != null) { - parent.setEnabled(false); - } - - if (DIRECTORIES_ONLY == getFileSelectionMode()) { - currentFile = directoryChooser.showDialog(null); - } else { - currentFile = fileChooser.showSaveDialog(null); - } - latch.countDown(); - } - - }); - try { - latch.await(); - } catch (InterruptedException ex) { - throw new RuntimeException(ex); - } finally { - if (parent != null) { - parent.setEnabled(true); - } - } - - if (currentFile != null) { - return JFileChooser.APPROVE_OPTION; - } else { - return JFileChooser.CANCEL_OPTION; - } - } - - @Override - public int showDialog(Component parent, String approveButtonText) { - if (!FX_AVAILABLE) { - return super.showDialog(parent, approveButtonText); - } - return showOpenDialog(parent); - } - - @Override - public File[] getSelectedFiles() { - if (!FX_AVAILABLE) { - return super.getSelectedFiles(); - } - if (currentFiles == null) { - return null; - } - return currentFiles.toArray(new File[currentFiles.size()]); - } - - @Override - public File getSelectedFile() { - if (!FX_AVAILABLE) { - return super.getSelectedFile(); - } - return currentFile; - } - - @Override - public void setSelectedFiles(File[] selectedFiles) { - if (!FX_AVAILABLE) { - super.setSelectedFiles(selectedFiles); - return; - } - if (selectedFiles == null || selectedFiles.length == 0) { - currentFiles = null; - } else { - setSelectedFile(selectedFiles[0]); - currentFiles = new ArrayList<>(Arrays.asList(selectedFiles)); - } - } - - @Override - public void setSelectedFile(File file) { - if (!FX_AVAILABLE) { - super.setSelectedFile(file); - return; - } - currentFile = file; - if (file != null) { - if (file.isDirectory()) { - fileChooser.setInitialDirectory(file.getAbsoluteFile()); - - if (directoryChooser != null) { - directoryChooser.setInitialDirectory(file.getAbsoluteFile()); - } - } else if (file.isFile()) { - fileChooser.setInitialDirectory(file.getParentFile()); - fileChooser.setInitialFileName(file.getName()); - - if (directoryChooser != null) { - directoryChooser.setInitialDirectory(file.getParentFile()); - } - } - - } - } - - @Override - public void setFileSelectionMode(int mode) { - super.setFileSelectionMode(mode); - if (!FX_AVAILABLE) { - return; - } - if (mode == DIRECTORIES_ONLY) { - if (directoryChooser == null) { - directoryChooser = new DirectoryChooser(); - } - setSelectedFile(currentFile); - setDialogTitle(getDialogTitle()); - } - } - - @Override - public void setDialogTitle(String dialogTitle) { - if (!FX_AVAILABLE) { - super.setDialogTitle(dialogTitle); - return; - } - fileChooser.setTitle(dialogTitle); - if (directoryChooser != null) { - directoryChooser.setTitle(dialogTitle); - } - } - - @Override - public String getDialogTitle() { - if (!FX_AVAILABLE) { - return super.getDialogTitle(); - } - return fileChooser.getTitle(); - } - - @Override - public void changeToParentDirectory() { - if (!FX_AVAILABLE) { - super.changeToParentDirectory(); - return; - } - File parentDir = fileChooser.getInitialDirectory().getParentFile(); - if (parentDir.isDirectory()) { - fileChooser.setInitialDirectory(parentDir); - if (directoryChooser != null) { - directoryChooser.setInitialDirectory(parentDir); - } - } - } - - @Override - public void addChoosableFileFilter(FileFilter filter) { - super.addChoosableFileFilter(filter); - if (!FX_AVAILABLE || filter == null) { - return; - } - if (filter.getClass().equals(FileNameExtensionFilter.class)) { - FileNameExtensionFilter f = (FileNameExtensionFilter) filter; - - List ext = new ArrayList<>(); - for (String extension : f.getExtensions()) { - ext.add(extension.replaceAll("^\\*?\\.?(.*)$", "*.$1")); - } - fileChooser.getExtensionFilters() - .add(new FileChooser.ExtensionFilter(f.getDescription(), ext)); - } - } - - @Override - public void setAcceptAllFileFilterUsed(boolean bool) { - boolean differs = isAcceptAllFileFilterUsed() ^ bool; - super.setAcceptAllFileFilterUsed(bool); - if (!FX_AVAILABLE) { - return; - } - if (!differs) { - return; - } - if (bool) { - fileChooser.getExtensionFilters() - .add(new FileChooser.ExtensionFilter("All files", "*.*")); - } else { - for (Iterator it - = fileChooser.getExtensionFilters().iterator(); it.hasNext();) { - FileChooser.ExtensionFilter filter = it.next(); - if (filter.getExtensions().size() == 1 - && filter.getExtensions().contains("*.*")) { - it.remove(); - } - } - } - - } - - private void initFxFileChooser(File currentFile) { - if (FX_AVAILABLE) { - fileChooser = new FileChooser(); - this.currentFile = currentFile; - setSelectedFile(currentFile); - } - } - -} \ No newline at end of file From 748c2b8e91971d9c7bd028a3a47cb281a87e637c Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 7 Apr 2020 14:10:14 +0800 Subject: [PATCH 022/135] fix --- .../com/fr/design/mainframe/FormWidgetDetailPane.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 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 480a4b3db0..043a11d406 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,7 +5,7 @@ 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.FRFileChooserFactory; +import com.fr.design.gui.ifilechooser.UINativeFileChooser; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.widget.FRWidgetFactory; @@ -323,10 +323,13 @@ public class FormWidgetDetailPane extends FormDockView{ new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - JFileChooser fileChooser = FRFileChooserFactory.createFileChooser(); + UINativeFileChooser fileChooser = new UINativeFileChooser(); 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")); + 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 chosenFile = fileChooser.getSelectedFile(); installFromDiskZipFile(chosenFile); From bd4c7a6f6bc24bfa8a7708862dd1b50269051d81 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 12 May 2020 23:26:22 -0700 Subject: [PATCH 023/135] =?UTF-8?q?REPORT-28701=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E7=BB=84=E4=BB=B6=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/FormWidgetDetailPane.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 043a11d406..3273e89dca 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 @@ -325,14 +325,17 @@ public class FormWidgetDetailPane extends FormDockView{ public void actionPerformed(ActionEvent e) { 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 chosenFile = fileChooser.getSelectedFile(); - installFromDiskZipFile(chosenFile); + final File[] chosenFiles = fileChooser.getSelectedFiles(); + for (File file : chosenFiles) { + installFromDiskZipFile(file); + } } } } From 2e315d7ce2a1ee7cb8bead38c00c9891f6e9efe4 Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 13 May 2020 15:40:32 +0800 Subject: [PATCH 024/135] =?UTF-8?q?REPORT-28950=20=E6=8A=A5=E8=A1=A8featur?= =?UTF-8?q?e=E5=B7=A5=E7=A8=8B=E5=88=87=E6=8D=A2=E4=B8=BAgradle=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + build.gradle | 77 +++++++++++++++ designer-chart/build.gradle | 3 + designer-form/build.gradle | 3 + designer-realize/build.gradle | 4 + globalConfigHook.gradle | 29 ++++++ gradlew | 172 ++++++++++++++++++++++++++++++++++ gradlew.bat | 84 +++++++++++++++++ settings.gradle | 12 +++ 9 files changed, 386 insertions(+) create mode 100644 build.gradle create mode 100644 designer-chart/build.gradle create mode 100644 designer-form/build.gradle create mode 100644 designer-realize/build.gradle create mode 100644 globalConfigHook.gradle create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore index 417bed08c8..4e6fdbfbd4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ .DS_Store .classpath .project +.gradle target/ +*/build diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000000..159d799c4f --- /dev/null +++ b/build.gradle @@ -0,0 +1,77 @@ +import org.gradle.plugins.ide.idea.model.IdeaLanguageLevel + +plugins { + id 'java' + id 'java-library' + id 'com.fr.common' version '1.0-SNAPSHOT' +} + +// 模块参数 +ext { + frVersion = "10.0-FEATURE-SNAPSHOT" + outputPath = "build" + ignoreTestFailureSetting = true + languageLevelSetting = 1.8 +} + +apply from: 'globalConfigHook.gradle' + +dependencies { + api project(':designer-base') + api project(':designer-chart') + api project(':designer-form') + api project(':designer-realize') +} + +allprojects { + apply plugin: 'java' + apply plugin: 'java-library' + apply plugin: 'idea' + + group 'com.fr.design' + version frVersion + sourceCompatibility = languageLevelSetting + targetCompatibility = languageLevelSetting + + tasks.withType(JavaCompile) { + options.encoding = "UTF-8" + } + + repositories { + mavenLocal() + } + + idea { + module { + inheritOutputDirs = false + outputDir = file(outputPath +"/classes") + testOutputDir = file(outputPath +"/test-classes") + languageLevel = new IdeaLanguageLevel(sourceCompatibility) + targetBytecodeVersion = targetCompatibility + } + } + + dependencies { + implementation 'com.fr.third:jxbrowser:7.5' + implementation 'com.fr.third:jxbrowser-swing:7.5' + implementation 'com.fr.third:jxbrowser-mac:7.5' + implementation 'com.fr.third:jxbrowser-win64:7.5' + implementation 'com.fr.third.server:servlet-api:3.0' + implementation 'org.swingexplorer:swexpl:2.0.1' + implementation 'org.swingexplorer:swag:1.0' + implementation 'net.java.dev.jna:jna:5.4.0' + implementation 'org.apache.tomcat:tomcat-catalina:8.5.32' + implementation 'io.socket:socket.io-client:0.7.0' + implementation 'com.fr.third:fine-third:' + frVersion + implementation 'com.fr.core:fine-core:' + frVersion + implementation 'com.fr.activator:fine-activator:' + frVersion + implementation 'com.fr.datasource:fine-datasource:' + frVersion + implementation 'com.fr.decision:fine-decision:' + frVersion + implementation 'com.fr.schedule:fine-schedule:' + frVersion + implementation 'com.fr.report:fine-report-engine:' + frVersion + testImplementation 'org.easymock:easymock:3.5.1' + testImplementation 'org.powermock:powermock-module-junit4:1.7.1' + testImplementation 'org.powermock:powermock-api-easymock:1.7.1' + testImplementation 'junit:junit:4.12' + } +} diff --git a/designer-chart/build.gradle b/designer-chart/build.gradle new file mode 100644 index 0000000000..e59f9ef2f8 --- /dev/null +++ b/designer-chart/build.gradle @@ -0,0 +1,3 @@ +dependencies { + compile project(':designer-base') +} diff --git a/designer-form/build.gradle b/designer-form/build.gradle new file mode 100644 index 0000000000..e59f9ef2f8 --- /dev/null +++ b/designer-form/build.gradle @@ -0,0 +1,3 @@ +dependencies { + compile project(':designer-base') +} diff --git a/designer-realize/build.gradle b/designer-realize/build.gradle new file mode 100644 index 0000000000..ffb6823e88 --- /dev/null +++ b/designer-realize/build.gradle @@ -0,0 +1,4 @@ +dependencies { + compile project(':designer-form') + compile project(':designer-chart') +} diff --git a/globalConfigHook.gradle b/globalConfigHook.gradle new file mode 100644 index 0000000000..c625d05b1d --- /dev/null +++ b/globalConfigHook.gradle @@ -0,0 +1,29 @@ +def getRootGradle() { + def currentGradle = gradle + while (currentGradle.parent) { + currentGradle = currentGradle.parent + } + return currentGradle +} + +def findHookIncludedBuild() { + def rootGradle = getRootGradle() + def hookProject = rootGradle.getIncludedBuilds() + .find({ build -> build.name == 'hook' }) + return hookProject +} + +def findGlobalConfig() { + def hookProject = findHookIncludedBuild() + if (hookProject) { + def path = hookProject.projectDir.parent + '/globalConfig.gradle' + if (file(path).exists()) { + return path + } + } +} + +def globalConfigPath = findGlobalConfig() +if (globalConfigPath) { + apply from: globalConfigPath +} \ No newline at end of file diff --git a/gradlew b/gradlew new file mode 100644 index 0000000000..af6708ff22 --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000000..6d57edc706 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000000..077d17597b --- /dev/null +++ b/settings.gradle @@ -0,0 +1,12 @@ +pluginManagement { + repositories { + maven { + url 'http://mvn.finedevelop.com/repository/maven-public/' + } + gradlePluginPortal() + } +} + +rootProject.name = 'design' + +include 'designer-base', 'designer-chart', 'designer-form', 'designer-realize' From 6f63969355a4415aeafbe83b7cd20da7b856eba3 Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 13 May 2020 16:45:16 +0800 Subject: [PATCH 025/135] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E7=BB=9F=E4=B8=80wraper=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 58695 bytes gradle/wrapper/gradle-wrapper.properties | 6 ++++++ 2 files changed, 6 insertions(+) create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..f3d88b1c2faf2fc91d853cd5d4242b5547257070 GIT binary patch literal 58695 zcma&OV~}Oh(k5J8>Mq;vvTfV8ZQE5{wr$(iDciPf+tV}m-if*I+;_h3N1nY;M6TF7 zBc7A_WUgl&IY|&uNFbnJzkq;%`2QLZ5b*!{1OkHidzBVe;-?mu5upVElKVGD>pC88 zzP}E3wRHBgaO?2nzdZ5pL;m-xf&RU>buj(E-s=DK zf%>P9se`_emGS@673tqyT^;o8?2H}$uO&&u^TlmHfPgSSfPiTK^AZ7DTPH`Szw4#- z&21E&^c|dx9f;^@46XDX9itS+ZRYuqx#wG*>5Bs&gxwSQbj8grds#xkl;ikls1%(2 zR-`Tn(#9}E_aQ!zu~_iyc0gXp2I`O?erY?=JK{M`Ew(*RP3vy^0=b2E0^PSZgm(P6 z+U<&w#)I=>0z=IC4 zh4Q;eq94OGttUh7AGWu7m){;^Qk*5F6eTn+Ky$x>9Ntl~n0KDzFmB0lBI6?o!({iX zQt=|-9TPjAmCP!eA{r|^71cIvI(1#UCSzPw(L2>8OG0O_RQeJ{{MG)tLQ*aSX{AMS zP-;|nj+9{J&c9UV5Ww|#OE*Ah6?9WaR?B04N|#`m0G-Iqwd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1 zBC;}%YZ2!4I>*=sR)O~jBPx6sxmIEBnq)s-fHz_y0z8-gPl2Us4BiBXNR5CIF!YR@ zb9B305SilU*@4|+ x6JBtc8JSt5M0pkooaq!^FqtuD_KdXXTo>Mw54>`rP&>h&58!3a6l6r9{sG7g--!SK literal 0 HcmV?d00001 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..e0c5e220cc --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 22 15:17:12 CST 2020 +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-all.zip +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME From 82fede2fe208a04c1354d0cd33197dc52f2fa8f9 Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 13 May 2020 18:14:30 +0800 Subject: [PATCH 026/135] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E5=8E=BB=E5=88=86=E6=94=AF=E5=90=8D=E7=A1=AC=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 159d799c4f..ebec6e7705 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ plugins { // 模块参数 ext { - frVersion = "10.0-FEATURE-SNAPSHOT" + frVersion = "" outputPath = "build" ignoreTestFailureSetting = true languageLevelSetting = 1.8 @@ -16,6 +16,10 @@ ext { apply from: 'globalConfigHook.gradle' +if(versions.frVersion){ + frVersion = versions.frVersion +} + dependencies { api project(':designer-base') api project(':designer-chart') From 1e5f8d36f1401cee6a1401e251d9ed89b8201142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 22 May 2020 16:20:26 +0800 Subject: [PATCH 027/135] =?UTF-8?q?CHART-14022=20=20=E7=88=B6=E7=B1=BB?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E6=94=B9=E5=8F=98=EF=BC=8C=E5=AD=90=E7=B1=BB?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/van/chart/designer/PlotFactory.java | 4 ++-- .../designer/component/format/FormatPaneWithNormalType.java | 2 +- .../designer/component/format/FormatPaneWithOutFont.java | 2 +- .../van/chart/designer/style/axis/VanChartBaseAxisPane.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java index d3e1adbb90..e92afa38f2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java @@ -63,12 +63,12 @@ import javax.swing.BorderFactory; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; -import java.awt.Component; import java.lang.reflect.Constructor; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; +import java.awt.Component; /** * Created by Mitisky on 16/3/1. @@ -339,7 +339,7 @@ public class PlotFactory { public static FormatPane createAutoFormatPane() { FormatPane formatPane = new FormatPane() { - protected Component[][] getComponent(JPanel fontPane, JPanel centerPane, JPanel typePane) { + protected Component[][] getComponent(JPanel fontPane, JPanel centerPane, JPanel typePane, JPanel optionPane) { typePane.setBorder(BorderFactory.createEmptyBorder()); return new Component[][]{ new Component[]{typePane, null}, diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithNormalType.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithNormalType.java index 728bc1b1cd..959194ad1e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithNormalType.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithNormalType.java @@ -23,7 +23,7 @@ public class FormatPaneWithNormalType extends FormatPaneWithOutFont { setForDataSheet(); } - 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, centerPane}, }; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithOutFont.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithOutFont.java index 7275ad0748..f225156d86 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithOutFont.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithOutFont.java @@ -28,7 +28,7 @@ public class FormatPaneWithOutFont extends FormatPane { return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); } - protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { + protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane, JPanel optionPane) { typePane.setBorder(BorderFactory.createEmptyBorder()); return new Component[][]{ new Component[]{null, null}, diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java index 064a7156bd..1858f0a408 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -445,7 +445,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected FormatPane createFormatPane(){ return new FormatPane(){ - protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { + protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane, JPanel optionPane) { typePane.setBorder(BorderFactory.createEmptyBorder()); return new Component[][]{ new Component[]{typePane,null}, From 1c96cd163aa8b06b73503d72e23dd719fc7514e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 22 May 2020 16:28:02 +0800 Subject: [PATCH 028/135] =?UTF-8?q?=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/van/chart/designer/PlotFactory.java | 2 +- .../designer/component/format/FormatPaneWithNormalType.java | 2 +- .../chart/designer/component/format/FormatPaneWithOutFont.java | 2 +- .../fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java index e92afa38f2..5b5547d069 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java @@ -339,7 +339,7 @@ public class PlotFactory { public static FormatPane createAutoFormatPane() { FormatPane formatPane = new FormatPane() { - protected Component[][] getComponent(JPanel fontPane, JPanel centerPane, JPanel typePane, JPanel optionPane) { + protected Component[][] getComponent(JPanel fontPane, JPanel centerPane, JPanel typePane) { typePane.setBorder(BorderFactory.createEmptyBorder()); return new Component[][]{ new Component[]{typePane, null}, diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithNormalType.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithNormalType.java index 959194ad1e..728bc1b1cd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithNormalType.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithNormalType.java @@ -23,7 +23,7 @@ public class FormatPaneWithNormalType extends FormatPaneWithOutFont { setForDataSheet(); } - 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, centerPane}, }; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithOutFont.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithOutFont.java index f225156d86..7275ad0748 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithOutFont.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithOutFont.java @@ -28,7 +28,7 @@ public class FormatPaneWithOutFont extends FormatPane { return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); } - protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane, JPanel optionPane) { + protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { typePane.setBorder(BorderFactory.createEmptyBorder()); return new Component[][]{ new Component[]{null, null}, diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java index 1858f0a408..064a7156bd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -445,7 +445,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected FormatPane createFormatPane(){ return new FormatPane(){ - protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane, JPanel optionPane) { + protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { typePane.setBorder(BorderFactory.createEmptyBorder()); return new Component[][]{ new Component[]{typePane,null}, From f139a0b8d60b0c7daacc1912e862bdf28af95314 Mon Sep 17 00:00:00 2001 From: Harrison Date: Fri, 22 May 2020 16:58:03 +0800 Subject: [PATCH 029/135] =?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 622e9a59cb..394dfca1e2 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 18483728b00d75721a91fa7630791405b611daf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 22 May 2020 17:24:06 +0800 Subject: [PATCH 030/135] =?UTF-8?q?=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/van/chart/designer/PlotFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java index 5b5547d069..d3e1adbb90 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java @@ -63,12 +63,12 @@ import javax.swing.BorderFactory; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; +import java.awt.Component; import java.lang.reflect.Constructor; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; -import java.awt.Component; /** * Created by Mitisky on 16/3/1. 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 031/135] =?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 88d2625d02..661b4fa5c8 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 032/135] =?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 597f733f1e..c1418f834b 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 033/135] =?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 394dfca1e2..cf8f4f74d4 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 034/135] =?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 2ec3f6c7ee..f3c5735f01 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 035/135] =?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 9ade762500..4829545468 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 036/135] =?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 4f610c060b..8dd6f8aa28 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 c192d054c6..ed6b7a6d8f 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 037/135] =?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 d14780054a..433f7c4f70 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 038/135] =?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 06cb19d0ae..0a6e692f49 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 039/135] =?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 311ea4cb76..3273e89dca 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 040/135] =?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 e2112f4f37..e464d7e052 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 Date: Mon, 25 May 2020 16:00:08 +0800 Subject: [PATCH 041/135] =?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, 49 insertions(+), 25 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 e464d7e052..e2112f4f37 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.ExtraDesignClassManager; import com.fr.design.actions.FormMobileAttrAction; @@ -13,6 +14,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; @@ -29,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; @@ -125,60 +128,63 @@ public class JForm extends JTemplate 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() { - + 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面板的代码 @@ -203,12 +209,14 @@ public class JForm extends JTemplate implements BaseJForm getProcessInfo() { + //这边需要判空,图表的埋点信息收集时可能没有初始化processInfo if (processInfo == null) { processInfo = new JFormProcessInfo(template); } return processInfo; } + public FormECCompositeProvider getReportComposite() { return this.reportComposite; } @@ -559,10 +567,19 @@ public class JForm extends JTemplate implements BaseJForm implements BaseJForm implements BaseJForm implements BaseJForm implements BaseJForm implements BaseJForm Date: Mon, 25 May 2020 16:00:45 +0800 Subject: [PATCH 042/135] =?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, 13 insertions(+), 2 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 8dd6f8aa28..4f610c060b 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 ed6b7a6d8f..c192d054c6 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) { From 55bfb305d9f2aacf8b795d8b190fbab773f63f52 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 16:01:47 +0800 Subject: [PATCH 043/135] =?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, 57 insertions(+), 1 deletion(-) 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 f3c5735f01..2ec3f6c7ee 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,6 +9,11 @@ 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 @@ -37,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 @@ -47,6 +54,27 @@ 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() { @@ -59,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(); @@ -141,4 +185,16 @@ 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 b3ab7ae77341b3978374654dde06a2a47d2edb91 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 16:02:28 +0800 Subject: [PATCH 044/135] =?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, 31 insertions(+), 7 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 433f7c4f70..d14780054a 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,7 +66,8 @@ import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.StringUtils; -import org.jetbrains.annotations.NotNull; +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; @@ -286,7 +310,7 @@ public class XCreatorUtils { * @param creator 组件 * @return 返回顶层容器 */ - public static XLayoutContainer getHotspotContainer(@NotNull XCreator creator) { + public static XLayoutContainer getHotspotContainer(@Nonnull XCreator creator) { if (creator.isDedicateContainer()) { return (XLayoutContainer) creator.getParent(); } From 492375bbb95c7631e5b6ff09cb2384c0af86e487 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 16:03:01 +0800 Subject: [PATCH 045/135] =?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, 8 insertions(+), 1 deletion(-) 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 4829545468..9ade762500 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() { From f28611c3e86876c594520cba59db30cadb16105c Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 16:03:39 +0800 Subject: [PATCH 046/135] =?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, 38 insertions(+), 14 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 3273e89dca..311ea4cb76 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,6 +8,7 @@ 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; @@ -17,9 +18,20 @@ import com.fr.share.ShareConstants; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; -import javax.swing.*; +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.*; +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; @@ -323,18 +335,30 @@ public class FormWidgetDetailPane extends FormDockView{ new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - 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); + 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 c69f90e782691f6a780d6b0808c6cb46094e4282 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 16:04:21 +0800 Subject: [PATCH 047/135] =?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, 15 insertions(+), 4 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 0a6e692f49..06cb19d0ae 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,6 +1,7 @@ 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; @@ -27,9 +28,12 @@ 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; @@ -93,7 +97,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()) { @@ -284,9 +288,16 @@ public class FormCreatorDropTarget extends DropTarget { } private void dealChartBuryingPoint(Widget widget) { - if (widget instanceof ChartEditor) { - ChartCollection chartCollection = (ChartCollection)((ChartEditor) widget).getChartCollection(); - ChartInfoCollector.getInstance().collection(chartCollection.getSelectedChartProvider(ChartProvider.class), null); + 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); + } } } } From 1823b7487d49ef4eb090083c478365509f183c12 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 16:04:53 +0800 Subject: [PATCH 048/135] =?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, 59 insertions(+), 42 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 cf8f4f74d4..394dfca1e2 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; @@ -130,13 +131,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) { @@ -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,18 +171,22 @@ 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); } - + private void removePropertyItem(PropertyItemPaneProvider provider) { - + propertyItemMap.remove(provider.key()); String replaceKey = provider.replaceKey(); if (replaceKey == null) { @@ -186,18 +197,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 +223,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { button.addActionListener(buttonListener); } propertyItemMap.put(key, propertyItem); - + String replaceKey = provider.replaceKey(); if (replaceKey == null) { return; @@ -221,11 +232,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 +251,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}); // 条件属性 @@ -474,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) { + public void replaceKeyPane(final String key, final JComponent pane) { - propertyItemMap.get(key).replaceContentPane(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); } @@ -653,8 +670,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 +722,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 +737,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 +827,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } private String getBtnIconUrl() { - + return getIconBaseDir() + btnIconName + iconSuffix; } From e4679bbb8ea55a4f7e866b7cd39e8fa91a2eb793 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 16:05:24 +0800 Subject: [PATCH 049/135] =?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, 42 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 661b4fa5c8..88d2625d02 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -8,12 +8,14 @@ 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; @@ -21,6 +23,7 @@ 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; @@ -55,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; @@ -83,6 +87,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; @@ -199,6 +207,9 @@ 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); } @@ -347,6 +358,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } catch (IOException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + XmlHandler.Self.handle(e); } finally { if (null != fileWriter) { try { @@ -561,6 +573,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(); } @@ -1403,6 +1419,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { /** * 对国际化进行校验 * 非简繁英日韩的默认环境 设计器全部默认为英文版本 + * * @param locale * @return */ @@ -1554,7 +1571,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); @@ -2050,4 +2067,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(); + } + }; } From 8084401e67315f4b7e06ffd57f35616a26f0707d Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 26 May 2020 17:13:59 +0800 Subject: [PATCH 050/135] =?UTF-8?q?MOBILE-27220=20=E5=9C=A8=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=B1=9E=E6=80=A7=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E2=80=9C=E9=BB=98=E8=AE=A4=E2=80=9D=E5=92=8C?= =?UTF-8?q?=E2=80=9C=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A0=B7=E5=BC=8F=E2=80=9D?= =?UTF-8?q?=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/ui/MobileStyleDefinePane.java | 39 ++++++++++++++++--- .../mobile/ui/MobileStyleFontConfigPane.java | 3 +- 2 files changed, 34 insertions(+), 8 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 5f11e46db0..20d983e7a6 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 @@ -5,6 +5,7 @@ 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.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.i18n.Toolkit; @@ -17,6 +18,7 @@ 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.locale.InterProviderFactory; import com.fr.stable.Constants; import javax.swing.JPanel; @@ -29,6 +31,8 @@ import java.awt.Component; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; public class MobileStyleDefinePane extends BasicBeanPane { @@ -42,6 +46,8 @@ public class MobileStyleDefinePane extends BasicBeanPane { private Widget widget; private MobileStyleCustomDefinePane customBeanPane; private Class mobileStyleClazz; + private UIComboBox customCombo; + private JPanel settingPane; private ColorSelectBox colorSelectBox; private Color titleColor = new Color(47, 142, 241); private JPanel commomPane; @@ -62,6 +68,8 @@ public class MobileStyleDefinePane extends BasicBeanPane { @Override public void populateBean(MobileStyle ob) { this.customBeanPane.populateBean(ob); + + customCombo.setSelectedIndex(ob.isCommonCustom() ? 1 : 0); if(ob.getBackground() != null) { colorSelectBox.setSelectObject(((ColorBackground)ob.getBackground()).getColor()); } @@ -83,6 +91,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { MobileStyle mobileStyle = Reflect.on(mobileStyleClazz).create().get(); this.widget.setMobileStyle(mobileStyle); this.customBeanPane.updateBean(); + mobileStyle.setCommonCustom(customCombo.getSelectedIndex() == 1); mobileStyle.setBackground(ColorBackground.getInstance(colorSelectBox.getSelectObject())); mobileStyle.setBorderType(borderType.getSelectedLineStyle()); mobileStyle.setBorderColor(borderColor.getSelectObject()); @@ -126,6 +135,23 @@ public class MobileStyleDefinePane extends BasicBeanPane { commomPane.setBorder(titledBorder); this.add(commomPane, BorderLayout.NORTH); + + customCombo = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Mobile_Default"), Toolkit.i18nText("FIne-Design_Mobile_Custom")}); + customCombo.setSelectedIndex(0); + customCombo.setPreferredSize(new Dimension(NORMAL_COMBO_WIDTH + 15, 20)); + customCombo.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + boolean isCustom = customCombo.getSelectedIndex() == 1; + settingPane.setVisible(isCustom); + } + }); + commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Attribute_setting")), customCombo)); + + settingPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 10); + settingPane.setVisible(false); + commomPane.add(settingPane); + createBackgroundPane(); createBorderPane(); createIconSettingPane(); @@ -136,7 +162,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { colorSelectBox = new ColorSelectBox(NORMAL_COMBO_WIDTH); JPanel backgroundPane = createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Background")), colorSelectBox); - commomPane.add(backgroundPane); + settingPane.add(backgroundPane); } private void createBorderPane() { @@ -146,19 +172,20 @@ public class MobileStyleDefinePane extends BasicBeanPane { borderColor = new NewColorSelectBox(NORMAL_COMBO_WIDTH); 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)); + settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderType")), borderType)); + settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderColor")), borderColor)); + settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderRadius")), borderRadius)); } private void createIconSettingPane() { iconColor = new NewColorSelectBox(NORMAL_COMBO_WIDTH); - commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Icon_Color")), iconColor)); + iconColor.setSelectObject(new Color(31,173,229)); + settingPane.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)); + settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Font")), fontConfigPane)); } private void createCustomPane() { 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 f765e25845..14b8c346fb 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 @@ -31,7 +31,6 @@ public class MobileStyleFontConfigPane extends JPanel { 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); } @@ -51,7 +50,7 @@ public class MobileStyleFontConfigPane extends JPanel { fontSizeComboBox = new UIComboBox(); fontSizeComboBox.setModel(new DefaultComboBoxModel(getFontSizes())); - fontSizeComboBox.setSelectedItem(0); + fontSizeComboBox.setSelectedItem(16); fontSizeComboBox.setPreferredSize(new Dimension(60, 20)); fontSizeComboBox.setRenderer(new LineCellRenderer()); underline = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png")); From 1789ed55ae20455879133f016f4348411a342d3c Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 26 May 2020 17:28:00 +0800 Subject: [PATCH 051/135] =?UTF-8?q?=E5=91=BD=E5=90=8D=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 20d983e7a6..e21af7c6b5 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 @@ -142,8 +142,8 @@ public class MobileStyleDefinePane extends BasicBeanPane { customCombo.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { - boolean isCustom = customCombo.getSelectedIndex() == 1; - settingPane.setVisible(isCustom); + boolean custom = customCombo.getSelectedIndex() == 1; + settingPane.setVisible(custom); } }); commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Attribute_setting")), customCombo)); From 75356f6866f17b1287103713b98bc5f05237fa45 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 26 May 2020 20:55:55 +0800 Subject: [PATCH 052/135] =?UTF-8?q?MOBILE-27268=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E7=BB=84=E4=BB=B6=E5=B1=9E=E6=80=A7=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E6=98=AF=E9=A2=9C=E8=89=B2=E5=B1=9E=E6=80=A7=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E4=B8=8B=E5=88=92=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/ui/MobileStyleFontConfigPane.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 14b8c346fb..3c756db09b 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,6 +2,7 @@ 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.gui.icombobox.UIComboBoxRenderer; @@ -16,7 +17,6 @@ import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import java.awt.BorderLayout; -import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.FlowLayout; @@ -38,7 +38,7 @@ public class MobileStyleFontConfigPane extends JPanel { } private UIComboBox fontSizeComboBox; - private UIToggleButton underline; + private UIColorButton color; private UIToggleButton italic; private UIToggleButton bold; @@ -53,7 +53,7 @@ public class MobileStyleFontConfigPane extends JPanel { fontSizeComboBox.setSelectedItem(16); fontSizeComboBox.setPreferredSize(new Dimension(60, 20)); fontSizeComboBox.setRenderer(new LineCellRenderer()); - underline = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png")); + color = new UIColorButton(); 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")); @@ -61,7 +61,7 @@ public class MobileStyleFontConfigPane extends JPanel { this.setButtonsSize(BUTTON_SIZE); Component[] components_font = new Component[]{ - fontSizeComboBox, underline, italic, bold + fontSizeComboBox, color, italic, bold }; JPanel buttonPane = new JPanel(new BorderLayout()); @@ -72,13 +72,13 @@ public class MobileStyleFontConfigPane extends JPanel { } private void setButtonsTips() { - underline.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Underline")); + color.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Foreground")); 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); + color.setPreferredSize(size); italic.setPreferredSize(size); bold.setPreferredSize(size); } @@ -86,9 +86,9 @@ public class MobileStyleFontConfigPane extends JPanel { public void populateBean(FRFont frFont) { fontSizeComboBox.setSelectedItem(frFont.getSize()); + color.setColor(frFont.getForeground()); bold.setSelected(frFont.isBold()); italic.setSelected(frFont.isItalic()); - underline.setSelected(frFont.getUnderline() != Constants.LINE_NONE); } public FRFont updateBean() { @@ -99,8 +99,8 @@ public class MobileStyleFontConfigPane extends JPanel { FRFont.DEFAULT_FONTNAME, style, Float.parseFloat(fontSizeComboBox.getSelectedItem().toString()), - Color.BLACK, - underline.isSelected() ? Constants.LINE_THIN : Constants.LINE_NONE + color.getColor(), + Constants.LINE_NONE ); } From 3dd760120835ab355be4577d9302c57a9a2cc2d0 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 26 May 2020 23:55:19 +0800 Subject: [PATCH 053/135] =?UTF-8?q?=E5=91=BD=E5=90=8D=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/mobile/ui/MobileStyleDefinePane.java | 7 ++----- 1 file changed, 2 insertions(+), 5 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 e21af7c6b5..e418bba0e3 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 @@ -18,13 +18,10 @@ 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.locale.InterProviderFactory; import com.fr.stable.Constants; import javax.swing.JPanel; import javax.swing.border.TitledBorder; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -136,7 +133,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { this.add(commomPane, BorderLayout.NORTH); - customCombo = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Mobile_Default"), Toolkit.i18nText("FIne-Design_Mobile_Custom")}); + customCombo = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Mobile_Default"), Toolkit.i18nText("Fine-Design_Mobile_Custom")}); customCombo.setSelectedIndex(0); customCombo.setPreferredSize(new Dimension(NORMAL_COMBO_WIDTH + 15, 20)); customCombo.addItemListener(new ItemListener() { @@ -146,7 +143,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { settingPane.setVisible(custom); } }); - commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Attribute_setting")), customCombo)); + commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Attribute_Settings")), customCombo)); settingPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 10); settingPane.setVisible(false); From 64ea27b9225f47c65efb91b88771f43b142e231d Mon Sep 17 00:00:00 2001 From: yaohwu Date: Wed, 27 May 2020 10:32:49 +0800 Subject: [PATCH 054/135] =?UTF-8?q?REPORT-31454=20=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E4=B8=BA=E6=8A=98=E5=8F=A0=E6=A0=91-=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E6=94=B9=E8=BF=9B=EF=BC=88=E9=9D=9Ecptx=E4=B8=8D=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E8=AF=A5=E9=9D=A2=E6=9D=BF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/CellExpandAttrPanelProvider.java | 7 +++++++ .../AbstractCellExpandAttrPanelProvider.java | 4 ++++ .../settingpane/CellExpandExtraAttrPane.java | 19 +++++++++++++------ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/CellExpandAttrPanelProvider.java b/designer-base/src/main/java/com/fr/design/fun/CellExpandAttrPanelProvider.java index ec37e16007..fd3953564f 100644 --- a/designer-base/src/main/java/com/fr/design/fun/CellExpandAttrPanelProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/CellExpandAttrPanelProvider.java @@ -18,4 +18,11 @@ public interface CellExpandAttrPanelProvider extends Mutable { * @return 创建单元格属性-扩展设置中的额外面板 */ BasicBeanPane createPanel(); + + /** + * 是否应该展示 + * + * @return return {@code true} if extra panel is displayable + */ + boolean isDisplayable(); } diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellExpandAttrPanelProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellExpandAttrPanelProvider.java index 3ec730862c..d0b1eca5c7 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellExpandAttrPanelProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellExpandAttrPanelProvider.java @@ -36,4 +36,8 @@ public class AbstractCellExpandAttrPanelProvider implements CellExpandAttrPanelP public BasicBeanPane createPanel() { return null; } + + public boolean isDisplayable() { + return true; + } } 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 58f11277c1..e5c7d3095d 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 @@ -73,6 +73,7 @@ public class CellExpandExtraAttrPane extends JPanel { } public void populate(TemplateCellElement cellElement) { + refreshExtraPanel(); this.cellElement = cellElement; if (extras != null) { for (BasicBeanPane extra : extras) { @@ -91,6 +92,13 @@ public class CellExpandExtraAttrPane extends JPanel { } private void refresh() { + refreshExtraPanel(); + if (this.cellElement != null) { + this.populate(cellElement); + } + } + + private void refreshExtraPanel() { this.removeAll(); if (extras == null) { extras = new ArrayList<>(); @@ -99,9 +107,11 @@ public class CellExpandExtraAttrPane extends JPanel { Set attrProviders = ExtraDesignClassManager.getInstance().getArray(CellExpandAttrPanelProvider.MARK_STRING); if (attrProviders != null) { for (CellExpandAttrPanelProvider attrProvider : attrProviders) { - BasicBeanPane extra = attrProvider.createPanel(); - if (extra != null) { - extras.add(extra); + if (attrProvider.isDisplayable()) { + BasicBeanPane extra = attrProvider.createPanel(); + if (extra != null) { + extras.add(extra); + } } } } @@ -115,9 +125,6 @@ public class CellExpandExtraAttrPane extends JPanel { 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 aaea0d92ee2493d54399f1c73dfd9d1ea74eaf29 Mon Sep 17 00:00:00 2001 From: yaohwu Date: Wed, 27 May 2020 10:45:18 +0800 Subject: [PATCH 055/135] =?UTF-8?q?REPORT-31454=20=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E4=B8=BA=E6=8A=98=E5=8F=A0=E6=A0=91-=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E6=94=B9=E8=BF=9B=EF=BC=88=E9=9D=9Ecptx=E4=B8=8D=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E8=AF=A5=E9=9D=A2=E6=9D=BF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/cell/settingpane/CellExpandExtraAttrPane.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 e5c7d3095d..c59afcaf7d 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 @@ -94,7 +94,11 @@ public class CellExpandExtraAttrPane extends JPanel { private void refresh() { refreshExtraPanel(); if (this.cellElement != null) { - this.populate(cellElement); + if (extras != null) { + for (BasicBeanPane extra : extras) { + extra.populateBean(cellElement); + } + } } } From 43894e0d3fe0d1acde3017ef544c017482b51d3a Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 28 May 2020 13:44:59 +0800 Subject: [PATCH 056/135] =?UTF-8?q?REPORT-31879=20gauss=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E8=8E=B7=E5=8F=96=E4=B8=8D=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/datapane/ChoosePane.java | 32 ++++++++++++------- .../design/present/dict/DatabaseDictPane.java | 10 ++++-- 2 files changed, 29 insertions(+), 13 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 eda6414671..ca761bb579 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,10 +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.Dialect; import com.fr.data.core.db.dialect.DialectFactory; import com.fr.data.impl.Connection; import com.fr.data.impl.DBTableData; @@ -38,11 +38,7 @@ import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; -import javax.swing.JList; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JTree; -import javax.swing.SwingWorker; +import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.event.PopupMenuEvent; @@ -53,9 +49,7 @@ import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreeCellRenderer; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; +import java.awt.*; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; import java.awt.event.ItemEvent; @@ -455,6 +449,15 @@ public class ChoosePane extends BasicBeanPane implements Refresha * @return 数据集数据 */ public TableData createSelectTableData() { + return createSelectTableData(new SelectSqlProcessor() { + @Override + public String createSelectSql(String schema, String tableName, Dialect dialect) { + return DataCoreUtils.createSelectSQL(schema, tableName, dialect); + } + }); + } + + public TableData createSelectTableData(SelectSqlProcessor sqlProcessor) { DataBaseItems paras = this.updateBean(); boolean connect = false; com.fr.data.impl.Connection database = DBUtils.checkDBConnection(paras.getDatabaseName()); @@ -477,11 +480,11 @@ public class ChoosePane extends BasicBeanPane implements Refresha TableData tableData = null; if (WorkContext.getCurrent().isLocal()) { - tableData = new DBTableData(database, DataCoreUtils.createSelectSQL(paras.getSchemaName(), paras.getTableName(), + tableData = new DBTableData(database, sqlProcessor.createSelectSql(paras.getSchemaName(), paras.getTableName(), DialectFactory.getDialectByName(paras.getDatabaseName()))); } else { try { - TableData tableDataLocal = new DBTableData(database, DataCoreUtils.createSelectSQL(paras.getSchemaName(), paras.getTableName(), DialectFactory.getDialectByName(paras.getDatabaseName()))); + TableData tableDataLocal = new DBTableData(database, sqlProcessor.createSelectSql(paras.getSchemaName(), paras.getTableName(), DialectFactory.getDialectByName(paras.getDatabaseName()))); tableData = DataOperator.getInstance().previewTableData(tableDataLocal, java.util.Collections.EMPTY_MAP, DesignerEnvManager.getEnvManager().getMaxNumberOrPreviewRow()); } catch (Exception e) { @@ -591,6 +594,13 @@ public class ChoosePane extends BasicBeanPane implements Refresha }); } + /** + * 数据集选择面板里的生成sql语句的接口 + */ + public interface SelectSqlProcessor { + String createSelectSql(String schema, String tableName, Dialect dialect); + } + protected class StringUIComboBox extends UIComboBox { private boolean refreshingModel = false; diff --git a/designer-base/src/main/java/com/fr/design/present/dict/DatabaseDictPane.java b/designer-base/src/main/java/com/fr/design/present/dict/DatabaseDictPane.java index 668bcd9beb..7ffb4e61e0 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/DatabaseDictPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/DatabaseDictPane.java @@ -2,7 +2,9 @@ package com.fr.design.present.dict; import com.fr.base.BaseFormula; import com.fr.base.TableData; +import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.DBUtils; +import com.fr.data.core.db.dialect.Dialect; import com.fr.data.impl.DatabaseDictionary; import com.fr.data.impl.NameDatabaseConnection; import com.fr.design.beans.FurtherBasicBeanPane; @@ -23,7 +25,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.layout.TableLayoutHelper; - import com.fr.stable.StringUtils; import javax.swing.*; @@ -215,7 +216,12 @@ public class DatabaseDictPane extends FurtherBasicBeanPane i * */ public void dbChange() { - TableData tableData = this.chooseTable.createSelectTableData(); + TableData tableData = this.chooseTable.createSelectTableData(new ChoosePane.SelectSqlProcessor() { + @Override + public String createSelectSql(String schema, String tableName, Dialect dialect) { + return DataCoreUtils.createColumnSelectSQL(schema, tableName, dialect); + } + }); String[] columnNames = DesignTableDataManager.getColumnNamesByTableData(tableData).toArray(new String[0]); ColumnNameEditor columnNameEditor1 = new ColumnNameEditor(columnNames); columnNameEditor1.addItemListener(itemListener); From 775438b1f890a36082da0d405d4ca4ffcbbbb48c Mon Sep 17 00:00:00 2001 From: Bruce Date: Thu, 28 May 2020 18:11:17 +0800 Subject: [PATCH 057/135] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=EF=BC=8C=E6=89=93=E5=8C=85=E5=A4=B1=E8=B4=A5=EF=BC=8C=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 37 ------------------- 1 file changed, 37 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 9d59ef187a..595f812afd 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -270,43 +270,6 @@ public class EnvChangeEntrance { } } - /** - * 对选择的环境做服务检测 - * @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、选择的环境为远程环境 From e347eae9ddbf7415d09b27843c0f940eb03133b8 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 28 May 2020 18:50:42 +0800 Subject: [PATCH 058/135] =?UTF-8?q?=E6=97=A0jira=20feature=E6=89=93?= =?UTF-8?q?=E5=8C=85=E5=A4=B1=E8=B4=A5?= 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 ++- .../java/com/fr/design/os/impl/MacOsAddListenerAction.java | 3 ++- 2 files changed, 4 insertions(+), 2 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 2cf8d8c350..69a262bdfd 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 @@ -509,7 +509,8 @@ 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); - Reflect.on(Reflect.on(clazz).call("getApplication").get()).call("setDockIconImage", icon); + Object application = Reflect.on(clazz).call("getApplication").get(); + Reflect.on(application).call("setDockIconImage", icon); } else { this.setIconImages(image); } 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 1ff796a1dc..6386ecd73e 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 @@ -28,7 +28,8 @@ public class MacOsAddListenerAction implements OSBasedAction { Object quitInstance = getProxy(quitHandler, "handleQuitRequestWith", new QuitAction()); Class aboutHandler = Class.forName("com.apple.eawt.AboutHandler"); Object aboutInstance = getProxy(aboutHandler, "handleAbout", new AboutAction()); - Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", quitInstance) + Object application = Reflect.on(app).call("getApplication").get(); + Reflect.on(application).call("setQuitHandler", quitInstance) .call("setAboutHandler", aboutInstance); } catch (ClassNotFoundException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); From 2b32762482309867d625fed1d9e001627dd824d8 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 29 May 2020 11:23:11 +0800 Subject: [PATCH 059/135] =?UTF-8?q?KERNEL-4069=20=E9=85=8D=E5=90=88?= =?UTF-8?q?=E5=AE=8C=E6=88=90JDK11=E6=9E=84=E5=BB=BA=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E7=9A=84=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/frpane/UIBubbleFloatPane.java | 2 +- .../ui/rsyntaxtextarea/RSyntaxTextArea.java | 13 +- .../com/fr/design/utils/AWTUtilities.java | 200 ++++++++++++++++++ .../main/java/com/fr/start/SplashWindow.java | 3 +- 4 files changed, 204 insertions(+), 14 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/utils/AWTUtilities.java diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java index c41cc9f7ac..0297353ee0 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java @@ -2,9 +2,9 @@ package com.fr.design.gui.frpane; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.UIDialog; +import com.fr.design.utils.AWTUtilities; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; -import com.sun.awt.AWTUtilities; import javax.swing.JComponent; import javax.swing.JPanel; diff --git a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxTextArea.java b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxTextArea.java index 30fc7b8717..9cdc3b0ef5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxTextArea.java +++ b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxTextArea.java @@ -9,16 +9,7 @@ */ package com.fr.design.gui.syntax.ui.rsyntaxtextarea; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Insets; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.RenderingHints; +import java.awt.*; import java.awt.datatransfer.Clipboard; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -604,7 +595,7 @@ private boolean fractionalFontMetricsEnabled; SecurityManager sm = System.getSecurityManager(); if (sm!=null) { try { - sm.checkSystemClipboardAccess(); + sm.checkPermission(new AWTPermission("accessClipboard")); } catch (SecurityException se) { UIManager.getLookAndFeel().provideErrorFeedback(null); return; diff --git a/designer-base/src/main/java/com/fr/design/utils/AWTUtilities.java b/designer-base/src/main/java/com/fr/design/utils/AWTUtilities.java new file mode 100644 index 0000000000..12bf2ac4d6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/utils/AWTUtilities.java @@ -0,0 +1,200 @@ +package com.fr.design.utils; + +import sun.awt.SunToolkit; + +import java.awt.*; + +/** + * 适配jdk10之后被移除的 com.sun.awt.AWTUtilities + * 参照 https://github.com/frohoff/jdk8u-dev-jdk/blob/master/src/share/classes/com/sun/awt/AWTUtilities.java中实现 + * + * @author hades + * @version 10.0 + * Created by hades on 2020/5/29 + */ +public class AWTUtilities { + + /** + * @param window the window to set the shape to + * @param shape the shape to set to the window + * + */ + public static void setWindowShape(Window window, Shape shape) { + if (window == null) { + throw new NullPointerException("The window argument should not be null."); + } + window.setShape(shape); + } + + /** + * + * + * @param window the window to set the shape to + * @param opaque whether the window must be opaque (true), + * or translucent (false) + * + */ + public static void setWindowOpaque(Window window, boolean opaque) { + if (window == null) { + throw new NullPointerException("The window argument should not be null."); + } + if (!opaque && !isTranslucencySupported(Translucency.PERPIXEL_TRANSLUCENT)) { + throw new UnsupportedOperationException("The PERPIXEL_TRANSLUCENT translucency kind is not supported"); + } + Color color = window.getBackground(); + if (color == null) { + color = new Color(0, 0, 0, 0); + } + window.setBackground(new Color(color.getRed(), color.getGreen(), color.getBlue(), opaque ? 255 : 0)); + } + + + public static enum Translucency { + /** + * Represents support in the underlying system for windows each pixel + * of which is guaranteed to be either completely opaque, with + * an alpha value of 1.0, or completely transparent, with an alpha + * value of 0.0. + */ + PERPIXEL_TRANSPARENT, + + /** + * Represents support in the underlying system for windows all of + * the pixels of which have the same alpha value between or including + * 0.0 and 1.0. + */ + TRANSLUCENT, + + /** + * Represents support in the underlying system for windows that + * contain or might contain pixels with arbitrary alpha values + * between and including 0.0 and 1.0. + */ + PERPIXEL_TRANSLUCENT; + } + + + /** + * Returns whether the given level of translucency is supported by + * the underlying system. + * + * Note that this method may sometimes return the value + * indicating that the particular level is supported, but + * the native windowing system may still not support the + * given level of translucency (due to the bugs in + * the windowing system). + * + * @param translucencyKind a kind of translucency support + * (either PERPIXEL_TRANSPARENT, + * TRANSLUCENT, or PERPIXEL_TRANSLUCENT) + * @return whether the given translucency kind is supported + */ + private static boolean isTranslucencySupported(Translucency translucencyKind) { + switch (translucencyKind) { + case PERPIXEL_TRANSPARENT: + return isWindowShapingSupported(); + case TRANSLUCENT: + return isWindowOpacitySupported(); + case PERPIXEL_TRANSLUCENT: + return isWindowTranslucencySupported(); + } + return false; + } + + /** + * Returns whether the windowing system supports changing the opacity + * value of top-level windows. + * Note that this method may sometimes return true, but the native + * windowing system may still not support the concept of + * translucency (due to the bugs in the windowing system). + */ + private static boolean isWindowOpacitySupported() { + Toolkit curToolkit = Toolkit.getDefaultToolkit(); + if (!(curToolkit instanceof SunToolkit)) { + return false; + } + return ((SunToolkit)curToolkit).isWindowOpacitySupported(); + } + + /** + * Returns whether the windowing system supports changing the shape + * of top-level windows. + * Note that this method may sometimes return true, but the native + * windowing system may still not support the concept of + * shaping (due to the bugs in the windowing system). + */ + private static boolean isWindowShapingSupported() { + Toolkit curToolkit = Toolkit.getDefaultToolkit(); + if (!(curToolkit instanceof SunToolkit)) { + return false; + } + return ((SunToolkit)curToolkit).isWindowShapingSupported(); + } + + private static boolean isWindowTranslucencySupported() { + /* + * Per-pixel alpha is supported if all the conditions are TRUE: + * 1. The toolkit is a sort of SunToolkit + * 2. The toolkit supports translucency in general + * (isWindowTranslucencySupported()) + * 3. There's at least one translucency-capable + * GraphicsConfiguration + */ + + Toolkit curToolkit = Toolkit.getDefaultToolkit(); + if (!(curToolkit instanceof SunToolkit)) { + return false; + } + + if (!((SunToolkit)curToolkit).isWindowTranslucencySupported()) { + return false; + } + + GraphicsEnvironment env = + GraphicsEnvironment.getLocalGraphicsEnvironment(); + + // If the default GC supports translucency return true. + // It is important to optimize the verification this way, + // see CR 6661196 for more details. + if (isTranslucencyCapable(env.getDefaultScreenDevice() + .getDefaultConfiguration())) + { + return true; + } + + // ... otherwise iterate through all the GCs. + GraphicsDevice[] devices = env.getScreenDevices(); + + for (int i = 0; i < devices.length; i++) { + GraphicsConfiguration[] configs = devices[i].getConfigurations(); + for (int j = 0; j < configs.length; j++) { + if (isTranslucencyCapable(configs[j])) { + return true; + } + } + } + + return false; + } + + private static boolean isTranslucencyCapable(GraphicsConfiguration gc) { + if (gc == null) { + throw new NullPointerException("The gc argument should not be null"); + } + /* + return gc.isTranslucencyCapable(); + */ + Toolkit curToolkit = Toolkit.getDefaultToolkit(); + if (!(curToolkit instanceof SunToolkit)) { + return false; + } + return ((SunToolkit)curToolkit).isTranslucencyCapable(gc); + } + + + + + + + +} diff --git a/designer-base/src/main/java/com/fr/start/SplashWindow.java b/designer-base/src/main/java/com/fr/start/SplashWindow.java index 0176883f57..b6a012f95a 100644 --- a/designer-base/src/main/java/com/fr/start/SplashWindow.java +++ b/designer-base/src/main/java/com/fr/start/SplashWindow.java @@ -2,9 +2,9 @@ package com.fr.start; import com.fr.base.BaseUtils; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.utils.AWTUtilities; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.OperatingSystem; -import com.sun.awt.AWTUtilities; import javax.swing.ImageIcon; import javax.swing.JFrame; @@ -41,7 +41,6 @@ public class SplashWindow extends JFrame { this.setAlwaysOnTop(false); this.setUndecorated(true); AWTUtilities.setWindowOpaque(this, false); - //使窗体背景透明 if (OperatingSystem.isWindows()) { this.setBackground(new Color(0, 0, 0, 0)); From 974e6d677ad2b7715014161851b5a8f391537dc9 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 29 May 2020 11:25:33 +0800 Subject: [PATCH 060/135] =?UTF-8?q?KERNEL-4069=20fix=20=E6=BC=8F=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/alphafine/listener/ComponentHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/listener/ComponentHandler.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/listener/ComponentHandler.java index 1294fd7d08..17f12f9dde 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/listener/ComponentHandler.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/listener/ComponentHandler.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.alphafine.listener; -import com.sun.awt.AWTUtilities; +import com.fr.design.utils.AWTUtilities; import java.awt.*; import java.awt.event.ComponentAdapter; From 04a90491bfd60a02ec1487cd8e50365557832924 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 1 Jun 2020 10:48:53 +0800 Subject: [PATCH 061/135] =?UTF-8?q?KERNEL-4069=20JDK11=E9=80=82=E9=85=8D?= =?UTF-8?q?=20=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E7=9A=84=E7=B1=BB?= =?UTF-8?q?=E4=B8=8Emac=E4=B8=8B=E7=9A=84=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/extra/LoginWebBridge.java | 12 - .../com/fr/design/extra/PluginWebBridge.java | 7 - .../com/fr/design/extra/QQLoginWebPane.java | 234 ------------------ .../com/fr/design/extra/WebViewDlgHelper.java | 15 -- .../os/impl/MacOsAddListenerAction.java | 11 +- 5 files changed, 10 insertions(+), 269 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/extra/QQLoginWebPane.java diff --git a/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java b/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java index 471e25109a..0862c74472 100644 --- a/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java +++ b/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java @@ -196,18 +196,6 @@ public class LoginWebBridge { uiLabel.setBackground(LOGIN_BACKGROUND); } - /** - * 弹出QQ授权页面 - */ - public void showQQ() { - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - WebViewDlgHelper.createQQLoginDialog(); - } - }); - } - /** * 关闭QQ授权窗口 */ diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java b/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java index 10f65fa2b7..159e6d6d9c 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java @@ -533,13 +533,6 @@ public class PluginWebBridge { threadPoolExecutor.submit(task); } - /** - * 弹出QQ授权页面 - */ - public void showQQ() { - LoginWebBridge.getHelper().showQQ(); - } - /** * 通过QQ登录后通知登录 */ diff --git a/designer-base/src/main/java/com/fr/design/extra/QQLoginWebPane.java b/designer-base/src/main/java/com/fr/design/extra/QQLoginWebPane.java deleted file mode 100644 index 9c56738b49..0000000000 --- a/designer-base/src/main/java/com/fr/design/extra/QQLoginWebPane.java +++ /dev/null @@ -1,234 +0,0 @@ -package com.fr.design.extra; - -import com.fr.design.dialog.FineJOptionPane; -import com.fr.general.CloudCenter; -import com.fr.general.ComparatorUtils; -import com.fr.general.IOUtils; -import com.fr.log.FineLoggerFactory; -import javafx.application.Platform; -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.value.ChangeListener; -import javafx.beans.value.ObservableValue; -import javafx.concurrent.Worker; -import javafx.embed.swing.JFXPanel; -import javafx.event.ActionEvent; -import javafx.event.EventHandler; -import javafx.scene.Group; -import javafx.scene.Node; -import javafx.scene.Scene; -import javafx.scene.control.ButtonBuilder; -import javafx.scene.control.LabelBuilder; -import javafx.scene.input.MouseEvent; -import javafx.scene.layout.BorderPane; -import javafx.scene.layout.HBox; -import javafx.scene.layout.HBoxBuilder; -import javafx.scene.paint.Color; -import javafx.scene.web.WebEngine; -import javafx.scene.web.WebEvent; -import javafx.scene.web.WebView; -import javafx.stage.Modality; -import javafx.stage.Screen; -import javafx.stage.Stage; -import javafx.stage.StageStyle; -import javafx.stage.WindowEvent; -import javafx.util.Callback; -import netscape.javascript.JSObject; - -import javax.swing.JOptionPane; -import javax.swing.SwingUtilities; -import java.awt.Toolkit; - -/** - * Created by zhaohehe on 16/7/28. - */ -public class QQLoginWebPane extends JFXPanel { - - private WebEngine webEngine; - private String url; - - private static JSObject window; - - private static int DEFAULT_PRIMARYSTAGE_WIDTH = 100; - private static int DEFAULT_PRIMARYSTAGE_HEIGHT = 100; - - private static int DEFAULT_CONFIRM_WIDTH = 450; - private static int DEFAULT_CONFIRM_HEIGHT = 160; - private static int DEFAULT_OFFEST = 20; - - class Delta { - double x, y; - } - - public QQLoginWebPane(final String installHome) { - Platform.setImplicitExit(false); - Platform.runLater(new Runnable() { - @Override - public void run() { - BorderPane root = new BorderPane(); - Scene scene = new Scene(root); - QQLoginWebPane.this.setScene(scene); - final WebView webView = new WebView(); - webEngine = webView.getEngine(); - url = "file:///" + installHome + "/scripts/qqLogin.html"; - webEngine.load(url); - - final Stage primaryStage = new Stage(); - - HBox layout = new HBox(); - try { - primaryStage.initStyle(StageStyle.TRANSPARENT); - primaryStage.setScene(new Scene(layout)); - webView.getScene().getStylesheets().add(IOUtils.getResource("modal-dialog.css", getClass()).toExternalForm()); - primaryStage.initStyle(StageStyle.UTILITY); - primaryStage.setScene(new Scene(new Group(), DEFAULT_PRIMARYSTAGE_WIDTH, DEFAULT_PRIMARYSTAGE_HEIGHT)); - primaryStage.setX(0); - primaryStage.setY(Screen.getPrimary().getBounds().getHeight() + DEFAULT_PRIMARYSTAGE_HEIGHT); - primaryStage.show(); - } catch (Exception e) { - FineLoggerFactory.getLogger().info(e.getMessage()); - } - webEngine.setConfirmHandler(new Callback() { - @Override - public Boolean call(String msg) { - Boolean confirmed = confirm(primaryStage, msg, webView); - return confirmed; - } - }); - configWebEngine(); - webView.setContextMenuEnabled(false);//屏蔽右键 - root.setCenter(webView); - } - }); - } - - private void configWebEngine() { - - webEngine.locationProperty().addListener(new ChangeListener() { - @Override - public void changed(ObservableValue observable, final String oldValue, String newValue) { - disableLink(webEngine); - // webView好像默认以手机版显示网页,浏览器里过滤掉这个跳转 - if (ComparatorUtils.equals(newValue, url) || ComparatorUtils.equals(newValue, CloudCenter.getInstance().acquireUrlByKind("bbs.mobile"))) { - return; - } - LoginWebBridge.getHelper().openUrlAtLocalWebBrowser(webEngine, newValue); - } - }); - - webEngine.setOnAlert(new EventHandler>() { - @Override - public void handle(WebEvent event) { - showAlert(event.getData()); - } - }); - - webEngine.getLoadWorker().stateProperty().addListener( - new ChangeListener() { - public void changed(ObservableValue ov, Worker.State oldState, Worker.State newState) { - if (newState == Worker.State.SUCCEEDED) { - window = (JSObject) webEngine.executeScript("window"); - window.setMember("QQLoginHelper", LoginWebBridge.getHelper()); - } - } - } - ); - } - - private void showAlert(final String message) { - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - FineJOptionPane.showMessageDialog(QQLoginWebPane.this, message); - } - }); - } - - private void disableLink(final WebEngine eng) { - try { - // webView端不跳转 虽然webView可以指定本地浏览器打开某个链接,但是当本地浏览器跳转到指定链接的同时,webView也做了跳转, - // 为了避免出现在一个600*400的资讯框里加载整个网页的情况,webView不跳转到新网页 - Platform.runLater(new Runnable() { - @Override - public void run() { - eng.executeScript("location.reload()"); - LoginWebBridge.getHelper().closeQQWindow(); - } - }); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - - private Boolean confirm(final Stage parent, String msg, final WebView webView) { - final BooleanProperty confirmationResult = new SimpleBooleanProperty(); - // initialize the confirmation dialog - final Stage dialog = new Stage(StageStyle.UTILITY); - dialog.setX(Toolkit.getDefaultToolkit().getScreenSize().getWidth() / 2 - DEFAULT_CONFIRM_WIDTH / 2.0D + DEFAULT_OFFEST); - dialog.setY(Toolkit.getDefaultToolkit().getScreenSize().getHeight() / 2 + DEFAULT_OFFEST); - dialog.setHeight(DEFAULT_CONFIRM_HEIGHT); - dialog.setWidth(DEFAULT_CONFIRM_WIDTH); - dialog.setIconified(false); - dialog.initOwner(parent); - dialog.initModality(Modality.WINDOW_MODAL); - dialog.setScene( - new Scene( - HBoxBuilder.create().styleClass("modal-dialog").children( - LabelBuilder.create().text(msg).build(), - ButtonBuilder.create().text(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_BBSLogin_Switch_Account")).defaultButton(true).onAction(new EventHandler() { - @Override - public void handle(ActionEvent actionEvent) { - // take action and close the dialog. - confirmationResult.set(true); - webView.getEngine().reload(); - dialog.close(); - } - }).build(), - ButtonBuilder.create().text(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Cancel")).cancelButton(true).onAction(new EventHandler() { - @Override - public void handle(ActionEvent actionEvent) { - // abort action and close the dialog. - confirmationResult.set(false); - dialog.close(); - } - }).build() - ).build() - , Color.TRANSPARENT - ) - ); - configDrag(dialog); - // style and show the dialog. - dialog.getScene().getStylesheets().add(IOUtils.getResource("modal-dialog.css", getClass()).toExternalForm()); - dialog.setOnCloseRequest(new EventHandler() { - @Override - public void handle(WindowEvent event) { - event.consume(); - dialog.close(); - } - }); - dialog.showAndWait(); - return confirmationResult.get(); - } - - private void configDrag(final Stage dialog) { - // allow the dialog to be dragged around. - final Node root = dialog.getScene().getRoot(); - final Delta dragDelta = new Delta(); - - root.setOnMousePressed(new EventHandler() { - @Override - public void handle(MouseEvent mouseEvent) { - // record a delta distance for the drag and drop operation. - dragDelta.x = dialog.getX() - mouseEvent.getScreenX(); - dragDelta.y = dialog.getY() - mouseEvent.getScreenY(); - } - }); - root.setOnMouseDragged(new EventHandler() { - @Override - public void handle(MouseEvent mouseEvent) { - dialog.setX(mouseEvent.getScreenX() + dragDelta.x); - dialog.setY(mouseEvent.getScreenY() + dragDelta.y); - } - }); - } -} 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 47d1541461..2dea7108e9 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 @@ -184,21 +184,6 @@ public class WebViewDlgHelper { } } - public static void createQQLoginDialog() { - try { - Class clazz = Class.forName("com.fr.design.extra.QQLoginWebPane"); - Constructor constructor = clazz.getConstructor(String.class); - Component webPane = (Component) constructor.newInstance(new File(installHome).getAbsolutePath()); - - UIDialog qqLoginDialog = new QQLoginDialog(DesignerContext.getDesignerFrame(), webPane); - LoginWebBridge.getHelper().setQQDialog(qqLoginDialog); - qqLoginDialog.setVisible(true); - } catch (Throwable ignored) { - // ignored - } - } - - private static void confirmDownLoadShopJS() { int rv = FineJOptionPane.showConfirmDialog( null, 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 6386ecd73e..3dd462b8f8 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 @@ -9,6 +9,7 @@ import com.fr.invoke.Reflect; import com.fr.log.FineLoggerFactory; import com.fr.stable.os.support.OSBasedAction; +import java.awt.*; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; @@ -32,7 +33,15 @@ public class MacOsAddListenerAction implements OSBasedAction { Reflect.on(application).call("setQuitHandler", quitInstance) .call("setAboutHandler", aboutInstance); } catch (ClassNotFoundException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); + try { + Class quitHandler = Class.forName("java.awt.desktop.QuitHandler"); + Object quitInstance = getProxy(quitHandler, "handleQuitRequestWith", new QuitAction()); + Class aboutHandler = Class.forName("java.awt.desktop.AboutHandler"); + Object aboutInstance = getProxy(aboutHandler, "handleAbout", new AboutAction()); + Reflect.on(Desktop.getDesktop()).call("setQuitHandler", quitInstance).call("setAboutHandler", aboutInstance); + } catch (ClassNotFoundException ex) { + FineLoggerFactory.getLogger().error(ex.getMessage(), ex); + } } } From ff753001c487d64032ecb95aef35b7cffe418701 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 1 Jun 2020 11:50:11 +0800 Subject: [PATCH 062/135] =?UTF-8?q?KERNEL-4069=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=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/os/impl/MacOsAddListenerAction.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 3dd462b8f8..d2ab576205 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 @@ -15,6 +15,10 @@ import java.lang.reflect.Method; import java.lang.reflect.Proxy; /** + * com.apple.eawt.Application属于jdk1.8及以下mac jdk特有的api + * 在jdk9中被移除,由Desktop.getDesktop().setQuitHandler等jdk9.0引入的新api替代 + * 参见 https://stackoverflow.com/questions/38381824/how-can-i-use-apple-com-apple-eawt-functionality-on-java-8 + * * @author hades * @version 10.0 * Created by hades on 2020/3/13 @@ -33,6 +37,8 @@ public class MacOsAddListenerAction implements OSBasedAction { Reflect.on(application).call("setQuitHandler", quitInstance) .call("setAboutHandler", aboutInstance); } catch (ClassNotFoundException e) { + // 上面的不能移除,同时要保证再jdk1.8下面能运行 + // 抛出异常时 说明使用>=jdk9运行行设计器,但由于编译使用1.8构建,使用反射运行 try { Class quitHandler = Class.forName("java.awt.desktop.QuitHandler"); Object quitInstance = getProxy(quitHandler, "handleQuitRequestWith", new QuitAction()); From f47a1d27867415a133400d32652627042510f82e Mon Sep 17 00:00:00 2001 From: hiram Date: Tue, 2 Jun 2020 09:56:03 +0800 Subject: [PATCH 063/135] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20gradl?= =?UTF-8?q?e=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index ebec6e7705..0112687676 100644 --- a/build.gradle +++ b/build.gradle @@ -14,11 +14,12 @@ ext { languageLevelSetting = 1.8 } -apply from: 'globalConfigHook.gradle' +applyGlobalConfigPathIfExist() -if(versions.frVersion){ - frVersion = versions.frVersion +if (versions.frVersion) { + frVersion = versions.frVersion } +def frDevVersion = "DEV" + frVersion dependencies { api project(':designer-base') @@ -33,7 +34,7 @@ allprojects { apply plugin: 'idea' group 'com.fr.design' - version frVersion + version frDevVersion sourceCompatibility = languageLevelSetting targetCompatibility = languageLevelSetting @@ -72,7 +73,7 @@ allprojects { implementation 'com.fr.datasource:fine-datasource:' + frVersion implementation 'com.fr.decision:fine-decision:' + frVersion implementation 'com.fr.schedule:fine-schedule:' + frVersion - implementation 'com.fr.report:fine-report-engine:' + frVersion + implementation 'com.fr.report:fine-report-engine:' + frDevVersion testImplementation 'org.easymock:easymock:3.5.1' testImplementation 'org.powermock:powermock-module-junit4:1.7.1' testImplementation 'org.powermock:powermock-api-easymock:1.7.1' From 04f474543ff0dd4759027ce66de92c31c6a334f5 Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 2 Jun 2020 11:15:59 +0800 Subject: [PATCH 064/135] =?UTF-8?q?REPORT-32149=E3=80=90=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=8A=A0=E5=AF=86=E3=80=91@harrison=E4=B8=A4=E4=B8=AA=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E8=BF=9B=E8=A1=8C=E6=8B=96=E5=85=A5=EF=BC=8C=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E9=A2=84=E8=A7=88=E5=BE=88=E5=A5=87=E6=80=AA=20[?= =?UTF-8?q?=E5=9C=BA=E6=99=AF]=20=E6=8B=96=E5=85=A5=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E7=BB=84=E4=BB=B6=E6=97=B6=E7=BB=9D=E5=AF=B9?= =?UTF-8?q?=E7=94=BB=E5=B8=83=E5=9D=97=EF=BC=8C=E5=86=85=E9=83=A8=E6=9C=89?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E7=BB=84=E4=BB=B6=E3=80=82=E6=AD=A4=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E4=BC=9A=E5=AF=B9=E5=86=85=E9=83=A8=E7=9A=84?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E7=BB=84=E4=BB=B6=E8=BF=9B=E8=A1=8C=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E3=80=82=20[solution]=20=E9=80=92=E5=BD=92=E7=9A=84?= =?UTF-8?q?=E5=AF=B9=E6=89=80=E6=9C=89=E7=BB=84=E4=BB=B6=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E5=A4=84=E7=90=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/beans/models/AddingModel.java | 95 +++++++++++++------ .../beans/models/AddingModelTest.java | 52 ++++++++++ 2 files changed, 118 insertions(+), 29 deletions(-) create mode 100644 designer-form/src/test/java/com/fr/design/designer/beans/models/AddingModelTest.java diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java index 9d308b9d4b..7bf623db69 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java @@ -1,47 +1,52 @@ package com.fr.design.designer.beans.models; -import java.awt.Rectangle; - -import com.fr.design.designer.creator.XWAbsoluteLayout; -import com.fr.design.mainframe.FormDesigner; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.ComponentAdapter; import com.fr.design.designer.beans.adapters.component.CompositeComponentAdapter; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; -import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.designer.creator.XWAbsoluteLayout; +import com.fr.design.designer.creator.XWTitleLayout; +import com.fr.design.mainframe.FormDesigner; import com.fr.design.utils.ComponentUtils; +import com.fr.form.main.Form; +import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WTitleLayout; import com.fr.general.ComparatorUtils; +import java.awt.Rectangle; +import java.util.HashSet; +import java.util.Set; + /** * 添加状态下的model */ public class AddingModel { - + + private static final String POSTFIX = "_a"; + // 当前要添加的组件 private XCreator creator; // 记录当前鼠标的位置信息 private int currentX; private int currentY; private boolean added; - + public AddingModel(FormDesigner designer, XCreator xCreator) { - String creatorName = getXCreatorName(designer, xCreator); this.creator = xCreator; - instantiateCreator(designer, creatorName); + instantiateCreator(designer); // 初始的时候隐藏该组件的图标 currentY = -this.creator.getWidth(); currentX = -this.creator.getHeight(); } - + /** - * 待说明 + * 初始化创建器 * - * @param designer 设计器 - * @param creatorName 组件名 + * @param designer 设计器 */ - public void instantiateCreator(FormDesigner designer, String creatorName) { - creator.toData().setWidgetName(creatorName); + public void instantiateCreator(FormDesigner designer) { + renameWidgetName(designer.getTarget(), creator); ComponentAdapter adapter = new CompositeComponentAdapter(designer, creator); adapter.initialize(); creator.addNotify(); @@ -56,7 +61,7 @@ public class AddingModel { currentX = x - (xCreator.getWidth() / 2); currentY = y - (xCreator.getHeight() / 2); } - + /** * 隐藏当前组件的图标 */ @@ -64,28 +69,60 @@ public class AddingModel { currentX = -this.creator.getWidth(); currentY = -this.creator.getHeight(); } - - public String getXCreatorName(FormDesigner designer, XCreator x) { - String def = x.createDefaultName(); - if (x.acceptType(XWParameterLayout.class)) { - return def; + + /** + * 防止冲突,重命名 XCreator 内部的 widget + * + * @param form 表单 + * @param xCreator 创建器 + */ + private static void renameWidgetName(Form form, XCreator xCreator) { + + Set nameSpace = new HashSet<>(8); + recursiveRenameWidgetName(form, nameSpace, xCreator); + } + + private static void recursiveRenameWidgetName(Form form, Set nameSpace, XCreator xCreator) { + + String copyName = getAddWidgetName(form, xCreator.toData(), nameSpace); + if (xCreator.toData() instanceof WTitleLayout) { + XWTitleLayout xwTitleLayout = new XWTitleLayout((WTitleLayout) xCreator.toData(), xCreator.getSize()); + xwTitleLayout.resetCreatorName(copyName); + return; } - int i = 0; - while (designer.getTarget().isNameExist(def + i)) { - i++; + xCreator.resetCreatorName(copyName); + int count = xCreator.getComponentCount(); + for (int a = 0; a < count; a++) { + if (xCreator.getComponent(a) instanceof XCreator) { + XCreator child = (XCreator) xCreator.getComponent(a); + recursiveRenameWidgetName(form, nameSpace, child); + } + } - return def + i; } - + + /** + * 组件拷贝命名规则 + */ + private static String getAddWidgetName(Form form, Widget added, Set nameSpace) { + + StringBuilder name = new StringBuilder(added.getWidgetName()); + do { + name.append(POSTFIX); + } while (form.isNameExist(name.toString()) || nameSpace.contains(name.toString())); + nameSpace.add(name.toString()); + return name.toString(); + } + public int getCurrentX() { return currentX; } - + public int getCurrentY() { return currentY; } - - + + /** * 移动组件图标到鼠标事件发生的位置 * diff --git a/designer-form/src/test/java/com/fr/design/designer/beans/models/AddingModelTest.java b/designer-form/src/test/java/com/fr/design/designer/beans/models/AddingModelTest.java new file mode 100644 index 0000000000..64084844d1 --- /dev/null +++ b/designer-form/src/test/java/com/fr/design/designer/beans/models/AddingModelTest.java @@ -0,0 +1,52 @@ +package com.fr.design.designer.beans.models; + +import com.fr.design.designer.creator.CRPropertyDescriptor; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.mainframe.FormDesigner; +import com.fr.form.main.Form; +import com.fr.form.ui.ChartEditor; +import org.easymock.EasyMock; +import org.junit.Assert; +import org.junit.Test; + +import javax.swing.JComponent; +import java.awt.Dimension; +import java.beans.IntrospectionException; + +public class AddingModelTest { + + @Test + public void testInstantiateCreator() throws Exception { + + ChartEditor chartEditor = new ChartEditor(); + chartEditor.setWidgetName("test"); + XCreator xCreator = new XCreator(chartEditor, new Dimension(20, 20)) { + @Override + public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { + return new CRPropertyDescriptor[0]; + } + + @Override + protected JComponent initEditor() { + return null; + } + + @Override + protected void initXCreatorProperties() { + } + }; + AddingModel addingModel = new AddingModel(xCreator, 20, 20); + + Form form = EasyMock.mock(Form.class); + EasyMock.expect(form.isNameExist("test_a")).andReturn(true).once(); + EasyMock.expect(form.isNameExist(EasyMock.anyString())).andReturn(false).anyTimes(); + EasyMock.replay(form); + + FormDesigner mock = EasyMock.mock(FormDesigner.class); + EasyMock.expect(mock.getTarget()).andReturn(form).anyTimes(); + EasyMock.replay(mock); + + addingModel.instantiateCreator(mock); + Assert.assertEquals("test_a_a", xCreator.toData().getWidgetName()); + } +} \ No newline at end of file From c5b4410d9a231d384cd4bfe23b939351fe739f05 Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 2 Jun 2020 17:07:10 +0800 Subject: [PATCH 065/135] =?UTF-8?q?=E6=B2=BF=E7=94=A8=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=9A=84=E5=91=BD=E5=90=8D=E8=A7=84=E5=88=99=E3=80=82=20?= =?UTF-8?q?=E5=8F=AA=E8=BF=9B=E8=A1=8C=20n=20=E5=AF=B9=20n=20=E7=9A=84?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/beans/models/AddingModel.java | 41 ++++++++++--------- .../beans/models/AddingModelTest.java | 23 +++++++---- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java index 7bf623db69..833101750b 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java @@ -6,11 +6,11 @@ import com.fr.design.designer.beans.adapters.component.CompositeComponentAdapter import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWAbsoluteLayout; +import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWTitleLayout; import com.fr.design.mainframe.FormDesigner; import com.fr.design.utils.ComponentUtils; import com.fr.form.main.Form; -import com.fr.form.ui.Widget; import com.fr.form.ui.container.WTitleLayout; import com.fr.general.ComparatorUtils; @@ -23,8 +23,6 @@ import java.util.Set; */ public class AddingModel { - private static final String POSTFIX = "_a"; - // 当前要添加的组件 private XCreator creator; // 记录当前鼠标的位置信息 @@ -77,41 +75,46 @@ public class AddingModel { * @param xCreator 创建器 */ private static void renameWidgetName(Form form, XCreator xCreator) { - - Set nameSpace = new HashSet<>(8); - recursiveRenameWidgetName(form, nameSpace, xCreator); + + Set nameSpace = new HashSet<>(); + recursiveRenameWidgetName(form, xCreator, nameSpace); } - private static void recursiveRenameWidgetName(Form form, Set nameSpace, XCreator xCreator) { + private static void recursiveRenameWidgetName(Form form, XCreator xCreator, Set nameSpace) { - String copyName = getAddWidgetName(form, xCreator.toData(), nameSpace); + String creatorName = uniqueName(form, xCreator, nameSpace); if (xCreator.toData() instanceof WTitleLayout) { XWTitleLayout xwTitleLayout = new XWTitleLayout((WTitleLayout) xCreator.toData(), xCreator.getSize()); - xwTitleLayout.resetCreatorName(copyName); + xwTitleLayout.resetCreatorName(creatorName); return; } - xCreator.resetCreatorName(copyName); + xCreator.resetCreatorName(creatorName); int count = xCreator.getComponentCount(); for (int a = 0; a < count; a++) { if (xCreator.getComponent(a) instanceof XCreator) { XCreator child = (XCreator) xCreator.getComponent(a); - recursiveRenameWidgetName(form, nameSpace, child); + recursiveRenameWidgetName(form, child, nameSpace); } } } /** - * 组件拷贝命名规则 + * 组件命名规则 */ - private static String getAddWidgetName(Form form, Widget added, Set nameSpace) { + public static String uniqueName(Form form, XCreator x, Set nameSpace) { - StringBuilder name = new StringBuilder(added.getWidgetName()); - do { - name.append(POSTFIX); - } while (form.isNameExist(name.toString()) || nameSpace.contains(name.toString())); - nameSpace.add(name.toString()); - return name.toString(); + String def = x.createDefaultName(); + if (x.acceptType(XWParameterLayout.class)) { + return def; + } + int i = 0; + String name = def + i; + while (form.isNameExist(name) || nameSpace.contains(name)) { + i++; + name = def + i; + } + return name; } public int getCurrentX() { diff --git a/designer-form/src/test/java/com/fr/design/designer/beans/models/AddingModelTest.java b/designer-form/src/test/java/com/fr/design/designer/beans/models/AddingModelTest.java index 64084844d1..1487eb574a 100644 --- a/designer-form/src/test/java/com/fr/design/designer/beans/models/AddingModelTest.java +++ b/designer-form/src/test/java/com/fr/design/designer/beans/models/AddingModelTest.java @@ -17,36 +17,41 @@ public class AddingModelTest { @Test public void testInstantiateCreator() throws Exception { - + ChartEditor chartEditor = new ChartEditor(); - chartEditor.setWidgetName("test"); + chartEditor.setWidgetName("test01"); XCreator xCreator = new XCreator(chartEditor, new Dimension(20, 20)) { @Override public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { return new CRPropertyDescriptor[0]; } - + @Override protected JComponent initEditor() { return null; } - + @Override protected void initXCreatorProperties() { } + + @Override + public String createDefaultName() { + return "test"; + } }; AddingModel addingModel = new AddingModel(xCreator, 20, 20); - + Form form = EasyMock.mock(Form.class); - EasyMock.expect(form.isNameExist("test_a")).andReturn(true).once(); + EasyMock.expect(form.isNameExist("test0")).andReturn(true).once(); EasyMock.expect(form.isNameExist(EasyMock.anyString())).andReturn(false).anyTimes(); EasyMock.replay(form); - + FormDesigner mock = EasyMock.mock(FormDesigner.class); EasyMock.expect(mock.getTarget()).andReturn(form).anyTimes(); EasyMock.replay(mock); - + addingModel.instantiateCreator(mock); - Assert.assertEquals("test_a_a", xCreator.toData().getWidgetName()); + Assert.assertEquals("test1", xCreator.toData().getWidgetName()); } } \ No newline at end of file From e6df73ae3026db6235fb5d588cd9e6eb527d7cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 2 Jun 2020 18:33:53 +0800 Subject: [PATCH 066/135] =?UTF-8?q?CHART-13666=20=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E8=87=AA=E5=8A=A8=E5=8C=B9=E9=85=8D=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/icombocheckbox/UICheckListPopup.java | 13 +- .../gui/icombocheckbox/UIComboCheckBox.java | 8 +- .../fr/design/module/DesignModuleFactory.java | 28 +- .../fr/design/images/m_insert/auto_chart.png | Bin 0 -> 135 bytes .../fr/design/ChartTypeInterfaceManager.java | 17 +- .../com/fr/design/chart/AutoChartDialog.java | 69 ++ .../com/fr/design/chart/AutoChartIcon.java | 108 +++ .../fr/design/chart/AutoChartTypePane.java | 230 +++++++ .../design/chart/ChartDesignerActivator.java | 1 + .../java/com/fr/design/chart/ChartDialog.java | 102 +-- .../fr/design/chart/gui/ChartComponent.java | 3 + .../mainframe/chart/gui/ChartTypePane.java | 47 +- .../design/images/form/toolbar/auto_chart.png | Bin 0 -> 179 bytes .../designer/creator/XAutoChartCreator.java | 113 ++++ .../design/designer/creator/XChartEditor.java | 625 +++++++++--------- .../designer/creator/XCreatorUtils.java | 2 + .../insert/cell/AutoChartCellAction.java | 57 ++ .../insert/flot/AutoChartFloatAction.java | 53 ++ .../actions/insert/flot/ChartFloatAction.java | 11 +- .../cell/editor/AutoChartCellEditor.java | 24 + .../cell/editor/AutoChartFloatEditor.java | 18 + .../design/cell/editor/ChartCellEditor.java | 18 +- .../design/cell/editor/ChartFloatEditor.java | 16 +- .../fr/design/mainframe/ElementCasePane.java | 10 +- .../fr/start/module/DesignerActivator.java | 49 +- 25 files changed, 1209 insertions(+), 413 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/auto_chart.png create mode 100644 designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java create mode 100644 designer-chart/src/main/java/com/fr/design/chart/AutoChartIcon.java create mode 100644 designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java create mode 100644 designer-chart/src/main/resources/com/fr/design/images/form/toolbar/auto_chart.png create mode 100644 designer-form/src/main/java/com/fr/design/designer/creator/XAutoChartCreator.java create mode 100644 designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java create mode 100644 designer-realize/src/main/java/com/fr/design/actions/insert/flot/AutoChartFloatAction.java create mode 100644 designer-realize/src/main/java/com/fr/design/cell/editor/AutoChartCellEditor.java create mode 100644 designer-realize/src/main/java/com/fr/design/cell/editor/AutoChartFloatEditor.java diff --git a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java index b0b57f29c3..cfc4dbfb0b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java @@ -11,6 +11,10 @@ import com.fr.general.IOUtils; import javax.swing.JCheckBox; import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; @@ -22,10 +26,6 @@ import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; public class UICheckListPopup extends UIPopupMenu { private List listeners = new ArrayList(); @@ -68,6 +68,11 @@ public class UICheckListPopup extends UIPopupMenu { addCheckboxValues(values); } + public void refreshCheckboxValues(Object[] value){ + this.values = value; + addCheckboxValues(values); + } + public void addCheckboxValues(Object[] value) { checkboxPane.removeAll(); checkBoxList.clear(); 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 0652f9cf8f..b88c157a8f 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 @@ -17,6 +17,9 @@ import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.event.PopupMenuEvent; import javax.swing.event.PopupMenuListener; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -29,9 +32,6 @@ import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; /** * 设计器下拉复选框组件 @@ -198,7 +198,7 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam */ public void refreshCombo(Object[] value) { this.values = value; - this.popup.addCheckboxValues(value); + this.popup.refreshCheckboxValues(value); } /** diff --git a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java index 9669b7cf92..fbf269477c 100644 --- a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java +++ b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java @@ -19,11 +19,10 @@ import com.fr.plugin.solution.sandbox.collection.PluginSandboxCollections; import com.fr.stable.StableUtils; import org.jetbrains.annotations.NotNull; +import java.lang.reflect.Constructor; import java.awt.Dialog; import java.awt.Frame; import java.awt.Window; -import java.lang.reflect.Constructor; -import java.util.ArrayList; /** * Created by IntelliJ IDEA. @@ -45,6 +44,7 @@ public class DesignModuleFactory { private Class chartEditorClass; private Class chartComponentClass; private Class chartDialogClass; + private Class autoChartDialogClass; private Class chartPropertyPaneClass; private Class newFormAction; private Class formParaDesigner; @@ -100,6 +100,10 @@ public class DesignModuleFactory { instance.chartDialogClass = cd; } + public static void registerAutoChartDialogClass(Class autoChartDialogClass) { + instance.autoChartDialogClass = autoChartDialogClass; + } + public static void registerChartPropertyPaneClass(Class p) { instance.chartPropertyPaneClass = p; } @@ -205,6 +209,26 @@ public class DesignModuleFactory { return null; } + /** + * kunsnat: 初始化图表向导对话框, 调用静态方法showWindow, 参数window. + * + * @return 返回调出的图表自动推荐ChartDialog + */ + public static MiddleChartDialog getAutoChartDialog(Window window) { + try { + Constructor c; + if (window instanceof Frame) { + c = instance.autoChartDialogClass.getConstructor(Frame.class); + } else { + c = instance.autoChartDialogClass.getConstructor(Dialog.class); + } + return c.newInstance(window); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return null; + } + /** * kunsnat: 获取图表属性界面 * diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/auto_chart.png b/designer-base/src/main/resources/com/fr/design/images/m_insert/auto_chart.png new file mode 100644 index 0000000000000000000000000000000000000000..c6de0fe5e05a697ee5ae011930c47bd18ea5ecfc GIT binary patch literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|96eneLo5W7 z6BY;3W8U9kpP49tfO gIGB?zbNiJt7+UZsWXSz~4>XLy)78&qol`;+0E~brMF0Q* literal 0 HcmV?d00001 diff --git a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java index 4eb7258348..e37409075a 100644 --- a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java @@ -12,8 +12,10 @@ import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.chart.fun.ChartTypeUIProvider; import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.condition.ConditionAttributesPane; +import com.fr.design.gui.core.CustomWidgetOption; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.ChartEditPane; import com.fr.design.mainframe.chart.ChartsConfigPane; @@ -41,6 +43,7 @@ import com.fr.design.type.ui.RangeChartTypeUI; import com.fr.design.type.ui.StockChartTypeUI; import com.fr.design.type.ui.XYScatterChartTypeUI; import com.fr.extended.chart.AbstractChart; +import com.fr.form.ui.ChartAutoEditor; import com.fr.form.ui.ChartEditor; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; @@ -162,8 +165,13 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr public static WidgetOption[] initWidgetOption() { String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDs(); - ChartWidgetOption[] child = new ChartWidgetOption[chartIDs.length]; - int index = 0; + List child = new ArrayList<>(); + if (ChartTypeManager.AUTO_CHART) { + //TODO @Bjorn 视觉样式优化icon + child.add(new CustomWidgetOption(Toolkit.i18nText("Fine-Design_Chart_M_Popup_Auto_Chart_Type"), + IOUtils.readIcon("com/fr/design/images/form/toolbar/auto_chart.png"), ChartAutoEditor.class)); + } + for (String chartID : chartIDs) { ChartProvider[] rowChart = ChartTypeManager.getInstance().getCharts(chartID); if (ArrayUtils.isEmpty(rowChart) && !ChartTypeManager.innerChart(chartID)) { @@ -172,11 +180,10 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr String name = ChartTypeInterfaceManager.getInstance().getName(chartID); String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(chartID); Icon icon = IOUtils.readIcon(iconPath); - child[index] = new ChartWidgetOption(name, icon, ChartEditor.class, chartID); - index++; + child.add(new ChartWidgetOption(name, icon, ChartEditor.class, chartID)); } - return child; + return child.toArray(new WidgetOption[child.size()]); } private static void readVanChart() { diff --git a/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java b/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java new file mode 100644 index 0000000000..4c5225a5a9 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java @@ -0,0 +1,69 @@ +package com.fr.design.chart; + +import com.fr.base.chart.BaseChartCollection; +import com.fr.base.chart.chartdata.TopDefinitionProvider; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.plugin.chart.vanchart.VanChart; + +import java.awt.Component; +import java.awt.Dialog; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-05-28 + */ +public class AutoChartDialog extends ChartDialog { + + private AutoChartTypePane autoChartTypePane; + + public AutoChartDialog(Frame owner) { + super(owner); + } + + public AutoChartDialog(Dialog owner) { + super(owner); + } + + protected Component initCenterPane() { + autoChartTypePane = new AutoChartTypePane(); + + return autoChartTypePane; + } + + protected void addOkAction() { + ok.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + ChartCollection chartCollection = (ChartCollection) getChartCollection(); + autoChartTypePane.update(chartCollection); + if (chartCollection.getChartCount() > 0) { + doOK(); + } else { + doCancel(); + } + } + }); + } + + /** + * 更新新建的图表 ChartCollection + */ + public void populate(BaseChartCollection cc) { + super.populate(cc); + ChartCollection chartCollection = (ChartCollection) getChartCollection(); + VanChart vanChart = chartCollection.getSelectedChartProvider(VanChart.class); + if (vanChart == null) { + return; + } + TopDefinitionProvider filterDefinition = vanChart.getFilterDefinition(); + if (filterDefinition == null) { + return; + } + String tableName = vanChart.getFilterDefinition().getTableName(); + String[] dataFields = vanChart.getFilterDefinition().getDataFields(); + autoChartTypePane.populate(tableName, dataFields); + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chart/AutoChartIcon.java b/designer-chart/src/main/java/com/fr/design/chart/AutoChartIcon.java new file mode 100644 index 0000000000..426dab0403 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chart/AutoChartIcon.java @@ -0,0 +1,108 @@ +package com.fr.design.chart; + +import com.fr.base.ScreenResolution; +import com.fr.base.chart.BaseChartPainter; +import com.fr.base.chart.chartdata.CallbackEvent; +import com.fr.base.chart.result.WebChartIDInfo; +import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.design.ChartTypeInterfaceManager; +import com.fr.design.file.HistoryTemplateListPane; +import com.fr.script.Calculator; + +import javax.swing.Icon; +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Paint; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-05-29 + */ +public class AutoChartIcon implements Icon { + + private static final int WIDTH = 500; + private static final int HEIGHT = 281; + + private ChartCollection chartCollection; + private CallbackEvent callbackEvent; + + private String chartName; + + public AutoChartIcon(ChartCollection chartCollection) { + this.chartCollection = chartCollection; + initChartName(); + } + + public ChartCollection getChartCollection() { + return chartCollection; + } + + public String getChartName() { + return chartName; + } + + private void initChartName() { + Chart chart = chartCollection.getSelectedChart(Chart.class); + String[] subName = ChartTypeInterfaceManager.getInstance().getSubName(chart.getPlot().getPlotID()); + chartName = subName[0]; + } + + public void registerCallBackEvent(CallbackEvent callbackEvent) { + this.callbackEvent = callbackEvent; + } + + /** + * 画出缩略图Icon + * + * @param g 图形的上下文 + * @param c 所在的Component + * @param x 缩略图的起始坐标x + * @param y 缩略图的起始坐标y + */ + @Override + public void paintIcon(Component c, Graphics g, int x, int y) { + + BaseChartPainter painter = chartCollection.createResultChartPainterWithOutDealFormula(Calculator.createCalculator(), + WebChartIDInfo.createEmptyDesignerInfo(), getIconWidth(), getIconHeight()); + + int resolution = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution(); + if (resolution == 0) { + resolution = ScreenResolution.getScreenResolution(); + } + + Graphics2D g2d = (Graphics2D) g; + Paint oldPaint = g2d.getPaint(); + g.translate(x, y); + g2d.setPaint(Color.white); + g2d.fillRect(0, 0, getIconWidth(), getIconHeight()); + + painter.paint(g2d, getIconWidth(), getIconHeight(), resolution, null, callbackEvent); + + g.translate(-x, -y); + g2d.setPaint(oldPaint); + } + + /** + * 返回缩略图的宽度 + * + * @return int 缩略图宽度 + */ + @Override + public int getIconWidth() { + return WIDTH; + } + + /** + * 返回缩略图的高度 + * + * @return int 缩略图高度 + */ + @Override + public int getIconHeight() { + return HEIGHT; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java new file mode 100644 index 0000000000..8100e2ad56 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java @@ -0,0 +1,230 @@ +package com.fr.design.chart; + +import com.fr.base.chart.BaseChartCollection; +import com.fr.base.chart.BaseChartGetter; +import com.fr.base.chart.chartdata.CallbackEvent; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.chartx.attr.ChartProvider; +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.gui.ibutton.UIButton; +import com.fr.design.gui.icombocheckbox.UIComboCheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.plugin.chart.area.VanChartAreaPlot; +import com.fr.plugin.chart.column.VanChartColumnPlot; +import com.fr.plugin.chart.line.VanChartLinePlot; +import com.fr.plugin.chart.vanchart.VanChart; + +import javax.swing.BorderFactory; +import javax.swing.DefaultListCellRenderer; +import javax.swing.DefaultListModel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JSplitPane; +import javax.swing.ListCellRenderer; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-05-29 + */ +public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent { + + private JList chartViewList; + private DefaultListModel chartResultModel; + private UIButton refreshButton; + + private TableDataComboBox tableNameComboBox; + private UIComboCheckBox dataFieldBox; + + public AutoChartTypePane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + initButtonGroup(); + initRefreshLabel(); + initDataFiledBox(); + JPanel contentPane = createContentPane(); + + chartViewList = new JList(); + + chartResultModel = new DefaultListModel(); + chartViewList.setModel(chartResultModel); + chartViewList.setVisibleRowCount(0); + chartViewList.setLayoutOrientation(JList.HORIZONTAL_WRAP); + chartViewList.setCellRenderer(iconCellRenderer); + + JScrollPane subListPane = new JScrollPane(chartViewList); + + JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, contentPane, subListPane); + splitPane.setDividerLocation(60); + splitPane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Chart_M_Popup_Auto_Chart_Type"))); + this.add(splitPane); + } + + ListCellRenderer iconCellRenderer = new DefaultListCellRenderer() { + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + this.setText(""); + + AutoChartIcon chartIcon = (AutoChartIcon) value; + this.setIcon(chartIcon); + setHorizontalAlignment(UILabel.CENTER); + if (isSelected) { + // 深蓝色. + this.setBackground(new Color(57, 107, 181)); + this.setBorder(GUICoreUtils.createTitledBorder(chartIcon.getChartName(), Color.WHITE)); + } else { + this.setBorder(GUICoreUtils.createTitledBorder(chartIcon.getChartName())); + } + return this; + } + }; + + private JPanel createContentPane() { + JPanel panel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + + JPanel tableDataPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + panel.add(tableDataPane); + tableDataPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data") + ":")); + tableNameComboBox.setPreferredSize(new Dimension(96, 20)); + tableDataPane.add(tableNameComboBox); + + JPanel areaNamePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + panel.add(areaNamePane); + areaNamePane.add(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Field") + ":")); + areaNamePane.add(dataFieldBox); + panel.add(refreshButton); + return panel; + } + + private void initButtonGroup() { + dataFieldBox = new UIComboCheckBox(new Object[0]); + dataFieldBox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + checkButtonState(); + } + }); + } + + private void initDataFiledBox() { + tableNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); + tableNameComboBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + if (e.getStateChange() == ItemEvent.SELECTED) { + refreshBox(); + checkButtonState(); + } + } + }); + } + + private void checkButtonState() { + if (tableNameComboBox.getSelectedItem() != null && dataFieldBox.getSelectedValues().length > 0) { + refreshButton.setEnabled(true); + } else { + refreshButton.setEnabled(false); + } + } + + private void refreshBox() { + TableDataWrapper dataWrap = tableNameComboBox.getSelectedItem(); + + if (dataWrap == null) { + return; + } + dataFieldBox.clearText(); + + List columnNameList = dataWrap.calculateColumnNameList(); + + dataFieldBox.refreshCombo(columnNameList.toArray()); + } + + private void initRefreshLabel() { + refreshButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Recommend")); + refreshButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + calculateAutoChart(); + } + }); + refreshButton.setEnabled(false); + } + + private void calculateAutoChart() { + chartResultModel.clear(); + + //TODO 使用以下模拟数据,计算规则待补充 + BaseChartCollection chartCollection = BaseChartGetter.createChartCollection(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID); + VanChart selectedChart = ((ChartCollection) chartCollection).getSelectedChart(VanChart.class); + selectedChart.getTitle().setTextObject("自动图表标题"); + + BaseChartCollection chartCollection1 = BaseChartGetter.createChartCollection(VanChartLinePlot.VAN_CHART_LINE_PLOT); + VanChart selectedChart1 = ((ChartCollection) chartCollection1).getSelectedChart(VanChart.class); + selectedChart1.getTitle().setTextObject("自动图表标题"); + + BaseChartCollection chartCollection2 = BaseChartGetter.createChartCollection(VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID); + VanChart selectedChart2 = ((ChartCollection) chartCollection2).getSelectedChart(VanChart.class); + selectedChart2.getTitle().setTextObject("自动图表标题"); + + AutoChartIcon autoChartIcon = new AutoChartIcon((ChartCollection) chartCollection); + autoChartIcon.registerCallBackEvent(this); + AutoChartIcon autoChartIcon1 = new AutoChartIcon((ChartCollection) chartCollection1); + autoChartIcon1.registerCallBackEvent(this); + AutoChartIcon autoChartIcon2 = new AutoChartIcon((ChartCollection) chartCollection2); + autoChartIcon2.registerCallBackEvent(this); + + chartResultModel.addElement(autoChartIcon); + chartResultModel.addElement(autoChartIcon1); + chartResultModel.addElement(autoChartIcon2); + chartViewList.setSelectedIndex(0); + } + + @Override + public void populate(ChartCollection cc) { + + } + + @Override + public void update(ChartCollection cc) { + if (chartViewList.getSelectedIndex() < 0) { + return; + } + AutoChartIcon chartIcon = (AutoChartIcon) chartViewList.getSelectedValue(); + ChartProvider chartProvider = chartIcon.getChartCollection().getSelectedChartProvider(ChartProvider.class); + if (cc.getChartCount() > 0) { + cc.setSelectChart(chartProvider); + } else { + cc.addChart(chartProvider); + } + } + + public void populate(String tableName, String[] dataFields) { + tableNameComboBox.setSelectedTableDataByName(tableName); + Map map = new HashMap(); + for (String dataField : dataFields) { + map.put(dataField, true); + } + dataFieldBox.setSelectedValues(map); + } + + @Override + public void callback() { + this.repaint(); + } +} 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 65d6abd640..098b965d06 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 @@ -39,6 +39,7 @@ public class ChartDesignerActivator extends Activator implements Prepare { DesignModuleFactory.registerChartComponentClass(ChartComponent.class); DesignModuleFactory.registerChartDialogClass(ChartDialog.class); + DesignModuleFactory.registerAutoChartDialogClass(AutoChartDialog.class); DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); 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 623271873e..bd6a2cf7e7 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 @@ -10,6 +10,7 @@ import com.fr.third.joda.time.DateTime; import javax.swing.JPanel; import java.awt.BorderLayout; +import java.awt.Component; import java.awt.Dialog; import java.awt.FlowLayout; import java.awt.Frame; @@ -18,15 +19,17 @@ import java.awt.event.ActionListener; /** * 封装一层 图表新建的对话框, 配合属性表确定: 先单独只要一种图表类型的对话框. + * * @author kunsnat E-mail:kunsnat@gmail.com * @version 创建时间:2013-1-7 下午07:29:15 */ public class ChartDialog extends MiddleChartDialog { - - private BaseChartCollection cc; - - private UIButton ok; - private UIButton cancel; + + private BaseChartCollection cc; + + protected UIButton ok; + protected UIButton cancel; + private ChartTypePane chartTypePane; public ChartDialog(Frame owner) { super(owner); @@ -37,57 +40,62 @@ public class ChartDialog extends MiddleChartDialog { super(owner); initComponent(); } - - 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(); - setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_M_Popup_Chart_Type")); + private void initComponent() { + this.setModal(true); + this.setLayout(new BorderLayout()); + setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_M_Popup_Chart_Type")); this.applyClosingAction(); this.applyEscapeAction(); - this.setBasicDialogSize(BasicDialog.DEFAULT); - this.add(chartTypePane, BorderLayout.CENTER); - - JPanel buttonPane = new JPanel(); - buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); - - this.add(buttonPane, BorderLayout.SOUTH); - - ok = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")); - cancel = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cancel")); - - buttonPane.add(ok); - buttonPane.add(cancel); - - ok.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - chartTypePane.update((ChartCollection)cc, createTime); - doOK(); - } - }); - - cancel.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - doCancel(); - } - }); - - GUICoreUtils.setWindowCenter(getOwner(), this); + this.setBasicDialogSize(BasicDialog.DEFAULT); + this.add(initCenterPane(), BorderLayout.CENTER); + + JPanel buttonPane = new JPanel(); + buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); + this.add(buttonPane, BorderLayout.SOUTH); + + ok = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")); + cancel = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cancel")); + + addOkAction(); + cancel.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + doCancel(); + } + }); + + buttonPane.add(ok); + buttonPane.add(cancel); + + GUICoreUtils.setWindowCenter(getOwner(), this); + } + + protected Component initCenterPane() { + chartTypePane = new ChartTypePane(); + return chartTypePane; + } + + protected void addOkAction() { + final String createTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); + ok.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + chartTypePane.update((ChartCollection) cc, createTime); + doOK(); + } + }); } /** * 不处理 */ - public void checkValid() throws Exception { - - } - - /** - * 更新新建的图表 ChartCollection - */ + public void checkValid() throws Exception { + + } + + /** + * 更新新建的图表 ChartCollection + */ public void populate(BaseChartCollection cc) { if (cc == null) { return; 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 aa7f9107b2..85b13aef7e 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 @@ -140,6 +140,9 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene public void paintComponent(Graphics g) { // super.paintComponent(g); + if(chartCollection4Design.getChartCount() == 0) { + return; + } Graphics2D g2d = (Graphics2D) g; 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 6c7edc2d2f..6719401bb2 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 @@ -6,28 +6,36 @@ import com.fr.chartx.attr.ChartProvider; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.dialog.BasicScrollPane; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.gui.chart.MiddleChartDialog; import com.fr.design.gui.frpane.UIComboBoxPane; +import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.ChartEditPane; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.item.FlexibleComboBox; import com.fr.design.mainframe.chart.gui.item.ItemEventType; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; +import com.fr.design.module.DesignModuleFactory; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.awt.CardLayout; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; /** * 图表 属性表, 类型选择 界面. @@ -39,11 +47,12 @@ public class ChartTypePane extends AbstractChartAttrPane{ private ChartTypeButtonPane buttonPane; private ChartEditPane editPane; private ChartCollection editingCollection; + private UIButton autoButton; @Override protected JPanel createContentPane() { JPanel content = new JPanel(new BorderLayout()); - + buttonPane = new ChartTypeButtonPane(this); content.add(buttonPane, BorderLayout.NORTH); @@ -76,9 +85,14 @@ public class ChartTypePane extends AbstractChartAttrPane{ } }; content.add(scrollPane, BorderLayout.CENTER); - + buttonPane.setEditingChartPane(chartTypeComBox); - + + if(ChartTypeManager.AUTO_CHART) { + initAutoButton(); + content.add(autoButton, BorderLayout.SOUTH); + } + return content; } @@ -97,6 +111,25 @@ public class ChartTypePane extends AbstractChartAttrPane{ return PaneTitleConstants.CHART_TYPE_TITLE; } + private void initAutoButton(){ + //TODO @Bjorn 视觉样式优化 + autoButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_M_Popup_Auto_Chart_Type")); + autoButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + final MiddleChartDialog autoChartDialog = DesignModuleFactory.getAutoChartDialog(DesignerContext.getDesignerFrame()); + autoChartDialog.populate(editingCollection); + autoChartDialog.addDialogActionListener(new DialogActionAdapter() { + @Override + public void doOk() { + populate(editingCollection); + } + }); + autoChartDialog.setVisible(true); + } + }); + } + class ComboBoxPane extends UIComboBoxPane { private Map>> allChartTypePane; diff --git a/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/auto_chart.png b/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/auto_chart.png new file mode 100644 index 0000000000000000000000000000000000000000..e07ad0583983e651035913baa10b34351d528b3b GIT binary patch literal 179 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP*AeO zHKHUqKdq!Zu_%?nF(p4KRlzeiF+DXXH8G{K@MNkDP?3YDi(^Q|t)xHy|JyU0eRw@V zwTor;-9opVS2H9uSeWw}xK~Pvq}% - private DesignerEditor designerEditor; - // private DesignerEditor designerEditor; - //marro:无奈的属性,暂时想不出好办法 - private boolean isRefreshing = false; - - private boolean isEditing = false; - - private boolean isHovering = false; - private static final Color OUTER_BORDER_COLOR = new Color(65, 155, 249, 30); - private static final Color INNER_BORDER_COLOR = new Color(65, 155, 249); - - public XChartEditor(BaseChartEditor editor) { - this(editor, new Dimension(250, 150)); - } - - public XChartEditor(BaseChartEditor editor, Dimension size) { - super((Widget)editor, size); - } - - @Override - public String getIconPath() { - return super.getIconPath(); - } - - - @Override - protected String getIconName() { - return "Chart.png"; - } - - /** - * 返回组件默认名 - * @return 组件类名(小写) - */ - public String createDefaultName() { - return "chart"; - } - - /** - * 是否支持设置标题 - * @return 是返回true - */ - public boolean hasTitleStyle() { - return true; - } - - @Override - public void stopEditing() { - isEditing = false; - } - - /** - * 得到属性名 - * @return 属性名 - * @throws java.beans.IntrospectionException - */ - 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("visible", this.data.getClass()).setI18NName( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Visible")).setPropertyChangeListener(new PropertyChangeAdapter() { - - @Override - public void propertyChange() { - makeVisible(toData().isVisible());} - }), - new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( - WLayoutBorderStyleEditor.class).setI18NName( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") - .setPropertyChangeListener(new PropertyChangeAdapter() { - - @Override - public void propertyChange() { - initStyle(); - } - }), - }; - } - - /** - * 该组件是否可以拖入参数面板 - * @return 是则返回true - */ - public boolean canEnterIntoParaPane(){ - return false; - } - - - /** - * 编辑状态的时候需要重新绘制下边框 - * - */ - @Override - public void paintBorder(Graphics g, Rectangle bounds){ - if(isEditing){ - g.setColor(OUTER_BORDER_COLOR); - GraphHelper.draw(g, new Rectangle(bounds.x - BORDER_WIDTH, bounds.y - BORDER_WIDTH, bounds.width + BORDER_WIDTH + 1, bounds.height + BORDER_WIDTH + 1), Constants.LINE_LARGE); - }else if(!isHovering){ - super.paintBorder(g, bounds); - } - } - - - /** - * 返回设计器的Editor - */ - public DesignerEditor getDesignerEditor() { - return designerEditor; - } - - @Override - protected void initXCreatorProperties() { - super.initXCreatorProperties(); - initBorderStyle(); - BaseChartCollection collection = ((BaseChartEditor) data).getChartCollection(); - isRefreshing = true; - ((MiddleChartComponent) designerEditor.getEditorTarget()).populate(collection); - isRefreshing = false; - } - - /** - * 点击选中的时候, 刷新界面 - * 右键 reset之后, 触发事件 populate此方法 - * - * @param jform 表单 - * @param formDesigner 表单设计器 - * @return 控件. - */ - public JComponent createToolPane(final BaseJForm jform, final FormDesigner formDesigner) { - MiddleChartComponent middleChartComponent = getDesignerEditorTarget(); - if (null != middleChartComponent) { - middleChartComponent.addStopEditingListener(new PropertyChangeAdapter() { - public void propertyChange() { - JComponent pane = jform.getEditingPane(); - if (pane instanceof BaseChartPropertyPane) { - ((BaseChartPropertyPane) pane).setSupportCellData(true); - MiddleChartComponent middleChartComponent = getDesignerEditorTarget(); - if (null != middleChartComponent) { - ((BaseChartPropertyPane) pane).populateChartPropertyPane(middleChartComponent.update(), formDesigner); - } - } - } - }); - } - if (isEditing){ - final BaseChartPropertyPane propertyPane = DesignModuleFactory.getChartPropertyPane(); - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - if (getDesignerEditor().getEditorTarget() != null) { - propertyPane.setSupportCellData(true); - MiddleChartComponent middleChartComponent = getDesignerEditorTarget(); - if (null != middleChartComponent) { - propertyPane.populateChartPropertyPane(middleChartComponent.update(), formDesigner); - } - } - } - }); - return (JComponent)propertyPane; - } - else{ - return (JComponent)DesignModuleFactory.getWidgetPropertyPane(formDesigner); - } - } - - private MiddleChartComponent getDesignerEditorTarget() { - MiddleChartComponent bcc = null; - if (getDesignerEditor().getEditorTarget() instanceof MiddleChartComponent) { - bcc = (MiddleChartComponent) getDesignerEditor().getEditorTarget(); - } - return bcc; - } - - /** - * 渲染Painter - */ - public void paint(Graphics g) { - designerEditor.paintEditor(g, this.getSize()); - super.paint(g); - if(isEditing){ - g.setColor(INNER_BORDER_COLOR); - GraphHelper.draw(g, new Rectangle(0, 0, getWidth(), getHeight()), Constants.LINE_MEDIUM); - } - } - - /** - * 初始化Editor大小. - * - * @return 返回大小. - */ - public Dimension initEditorSize() { - return BORDER_PREFERRED_SIZE; - } - - /** - * 响应点击事件 - * - * @param editingMouseListener 鼠标点击,位置处理器 - * @param e 鼠标点击事件 - */ - public void respondClick(EditingMouseListener editingMouseListener,MouseEvent e){ - FormDesigner designer = editingMouseListener.getDesigner(); - SelectionModel selectionModel = editingMouseListener.getSelectionModel(); - isEditing = e.getButton() == MouseEvent.BUTTON1 && - (e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR); - displayCoverPane(!isEditing); - selectionModel.selectACreatorAtMouseEvent(e); - - if (editingMouseListener.stopEditing()) { - if (this != (XCreator)designer.getRootComponent()) { - ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this); - editingMouseListener.startEditing(this, isEditing ? adapter.getDesignerEditor() : null, adapter); - } - } - HelpDialogManager.getInstance().setPane(coverPanel); - if (this.isHelpBtnOnFocus()) { - coverPanel.setMsgDisplay(e); - } - } - - @Override - protected JComponent initEditor() { - if (designerEditor == null) { - final MiddleChartComponent chartComponent = DesignModuleFactory.getChartComponent(((BaseChartEditor) data).getChartCollection()); - if (chartComponent != null) { - JComponent jChart = chartComponent; - jChart.setBorder(BorderFactory.createLineBorder(Color.lightGray)); - designerEditor = new DesignerEditor(jChart); - chartComponent.addStopEditingListener(designerEditor); - designerEditor.addPropertyChangeListener(new PropertyChangeAdapter() { - public void propertyChange() { - if (!isRefreshing) { - ((BaseChartEditor) data).resetChangeChartCollection(chartComponent.update()); - } - } - }); - } - } - - if (editor == null) { - setBorder(DEFALUTBORDER); - editor = new JPanel(); - editor.setBackground(null); - editor.setLayout(null); - editor.setOpaque(false); - - coverPanel = new CoverReportPane(); - coverPanel.setPreferredSize(this.getPreferredSize()); - coverPanel.setBounds(this.getBounds()); - - editor.add(coverPanel); - coverPanel.setVisible(false); - } - return editor; - } - - /** - * 是否展现覆盖的pane - * @param display 是否 - */ - public void displayCoverPane(boolean display){ - isHovering = display; - coverPanel.setVisible(display); - coverPanel.setPreferredSize(editor.getPreferredSize()); - coverPanel.setBounds(editor.getBounds()); - editor.repaint(); - } - - public JComponent getCoverPane(){ - return coverPanel; - } - - /** - * 是否支持设置可用 - * return boolean - */ - public boolean supportSetEnable(){ - return false; - } - - /** - * data属性改变触发其他操作 - * - */ - public void firePropertyChange(){ - initStyle(); - } - - @Override - public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { - return new WidgetPropertyUIProvider[]{ new ChartEditorPropertyUI(this)}; - } - - /** - * 是否支持共享-现只支持报表块、图表、tab块、绝对布局 - * @return - */ - public boolean isSupportShared() { - return true; - } - - @Override - public boolean supportMobileStyle() { - return false; - } + private static final long serialVersionUID = -7009439442104836657L; + private static final int BORDER_WIDTH = 2; + //具体来说是DesignerEditor + private DesignerEditor designerEditor; + // private DesignerEditor designerEditor; + //marro:无奈的属性,暂时想不出好办法 + private boolean isRefreshing = false; + + protected boolean isEditing = false; + + private boolean isHovering = false; + private static final Color OUTER_BORDER_COLOR = new Color(65, 155, 249, 30); + private static final Color INNER_BORDER_COLOR = new Color(65, 155, 249); + + public XChartEditor(BaseChartEditor editor) { + this(editor, new Dimension(250, 150)); + } + + public XChartEditor(BaseChartEditor editor, Dimension size) { + super((Widget) editor, size); + } + + @Override + public String getIconPath() { + return super.getIconPath(); + } + + + @Override + protected String getIconName() { + return "Chart.png"; + } + + /** + * 返回组件默认名 + * + * @return 组件类名(小写) + */ + public String createDefaultName() { + return "chart"; + } + + /** + * 是否支持设置标题 + * + * @return 是返回true + */ + public boolean hasTitleStyle() { + return true; + } + + @Override + public void stopEditing() { + isEditing = false; + } + + + /** + * 得到属性名 + * + * @return 属性名 + * @throws java.beans.IntrospectionException + */ + 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("visible", this.data.getClass()).setI18NName( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Visible")).setPropertyChangeListener(new PropertyChangeAdapter() { + + @Override + public void propertyChange() { + makeVisible(toData().isVisible()); + } + }), + new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( + WLayoutBorderStyleEditor.class).setI18NName( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") + .setPropertyChangeListener(new PropertyChangeAdapter() { + + @Override + public void propertyChange() { + initStyle(); + } + }), + }; + } + + /** + * 该组件是否可以拖入参数面板 + * + * @return 是则返回true + */ + public boolean canEnterIntoParaPane() { + return false; + } + + + /** + * 编辑状态的时候需要重新绘制下边框 + */ + @Override + public void paintBorder(Graphics g, Rectangle bounds) { + if (isEditing) { + g.setColor(OUTER_BORDER_COLOR); + GraphHelper.draw(g, new Rectangle(bounds.x - BORDER_WIDTH, bounds.y - BORDER_WIDTH, bounds.width + BORDER_WIDTH + 1, bounds.height + BORDER_WIDTH + 1), Constants.LINE_LARGE); + } else if (!isHovering) { + super.paintBorder(g, bounds); + } + } + + + /** + * 返回设计器的Editor + */ + public DesignerEditor getDesignerEditor() { + return designerEditor; + } + + @Override + protected void initXCreatorProperties() { + super.initXCreatorProperties(); + initBorderStyle(); + BaseChartCollection collection = ((BaseChartEditor) data).getChartCollection(); + isRefreshing = true; + ((MiddleChartComponent) designerEditor.getEditorTarget()).populate(collection); + isRefreshing = false; + } + + /** + * 点击选中的时候, 刷新界面 + * 右键 reset之后, 触发事件 populate此方法 + * + * @param jform 表单 + * @param formDesigner 表单设计器 + * @return 控件. + */ + public JComponent createToolPane(final BaseJForm jform, final FormDesigner formDesigner) { + MiddleChartComponent middleChartComponent = getDesignerEditorTarget(); + if (null != middleChartComponent) { + middleChartComponent.addStopEditingListener(new PropertyChangeAdapter() { + public void propertyChange() { + JComponent pane = jform.getEditingPane(); + if (pane instanceof BaseChartPropertyPane) { + ((BaseChartPropertyPane) pane).setSupportCellData(true); + MiddleChartComponent middleChartComponent = getDesignerEditorTarget(); + if (null != middleChartComponent) { + ((BaseChartPropertyPane) pane).populateChartPropertyPane(middleChartComponent.update(), formDesigner); + } + } + } + }); + } + if (isEditing) { + final BaseChartPropertyPane propertyPane = DesignModuleFactory.getChartPropertyPane(); + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + if (getDesignerEditor().getEditorTarget() != null) { + propertyPane.setSupportCellData(true); + MiddleChartComponent middleChartComponent = getDesignerEditorTarget(); + if (null != middleChartComponent) { + propertyPane.populateChartPropertyPane(middleChartComponent.update(), formDesigner); + } + } + } + }); + return (JComponent) propertyPane; + } else { + return (JComponent) DesignModuleFactory.getWidgetPropertyPane(formDesigner); + } + } + + private MiddleChartComponent getDesignerEditorTarget() { + MiddleChartComponent bcc = null; + if (getDesignerEditor().getEditorTarget() instanceof MiddleChartComponent) { + bcc = (MiddleChartComponent) getDesignerEditor().getEditorTarget(); + } + return bcc; + } + + /** + * 渲染Painter + */ + public void paint(Graphics g) { + designerEditor.paintEditor(g, this.getSize()); + super.paint(g); + if (isEditing) { + g.setColor(INNER_BORDER_COLOR); + GraphHelper.draw(g, new Rectangle(0, 0, getWidth(), getHeight()), Constants.LINE_MEDIUM); + } + } + + /** + * 初始化Editor大小. + * + * @return 返回大小. + */ + public Dimension initEditorSize() { + return BORDER_PREFERRED_SIZE; + } + + /** + * 响应点击事件 + * + * @param editingMouseListener 鼠标点击,位置处理器 + * @param e 鼠标点击事件 + */ + public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e) { + FormDesigner designer = editingMouseListener.getDesigner(); + SelectionModel selectionModel = editingMouseListener.getSelectionModel(); + isEditing = e.getButton() == MouseEvent.BUTTON1 && + (e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR); + displayCoverPane(!isEditing); + selectionModel.selectACreatorAtMouseEvent(e); + + if (editingMouseListener.stopEditing()) { + if (this != (XCreator) designer.getRootComponent()) { + ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this); + editingMouseListener.startEditing(this, isEditing ? adapter.getDesignerEditor() : null, adapter); + } + } + HelpDialogManager.getInstance().setPane(coverPanel); + if (this.isHelpBtnOnFocus()) { + coverPanel.setMsgDisplay(e); + } + } + + @Override + protected JComponent initEditor() { + if (designerEditor == null) { + final MiddleChartComponent chartComponent = DesignModuleFactory.getChartComponent(((BaseChartEditor) data).getChartCollection()); + if (chartComponent != null) { + JComponent jChart = chartComponent; + jChart.setBorder(BorderFactory.createLineBorder(Color.lightGray)); + designerEditor = new DesignerEditor(jChart); + chartComponent.addStopEditingListener(designerEditor); + designerEditor.addPropertyChangeListener(new PropertyChangeAdapter() { + public void propertyChange() { + if (!isRefreshing) { + ((BaseChartEditor) data).resetChangeChartCollection(chartComponent.update()); + } + } + }); + } + } + + if (editor == null) { + setBorder(DEFALUTBORDER); + editor = new JPanel(); + editor.setBackground(null); + editor.setLayout(null); + editor.setOpaque(false); + + coverPanel = new CoverReportPane(); + coverPanel.setPreferredSize(this.getPreferredSize()); + coverPanel.setBounds(this.getBounds()); + + editor.add(coverPanel); + coverPanel.setVisible(false); + } + return editor; + } + + /** + * 是否展现覆盖的pane + * + * @param display 是否 + */ + public void displayCoverPane(boolean display) { + isHovering = display; + coverPanel.setVisible(display); + coverPanel.setPreferredSize(editor.getPreferredSize()); + coverPanel.setBounds(editor.getBounds()); + editor.repaint(); + } + + public JComponent getCoverPane() { + return coverPanel; + } + + /** + * 是否支持设置可用 + * return boolean + */ + public boolean supportSetEnable() { + return false; + } + + /** + * data属性改变触发其他操作 + */ + public void firePropertyChange() { + initStyle(); + } + + @Override + public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { + return new WidgetPropertyUIProvider[]{new ChartEditorPropertyUI(this)}; + } + + /** + * 是否支持共享-现只支持报表块、图表、tab块、绝对布局 + * + * @return + */ + public boolean isSupportShared() { + return true; + } + + @Override + public boolean supportMobileStyle() { + return false; + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index d14780054a..1a2df828ce 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 @@ -19,6 +19,7 @@ import com.fr.form.parameter.FormSubmitButton; import com.fr.form.ui.Button; import com.fr.form.ui.CardAddButton; import com.fr.form.ui.CardSwitchButton; +import com.fr.form.ui.ChartAutoEditor; import com.fr.form.ui.CheckBox; import com.fr.form.ui.CheckBoxGroup; import com.fr.form.ui.ComboBox; @@ -174,6 +175,7 @@ public class XCreatorUtils { private static void putExtraEditor() { if (DesignModuleFactory.getChartEditorClass() != null) { objectMap.put(DesignModuleFactory.getChartEditorClass(), XChartEditor.class); + objectMap.put(ChartAutoEditor.class, XAutoChartCreator.class); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java new file mode 100644 index 0000000000..13990f7d84 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java @@ -0,0 +1,57 @@ +package com.fr.design.actions.insert.cell; + +import com.fr.base.BaseUtils; +import com.fr.chart.chartattr.AutoChartCollection; +import com.fr.design.actions.core.WorkBookSupportable; +import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.menu.MenuKeySet; + +import javax.swing.KeyStroke; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-05-28 + */ +public class AutoChartCellAction extends AbstractCellAction implements WorkBookSupportable { + + public AutoChartCellAction() { + initAction(); + } + + public AutoChartCellAction(ElementCasePane t) { + super(t); + initAction(); + } + + private void initAction() { + this.setMenuKeySet(INSERT_AUTO_CHART); + this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setMnemonic(getMenuKeySet().getMnemonic()); + //TODO @Bjorn 视觉样式优化icon + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/auto_chart.png")); + } + + public static final MenuKeySet INSERT_AUTO_CHART = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'M'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Auto_Chart"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; + + + @Override + public Class getCellValueClass() { + return AutoChartCollection.class; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/AutoChartFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/AutoChartFloatAction.java new file mode 100644 index 0000000000..92e9cca3d4 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/AutoChartFloatAction.java @@ -0,0 +1,53 @@ +package com.fr.design.actions.insert.flot; + +import com.fr.base.BaseUtils; +import com.fr.design.gui.chart.MiddleChartDialog; +import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.menu.MenuKeySet; +import com.fr.design.module.DesignModuleFactory; + +import javax.swing.KeyStroke; +import java.awt.Window; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-05-28 + */ +public class AutoChartFloatAction extends ChartFloatAction { + + /** + * 构造函数 图表插入悬浮元素 + */ + public AutoChartFloatAction(ElementCasePane t) { + super(t); + } + + protected void init() { + this.setMenuKeySet(FLOAT_INSERT_AUTO_CHART); + this.setName(getMenuKeySet().getMenuKeySetName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/auto_chart.png")); + } + + public static final MenuKeySet FLOAT_INSERT_AUTO_CHART = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'M'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Auto_Chart"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; + + protected MiddleChartDialog getMiddleChartDialog(Window window) { + return DesignModuleFactory.getAutoChartDialog(window); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ChartFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ChartFloatAction.java index 39b11d4c2a..1d1e07c628 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ChartFloatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/ChartFloatAction.java @@ -27,6 +27,7 @@ import com.fr.stable.unit.OLDPIX; import javax.swing.KeyStroke; import java.awt.Color; +import java.awt.Window; /** * 图表插入悬浮元素的操作. @@ -40,6 +41,10 @@ public class ChartFloatAction extends ElementCaseAction { */ public ChartFloatAction(ElementCasePane t) { super(t); + init(); + } + + protected void init() { this.setMenuKeySet(FLOAT_INSERT_CHART); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); @@ -78,7 +83,7 @@ public class ChartFloatAction extends ElementCaseAction { reportPane.stopEditing(); final BaseChartCollection cc = (BaseChartCollection) StableFactory.createXmlObject(BaseChartCollection.XML_TAG); - final MiddleChartDialog chartDialog = DesignModuleFactory.getChartDialog(DesignerContext.getDesignerFrame()); + final MiddleChartDialog chartDialog = getMiddleChartDialog(DesignerContext.getDesignerFrame()); chartDialog.populate(cc); chartDialog.addDialogActionListener(new DialogActionAdapter() { @Override @@ -124,4 +129,8 @@ public class ChartFloatAction extends ElementCaseAction { chartDialog.setVisible(true); return isRecordNeeded; } + + protected MiddleChartDialog getMiddleChartDialog(Window window) { + return DesignModuleFactory.getChartDialog(window); + } } diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/AutoChartCellEditor.java b/designer-realize/src/main/java/com/fr/design/cell/editor/AutoChartCellEditor.java new file mode 100644 index 0000000000..4102487667 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/AutoChartCellEditor.java @@ -0,0 +1,24 @@ +package com.fr.design.cell.editor; + +import com.fr.design.gui.chart.MiddleChartDialog; +import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.module.DesignModuleFactory; +import com.fr.report.elementcase.TemplateElementCase; + +import java.awt.Window; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-05-28 + */ +public class AutoChartCellEditor extends ChartCellEditor { + + public AutoChartCellEditor(ElementCasePane ePane) { + super(ePane); + } + + protected MiddleChartDialog getMiddleChartDialog(Window window) { + return DesignModuleFactory.getAutoChartDialog(window); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/AutoChartFloatEditor.java b/designer-realize/src/main/java/com/fr/design/cell/editor/AutoChartFloatEditor.java new file mode 100644 index 0000000000..19c8788d0d --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/AutoChartFloatEditor.java @@ -0,0 +1,18 @@ +package com.fr.design.cell.editor; + +import com.fr.design.gui.chart.MiddleChartDialog; +import com.fr.design.module.DesignModuleFactory; + +import java.awt.Window; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-05-28 + */ +public class AutoChartFloatEditor extends ChartFloatEditor { + + protected MiddleChartDialog getMiddleChartDialog(Window window) { + return DesignModuleFactory.getAutoChartDialog(window); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/ChartCellEditor.java b/designer-realize/src/main/java/com/fr/design/cell/editor/ChartCellEditor.java index 2774c8392a..67ccc48765 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/ChartCellEditor.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/ChartCellEditor.java @@ -1,21 +1,21 @@ package com.fr.design.cell.editor; -import java.awt.Component; - -import javax.swing.SwingUtilities; - import com.fr.base.chart.BaseChartCollection; +import com.fr.design.dialog.DialogActionListener; import com.fr.design.gui.chart.MiddleChartComponent; import com.fr.design.gui.chart.MiddleChartDialog; -import com.fr.design.module.DesignModuleFactory; -import com.fr.design.dialog.DialogActionListener; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.module.DesignModuleFactory; import com.fr.grid.Grid; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; import com.fr.stable.bridge.StableFactory; import com.fr.stable.core.PropertyChangeAdapter; +import javax.swing.SwingUtilities; +import java.awt.Component; +import java.awt.Window; + /** * CellEditor used to edit Chart object. */ @@ -67,7 +67,7 @@ public class ChartCellEditor extends AbstractCellEditor implements DialogActionL this.chartCellEditorDialog = null; return glyphComponent; } - this.chartCellEditorDialog = DesignModuleFactory.getChartDialog(SwingUtilities.getWindowAncestor(grid)); + this.chartCellEditorDialog = getMiddleChartDialog(SwingUtilities.getWindowAncestor(grid)); this.chartCellEditorDialog.addDialogActionListener(this); BaseChartCollection cc = (BaseChartCollection)StableFactory.createXmlObject(BaseChartCollection.XML_TAG); this.chartCellEditorDialog.populate(cc); @@ -84,4 +84,8 @@ public class ChartCellEditor extends AbstractCellEditor implements DialogActionL public void doCancel() { cancelCellEditing(); } + + protected MiddleChartDialog getMiddleChartDialog(Window window) { + return DesignModuleFactory.getChartDialog(window); + } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/ChartFloatEditor.java b/designer-realize/src/main/java/com/fr/design/cell/editor/ChartFloatEditor.java index 90adbb98d7..5087ad4ae8 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/ChartFloatEditor.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/ChartFloatEditor.java @@ -1,20 +1,20 @@ package com.fr.design.cell.editor; -import java.awt.Component; - -import javax.swing.SwingUtilities; - import com.fr.base.chart.BaseChartCollection; +import com.fr.design.dialog.DialogActionListener; import com.fr.design.gui.chart.MiddleChartComponent; import com.fr.design.gui.chart.MiddleChartDialog; import com.fr.design.module.DesignModuleFactory; -import com.fr.design.dialog.DialogActionListener; import com.fr.grid.Grid; import com.fr.report.cell.FloatElement; import com.fr.stable.StringUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.core.PropertyChangeAdapter; +import javax.swing.SwingUtilities; +import java.awt.Component; +import java.awt.Window; + public class ChartFloatEditor extends AbstractFloatEditor implements DialogActionListener { private MiddleChartDialog chartFloatEditorDialog = null; @@ -65,7 +65,7 @@ public class ChartFloatEditor extends AbstractFloatEditor implements DialogActio } return glyphComponent; } - this.chartFloatEditorDialog = DesignModuleFactory.getChartDialog(SwingUtilities.getWindowAncestor(grid)); + this.chartFloatEditorDialog = getMiddleChartDialog(SwingUtilities.getWindowAncestor(grid)); this.chartFloatEditorDialog.addDialogActionListener(this); BaseChartCollection cc = (BaseChartCollection)StableFactory.createXmlObject(BaseChartCollection.XML_TAG); this.chartFloatEditorDialog.populate(cc); @@ -82,4 +82,8 @@ public class ChartFloatEditor extends AbstractFloatEditor implements DialogActio public void doCancel() { cancelFloatEditing(); } + + protected MiddleChartDialog getMiddleChartDialog(Window window) { + return DesignModuleFactory.getChartDialog(window); + } } \ No newline at end of file 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 c9c9066183..24178bcfd4 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 @@ -9,6 +9,7 @@ import com.fr.base.Formula; import com.fr.base.ScreenResolution; import com.fr.base.Style; import com.fr.base.vcs.DesignerMode; +import com.fr.chart.chartattr.AutoChartCollection; import com.fr.design.DesignState; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -52,6 +53,8 @@ import com.fr.design.cell.bar.DynamicScrollBar; import com.fr.design.cell.clipboard.CellElementsClip; import com.fr.design.cell.clipboard.ElementsTransferable; import com.fr.design.cell.clipboard.FloatElementsClip; +import com.fr.design.cell.editor.AutoChartCellEditor; +import com.fr.design.cell.editor.AutoChartFloatEditor; import com.fr.design.cell.editor.BiasTextPainterCellEditor; import com.fr.design.cell.editor.CellEditor; import com.fr.design.cell.editor.ChartCellEditor; @@ -118,6 +121,8 @@ import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JScrollBar; import javax.swing.KeyStroke; +import java.lang.reflect.Constructor; +import java.util.Set; import java.awt.AWTEvent; import java.awt.Adjustable; import java.awt.Dimension; @@ -131,8 +136,6 @@ import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.lang.reflect.Constructor; -import java.util.Set; import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; @@ -399,6 +402,9 @@ public abstract class ElementCasePane extends Tar grid.setDefaultFloatEditor(chartClass, new ChartFloatEditor()); } + grid.setDefaultCellEditor(AutoChartCollection.class, new AutoChartCellEditor(this)); + grid.setDefaultFloatEditor(AutoChartCollection.class, new AutoChartFloatEditor()); + addExtraCellEditor(grid); grid.setDefaultFloatEditor(Formula.class, new FormulaFloatEditor()); 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 38efb4c1fc..45d31dcb1b 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 @@ -7,12 +7,14 @@ import com.fr.base.passport.FinePassportListenerAdapter; import com.fr.base.passport.FinePassportManager; import com.fr.base.process.ProcessOperator; import com.fr.chart.chartattr.ChartCollection; +import com.fr.chart.charttypes.ChartTypeManager; import com.fr.config.MarketConfig; import com.fr.decision.update.backup.RecoverManager; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.NewFormAction; import com.fr.design.actions.core.ActionFactory; +import com.fr.design.actions.insert.cell.AutoChartCellAction; import com.fr.design.actions.insert.cell.BiasCellAction; import com.fr.design.actions.insert.cell.ChartCellAction; import com.fr.design.actions.insert.cell.DSColumnCellAction; @@ -21,6 +23,7 @@ import com.fr.design.actions.insert.cell.GeneralCellAction; import com.fr.design.actions.insert.cell.ImageCellAction; import com.fr.design.actions.insert.cell.RichTextCellAction; import com.fr.design.actions.insert.cell.SubReportCellAction; +import com.fr.design.actions.insert.flot.AutoChartFloatAction; import com.fr.design.actions.insert.flot.ChartFloatAction; import com.fr.design.actions.insert.flot.FormulaFloatAction; import com.fr.design.actions.insert.flot.ImageFloatAction; @@ -112,11 +115,11 @@ import com.fr.start.BBSGuestPaneProvider; import com.fr.task.Once; import com.fr.xml.ReportXMLUtils; -import java.awt.*; -import java.awt.image.*; import java.util.ArrayList; import java.util.List; import java.util.Set; +import java.awt.Image; +import java.awt.image.BufferedImage; /** * Created by juhaoyu on 2018/1/31. @@ -222,16 +225,21 @@ public class DesignerActivator extends Activator { classes.add(provider.actionForInsertCellElement()); } - return ArrayUtils.addAll(new Class[]{ - DSColumnCellAction.class, - GeneralCellAction.class, - RichTextCellAction.class, - FormulaCellAction.class, - ChartCellAction.class, - ImageCellAction.class, - BiasCellAction.class, - SubReportCellAction.class - }, classes.toArray(new Class[classes.size()])); + List> baseClasses = new ArrayList<>(); + baseClasses.add(DSColumnCellAction.class); + baseClasses.add(GeneralCellAction.class); + baseClasses.add(RichTextCellAction.class); + baseClasses.add(FormulaCellAction.class); + baseClasses.add(ChartCellAction.class); + if(ChartTypeManager.AUTO_CHART) { + baseClasses.add(AutoChartCellAction.class); + } + baseClasses.add(ImageCellAction.class); + baseClasses.add(BiasCellAction.class); + baseClasses.add(SubReportCellAction.class); + + return ArrayUtils.addAll(baseClasses.toArray(new Class[baseClasses.size()]), + classes.toArray(new Class[classes.size()])); } private static Class[] actionsForInsertFloatElement() { @@ -240,12 +248,17 @@ public class DesignerActivator extends Activator { for (ElementUIProvider provider : providers) { classes.add(provider.actionForInsertFloatElement()); } - return ArrayUtils.addAll(new Class[]{ - TextBoxFloatAction.class, - FormulaFloatAction.class, - ChartFloatAction.class, - ImageFloatAction.class - }, classes.toArray(new Class[classes.size()])); + + List> baseClasses = new ArrayList<>(); + baseClasses.add(TextBoxFloatAction.class); + baseClasses.add(FormulaFloatAction.class); + baseClasses.add(ChartFloatAction.class); + if(ChartTypeManager.AUTO_CHART) { + baseClasses.add(AutoChartFloatAction.class); + } + baseClasses.add(ImageFloatAction.class); + return ArrayUtils.addAll(baseClasses.toArray(new Class[baseClasses.size()]), + classes.toArray(new Class[classes.size()])); } private static NameableCreator[] hyperlinkTypes() { From f52bcbdb7f019a85f0219a31c16662c936d04965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 3 Jun 2020 09:13:48 +0800 Subject: [PATCH 067/135] CHART-13666 --- .../main/java/com/fr/design/module/DesignModuleFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java index fbf269477c..5881132b39 100644 --- a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java +++ b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java @@ -210,9 +210,9 @@ public class DesignModuleFactory { } /** - * kunsnat: 初始化图表向导对话框, 调用静态方法showWindow, 参数window. + * 初始化图表向导对话框, 调用静态方法showWindow, 参数window. * - * @return 返回调出的图表自动推荐ChartDialog + * @return 返回调出的图表自动推荐AutoChartDialog */ public static MiddleChartDialog getAutoChartDialog(Window window) { try { From 2a078f775bea64fa1f21dcfa59d27440e0e4f32e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 3 Jun 2020 09:44:06 +0800 Subject: [PATCH 068/135] =?UTF-8?q?CHART-13666=20=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=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/gui/icombocheckbox/UIComboCheckBox.java | 1 + 1 file changed, 1 insertion(+) 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 b88c157a8f..d2479ae04b 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 @@ -198,6 +198,7 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam */ public void refreshCombo(Object[] value) { this.values = value; + //CHART-13666 控件之前的刷新有bug,没有刷新popup中values的值,导致数组越界 this.popup.refreshCheckboxValues(value); } From 87c6994e38814ccad2e50679a306c23a60c27ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 3 Jun 2020 11:38:20 +0800 Subject: [PATCH 069/135] =?UTF-8?q?CHART-13666=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 --- .../gui/icombocheckbox/UICheckListPopup.java | 14 ++++----- .../com/fr/design/chart/AutoChartDialog.java | 6 ++-- .../com/fr/design/chart/AutoChartIcon.java | 8 ++--- .../fr/design/chart/AutoChartTypePane.java | 31 ------------------- .../java/com/fr/design/chart/ChartDialog.java | 15 ++++----- .../insert/cell/AutoChartCellAction.java | 3 +- 6 files changed, 22 insertions(+), 55 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java index cfc4dbfb0b..ec5da8bcaf 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java @@ -53,7 +53,7 @@ public class UICheckListPopup extends UIPopupMenu { public void setMaxDisplayNumber(int maxDisplayNumber) { this.maxDisplayNumber = maxDisplayNumber; - addCheckboxValues(values); + addCheckboxValues(); } private void initComponent() { @@ -65,21 +65,21 @@ public class UICheckListPopup extends UIPopupMenu { this.setLayout(new BorderLayout()); this.add(jScrollPane, BorderLayout.CENTER); - addCheckboxValues(values); + addCheckboxValues(); } - public void refreshCheckboxValues(Object[] value){ - this.values = value; - addCheckboxValues(values); + public void refreshCheckboxValues(Object[] values){ + this.values = values; + addCheckboxValues(); } - public void addCheckboxValues(Object[] value) { + private void addCheckboxValues() { checkboxPane.removeAll(); checkBoxList.clear(); //全选加在第一个位置 addOneCheckValue(SELECT_ALL); - for (Object checkValue : value) { + for (Object checkValue : values) { addOneCheckValue(checkValue); } addSelectListener(); diff --git a/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java b/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java index 4c5225a5a9..3bd54c27cb 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java +++ b/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java @@ -34,8 +34,8 @@ public class AutoChartDialog extends ChartDialog { return autoChartTypePane; } - protected void addOkAction() { - ok.addActionListener(new ActionListener() { + protected ActionListener getActionListener() { + return new ActionListener() { public void actionPerformed(ActionEvent e) { ChartCollection chartCollection = (ChartCollection) getChartCollection(); autoChartTypePane.update(chartCollection); @@ -45,7 +45,7 @@ public class AutoChartDialog extends ChartDialog { doCancel(); } } - }); + }; } /** diff --git a/designer-chart/src/main/java/com/fr/design/chart/AutoChartIcon.java b/designer-chart/src/main/java/com/fr/design/chart/AutoChartIcon.java index 426dab0403..b85e2194c1 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/AutoChartIcon.java +++ b/designer-chart/src/main/java/com/fr/design/chart/AutoChartIcon.java @@ -1,13 +1,12 @@ package com.fr.design.chart; -import com.fr.base.ScreenResolution; import com.fr.base.chart.BaseChartPainter; import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.chart.result.WebChartIDInfo; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.ChartTypeInterfaceManager; -import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.script.Calculator; import javax.swing.Icon; @@ -69,10 +68,7 @@ public class AutoChartIcon implements Icon { BaseChartPainter painter = chartCollection.createResultChartPainterWithOutDealFormula(Calculator.createCalculator(), WebChartIDInfo.createEmptyDesignerInfo(), getIconWidth(), getIconHeight()); - int resolution = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution(); - if (resolution == 0) { - resolution = ScreenResolution.getScreenResolution(); - } + int resolution = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getJTemplateResolution(); Graphics2D g2d = (Graphics2D) g; Paint oldPaint = g2d.getPaint(); diff --git a/designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java index 8100e2ad56..b546a330b5 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java @@ -1,7 +1,5 @@ package com.fr.design.chart; -import com.fr.base.chart.BaseChartCollection; -import com.fr.base.chart.BaseChartGetter; import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.chart.chartattr.ChartCollection; import com.fr.chartx.attr.ChartProvider; @@ -14,10 +12,6 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.plugin.chart.area.VanChartAreaPlot; -import com.fr.plugin.chart.column.VanChartColumnPlot; -import com.fr.plugin.chart.line.VanChartLinePlot; -import com.fr.plugin.chart.vanchart.VanChart; import javax.swing.BorderFactory; import javax.swing.DefaultListCellRenderer; @@ -168,31 +162,6 @@ public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent private void calculateAutoChart() { chartResultModel.clear(); - - //TODO 使用以下模拟数据,计算规则待补充 - BaseChartCollection chartCollection = BaseChartGetter.createChartCollection(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID); - VanChart selectedChart = ((ChartCollection) chartCollection).getSelectedChart(VanChart.class); - selectedChart.getTitle().setTextObject("自动图表标题"); - - BaseChartCollection chartCollection1 = BaseChartGetter.createChartCollection(VanChartLinePlot.VAN_CHART_LINE_PLOT); - VanChart selectedChart1 = ((ChartCollection) chartCollection1).getSelectedChart(VanChart.class); - selectedChart1.getTitle().setTextObject("自动图表标题"); - - BaseChartCollection chartCollection2 = BaseChartGetter.createChartCollection(VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID); - VanChart selectedChart2 = ((ChartCollection) chartCollection2).getSelectedChart(VanChart.class); - selectedChart2.getTitle().setTextObject("自动图表标题"); - - AutoChartIcon autoChartIcon = new AutoChartIcon((ChartCollection) chartCollection); - autoChartIcon.registerCallBackEvent(this); - AutoChartIcon autoChartIcon1 = new AutoChartIcon((ChartCollection) chartCollection1); - autoChartIcon1.registerCallBackEvent(this); - AutoChartIcon autoChartIcon2 = new AutoChartIcon((ChartCollection) chartCollection2); - autoChartIcon2.registerCallBackEvent(this); - - chartResultModel.addElement(autoChartIcon); - chartResultModel.addElement(autoChartIcon1); - chartResultModel.addElement(autoChartIcon2); - chartViewList.setSelectedIndex(0); } @Override 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 bd6a2cf7e7..9c2b730ab0 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 @@ -27,9 +27,10 @@ public class ChartDialog extends MiddleChartDialog { private BaseChartCollection cc; - protected UIButton ok; - protected UIButton cancel; + private UIButton ok; + private UIButton cancel; private ChartTypePane chartTypePane; + private String createTime; public ChartDialog(Frame owner) { super(owner); @@ -42,6 +43,7 @@ public class ChartDialog extends MiddleChartDialog { } private void initComponent() { + createTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); this.setModal(true); this.setLayout(new BorderLayout()); setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_M_Popup_Chart_Type")); @@ -58,7 +60,7 @@ public class ChartDialog extends MiddleChartDialog { ok = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")); cancel = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cancel")); - addOkAction(); + ok.addActionListener(getActionListener()); cancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { doCancel(); @@ -76,14 +78,13 @@ public class ChartDialog extends MiddleChartDialog { return chartTypePane; } - protected void addOkAction() { - final String createTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); - ok.addActionListener(new ActionListener() { + protected ActionListener getActionListener() { + return new ActionListener() { public void actionPerformed(ActionEvent e) { chartTypePane.update((ChartCollection) cc, createTime); doOK(); } - }); + }; } /** diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java index 13990f7d84..6ee1a74c48 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java @@ -3,6 +3,7 @@ package com.fr.design.actions.insert.cell; import com.fr.base.BaseUtils; import com.fr.chart.chartattr.AutoChartCollection; import com.fr.design.actions.core.WorkBookSupportable; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.menu.MenuKeySet; @@ -40,7 +41,7 @@ public class AutoChartCellAction extends AbstractCellAction implements WorkBookS @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Auto_Chart"); + return Toolkit.i18nText("Fine-Design_Report_M_Insert_Auto_Chart"); } @Override From 16346fd4f78b41437570ffa90b2896c0d3bd9d75 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Wed, 3 Jun 2020 15:11:26 +0800 Subject: [PATCH 070/135] =?UTF-8?q?REPORT-31381=20=E9=80=9A=E8=BF=87alphaf?= =?UTF-8?q?ine=E6=90=9C=E7=B4=A2=E6=8F=92=E4=BB=B6=EF=BC=8C=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E6=8F=92=E4=BB=B6mini=E5=95=86=E5=9F=8E=E5=90=8E?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=9A=84=E6=8F=92=E4=BB=B6=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/extra/WebViewDlgHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 47d1541461..027549c7cb 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 @@ -155,7 +155,7 @@ public class WebViewDlgHelper { * @param data */ public static void showPluginInStore(String keyword, String data) { - PluginWebBridge.getHelper().showResultInStore(keyword, data); + PluginWebBridge.getHelper().openWithSearch(keyword); createPluginDialog(); } From 2f58e87ed88eff1cd557cdd3a3f1df3f8ff2beeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 3 Jun 2020 17:31:22 +0800 Subject: [PATCH 071/135] =?UTF-8?q?CHART-13666=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/ChartTypeInterfaceManager.java | 16 +++---- .../insert/flot/AutoChartFloatAction.java | 3 +- .../fr/start/module/DesignerActivator.java | 44 +++++++------------ 3 files changed, 23 insertions(+), 40 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java index e37409075a..014778cac8 100644 --- a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java @@ -12,10 +12,8 @@ import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.chart.fun.ChartTypeUIProvider; import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.condition.ConditionAttributesPane; -import com.fr.design.gui.core.CustomWidgetOption; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.ChartEditPane; import com.fr.design.mainframe.chart.ChartsConfigPane; @@ -43,7 +41,6 @@ import com.fr.design.type.ui.RangeChartTypeUI; import com.fr.design.type.ui.StockChartTypeUI; import com.fr.design.type.ui.XYScatterChartTypeUI; import com.fr.extended.chart.AbstractChart; -import com.fr.form.ui.ChartAutoEditor; import com.fr.form.ui.ChartEditor; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; @@ -165,12 +162,8 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr public static WidgetOption[] initWidgetOption() { String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDs(); - List child = new ArrayList<>(); - if (ChartTypeManager.AUTO_CHART) { - //TODO @Bjorn 视觉样式优化icon - child.add(new CustomWidgetOption(Toolkit.i18nText("Fine-Design_Chart_M_Popup_Auto_Chart_Type"), - IOUtils.readIcon("com/fr/design/images/form/toolbar/auto_chart.png"), ChartAutoEditor.class)); - } + ChartWidgetOption[] child = new ChartWidgetOption[chartIDs.length]; + int index = 0; for (String chartID : chartIDs) { ChartProvider[] rowChart = ChartTypeManager.getInstance().getCharts(chartID); @@ -180,10 +173,11 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr String name = ChartTypeInterfaceManager.getInstance().getName(chartID); String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(chartID); Icon icon = IOUtils.readIcon(iconPath); - child.add(new ChartWidgetOption(name, icon, ChartEditor.class, chartID)); + child[index] = new ChartWidgetOption(name, icon, ChartEditor.class, chartID); + index++; } - return child.toArray(new WidgetOption[child.size()]); + return child; } private static void readVanChart() { diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/AutoChartFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/AutoChartFloatAction.java index 92e9cca3d4..bb0389731e 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/AutoChartFloatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/AutoChartFloatAction.java @@ -2,6 +2,7 @@ package com.fr.design.actions.insert.flot; import com.fr.base.BaseUtils; import com.fr.design.gui.chart.MiddleChartDialog; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.menu.MenuKeySet; import com.fr.design.module.DesignModuleFactory; @@ -38,7 +39,7 @@ public class AutoChartFloatAction extends ChartFloatAction { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Auto_Chart"); + return Toolkit.i18nText("Fine-Design_Report_M_Insert_Auto_Chart"); } @Override 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 45d31dcb1b..c0a979d6eb 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 @@ -7,14 +7,12 @@ import com.fr.base.passport.FinePassportListenerAdapter; import com.fr.base.passport.FinePassportManager; import com.fr.base.process.ProcessOperator; import com.fr.chart.chartattr.ChartCollection; -import com.fr.chart.charttypes.ChartTypeManager; import com.fr.config.MarketConfig; import com.fr.decision.update.backup.RecoverManager; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.NewFormAction; import com.fr.design.actions.core.ActionFactory; -import com.fr.design.actions.insert.cell.AutoChartCellAction; import com.fr.design.actions.insert.cell.BiasCellAction; import com.fr.design.actions.insert.cell.ChartCellAction; import com.fr.design.actions.insert.cell.DSColumnCellAction; @@ -23,7 +21,6 @@ import com.fr.design.actions.insert.cell.GeneralCellAction; import com.fr.design.actions.insert.cell.ImageCellAction; import com.fr.design.actions.insert.cell.RichTextCellAction; import com.fr.design.actions.insert.cell.SubReportCellAction; -import com.fr.design.actions.insert.flot.AutoChartFloatAction; import com.fr.design.actions.insert.flot.ChartFloatAction; import com.fr.design.actions.insert.flot.FormulaFloatAction; import com.fr.design.actions.insert.flot.ImageFloatAction; @@ -225,21 +222,16 @@ public class DesignerActivator extends Activator { classes.add(provider.actionForInsertCellElement()); } - List> baseClasses = new ArrayList<>(); - baseClasses.add(DSColumnCellAction.class); - baseClasses.add(GeneralCellAction.class); - baseClasses.add(RichTextCellAction.class); - baseClasses.add(FormulaCellAction.class); - baseClasses.add(ChartCellAction.class); - if(ChartTypeManager.AUTO_CHART) { - baseClasses.add(AutoChartCellAction.class); - } - baseClasses.add(ImageCellAction.class); - baseClasses.add(BiasCellAction.class); - baseClasses.add(SubReportCellAction.class); - - return ArrayUtils.addAll(baseClasses.toArray(new Class[baseClasses.size()]), - classes.toArray(new Class[classes.size()])); + return ArrayUtils.addAll(new Class[]{ + DSColumnCellAction.class, + GeneralCellAction.class, + RichTextCellAction.class, + FormulaCellAction.class, + ChartCellAction.class, + ImageCellAction.class, + BiasCellAction.class, + SubReportCellAction.class + }, classes.toArray(new Class[classes.size()])); } private static Class[] actionsForInsertFloatElement() { @@ -249,16 +241,12 @@ public class DesignerActivator extends Activator { classes.add(provider.actionForInsertFloatElement()); } - List> baseClasses = new ArrayList<>(); - baseClasses.add(TextBoxFloatAction.class); - baseClasses.add(FormulaFloatAction.class); - baseClasses.add(ChartFloatAction.class); - if(ChartTypeManager.AUTO_CHART) { - baseClasses.add(AutoChartFloatAction.class); - } - baseClasses.add(ImageFloatAction.class); - return ArrayUtils.addAll(baseClasses.toArray(new Class[baseClasses.size()]), - classes.toArray(new Class[classes.size()])); + return ArrayUtils.addAll(new Class[]{ + TextBoxFloatAction.class, + FormulaFloatAction.class, + ChartFloatAction.class, + ImageFloatAction.class + }, classes.toArray(new Class[classes.size()])); } private static NameableCreator[] hyperlinkTypes() { From 211bf38b9a686ea5b105185624c021b749def087 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Wed, 3 Jun 2020 21:05:17 +0800 Subject: [PATCH 072/135] =?UTF-8?q?alphafine=E6=90=9C=E7=B4=A2=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E5=85=B3=E9=94=AE=E8=AF=8D=E6=89=93=E5=BC=80?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=95=86=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/extra/WebViewDlgHelper.java | 5 ++--- .../design/mainframe/alphafine/cell/model/PluginModel.java | 4 +--- 2 files changed, 3 insertions(+), 6 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 027549c7cb..04b2db91ac 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 @@ -11,7 +11,6 @@ import com.fr.general.CommonIOUtils; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; -import com.fr.general.http.HttpClient; import com.fr.general.http.HttpToolbox; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; @@ -32,7 +31,6 @@ import java.awt.Window; import java.io.File; import java.io.IOException; import java.lang.reflect.Constructor; -import java.net.HttpURLConnection; import java.util.concurrent.ExecutionException; /** @@ -154,8 +152,9 @@ public class WebViewDlgHelper { * @param keyword * @param data */ + @Deprecated public static void showPluginInStore(String keyword, String data) { - PluginWebBridge.getHelper().openWithSearch(keyword); + PluginWebBridge.getHelper().showResultInStore(keyword, data); createPluginDialog(); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java index 84ea70c05c..570538cad1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java @@ -3,9 +3,7 @@ package com.fr.design.mainframe.alphafine.cell.model; import com.fr.design.extra.WebViewDlgHelper; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.CellType; -import com.fr.json.JSONException; import com.fr.json.JSONObject; -import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; @@ -104,7 +102,7 @@ public class PluginModel extends AlphaCellModel { if (StringUtils.isBlank(this.pluginId) || !WorkContext.getCurrent().isLocal()) { return; } - WebViewDlgHelper.showPluginInStore(getName(), "[" + modelToJson().optString("result") + "]"); + WebViewDlgHelper.createPluginDialog(getName()); } @Override From 3854aba922347ba912ff4b71578172936d766b20 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 3 Jun 2020 22:30:42 +0800 Subject: [PATCH 073/135] =?UTF-8?q?REPORT-32939=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=AD=A3=E5=B8=B82g=E7=9B=AE=E5=89=8D=E7=BB=8F?= =?UTF-8?q?=E5=B8=B8=E5=87=BA=E7=8E=B0=E6=8E=92=E9=98=9F=E7=8E=B0=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 36 +++++++++++++++++++ .../fr/design/mainframe/DesignerFrame.java | 16 ++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) 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 cb68bb6e47..4375693485 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 @@ -42,6 +42,14 @@ public class HistoryTemplateListCache implements CallbackEvent { private List> historyList; private JTemplate editingTemplate; + /** + * 当设计器打开的模板数大于模板缓存对象个数时,会产生JVirtualTemplate(个数=打开的总模板数 - 缓存模板数) + * 每次点击切换模板时,当切换到JVirtualTemplate,会创建真实的JTemplate,但是该JTemplate创建后不会释放掉,需要调用whenClose主动释放 + * 该变量对JVirtualTemplate创建真实的JTemplate管理 + */ + private JTemplate currentVirtualReplaceTemplate; + + public static HistoryTemplateListCache getInstance() { return Holder.INSTANCE; } @@ -112,6 +120,14 @@ public class HistoryTemplateListCache implements CallbackEvent { * @see DesignerFrameFileDealerPane#setCurrentEditingTemplate(JTemplate) */ public void setCurrentEditingTemplate(JTemplate jt) { + + // 模板之间切换 如果存在上次JVirtualTemplate创建的真实模板 需要在此关闭,并释放掉 + boolean canReleaseVirtualReplaceTemplate = this.currentVirtualReplaceTemplate != null && jt != null + && !ComparatorUtils.equals(this.currentVirtualReplaceTemplate.getEditingFILE(), jt.getEditingFILE()); + if (canReleaseVirtualReplaceTemplate) { + HistoryTemplateListCache.getInstance().releaseVirtualReplaceTemplate(); + } + this.editingTemplate = jt; //如果当前历史面板中没有 @@ -423,4 +439,24 @@ public class HistoryTemplateListCache implements CallbackEvent { } } + + public void setCurrentVirtualReplaceTemplate(JTemplate currentVirtualReplaceTemplate) { + // 保证先释放 + releaseVirtualReplaceTemplate(); + this.currentVirtualReplaceTemplate = currentVirtualReplaceTemplate; + } + + public JTemplate getCurrentVirtualReplaceTemplate() { + return currentVirtualReplaceTemplate; + } + + /** + * 释放JVirtualTemplate创建的真实模板JTemplate + */ + private void releaseVirtualReplaceTemplate() { + if (this.currentVirtualReplaceTemplate != null) { + this.currentVirtualReplaceTemplate.whenClose(); + this.currentVirtualReplaceTemplate = 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 2cf8d8c350..e5b8e8b7e0 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,11 +1101,19 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ private void openFile(FILE tplFile) { + boolean virtualTemplate = false; if (tplFile != null) { int index = HistoryTemplateListCache.getInstance().contains(tplFile); if (index != -1) { JTemplate jt = HistoryTemplateListCache.getInstance().getHistoryList().get(index); - if (!(jt instanceof JVirtualTemplate)) { + if (jt instanceof JVirtualTemplate) { + JTemplate currentVirtualReplaceTemplate = HistoryTemplateListCache.getInstance().getCurrentVirtualReplaceTemplate(); + if (currentVirtualReplaceTemplate != null && ComparatorUtils.equals(currentVirtualReplaceTemplate.getEditingFILE(), jt.getEditingFILE())) { + currentVirtualReplaceTemplate.activeOldJTemplate(); + return; + } + virtualTemplate = true; + } else { jt.activeOldJTemplate(); return; } @@ -1116,6 +1124,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta if (jt == null) { return; } + + // 将JVirtualTemplate创建的真实模板管理起来 + if (virtualTemplate) { + HistoryTemplateListCache.getInstance().setCurrentVirtualReplaceTemplate(jt); + } + // 新的form不往前兼容 if (inValidDesigner(jt)) { this.addAndActivateJTemplate(); From 7ff33d1c6c4068d285df3c5af352306d1f2a9120 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 3 Jun 2020 22:37:06 +0800 Subject: [PATCH 074/135] REPORT-32939 add comment --- .../src/main/java/com/fr/design/mainframe/DesignerFrame.java | 1 + 1 file changed, 1 insertion(+) 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 e5b8e8b7e0..2cfd36687b 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 @@ -1109,6 +1109,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta if (jt instanceof JVirtualTemplate) { JTemplate currentVirtualReplaceTemplate = HistoryTemplateListCache.getInstance().getCurrentVirtualReplaceTemplate(); if (currentVirtualReplaceTemplate != null && ComparatorUtils.equals(currentVirtualReplaceTemplate.getEditingFILE(), jt.getEditingFILE())) { + // 防止在打开了模板的情况下 去双击目录树对应的模板重复创建JTemplate currentVirtualReplaceTemplate.activeOldJTemplate(); return; } From bd5b08e637e79250b9ff25637143e4a97d895982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 4 Jun 2020 10:07:47 +0800 Subject: [PATCH 075/135] =?UTF-8?q?CHART-13666=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 --- .../java/com/fr/design/chart/AutoChartDialog.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java b/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java index 3bd54c27cb..4f8a1d033d 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java +++ b/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java @@ -1,9 +1,7 @@ package com.fr.design.chart; import com.fr.base.chart.BaseChartCollection; -import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.chartattr.ChartCollection; -import com.fr.plugin.chart.vanchart.VanChart; import java.awt.Component; import java.awt.Dialog; @@ -53,17 +51,5 @@ public class AutoChartDialog extends ChartDialog { */ public void populate(BaseChartCollection cc) { super.populate(cc); - ChartCollection chartCollection = (ChartCollection) getChartCollection(); - VanChart vanChart = chartCollection.getSelectedChartProvider(VanChart.class); - if (vanChart == null) { - return; - } - TopDefinitionProvider filterDefinition = vanChart.getFilterDefinition(); - if (filterDefinition == null) { - return; - } - String tableName = vanChart.getFilterDefinition().getTableName(); - String[] dataFields = vanChart.getFilterDefinition().getDataFields(); - autoChartTypePane.populate(tableName, dataFields); } } From 060264cbe46aada91c5f0c4e7b366e855646046e Mon Sep 17 00:00:00 2001 From: Lanlan Date: Thu, 4 Jun 2020 10:10:11 +0800 Subject: [PATCH 076/135] =?UTF-8?q?REPORT-32275=20=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E6=9C=AA=E5=AE=89=E8=A3=85=E6=8F=92=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E5=9B=BA=E5=8C=96=E5=9B=9E=E4=BC=A0=E6=97=A5=E5=BF=97=E4=B8=AD?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=88=90=E5=8A=9F=EF=BC=8C=E5=AE=9E=E9=99=85?= =?UTF-8?q?=E4=B8=8A=E6=B2=A1=E6=9C=89=E5=9B=9E=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/messagecollect/solid/SolidCollector.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 194ca75d93..974f75dd33 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 @@ -58,8 +58,9 @@ public class SolidCollector { HttpToolbox.post(url, params); deleteSolidFile(); + + FineLoggerFactory.getLogger().info("send solid content to cloud center success."); } - FineLoggerFactory.getLogger().info("send solid content to cloud center success."); } catch (Exception e) { FineLoggerFactory.getLogger().info(e.getMessage(), e); } finally { From fdf8327ce0a8355deeeda891874e054e135ae1fc Mon Sep 17 00:00:00 2001 From: pengda Date: Thu, 4 Jun 2020 11:25:29 +0800 Subject: [PATCH 077/135] =?UTF-8?q?REPORT-29657=20lab=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=AD=97=E4=BD=93=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 --- .../com/fr/design/widget/ui/designer/LabelDefinePane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java index cf435c1d0d..d4ebf74ee7 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java @@ -25,7 +25,7 @@ import java.awt.*; * Created by ibm on 2017/8/3. */ public class LabelDefinePane extends AbstractDataModify

zLFZL-!4O#$PYrs>D6u z{Bq`${RyWhadGI43``GYZ(<}joFw&5!L|4)^OEB_jXT6^Mmg1MDrYv*)TS*mWm?1(qLXgoiWN1c9>kJGXc<4)uqsl z4pCPE-Zvwwq)LtY?JwDL?60AfxXL$0@+Ug3&czhJ4f~)V#30?*huzm3xgyWpj&VBu zUX?g*$*!q*D?x3@eAL-2^@EcKm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71YTCiA8GEIJv$HaeBkr^*ACev6 zh+6TTNdXlTu?TA!(0#pIn6UI*jc~l!8TDgKZ`0>aa`uTMJOZ+suDX^EU0ie9H(dN9Spjia25rM0^`yu6b0tnNfcU3Mf%<~{5auL~3~ zMBHdM3RCM(*U%^nw-=VyCQVFwHQK}z#&fRNa`h|9`As@ zP}#?yon~hjLfW}j_TE^((=D25bE>)+TNYMaL})D)_>O*3T0W><3YF_C5a57UoK;`e# z&grL<`Z2q$CHpaYyU5h!bY!)OF6JjlMI3XMF*-uvxxtcLWQ7M|PPnuEIRC)a-SOS4 z*0{?P=^?w+Qv++7w|g&Bly*5fC_3FqVoUlkyXA}$inRsn1qk`RDxs`T^AZa5FP6*= zGj-G{^1o_wq-76w{K;#bKRDt4H+@=!_>;rsf13_}cJ}%2_{<9NFPyIZPwRpB)2|f% p4de0uKO_7386VKiU8Q From 2c404034f1754dbd9c0ed9692c2b5e3d95fc1ef2 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 16 Jun 2020 11:16:11 +0800 Subject: [PATCH 116/135] =?UTF-8?q?CHART-14264=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=85=8D=E8=89=B2=E9=9D=A2=E6=9D=BF=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/component/VanChartFillStylePane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 7173f9678f..8f3f83c5b4 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 @@ -144,8 +144,9 @@ public class VanChartFillStylePane extends BasicBeanPane implemen double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double[] columnSize = {f, e}; - double[] rowSize = {p, p}; + double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ + new Component[]{null, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Match_Color_Scheme")), styleSelectBox}, new Component[]{null, customPane}, From d24ec99f43f2a617e17f22837e07d5c36a127ea6 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 16 Jun 2020 11:50:36 +0800 Subject: [PATCH 117/135] =?UTF-8?q?REPORT-33459=20=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E5=90=8E=20=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=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/quickeditor/CellQuickEditor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 82ac101147..088026ba70 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -187,7 +187,8 @@ public abstract class CellQuickEditor extends QuickEditor { selectedIndex = comboBox.getSelectedIndex(); comboBox.setPopupVisible(false); comboBox.repaint(); - if (selectedIndex < cellInsertActions.length) { + // comboBox.getSelectedIndex()可能返回-1 + if (selectedIndex != -1 && selectedIndex < cellInsertActions.length) { cellInsertActions[selectedIndex].actionPerformed(e); } comboBox.setSelectedIndex(currentSelectedIndex); From f3bd8ca44bfec61f7847b60fd1c157c12035d0f9 Mon Sep 17 00:00:00 2001 From: nmwei <254060001@qq.com> Date: Tue, 16 Jun 2020 15:00:08 +0800 Subject: [PATCH 118/135] =?UTF-8?q?MOBILE-27532=20=E5=8D=95=E9=80=89?= =?UTF-8?q?=EF=BC=8F=E5=A4=8D=E9=80=89=E6=8C=89=E9=92=AE=E7=BB=84=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XCheckBoxGroup.java | 7 ++ .../design/designer/creator/XRadioGroup.java | 7 ++ .../mobile/ButtonGroupPropertyUI.java | 32 +++++++ .../mobile/ButtonGroupDefinePane.java | 84 +++++++++++++++++++ 4 files changed, 130 insertions(+) create mode 100644 designer-form/src/main/java/com/fr/design/designer/properties/mobile/ButtonGroupPropertyUI.java create mode 100644 designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ButtonGroupDefinePane.java diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCheckBoxGroup.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCheckBoxGroup.java index 26f1421a64..086b8c3e71 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCheckBoxGroup.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCheckBoxGroup.java @@ -3,7 +3,9 @@ */ package com.fr.design.designer.creator; +import com.fr.design.designer.properties.mobile.ButtonGroupPropertyUI; import com.fr.design.form.util.XCreatorConstants; +import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.widget.editors.DictionaryEditor; @@ -87,4 +89,9 @@ public class XCheckBoxGroup extends XFieldEditor { protected String getIconName() { return "checkbox_group_16.png"; } + + @Override + public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { + return new WidgetPropertyUIProvider[] {new ButtonGroupPropertyUI(this)}; + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XRadioGroup.java b/designer-form/src/main/java/com/fr/design/designer/creator/XRadioGroup.java index af10fbc170..879c833996 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XRadioGroup.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XRadioGroup.java @@ -12,6 +12,8 @@ import javax.swing.ButtonGroup; import javax.swing.JComponent; import javax.swing.JRadioButton; +import com.fr.design.designer.properties.mobile.ButtonGroupPropertyUI; +import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.widget.editors.DictionaryEditor; import com.fr.design.mainframe.widget.editors.InChangeBooleanEditor; @@ -83,4 +85,9 @@ public class XRadioGroup extends XFieldEditor { protected String getIconName() { return "button_group_16.png"; } + + @Override + public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { + return new WidgetPropertyUIProvider[] {new ButtonGroupPropertyUI(this)}; + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/properties/mobile/ButtonGroupPropertyUI.java b/designer-form/src/main/java/com/fr/design/designer/properties/mobile/ButtonGroupPropertyUI.java new file mode 100644 index 0000000000..2c6b85c85c --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/properties/mobile/ButtonGroupPropertyUI.java @@ -0,0 +1,32 @@ +package com.fr.design.designer.properties.mobile; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XFieldEditor; +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.ButtonGroupDefinePane; + +public class ButtonGroupPropertyUI extends AbstractWidgetPropertyUIProvider { + + private XCreator xCreator; + + public ButtonGroupPropertyUI(XFieldEditor xButtonGroupEditor) { + this.xCreator = xButtonGroupEditor; + } + + @Override + public AbstractPropertyTable createWidgetAttrTable() { + return null; + } + + @Override + public BasicPane createWidgetAttrPane() { + return new ButtonGroupDefinePane(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/widget/ui/designer/mobile/ButtonGroupDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ButtonGroupDefinePane.java new file mode 100644 index 0000000000..8ef0107398 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ButtonGroupDefinePane.java @@ -0,0 +1,84 @@ +package com.fr.design.widget.ui.designer.mobile; + +import com.fr.base.mobile.ButtonGroupMaxRowsMobileAttr; +import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.FormDesigner; +import com.fr.form.ui.ButtonGroup; + +import javax.swing.*; +import java.awt.*; + + +public class ButtonGroupDefinePane extends MobileWidgetDefinePane { + + private XCreator xCreator; // 当前选中控件的xCreator + private UISpinner maxShowRowsSpinner; + + public ButtonGroupDefinePane(XCreator xCreator) { + this.xCreator = xCreator; + } + + @Override + public void initPropertyGroups(Object source) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + UILabel maxShowRowsLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design-Mobile_Max_Show_Rows"), SwingConstants.LEFT); + this.maxShowRowsSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 5); + Component[][] components = new Component[][]{ + new Component[] {maxShowRowsLabel, maxShowRowsSpinner} + }; + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + double[] rowSize = {p}; + double[] columnSize = {p,f}; + int[][] rowCount = {{1, 1}}; + final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 30, LayoutConstants.VGAP_LARGE); + panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + final JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); + panelWrapper.add(panel, BorderLayout.NORTH); + UIExpandablePane folderPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, panelWrapper); + this.add(folderPane, BorderLayout.NORTH); + this.repaint(); + } + + 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) { + ButtonGroupMaxRowsMobileAttr maxRowsMobileAttr = ((ButtonGroup)xCreator.toData()).getMobileMaxRowsAttr(); + this.maxShowRowsSpinner.setValue(maxRowsMobileAttr.getMaxShowRows()); + // 数据 populate 完成后,再设置监听 + this.bindListeners2Widgets(); + } + + @Override + public void update() { + ButtonGroupMaxRowsMobileAttr maxRowsMobileAttr = ((ButtonGroup)xCreator.toData()).getMobileMaxRowsAttr(); + maxRowsMobileAttr.setMaxShowRows((int) maxShowRowsSpinner.getValue()); + DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来 + } +} From 6429b828d5ef758b6f6e3d7e707d2e58fba08bb8 Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 16 Jun 2020 16:59:18 +0800 Subject: [PATCH 119/135] =?UTF-8?q?REPORT-33731=20=E5=B8=A6=E5=8F=82?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E8=BF=87=E7=A8=8B=E9=A2=84=E8=A7=88=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=BC=B9=E5=87=BA=E5=8F=82=E6=95=B0=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/DesignTableDataManager.java | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 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 dc7002fa85..7bfd4a6ee8 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 @@ -22,7 +22,6 @@ import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.iprogressbar.AutoProgressBar; -import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.design.parameter.ParameterInputPane; import com.fr.file.ProcedureConfig; @@ -38,7 +37,7 @@ import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; -import javax.swing.JFrame; +import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.io.ByteArrayOutputStream; @@ -484,15 +483,9 @@ public abstract class DesignTableDataManager { if (ArrayUtils.isEmpty(parameters)) { parameters = tabledata.getParameters(Calculator.createCalculator()); } - final Map parameterMap = new HashMap<>(); + Map parameterMap = new HashMap<>(); if (needInputParams(isMustInputParameters, parameters)) { - final ParameterInputPane pPane = new ParameterInputPane(parameters); - pPane.showSmallWindow(new JFrame(), new DialogActionAdapter() { - @Override - public void doOk() { - parameterMap.putAll(pPane.update()); - } - }).setVisible(true); + showParaWindow(parameterMap, parameters); } else { for (ParameterProvider parameter : parameters) { parameterMap.put(parameter.getName(), parameter.getValue()); @@ -583,15 +576,10 @@ public abstract class DesignTableDataManager { return storeProcedure.creatLazyDataModel(); } ParameterProvider[] inParameters = DataOperator.getInstance().getStoreProcedureParameters(storeProcedure); - final Map parameterMap = new HashMap(); + Map parameterMap = new HashMap<>(); if (inParameters.length > 0 && !ComparatorUtils.equals(threadLocal.get(), NO_PARAMETER)) {// 检查Parameter. - final ParameterInputPane pPane = new ParameterInputPane(inParameters); - pPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { - @Override - public void doOk() { - parameterMap.putAll(pPane.update()); - } - }).setVisible(true); + + showParaWindow(parameterMap, inParameters); } storeProcedure.setFirstExpand(false); @@ -601,6 +589,16 @@ public abstract class DesignTableDataManager { return DataOperator.getInstance().previewProcedureDataModel(storeProcedure, parameterMap, 0); } + private static void showParaWindow(final Map parameterMap, ParameterProvider[] inParameters) { + final ParameterInputPane pPane = new ParameterInputPane(inParameters); + pPane.showSmallWindow(new JFrame(), new DialogActionAdapter() { + @Override + public void doOk() { + parameterMap.putAll(pPane.update()); + } + }).setVisible(true); + } + public static void setThreadLocal(String value) { threadLocal.set(value); } From df64e6e5c93d54904992099666fb57b584041113 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 16 Jun 2020 17:01:01 +0800 Subject: [PATCH 120/135] =?UTF-8?q?REPORT-33575=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=90=AF=E7=94=A8https=E7=9A=84=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=EF=BC=8C=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=85=B3=E6=8E=89?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=E6=B2=A1=E6=9C=89=E8=B7=B3=E5=87=BA=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=B7=A5=E4=BD=9C=E7=9B=AE=E5=BD=95=E7=9A=84=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=20&&=20REPORT-33454=20=E5=88=87=E6=8D=A2=E8=BF=9C?= =?UTF-8?q?=E7=A8=8B=E7=9B=AE=E5=BD=95=E6=88=90=E5=8A=9F=EF=BC=8C=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E6=8F=90=E7=A4=BA=E5=88=87=E6=8D=A2=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/socketio/DesignerSocketIO.java | 54 +++++++++++++------ .../fr/design/widget/CellWidgetCardPane.java | 3 ++ 2 files changed, 41 insertions(+), 16 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 79061dbab2..010f9d119d 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 @@ -2,13 +2,16 @@ package com.fr.design.mainframe.socketio; import com.fr.config.RemoteConfigEvent; import com.fr.decision.webservice.utils.DecisionServiceConstants; +import com.fr.design.DesignerEnvManager; 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; 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.log.FineLoggerFactory; import com.fr.report.RemoteDesignConstants; import com.fr.serialization.SerializerHelper; @@ -16,6 +19,7 @@ import com.fr.stable.ArrayUtils; import com.fr.third.apache.log4j.spi.LoggingEvent; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; +import com.fr.workspace.WorkspaceEvent; import com.fr.workspace.base.WorkspaceConstants; import com.fr.workspace.connect.WorkspaceConnection; import com.fr.workspace.server.socket.SocketInfoOperator; @@ -30,6 +34,20 @@ import java.net.URL; public class DesignerSocketIO { + + static { + EventDispatcher.listen(WorkspaceEvent.LostConnect, new Listener() { + @Override + public void on(Event event, Workspace param) { + // 远程设计websocket不支持wss 所以断开无法提醒 + // 使用远程设计的心跳断开来提醒断开 + if (DesignerEnvManager.getEnvManager().isHttps()) { + showConnectionLost(); + } + } + }); + } + enum Status { Connected, Disconnected, @@ -143,27 +161,31 @@ public class DesignerSocketIO { * socket 只用推日志和通知配置变更 */ if (status != Status.Disconnecting) { - try { - UIUtil.invokeAndWaitIfNeeded(new Runnable() { - @Override - public void run() { - FineJOptionPane.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); - } + showConnectionLost(); } status = Status.Disconnected; } }; + private static void showConnectionLost() { + try { + UIUtil.invokeAndWaitIfNeeded(new Runnable() { + @Override + public void run() { + FineJOptionPane.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); + } + } + //配置变更监听器 private static final Emitter.Listener modifyConfig = new Emitter.Listener() { @Override diff --git a/designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java b/designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java index 3bca81c1e4..57e87e090d 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java @@ -136,6 +136,9 @@ public class CellWidgetCardPane extends BasicPane { //todo } }); + if (rn == null) { + return; + } DataModify definePane = rn.getDefinePane(); attriCardPane.add(definePane.toSwingComponent(), rn.getCardName()); attriCardLayout.show(attriCardPane, rn.getCardName()); From 01ba3bf406c16027f3da12d8c642937b73fff53e Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 16 Jun 2020 17:05:04 +0800 Subject: [PATCH 121/135] =?UTF-8?q?REPORT-33575=20=E6=94=B9=E4=B8=8B?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/socketio/DesignerSocketIO.java | 6 +++--- 1 file changed, 3 insertions(+), 3 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 010f9d119d..e84237524c 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 @@ -42,7 +42,7 @@ public class DesignerSocketIO { // 远程设计websocket不支持wss 所以断开无法提醒 // 使用远程设计的心跳断开来提醒断开 if (DesignerEnvManager.getEnvManager().isHttps()) { - showConnectionLost(); + showConnectionLostDialog(); } } }); @@ -161,13 +161,13 @@ public class DesignerSocketIO { * socket 只用推日志和通知配置变更 */ if (status != Status.Disconnecting) { - showConnectionLost(); + showConnectionLostDialog(); } status = Status.Disconnected; } }; - private static void showConnectionLost() { + private static void showConnectionLostDialog() { try { UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override From cd8551d56586efcad816e696220fc32a45d9e351 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 16 Jun 2020 17:33:37 +0800 Subject: [PATCH 122/135] =?UTF-8?q?REPORT-31758=E3=80=90frm=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E9=87=8D=E6=9E=8405.25=E5=91=A8=E3=80=91frm?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E7=95=8C=E9=9D=A2=E6=94=AF=E6=8C=81=E7=BC=A9?= =?UTF-8?q?=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/FormAdaptiveConfigUIProcessor.java | 9 ++--- .../fr/design/mainframe/JFormSliderPane.java | 7 ++++ .../com/fr/design/mainframe/FormArea.java | 35 +++++++++++++------ .../java/com/fr/design/mainframe/JForm.java | 15 ++++++-- .../form/FormElementCaseDesigner.java | 12 +++---- 5 files changed, 51 insertions(+), 27 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 ebe0e8c3d4..abd4b6808a 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 @@ -25,13 +25,10 @@ public interface FormAdaptiveConfigUIProcessor extends Immutable { ShortCut getConfigShortCut(JTemplate jTemplate); /** - * 绘制自适应下报表块在表单界面中显示图片 - * @param size 绘制尺寸 - * @param elementCasePane 报表块内容对象 - * @return 自适应下报表块在表单界面中显示的图片 + * 是否开启表单滑块缩放功能 + * @return 是否开启表单滑块缩放 */ - BufferedImage paintFormElementCaseImage(Dimension size, JComponent elementCasePane); - + boolean openFormSliderZoom(); /** * 获取新自适应下字体显示的dpi diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java b/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java index 60b34a099d..1552d1b658 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java @@ -88,6 +88,8 @@ public class JFormSliderPane extends JPanel { private UIRadioButton customButton; //拖动条处理和button、直接输入不一样 private boolean isButtonOrIsTxt = true; + //是否选中指定的几个缩放等级,避免触发不必要的事件 + private boolean selectSpecified = false; private FormPopupPane dialog; private int upButtonX; private JPanel dialogContentPanel; @@ -288,6 +290,9 @@ public class JFormSliderPane extends JPanel { refreshBottun(val); JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); textField.setCaretPosition(showValSpinner.getValue().toString().length()); + if (!selectSpecified) { + customButton.setSelected(true); + } } }; @@ -317,7 +322,9 @@ public class JFormSliderPane extends JPanel { public void itemStateChanged(ItemEvent e) { JRadioButton temp = (JRadioButton) e.getSource(); if (temp.isSelected()) { + selectSpecified = true; showValSpinner.setValue(Integer.valueOf(temp.getText().substring(0, temp.getText().indexOf("%")))); + selectSpecified = false; } } }; 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 be9b4faa6f..508be0327a 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 @@ -2,12 +2,14 @@ package com.fr.design.mainframe; import com.fr.base.ScreenResolution; import com.fr.common.inputevent.InputEventBaseOnOS; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWBorderLayout; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.fun.FormAdaptiveConfigUIProcessor; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.itextfield.UINumberField; @@ -49,7 +51,6 @@ import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; public class FormArea extends JComponent implements ScrollRulerComponent { - private static final double SLIDER_FLOAT = 400.0; private static final double SLIDER_MIN = 10.0; public static final double DEFAULT_SLIDER = 100.0; @@ -76,6 +77,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { private int resolution = ScreenResolution.getScreenResolution(); private double screenValue; + public FormScrollBar getHorScrollBar() { return horScrollBar; } @@ -113,6 +115,13 @@ public class FormArea extends JComponent implements ScrollRulerComponent { this.designer.addMouseWheelListener(showValSpinnerMouseWheelListener); } + private boolean openSliderZoom(){ + FormAdaptiveConfigUIProcessor adaptiveConfigUI = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUIProcessor.MARK_STRING); + if (adaptiveConfigUI != null) { + return adaptiveConfigUI.openFormSliderZoom(); + } + return false; + } public void onMobileAttrModified() { FormMobileAttr formMobileAttr = designer.getTarget().getFormMobileAttr(); if (formMobileAttr.isMobileOnly()) { @@ -142,7 +151,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; double[] rowSize = {f}; - double[] columnSize = {p, f, p, p, p, p, p, f, p}; + double[] columnSize = {p, f, p, p, p, p, p, p}; UILabel tipsPane = new UILabel("form"); tipsPane.setPreferredSize(new Dimension(200, 0)); widthPane = new UINumberField(); @@ -150,18 +159,24 @@ public class FormArea extends JComponent implements ScrollRulerComponent { heightPane = new UINumberField(); heightPane.setPreferredSize(new Dimension(60, 0)); -// slidePane = new UINumberSlidePane(SLIDER_MIN, SLIDER_FLOAT); -// slidePane.setPreferredSize(new Dimension(260,20)); slidePane = JFormSliderPane.getInstance(); - slidePane.setPreferredSize(new Dimension(200, 20)); - - JPanel resizePane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{{ tipsPane, new UILabel(), widthPane, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel")), new UILabel("x"), heightPane, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel")), new UILabel(), slidePane }}, rowSize, columnSize, RESIZE_PANE_GAP); + slidePane.setPreferredSize(new Dimension(375, 20)); + + JPanel resizePane = TableLayoutHelper.createCommonTableLayoutPane( + new JComponent[][]{{tipsPane, new UILabel(), widthPane, + new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel")), + new UILabel("x"), heightPane, + new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel")), + slidePane}}, rowSize, columnSize, RESIZE_PANE_GAP); this.add(FormRulerLayout.BOTTOM, resizePane); setWidgetsConfig(); + boolean needOpenSliderZoom = openSliderZoom(); // 先初始话滑块及对应事件,然后获取分辨率调整容器的显示大小 - slidePane.setEnabled(false); - slidePane.setVisible(false); -// initTransparent(); + slidePane.setEnabled(needOpenSliderZoom); + slidePane.setVisible(needOpenSliderZoom); + if (needOpenSliderZoom) { + initTransparent(); + } initCalculateSize(); } 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 041705fb6d..b1990c038f 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 @@ -154,6 +154,15 @@ public class JForm extends JTemplate implements BaseJForm implements BaseJForm designerClass = new HashMap(); designerClass.put(Constants.ARG_0, FormElementCaseProvider.class); @@ -902,7 +911,7 @@ public class JForm extends JTemplate implements BaseJForm compoClass = new HashMap(); compoClass.put(Constants.ARG_0, BaseJForm.class); @@ -929,7 +938,7 @@ public class JForm extends JTemplate implements BaseJForm Date: Tue, 16 Jun 2020 20:42:57 +0800 Subject: [PATCH 123/135] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=AE=80=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/ui/designer/mobile/ButtonGroupDefinePane.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ButtonGroupDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ButtonGroupDefinePane.java index 8ef0107398..3f8f4bb05d 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ButtonGroupDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ButtonGroupDefinePane.java @@ -1,6 +1,5 @@ package com.fr.design.widget.ui.designer.mobile; -import com.fr.base.mobile.ButtonGroupMaxRowsMobileAttr; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.creator.XCreator; import com.fr.design.foldablepane.UIExpandablePane; @@ -69,16 +68,16 @@ public class ButtonGroupDefinePane extends MobileWidgetDefinePane { @Override public void populate(FormDesigner designer) { - ButtonGroupMaxRowsMobileAttr maxRowsMobileAttr = ((ButtonGroup)xCreator.toData()).getMobileMaxRowsAttr(); - this.maxShowRowsSpinner.setValue(maxRowsMobileAttr.getMaxShowRows()); + ButtonGroup buttonGroup = (ButtonGroup)xCreator.toData(); + this.maxShowRowsSpinner.setValue(buttonGroup.getMaxShowRows()); // 数据 populate 完成后,再设置监听 this.bindListeners2Widgets(); } @Override public void update() { - ButtonGroupMaxRowsMobileAttr maxRowsMobileAttr = ((ButtonGroup)xCreator.toData()).getMobileMaxRowsAttr(); - maxRowsMobileAttr.setMaxShowRows((int) maxShowRowsSpinner.getValue()); + ButtonGroup buttonGroup = (ButtonGroup)xCreator.toData(); + buttonGroup.setMaxShowRows((int) maxShowRowsSpinner.getValue()); DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来 } } From 488616bc6427cf67e67297eae7b9035326135424 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 17 Jun 2020 09:18:48 +0800 Subject: [PATCH 124/135] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= 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 | 3 --- 1 file changed, 3 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 b1990c038f..2fbccb1cd3 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 @@ -159,9 +159,6 @@ public class JForm extends JTemplate implements BaseJForm Date: Wed, 17 Jun 2020 09:28:13 +0800 Subject: [PATCH 125/135] =?UTF-8?q?CHART-13666=20=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=B1=BB=E5=9E=8B=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/ExtraDesignClassManager.java | 37 + .../design/fun/ChartWidgetOptionProvider.java | 14 + .../AbstractChartWidgetOptionProvider.java | 30 + .../fr/design/images/m_insert/auto_chart.png | Bin 135 -> 423 bytes .../fr/design/ChartTypeInterfaceManager.java | 12 +- .../com/fr/design/chart/AutoChartDialog.java | 24 + .../java/com/fr/design/chart/ChartDialog.java | 7 +- .../mainframe/chart/gui/ChartTypePane.java | 650 +++++++++--------- .../chart/gui/type/AbstractChartTypePane.java | 5 + .../chart/custom/VanChartCustomPlotPane.java | 3 +- .../type/AbstractVanChartTypePane.java | 95 ++- .../designer/type/VanChartMapPlotPane.java | 1 + .../designer/creator/XAutoChartCreator.java | 18 +- .../designer/creator/XCreatorUtils.java | 3 +- .../design/mainframe/FormParaWidgetPane.java | 16 +- .../design/form/images/auto_chart_preview.png | Bin 0 -> 20608 bytes .../insert/cell/AutoChartCellAction.java | 3 +- .../cell/editor/AutoChartCellEditor.java | 2 + .../fr/design/mainframe/ElementCasePane.java | 7 +- .../fr/start/module/DesignerActivator.java | 3 + 20 files changed, 553 insertions(+), 377 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/ChartWidgetOptionProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractChartWidgetOptionProvider.java create mode 100644 designer-form/src/main/resources/com/fr/design/form/images/auto_chart_preview.png diff --git a/designer-base/src/main/java/com/fr/design/ExtraDesignClassManager.java b/designer-base/src/main/java/com/fr/design/ExtraDesignClassManager.java index 656a7a6a78..4aa48591fd 100644 --- a/designer-base/src/main/java/com/fr/design/ExtraDesignClassManager.java +++ b/designer-base/src/main/java/com/fr/design/ExtraDesignClassManager.java @@ -8,6 +8,7 @@ import com.fr.base.BaseUtils; import com.fr.common.annotations.Open; import com.fr.design.data.datapane.TableDataNameObjectCreator; import com.fr.design.fun.CellWidgetOptionProvider; +import com.fr.design.fun.ChartWidgetOptionProvider; import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.fun.MobileWidgetStyleProvider; import com.fr.design.fun.ParameterWidgetOptionProvider; @@ -193,6 +194,42 @@ public class ExtraDesignClassManager extends AbstractExtraClassManager implement return result.toArray(new WidgetOption[result.size()]); } + public Map, Class> getChartWidgetOptionsMap() { + Set set = getArray(ChartWidgetOptionProvider.XML_TAG); + Map, Class> map = new HashMap<>(); + for (ChartWidgetOptionProvider provider : set) { + map.put(provider.classForWidget(), provider.appearanceForWidget()); + } + return map; + } + + public WidgetOption[] getBeforeChartWidgetOptions() { + return getChartUnits(true); + } + + public WidgetOption[] getAfterChartWidgetOptions() { + return getChartUnits(false); + } + + private WidgetOption[] getChartUnits(boolean isBefore) { + Set set = getArray(ChartWidgetOptionProvider.XML_TAG); + if (set.isEmpty()) { + return new WidgetOption[0]; + } + Set result = new HashSet<>(); + for (ChartWidgetOptionProvider provider : set) { + if (provider.isBefore() == isBefore) { + WidgetOption option = WidgetOptionFactory.createByWidgetClass( + provider.nameForWidget(), + BaseUtils.readIcon(provider.iconPathForWidget()), + provider.classForWidget() + ); + result.add(option); + } + } + return result.toArray(new WidgetOption[result.size()]); + } + public WidgetOption[] getCellWidgetOptions() { Set set = getArray(CellWidgetOptionProvider.XML_TAG); diff --git a/designer-base/src/main/java/com/fr/design/fun/ChartWidgetOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/ChartWidgetOptionProvider.java new file mode 100644 index 0000000000..3deb9947b6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/ChartWidgetOptionProvider.java @@ -0,0 +1,14 @@ +package com.fr.design.fun; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-06-12 + */ +public interface ChartWidgetOptionProvider extends ParameterWidgetOptionProvider { + + String XML_TAG = "ChartWidgetOptionProvider"; + + //在图表区域的开头还是结尾插入 + boolean isBefore(); +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractChartWidgetOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractChartWidgetOptionProvider.java new file mode 100644 index 0000000000..6669d873aa --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractChartWidgetOptionProvider.java @@ -0,0 +1,30 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.ChartWidgetOptionProvider; +import com.fr.design.fun.FormWidgetOptionProvider; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-06-12 + */ +@API(level = FormWidgetOptionProvider.CURRENT_LEVEL) +public abstract class AbstractChartWidgetOptionProvider extends AbstractProvider implements ChartWidgetOptionProvider { + + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } + + @Override + public boolean isBefore() { + return false; + } + +} diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/auto_chart.png b/designer-base/src/main/resources/com/fr/design/images/m_insert/auto_chart.png index c6de0fe5e05a697ee5ae011930c47bd18ea5ecfc..9413cf93971adab5f50b97c3303812659c2c5363 100644 GIT binary patch delta 383 zcmZo?T+Tefu-+v#!ZXd+mqCkxfq{d8u|1Q41;}CqVksbIU|?Rr$iNJw89`zTnBcMk z3z!jXkV2Et!cRbDf}SppAr^wk2@3=alwO;gnf>fPqkhD$`Wuh3u%fHV$;pqHW<-fi z;5Fd0lAiunp?>+{CmP?FZm=p`p5WU$v#-~!OxHthIkyAXMbTtqf#r-Rx;9E4J8?pw z^C43X*F;{YRO5}3(zE4`zh-iCJ9b{d*Ws6)lksDd;NW0pwzmJqjY+#dN*y?IM1m{i z&7ot*vKUQLj86!Zm0del|Nq~5Mx*{8zpBg+Br~dX$_N{nU5Ku@UjOgU->JR5M|qb# zyS_etb3@*v2Tz`KWMyRhVD}T);Up~)U_5ii468=7cdW1ea$MQ*_W%F-r4G|A=h)T$ zk~rZ|(Zy6)z_`FXrLpY|^QqMgrs52y{zsOIEw{KJz$q-e*`kD%LEv17((T-{0ia;= MboFyt=akR{0RG{M3;+NC delta 93 zcmZ3^+|D?`FwD`@#WBP}Fgam?fWf0n`8heC^5FAwd8D diff --git a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java index 014778cac8..8480d24647 100644 --- a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java @@ -104,6 +104,7 @@ import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.awt.event.ActionListener; import static com.fr.chart.charttypes.ChartTypeManager.DEFAULT_PRIORITY; import static com.fr.chart.charttypes.ChartTypeManager.DEPRECATED_CHART_PRIORITY; @@ -259,17 +260,21 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr * * @param paneList pane容器 */ - public void addPlotTypePaneList(List> paneList, Map>> allChartTypePane) { + public void addPlotTypePaneList(List> paneList, + Map>> allChartTypePane, + ActionListener autoButtonListener) { List priorityList = getPriorityInOrder(); for (Integer aPriorityList : priorityList) { String priority = String.valueOf(aPriorityList); - addPlotTypePaneList(priority, paneList, allChartTypePane); + addPlotTypePaneList(priority, paneList, allChartTypePane, autoButtonListener); } } - public void addPlotTypePaneList(String priority, List> paneList, Map>> allChartTypePane) { + public void addPlotTypePaneList(String priority, List> paneList, + Map>> allChartTypePane, + ActionListener autoButtonListener) { if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority)) { @@ -286,6 +291,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr continue; } pane.reLayout(plotID); + pane.registerButtonListener(autoButtonListener); paneList.add(pane); if (allChartTypePane.get(priority) == null) { diff --git a/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java b/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java index 4f8a1d033d..583889da6b 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java +++ b/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java @@ -1,7 +1,11 @@ package com.fr.design.chart; import com.fr.base.chart.BaseChartCollection; +import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.chartattr.ChartCollection; +import com.fr.chartx.TwoTuple; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.vanchart.VanChart; import java.awt.Component; import java.awt.Dialog; @@ -46,10 +50,30 @@ public class AutoChartDialog extends ChartDialog { }; } + protected String getDialogTitle() { + return Toolkit.i18nText("Fine-Design_Chart_M_Popup_Auto_Chart_Type"); + } + /** * 更新新建的图表 ChartCollection */ public void populate(BaseChartCollection cc) { super.populate(cc); + ChartCollection chartCollection = (ChartCollection) getChartCollection(); + VanChart vanChart = chartCollection.getSelectedChartProvider(VanChart.class); + if (vanChart == null) { + return; + } + TopDefinitionProvider filterDefinition = vanChart.getFilterDefinition(); + if (filterDefinition == null) { + return; + } + TwoTuple tableNameAndDataFields = filterDefinition.getTableNameAndDataFields(); + if (tableNameAndDataFields == null) { + return; + } + String tableName = tableNameAndDataFields.getFirst(); + String[] dataFields = tableNameAndDataFields.getSecond(); + autoChartTypePane.populate(tableName, dataFields); } } 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 9c2b730ab0..9251bdbc88 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 @@ -5,6 +5,7 @@ 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.i18n.Toolkit; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.third.joda.time.DateTime; @@ -46,7 +47,7 @@ public class ChartDialog extends MiddleChartDialog { createTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss"); this.setModal(true); this.setLayout(new BorderLayout()); - setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_M_Popup_Chart_Type")); + setTitle(getDialogTitle()); this.applyClosingAction(); this.applyEscapeAction(); @@ -73,6 +74,10 @@ public class ChartDialog extends MiddleChartDialog { GUICoreUtils.setWindowCenter(getOwner(), this); } + protected String getDialogTitle() { + return Toolkit.i18nText("Fine-Design_Chart_M_Popup_Chart_Type"); + } + protected Component initCenterPane() { chartTypePane = new ChartTypePane(); return chartTypePane; 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 6719401bb2..b363dc5f6b 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 @@ -9,9 +9,7 @@ import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.chart.MiddleChartDialog; import com.fr.design.gui.frpane.UIComboBoxPane; -import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.ChartEditPane; @@ -39,364 +37,366 @@ import java.awt.event.ItemListener; /** * 图表 属性表, 类型选择 界面. -* @author kunsnat E-mail:kunsnat@gmail.com -* @version 创建时间:2012-12-26 上午10:56:51 + * + * @author kunsnat E-mail:kunsnat@gmail.com + * @version 创建时间:2012-12-26 上午10:56:51 */ -public class ChartTypePane extends AbstractChartAttrPane{ - private ComboBoxPane chartTypeComBox; - private ChartTypeButtonPane buttonPane; +public class ChartTypePane extends AbstractChartAttrPane { + private ComboBoxPane chartTypeComBox; + private ChartTypeButtonPane buttonPane; private ChartEditPane editPane; private ChartCollection editingCollection; - private UIButton autoButton; - - @Override - protected JPanel createContentPane() { - JPanel content = new JPanel(new BorderLayout()); - - buttonPane = new ChartTypeButtonPane(this); - content.add(buttonPane, BorderLayout.NORTH); - - if (editingCollection != null) { - relayoutChartTypePane(editingCollection); - }else { - chartTypeComBox = new ComboBoxPane(); - } - - BasicScrollPane scrollPane = new BasicScrollPane() { - @Override - protected JPanel createContentPane() { - return chartTypeComBox; - } - - @Override - protected void layoutContentPane() { - - leftcontentPane = createContentPane(); - this.add(leftcontentPane); - } - - @Override - public void populateBean(Object ob) { - } - - @Override - protected String title4PopupWindow() { - return null; - } - }; - content.add(scrollPane, BorderLayout.CENTER); - - buttonPane.setEditingChartPane(chartTypeComBox); - - if(ChartTypeManager.AUTO_CHART) { - initAutoButton(); - content.add(autoButton, BorderLayout.SOUTH); - } - - return content; - } - - /** - * 界面做为按钮时的图片位置. design_base - */ - public String getIconPath() { - return "com/fr/design/images/chart/ChartType.png"; - } - - /** - * 界面标题 + private ActionListener autoButtonListener; + + @Override + protected JPanel createContentPane() { + initButtonListener(); + JPanel content = new JPanel(new BorderLayout()); + + buttonPane = new ChartTypeButtonPane(this); + content.add(buttonPane, BorderLayout.NORTH); + + if (editingCollection != null) { + relayoutChartTypePane(editingCollection); + } else { + chartTypeComBox = new ComboBoxPane(); + } + + BasicScrollPane scrollPane = new BasicScrollPane() { + @Override + protected JPanel createContentPane() { + return chartTypeComBox; + } + + @Override + protected void layoutContentPane() { + + leftcontentPane = createContentPane(); + this.add(leftcontentPane); + } + + @Override + public void populateBean(Object ob) { + } + + @Override + protected String title4PopupWindow() { + return null; + } + }; + content.add(scrollPane, BorderLayout.CENTER); + + buttonPane.setEditingChartPane(chartTypeComBox); + + return content; + } + + /** + * 界面做为按钮时的图片位置. design_base + */ + public String getIconPath() { + return "com/fr/design/images/chart/ChartType.png"; + } + + /** + * 界面标题 + * * @return 界面标题 - */ - public String title4PopupWindow() { - return PaneTitleConstants.CHART_TYPE_TITLE; - } - - private void initAutoButton(){ - //TODO @Bjorn 视觉样式优化 - autoButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_M_Popup_Auto_Chart_Type")); - autoButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - final MiddleChartDialog autoChartDialog = DesignModuleFactory.getAutoChartDialog(DesignerContext.getDesignerFrame()); - autoChartDialog.populate(editingCollection); - autoChartDialog.addDialogActionListener(new DialogActionAdapter() { - @Override - public void doOk() { - populate(editingCollection); - } - }); - autoChartDialog.setVisible(true); - } - }); - } - - class ComboBoxPane extends UIComboBoxPane { - private Map>> allChartTypePane; - - @Override - protected List> initPaneList() { - List> paneList = new ArrayList>(); - allChartTypePane = new LinkedHashMap>>(); - ChartTypeInterfaceManager.getInstance().addPlotTypePaneList(paneList, allChartTypePane); - return paneList; - } - - @Override - protected String title4PopupWindow() { - return null; - } - - /** - * 不同图表切换分同一个selected的不同图表切换和不同selected的不同图表切换 - * 如果是切换图表的某个图表发生变化,则collection的选择下标不会变 - * 如果是切换图表的不同图表之间切换,则collection的选择下标会改变 - * @param chart - */ - public void updateBean(ChartProvider chart) { - - String lastPlotID = chart.getID(); - - try{ - AbstractChartTypePane selectedPane = (AbstractChartTypePane) getSelectedPane(); - ChartProvider newDefaultChart =(ChartProvider) ChartTypeManager.getInstanceWithCheck().getCharts(selectedPane.getPlotID())[0].clone(); - if (!ComparatorUtils.equals(chart.getClass(), newDefaultChart.getClass())) { - //vanChart 和 chart 之间切换 - //不同chart之间切换 + */ + public String title4PopupWindow() { + return PaneTitleConstants.CHART_TYPE_TITLE; + } + + public void initButtonListener() { + autoButtonListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + final MiddleChartDialog autoChartDialog = DesignModuleFactory.getAutoChartDialog(DesignerContext.getDesignerFrame()); + autoChartDialog.populate(editingCollection); + autoChartDialog.addDialogActionListener(new DialogActionAdapter() { + @Override + public void doOk() { + populate(editingCollection); + } + }); + autoChartDialog.setVisible(true); + } + }; + } + + class ComboBoxPane extends UIComboBoxPane { + private Map>> allChartTypePane; + + @Override + protected List> initPaneList() { + List> paneList = new ArrayList>(); + allChartTypePane = new LinkedHashMap>>(); + ChartTypeInterfaceManager.getInstance().addPlotTypePaneList(paneList, allChartTypePane, autoButtonListener); + return paneList; + } + + @Override + protected String title4PopupWindow() { + return null; + } + + /** + * 不同图表切换分同一个selected的不同图表切换和不同selected的不同图表切换 + * 如果是切换图表的某个图表发生变化,则collection的选择下标不会变 + * 如果是切换图表的不同图表之间切换,则collection的选择下标会改变 + * + * @param chart + */ + public void updateBean(ChartProvider chart) { + + String lastPlotID = chart.getID(); + + try { + AbstractChartTypePane selectedPane = (AbstractChartTypePane) getSelectedPane(); + ChartProvider newDefaultChart = (ChartProvider) ChartTypeManager.getInstanceWithCheck().getCharts(selectedPane.getPlotID())[0].clone(); + if (!ComparatorUtils.equals(chart.getClass(), newDefaultChart.getClass())) { + //vanChart 和 chart 之间切换 + //不同chart之间切换 editingCollection.removeNameObject(editingCollection.getSelectedIndex()); editingCollection.addChart(newDefaultChart); chart = newDefaultChart; } - }catch (CloneNotSupportedException e){ + } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } - //这一步会替换plot - ((AbstractChartTypePane)getSelectedPane()).updateBean(chart); - - String chartID = chart.getID(); - - //chartID改变的话图表类型就算改变了 - if (StringUtils.isNotEmpty(chartID)) { - - boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(chartID); - - if (editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, chartID))) { - editPane.reLayout(chart); - } - } - } - - protected UIComboBox createComboBox() { - return new FlexibleComboBox(); - } - - @Override - protected void addItemChangeEvent() { - jcb.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - FlexibleComboBox fcb = (FlexibleComboBox)jcb; - if (fcb.isReactor()){ - return; - } - comboBoxItemStateChanged(); - CardLayout cl = (CardLayout)cardPane.getLayout(); - cl.show(cardPane, cardNames[jcb.getSelectedIndex()]); - } - }); - } - - private void addAllCards() { - Iterator iterator = allChartTypePane.keySet().iterator(); - - while (iterator.hasNext()) { - addOnePriorityCards(iterator.next(), false); - } - } - - private void addOnePriorityCards(String priority) { - addOnePriorityCards(priority, true); - } - - private void addOnePriorityCards(String priority, boolean ignore) { - - Map> map = allChartTypePane.get(priority); - - Iterator>> iterator = map.entrySet().iterator(); - - while (iterator.hasNext()) { - Map.Entry> entry = iterator.next(); - String plotID = entry.getKey(); - if (ignore || ChartTypeManager.enabledChart(plotID)) { - cards.add(entry.getValue()); - } - } - - } - - private void addOnePlotIDCards(String priority, String plotID) { - cards.add(allChartTypePane.get(priority).get(plotID)); - } - - //因为饼图(新特性)把(新特性)去掉了,和老的饼图同名,下拉框选项和typePane不能一一对应了 - //处理办法:这边除了重构 下拉项选项和cardNames 还需要把cards重构下(不需要init pane,只需要我需要的拿出来就好了) - private void relayout(ChartCollection collection){ - //重构需要重构下拉框选项和cardNames - ChartProvider chart = collection.getSelectedChartProvider(ChartProvider.class); - String chartID = chart.getID(); - String priority = ChartTypeManager.getInstanceWithCheck().getPriority(chartID); - boolean enabledChart = ChartTypeManager.enabledChart(chartID); - String item = ChartTypeInterfaceManager.getInstance().getName(chartID); - - //第一步就是重构cards - cards.clear(); - if (enabledChart) { - if (collection.getChartCount() == 1) { - addAllCards(); - } else { - addOnePriorityCards(priority); - } - } else { - addOnePlotIDCards(priority, chartID); - } - - //下拉框重构开始。为了防止重构是触发update - ((FlexibleComboBox)jcb).setItemEvenType(ItemEventType.REACTOR); - //重构下拉框选项 - cardNames = new String[cards.size()]; - cardPane.removeAll(); - jcb.removeAllItems(); - for (int i = 0; i < this.cards.size(); i++) { - String name = this.cards.get(i).title4PopupWindow();// Name从各自的pane里面获取 - cardNames[i] = name; - cardPane.add(this.cards.get(i), cardNames[i]); - addComboBoxItem(cards, i); - } - //重新选择选中的下拉项 - jcb.setSelectedItem(item); - jcb.setEnabled(enabledChart); - //下拉框重构结束 - ((FlexibleComboBox)jcb).setItemEvenType(ItemEventType.DEFAULT); - //重新选中 - checkPlotPane(); - } - - private void checkPlotPane() { - CardLayout cl = (CardLayout)cardPane.getLayout(); - cl.show(cardPane, cardNames[jcb.getSelectedIndex()]); - } - - @Override - public void populateBean(ChartProvider ob) { - for (int i = 0; i < this.cards.size(); i++) { - FurtherBasicBeanPane pane = cards.get(i); - if (pane.accept(ob)) { - pane.populateBean(ob); - Object item = pane.title4PopupWindow(); - for (int j = 0; j < cardNames.length; j++) { - if (ComparatorUtils.equals(item, cardNames[j])) { - jcb.setSelectedIndex(j); - } - } - return; - } - } - } - - @Override - public ChartProvider updateBean() { - return getSelectedPane().updateBean(); - } - - @Override - public FurtherBasicBeanPane getSelectedPane() { - Object item = jcb.getSelectedItem(); - for (int i = 0; i < cards.size(); i++){ - if (ComparatorUtils.equals(item, cards.get(i).title4PopupWindow())){ - return cards.get(i); - } - } - return cards.get(0); - } - - } - - - /** - * 面板重构 - * @param lastPlotID - * @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.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, plotID))) { - editPane.reLayout(chart); - } - } - - - public void relayoutChartTypePane(ChartCollection collection){ - chartTypeComBox.relayout(collection); - } - - /** - * 更新界面属性 用于展示 - */ - public void populate(ChartCollection collection) { - editingCollection = collection; - - ChartProvider chart = collection.getSelectedChartProvider(ChartProvider.class); - this.remove(leftContentPane); - initContentPane(); - - buttonPane.populateBean(collection); - chartTypeComBox.populateBean(chart); - - buttonPane.setVisible(ChartTypeInterfaceManager.getInstance().needChartChangePane(chart)); - - this.initAllListeners(); - } - - /** - * 保存界面属性 - */ - public void update(ChartCollection collection) { + //这一步会替换plot + ((AbstractChartTypePane) getSelectedPane()).updateBean(chart); + + String chartID = chart.getID(); + + //chartID改变的话图表类型就算改变了 + if (StringUtils.isNotEmpty(chartID)) { + + boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(chartID); + + if (editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, chartID))) { + editPane.reLayout(chart); + } + } + } + + protected UIComboBox createComboBox() { + return new FlexibleComboBox(); + } + + @Override + protected void addItemChangeEvent() { + jcb.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + FlexibleComboBox fcb = (FlexibleComboBox) jcb; + if (fcb.isReactor()) { + return; + } + comboBoxItemStateChanged(); + CardLayout cl = (CardLayout) cardPane.getLayout(); + cl.show(cardPane, cardNames[jcb.getSelectedIndex()]); + } + }); + } + + private void addAllCards() { + Iterator iterator = allChartTypePane.keySet().iterator(); + + while (iterator.hasNext()) { + addOnePriorityCards(iterator.next(), false); + } + } + + private void addOnePriorityCards(String priority) { + addOnePriorityCards(priority, true); + } + + private void addOnePriorityCards(String priority, boolean ignore) { + + Map> map = allChartTypePane.get(priority); + + Iterator>> iterator = map.entrySet().iterator(); + + while (iterator.hasNext()) { + Map.Entry> entry = iterator.next(); + String plotID = entry.getKey(); + if (ignore || ChartTypeManager.enabledChart(plotID)) { + cards.add(entry.getValue()); + } + } + + } + + private void addOnePlotIDCards(String priority, String plotID) { + cards.add(allChartTypePane.get(priority).get(plotID)); + } + + //因为饼图(新特性)把(新特性)去掉了,和老的饼图同名,下拉框选项和typePane不能一一对应了 + //处理办法:这边除了重构 下拉项选项和cardNames 还需要把cards重构下(不需要init pane,只需要我需要的拿出来就好了) + private void relayout(ChartCollection collection) { + //重构需要重构下拉框选项和cardNames + ChartProvider chart = collection.getSelectedChartProvider(ChartProvider.class); + String chartID = chart.getID(); + String priority = ChartTypeManager.getInstanceWithCheck().getPriority(chartID); + boolean enabledChart = ChartTypeManager.enabledChart(chartID); + String item = ChartTypeInterfaceManager.getInstance().getName(chartID); + + //第一步就是重构cards + cards.clear(); + if (enabledChart) { + if (collection.getChartCount() == 1) { + addAllCards(); + } else { + addOnePriorityCards(priority); + } + } else { + addOnePlotIDCards(priority, chartID); + } + + //下拉框重构开始。为了防止重构是触发update + ((FlexibleComboBox) jcb).setItemEvenType(ItemEventType.REACTOR); + //重构下拉框选项 + cardNames = new String[cards.size()]; + cardPane.removeAll(); + jcb.removeAllItems(); + for (int i = 0; i < this.cards.size(); i++) { + String name = this.cards.get(i).title4PopupWindow();// Name从各自的pane里面获取 + cardNames[i] = name; + cardPane.add(this.cards.get(i), cardNames[i]); + addComboBoxItem(cards, i); + } + //重新选择选中的下拉项 + jcb.setSelectedItem(item); + jcb.setEnabled(enabledChart); + //下拉框重构结束 + ((FlexibleComboBox) jcb).setItemEvenType(ItemEventType.DEFAULT); + //重新选中 + checkPlotPane(); + } + + private void checkPlotPane() { + CardLayout cl = (CardLayout) cardPane.getLayout(); + cl.show(cardPane, cardNames[jcb.getSelectedIndex()]); + } + + @Override + public void populateBean(ChartProvider ob) { + for (int i = 0; i < this.cards.size(); i++) { + FurtherBasicBeanPane pane = cards.get(i); + if (pane.accept(ob)) { + pane.populateBean(ob); + Object item = pane.title4PopupWindow(); + for (int j = 0; j < cardNames.length; j++) { + if (ComparatorUtils.equals(item, cardNames[j])) { + jcb.setSelectedIndex(j); + } + } + return; + } + } + } + + @Override + public ChartProvider updateBean() { + return getSelectedPane().updateBean(); + } + + @Override + public FurtherBasicBeanPane getSelectedPane() { + Object item = jcb.getSelectedItem(); + for (int i = 0; i < cards.size(); i++) { + if (ComparatorUtils.equals(item, cards.get(i).title4PopupWindow())) { + return cards.get(i); + } + } + return cards.get(0); + } + + } + + + /** + * 面板重构 + * + * @param lastPlotID + * @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.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, plotID))) { + editPane.reLayout(chart); + } + } + + + public void relayoutChartTypePane(ChartCollection collection) { + chartTypeComBox.relayout(collection); + } + + /** + * 更新界面属性 用于展示 + */ + public void populate(ChartCollection collection) { + editingCollection = collection; + + ChartProvider chart = collection.getSelectedChartProvider(ChartProvider.class); + this.remove(leftContentPane); + initContentPane(); + + buttonPane.populateBean(collection); + chartTypeComBox.populateBean(chart); + + buttonPane.setVisible(ChartTypeInterfaceManager.getInstance().needChartChangePane(chart)); + + this.initAllListeners(); + } + + /** + * 保存界面属性 + */ + public void update(ChartCollection collection) { editingCollection = collection; - buttonPane.update(collection);// 内部操作时 已经做过处理. - ChartProvider chart = collection.getSelectedChartProvider(ChartProvider.class); - chartTypeComBox.updateBean(chart); - } + buttonPane.update(collection);// 内部操作时 已经做过处理. + ChartProvider chart = collection.getSelectedChartProvider(ChartProvider.class); + chartTypeComBox.updateBean(chart); + } /** * 所有图表的类型界面 + * * @return 类型界面 */ - public FurtherBasicBeanPane[] getPaneList(){ + public FurtherBasicBeanPane[] getPaneList() { return chartTypeComBox.getCards().toArray(new FurtherBasicBeanPane[0]); } /** * 当前选中的图表的index + * * @return 当前选中的图表的index */ - public int getSelectedIndex(){ + public int getSelectedIndex() { return chartTypeComBox.getSelectedIndex(); } /** * 返回选中的图表的index + * * @return 选中的图标的序号 */ - public int getSelectedChartIndex(){ + public int getSelectedChartIndex() { return chartTypeComBox.getSelectedIndex(); } /** * 设置下编辑的面板 + * * @param currentEditPane 设置下编辑的面板 */ public void registerChartEditPane(ChartEditPane currentEditPane) { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java index eee0e322e6..4f3f025105 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java @@ -22,6 +22,7 @@ import java.util.List; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; +import java.awt.event.ActionListener; public abstract class AbstractChartTypePane extends FurtherBasicBeanPane { @@ -240,4 +241,8 @@ public abstract class AbstractChartTypePane extends Fur public ChartProvider getDefaultChart() { return BarIndependentChart.barChartTypes[0]; } + + public void registerButtonListener(ActionListener autoButtonListener) { + + } } \ No newline at end of file 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 a4b43843e4..6bace5ef90 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 @@ -61,7 +61,8 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane { return new Component[][]{ new Component[]{typePane}, new Component[]{stylePane}, - new Component[]{contentPane} + new Component[]{contentPane}, + new Component[]{buttonPane}, }; } 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 c2406e0d2c..577a04664c 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 @@ -1,5 +1,6 @@ package com.fr.van.chart.designer.type; +import com.fr.base.BaseUtils; import com.fr.chart.base.AttrFillStyle; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Legend; @@ -7,13 +8,16 @@ import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.chartglyph.DataSheet; +import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chartx.data.AbstractDataDefinition; import com.fr.chartx.data.ChartDataDefinitionProvider; import com.fr.chartx.data.field.AbstractColumnFieldCollection; import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection; import com.fr.design.ChartTypeInterfaceManager; +import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.MultilineLabel; +import com.fr.design.i18n.Toolkit; 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; @@ -25,21 +29,53 @@ import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartZoom; import com.fr.plugin.chart.vanchart.VanChart; +import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; +import java.awt.Dimension; +import java.awt.event.ActionListener; public abstract class AbstractVanChartTypePane extends AbstractChartTypePane { private static final long serialVersionUID = 7743244512351499265L; private UICheckBox largeModelCheckBox; + protected JPanel buttonPane; + + protected UIButton autoButton; + private boolean samePlot; protected boolean isSamePlot() { return samePlot; } + public AbstractVanChartTypePane() { + buttonPane = new JPanel(); + buttonPane.setLayout(new BorderLayout()); + if (ChartTypeManager.AUTO_CHART) { + autoButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_M_Popup_Auto_Chart_Type"), + BaseUtils.readIcon("/com/fr/design/images/m_insert/auto_chart.png")) { + @Override + public Dimension getPreferredSize() { + return new Dimension((int) super.getPreferredSize().getWidth(), 25); + } + }; + buttonPane.setBorder((BorderFactory.createEmptyBorder(5, 0, 0, 0))); + buttonPane.add(autoButton); + } + } + + @Override + protected Component[][] getPaneComponents(JPanel typePane) { + return new Component[][]{ + new Component[]{typePane}, + new Component[]{buttonPane}, + new Component[]{stylePane}, + }; + } + //新图表暂时还没有平面3d,渐变高光等布局。 @Override protected String[] getTypeLayoutPath() { @@ -66,7 +102,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane}T)cyQ;Db76u6h3JMCAoUEie3JORE1qHPO@)$V6 z?Nnz5JfS+N%e+M?9elY7{2^(sBWIzcgu)EGhM=GZTcdyOY5{qWE^&<)a*Gfe<+563dZ^GumA4Bf9>G^ zVK=}4hjOYl+M15MZ28oa*dJjx>$At%IPmDfciWOdxDMJs^r&!*0*p-8Pw2*j@C?ZE z!vx0S%4c1T*AqFb=5K{){82y424Fg zDYf+O3UiO__-$0ZfTVB3D#bR#+%0dI(ss)_@&Ab~8K1>m-(L6pIukK{HmEd{{JM2O zDaI?*{-5XVLw+@B5ZDBwfTX}_gYyhdRYyh}i0$M~h4V1ocfo{l&>$=8sE^mPLk0^u^ z*s?Ty%C;ke1l7z}m{aB?o-tdqh{s(8F}vGQi7ZaC(v|En)qGA2?@FJ~0>k~?!1a=U zQ(H3VA&jK2HtPk%_s9*(ss*Ud9hZB|+m}s0@gyvT@I3|n1SN+}PqGji75#uJcIaV) zip$T0cF&5%>Ly5csIwf=59np!Uh^R{_Kid2Rn~LB?ZdGMScvuTW6qsG=ALp+M%Y%z zj4f-_veznyi4d)M8T%`IUf8FxdGQw2&Dq8*E$*q+u6upA>&`pOfR7kvAmZ%ONaWwM zMnR4k6q(*uSd+reKy*cWoI!W%m{DJXUpZ8EUeitSzCm|mLudit1dR0Zc^mf6Bf4-H zA*Ek6kaNEjGq|M}JSkj*SnB2!+ZX~UXmm?u-=rVkaXn)|Es=h(oP!v#-%HGOsCqtn zz~&(5YsM1|W8_Yah~Mckik2aTc_(VURTnr!;eS543_LF}?ol#+VX#I%s+Vj2X8Wmh zrK46ym6AU}T1#H;!-npobv-SeBMb-YR{G9ur^H@mc~7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X+)89MwX6u_ePK!4kfma!?O#*iGRc&M@Om&}Z zv}?*tAHD6WY5TnmtDBUhFCCj{B=fCgqVv)6nGdBkH*XK#wercNdAlRuR0f_;i`3RB zol$eJ^!9=+cloDukX|-E0=UX+4OF4k>&SATa3a_{aK^0 z7dd&yfpeb4mq9BqlYwjSfa9)QEKRxzUv5oRFPj_VtDHLNcc~FyNswt}(Pcg0jMA!K zLh3iHC7!>zT3PpPMzWoPw^@qYOqBxQHpc(o-khAf|BT#p-krP8T4e5I4pb7E?WQ-k z_O{-QnZR`^YrnDvu6=)EpWa5r%OAD5y0|u7}VwY5J0tF&z_`NoU})`?0ZGH#`M$Ew`aN68;SMX1y?A^hRR=m`Ecvj5|vLy zDbxF+xi5=U>o(pnegH9onWx}jqJ3|&;5Si-E5vy<-9dMVDG0J zCyORGMQOcGs{PsidD)(T%())m9TecjpQ8kLbbFKltppxT41*~Q?g{+(UncML-6SSF Q26XzLr>mdKI;Vst0C}8TlmGw# literal 0 HcmV?d00001 diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java index 6ee1a74c48..c24ea2367d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java @@ -2,6 +2,7 @@ package com.fr.design.actions.insert.cell; import com.fr.base.BaseUtils; import com.fr.chart.chartattr.AutoChartCollection; +import com.fr.common.annotations.Open; import com.fr.design.actions.core.WorkBookSupportable; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.ElementCasePane; @@ -14,6 +15,7 @@ import javax.swing.KeyStroke; * @version 10.0 * Created by Bjorn on 2020-05-28 */ +@Open public class AutoChartCellAction extends AbstractCellAction implements WorkBookSupportable { public AutoChartCellAction() { @@ -29,7 +31,6 @@ public class AutoChartCellAction extends AbstractCellAction implements WorkBookS this.setMenuKeySet(INSERT_AUTO_CHART); this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); - //TODO @Bjorn 视觉样式优化icon this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/auto_chart.png")); } diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/AutoChartCellEditor.java b/designer-realize/src/main/java/com/fr/design/cell/editor/AutoChartCellEditor.java index 4102487667..8dbbecca08 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/AutoChartCellEditor.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/AutoChartCellEditor.java @@ -1,5 +1,6 @@ package com.fr.design.cell.editor; +import com.fr.common.annotations.Open; import com.fr.design.gui.chart.MiddleChartDialog; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.module.DesignModuleFactory; @@ -12,6 +13,7 @@ import java.awt.Window; * @version 10.0 * Created by Bjorn on 2020-05-28 */ +@Open public class AutoChartCellEditor extends ChartCellEditor { public AutoChartCellEditor(ElementCasePane ePane) { 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 24178bcfd4..9fc0b7b521 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 @@ -9,7 +9,6 @@ import com.fr.base.Formula; import com.fr.base.ScreenResolution; import com.fr.base.Style; import com.fr.base.vcs.DesignerMode; -import com.fr.chart.chartattr.AutoChartCollection; import com.fr.design.DesignState; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -53,8 +52,6 @@ import com.fr.design.cell.bar.DynamicScrollBar; import com.fr.design.cell.clipboard.CellElementsClip; import com.fr.design.cell.clipboard.ElementsTransferable; import com.fr.design.cell.clipboard.FloatElementsClip; -import com.fr.design.cell.editor.AutoChartCellEditor; -import com.fr.design.cell.editor.AutoChartFloatEditor; import com.fr.design.cell.editor.BiasTextPainterCellEditor; import com.fr.design.cell.editor.CellEditor; import com.fr.design.cell.editor.ChartCellEditor; @@ -402,8 +399,6 @@ public abstract class ElementCasePane extends Tar grid.setDefaultFloatEditor(chartClass, new ChartFloatEditor()); } - grid.setDefaultCellEditor(AutoChartCollection.class, new AutoChartCellEditor(this)); - grid.setDefaultFloatEditor(AutoChartCollection.class, new AutoChartFloatEditor()); addExtraCellEditor(grid); @@ -427,7 +422,7 @@ public abstract class ElementCasePane extends Tar editor = (CellEditor) c.newInstance(); } catch (NoSuchMethodException e) { try { - c = clazz.getConstructor(ElementCase.class); + c = clazz.getConstructor(ElementCasePane.class); editor = (CellEditor) c.newInstance(this); } catch (Exception e1) { FineLoggerFactory.getLogger().error(e1.getMessage(), e1); 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 c0a979d6eb..3f1aa26636 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 @@ -350,6 +350,9 @@ public class DesignerActivator extends Activator { Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); for (ElementUIProvider provider : providers) { try { + if (provider.quickEditor() == null) { + continue; + } ActionFactory.registerCellEditor(provider.targetObjectClass(), provider.quickEditor().newInstance()); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); From a40991ca180d6967c44d86e6f445392a07c40865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 17 Jun 2020 09:29:58 +0800 Subject: [PATCH 126/135] CHART-13666 --- .../fr/design/fun/impl/AbstractChartWidgetOptionProvider.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractChartWidgetOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractChartWidgetOptionProvider.java index 6669d873aa..af93c586f0 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractChartWidgetOptionProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractChartWidgetOptionProvider.java @@ -1,7 +1,6 @@ package com.fr.design.fun.impl; import com.fr.design.fun.ChartWidgetOptionProvider; -import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.stable.fun.impl.AbstractProvider; import com.fr.stable.fun.mark.API; @@ -10,7 +9,7 @@ import com.fr.stable.fun.mark.API; * @version 10.0 * Created by Bjorn on 2020-06-12 */ -@API(level = FormWidgetOptionProvider.CURRENT_LEVEL) +@API(level = ChartWidgetOptionProvider.CURRENT_LEVEL) public abstract class AbstractChartWidgetOptionProvider extends AbstractProvider implements ChartWidgetOptionProvider { public int currentAPILevel() { From 0e2370b266d4d913fcbabb80de44b26e0fce2478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 17 Jun 2020 09:45:03 +0800 Subject: [PATCH 127/135] =?UTF-8?q?CHART-13666=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=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/chart/AutoChartDialog.java | 2 +- .../fr/van/chart/designer/type/AbstractVanChartTypePane.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java b/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java index 583889da6b..ddf4a0b407 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java +++ b/designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java @@ -51,7 +51,7 @@ public class AutoChartDialog extends ChartDialog { } protected String getDialogTitle() { - return Toolkit.i18nText("Fine-Design_Chart_M_Popup_Auto_Chart_Type"); + return Toolkit.i18nText("Fine-Design_Chart_Auto_Recommended_Chart"); } /** 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 577a04664c..6189c347b4 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 @@ -55,7 +55,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane Date: Wed, 17 Jun 2020 11:32:34 +0800 Subject: [PATCH 128/135] =?UTF-8?q?REPORT-33858=20=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=AD=BB=E5=BE=AA=E7=8E=AF=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/mainframe/errorinfo/ErrorInfoLogAppender.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java index bcdea3e5a1..10ac2e3a27 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java @@ -147,8 +147,11 @@ public class ErrorInfoLogAppender extends AppenderSkeleton { } }; try { - file.readStream(new ByteArrayInputStream(WorkContext.getWorkResource().readFully(StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, bookPath)))); - return file.getTemplateID(); + //如果bookPath是null,ResourceIOUtils会因为无法读取文件夹的流输出error日志,输出日志会再次走到这里,引起死循环 + if (StringUtils.isNotBlank(bookPath)) { + file.readStream(new ByteArrayInputStream(WorkContext.getWorkResource().readFully(StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, bookPath)))); + return file.getTemplateID(); + } } catch (Exception ignore) { } From 04b01ff4664ca43ae8db712cd02ba1bf4b7185f3 Mon Sep 17 00:00:00 2001 From: zack Date: Wed, 17 Jun 2020 13:02:07 +0800 Subject: [PATCH 129/135] =?UTF-8?q?import=E8=AE=BE=E7=BD=AE=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/data/DesignTableDataManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7bfd4a6ee8..f9c9ddab6b 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 @@ -37,7 +37,7 @@ import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; -import javax.swing.*; +import javax.swing.JFrame; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.io.ByteArrayOutputStream; From a1350867e76fb11ce20a79711826b25a208d03e3 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 18 Jun 2020 09:41:20 +0800 Subject: [PATCH 130/135] =?UTF-8?q?CHART-14104=20=E5=9D=90=E6=A0=87?= =?UTF-8?q?=E8=BD=B4=E5=88=87=E6=8D=A2=E5=89=8D=E5=90=8E=EF=BC=8C=E4=BC=A0?= =?UTF-8?q?=E9=80=92=E7=BD=91=E6=A0=BC=E7=BA=BF=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../axis/VanChartAxisScrollPaneWithTypeSelect.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java index eda8ea007d..830bebf643 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java @@ -1,11 +1,11 @@ package com.fr.van.chart.designer.style.axis; import com.fr.chart.chartattr.Axis; +import com.fr.design.i18n.Toolkit; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.general.ComparatorUtils; - import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartTimeAxis; import com.fr.plugin.chart.attr.axis.VanChartValueAxis; @@ -57,7 +57,7 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll protected void initLayout() { this.setLayout(new BorderLayout(0,6)); - JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Type"),jcb); + JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Type"), jcb); northPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,0)); this.add(northPane, BorderLayout.NORTH); this.add(cardPane, BorderLayout.CENTER); @@ -102,21 +102,21 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll if(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY)){ textAxisPane.updateBean(axis); } else { - axis = new VanChartAxis(axis.getAxisName(), axis.getPosition()); + axis = new VanChartAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType()); textAxisPane.updateBean(axis); } } else if(ComparatorUtils.equals(index, AxisType.AXIS_TIME.ordinal())){ if(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_TIME)){ timeAxisPane.updateBean(axis); } else { - axis = new VanChartTimeAxis(axis.getAxisName(), axis.getPosition()); + axis = new VanChartTimeAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType()); timeAxisPane.updateBean(axis); } } else if(ComparatorUtils.equals(index, AxisType.AXIS_VALUE.ordinal())){ if(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_VALUE)){ valueAxisPane.updateBean(axis); } else { - axis = new VanChartValueAxis(axis.getAxisName(), axis.getPosition()); + axis = new VanChartValueAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType()); valueAxisPane.updateBean(axis); } } From 03f3c716755be677e640e369b7191461a990cf8a Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 18 Jun 2020 11:22:01 +0800 Subject: [PATCH 131/135] =?UTF-8?q?REPORT-33616=20=E5=A1=AB=E6=8A=A5?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E8=AE=BE=E7=BD=AE-=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8D=95=E5=85=83=E6=A0=BC=EF=BC=8C=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E5=92=8C=E5=8F=96=E6=B6=88=E6=95=88=E6=9E=9C=E4=B8=80?= =?UTF-8?q?=E6=A0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../write/submit/DBManipulationPane.java | 72 +++++++++++++++++-- .../submit/SmartInsertDBManipulationPane.java | 2 +- 2 files changed, 66 insertions(+), 8 deletions(-) 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 9df5d7916a..590f9d1121 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 @@ -36,6 +36,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.general.DateUtils; import com.fr.general.data.Condition; +import com.fr.log.FineLoggerFactory; import com.fr.stable.ColumnRow; import com.fr.stable.ColumnRowGroup; import com.fr.write.DBManipulation; @@ -47,14 +48,31 @@ import com.fr.write.config.InsertConfig; import com.fr.write.config.IntelliDMLConfig; import com.fr.write.config.UpdateConfig; -import javax.swing.*; +import javax.swing.AbstractCellEditor; +import javax.swing.BorderFactory; +import javax.swing.DefaultCellEditor; +import javax.swing.DefaultComboBoxModel; +import javax.swing.Icon; +import javax.swing.JList; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTree; +import javax.swing.ListSelectionModel; +import javax.swing.SwingUtilities; import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableCellEditor; import javax.swing.table.TableColumn; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeModel; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.GridLayout; +import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusAdapter; @@ -911,6 +929,11 @@ public class DBManipulationPane extends BasicBeanPane { return ComparatorUtils.equals(this.name, ((ColumnName)obj).name); } + + @Override + protected ColumnName clone() throws CloneNotSupportedException { + return new ColumnName(name); + } } public static class ColumnValue { @@ -931,6 +954,11 @@ public class DBManipulationPane extends BasicBeanPane { return ComparatorUtils.equals(this.obj, ((ColumnValue)obj).obj); } + + @Override + protected ColumnValue clone() throws CloneNotSupportedException { + return new ColumnValue(obj); + } } protected static class KeyColumnNameValueTable extends JTable { @@ -941,7 +969,14 @@ public class DBManipulationPane extends BasicBeanPane { public KeyColumnTableModel getTableModel4SmartAddCell() { - return new KeyColumnValueTableModel((KeyColumnTableModel)this.getModel()); + KeyColumnTableModel clonedTableModel = null; + try { + //智能添加的时候修改clone的配置,不修改原配置,点击确认后覆盖原配置 + clonedTableModel = ((KeyColumnValueTableModel) this.getModel()).clone(); + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return new KeyColumnValueTableModel(clonedTableModel); } } @@ -949,11 +984,11 @@ public class DBManipulationPane extends BasicBeanPane { protected abstract static class KeyColumnTableModel extends AbstractTableModel { public static final String RAW_KEY = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_RWA_Key"); public static final String COLUMN = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Column"); - public static final String VALUE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value"); + public static final String VALUE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value"); - public static final String[] COLUMN_NAMES = new String[]{RAW_KEY, COLUMN, VALUE}; + public static final String[] COLUMN_NAMES = new String[]{RAW_KEY, COLUMN, VALUE}; - protected java.util.List keyColumnNameValueList = new ArrayList(); + protected List keyColumnNameValueList = new ArrayList<>(); public KeyColumnTableModel(KeyColumnTableModel model) { if (model != null) { @@ -988,9 +1023,16 @@ public class DBManipulationPane extends BasicBeanPane { public void removeAllKeyColumnNameValue() { this.keyColumnNameValueList.clear(); } + + public void refreshNameValueList(KeyColumnTableModel model) { + if (model != null) { + this.keyColumnNameValueList.clear(); + this.keyColumnNameValueList.addAll(model.keyColumnNameValueList); + } + } } - protected static class KeyColumnValueTableModel extends KeyColumnTableModel { + protected static class KeyColumnValueTableModel extends KeyColumnTableModel implements Cloneable{ public KeyColumnValueTableModel(KeyColumnTableModel model) { super(model); @@ -1037,6 +1079,16 @@ public class DBManipulationPane extends BasicBeanPane { public boolean isCellEditable(int row, int col) { return true; } + + @Override + protected KeyColumnValueTableModel clone() throws CloneNotSupportedException { + KeyColumnValueTableModel cloned = (KeyColumnValueTableModel) super.clone(); + cloned.keyColumnNameValueList = new ArrayList<>(); + for (KeyColumnNameValue keyColumnNameValue : keyColumnNameValueList) { + cloned.keyColumnNameValueList.add(keyColumnNameValue.clone()); + } + return cloned; + } } @@ -1054,11 +1106,17 @@ public class DBManipulationPane extends BasicBeanPane { /** * 字符串 + * * @return 字符串z */ public String toString() { return (isKey ? "* " : "") + cn + ":" + cv; } + + @Override + protected KeyColumnNameValue clone() throws CloneNotSupportedException { + return new KeyColumnNameValue(isKey, cn.clone(), cv.clone(), false); + } } /* diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index dd675ffe3c..37d6a639f3 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -511,7 +511,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { private SmartJTablePaneAction a = new AbstractSmartJTablePaneAction(this, SmartInsertDBManipulationPane.this) { @Override public void doOk() { - // 遗留代码 + ((KeyColumnTableModel)keyColumnValuesTable.getModel()).refreshNameValueList((KeyColumnTableModel)model); } @Override From 90394c357d4933e24a8bf9145eba7d611796327a Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 18 Jun 2020 15:03:45 +0800 Subject: [PATCH 132/135] =?UTF-8?q?REPORT-33599=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E8=8F=9C=E5=8D=95=E6=A0=8F=E5=AF=BC=E5=87=BAtxt?= =?UTF-8?q?=EF=BC=8C=E5=BD=93=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA=E7=9A=84?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=97=B6=E6=A8=A1=E7=89=88=E4=BC=9A=E8=A2=AB?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E4=B8=BA=E5=BE=85=E4=BF=9D=E5=AD=98=E7=8A=B6?= =?UTF-8?q?=E6=80=81=20&&=20REPORT-33525=20=E5=88=A0=E9=99=A4=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E7=9A=84Js=E6=88=96=E8=80=85css=20=E6=9C=89=E6=AD=A7?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/frpane/EditingStringListPane.java | 6 +++++- .../fr/design/parameter/ParameterInputPane.java | 17 +++++++++++------ .../export/AbstractWorkBookExportAction.java | 10 ++++++++-- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java index 068e9cc9db..7168db0b5c 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java @@ -3,6 +3,7 @@ package com.fr.design.gui.frpane; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.JListUtils; @@ -150,7 +151,10 @@ public abstract class EditingStringListPane extends BasicBeanPane> public void actionPerformed(ActionEvent e) { Object selected = jlist.getSelectedValue(); if (selected != null) { - int re = FineJOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(EditingStringListPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sure_To_Delete") + selected.toString() + "?"); + int re = FineJOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(EditingStringListPane.this), + Toolkit.i18nText("Fine-Design_Basic_Sure_To_Delete") + selected.toString() + "?", + Toolkit.i18nText("Fine-Design_Basic_Confirm"), + JOptionPane.OK_CANCEL_OPTION); if (re == JOptionPane.OK_OPTION) { JListUtils.removeSelectedListItems(jlist); } 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 8e8819c67d..b16e6b2792 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 @@ -106,12 +106,8 @@ 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(); - } - }); + initTextListener(textF); + this.editorNameMap.put(textF, parameter.getName()); nameAddedList.add(parameter.getName()); } @@ -120,6 +116,15 @@ public class ParameterInputPane extends BasicPane { flowTableLayoutHelper.adjustLabelWidth(); } + protected void initTextListener(ValueEditorPane textF) { + textF.getCurrentEditor().addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(); + } + }); + } + private Editor[] makeEditorByValue(Object pv) { Editor[] editors = {null}; if (pv instanceof Integer) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/file/export/AbstractWorkBookExportAction.java b/designer-realize/src/main/java/com/fr/design/actions/file/export/AbstractWorkBookExportAction.java index 22a4118208..a96dbf6bb0 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/file/export/AbstractWorkBookExportAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/file/export/AbstractWorkBookExportAction.java @@ -5,6 +5,7 @@ package com.fr.design.actions.file.export; import com.fr.base.Parameter; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.editor.ValueEditorPane; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JWorkBook; import com.fr.design.parameter.ParameterInputPane; @@ -43,8 +44,13 @@ public abstract class AbstractWorkBookExportAction extends AbstractExportAction< Parameter[] parameters = tpl.getParameters(); // 检查Parameter if (parameters != null && parameters.length > 0) { - final ParameterInputPane pPane = new ParameterInputPane( - parameters); + final ParameterInputPane pPane = new ParameterInputPane(parameters) { + @Override + protected void initTextListener(ValueEditorPane textF) { + // 导出不做处理 + // do noting + } + }; pPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { From ce05afdf4c4b1ecb2e84b4e7c3f50c16b4361c46 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Thu, 18 Jun 2020 16:19:03 +0800 Subject: [PATCH 133/135] =?UTF-8?q?MOBILE-27698=20=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E6=8E=A7=E4=BB=B6=E7=B1=BB=E6=8F=92=E4=BB=B6=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=BE=B9=E6=A1=86=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/ui/MobileStyleDefinePane.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 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 e418bba0e3..6c03df00d5 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 @@ -67,19 +67,19 @@ public class MobileStyleDefinePane extends BasicBeanPane { this.customBeanPane.populateBean(ob); customCombo.setSelectedIndex(ob.isCommonCustom() ? 1 : 0); - if(ob.getBackground() != null) { - colorSelectBox.setSelectObject(((ColorBackground)ob.getBackground()).getColor()); + if(ob.getCommonBackground() != null) { + colorSelectBox.setSelectObject(((ColorBackground)ob.getCommonBackground()).getColor()); } - borderType.setSelectedLineStyle(ob.getBorderType()); - if (ob.getBorderColor() != null) { - borderColor.setSelectObject(ob.getBorderColor()); + borderType.setSelectedLineStyle(ob.getCommonBorderType()); + if (ob.getCommonBorderColor() != null) { + borderColor.setSelectObject(ob.getCommonBorderColor()); } - borderRadius.setValue(ob.getBorderRadius()); - if (ob.getIconColor() != null) { - iconColor.setSelectObject(ob.getIconColor()); + borderRadius.setValue(ob.getCommonBorderRadius()); + if (ob.getCommonIconColor() != null) { + iconColor.setSelectObject(ob.getCommonIconColor()); } - if (ob.getFont() != null) { - fontConfigPane.populateBean(ob.getFont()); + if (ob.getCommonFont() != null) { + fontConfigPane.populateBean(ob.getCommonFont()); } } @@ -89,12 +89,12 @@ public class MobileStyleDefinePane extends BasicBeanPane { this.widget.setMobileStyle(mobileStyle); this.customBeanPane.updateBean(); mobileStyle.setCommonCustom(customCombo.getSelectedIndex() == 1); - mobileStyle.setBackground(ColorBackground.getInstance(colorSelectBox.getSelectObject())); - mobileStyle.setBorderType(borderType.getSelectedLineStyle()); - mobileStyle.setBorderColor(borderColor.getSelectObject()); - mobileStyle.setBorderRadius(borderRadius.getValue()); - mobileStyle.setIconColor(iconColor.getSelectObject()); - mobileStyle.setFont(fontConfigPane.updateBean()); + mobileStyle.setCommonBackground(ColorBackground.getInstance(colorSelectBox.getSelectObject())); + mobileStyle.setCommonBorderType(borderType.getSelectedLineStyle()); + mobileStyle.setCommonBorderColor(borderColor.getSelectObject()); + mobileStyle.setCommonBorderRadius(borderRadius.getValue()); + mobileStyle.setCommonIconColor(iconColor.getSelectObject()); + mobileStyle.setCommonFont(fontConfigPane.updateBean()); return mobileStyle; } From 151a8bb5ca78c66a0894f76223ba64458b5a38ce Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 24 Jun 2020 15:34:13 +0800 Subject: [PATCH 134/135] =?UTF-8?q?REPORT-34222=20=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=BB=99=E5=AE=B9=E5=99=A8=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E5=BC=80=E4=B8=AA=E5=A4=8D=E5=88=B6=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3=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/fun/FormWidgetOptionProvider.java | 7 +++++ .../AbstractFormWidgetOptionProvider.java | 5 ++++ .../designer/beans/models/SelectionModel.java | 26 +++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java index bfc32f4e9e..9f033d6dc6 100644 --- a/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java @@ -16,4 +16,11 @@ public interface FormWidgetOptionProvider extends ParameterWidgetOptionProvider */ boolean isContainer(); + /** + * 如果是布局容器要实现粘贴到容器中的操作 + * @param t + * @param 泛型参数 表示选中的组件 一般为FormSelection + */ + void paste2Container(T t); + } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java index 43cab95143..537a49d018 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java @@ -25,4 +25,9 @@ public abstract class AbstractFormWidgetOptionProvider extends AbstractProvider public boolean isContainer() { return false; } + + @Override + public void paste2Container(T t) { + // do nothing + } } \ No newline at end of file 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 dd964e4ab5..9f5f36f660 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,6 +1,7 @@ package com.fr.design.designer.beans.models; import com.fr.common.inputevent.InputEventBaseOnOS; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.base.clipboard.ClipboardFilter; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.LayoutAdapter; @@ -19,11 +20,13 @@ 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.fun.FormWidgetOptionProvider; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormSelection; import com.fr.design.mainframe.FormSelectionUtils; import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.LayoutUtils; +import com.fr.general.ComparatorUtils; import com.fr.stable.ArrayUtils; import java.awt.LayoutManager; @@ -31,6 +34,7 @@ import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.MouseEvent; import java.util.ArrayList; +import java.util.Set; /** * 该model保存当前选择的组件和剪切版信息 @@ -43,6 +47,7 @@ public class SelectionModel { private FormDesigner designer; private FormSelection selection; private Rectangle hotspotBounds; + private FormWidgetOptionProvider provider; public SelectionModel(FormDesigner designer) { this.designer = designer; @@ -256,9 +261,30 @@ public class SelectionModel { //绝对布局 Rectangle rec = selection.getSelctionBounds(); FormSelectionUtils.paste2Container(designer, container, clipboard, rec.x + DELTA_X_Y, rec.y + DELTA_X_Y); + } else if (isExtraContainer(container)) { + provider.paste2Container(selection); } } + + /** + * 扩展的容器布局 + * @param container + * @return + */ + private boolean isExtraContainer(XLayoutContainer container) { + if (container != null) { + Set set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG); + for (FormWidgetOptionProvider provider : set) { + if (provider.isContainer() && ComparatorUtils.equals(provider.appearanceForWidget(), selection.getSelectedCreator().getParent().getClass())) { + this.provider = provider; + return true; + } + } + } + return false; + } + /** * 删除当前所有选择的组件 */ From 56c61a0c16bb17d1c6fd117014a5475614116b67 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 25 Jun 2020 14:32:57 +0800 Subject: [PATCH 135/135] =?UTF-8?q?CHART-14399=20=E5=9D=90=E6=A0=87?= =?UTF-8?q?=E8=BD=B4=E5=88=87=E6=8D=A2=E7=B1=BB=E5=9E=8B=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E7=BD=91=E6=A0=BC=E7=BA=BF=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=92=8C=E9=A2=9C=E8=89=B2=09=E5=90=8C=E6=AD=A5=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/axis/VanChartAxisScrollPaneWithTypeSelect.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java index 830bebf643..ef042e0f2a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java @@ -102,21 +102,21 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll if(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY)){ textAxisPane.updateBean(axis); } else { - axis = new VanChartAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType()); + axis = new VanChartAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor()); textAxisPane.updateBean(axis); } } else if(ComparatorUtils.equals(index, AxisType.AXIS_TIME.ordinal())){ if(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_TIME)){ timeAxisPane.updateBean(axis); } else { - axis = new VanChartTimeAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType()); + axis = new VanChartTimeAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor()); timeAxisPane.updateBean(axis); } } else if(ComparatorUtils.equals(index, AxisType.AXIS_VALUE.ordinal())){ if(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_VALUE)){ valueAxisPane.updateBean(axis); } else { - axis = new VanChartValueAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType()); + axis = new VanChartValueAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor()); valueAxisPane.updateBean(axis); } }