From af75c06a8ea90034a81f754b368851e5a5c67c25 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 19 May 2021 17:12:11 +0800 Subject: [PATCH 01/10] =?UTF-8?q?REPORT-52212=20=20=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E5=87=BA=E7=8E=B0=E7=99=BD=E8=89=B2=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=20=E6=BC=8F=E6=94=B9=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/start/module/DesignerWorkspaceActivator.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java index 0e02e93de..24d918951 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java @@ -2,7 +2,6 @@ package com.fr.start.module; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.PluginClassRefreshManager; -import com.fr.design.env.WorkspaceChangeLoadingDialog; import com.fr.design.file.HistoryTemplateListCache; import com.fr.event.Event; import com.fr.event.Listener; @@ -62,9 +61,8 @@ public class DesignerWorkspaceActivator extends Activator { @Override public void on(Event event, Workspace workspace) { - + HistoryTemplateListCache.getInstance().load(); PluginClassRefreshManager.getInstance().addPluginListener(); - WorkspaceChangeLoadingDialog.hideDialog(); } }); } From 53388c1024e6ce3334dc09ef2503bd7cb71fad03 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Wed, 19 May 2021 20:53:39 +0800 Subject: [PATCH 02/10] =?UTF-8?q?REPORT-51678=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=8D=E7=94=A8=E6=8F=92=E4=BB=B6=E4=BB=A3=E7=A0=81=E5=90=88?= =?UTF-8?q?=E5=B9=B6--=E8=A1=A5=E5=85=85SnapChat=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EastRegionContainerPane.java | 41 ++++- .../mainframe/reuse/ReuseGuideDialog.java | 167 ++++++++++++++++++ .../design/mainframe/reuse}/SnapChatKeys.java | 2 +- .../share/util/InstallComponentHelper.java | 2 +- 4 files changed, 201 insertions(+), 11 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java rename {designer-form/src/main/java/com/fr/design/mainframe/share/ui/menu => designer-base/src/main/java/com/fr/design/mainframe/reuse}/SnapChatKeys.java (91%) 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 346902a0d..541cb8e0f 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 @@ -13,8 +13,11 @@ 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.mainframe.reuse.ReuseGuideDialog; +import com.fr.design.mainframe.reuse.SnapChatKeys; import com.fr.design.menu.SnapChatUtil; import com.fr.design.notification.SnapChat; +import com.fr.design.notification.SnapChatFactory; import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; @@ -297,14 +300,20 @@ public class EastRegionContainerPane extends UIEastResizableContainer { "hyperlink", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); // 组件库 - PropertyItem widgetLib = new PropertyItem(KEY_WIDGET_LIB, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Library"), - "widgetlib", new PropertyMode[]{PropertyMode.FORM}, - new PropertyMode[]{PropertyMode.FORM}, new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - ComponentReuseNotifyUtil.enterWidgetLibExtraAction(); - } - }); + PropertyItem widgetLib = new PropertyItem( + KEY_WIDGET_LIB, + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Library"), + "widgetlib", + new PropertyMode[]{PropertyMode.FORM}, + new PropertyMode[]{PropertyMode.FORM}, + getWidgetLibSnapChat(), + getWidgetLibPromptWindow(), + new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + ComponentReuseNotifyUtil.enterWidgetLibExtraAction(); + } + }); // 权限编辑 PropertyItem authorityEdition = new PropertyItem(KEY_AUTHORITY_EDITION, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Permissions_Edition"), "authorityedit", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION_DISABLED}, @@ -519,6 +528,17 @@ public class EastRegionContainerPane extends UIEastResizableContainer { propertyItemMap.get(KEY_WIDGET_LIB).replaceContentPane(pane); } + public SnapChat getWidgetLibSnapChat() { + return SnapChatFactory.createSnapChat(false, SnapChatKeys.COMPONENT); + } + + public PromptWindow getWidgetLibPromptWindow() { + if (getWidgetLibSnapChat().hasRead()) { + return new ReuseGuideDialog(DesignerContext.getDesignerFrame()); + } + return null; + } + public JComponent getWidgetLibPane() { return propertyItemMap.get(KEY_WIDGET_LIB).getContentPane(); } @@ -726,11 +746,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer { this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes, null, null); } + public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes, SnapChat snapChat, PromptWindow promptWindow, ActionListener actionListener) { + this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes, snapChat, promptWindow, actionListener); + } + public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes, ActionListener actionListener) { this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes, null, null, actionListener); } - public PropertyItem(String name, String title, String btnIconName, String iconBaseDir, PropertyMode[] visibleModes, PropertyMode[] enableModes, SnapChat snapChat, PromptWindow promptWindow) { this(name, title, btnIconName, iconBaseDir, visibleModes, enableModes, snapChat, promptWindow, null); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java new file mode 100644 index 000000000..8157f9d16 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java @@ -0,0 +1,167 @@ +package com.fr.design.mainframe.reuse; + +import com.fr.base.background.ColorBackground; +import com.fr.design.dialog.UIDialog; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.PromptWindow; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.IOUtils; + +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.RenderingHints; +import java.awt.geom.RoundRectangle2D; + +public class ReuseGuideDialog extends UIDialog implements PromptWindow { + InnerDialog innerDialog; + private static final Dimension DEFAULT = new Dimension(735, 510); + + public ReuseGuideDialog(Frame parent) { + super(parent); + } + + @Override + public void showWindow() { + innerDialog = new InnerDialog(this); + JPanel backGroundPane = new JPanel() { + @Override + protected void paintComponent(Graphics g) { + Image icon = IOUtils.readImage("com/fr/plugin/form/images/background.png");// 003.jpg是测试图片在项目的根目录下 + g.drawImage(icon, 0, 0, getSize().width, getSize().height, this);// 图片会自动缩放 + } + }; + add(backGroundPane, BorderLayout.CENTER); + initStyle(); + innerDialog.showWindow(); + } + + private void initStyle() { + setSize(DEFAULT); + setUndecorated(true); + setBackground(new Color(0, 0, 0, 0)); + GUICoreUtils.centerWindow(this); + } + + @Override + public void hideWindow() { + this.setVisible(false); + if (innerDialog != null) { + innerDialog.setVisible(false); + innerDialog.dispose(); + innerDialog = null; + } + this.dispose(); + } + + @Override + public void checkValid() { + + } + + class InnerDialog extends UIDialog { + private final Dimension DEFAULT = new Dimension(700, 475); + private static final int TITLE_FONT_SIZE = 20; + + public InnerDialog(Dialog dialog) { + super(dialog); + } + + public void showWindow() { + add(createCenterPanel(), BorderLayout.CENTER); + add(createSouthPanel(), BorderLayout.SOUTH); + add(createNorthPanel(), BorderLayout.NORTH); + showDialog(); + } + + private JPanel createNorthPanel() { + JPanel northPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + + //右上角关闭按钮 + JButton button = new JButton(new ImageIcon(IOUtils.readImage("/com/fr/plugin/form/images/close.png").getScaledInstance(15, 15, Image.SCALE_SMOOTH))); + button.setBorder(null); + button.setOpaque(false); + button.addActionListener(e -> ReuseGuideDialog.this.hideWindow()); + + northPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 15)); + northPanel.setOpaque(false); + northPanel.add(button); + return northPanel; + } + + private JPanel createCenterPanel() { + JPanel centerPanel = new JPanel(new BorderLayout()); + + UILabel titleLabel = new UILabel(Toolkit.i18nText("Fine-Plugin_Component_Drag_And_Make_Component")); + UILabel imageLabel = new UILabel(new ImageIcon(IOUtils.readImage("com/fr/plugin/form/images/guide.png").getScaledInstance(DEFAULT.width, DEFAULT.height, Image.SCALE_SMOOTH))); + titleLabel.setFont(new Font(titleLabel.getFont().getName(), Font.BOLD, TITLE_FONT_SIZE)); + titleLabel.setBorder(BorderFactory.createEmptyBorder()); + + JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER)); + panel.setOpaque(false); + panel.add(titleLabel); + + centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); + centerPanel.setOpaque(false); + centerPanel.add(imageLabel, BorderLayout.CENTER); + centerPanel.add(panel, BorderLayout.NORTH); + return centerPanel; + } + + private JPanel createSouthPanel() { + JPanel southPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + + JButton button = new JButton(Toolkit.i18nText("Fine-Plugin_Component_Try_Drag")) { + @Override + public void paint(Graphics g) { + ColorBackground buttonBackground = ColorBackground.getInstance(Color.decode("#419BF9")); + Graphics2D g2d = (Graphics2D) g; + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + buttonBackground.paint(g2d, new RoundRectangle2D.Double(0, 0, getWidth(), getHeight(), 8, 8)); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); + super.paint(g); + } + }; + button.setBorder(null); + button.setForeground(Color.WHITE); + button.setOpaque(false); + button.addActionListener(e -> ReuseGuideDialog.this.hideWindow()); + + southPanel.setBorder(BorderFactory.createEmptyBorder(0, 290, 19, 290)); + southPanel.setPreferredSize(new Dimension(DEFAULT.width, 51)); + southPanel.setOpaque(false); + southPanel.add(button); + return southPanel; + } + + /** + * 显示窗口 + */ + private void showDialog() { + setSize(DEFAULT); + setUndecorated(true); + GUICoreUtils.centerWindow(this); + setModalityType(ModalityType.APPLICATION_MODAL); + ReuseGuideDialog.this.setVisible(true); + setVisible(true); + } + + @Override + public void checkValid() { + + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/menu/SnapChatKeys.java b/designer-base/src/main/java/com/fr/design/mainframe/reuse/SnapChatKeys.java similarity index 91% rename from designer-form/src/main/java/com/fr/design/mainframe/share/ui/menu/SnapChatKeys.java rename to designer-base/src/main/java/com/fr/design/mainframe/reuse/SnapChatKeys.java index cf563d2e8..8f07f503b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/menu/SnapChatKeys.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/reuse/SnapChatKeys.java @@ -1,4 +1,4 @@ -package com.fr.design.mainframe.share.ui.menu; +package com.fr.design.mainframe.reuse; import com.fr.design.notification.SnapChatKey; diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java index 8e4de49f3..ecf8be2b0 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.share.util; -import com.fr.design.mainframe.share.ui.menu.SnapChatKeys; +import com.fr.design.mainframe.reuse.SnapChatKeys; import com.fr.design.notification.SnapChat; import com.fr.design.notification.SnapChatFactory; import com.fr.form.share.constants.ComponentPath; From 51a80eab8dcd672f48629466bdad7184e35ecf99 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 20 May 2021 10:43:32 +0800 Subject: [PATCH 03/10] =?UTF-8?q?REPORT-51244=20=E3=80=9010.0.17=E3=80=91?= =?UTF-8?q?=E5=A4=8D=E7=94=A8=E7=BB=84=E4=BB=B6=E6=8E=A5=E8=A7=A6=E7=82=B9?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20-=20=E5=8A=9F=E8=83=BD=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/ComponentReuseNotifyUtil.java | 9 ++- .../mainframe/EastRegionContainerPane.java | 3 - .../reuse/ComponentReuseNotificationInfo.java | 20 +++++- .../treeview/ComponentTreeCellRenderer.java | 2 +- .../design/mainframe/FormParaWidgetPane.java | 6 +- .../mainframe/FormWidgetDetailPane.java | 12 +++- .../mainframe/ReuseTriggerPointManager.java | 7 +- .../share/collect/ComponentCollector.java | 70 ++++++++++++++++++- .../share/ui/block/LocalWidgetBlock.java | 2 + .../share/ui/block/OnlineWidgetBlock.java | 1 + .../share/util/InstallComponentHelper.java | 12 ++-- 11 files changed, 123 insertions(+), 21 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/ComponentReuseNotifyUtil.java b/designer-base/src/main/java/com/fr/design/mainframe/ComponentReuseNotifyUtil.java index 8541ffa66..abad05eb1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/ComponentReuseNotifyUtil.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/ComponentReuseNotifyUtil.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe; +import com.fr.design.DesignerEnvManager; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; import com.fr.design.mainframe.toast.DesignerToastMsgUtil; @@ -17,11 +18,6 @@ public class ComponentReuseNotifyUtil { } - public static void enterWidgetLib() { - EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB); - enterWidgetLibExtraAction(); - } - public static void enterWidgetLibExtraAction() { if (ComponentReuseNotificationInfo.getInstance().isClickedWidgetLib()) { return; @@ -35,5 +31,8 @@ public class ComponentReuseNotifyUtil { if (snapChat.hasRead()) { DesignerToastMsgUtil.toastPrompt(Toolkit.i18nText("Fine-Design_Component_Reuse_Merge_Prompt")); } + ComponentReuseNotificationInfo.getInstance().setClickedWidgetLib(true); + DesignerEnvManager.getEnvManager().saveXMLFile(); } + } 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 346902a0d..8b9b1cf3a 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 @@ -942,9 +942,6 @@ public class EastRegionContainerPane extends UIEastResizableContainer { @Override public void paintComponent(Graphics g) { super.paintComponent(g); - if (snapChat != null && !snapChat.hasRead()) { - SnapChatUtil.paintPropertyItemPoint(g, getBounds()); - } } }; button.setDisabledIcon(IconUtils.readIcon(getIconBaseDir() + btnIconName + ICON_SUFFIX_DISABLED)); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/reuse/ComponentReuseNotificationInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/reuse/ComponentReuseNotificationInfo.java index d819c1876..0ec6f26ad 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/reuse/ComponentReuseNotificationInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/reuse/ComponentReuseNotificationInfo.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.reuse; +import com.fr.design.DesignerEnvManager; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLable; import com.fr.stable.xml.XMLableReader; @@ -22,6 +23,8 @@ public class ComponentReuseNotificationInfo implements XMLable { private boolean clickedWidgetLib = false; + private long lastGuidePopUpTime = 0; + public long getLastNotifyTime() { return lastNotifyTime; } @@ -46,11 +49,25 @@ public class ComponentReuseNotificationInfo implements XMLable { this.clickedWidgetLib = clickedWidgetLib; } + public long getLastGuidePopUpTime() { + return lastGuidePopUpTime; + } + + public void setLastGuidePopUpTime(long lastGuidePopUpTime) { + this.lastGuidePopUpTime = lastGuidePopUpTime; + } + + public void updateLastGuidePopUpTime() { + this.setLastGuidePopUpTime(System.currentTimeMillis()); + DesignerEnvManager.getEnvManager().saveXMLFile(); + } + @Override public void readXML(XMLableReader reader) { this.setLastNotifyTime(reader.getAttrAsLong("lastNotifyTime", 0L)); this.setNotifiedNumber(reader.getAttrAsInt("notifiedNumber", 0)); this.setClickedWidgetLib(reader.getAttrAsBoolean("clickedWidgetLib", false)); + this.setLastGuidePopUpTime(reader.getAttrAsLong("lastGuidePopUpTime", 0L)); } @Override @@ -58,7 +75,8 @@ public class ComponentReuseNotificationInfo implements XMLable { writer.startTAG("ComponentReuseNotificationInfo"); writer.attr("lastNotifyTime", this.lastNotifyTime) .attr("notifiedNumber", this.notifiedNumber) - .attr("clickedWidgetLib", this.clickedWidgetLib); + .attr("clickedWidgetLib", this.clickedWidgetLib) + .attr("lastGuidePopUpTime", this.lastGuidePopUpTime); writer.end(); } diff --git a/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java b/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java index e4bfcfaf1..f310adc42 100644 --- a/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java +++ b/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java @@ -18,7 +18,7 @@ import java.awt.Graphics; public class ComponentTreeCellRenderer extends DefaultTreeCellRenderer { private boolean needAddShareIcon = false; - private static final Icon SHARE_ICON = BaseUtils.readIcon("/com/fr/design/images/toast/icon_reuse.png"); + private static final Icon SHARE_ICON = BaseUtils.readIcon("/com/fr/design/images/toast/reuse_icon.png"); public ComponentTreeCellRenderer() { } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java index b5722e9da..81b4e7b61 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java @@ -16,6 +16,7 @@ import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.module.DesignModuleFactory; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.UserDefinedWidgetConfig; @@ -32,6 +33,7 @@ import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.ArrayUtils; +import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JSeparator; @@ -244,10 +246,12 @@ public class FormParaWidgetPane extends JPanel { private JPanel createComponentReuseToolPane() { JPanel jPanel = new JPanel(new BorderLayout(17, 10)); UILabel uiLabel = new UILabel(BaseUtils.readIcon("/com/fr/design/images/form/designer/widget_apply_icon.png")); + uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 0 ,5, 0)); jPanel.addMouseListener(new MouseListener() { @Override public void mouseClicked(MouseEvent e) { - ComponentReuseNotifyUtil.enterWidgetLib(); + FormWidgetDetailPane.getInstance().enterWidgetLib(); + ComponentCollector.getInstance().collectToolbarJump(); } @Override 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 fdad24577..dd0cce25b 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 @@ -23,7 +23,10 @@ import java.util.List; * Time: 下午8:18 */ public class FormWidgetDetailPane extends FormDockView{ + private static final int ONLINE_TAB = 1; + private JPanel centerPane; + private UIHeadGroup headGroup; private List paneList; public static FormWidgetDetailPane getInstance() { @@ -78,7 +81,7 @@ public class FormWidgetDetailPane extends FormDockView{ paneNames[i] = title; centerPane.add(paneList.get(i), title); } - UIHeadGroup headGroup = new UIHeadGroup(paneNames) { + headGroup = new UIHeadGroup(paneNames) { protected void tabChanged(int newSelectedIndex) { if (newSelectedIndex == 1) { ComponentCollector.getInstance().collectMarkerClick(); @@ -91,6 +94,7 @@ public class FormWidgetDetailPane extends FormDockView{ this.add(centerPane, BorderLayout.CENTER); } + /** * 清除数据 */ @@ -101,6 +105,12 @@ public class FormWidgetDetailPane extends FormDockView{ } + public void enterWidgetLib() { + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB); + headGroup.setSelectedIndex(ONLINE_TAB); + ComponentReuseNotifyUtil.enterWidgetLibExtraAction(); + } + /** * 定位 * diff --git a/designer-form/src/main/java/com/fr/design/mainframe/ReuseTriggerPointManager.java b/designer-form/src/main/java/com/fr/design/mainframe/ReuseTriggerPointManager.java index c4bdc8bf7..beb779be8 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/ReuseTriggerPointManager.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/ReuseTriggerPointManager.java @@ -14,6 +14,7 @@ import com.fr.design.mainframe.adaptve.config.impl.CellStyleTriggerPoint; import com.fr.design.mainframe.adaptve.config.impl.CellValueImageChangeTriggerPoint; import com.fr.design.mainframe.adaptve.config.ReuseNotifyInfo; import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; +import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.toast.DesignerToastMsgUtil; import com.fr.event.Event; import com.fr.event.EventDispatcher; @@ -81,7 +82,7 @@ public class ReuseTriggerPointManager { } - private boolean hasNotifiedTwice() { + public boolean hasNotifiedTwice() { return ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() >= 2; } @@ -147,6 +148,7 @@ public class ReuseTriggerPointManager { JTemplate currentJTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); DesignerToastMsgUtil.toastPrompt(createReusePrompt((JForm) currentJTemplate)); ReuseTriggerPointManager.getInstance().writeTriggerInfo2xml(); + ComponentCollector.getInstance().collectPromptJumpWhenShow(); } } @@ -180,7 +182,8 @@ public class ReuseTriggerPointManager { @Override public void mouseClicked(MouseEvent e) { jForm.tabChanged(0); - ComponentReuseNotifyUtil.enterWidgetLib(); + FormWidgetDetailPane.getInstance().enterWidgetLib(); + ComponentCollector.getInstance().collectPromptJumpWhenJump(); } @Override diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java b/designer-form/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java index a2c4ba5d9..1fa2b993e 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.share.collect; import com.fr.base.io.XMLReadHelper; import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; import com.fr.form.share.DefaultSharableWidget; import com.fr.form.share.SharableWidgetProvider; import com.fr.form.share.constants.ComponentPath; @@ -44,6 +45,12 @@ import java.util.Iterator; * created by Harrison on 2020/03/25 **/ public class ComponentCollector implements XMLable { + private static final long ONE_MINUTE = 60 * 1000L; + + private static final int REUSE_INFO_FIRST_POPUP = 1; + + private static final int REUSE_INFO_SECOND_POPUP = 2; + private static final String SIMPLE_DATE_PATTERN = "yyyy-MM-dd"; private static final String XML = "ComponentCollector"; @@ -90,8 +97,13 @@ public class ComponentCollector implements XMLable { private static final String MARKET_CLICK = "marketClick"; + private static final String PROMPT_JUMP = "promptJump"; + + private static final String TOOLBAR_JUMP = "toolbarJump"; + + private static final String POPUP_JUMP = "popupJump"; + private static final String uuid = DesignerEnvManager.getEnvManager().getUUID(); - private static ComponentCollector instance; private int localCmpNumber = 0; @@ -103,6 +115,12 @@ public class ComponentCollector implements XMLable { private int cmpBoardClick = 0; + private int promptJump = 0; + + private int toolbarJump = 0; + + private int popupJump = 0; + private JSONArray activateRecord = JSONFactory.createJSON(JSON.ARRAY); private JSONArray generateCmpRecord = JSONFactory.createJSON(JSON.ARRAY); @@ -314,6 +332,41 @@ public class ComponentCollector implements XMLable { saveInfo(); } + public void collectPromptJumpWhenJump(){ + if (ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() == REUSE_INFO_FIRST_POPUP) { + this.promptJump = 1; + saveInfo(); + }else if(ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() == REUSE_INFO_SECOND_POPUP){ + this.promptJump = 2; + saveInfo(); + } + } + + + public void collectPromptJumpWhenShow() { + if (ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() == REUSE_INFO_SECOND_POPUP) { + this.promptJump = -1; + saveInfo(); + } + } + + public void collectToolbarJump() { + if (this.toolbarJump == 0) { + this.toolbarJump = 1; + saveInfo(); + } + + } + + public void collectPopupJump() { + long currentTime = System.currentTimeMillis(); + long lastGuidePopUpTime = ComponentReuseNotificationInfo.getInstance().getLastGuidePopUpTime(); + if (currentTime - lastGuidePopUpTime <= ONE_MINUTE && this.popupJump == 0) { + this.popupJump = 1; + saveInfo(); + } + } + public void clearSortType() { sortType = JSONFactory.createJSON(JSON.ARRAY); } @@ -419,6 +472,9 @@ public class ComponentCollector implements XMLable { this.searchContent = parseJSONArray(reader.getAttrAsString(SEARCH_CONTENT,StringUtils.EMPTY)); this.filterContent = parseJSONArray(reader.getAttrAsString(FILTER_CONTENT, StringUtils.EMPTY)); this.sortType = parseJSONArray(reader.getAttrAsString(SORT_TYPE, StringUtils.EMPTY)); + this.promptJump = reader.getAttrAsInt(PROMPT_JUMP, 0); + this.toolbarJump = reader.getAttrAsInt(TOOLBAR_JUMP, 0); + this.popupJump = reader.getAttrAsInt(POPUP_JUMP, 0); } } @@ -453,6 +509,9 @@ public class ComponentCollector implements XMLable { .attr(SEARCH_CONTENT, searchContent.toString()) .attr(FILTER_CONTENT, filterContent.toString()) .attr(SORT_TYPE, sortType.toString()) + .attr(PROMPT_JUMP, promptJump) + .attr(TOOLBAR_JUMP, toolbarJump) + .attr(POPUP_JUMP, popupJump) .end(); } @@ -477,6 +536,15 @@ public class ComponentCollector implements XMLable { jo.put(SEARCH_CONTENT, searchContent.toString()); jo.put(FILTER_CONTENT, filterContent.toString()); jo.put(SORT_TYPE, sortType.toString()); + jo.put("guideInfo", assembleGuideInfo()); + return jo.toString(); + } + + private String assembleGuideInfo() { + JSONObject jo = JSONFactory.createJSON(JSON.OBJECT); + jo.put(PROMPT_JUMP, promptJump) + .put(TOOLBAR_JUMP, toolbarJump) + .put(POPUP_JUMP, popupJump); return jo.toString(); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java index 862616fa4..911ff7b77 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java @@ -13,6 +13,7 @@ import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.WidgetToolBarPane; +import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.group.ui.GroupMoveDialog; import com.fr.design.mainframe.share.ui.base.PopupMenuItem; import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; @@ -192,6 +193,7 @@ public class LocalWidgetBlock extends PreviewWidgetBlock return; } hidePreview(); + ComponentCollector.getInstance().collectPopupJump(); Object source = e.getSource(); Widget creatorSource; String shareId; diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java index 15ebebd6d..4b5c9c0cb 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java @@ -123,6 +123,7 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock { if (lastPressEvent == null) { return; } + ComponentCollector.getInstance().collectPopupJump(); Object source = e.getSource(); Widget creatorSource; String shareId; diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java index 8e4de49f3..3f41afe36 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java @@ -22,12 +22,12 @@ public class InstallComponentHelper { private static final String PRE_INSTALL_PATH = "/com/fr/form/share/components"; private static final String[] PRE_INSTALL_COMPONENTS = new String[]{ - "大屏标题-蓝白.739e7afd-ce1d-40ea-b272-3c96eacc27f8.reu", - "单数据指标卡-绿色.48ea0497-1c7f-4894-a927-0f18fe4d2f27.reu", - "单数据指标卡-蓝色.d158c9d6-66be-410a-8697-47b19a8f9565.reu", - "分类对比竖向仪表板-浅色.a90a7b81-26fd-4461-8a39-ce1c07a16ad0.reu", - "分层雷达图-浅色.d2cd7a40-c14c-4a79-a30e-25d2ba555479.reu", - "进度表格-浅色.8aafad8b-d85c-4921-b45d-1acb4c226ca2.reu" + "单行指标卡.f3df58b3-4302-4cab-ab77-caaf225de60a.reu", + "分层雷达图-深色.49f8397c-e6a6-482a-acc7-46d8cec353a4.reu", + "红绿灯表格-浅色.d0466992-328a-4ccf-ad67-6cbc844d669c.reu", + "进度表格-深色.de4141ce-5c25-4506-9424-f5aa15fbf6d0.reu", + "三列指标卡.61a83d18-a162-4dc3-aa57-3b954edaf82e.reu", + "透明按钮切换图表.e373e13a-3da0-4c29-91bc-9ae804241023.reu" }; public static void installPreComponent() { From 722d32f6db066aa04ce4825ecb78cc151f3b388b Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Thu, 20 May 2021 13:35:17 +0800 Subject: [PATCH 04/10] =?UTF-8?q?REPORT-51678=20promptWindow=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=8F=8D=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/EastRegionContainerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 541cb8e0f..cb290e49e 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 @@ -533,7 +533,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } public PromptWindow getWidgetLibPromptWindow() { - if (getWidgetLibSnapChat().hasRead()) { + if (!getWidgetLibSnapChat().hasRead()) { return new ReuseGuideDialog(DesignerContext.getDesignerFrame()); } return null; From 72b00b8298a4e353111fd211090e41f79bfdb7b9 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Thu, 20 May 2021 15:03:53 +0800 Subject: [PATCH 05/10] =?UTF-8?q?REPORT-52490=20=E7=A4=BE=E5=8C=BA?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=B7=BB=E5=8A=A0=E6=A8=A1=E6=9D=BF=E5=95=86?= =?UTF-8?q?=E5=9F=8E=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/community/TemplateStoreAction.java | 9 ++++----- .../design/mainframe/share/collect/CollectorManager.java | 0 .../mainframe/share/collect/ComponentCollector.java | 0 .../design/mainframe/share/collect/ComponentSender.java | 0 .../com/fr/design/mainframe/toolbar/ToolBarMenuDock.java | 1 + 5 files changed, 5 insertions(+), 5 deletions(-) rename designer-form/src/main/java/com/fr/design/mainframe/share/ui/menu/TemplateStoreMenu.java => designer-base/src/main/java/com/fr/design/actions/community/TemplateStoreAction.java (83%) rename {designer-form => designer-base}/src/main/java/com/fr/design/mainframe/share/collect/CollectorManager.java (100%) rename {designer-form => designer-base}/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java (100%) rename {designer-form => designer-base}/src/main/java/com/fr/design/mainframe/share/collect/ComponentSender.java (100%) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/menu/TemplateStoreMenu.java b/designer-base/src/main/java/com/fr/design/actions/community/TemplateStoreAction.java similarity index 83% rename from designer-form/src/main/java/com/fr/design/mainframe/share/ui/menu/TemplateStoreMenu.java rename to designer-base/src/main/java/com/fr/design/actions/community/TemplateStoreAction.java index 7346cb1f5..6a01b3f1c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/menu/TemplateStoreMenu.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/TemplateStoreAction.java @@ -1,8 +1,7 @@ -package com.fr.design.mainframe.share.ui.menu; +package com.fr.design.actions.community; import com.fr.base.BaseUtils; import com.fr.design.actions.UpdateAction; -import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.menu.MenuKeySet; import com.fr.design.utils.BrowseUtils; @@ -14,9 +13,9 @@ import java.awt.event.ActionEvent; /** * created by Harrison on 2020/03/24 **/ -public class TemplateStoreMenu extends UpdateAction { +public class TemplateStoreAction extends UpdateAction { - public TemplateStoreMenu() { + public TemplateStoreAction() { this.setMenuKeySet(TEMPLATE); this.setName(getMenuKeySet().getMenuName()); @@ -29,7 +28,7 @@ public class TemplateStoreMenu extends UpdateAction { @Override public String getMenuName() { - return Toolkit.i18nText("Fine-Design_Share_Template_Store"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_Template_Store"); } @Override diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/collect/CollectorManager.java b/designer-base/src/main/java/com/fr/design/mainframe/share/collect/CollectorManager.java similarity index 100% rename from designer-form/src/main/java/com/fr/design/mainframe/share/collect/CollectorManager.java rename to designer-base/src/main/java/com/fr/design/mainframe/share/collect/CollectorManager.java diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java similarity index 100% rename from designer-form/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java rename to designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/collect/ComponentSender.java b/designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentSender.java similarity index 100% rename from designer-form/src/main/java/com/fr/design/mainframe/share/collect/ComponentSender.java rename to designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentSender.java 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 3dbdac094..d6cdbd8e3 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 @@ -591,6 +591,7 @@ public abstract class ToolBarMenuDock { shortCuts.add(new TechSolutionAction()); shortCuts.add(SeparatorDef.DEFAULT); + shortCuts.add(new TemplateStoreAction()); LocaleCenter.buildAction(new LocaleAction() { @Override From 03fe02e702eae08fc8ea00ee917bcb817ab6409e Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Thu, 20 May 2021 15:04:38 +0800 Subject: [PATCH 06/10] =?UTF-8?q?REPORT-52364=20SnapChat=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E8=B7=AF=E5=BE=84=E4=BF=AE=E6=94=B9=E4=B8=8E?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/EastRegionContainerPane.java | 4 +++- .../fr/design/mainframe/reuse/ReuseGuideDialog.java | 10 +++++----- 2 files changed, 8 insertions(+), 6 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 cb290e49e..5053efbe0 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 @@ -100,6 +100,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private JPanel defaultPane; // "无可用配置项"面板 private JPanel defaultAuthorityPane; // "该元素不支持权限编辑" private PropertyItem selectedItem; // 当前被选中的属性配置项 + private SnapChat widgetLibSnapChat; public enum PropertyMode { REPORT, // 报表 @@ -300,6 +301,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { "hyperlink", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); // 组件库 + widgetLibSnapChat = SnapChatFactory.createSnapChat(false, SnapChatKeys.COMPONENT); PropertyItem widgetLib = new PropertyItem( KEY_WIDGET_LIB, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Library"), @@ -529,7 +531,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } public SnapChat getWidgetLibSnapChat() { - return SnapChatFactory.createSnapChat(false, SnapChatKeys.COMPONENT); + return widgetLibSnapChat; } public PromptWindow getWidgetLibPromptWindow() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java index 8157f9d16..98e149e0c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java @@ -40,7 +40,7 @@ public class ReuseGuideDialog extends UIDialog implements PromptWindow { JPanel backGroundPane = new JPanel() { @Override protected void paintComponent(Graphics g) { - Image icon = IOUtils.readImage("com/fr/plugin/form/images/background.png");// 003.jpg是测试图片在项目的根目录下 + Image icon = IOUtils.readImage("com/fr/base/images/share/background.png");// 003.jpg是测试图片在项目的根目录下 g.drawImage(icon, 0, 0, getSize().width, getSize().height, this);// 图片会自动缩放 } }; @@ -91,7 +91,7 @@ public class ReuseGuideDialog extends UIDialog implements PromptWindow { JPanel northPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); //右上角关闭按钮 - JButton button = new JButton(new ImageIcon(IOUtils.readImage("/com/fr/plugin/form/images/close.png").getScaledInstance(15, 15, Image.SCALE_SMOOTH))); + JButton button = new JButton(new ImageIcon(IOUtils.readImage("/com/fr/base/images/share/close.png").getScaledInstance(15, 15, Image.SCALE_SMOOTH))); button.setBorder(null); button.setOpaque(false); button.addActionListener(e -> ReuseGuideDialog.this.hideWindow()); @@ -105,8 +105,8 @@ public class ReuseGuideDialog extends UIDialog implements PromptWindow { private JPanel createCenterPanel() { JPanel centerPanel = new JPanel(new BorderLayout()); - UILabel titleLabel = new UILabel(Toolkit.i18nText("Fine-Plugin_Component_Drag_And_Make_Component")); - UILabel imageLabel = new UILabel(new ImageIcon(IOUtils.readImage("com/fr/plugin/form/images/guide.png").getScaledInstance(DEFAULT.width, DEFAULT.height, Image.SCALE_SMOOTH))); + UILabel titleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Share_Drag_And_Make_Component")); + UILabel imageLabel = new UILabel(new ImageIcon(IOUtils.readImage("com/fr/base/images/share/guide.png").getScaledInstance(DEFAULT.width, DEFAULT.height, Image.SCALE_SMOOTH))); titleLabel.setFont(new Font(titleLabel.getFont().getName(), Font.BOLD, TITLE_FONT_SIZE)); titleLabel.setBorder(BorderFactory.createEmptyBorder()); @@ -124,7 +124,7 @@ public class ReuseGuideDialog extends UIDialog implements PromptWindow { private JPanel createSouthPanel() { JPanel southPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - JButton button = new JButton(Toolkit.i18nText("Fine-Plugin_Component_Try_Drag")) { + JButton button = new JButton(Toolkit.i18nText("Fine-Design_Share_Try_Drag")) { @Override public void paint(Graphics g) { ColorBackground buttonBackground = ColorBackground.getInstance(Color.decode("#419BF9")); From 4f70159da57d5a2e3731f8fa9040a5872f677b36 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Thu, 20 May 2021 15:13:14 +0800 Subject: [PATCH 07/10] =?UTF-8?q?REPORT-51678=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=8F=92=E4=BB=B6=E4=BF=AE=E5=A4=8D=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/share/ui/local/ToolbarPane.java | 2 +- .../share/ui/online/AbstractOnlineWidgetShowPane.java | 2 +- .../share/ui/online/OnlineWidgetShowPane.java | 2 +- .../mainframe/share/ui/widgetfilter/FilterPane.java | 10 ++++++---- .../com/fr/design/share/ui/config/ShareConfigPane.java | 2 +- .../com/fr/design/share/ui/generate/EffectContent.java | 5 +++-- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ToolbarPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ToolbarPane.java index 4a32b149e..c720e7f9c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ToolbarPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ToolbarPane.java @@ -119,7 +119,7 @@ class ToolbarPane extends JPanel { private FilterPane createFilterPane() { filterPanel = FilterPane.createLocalFilterPane(); filterPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); - filterPanel.registerChangeListerner(e -> LocalWidgetRepoPane.getInstance().refreshShowPanel()); + filterPanel.registerChangeListener(e -> LocalWidgetRepoPane.getInstance().refreshShowPanel()); return filterPanel; } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetShowPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetShowPane.java index 5a5d43234..fc2390d61 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetShowPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetShowPane.java @@ -138,7 +138,7 @@ public abstract class AbstractOnlineWidgetShowPane extends JPanel { } public void initFilterPaneListener(FilterPane filterPane) { - filterPane.registerChangeListerner(new ChangeListener() { + filterPane.registerChangeListener(new ChangeListener() { @Override public void stateChanged(final ChangeEvent e) { String filterStr = e.getSource().toString(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetShowPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetShowPane.java index 691defde7..2325fb130 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetShowPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetShowPane.java @@ -90,7 +90,7 @@ public class OnlineWidgetShowPane extends AbstractOnlineWidgetShowPane { @Override public void initFilterPaneListener(FilterPane filterPane) { super.initFilterPaneListener(filterPane); - filterPane.registerChangeListerner(new ChangeListener() { + filterPane.registerChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { lastFilter = e.getSource().toString(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPane.java index ce976e217..4e8f9ffc5 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPane.java @@ -46,7 +46,7 @@ public class FilterPane extends JPanel { private Popup popup; private boolean showPopup = false; private FilterPopupPane filterPopupPane; - private ChangeListener changeListener; + private List changeListenerList = new ArrayList<>(); private final AWTEventListener awtEventListener; List listenerList = new ArrayList<>(); @@ -191,12 +191,14 @@ public class FilterPane extends JPanel { && !ComparatorUtils.equals(mv.getSource(), filterLabel); } - public void registerChangeListerner(ChangeListener changeListener) { - this.changeListener = changeListener; + public void registerChangeListener(ChangeListener changeListener) { + changeListenerList.add(changeListener); } public void fireChangeListener(ChangeEvent e) { - this.changeListener.stateChanged(e); + for (ChangeListener changeListener : changeListenerList) { + changeListener.stateChanged(e); + } } public void reset() { diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/config/ShareConfigPane.java b/designer-realize/src/main/java/com/fr/design/share/ui/config/ShareConfigPane.java index 9b55dc122..fa5606fe8 100644 --- a/designer-realize/src/main/java/com/fr/design/share/ui/config/ShareConfigPane.java +++ b/designer-realize/src/main/java/com/fr/design/share/ui/config/ShareConfigPane.java @@ -155,7 +155,7 @@ public class ShareConfigPane extends BasicPane { private JPanel createInfoPane() { JPanel infoPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Share_Introduce")); PlaceholderTextArea textArea = new PlaceholderTextArea(); - textArea.setText(this.widget.getDescription()); + textArea.setText(getDescription()); textArea.setPlaceholder(Toolkit.i18nText("Fine-Design_Share_No_Introduction")); textArea.setEditable(false); UIScrollPane scrollPane = new UIScrollPane(textArea); diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectContent.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectContent.java index 63098ffd5..4fef5f51a 100644 --- a/designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectContent.java +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectContent.java @@ -17,6 +17,7 @@ import com.fr.locale.InterProviderFactory; import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JPanel; +import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JTree; import javax.swing.event.TreeSelectionListener; @@ -144,8 +145,8 @@ public class EffectContent extends JPanel { } private void setPaneDisabled(Component component) { - if (component instanceof UIScrollPane) { - UIScrollPane pane = (UIScrollPane) component; + if (component instanceof JScrollPane) { + JScrollPane pane = (JScrollPane) component; setPaneDisabled(pane.getViewport().getView()); return; } From 582920d2358bd85969950027361a00be55ba5a77 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 20 May 2021 16:04:58 +0800 Subject: [PATCH 08/10] =?UTF-8?q?REPORT-52564=20=E6=8F=92=E4=BB=B6-?= =?UTF-8?q?=E6=96=B0=E8=87=AA=E9=80=82=E5=BA=94-=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=92=8C=E6=96=B0=E4=B8=BBjar=E6=9C=89=E4=B8=8D=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E9=97=AE=E9=A2=98=EF=BC=8C=E6=9C=89=E7=9A=84=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=88=87=E6=8D=A2=E6=96=B0=E8=80=81=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=B8=8D=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/app/FormApp.java | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java index 02692c991..6a896329a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java @@ -44,30 +44,8 @@ class FormApp extends AbstractAppProvider { HashMap classType = new HashMap(); classType.put(Constants.ARG_0, Form.class); classType.put(Constants.ARG_1, FILE.class); - classType.put(Constants.ARG_2, Parameter[].class); - JForm emptyForm = new JForm(new Form(new WBorderLayout("form")), tplFile); - OpenWorker> worker = new OpenWorker<>( - new Callable>() { - @Override - public OpenResult call() throws Exception { - Form form = asIOFile(tplFile); - return new OpenResult<>(form, form.getParameters()); - } - }, emptyForm); - worker.addCallBack(new Callable>() { - @Override - public JTemplate call() throws Exception { - OpenResult result = worker.getResult(); - return compatibleForm(result.getBaseBook(), result.getRef(), tplFile, classType); - } - }); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Report_Template_Opening_And_Waiting", tplFile.getName()) + "..."); - worker.start(tplFile.getPath()); - OpenResult result = worker.getResult(); - if (result != null) { - return compatibleForm(result.getBaseBook(), new Parameter[0], tplFile, classType); - } - return emptyForm; + return compatibleForm(tplFile, classType); } /** @@ -75,13 +53,36 @@ class FormApp extends AbstractAppProvider { * * @return */ - private JTemplate compatibleForm(Form form, Parameter[] parameters, FILE tplFile, HashMap classType) { - if (ComparatorUtils.equals(StableFactory.getRegisteredClass(BaseJForm.XML_TAG).getName(), JForm.class)) { - return (JTemplate) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, - new Object[]{form, tplFile, parameters}, classType, BaseJForm.class); + private JTemplate compatibleForm(FILE tplFile, HashMap classType) { + if (ComparatorUtils.equals(StableFactory.getRegisteredClass(BaseJForm.XML_TAG), JForm.class)) { + classType.put(Constants.ARG_2, Parameter[].class); + JForm emptyForm = new JForm(new Form(new WBorderLayout("form")), tplFile); + OpenWorker> worker = new OpenWorker<>( + new Callable>() { + @Override + public OpenResult call() throws Exception { + Form form = asIOFile(tplFile); + return new OpenResult<>(form, form.getParameters()); + } + }, emptyForm); + worker.addCallBack(new Callable>() { + @Override + public JTemplate call() throws Exception { + OpenResult result = worker.getResult(); + return (JTemplate) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, + new Object[]{result.getBaseBook(), tplFile, result.getRef()}, classType, BaseJForm.class); + } + }); + worker.start(tplFile.getPath()); + OpenResult result = worker.getResult(); + if (result != null) { + return (JTemplate) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, + new Object[]{result.getBaseBook(), tplFile, new Parameter[0]}, classType, BaseJForm.class); + } + return emptyForm; } else { return (JTemplate) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, - new Object[]{form, tplFile}, classType, BaseJForm.class); + new Object[]{asIOFile(tplFile), tplFile}, classType, BaseJForm.class); } } From dfa979bd453d9863273a71929f1ad3163881c695 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 20 May 2021 16:39:29 +0800 Subject: [PATCH 09/10] =?UTF-8?q?REPORT-52554=20=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E4=BA=86=E6=8A=BD=E6=95=B0=E7=BC=93=E5=AD=98=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=20=E5=AD=98=E5=9C=A8npe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/data/BasicTableDataTreePane.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java index b72ae2f15..b0997b7f6 100644 --- a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java @@ -497,7 +497,9 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp } public void refreshToolBar() { - toolbarDef.refreshToolBar(FORBIDDEN_SET); + if (toolbarDef != null) { + toolbarDef.refreshToolBar(FORBIDDEN_SET); + } } public void checkEnable() { From 2e2b119c31693288936868caa9580c418b6ac669 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 20 May 2021 16:40:54 +0800 Subject: [PATCH 10/10] =?UTF-8?q?REPORT-51244=E3=80=9010.0.17=E3=80=91?= =?UTF-8?q?=E5=A4=8D=E7=94=A8=E7=BB=84=E4=BB=B6=E6=8E=A5=E8=A7=A6=E7=82=B9?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java index 98e149e0c..4e0bb3143 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java @@ -6,6 +6,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.PromptWindow; +import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.IOUtils; @@ -58,6 +59,7 @@ public class ReuseGuideDialog extends UIDialog implements PromptWindow { @Override public void hideWindow() { + ComponentReuseNotificationInfo.getInstance().updateLastGuidePopUpTime(); this.setVisible(false); if (innerDialog != null) { innerDialog.setVisible(false);