From e8ece2ca512113e9d0184b809afb1bdcb03e3ed8 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 9 Oct 2020 23:51:31 +0800 Subject: [PATCH 01/13] =?UTF-8?q?CHART-16111=20=E5=AF=8C=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E6=A0=B7=E5=BC=8F=E5=88=87=E6=8D=A2=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E4=BF=9D=E7=95=99content?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/com/fr/design/editor/script/editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js index 494be9525..f87d8b6c0 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js @@ -232,7 +232,7 @@ content = this.editor.getValue(BI.NicEditor.FormatType.ESCAPE), origin = content; if (isAuto) { - // content = this._switchToAutoStyle(); + content = this._switchToAutoStyle(); this.setFocus(); } else if (editorService.isRichTextEqual(content, this.options.placeholder)) { content = ""; From d6c6299733b078c6ab5959aa7f688e6f83a03509 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Sat, 10 Oct 2020 09:53:12 +0800 Subject: [PATCH 02/13] =?UTF-8?q?REPORT-38778=201.=E6=96=B0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=9A=84=E5=B0=8F=E7=BA=A2=E7=82=B9=E3=80=81=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E6=8F=90=E7=A4=BA=EF=BC=9B=202.=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E9=A1=B9=203.=E6=96=B0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=A2=84=E8=A3=85=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EastRegionContainerPane.java | 32 +++++++--- .../com/fr/design/mainframe/PromptWindow.java | 17 ++++++ .../fr/design/mainframe/PropertyItemBean.java | 54 +++++++++++------ .../com/fr/design/menu/SnapChatMenuDef.java | 50 ++++++++-------- .../fr/design/menu/SnapChatUpdateAction.java | 58 +++++++++---------- .../java/com/fr/design/menu/SnapChatUtil.java | 31 ++++++---- .../design/notification/AbstractSnapChat.java | 22 +++++++ .../com/fr/design/notification/SnapChat.java | 4 ++ 8 files changed, 177 insertions(+), 91 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/PromptWindow.java create mode 100644 designer-base/src/main/java/com/fr/design/notification/AbstractSnapChat.java 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 c7c587563..3dd7b2d99 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 @@ -12,6 +12,8 @@ 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.menu.SnapChatUtil; +import com.fr.design.notification.SnapChat; import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; @@ -221,11 +223,13 @@ public class EastRegionContainerPane extends UIEastResizableContainer { String key = provider.key(); PropertyItemBean itemBean = provider.getItem(); PropertyItem propertyItem = new PropertyItem(itemBean.getName(), - itemBean.getTitle(), - itemBean.getBtnIconName(), - itemBean.getBtnIconBaseDir(), - itemBean.getVisibleModes(), - itemBean.getEnableModes()); + itemBean.getTitle(), + itemBean.getBtnIconName(), + itemBean.getBtnIconBaseDir(), + itemBean.getVisibleModes(), + itemBean.getEnableModes(), + itemBean.getSnapChat(), + itemBean.getPromptWindow()); UIButton button = propertyItem.getButton(); List buttonListeners = itemBean.getButtonListeners(); if (buttonListeners != null) { @@ -657,6 +661,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { class PropertyItem { + private SnapChat snapChat; private UIButton button; private String name; // 用于 card 切换 private String title; // 用于显示 @@ -667,6 +672,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private FixedPopupPane popupPane; // 左侧固定弹出框 private PopupToolPane popupToolPane; // 弹出工具条 private PopupDialog popupDialog; // 弹出框 + private PromptWindow promptWindow; //提示窗 private boolean isPoppedOut = false; // 是否弹出 private boolean isVisible = true; // 是否可见 private boolean replace = false; // 是否被替代 @@ -687,14 +693,16 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes) { - this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes); + this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes, null,null); } - public PropertyItem(String name, String title, String btnIconName, String iconBaseDir, PropertyMode[] visibleModes, PropertyMode[] enableModes) { + public PropertyItem(String name, String title, String btnIconName, String iconBaseDir, PropertyMode[] visibleModes, PropertyMode[] enableModes, SnapChat snapChat,PromptWindow promptWindow) { this.name = name; this.title = title; this.btnIconName = btnIconName; this.iconBaseDir = iconBaseDir; + this.snapChat = snapChat; + this.promptWindow = promptWindow; initButton(); initPropertyPanel(); initModes(visibleModes, enableModes); @@ -875,6 +883,9 @@ public class EastRegionContainerPane extends UIEastResizableContainer { @Override public void paintComponent(Graphics g) { super.paintComponent(g); + if (snapChat != null && !snapChat.hasRead()) { + SnapChatUtil.paintPropertyItemPoint(g, getBounds()); + } } }; button.set4LargeToolbarButton(); @@ -902,6 +913,13 @@ public class EastRegionContainerPane extends UIEastResizableContainer { popupFixedPane(); } setTabButtonSelected(); + if (snapChat != null && !snapChat.hasRead()) { + snapChat.markRead(); + + } + if (promptWindow != null) { + promptWindow.showWindow(); + } } }); button.setToolTipText(title); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/PromptWindow.java b/designer-base/src/main/java/com/fr/design/mainframe/PromptWindow.java new file mode 100644 index 000000000..4dc85d1bf --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/PromptWindow.java @@ -0,0 +1,17 @@ +package com.fr.design.mainframe; + +/** + * @Author: Yuan.Wang + * @Date: 2020/10/9 + */ +public interface PromptWindow { + /** + * 显示弹窗 + * */ + void showWindow(); + + /** + * 影藏弹窗 + * */ + void hideWindow(); +} 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 ee54364ba..cdd5dbb64 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 @@ -1,5 +1,7 @@ package com.fr.design.mainframe; +import com.fr.design.notification.SnapChat; + import java.awt.event.ActionListener; import java.util.List; @@ -7,71 +9,89 @@ import java.util.List; * created by Harrison on 2020/03/23 **/ public class PropertyItemBean { - + private String name; private String title; private String btnIconName; private String btnIconBaseDir; + private SnapChat snapChat; + private PromptWindow promptWindow; 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 String getBtnIconBaseDir() { - + return btnIconBaseDir; } - + public void setBtnIconBaseDir(String btnIconBaseDir) { this.btnIconBaseDir = btnIconBaseDir; } - + + public SnapChat getSnapChat() { + return snapChat; + } + + public void setSnapChat(SnapChat snapChat) { + this.snapChat = snapChat; + } + + public PromptWindow getPromptWindow() { + return promptWindow; + } + + public void setPromptWindow(PromptWindow promptWindow) { + this.promptWindow = promptWindow; + } + 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/SnapChatMenuDef.java b/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java index 2ec3f6c7e..762bb513c 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 @@ -2,6 +2,7 @@ package com.fr.design.menu; import com.fr.design.gui.imenu.UIMenu; import com.fr.design.gui.imenu.UIScrollMenu; +import com.fr.design.notification.AbstractSnapChat; import com.fr.design.notification.SnapChat; import com.fr.design.notification.SnapChatConfig; import com.fr.design.notification.SnapChatKey; @@ -22,6 +23,17 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat { private SnapChatKey uniqueKey; private SnapChatMenuUI menuUI = new SnapChatMenuUI(this); + private SnapChat snapChat = new AbstractSnapChat() { + @Override + public SnapChatKey key() { + return uniqueKey; + } + + @Override + public boolean defaultStatus() { + return true; + } + }; public SnapChatMenuDef(String name, SnapChatKey uniqueKey) { super(name); @@ -40,26 +52,24 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat { @Override public boolean hasRead() { - - String calcKey = calcKey(); - Boolean val = SnapChatConfig.getInstance().hasRead(calcKey); - // 默认读过了。 - return val == null ? defaultStatus() : val; + return snapChat.hasRead(); } @Override public void markRead() { - - String calcKey = calcKey(); - SnapChatConfig.getInstance().markRead(calcKey); + snapChat.markRead(); } - + @Override public boolean defaultStatus() { - - return true; + return snapChat.defaultStatus(); } - + + @Override + public SnapChatKey key() { + return snapChat.key(); + } + @Override public void addShortCut(ShortCut shortCut) { @@ -74,13 +84,6 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat { super.insertShortCut(index, shortCut); } - - @Override - public SnapChatKey key() { - - return this.uniqueKey; - } - @Override protected MenuListener createMenuListener() { @@ -97,17 +100,12 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat { if (shortCut instanceof SnapChatUpdateAction) { SnapChatUpdateAction action = (SnapChatUpdateAction) shortCut; if (!action.hasRead()) { - String calcKey = calcKey(); + String calcKey = snapChat.calcKey(); SnapChatConfig.getInstance().resetRead(calcKey); } } } - - private String calcKey() { - - return key().calc(); - } - + @Override protected UIMenu createJMenu0() { diff --git a/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java b/designer-base/src/main/java/com/fr/design/menu/SnapChatUpdateAction.java index 9ade76250..45645167d 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 @@ -2,6 +2,7 @@ package com.fr.design.menu; import com.fr.design.actions.UpdateAction; import com.fr.design.gui.imenu.UIMenuItem; +import com.fr.design.notification.AbstractSnapChat; import com.fr.design.notification.SnapChat; import com.fr.design.notification.SnapChatConfig; import com.fr.design.notification.SnapChatKey; @@ -12,57 +13,56 @@ import java.awt.event.ActionEvent; * created by Harrison on 2020/03/22 **/ public abstract class SnapChatUpdateAction extends UpdateAction implements SnapChat { - + private SnapChatKey uniqueKey; - + + private SnapChat snapChat = new AbstractSnapChat() { + @Override + public SnapChatKey key() { + return uniqueKey; + } + + @Override + public boolean defaultStatus() { + return false; + } + }; + public SnapChatUpdateAction(SnapChatKey uniqueKey) { this.uniqueKey = uniqueKey; } - + @Override public final void actionPerformed(ActionEvent e) { - markRead(); actionPerformed0(e); } - + protected abstract void actionPerformed0(ActionEvent e); - + @Override public boolean hasRead() { - - String calcKey = calcKey(); - Boolean val = SnapChatConfig.getInstance().hasRead(calcKey); - return val == null ? defaultStatus() : val; + return snapChat.hasRead(); } - + @Override public void markRead() { - - String calcKey = calcKey(); - SnapChatConfig.getInstance().markRead(calcKey); + snapChat.markRead(); } - + @Override public boolean defaultStatus() { - - return false; + return snapChat.defaultStatus(); } - + @Override public SnapChatKey key() { - - return this.uniqueKey; - } - - private String calcKey() { - - return key().calc(); + return snapChat.key(); } - + @Override public UIMenuItem createMenuItem() { - + Object object = this.getValue(UIMenuItem.class.getName()); if (object == null && !(object instanceof UIMenuItem)) { UIMenuItem menuItem = new UIMenuItem(this); @@ -70,10 +70,10 @@ public abstract class SnapChatUpdateAction extends UpdateAction implements SnapC 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 index 6eb648055..46bede232 100644 --- a/designer-base/src/main/java/com/fr/design/menu/SnapChatUtil.java +++ b/designer-base/src/main/java/com/fr/design/menu/SnapChatUtil.java @@ -10,24 +10,31 @@ import java.awt.geom.Ellipse2D; * created by Harrison on 2020/03/22 **/ public class SnapChatUtil { - + private static final int WIDTH = 4; + private static final int HEIGHT = 4; + private static final int TOP_GAP = 4; + private static final int RIGHT_GAP = 6; + + /** + * 绘制菜单项的小红点 + */ public static void paintSnapChat(Graphics g, Rectangle textRect) { - - Color oldColor = g.getColor(); - - double x = textRect.getWidth(); - x += textRect.getX(); - x += 2; - + double x = textRect.getWidth() + textRect.getX() + 2; double y = textRect.getY(); - + paintRedPoint(g, new Ellipse2D.Double(x, y, WIDTH, HEIGHT)); + } + + public static void paintPropertyItemPoint(Graphics g, Rectangle bounds) { + double x = bounds.getWidth() - RIGHT_GAP; + paintRedPoint(g, new Ellipse2D.Double(x, TOP_GAP, WIDTH, HEIGHT)); + } + + private static void paintRedPoint(Graphics g, Ellipse2D.Double shape) { + Color oldColor = g.getColor(); 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/AbstractSnapChat.java b/designer-base/src/main/java/com/fr/design/notification/AbstractSnapChat.java new file mode 100644 index 000000000..0b174da94 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/notification/AbstractSnapChat.java @@ -0,0 +1,22 @@ +package com.fr.design.notification; + +/** + * @Author: Yuan.Wang + * @Date: 2020/9/27 + */ +public abstract class AbstractSnapChat implements SnapChat { + @Override + public boolean hasRead() { + + String calcKey = calcKey(); + Boolean val = SnapChatConfig.getInstance().hasRead(calcKey); + return val == null ? defaultStatus() : val; + } + + @Override + public void markRead() { + + String calcKey = calcKey(); + SnapChatConfig.getInstance().markRead(calcKey); + } +} diff --git a/designer-base/src/main/java/com/fr/design/notification/SnapChat.java b/designer-base/src/main/java/com/fr/design/notification/SnapChat.java index 4f610c060..71aabb87d 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 @@ -32,4 +32,8 @@ public interface SnapChat { * @return 字符标志 */ SnapChatKey key(); + + default String calcKey() { + return key().calc(); + } } From 1cc03553fe9539a284327d26f0d582511a99d802 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Sat, 10 Oct 2020 10:02:29 +0800 Subject: [PATCH 03/13] =?UTF-8?q?REPORT-38778=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=8C=E5=8E=BB=E6=8E=89=E6=97=A0=E7=94=A8?= =?UTF-8?q?import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/EastRegionContainerPane.java | 7 +++---- 1 file changed, 3 insertions(+), 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 3dd7b2d99..03524452b 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 @@ -915,10 +915,9 @@ public class EastRegionContainerPane extends UIEastResizableContainer { setTabButtonSelected(); if (snapChat != null && !snapChat.hasRead()) { snapChat.markRead(); - - } - if (promptWindow != null) { - promptWindow.showWindow(); + if (promptWindow != null) { + promptWindow.showWindow(); + } } } }); From bf07ae48dd44f2936bee1fb171f505598945e32f Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Sat, 10 Oct 2020 10:31:02 +0800 Subject: [PATCH 04/13] =?UTF-8?q?REPORT-38778=20=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EastRegionContainerPane.java | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 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 03524452b..0703216eb 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 @@ -173,7 +173,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } updateAllPropertyPane(); } - }); } + }); + } }, filter); PluginListenerRegistration.getInstance().listen( PluginEventType.BeforeStop, @@ -328,6 +329,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { cellElement.popupDialog.showDefaultPane(); } } + // 禁用单元格元素tab private void enableCellElementPane(PropertyItem cellElement) { cellElement.setEnabled(true); @@ -385,7 +387,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { /** * 可通过此方法,判断当前的编辑模式 - * */ + */ public PropertyMode getCurrentMode() { return currentMode; } @@ -531,7 +533,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { propertyItemMap.get(KEY_WIDGET_SETTINGS).replaceHeaderPane(paraPane); } - public static void main(String[] args){ + public static void main(String[] args) { JFrame jf = new JFrame("test"); // jf = new JFrame("test"); @@ -553,7 +555,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { // leftPane.add(b2); // leftPane.setLayout(new BoxLayout(leftPane, BoxLayout.Y_AXIS)); - JPanel content = (JPanel)jf.getContentPane(); + JPanel content = (JPanel) jf.getContentPane(); // content.setLayout(null); content.add(cc, BorderLayout.CENTER); content.add(new EastRegionContainerPane(), BorderLayout.EAST); @@ -693,10 +695,10 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes) { - this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes, null,null); + this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes, null, null); } - public PropertyItem(String name, String title, String btnIconName, String iconBaseDir, PropertyMode[] visibleModes, PropertyMode[] enableModes, SnapChat snapChat,PromptWindow promptWindow) { + public PropertyItem(String name, String title, String btnIconName, String iconBaseDir, PropertyMode[] visibleModes, PropertyMode[] enableModes, SnapChat snapChat, PromptWindow promptWindow) { this.name = name; this.title = title; this.btnIconName = btnIconName; @@ -843,7 +845,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { if (isRightPaneVisible()) { hideCurrentPopupPane(); replaceContentPane(contentPane); - } else if(popupPane != null && popupPane.isVisible()) { + } else if (popupPane != null && popupPane.isVisible()) { popupPane.replaceContentPane(contentArea); } } @@ -880,6 +882,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public Dimension getPreferredSize() { return new Dimension(TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT); } + @Override public void paintComponent(Graphics g) { super.paintComponent(g); @@ -1032,8 +1035,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } /** - * @Description:刷新currentPopupPane面板位置,当设计器缩放时会调用这个函数 * @param + * @Description:刷新currentPopupPane面板位置,当设计器缩放时会调用这个函数 * @return: * @Author: Henry.Wang * @date: 2020/7/30 11:39 @@ -1048,8 +1051,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } /** - * @Description:清空currentPopupPane数据,当切换模板时会调用这个函数 * @param + * @Description:清空currentPopupPane数据,当切换模板时会调用这个函数 * @return: * @Author: Henry.Wang * @date: 2020/7/30 11:42 @@ -1088,12 +1091,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } repaint(); } + @Override public void mouseClicked(MouseEvent e) { if (e.getX() >= ARROW_RANGE_START) { onPop(); } } + @Override public void mouseReleased(MouseEvent e) { mouseDownCompCoords = null; @@ -1101,6 +1106,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { contentPane.setBackground(originColor); } } + @Override public void mousePressed(MouseEvent e) { if (e.getX() < ARROW_RANGE_START) { @@ -1122,6 +1128,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } repaint(); } + @Override public void mouseDragged(MouseEvent e) { if (isMovable && mouseDownCompCoords != null) { @@ -1234,6 +1241,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private Container contentPane; private JPanel defaultPane; // 无可用配置项 private PropertyItem propertyItem; + public PopupDialog(PropertyItem propertyItem) { super(DesignerContext.getDesignerFrame()); container = getContentPane(); @@ -1336,6 +1344,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { mouseDownCompCoords = e.getLocationOnScreen(); } } + @Override public void mouseReleased(MouseEvent e) { mouseDownCompCoords = null; From 80b9c03c0f2dd76e518a84e0fd662f4b41eb5756 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Sat, 10 Oct 2020 11:52:56 +0800 Subject: [PATCH 05/13] =?UTF-8?q?REPORT-38778=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=8F=8F=E8=BF=B0=E3=80=82=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BA=86SnapChat=E7=9A=84=E5=B7=A5=E5=8E=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/PromptWindow.java | 9 +++++--- .../com/fr/design/menu/SnapChatMenuDef.java | 15 +++---------- .../fr/design/menu/SnapChatUpdateAction.java | 13 ++---------- .../design/notification/SnapChatFactory.java | 21 +++++++++++++++++++ 4 files changed, 32 insertions(+), 26 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/notification/SnapChatFactory.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/PromptWindow.java b/designer-base/src/main/java/com/fr/design/mainframe/PromptWindow.java index 4dc85d1bf..dc7fc1f63 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/PromptWindow.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/PromptWindow.java @@ -1,17 +1,20 @@ package com.fr.design.mainframe; +import javax.swing.JWindow; + /** * @Author: Yuan.Wang * @Date: 2020/10/9 + * 只关心Window的显示和隐藏操作时可以实现该接口 */ public interface PromptWindow { /** * 显示弹窗 - * */ + */ void showWindow(); /** - * 影藏弹窗 - * */ + * 隐藏弹窗 + */ void hideWindow(); } 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 762bb513c..88757b689 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 @@ -5,6 +5,7 @@ import com.fr.design.gui.imenu.UIScrollMenu; import com.fr.design.notification.AbstractSnapChat; import com.fr.design.notification.SnapChat; import com.fr.design.notification.SnapChatConfig; +import com.fr.design.notification.SnapChatFactory; import com.fr.design.notification.SnapChatKey; import javax.swing.JMenu; @@ -20,21 +21,11 @@ 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); - private SnapChat snapChat = new AbstractSnapChat() { - @Override - public SnapChatKey key() { - return uniqueKey; - } + private SnapChat snapChat = SnapChatFactory.createSnapChat(true, uniqueKey); - @Override - public boolean defaultStatus() { - return true; - } - }; - public SnapChatMenuDef(String name, SnapChatKey uniqueKey) { super(name); this.uniqueKey = uniqueKey; 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 45645167d..71fbc95a7 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 @@ -5,6 +5,7 @@ import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.notification.AbstractSnapChat; import com.fr.design.notification.SnapChat; import com.fr.design.notification.SnapChatConfig; +import com.fr.design.notification.SnapChatFactory; import com.fr.design.notification.SnapChatKey; import java.awt.event.ActionEvent; @@ -16,17 +17,7 @@ public abstract class SnapChatUpdateAction extends UpdateAction implements SnapC private SnapChatKey uniqueKey; - private SnapChat snapChat = new AbstractSnapChat() { - @Override - public SnapChatKey key() { - return uniqueKey; - } - - @Override - public boolean defaultStatus() { - return false; - } - }; + private SnapChat snapChat = SnapChatFactory.createSnapChat(false, uniqueKey); public SnapChatUpdateAction(SnapChatKey uniqueKey) { this.uniqueKey = uniqueKey; diff --git a/designer-base/src/main/java/com/fr/design/notification/SnapChatFactory.java b/designer-base/src/main/java/com/fr/design/notification/SnapChatFactory.java new file mode 100644 index 000000000..c685e0f34 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChatFactory.java @@ -0,0 +1,21 @@ +package com.fr.design.notification; + +/** + * @Author: Yuan.Wang + * @Date: 2020/10/10 + */ +public class SnapChatFactory { + public static SnapChat createSnapChat(boolean defaultStatus, SnapChatKey snapChatKey) { + return new AbstractSnapChat() { + @Override + public boolean defaultStatus() { + return defaultStatus; + } + + @Override + public SnapChatKey key() { + return snapChatKey; + } + }; + } +} From def7bcf41eac47214a09b04d6c93f0a31b866299 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sat, 10 Oct 2020 13:50:34 +0800 Subject: [PATCH 06/13] =?UTF-8?q?CHART-16097=20=E6=9F=B1=E5=BD=A2=E5=9B=BE?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=AF=8C=E6=96=87=E6=9C=AC=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=96=B9=E5=90=91=E7=81=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartColumnPlotLabelDetailPane.java | 17 +++++++++++++++++ .../label/VanChartPlotLabelDetailPane.java | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java index 3243bad71..b32a23c69 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java @@ -1,6 +1,8 @@ package com.fr.van.chart.column; import com.fr.chart.chartattr.Plot; +import com.fr.plugin.chart.base.AttrLabelDetail; +import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.column.VanChartColumnPlot; import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; @@ -14,4 +16,19 @@ public class VanChartColumnPlotLabelDetailPane extends VanChartPlotLabelDetailPa protected boolean hasLabelOrientationPane() { return !((VanChartColumnPlot) this.getPlot()).isBar(); } + + private void checkOrientationEnable(AttrLabelDetail detail) { + AttrTooltipContent content = detail.getContent(); + getOrientation().setEnabled(content != null && !content.isRichText()); + } + + public void populate(AttrLabelDetail detail) { + super.populate(detail); + checkOrientationEnable(detail); + } + + public void update(AttrLabelDetail detail) { + super.update(detail); + checkOrientationEnable(detail); + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index fd387654e..6f577965b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -88,6 +88,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return plot; } + public UIButtonGroup getOrientation() { + return orientation; + } + //默认从factory中取 protected void initToolTipContentPane(Plot plot) { dataLabelContentPane = PlotFactory.createPlotLabelContentPane(plot, parent, VanChartPlotLabelDetailPane.this); From aa138dd69481c2083c4ec80334d03e196364d8c7 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sat, 10 Oct 2020 14:11:14 +0800 Subject: [PATCH 07/13] =?UTF-8?q?CHART-16116=20=E4=BF=AE=E6=94=B9=E6=B0=94?= =?UTF-8?q?=E6=B3=A1=E5=9B=BE=E6=95=A3=E7=82=B9=E5=9B=BE=E6=A0=87=E7=AD=BE?= =?UTF-8?q?HTMl=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/scatter/VanChartScatterLabelContentPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java index 72ab39c9a..160cfb25e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java @@ -1,6 +1,7 @@ package com.fr.van.chart.scatter; import com.fr.van.chart.designer.component.VanChartHtmlLabelPane; +import com.fr.van.chart.designer.component.VanChartHtmlLabelPaneWithBackGroundLabel; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -17,7 +18,7 @@ public class VanChartScatterLabelContentPane extends VanChartScatterTooltipCont @Override protected VanChartHtmlLabelPane createHtmlLabelPane() { - return new VanChartHtmlLabelPane(); + return new VanChartHtmlLabelPaneWithBackGroundLabel(); } } From 5a2b5fc80958b2adf5b16e74b0a0f5e617c8447e Mon Sep 17 00:00:00 2001 From: Hans Date: Sat, 10 Oct 2020 15:06:23 +0800 Subject: [PATCH 08/13] =?UTF-8?q?MOBILE-29637=20&=20MOBILE-29634=E3=80=90?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E3=80=91tab=E6=89=8B=E5=8A=BF?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=8F=98=E6=9B=B4=EF=BC=8C=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=BB=91=E5=8A=A8=E8=AE=BE=E7=BD=AE=E4=B8=8E=E5=9C=86=E7=82=B9?= =?UTF-8?q?=E6=8C=87=E7=A4=BA=E5=99=A8=E8=AE=BE=E7=BD=AE=E7=9A=84=E5=85=B3?= =?UTF-8?q?=E8=81=94=E5=85=B3=E7=B3=BB=20&=20=E3=80=90RN=E3=80=91release?= =?UTF-8?q?=20jar=EF=BC=8C=E9=BB=98=E8=AE=A4=E6=A0=B7=E5=BC=8Ftab=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E5=AD=97=E5=8F=B7=E5=8F=98=E5=B0=8F=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/component/MobileTabCommonSettingPane.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java index 82a09c4e0..4670456ae 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java @@ -133,14 +133,6 @@ public class MobileTabCommonSettingPane extends BasicPane { tableConfigJPanel.add(dotIndicatorSettingPanel, BorderLayout.CENTER); this.add(tableConfigJPanel, BorderLayout.CENTER); - tabSlideCheck.addChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - showTabDotIndicatorCheck.setVisible(tabSlideCheck.isSelected()); - dotIndicatorSettingPanel.setVisible(tabSlideCheck.isSelected() && showTabDotIndicatorCheck.isSelected()); - } - }); - showTabDotIndicatorCheck.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { From 1a646fa03d2460b75ef1f4f73740ee1cb5e91ceb Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 11 Oct 2020 20:12:40 +0800 Subject: [PATCH 09/13] =?UTF-8?q?CHART-15948=20=E5=AF=8C=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E9=BB=98=E8=AE=A4=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../box/VanChartBoxTooltipContentPane.java | 2 + .../VanChartColumnPlotLabelDetailPane.java | 7 +++- .../component/VanChartRichEditorPane.java | 21 ++++++++++- .../component/VanChartTooltipContentPane.java | 12 ++++++ .../TooltipContentPaneWithOutSeries.java | 2 + .../style/VanChartFunnelLabelContentPane.java | 6 +++ .../VanChartFunnelTooltipContentPane.java | 10 ++++- .../VanChartGanttTooltipContentPane.java | 2 + .../VanChartScatterTooltipContentPane.java | 2 + .../VanChartStructureTooltipContentPane.java | 2 + .../com/fr/design/editor/rich_editor.html | 37 +++++++++++++++++-- 11 files changed, 96 insertions(+), 7 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java index c23a5c921..abba5f753 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java @@ -308,6 +308,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { populateRichTextFormat(formatPaneGroup, formatGroup); populateRichText(attrTooltipContent.getRichTextAttr()); + + checkRichEditorState(attrTooltipContent); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java index b32a23c69..7da396c51 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java @@ -1,6 +1,7 @@ package com.fr.van.chart.column; import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.column.VanChartColumnPlot; @@ -19,7 +20,11 @@ public class VanChartColumnPlotLabelDetailPane extends VanChartPlotLabelDetailPa private void checkOrientationEnable(AttrLabelDetail detail) { AttrTooltipContent content = detail.getContent(); - getOrientation().setEnabled(content != null && !content.isRichText()); + UIButtonGroup orientation = getOrientation(); + + if (orientation != null) { + orientation.setEnabled(content != null && !content.isRichText()); + } } public void populate(AttrLabelDetail detail) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java index d1f294e41..615979f30 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java @@ -69,18 +69,27 @@ public class VanChartRichEditorPane { paramsStr.deleteCharAt(len - 1); } - return new RichEditorModel(richText.getContent(), richText.isAuto(), paramsStr.toString()); + String content = richText.getContent(); + String initParams = StringUtils.EMPTY; + + if (content.contains("data-id") && !content.contains("class")) { + initParams = richText.getInitParamsContent(); + } + + return new RichEditorModel(content, richText.isAuto(), paramsStr.toString(), initParams); } public static class RichEditorModel { private String content; private boolean auto; private String params; + private String initParams; - public RichEditorModel(String content, boolean auto, String params) { + public RichEditorModel(String content, boolean auto, String params, String initParams) { this.content = content; this.auto = auto; this.params = params; + this.initParams = initParams; } public String getContent() { @@ -106,5 +115,13 @@ public class VanChartRichEditorPane { public void setParams(String params) { this.params = params; } + + public String getInitParams() { + return initParams; + } + + public void setInitParams(String initParams) { + this.initParams = initParams; + } } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 847cd3891..fe2b4e365 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -12,9 +12,11 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.ui.ModernUIPane; +import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.AttrTooltipRichText; import com.fr.plugin.chart.base.format.AttrTooltipFormat; +import com.fr.stable.StringUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithoutCheckBox; @@ -683,6 +685,8 @@ public class VanChartTooltipContentPane extends BasicBeanPane -1) { + content += '

' + editorService.getEditorParamImage(key) + '

'; + } + } + + return content; + } + var dimensionIds = getDimensionIds(params); + if (initParams) { + content = getInitContent(params, initParams); + } + var rich_editor = BI.createWidget({ type: "bi.design.chart.common.editor", element: "body", @@ -92,10 +114,19 @@ }); Pool.dispatch = function () { + var content = Pool.data.getContent(); + var isAuto = Pool.data.isAuto(); + var params = Pool.data.getParams(); + var initParams = Pool.data.getInitParams(); + + if (initParams) { + content = getInitContent(params, initParams); + } + rich_editor.setValue({ - content: Pool.data.getContent(), - isAuto: Pool.data.isAuto(), - dimensionIds: getDimensionIds(Pool.data.getParams()) + content: content, + isAuto: isAuto, + dimensionIds: getDimensionIds(params) }); } From 3ed4b1c9098d544ff44e376d9b92aaffaa96661b Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 11 Oct 2020 20:40:10 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E5=A1=AB=E5=85=85=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E6=97=B6=E6=9B=B4=E6=96=B0=E5=88=9D=E5=A7=8B=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/designer/component/VanChartTooltipContentPane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index fe2b4e365..632198dbd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -706,6 +706,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Sun, 11 Oct 2020 21:39:35 +0800 Subject: [PATCH 11/13] =?UTF-8?q?CHART-16117=20=E9=80=89=E6=8B=A9=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E7=BC=96=E8=BE=91=E5=99=A8=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=BA=94=E8=AE=BE=E7=BD=AEdirty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/designer/component/VanChartTooltipContentPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 632198dbd..4c81493e4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -606,7 +606,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Mon, 12 Oct 2020 10:28:37 +0800 Subject: [PATCH 12/13] =?UTF-8?q?CHART-15747=20=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E4=BA=A4=E4=BA=92=E5=B1=9E=E6=80=A7=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E7=B3=BB=E5=88=97=E5=90=8D=E5=8B=BE=E9=80=89=E8=A2=AB?= =?UTF-8?q?=E5=8E=BB=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartTooltipContentPane.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 4c81493e4..5d0a613ac 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -731,8 +731,6 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Mon, 12 Oct 2020 10:54:15 +0800 Subject: [PATCH 13/13] =?UTF-8?q?REPORT-38778=20=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E5=92=8C=E6=A8=A1=E6=9D=BF=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E7=9A=84=E5=B0=8F=E7=BA=A2=E7=82=B9=EF=BC=8C=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=B7=A5=E5=8E=82=E7=B1=BB=E5=BC=95=E8=B5=B7?= =?UTF-8?q?=E7=9A=84bug=EF=BC=8C=E4=BF=AE=E6=94=B9=E9=A2=84=E8=A3=85?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/toolbar/ToolBarMenuDock.java | 9 ++------- .../main/java/com/fr/design/menu/SnapChatMenuDef.java | 6 ++++-- .../java/com/fr/design/menu/SnapChatUpdateAction.java | 6 ++---- .../com/fr/design/notification/SnapChatFactory.java | 11 +++++++++++ .../java/com/fr/design/notification/SnapChatKey.java | 11 ++++++++++- 5 files changed, 29 insertions(+), 14 deletions(-) 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 c81c6749f..757d7be04 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -54,9 +54,7 @@ import com.fr.design.mainframe.ToolBarNewTemplatePane; import com.fr.design.menu.MenuDef; import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ShortCut; -import com.fr.design.menu.SnapChatMenuDef; import com.fr.design.menu.ToolBarDef; -import com.fr.design.notification.SnapChatAllTypes; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.remote.action.RemoteDesignAuthManagerAction; import com.fr.design.update.actions.SoftwareUpdateAction; @@ -655,11 +653,8 @@ public abstract class ToolBarMenuDock { } public MenuDef createCommunityMenuDef() { - - MenuDef menuDef = new SnapChatMenuDef( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community"), - 'C', - SnapChatAllTypes.Menu.BBS); + + MenuDef menuDef = new MenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community"), 'C'); ShortCut[] otherCommunityShortCuts = createCommunityShortCuts(); for (ShortCut shortCut : otherCommunityShortCuts) { menuDef.addShortCut(shortCut); diff --git a/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java b/designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java index 88757b689..80ba40afe 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 @@ -2,7 +2,6 @@ package com.fr.design.menu; import com.fr.design.gui.imenu.UIMenu; import com.fr.design.gui.imenu.UIScrollMenu; -import com.fr.design.notification.AbstractSnapChat; import com.fr.design.notification.SnapChat; import com.fr.design.notification.SnapChatConfig; import com.fr.design.notification.SnapChatFactory; @@ -24,21 +23,24 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat { private SnapChatKey uniqueKey; private SnapChatMenuUI menuUI = new SnapChatMenuUI(this); - private SnapChat snapChat = SnapChatFactory.createSnapChat(true, uniqueKey); + private SnapChat snapChat ; public SnapChatMenuDef(String name, SnapChatKey uniqueKey) { super(name); this.uniqueKey = uniqueKey; + snapChat = SnapChatFactory.createSnapChat(true, uniqueKey); } public SnapChatMenuDef(Boolean rePaint, SnapChatKey uniqueKey) { super(rePaint); this.uniqueKey = uniqueKey; + snapChat = SnapChatFactory.createSnapChat(true, uniqueKey); } public SnapChatMenuDef(String name, char mnemonic, SnapChatKey uniqueKey) { super(name, mnemonic); this.uniqueKey = uniqueKey; + snapChat = SnapChatFactory.createSnapChat(true, uniqueKey); } @Override 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 71fbc95a7..8cc073437 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 @@ -2,9 +2,7 @@ package com.fr.design.menu; import com.fr.design.actions.UpdateAction; import com.fr.design.gui.imenu.UIMenuItem; -import com.fr.design.notification.AbstractSnapChat; import com.fr.design.notification.SnapChat; -import com.fr.design.notification.SnapChatConfig; import com.fr.design.notification.SnapChatFactory; import com.fr.design.notification.SnapChatKey; @@ -16,11 +14,11 @@ import java.awt.event.ActionEvent; public abstract class SnapChatUpdateAction extends UpdateAction implements SnapChat { private SnapChatKey uniqueKey; - - private SnapChat snapChat = SnapChatFactory.createSnapChat(false, uniqueKey); + private SnapChat snapChat ; public SnapChatUpdateAction(SnapChatKey uniqueKey) { this.uniqueKey = uniqueKey; + snapChat = SnapChatFactory.createSnapChat(false, uniqueKey); } @Override diff --git a/designer-base/src/main/java/com/fr/design/notification/SnapChatFactory.java b/designer-base/src/main/java/com/fr/design/notification/SnapChatFactory.java index c685e0f34..a3fd463a3 100644 --- a/designer-base/src/main/java/com/fr/design/notification/SnapChatFactory.java +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChatFactory.java @@ -1,11 +1,17 @@ package com.fr.design.notification; +import com.fr.plugin.context.PluginContext; + /** * @Author: Yuan.Wang * @Date: 2020/10/10 */ public class SnapChatFactory { public static SnapChat createSnapChat(boolean defaultStatus, SnapChatKey snapChatKey) { + return createSnapChat(defaultStatus, snapChatKey, null); + } + + public static SnapChat createSnapChat(boolean defaultStatus, SnapChatKey snapChatKey, PluginContext context) { return new AbstractSnapChat() { @Override public boolean defaultStatus() { @@ -16,6 +22,11 @@ public class SnapChatFactory { public SnapChatKey key() { return snapChatKey; } + + @Override + public String calcKey() { + return context == null ? key().calc() : key().calc(context); + } }; } } 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 index fa316db35..ecb89e509 100644 --- a/designer-base/src/main/java/com/fr/design/notification/SnapChatKey.java +++ b/designer-base/src/main/java/com/fr/design/notification/SnapChatKey.java @@ -1,9 +1,18 @@ package com.fr.design.notification; +import com.fr.plugin.context.PluginContext; + /** * created by Harrison on 2020/03/16 **/ public interface SnapChatKey { - + String calc(); + + /** + * 插件刚被安装时不能通过PluginContexts.getContext()方法获取插件上下文,因此加一个接口 + */ + default String calc(PluginContext context) { + throw new UnsupportedOperationException(); + } }