From 8efb51bcdde6f07feb238c97f6a596bb74ab056b Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 25 May 2021 19:11:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-52843=20&&=20REPORT-52844=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8-=E5=90=88=E5=85=A5?= =?UTF-8?q?=E4=B8=BB=E7=89=88=E6=9C=AC-read=E5=92=8Cclicked=E9=83=BD?= =?UTF-8?q?=E6=98=AFfalse=E6=97=B6=EF=BC=8C=E7=82=B9=E5=87=BB=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8=E8=93=9D?= =?UTF-8?q?=E5=AD=97=EF=BC=8C=E5=BC=B9=E5=87=BA=E6=96=B0=E6=89=8B=E5=BC=95?= =?UTF-8?q?=E5=AF=BC=EF=BC=8C=E5=85=B3=E9=97=AD=E5=BC=95=E5=AF=BC=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E5=BC=B9=E5=87=BA=E4=BA=86=E5=B7=B2=E5=90=88=E5=85=A5?= =?UTF-8?q?=E4=B8=BB=E7=89=88=E6=9C=AC=E7=9A=84=E6=8F=90=E7=A4=BA;=20=20?= =?UTF-8?q?=20=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8-=E5=90=88=E5=85=A5?= =?UTF-8?q?=E4=B8=BB=E7=89=88=E6=9C=AC-=E9=BC=A0=E6=A0=87=E6=82=AC?= =?UTF-8?q?=E6=B5=AE=E5=B7=A5=E5=85=B7=E6=A0=8F=E5=A5=97=E7=94=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=97=B6=EF=BC=8Ctooltip=E6=98=BE=E7=A4=BA=E2=80=9C?= =?UTF-8?q?=E5=A5=97=E7=94=A8=E7=BB=84=E4=BB=B6=E2=80=9D=EF=BC=8C=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E6=96=87=E6=A1=A3=E4=BB=A5=E5=8F=8A=E5=92=8C=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E7=A1=AE=E8=AE=A4=E4=BA=86=E4=B8=8B=EF=BC=8C=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E6=98=AF=E2=80=9C=E5=A4=8D=E7=94=A8=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/ComponentReuseNotifyUtil.java | 5 +++-- .../com/fr/design/mainframe/EastRegionContainerPane.java | 2 +- .../java/com/fr/design/mainframe/FormParaWidgetPane.java | 2 +- .../java/com/fr/design/mainframe/FormWidgetDetailPane.java | 2 +- 4 files changed, 6 insertions(+), 5 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 abad05eb1..4ab10194c 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 @@ -18,7 +18,7 @@ public class ComponentReuseNotifyUtil { } - public static void enterWidgetLibExtraAction() { + public static void enterWidgetLibExtraAction(boolean needValidRead) { if (ComponentReuseNotificationInfo.getInstance().isClickedWidgetLib()) { return; } @@ -28,11 +28,12 @@ public class ComponentReuseNotifyUtil { return COMPONENT_SNAP_CHAT_KEY; } }); - if (snapChat.hasRead()) { + if (snapChat.hasRead() && needValidRead) { 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 94d79b2d1..1bffe0842 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 @@ -313,7 +313,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - ComponentReuseNotifyUtil.enterWidgetLibExtraAction(); + ComponentReuseNotifyUtil.enterWidgetLibExtraAction(true); } }); // 权限编辑 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 81b4e7b61..b8f3ff638 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 @@ -277,7 +277,7 @@ public class FormParaWidgetPane extends JPanel { jPanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); jPanel.add(uiLabel, BorderLayout.NORTH); jPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Component_Reuse_Apply_Widget")), BorderLayout.CENTER); - jPanel.setToolTipText(Toolkit.i18nText("Fine-Design_Component_Reuse_Apply_Widget")); + jPanel.setToolTipText(Toolkit.i18nText("Fine-Design_Share_Component")); return jPanel; } 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 dd0cce25b..f77e68e15 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 @@ -108,7 +108,7 @@ public class FormWidgetDetailPane extends FormDockView{ public void enterWidgetLib() { EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB); headGroup.setSelectedIndex(ONLINE_TAB); - ComponentReuseNotifyUtil.enterWidgetLibExtraAction(); + ComponentReuseNotifyUtil.enterWidgetLibExtraAction(false); } /** From ab113ab438b6b8044e81416d7d292e5d7c608225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 26 May 2021 11:06:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?CHART-18965=20=E8=87=AA=E5=AE=9A=E4=B9=89ht?= =?UTF-8?q?ml=E6=A1=86=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartHtmlLabelPane.java | 51 ++++++++++++------- ...artHtmlLabelPaneWithOutWidthAndHeight.java | 2 +- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java index 40f85dcb4..0e9cc416f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java @@ -11,9 +11,9 @@ import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; - import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.base.VanChartHtmlLabel; import com.fr.van.chart.designer.style.VanChartStylePane; @@ -32,7 +32,7 @@ import java.awt.event.ActionListener; /** * Created by Mitisky on 16/2/19. */ -public class VanChartHtmlLabelPane extends JPanel{ +public class VanChartHtmlLabelPane extends JPanel { private static final long serialVersionUID = -5512128966013558611L; private static final int JS_HEIGHT = 100; @@ -47,7 +47,9 @@ public class VanChartHtmlLabelPane extends JPanel{ private VanChartStylePane parent; - public void setCustomFormatterText(String text){ + private JPanel widthAndHeightPane; + + public void setCustomFormatterText(String text) { contentTextArea.setText(text); } @@ -56,24 +58,28 @@ public class VanChartHtmlLabelPane extends JPanel{ } public VanChartHtmlLabelPane() { - useHtml = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Html")); + useHtml = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Html")); UIComponentUtils.setLineWrap(useHtml); - JPanel widthAndHeightPane = createWidthAndHeightPane(); + useHtml.addChangeListener(e -> checkWidthAndHeightPane()); + widthAndHeightPane = createWidthAndHeightPane(); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f}; - double[] rowSize = {p, p, p}; + double[] rowSize = {p, p, p, p}; - Component[][] components = new Component[][]{ + Component[][] components = new Component[][]{ new Component[]{createJSContentPane()}, new Component[]{useHtml}, - new Component[]{widthAndHeightPane} + new Component[]{null, null}, }; JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); this.setLayout(new BorderLayout()); - this.add(contentPane, BorderLayout.CENTER); + this.add(contentPane, BorderLayout.NORTH); + if (widthAndHeightPane != null) { + this.add(widthAndHeightPane, BorderLayout.CENTER); + } } private JComponent createJSContentPane() { @@ -112,7 +118,7 @@ public class VanChartHtmlLabelPane extends JPanel{ ac.setTriggerKey(KeyStroke.getKeyStroke(shortCuts.replace("+", "pressed"))); ac.install(contentTextArea); - return new UIScrollPane(contentTextArea){ + return new UIScrollPane(contentTextArea) { @Override public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, JS_HEIGHT); @@ -121,15 +127,15 @@ public class VanChartHtmlLabelPane extends JPanel{ } private void fireJSChange() { - if(parent != null){ + if (parent != null) { parent.attributeChanged(); } } protected JPanel createWidthAndHeightPane() { - isCustomWidth = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Width")); + isCustomWidth = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Custom_Width")); customWidth = new UITextField(6); - isCustomHeight = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Height")); + isCustomHeight = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Custom_Height")); customHeight = new UITextField(6); isCustomWidth.addActionListener(new ActionListener() { @@ -147,13 +153,13 @@ public class VanChartHtmlLabelPane extends JPanel{ }); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = { p, f }; + double[] columnSize = {p, f}; double[] rowSize = {p, p, p}; - Component[][] components = new Component[][]{ + Component[][] components = new Component[][]{ new Component[]{isCustomWidth, customWidth}, new Component[]{isCustomHeight, customHeight}, - new Component[] {null, null} + new Component[]{null, null} }; return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } @@ -171,8 +177,14 @@ public class VanChartHtmlLabelPane extends JPanel{ checkWidth(); } - public void populate(VanChartHtmlLabel htmlLabel){ - if(htmlLabel == null){ + private void checkWidthAndHeightPane() { + if (widthAndHeightPane != null) { + widthAndHeightPane.setVisible(useHtml.isSelected()); + } + } + + public void populate(VanChartHtmlLabel htmlLabel) { + if (htmlLabel == null) { return; } setCustomFormatterText(htmlLabel.getCustomText()); @@ -186,10 +198,11 @@ public class VanChartHtmlLabelPane extends JPanel{ isCustomHeight.setSelected(htmlLabel.isCustomHeight()); customHeight.setText(htmlLabel.getHeight()); checkBoxUse(); + checkWidthAndHeightPane(); } public void update(VanChartHtmlLabel htmlLabel) { - if(htmlLabel == null){ + if (htmlLabel == null) { return; } htmlLabel.setCustomText(contentTextArea.getText()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithOutWidthAndHeight.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithOutWidthAndHeight.java index 48cc423c8..37a52fa16 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithOutWidthAndHeight.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithOutWidthAndHeight.java @@ -12,7 +12,7 @@ public class VanChartHtmlLabelPaneWithOutWidthAndHeight extends VanChartHtmlLabe private static final long serialVersionUID = -9213286452724939880L; protected JPanel createWidthAndHeightPane() { - return new JPanel(); + return null; } protected void populateWidthAndHeight(VanChartHtmlLabel htmlLabel) {