From c221d03f544acb635c8a76d8d750aa935d5a1c79 Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 22 Sep 2020 10:43:27 +0800 Subject: [PATCH 01/32] =?UTF-8?q?REPORT-38516=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E6=A8=A1=E6=9D=BF=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=EF=BC=8C=E8=BE=93=E5=85=A5=E6=A1=86=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=85=A8=201.=20bug=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=EF=BC=9A=E5=AD=97=E4=BD=93=E5=BC=82=E5=B8=B8=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E8=83=BD=E6=94=BE=E4=B8=8B=E7=9A=84=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E6=A1=86=E8=A2=AB=E6=8C=A4=E4=B8=8B=E5=8E=BB=E4=BA=86?= =?UTF-8?q?=202.=20=E4=BF=AE=E6=94=B9=E6=96=B9=E6=A1=88=EF=BC=9A=E5=B0=86?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=87=8D=E5=91=BD=E5=90=8D=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E7=9A=84=E5=AE=BD=E5=BA=A6=E5=A2=9E=E5=A4=A7=EF=BC=8C=E4=B8=8E?= =?UTF-8?q?hades=E6=94=B9=E7=9A=84=E6=96=87=E4=BB=B6=E5=A4=B9=E9=87=8D?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E5=BC=B9=E7=AA=97=E4=BF=9D=E6=8C=81=E4=B8=80?= =?UTF-8?q?=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/DesignerFrameFileDealerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index a9d9281e99..86f73982f1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -649,7 +649,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt BorderLayout.CENTER); - this.setSize(340, 180); + this.setSize(380, 180); this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Rename")); this.setResizable(false); this.setAlwaysOnTop(true); From 83c85c6a09845757eb703be29420237881863057 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 22 Sep 2020 11:47:38 +0800 Subject: [PATCH 02/32] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=96=B9=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartColumnPlotLabelDetailPane.java | 17 ++++++ .../column/VanChartColumnPlotLabelPane.java | 20 +++++++ .../fr/van/chart/designer/PlotFactory.java | 2 + .../label/VanChartGaugeLabelDetailPane.java | 5 +- .../label/VanChartGaugePlotLabelPane.java | 57 +++++++++++++++++-- .../label/VanChartPlotLabelDetailPane.java | 42 ++++++++++---- 6 files changed, 126 insertions(+), 17 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java 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 new file mode 100644 index 0000000000..3243bad711 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java @@ -0,0 +1,17 @@ +package com.fr.van.chart.column; + +import com.fr.chart.chartattr.Plot; +import com.fr.plugin.chart.column.VanChartColumnPlot; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; + +public class VanChartColumnPlotLabelDetailPane extends VanChartPlotLabelDetailPane { + + public VanChartColumnPlotLabelDetailPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected boolean hasLabelOrientationPane() { + return !((VanChartColumnPlot) this.getPlot()).isBar(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java new file mode 100644 index 0000000000..e80f6310d5 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java @@ -0,0 +1,20 @@ +package com.fr.van.chart.column; + +import com.fr.chart.chartattr.Plot; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; + +import java.awt.BorderLayout; + +public class VanChartColumnPlotLabelPane extends VanChartPlotLabelPane { + + public VanChartColumnPlotLabelPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected void createLabelPane() { + VanChartColumnPlotLabelDetailPane labelDetailPane = new VanChartColumnPlotLabelDetailPane(getPlot(), getParentPane()); + setLabelDetailPane(labelDetailPane); + getLabelPane().add(labelDetailPane, BorderLayout.CENTER); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java index aeaefa5b3a..b518b1ec86 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java @@ -23,6 +23,7 @@ import com.fr.plugin.chart.structure.VanChartStructurePlot; import com.fr.plugin.chart.treemap.VanChartTreeMapPlot; import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot; import com.fr.van.chart.bubble.force.VanChartBubbleRefreshTooltipPane; +import com.fr.van.chart.column.VanChartColumnPlotLabelPane; import com.fr.van.chart.designer.component.VanChartLabelContentPane; import com.fr.van.chart.designer.component.VanChartRefreshTooltipContentPane; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; @@ -95,6 +96,7 @@ public class PlotFactory { private static Map, Class> labelMap = new HashMap, Class>(); static { + labelMap.put(VanChartColumnPlot.class, VanChartColumnPlotLabelPane.class); labelMap.put(VanChartGaugePlot.class, VanChartGaugePlotLabelPane.class); labelMap.put(VanChartScatterPlot.class, VanChartScatterPlotLabelPane.class); labelMap.put(VanChartBubblePlot.class, VanChartScatterPlotLabelPane.class); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java index f06e7c1c7c..e1febb26b8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java @@ -114,8 +114,9 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { }; } - protected JPanel getLabelPositionPane(Component[][] comps, double[] row, double[] col) { - return TableLayoutHelper.createTableLayoutPane(comps, row, col); + // 仪表盘标签内无布局tab + protected JPanel getLabelLayoutPane(JPanel panel, String title) { + return panel; } protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java index bd1b9a1757..9bc21a0446 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java @@ -1,13 +1,15 @@ package com.fr.van.chart.designer.style.label; import com.fr.chart.chartattr.Plot; - +import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.attr.GaugeDetailStyle; import com.fr.plugin.chart.base.AttrLabel; +import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.design.i18n.Toolkit; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -18,6 +20,9 @@ import java.awt.BorderLayout; public class VanChartGaugePlotLabelPane extends VanChartPlotLabelPane { private static final long serialVersionUID = -322148616244458359L; + private UIButtonGroup orientation; + private JPanel layoutPane; + private VanChartPlotLabelDetailPane gaugeValueLabelPane; public VanChartGaugePlotLabelPane(Plot plot, VanChartStylePane parent) { @@ -41,23 +46,65 @@ public class VanChartGaugePlotLabelPane extends VanChartPlotLabelPane { } JPanel cateOrPercentPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(cateTitle, getLabelDetailPane()); JPanel valuePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(valueTitle, gaugeValueLabelPane); + + layoutPane = createGaugeLabelLayoutPane(); + getLabelPane().add(cateOrPercentPane, BorderLayout.NORTH); - getLabelPane().add(valuePane, BorderLayout.SOUTH); + getLabelPane().add(valuePane, BorderLayout.CENTER); + getLabelPane().add(layoutPane, BorderLayout.SOUTH); + + checkLayoutPaneVisible(); + } + + private void checkLayoutPaneVisible() { + layoutPane.setVisible(showLayoutPane()); + } + + private boolean showLayoutPane() { + VanChartGaugePlot plot = (VanChartGaugePlot) this.getPlot(); + GaugeDetailStyle gaugeDetailStyle = plot.getGaugeDetailStyle(); + + return plot.getGaugeStyle() == GaugeStyle.THERMOMETER && gaugeDetailStyle != null && gaugeDetailStyle.isHorizontalLayout(); + } + + // 试管仪表盘横行布局时,正常标签外增加布局tab,同时控制百分比和值标签的文本方向 + private JPanel createGaugeLabelLayoutPane() { + orientation = new UIButtonGroup<>(new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), + Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), + }); + + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Text_Orientation"), orientation); + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Form_Attr_Layout"), panel); } public void populate(AttrLabel attr) { super.populate(attr); if(gaugeValueLabelPane != null && attr != null){ - gaugeValueLabelPane.populate(attr.getGaugeValueLabelDetail()); + AttrLabelDetail labelDetail = attr.getGaugeValueLabelDetail(); + gaugeValueLabelPane.populate(labelDetail); + orientation.setSelectedIndex(labelDetail.isHorizontal() ? 0 : 1); + + checkLayoutPaneVisible(); } } public AttrLabel update() { AttrLabel attrLabel = super.update(); + if(gaugeValueLabelPane != null && attrLabel != null){ - gaugeValueLabelPane.update(attrLabel.getGaugeValueLabelDetail()); + AttrLabelDetail defaultLabelDetail = attrLabel.getAttrLabelDetail(); + AttrLabelDetail valueLabelDetail = attrLabel.getGaugeValueLabelDetail(); + + gaugeValueLabelPane.update(valueLabelDetail); + + boolean horizontal = orientation.getSelectedIndex() == 0; + defaultLabelDetail.setHorizontal(horizontal); + valueLabelDetail.setHorizontal(horizontal); } + return attrLabel; } } 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 576d0211c8..253a6f8322 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 @@ -28,9 +28,6 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; /** * Created by Mitisky on 15/12/7. @@ -42,6 +39,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { private UIButtonGroup position; private UIButtonGroup autoAdjust; + private UIButtonGroup orientation; private UIToggleButton tractionLine; private ColorSelectBox backgroundColor; @@ -157,8 +155,11 @@ public class VanChartPlotLabelDetailPane extends BasicPane { positionPane = new JPanel(); checkPositionPane(title); - panel.add(positionPane, BorderLayout.CENTER); + panel.add(positionPane, BorderLayout.NORTH); + if (hasLabelOrientationPane()) { + panel.add(createLabelOrientationPane(), BorderLayout.CENTER); + } if (plot.isSupportLeadLine()) { tractionLine = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Show_Guideline")); @@ -168,7 +169,25 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) { panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust"), autoAdjust), BorderLayout.SOUTH); } - return panel; + + return getLabelLayoutPane(panel, Toolkit.i18nText("Fine-Design_Form_Attr_Layout")); + } + + protected JPanel getLabelLayoutPane(JPanel panel, String title) { + return createTableLayoutPaneWithTitle(title, panel); + } + + protected boolean hasLabelOrientationPane() { + return false; + } + + private JPanel createLabelOrientationPane() { + orientation = new UIButtonGroup<>(new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), + Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), + }); + + return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Text_Orientation"), orientation); } protected void checkPositionPane(String title) { @@ -205,13 +224,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } } - protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ - JPanel panel = TableLayoutHelper.createTableLayoutPane(comps,row,col); - return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Form_Attr_Layout"), panel); + return TableLayoutHelper.createTableLayoutPane(comps, row, col); } - protected void initPositionListener() { position.addChangeListener(new ChangeListener() { @Override @@ -267,11 +283,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if(position != null){ position.setSelectedItem(detail.getPosition()); } + if(orientation != null){ + orientation.setSelectedIndex(detail.isHorizontal() ? 0 : 1); + } if(tractionLine != null){ tractionLine.setSelected(detail.isShowGuidLine()); } if(autoAdjust != null){ - autoAdjust.setSelectedIndex(detail.isAutoAdjust() == true ? 0 : 1); + autoAdjust.setSelectedIndex(detail.isAutoAdjust() ? 0 : 1); } if(backgroundColor != null){ @@ -294,6 +313,9 @@ public class VanChartPlotLabelDetailPane extends BasicPane { detail.setAutoAdjust(autoAdjust != null && autoAdjust.getSelectedItem()); + if(orientation != null){ + detail.setHorizontal(orientation.getSelectedIndex() == 0); + } if(tractionLine != null){ detail.setShowGuidLine(tractionLine.isSelected() && detail.getPosition() == Constants.OUTSIDE); } From 5b952eb12466b5ce65a4be0118a9c3a5d713fce4 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 22 Sep 2020 15:22:52 +0800 Subject: [PATCH 03/32] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=BE=B9=E6=A1=86=E5=92=8C=E8=83=8C=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/PlotFactory.java | 18 +++++- .../label/VanChartPlotLabelDetailPane.java | 61 +++++++++++++++++-- 2 files changed, 73 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java index b518b1ec86..9ea26a5c5b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java @@ -7,6 +7,7 @@ import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.style.FormatPane; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.plugin.chart.area.VanChartAreaPlot; import com.fr.plugin.chart.bubble.VanChartBubblePlot; import com.fr.plugin.chart.column.VanChartColumnPlot; @@ -77,7 +78,7 @@ import java.util.Set; */ public class PlotFactory { - private static Set> autoAdjustLabelPlots = new HashSet>(); + private static Set> autoAdjustLabelPlots = new HashSet<>(); static { autoAdjustLabelPlots.add(VanChartColumnPlot.class); @@ -90,10 +91,23 @@ public class PlotFactory { return autoAdjustLabelPlots.contains(plot.getClass()); } + private static Set> borderAndBackgroundLabelPlots = new HashSet<>(); + + static { + borderAndBackgroundLabelPlots.add(PiePlot4VanChart.class); + borderAndBackgroundLabelPlots.add(VanChartColumnPlot.class); + borderAndBackgroundLabelPlots.add(VanChartLinePlot.class); + borderAndBackgroundLabelPlots.add(VanChartAreaPlot.class); + } + + public static boolean hasBorderAndBackgroundPlotLabel(Plot plot) { + return borderAndBackgroundLabelPlots.contains(plot.getClass()); + } + /** * 标签Map */ - private static Map, Class> labelMap = new HashMap, Class>(); + private static Map, Class> labelMap = new HashMap<>(); static { labelMap.put(VanChartColumnPlot.class, VanChartColumnPlotLabelPane.class); 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 253a6f8322..b159af7558 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 @@ -20,6 +20,8 @@ import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.stable.Constants; import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; +import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -43,6 +45,8 @@ public class VanChartPlotLabelDetailPane extends BasicPane { private UIToggleButton tractionLine; private ColorSelectBox backgroundColor; + private VanChartBorderWithRadiusPane borderPane; + private VanChartBackgroundWithOutImagePane backgroundPane; private JPanel tractionLinePane; private JPanel positionPane; @@ -98,15 +102,48 @@ public class VanChartPlotLabelDetailPane extends BasicPane { protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { if(hasLabelPosition(plot)){ + + // 仅饼图、柱形图、条形图、折线图、面积图含有边框和背景 + if (hasBorderAndBackground(plot)) { + return new Component[][]{ + new Component[]{dataLabelContentPane,null}, + new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null}, + new Component[]{createLabelBorderPane(), null}, + new Component[]{createLabelBackgroundPane(), null} + }; + } + return new Component[][]{ new Component[]{dataLabelContentPane,null}, new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null} }; - } else { - return new Component[][]{ - new Component[]{dataLabelContentPane,null} - }; } + + return new Component[][]{ + new Component[]{dataLabelContentPane,null} + }; + } + + private JPanel createLabelBorderPane() { + borderPane = new VanChartBorderWithRadiusPane(); + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); + } + + private JPanel createLabelBackgroundPane() { + backgroundPane = new VanChartBackgroundWithOutImagePane(){ + + protected Component[][] getPaneComponents() { + return new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox}, + new Component[]{null, centerPane}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent}, + }; + } + }; + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane); } protected double[] getLabelStyleRowSize(double p) { @@ -121,6 +158,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return plot instanceof VanChartLabelPositionPlot; } + private boolean hasBorderAndBackground(Plot plot) { + return PlotFactory.hasBorderAndBackgroundPlotLabel(plot); + } + protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel); } @@ -296,6 +337,12 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if(backgroundColor != null){ backgroundColor.setSelectObject(detail.getBackgroundColor()); } + if(borderPane != null){ + borderPane.populate(detail.getGeneralInfo()); + } + if(backgroundPane != null){ + backgroundPane.populate(detail.getGeneralInfo()); + } checkAllUse(); } @@ -322,6 +369,12 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if(backgroundColor != null){ detail.setBackgroundColor(backgroundColor.getSelectObject()); } + if(borderPane != null){ + borderPane.update(detail.getGeneralInfo()); + } + if(backgroundPane != null){ + backgroundPane.update(detail.getGeneralInfo()); + } } } From 41c033b948b7a09d1d0e5cafad27615f8b2ed43f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 22 Sep 2020 16:06:38 +0800 Subject: [PATCH 04/32] =?UTF-8?q?CHART-15704=20=E8=AF=95=E7=AE=A1=E5=9E=8B?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E7=9B=98=E6=A0=87=E7=AD=BE=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=8A=8A=E6=89=80=E6=9C=89=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E9=83=BD=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../label/VanChartGaugeCateOrPercentLabelDetailPane.java | 2 +- .../designer/style/label/VanChartGaugeLabelDetailPane.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java index 292dcbfa47..9a5c453828 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java @@ -22,7 +22,7 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe } protected double[] getLabelPaneRowSize(Plot plot, double p) { - if (hasLabelAlign(plot)) { + if (hasLabelAlignPane()) { return new double[]{p, p, p, p}; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java index f06e7c1c7c..0921b6d628 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java @@ -123,7 +123,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { } protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { - if (hasLabelAlign(plot)) { + if (hasLabelAlignPane()) { return new Component[][]{ new Component[]{getDataLabelContentPane(), null}, @@ -222,6 +222,10 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { return getGaugeStyle() == GaugeStyle.THERMOMETER && !((VanChartGaugePlot) plot).getGaugeDetailStyle().isHorizontalLayout(); } + protected boolean hasLabelAlignPane() { + return getGaugeStyle() == GaugeStyle.THERMOMETER; + } + public void populate(AttrLabelDetail detail) { super.populate(detail); From 17534e63dc2efb7d965c8686e984f8667d3aad16 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 22 Sep 2020 16:55:31 +0800 Subject: [PATCH 05/32] =?UTF-8?q?REPORT-39601=20=E5=9C=A8=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E4=B8=AD=E6=8F=92=E5=85=A5=20=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E3=80=82=20=E5=AD=97=E4=BD=93=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=BA14=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=BB=99=E6=88=91=E5=8F=98=E6=88=9013?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/cell/editor/RichTextToolBar.java | 5 +- .../cell/editor/RichTextToolBarTest.java | 69 +++++++++++++++++++ 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 designer-realize/src/test/java/com/fr/design/cell/editor/RichTextToolBarTest.java diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java index a8f4b2ac1a..fb904e2190 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java @@ -502,14 +502,15 @@ public class RichTextToolBar extends BasicPane{ //pt转为px =*4/3 private int scaleUp(int fontSize) { - return (int) FontTransformUtil.pt2px(fontSize); + return roundUp(FontTransformUtil.pt2px(fontSize)); } //px转pt = *3/4 private int scaleDown(int fontSize) { - return (int) FontTransformUtil.px2pt(fontSize); + return roundUp(FontTransformUtil.px2pt(fontSize)); } + private DocumentListener inputListener = new DocumentListener() { @Override diff --git a/designer-realize/src/test/java/com/fr/design/cell/editor/RichTextToolBarTest.java b/designer-realize/src/test/java/com/fr/design/cell/editor/RichTextToolBarTest.java new file mode 100644 index 0000000000..7cae136d7d --- /dev/null +++ b/designer-realize/src/test/java/com/fr/design/cell/editor/RichTextToolBarTest.java @@ -0,0 +1,69 @@ +package com.fr.design.cell.editor; + +import com.fr.invoke.Reflect; +import org.easymock.EasyMock; +import org.junit.Assert; +import org.junit.Test; + +/** + * Created by kerry on 2020-09-21 + */ +public class RichTextToolBarTest { + @Test + public void testScaleUpAndDown() { + RichTextToolBar textToolBar = EasyMock.mock(RichTextToolBar.class); + + int result = Reflect.on(textToolBar).call("scaleUp", 10).get(); + Assert.assertEquals(13, result); + result = Reflect.on(textToolBar).call("scaleDown", 13).get(); + Assert.assertEquals(10, result); + + result = Reflect.on(textToolBar).call("scaleUp", 11).get(); + Assert.assertEquals(15, result); + result = Reflect.on(textToolBar).call("scaleDown", 15).get(); + Assert.assertEquals(11, result); + + result = Reflect.on(textToolBar).call("scaleUp", 12).get(); + Assert.assertEquals(16, result); + result = Reflect.on(textToolBar).call("scaleDown", 16).get(); + Assert.assertEquals(12, result); + + + result = Reflect.on(textToolBar).call("scaleUp", 13).get(); + Assert.assertEquals(17, result); + result = Reflect.on(textToolBar).call("scaleDown", 17).get(); + Assert.assertEquals(13, result); + + result = Reflect.on(textToolBar).call("scaleUp", 14).get(); + Assert.assertEquals(19, result); + result = Reflect.on(textToolBar).call("scaleDown", 19).get(); + Assert.assertEquals(14, result); + + result = Reflect.on(textToolBar).call("scaleUp", 16).get(); + Assert.assertEquals(21, result); + result = Reflect.on(textToolBar).call("scaleDown", 21).get(); + Assert.assertEquals(16, result); + + + result = Reflect.on(textToolBar).call("scaleUp", 17).get(); + Assert.assertEquals(23, result); + result = Reflect.on(textToolBar).call("scaleDown", 23).get(); + Assert.assertEquals(17, result); + + result = Reflect.on(textToolBar).call("scaleUp", 17).get(); + Assert.assertEquals(23, result); + result = Reflect.on(textToolBar).call("scaleDown", 23).get(); + Assert.assertEquals(17, result); + + result = Reflect.on(textToolBar).call("scaleUp", 19).get(); + Assert.assertEquals(25, result); + result = Reflect.on(textToolBar).call("scaleDown", 25).get(); + Assert.assertEquals(19, result); + + result = Reflect.on(textToolBar).call("scaleUp", 20).get(); + Assert.assertEquals(27, result); + result = Reflect.on(textToolBar).call("scaleDown", 27).get(); + Assert.assertEquals(20, result); + } + +} From 820b3b9edcb6144c77809e0e9ecc7e6b9eba3f3c Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 22 Sep 2020 17:48:18 +0800 Subject: [PATCH 06/32] =?UTF-8?q?REPORT-38376=20JDK11=E4=B8=8BLabel?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=96=87=E5=AD=97=E6=98=BE=E7=A4=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/utils/DesignUtils.java | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 2bf64642f2..f443a10ecf 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -19,10 +19,10 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.CommonCodeUtils; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import com.fr.stable.os.OperatingSystem; import com.fr.start.ServerStarter; import com.fr.workspace.WorkContext; -import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; import java.awt.Desktop; @@ -31,7 +31,6 @@ import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; @@ -83,6 +82,7 @@ public class DesignUtils { /** * 判断设计器端口是否被其他程序占用 * 尝试去通信,无回应就是其他程序占用端口,否则需要继续判断是否为设计器进程未关闭 + * * @return */ public static boolean isPortOccupied() { @@ -153,7 +153,7 @@ public class DesignUtils { return; } try (Socket socket = new Socket("localhost", port)) { - clientSend(lines, socket); + clientSend(lines, socket); } catch (Exception ignore) { } @@ -189,10 +189,10 @@ public class DesignUtils { DesignerEnvManager.getEnvManager().setCurrentEnv2Default(); ServerStarter.browserDemoURL(); } else if ("check".equals(line)) { - clientSend(new String[] {"response"}, socket); + clientSend(new String[]{"response"}, socket); } else if ("end".equals(line)) { - DesignerExiter.getInstance().execute(); } - else if (StringUtils.isNotEmpty(line)) { + DesignerExiter.getInstance().execute(); + } else if (StringUtils.isNotEmpty(line)) { File f = new File(line); String path = f.getAbsolutePath(); @@ -219,7 +219,7 @@ public class DesignUtils { } - public static void responseToClient(Socket socket) { + public static void responseToClient(Socket socket) { try (OutputStream outputStream = socket.getOutputStream()) { outputStream.write("reponse".getBytes(StandardCharsets.UTF_8)); outputStream.flush(); @@ -285,13 +285,20 @@ public class DesignUtils { return key.startsWith("TextField.") || key.startsWith("PasswordField."); } + /** + * 获取当前系统语言下设计器用的默认字体 + * + * @return 默认字体 + */ private static FRFont getCurrentLocaleFont() { FRFont guiFRFont; Locale defaultLocale = Locale.getDefault(); - - if (isDisplaySimSun(defaultLocale)) { + // JDK9 之后宋体在计算label中字母的空间上出现问题,暂时先用雅黑兼容,以后再统一字体 + if (StableUtils.getMajorJavaVersion() >= 9 && OperatingSystem.isWindows()) { + guiFRFont = getNamedFont("Microsoft YaHei"); + } else if (isDisplaySimSun(defaultLocale)) { guiFRFont = getNamedFont("SimSun"); - } else { + } else { guiFRFont = getNamedFont("Dialog"); } From 22ad83f2e74a1b2061d2e07884dd598cb5ccbd26 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 09:36:58 +0800 Subject: [PATCH 07/32] =?UTF-8?q?REPORT-39338=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E5=86=85=E7=BD=AE=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E8=BF=9B=E5=BA=A6=E6=9D=A1=E4=BC=9A=E5=85=88?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E4=B8=8A=E6=AC=A1=E7=9A=84=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=E5=86=8D=E5=88=9D=E5=A7=8B=E5=8C=96=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B9=E6=A1=88=EF=BC=9A=E4=B8=8D=E6=94=B9?= =?UTF-8?q?=E5=8F=98=E5=BC=B9=E7=AA=97=E5=A4=A7=E5=B0=8F=EF=BC=8C=E5=B0=86?= =?UTF-8?q?=E5=8E=9F=E6=9C=AC=E6=96=87=E5=AD=97=E6=A0=87=E7=AD=BEsetPrefer?= =?UTF-8?q?redSize=E6=B3=A8=E9=87=8A=E6=8E=89=EF=BC=8C=E5=9C=A8FlowLayout?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E4=B8=8B=EF=BC=8C=E6=A0=87=E7=AD=BE=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E4=BC=9A=E8=87=AA=E9=80=82=E5=BA=94=EF=BC=8C=E5=8F=A6?= =?UTF-8?q?=E5=A4=96=E6=B5=8B=E8=AF=95=E7=9A=84=E6=97=B6=E5=80=99=E5=8F=91?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E6=97=A5=E8=AF=AD=E5=92=8C=E9=9F=A9=E8=AF=AD?= =?UTF-8?q?=E4=B8=8B=E6=96=87=E5=AD=97=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= =?UTF-8?q?=EF=BC=8C=E8=BF=99=E6=98=AF=E4=B8=AA=E4=BB=A5=E5=89=8D=E5=B0=B1?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C=E4=B8=8E?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=92=8C=E5=9B=BD=E9=99=85=E5=8C=96=E5=90=8C?= =?UTF-8?q?=E5=AD=A6=E6=B2=9F=E9=80=9A=E4=BA=86=EF=BC=8C=E7=B2=BE=E7=AE=80?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=EF=BC=8C=E8=BF=99=E6=AC=A1=E9=A1=BA=E4=BE=BF?= =?UTF-8?q?=E4=B8=80=E8=B5=B7=E6=94=B9=E4=BA=86=20CHART-15905=20=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=9A=84release=E6=8F=92=E4=BB=B6=EF=BC=8C=E6=89=93?= =?UTF-8?q?=E5=BC=80cpt=E7=A9=BA=E7=99=BD=EF=BC=8C=E6=89=93=E5=BC=80frm?= =?UTF-8?q?=E7=9A=84=EF=BC=8C=E5=8F=B3=E4=BE=A7=E9=9D=A2=E6=9D=BF=E6=89=93?= =?UTF-8?q?=E4=B8=8D=E5=BC=80=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91=E4=B9=8B=E5=89=8D=E6=94=B9=E5=8A=A8=E7=9A=84?= =?UTF-8?q?UISpinner=EF=BC=8C=E6=B7=BB=E5=8A=A0=E4=BA=86=E4=B8=80=E7=A7=8D?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E4=B8=BAdouble=E3=80=81double=E3=80=81double?= =?UTF-8?q?=E3=80=81int=E7=9A=84=E6=9E=84=E9=80=A0=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=8C=E4=B8=8E=E5=8F=A6=E4=B8=80=E4=B8=AA=E5=8E=9F=E6=9C=89?= =?UTF-8?q?=E7=9A=84double=E3=80=81double=E3=80=81double=E3=80=81double?= =?UTF-8?q?=E5=86=B2=E7=AA=81=E4=BA=86=EF=BC=8C=E5=9B=A0=E4=B8=BA=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=86=85=E5=BE=88=E5=A4=9A=E5=9C=B0=E6=96=B9=E9=83=BD?= =?UTF-8?q?=E6=98=AF=E4=BC=A0=E4=BA=86=E5=9B=9B=E4=B8=AAint=E5=80=BC?= =?UTF-8?q?=E8=BF=9B=E6=9D=A5=EF=BC=8C=E7=84=B6=E5=90=8E=E8=A2=AB=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E4=BA=86=E6=96=B0=E6=B7=BB=E5=8A=A0=E7=9A=84=E9=82=A3?= =?UTF-8?q?=E7=A7=8D=E6=9E=84=E9=80=A0=E6=96=B9=E6=B3=95=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=B0=86=E6=96=B0?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9A=84=E6=9E=84=E9=80=A0=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E4=BF=AE=E6=94=B9=E4=B8=BAdouble=E3=80=81dou?= =?UTF-8?q?ble=E3=80=81double=E3=80=81double=E3=80=81int=EF=BC=8C=E5=AF=B9?= =?UTF-8?q?=E7=AC=AC=E5=9B=9B=E4=B8=AAdouble=E5=80=BC=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=8C=E5=A6=82=E6=9E=9C=E7=AD=89=E4=BA=8E?= =?UTF-8?q?Double.MIN=5FVALUE=EF=BC=8C=E5=B0=B1=E4=B8=8D=E5=81=9A=E5=A4=84?= =?UTF-8?q?=E7=90=86=EF=BC=8C=E5=90=A6=E5=88=99=E6=AD=A3=E5=B8=B8=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=BAdefaultValue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/ispinner/UISpinner.java | 13 ++++++++++++- .../mainframe/DesignerFrameFileDealerPane.java | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java index a418a2b37e..0d7c11ac4f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java @@ -56,9 +56,20 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver textField.setValue(defaultValue); } - public UISpinner(double minValue, double maxValue, double dierta, int numberFieldColumns) { + /** + * 为了避免跟上面的构造方法冲突,这边构造器接收五个参数,当传入defaultValue为Double.MIN_VALUE时,不设置默认值 + * @param minValue + * @param maxValue + * @param dierta + * @param defaultValue + * @param numberFieldColumns + */ + public UISpinner(double minValue, double maxValue, double dierta, double defaultValue, int numberFieldColumns) { this.numberFieldColumns = numberFieldColumns; init(minValue, maxValue, dierta); + if (defaultValue != Double.MIN_VALUE) { + textField.setValue(defaultValue); + } } private void init(double minValue, double maxValue, double dierta) { this.minValue = minValue; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index 86f73982f1..870853a45a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -556,7 +556,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt ); newNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); newNameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); - newNameLabel.setPreferredSize(new Dimension(118, 15)); + //newNameLabel.setPreferredSize(new Dimension(118, 15)); // 重命名输入框 nameField = new UITextField(oldName); @@ -649,7 +649,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt BorderLayout.CENTER); - this.setSize(380, 180); + this.setSize(340, 180); this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Rename")); this.setResizable(false); this.setAlwaysOnTop(true); From 2815e81223bbcaf3f391749876cc184341ebcd71 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 10:04:40 +0800 Subject: [PATCH 08/32] =?UTF-8?q?CHART-15905=20=E6=9B=B4=E6=96=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=96=B9=E6=A1=88=EF=BC=9A=E4=B9=8B=E5=89=8D=E4=BB=A5?= =?UTF-8?q?=E4=B8=BA=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BA=86UINumberField?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=EF=BC=8C=E4=B8=8D=E8=83=BD=E5=86=8D=E6=94=B9?= =?UTF-8?q?=E5=8F=98=E5=88=97=E6=95=B0=E4=BA=86=EF=BC=8C=E5=88=9A=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=BA=86=E4=B8=80=E4=B8=8B=E5=8F=91=E7=8E=B0=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E7=9A=84=EF=BC=8C=E6=89=80=E4=BB=A5=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=B7=BB=E5=8A=A0=E4=BA=86=E4=B8=80=E4=B8=AAset?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E5=8F=AF=E4=BB=A5=E4=BF=AE=E6=94=B9?= =?UTF-8?q?Spinner=E5=86=85=E7=9A=84UINumberField=E7=9A=84=E5=88=97?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tabledatapane/MaxMemRowCountPanel.java | 3 ++- .../com/fr/design/gui/ispinner/UISpinner.java | 22 ++++++------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java index 2df6cda02c..13fd60a60d 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java @@ -72,7 +72,8 @@ public class MaxMemRowCountPanel extends UIToolbar { this.setBackground(UIConstants.NORMAL_BACKGROUND); switchCache = new UIComboBox(CACHE_LIST); switchCache.addActionListener(switchStateL); - numberSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 4); + numberSpinner = new UISpinner(0, Integer.MAX_VALUE, 1); + numberSpinner.setNumberFieldColumns(4); } private void showAllPanel() { diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java index 0d7c11ac4f..c60ae27605 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java @@ -56,21 +56,6 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver textField.setValue(defaultValue); } - /** - * 为了避免跟上面的构造方法冲突,这边构造器接收五个参数,当传入defaultValue为Double.MIN_VALUE时,不设置默认值 - * @param minValue - * @param maxValue - * @param dierta - * @param defaultValue - * @param numberFieldColumns - */ - public UISpinner(double minValue, double maxValue, double dierta, double defaultValue, int numberFieldColumns) { - this.numberFieldColumns = numberFieldColumns; - init(minValue, maxValue, dierta); - if (defaultValue != Double.MIN_VALUE) { - textField.setValue(defaultValue); - } - } private void init(double minValue, double maxValue, double dierta) { this.minValue = minValue; this.maxValue = maxValue; @@ -180,6 +165,13 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver fireStateChanged(); } + /** + * 设置Spinner内的数字输入框列数 + * @param numberFieldColumns 输入框列数 + */ + public void setNumberFieldColumns(int numberFieldColumns) { + textField.setColumns(numberFieldColumns); + } public void setEnabled(boolean flag) { super.setEnabled(flag); From 4f8a3ef91f831f67b44398c61f3cbca27f09d897 Mon Sep 17 00:00:00 2001 From: "Jimmy.Zheng" Date: Wed, 23 Sep 2020 10:55:50 +0800 Subject: [PATCH 09/32] REPORT-38762 --- .../data/datapane/TreeTableDataComboBox.java | 11 ++++++++- .../design/gui/frpane/JTreeAutoBuildPane.java | 23 ++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java b/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java index 8b5c626571..8964ff8de0 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java @@ -69,7 +69,16 @@ public class TreeTableDataComboBox extends UIComboBox { } } } - + + /** + * 带参刷新方法 + * @param source 数据源数据集 + */ + public void refresh(TableDataSource source) { + this.source = source; + refresh(); + } + public void setSelectedTableDataByName(String name) { TableDataWrapper tableDataWrapper; if (res_map.get(name) != null) { diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java index 46cdae35bd..6103e68002 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java @@ -26,14 +26,14 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; - import com.fr.stable.StringUtils; - -import javax.swing.*; import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.List; +import javax.swing.*; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; public class JTreeAutoBuildPane extends BasicPane implements PreviewLabel.Previewable, EditOrNewLabel.Editable { private TreeTableDataComboBox treeTableDataComboBox; @@ -61,6 +61,23 @@ public class JTreeAutoBuildPane extends BasicPane implements PreviewLabel.Previe tdChange(); } }); + // REPORT-38762 加一个展开监听事件,下拉框展开时刷新一下数据集 + treeTableDataComboBox.addPopupMenuListener(new PopupMenuListener() { + @Override + public void popupMenuWillBecomeVisible(PopupMenuEvent e) { + treeTableDataComboBox.refresh(DesignTableDataManager.getEditingTableDataSource()); + } + + @Override + public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { + + } + + @Override + public void popupMenuCanceled(PopupMenuEvent e) { + + } + }); selectTreeDataPanel.add(treeTableDataComboBox); treeTableDataComboBox.setPreferredSize(new Dimension(200, 25)); treeTableDataComboBox.setSelectedIndex(-1); From 0336b6a964314730a6405cf0843d2af268b21c50 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 11:29:22 +0800 Subject: [PATCH 10/32] =?UTF-8?q?REPORT-40458=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E4=BB=A5=E5=90=8E=E4=BC=9A=E5=8D=A1=E4=BD=8F=EF=BC=8C=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E9=99=A4=E4=BA=86=E8=8F=9C=E5=8D=95=E6=A0=8F=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E9=83=BD=E5=8A=A8=E4=B8=8D=E4=BA=86=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91editingTemplate?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=88=A4=E7=A9=BA=EF=BC=8C=E5=BD=93=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=B7=B1=E6=B5=8B=E8=AF=95=E5=8F=91=E7=8E=B0=E6=98=AF?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E5=87=BA=E7=8E=B0null=E6=83=85=E5=86=B5?= =?UTF-8?q?=E7=9A=84=EF=BC=8C=E8=BF=99=E4=B8=AA=E9=97=AE=E9=A2=98=E6=98=AF?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E5=AE=89=E8=A3=85=E4=BA=86=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=96=B0=E5=BC=95=E6=93=8E=E6=8F=92=E4=BB=B6=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=82=A3=E8=BE=B9=E6=9F=90=E4=B8=AA=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=8F=AF=E8=83=BD=E4=BC=9A=E5=9C=A8setCurrentEditingT?= =?UTF-8?q?emplate=E4=B9=8B=E5=89=8D=EF=BC=8C=E8=B0=83=E7=94=A8checkCombin?= =?UTF-8?q?eUp=E6=96=B9=E6=B3=95=EF=BC=8C=E6=AD=A4=E6=97=B6getCurrentEditi?= =?UTF-8?q?ngTemplate=E4=BC=9A=E6=8B=BF=E5=88=B0null=E5=80=BC=EF=BC=8C?= =?UTF-8?q?=E7=84=B6=E5=90=8E=E5=87=BA=E7=8E=B0npe=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=A2=9E=E5=8A=A0=E5=88=A4?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/connect/JDBCDefPane.java | 1 + .../ipasswordfield/UIPasswordFieldWithFixedLength.java | 2 +- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 8 +++++--- .../main/java/com/fr/design/mainframe/TopXCreators.java | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 683b38e016..8f26ec8c32 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -8,6 +8,7 @@ import com.fr.design.border.UITitledBorder; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ipasswordfield.UIPassWordField; import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.ilable.ActionLabel; diff --git a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java index c1cb98ca3d..6fdace66a9 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java +++ b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java @@ -77,7 +77,7 @@ public class UIPasswordFieldWithFixedLength extends UIPassWordField { if (clearPassword) { UIPasswordFieldWithFixedLength.this.setText(StringUtils.EMPTY); UIPasswordFieldWithFixedLength.this.clearPassword = false; - UIPasswordFieldWithFixedLength.this.updateUI(); + //UIPasswordFieldWithFixedLength.this.updateUI(); } } }); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index fe0276b384..92d06d0b5e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -746,10 +746,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ public void checkCombineUp(boolean flag, ArrayList al) { //Yvan: 检查当前是否为WORK_SHEET状态,因为只有WORK_SHEET中含有格式刷组件,此时是不需要进行checkComponentsByNames的 - if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getMenuState() == DesignState.WORK_SHEET) { - return; + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (jTemplate != null) { + if (jTemplate.getMenuState() != DesignState.WORK_SHEET) { + combineUp.checkComponentsByNames(flag, al); + } } - combineUp.checkComponentsByNames(flag, al); } /** diff --git a/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java b/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java index 89b261bb9a..eef16f80b0 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java @@ -78,5 +78,6 @@ public class TopXCreators extends JComponent { TopXCreator topXCreator = (TopXCreator) getComponent(i); topXCreator.resizeTopXCreator(); } + //repaint(); } } From f3c2c203a860e1d06f748fdf5c9415e497bce178 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 23 Sep 2020 11:34:46 +0800 Subject: [PATCH 11/32] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E8=BE=B9=E6=A1=86?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BD=A2=E7=8A=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/border/VanChartBorderPane.java | 14 +++-- .../border/VanChartBorderWithRadiusPane.java | 12 ++-- .../border/VanChartBorderWithShapePane.java | 58 +++++++++++++++++++ .../label/VanChartPlotLabelDetailPane.java | 17 +++--- 4 files changed, 83 insertions(+), 18 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java index 478929662d..4514e39b9c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java @@ -6,6 +6,7 @@ import com.fr.chart.chartglyph.GeneralInfo; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.style.color.ColorSelectBox; import com.fr.design.utils.gui.UIComponentUtils; @@ -30,20 +31,18 @@ public class VanChartBorderPane extends BasicPane { protected void initComponents() { currentLineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); currentLineColorPane = new ColorSelectBox(100); - double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double[] columnSize = {f, e}; - double[] rowSize = {p, p, p, p}; Component[][] components = getUseComponent(); - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, getRowSize(), columnSize); this.setLayout(new BorderLayout()); this.add(panel,BorderLayout.CENTER); } protected Component[][] getUseComponent() { - UILabel lineStyleLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")); - UILabel colorLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")); + UILabel lineStyleLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")); + UILabel colorLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Color")); return new Component[][]{ new Component[]{null,null}, @@ -52,6 +51,11 @@ public class VanChartBorderPane extends BasicPane { }; } + protected double[] getRowSize() { + double p = TableLayout.PREFERRED; + return new double[]{p, p, p, p}; + } + /** * 标题 * @return 标题 diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java index 63eff90477..fabf1e669c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java @@ -4,10 +4,10 @@ import com.fr.chart.base.AttrBorder; import com.fr.chart.chartglyph.GeneralInfo; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.i18n.Toolkit; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; - import javax.swing.JSeparator; import java.awt.BorderLayout; import java.awt.Component; @@ -19,6 +19,10 @@ public class VanChartBorderWithRadiusPane extends VanChartBorderPane { private static final long serialVersionUID = -3937853702118283803L; private UISpinner radius; + public UISpinner getRadius() { + return radius; + } + @Override protected void initComponents() { radius = new UISpinner(0,1000,1,0); @@ -31,11 +35,11 @@ public class VanChartBorderWithRadiusPane extends VanChartBorderPane { return new Component[][]{ new Component[]{null,null}, new Component[]{ - FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")), + FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo) }, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),currentLineColorPane}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")),radius} + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")),currentLineColorPane}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")),radius} } ; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java new file mode 100644 index 0000000000..5361495872 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java @@ -0,0 +1,58 @@ +package com.fr.van.chart.designer.component.border; + +import com.fr.chart.base.AttrBorder; +import com.fr.chart.chartglyph.Marker; +import com.fr.chart.chartglyph.MarkerFactory; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.xcombox.MarkerComboBox; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.utils.gui.UIComponentUtils; +import com.fr.design.widget.FRWidgetFactory; +import com.fr.plugin.chart.base.AttrBorderWithShape; +import com.fr.plugin.chart.marker.type.MarkerType; + +import java.awt.Component; + +public class VanChartBorderWithShapePane extends VanChartBorderWithRadiusPane { + + private MarkerComboBox shapePane; + + protected void initComponents() { + shapePane = new MarkerComboBox(MarkerFactory.getLabelShapeMarkers()); + super.initComponents(); + } + + protected Component[][] getUseComponent() { + return new Component[][]{ + new Component[]{null, null}, + new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), + UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo)}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), currentLineColorPane}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Shape")), + UIComponentUtils.wrapWithBorderLayoutPane(shapePane)}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")), getRadius()} + }; + } + + protected double[] getRowSize() { + double p = TableLayout.PREFERRED; + return new double[]{p, p, p, p, p}; + } + + public void populate(AttrBorder border) { + super.populate(border); + + if (border instanceof AttrBorderWithShape) { + shapePane.setSelectedMarker((Marker.createMarker(((AttrBorderWithShape) border).getShape()))); + } + } + + public void update(AttrBorder border) { + super.update(border); + + if (border instanceof AttrBorderWithShape) { + ((AttrBorderWithShape) border).setShape(MarkerType.parse(shapePane.getSelectedMarkder().getMarkerType())); + } + } +} 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 b159af7558..22f8ace786 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 @@ -7,12 +7,11 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.style.color.ColorSelectBox; -import com.fr.design.i18n.Toolkit; - import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.attr.plot.VanChartLabelPositionPlot; import com.fr.plugin.chart.base.AttrLabelDetail; @@ -21,7 +20,7 @@ import com.fr.stable.Constants; import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; -import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; +import com.fr.van.chart.designer.component.border.VanChartBorderWithShapePane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -45,7 +44,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { private UIToggleButton tractionLine; private ColorSelectBox backgroundColor; - private VanChartBorderWithRadiusPane borderPane; + private VanChartBorderWithShapePane borderPane; private VanChartBackgroundWithOutImagePane backgroundPane; private JPanel tractionLinePane; @@ -125,7 +124,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } private JPanel createLabelBorderPane() { - borderPane = new VanChartBorderWithRadiusPane(); + borderPane = new VanChartBorderWithShapePane(); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); } @@ -338,10 +337,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { backgroundColor.setSelectObject(detail.getBackgroundColor()); } if(borderPane != null){ - borderPane.populate(detail.getGeneralInfo()); + borderPane.populate(detail.getBorder()); } if(backgroundPane != null){ - backgroundPane.populate(detail.getGeneralInfo()); + backgroundPane.populate(detail.getBackground()); } checkAllUse(); @@ -370,10 +369,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { detail.setBackgroundColor(backgroundColor.getSelectObject()); } if(borderPane != null){ - borderPane.update(detail.getGeneralInfo()); + borderPane.update(detail.getBorder()); } if(backgroundPane != null){ - backgroundPane.update(detail.getGeneralInfo()); + backgroundPane.update(detail.getBackground()); } } From 380c24445044f36e754e0dc3e7582adc3667c753 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 11:41:18 +0800 Subject: [PATCH 12/32] =?UTF-8?q?REPORT-40458=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E4=BB=A5=E5=90=8E=E4=BC=9A=E5=8D=A1=E4=BD=8F=EF=BC=8C=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E9=99=A4=E4=BA=86=E8=8F=9C=E5=8D=95=E6=A0=8F=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E9=83=BD=E5=8A=A8=E4=B8=8D=E4=BA=86=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91editingTemplate?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=88=A4=E7=A9=BA=EF=BC=8C=E5=BD=93=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=B7=B1=E6=B5=8B=E8=AF=95=E5=8F=91=E7=8E=B0=E6=98=AF?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E5=87=BA=E7=8E=B0null=E6=83=85=E5=86=B5?= =?UTF-8?q?=E7=9A=84=EF=BC=8C=E8=BF=99=E4=B8=AA=E9=97=AE=E9=A2=98=E6=98=AF?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E5=AE=89=E8=A3=85=E4=BA=86=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=96=B0=E5=BC=95=E6=93=8E=E6=8F=92=E4=BB=B6=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=82=A3=E8=BE=B9=E6=9F=90=E4=B8=AA=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=8F=AF=E8=83=BD=E4=BC=9A=E5=9C=A8setCurrentEditingT?= =?UTF-8?q?emplate=E4=B9=8B=E5=89=8D=EF=BC=8C=E8=B0=83=E7=94=A8checkCombin?= =?UTF-8?q?eUp=E6=96=B9=E6=B3=95=EF=BC=8C=E6=AD=A4=E6=97=B6getCurrentEditi?= =?UTF-8?q?ngTemplate=E4=BC=9A=E6=8B=BF=E5=88=B0null=E5=80=BC=EF=BC=8C?= =?UTF-8?q?=E7=84=B6=E5=90=8E=E5=87=BA=E7=8E=B0npe=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=A2=9E=E5=8A=A0=E5=88=A4?= =?UTF-8?q?=E7=A9=BA"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 92d06d0b5e..fe0276b384 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -746,12 +746,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ public void checkCombineUp(boolean flag, ArrayList al) { //Yvan: 检查当前是否为WORK_SHEET状态,因为只有WORK_SHEET中含有格式刷组件,此时是不需要进行checkComponentsByNames的 - JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - if (jTemplate != null) { - if (jTemplate.getMenuState() != DesignState.WORK_SHEET) { - combineUp.checkComponentsByNames(flag, al); - } + if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getMenuState() == DesignState.WORK_SHEET) { + return; } + combineUp.checkComponentsByNames(flag, al); } /** From e33f5214efdbcd3f2d204cd43466920b92169283 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 11:52:40 +0800 Subject: [PATCH 13/32] =?UTF-8?q?=E4=B9=8B=E5=89=8D=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=A4=9A=E4=BA=86=EF=BC=8C=E6=92=A4=E9=94=80=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/datapane/connect/JDBCDefPane.java | 1 - .../gui/ipasswordfield/UIPasswordFieldWithFixedLength.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 8f26ec8c32..683b38e016 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -8,7 +8,6 @@ import com.fr.design.border.UITitledBorder; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ipasswordfield.UIPassWordField; import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.ilable.ActionLabel; diff --git a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java index 6fdace66a9..c1cb98ca3d 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java +++ b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java @@ -77,7 +77,7 @@ public class UIPasswordFieldWithFixedLength extends UIPassWordField { if (clearPassword) { UIPasswordFieldWithFixedLength.this.setText(StringUtils.EMPTY); UIPasswordFieldWithFixedLength.this.clearPassword = false; - //UIPasswordFieldWithFixedLength.this.updateUI(); + UIPasswordFieldWithFixedLength.this.updateUI(); } } }); From e410f10bf07156a502ac7a763790c0dc85322183 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 11:53:19 +0800 Subject: [PATCH 14/32] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=A4=9A=E4=BA=86?= =?UTF-8?q?=EF=BC=8C=E6=92=A4=E9=94=80=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/TopXCreators.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java b/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java index eef16f80b0..89b261bb9a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/TopXCreators.java @@ -78,6 +78,5 @@ public class TopXCreators extends JComponent { TopXCreator topXCreator = (TopXCreator) getComponent(i); topXCreator.resizeTopXCreator(); } - //repaint(); } } From 67d94534628c0c90aceed4badcf4b6db75c1b79e Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 12:31:53 +0800 Subject: [PATCH 15/32] =?UTF-8?q?REPORT-40458=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E4=BB=A5=E5=90=8E=E4=BC=9A=E5=8D=A1=E4=BD=8F=EF=BC=8C=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E9=99=A4=E4=BA=86=E8=8F=9C=E5=8D=95=E6=A0=8F=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E9=83=BD=E5=8A=A8=E4=B8=8D=E4=BA=86=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91editingTemplate?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=88=A4=E7=A9=BA=EF=BC=8C=E5=BD=93=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=B7=B1=E6=B5=8B=E8=AF=95=E5=8F=91=E7=8E=B0=E6=98=AF?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E5=87=BA=E7=8E=B0null=E6=83=85=E5=86=B5?= =?UTF-8?q?=E7=9A=84=EF=BC=8C=E8=BF=99=E4=B8=AA=E9=97=AE=E9=A2=98=E6=98=AF?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E5=AE=89=E8=A3=85=E4=BA=86=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=96=B0=E5=BC=95=E6=93=8E=E6=8F=92=E4=BB=B6=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=82=A3=E8=BE=B9=E6=9F=90=E4=B8=AA=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=8F=AF=E8=83=BD=E4=BC=9A=E5=9C=A8setCurrentEditingT?= =?UTF-8?q?emplate=E4=B9=8B=E5=89=8D=EF=BC=8C=E8=B0=83=E7=94=A8checkCombin?= =?UTF-8?q?eUp=E6=96=B9=E6=B3=95=EF=BC=8C=E6=AD=A4=E6=97=B6getCurrentEditi?= =?UTF-8?q?ngTemplate=E4=BC=9A=E6=8B=BF=E5=88=B0null=E5=80=BC=EF=BC=8C?= =?UTF-8?q?=E7=84=B6=E5=90=8E=E5=87=BA=E7=8E=B0npe=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=A2=9E=E5=8A=A0=E5=88=A4?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index fe0276b384..92d06d0b5e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -746,10 +746,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ public void checkCombineUp(boolean flag, ArrayList al) { //Yvan: 检查当前是否为WORK_SHEET状态,因为只有WORK_SHEET中含有格式刷组件,此时是不需要进行checkComponentsByNames的 - if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getMenuState() == DesignState.WORK_SHEET) { - return; + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (jTemplate != null) { + if (jTemplate.getMenuState() != DesignState.WORK_SHEET) { + combineUp.checkComponentsByNames(flag, al); + } } - combineUp.checkComponentsByNames(flag, al); } /** From 12abfe93d64c1612bfc61ab26709a09bed5a5974 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 23 Sep 2020 15:40:09 +0800 Subject: [PATCH 16/32] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E7=BB=84=E4=BB=B6=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/editor/rich_editor.css | 22 +++++++++++++++++++ .../com/fr/design/editor/rich_editor.html | 1 + 2 files changed, 23 insertions(+) create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/rich_editor.css diff --git a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.css b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.css new file mode 100644 index 0000000000..27eb74d9b2 --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.css @@ -0,0 +1,22 @@ +.editor-insert-param-inactivated-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.editor-insert-param-inactivated-font .b-font:before { + content: "\e6ea"; + color: inherit; +} +.editor-insert-param-inactivated-font.disabled .b-font:before { + content: "\e6ea"; + color: inherit; +} +.editor-insert-param-active-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.editor-insert-param-active-font .b-font:before { + content: "\e6ea"; + color: #23beef; +} +.editor-insert-param-active-font.disabled .b-font:before { + content: "\e6ea"; + color: #23beef; +} \ No newline at end of file diff --git a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html index 3189374dad..1f50c2ddfd 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html +++ b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html @@ -4,6 +4,7 @@ + From e2decdc840721e838a83cd3180635f6bbe035437 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Sep 2020 16:40:42 +0800 Subject: [PATCH 17/32] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=E4=B9=8B=E5=89=8D=E5=9C=A8=E6=94=B9REPORT-38534?= =?UTF-8?q?=E8=BF=99=E4=B8=AAbug=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E7=9C=8B=E5=88=B0DesignState=E9=87=8C=E9=9D=A2=E6=9C=89?= =?UTF-8?q?=E4=B8=AA=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E7=8A=B6=E6=80=81?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E4=B8=BA=E4=B8=8D=E4=BC=9A=E5=B9=B2=E6=89=B0?= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=8C=E5=88=9A=E6=89=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=8F=A6=E4=B8=80=E4=B8=AAbug=E5=8F=91=E7=8E=B0=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=9D=A2=E6=9D=BF=E8=BF=99=E8=BE=B9=EF=BC=8C=E5=89=AA?= =?UTF-8?q?=E5=88=87=E5=A4=8D=E5=88=B6=E6=8C=89=E9=92=AE=E4=B9=9F=E6=98=AF?= =?UTF-8?q?=E4=BF=9D=E6=8C=81=E4=B8=80=E7=9B=B4=E5=8F=AF=E7=94=A8=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E6=89=80=E4=BB=A5=E8=A6=81=E5=A2=9E=E5=8A=A0=E4=B8=80?= =?UTF-8?q?=E5=B1=82=E5=88=A4=E6=96=AD=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=AD=A4?= =?UTF-8?q?=E6=97=B6=E6=98=AFWORK=5FSHEET=E7=8A=B6=E6=80=81=EF=BC=8C?= =?UTF-8?q?=E8=BF=98=E9=9C=80=E8=A6=81=E5=88=A4=E6=96=AD=E6=98=AF=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=8A=A5=E8=A1=A8=E5=9D=97=E8=BF=98=E6=98=AF=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=EF=BC=8C=E4=BB=85?= =?UTF-8?q?=E5=BD=93=E7=BC=96=E8=BE=91=E6=8A=A5=E8=A1=A8=E5=9D=97=E6=97=B6?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E4=B8=8D=E8=83=BD=E7=BD=AE=E7=81=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 92d06d0b5e..2f65fca0a8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -748,9 +748,11 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta //Yvan: 检查当前是否为WORK_SHEET状态,因为只有WORK_SHEET中含有格式刷组件,此时是不需要进行checkComponentsByNames的 JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jTemplate != null) { - if (jTemplate.getMenuState() != DesignState.WORK_SHEET) { - combineUp.checkComponentsByNames(flag, al); + // 第一个条件满足后还需要添加一重判断,判断是编辑报表块还是参数面板,编辑报表块时则直接return + if (jTemplate.getMenuState() == DesignState.WORK_SHEET && !jTemplate.isUpMode()) { + return; } + combineUp.checkComponentsByNames(flag, al); } } From 38c8fa79a8eff43e559b257964ce2e5a316084b4 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 23 Sep 2020 17:07:31 +0800 Subject: [PATCH 18/32] =?UTF-8?q?REPORT-40525=20=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=8B=96=E6=8B=BD=E7=BB=84=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E6=9D=A5=E5=9B=9E=E5=88=87=E6=8D=A2=E6=A8=A1=E6=9D=BF=EF=BC=8C?= =?UTF-8?q?=E5=86=8D=E6=8B=96=E6=8B=BD=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=BE=88?= =?UTF-8?q?=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/EditingMouseListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 2f2d8eb5b2..0e66964b43 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -177,8 +177,8 @@ public class EditingMouseListener extends MouseInputAdapter { if (designer.isDrawLineMode()) { designer.updateDrawLineMode(e); } else { - int relativeX = Math.max(0, designer.getRelativeX(e.getX())); - int relativeY = Math.max(0, designer.getRelativeY(e.getY())); + int relativeX = Math.max(0, e.getX()); + int relativeY = Math.max(0, e.getY()); if (selectionModel.hasSelectionComponent() && selectionModel.getSelection().getRelativeBounds().contains( From df84b426b0e143c4184726a82066b75c6e69fcad Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 23 Sep 2020 19:21:52 +0800 Subject: [PATCH 19/32] =?UTF-8?q?=E9=80=9A=E7=94=A8=E5=92=8C=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E4=B8=AD=E9=83=BD=E6=94=AF=E6=8C=81=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartTooltipContentPane.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 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 608ee2e16d..51ad13af1f 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 @@ -73,6 +73,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane styleButton; private ChartTextAttrPane textAttrPane; private VanChartHtmlLabelPane htmlLabelPane; @@ -202,6 +203,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Wed, 23 Sep 2020 20:44:15 +0800 Subject: [PATCH 20/32] =?UTF-8?q?=E7=94=98=E7=89=B9=E5=9B=BE=E5=92=8C?= =?UTF-8?q?=E6=A1=86=E6=9E=B6=E5=9B=BE=E6=A0=87=E7=AD=BE=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nChartLabelContentPaneWithoutRichText.java | 74 ++++++++++++++++++- .../label/GaugeLabelContentPane.java | 3 + 2 files changed, 73 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPaneWithoutRichText.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPaneWithoutRichText.java index 4c1935eef0..dafaef060c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPaneWithoutRichText.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPaneWithoutRichText.java @@ -6,6 +6,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; @@ -36,9 +37,11 @@ public class VanChartLabelContentPaneWithoutRichText extends BasicBeanPane styleButton; + private ChartTextAttrPane textAttrPane; private JPanel centerPane; private JPanel commonPanel; + private JPanel stylePanel; private VanChartHtmlLabelPane htmlLabelPane; private VanChartStylePane parent; @@ -85,7 +88,7 @@ public class VanChartLabelContentPaneWithoutRichText extends BasicBeanPane(new String[]{ + content = new UIButtonGroup<>(new String[]{ Toolkit.i18nText("Fine-Design_Chart_Common"), Toolkit.i18nText("Fine-Design_Chart_Custom") }); @@ -99,7 +102,7 @@ public class VanChartLabelContentPaneWithoutRichText extends BasicBeanPane(new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Automatic"), + Toolkit.i18nText("Fine-Design_Chart_Custom") + }); + + textAttrPane = new ChartTextAttrPane() { + protected Component[][] getComponents(JPanel buttonPane) { + return new Component[][]{ + new Component[]{null, null}, + new Component[]{null, getFontNameComboBox()}, + new Component[]{null, buttonPane} + }; + } + }; + + JPanel buttonPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), styleButton); + + JPanel stylePanel = new JPanel(new BorderLayout()); + stylePanel.add(buttonPane, BorderLayout.CENTER); + stylePanel.add(textAttrPane, BorderLayout.SOUTH); + + initStyleButtonListener(); + + return stylePanel; + } + + private void initStyleButtonListener() { + styleButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + checkStylePane(); + } + }); + } + + private void checkStylePane() { + if (hasTextStylePane()) { + stylePanel.setVisible(true); + textAttrPane.setVisible(styleButton.getSelectedIndex() == 1); + } else { + stylePanel.setVisible(false); + } + } + protected String getLabelContentTitle() { return Toolkit.i18nText("Fine-Design_Report_Text"); } @@ -237,7 +293,12 @@ public class VanChartLabelContentPaneWithoutRichText extends BasicBeanPane Date: Wed, 23 Sep 2020 20:51:07 +0800 Subject: [PATCH 21/32] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84setDirty?= 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 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 51ad13af1f..ca96165119 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 @@ -604,7 +604,6 @@ public class VanChartTooltipContentPane extends BasicBeanPane Date: Thu, 24 Sep 2020 09:41:40 +0800 Subject: [PATCH 22/32] =?UTF-8?q?REPORT-38376=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E7=9B=AE=E5=BD=95=E6=A0=91=E7=AD=89=E6=A0=91=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6JDK11=E4=B8=8B=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/datapane/TableDataTree.java | 21 ++--- .../gui/itree/filetree/EnvFileTree.java | 12 +-- .../designer/data/comp/MapDataTree.java | 48 +++++----- .../treeview/ComponentTreeCellRenderer.java | 89 +++++++++---------- 4 files changed, 71 insertions(+), 99 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java index 8f49b6e504..94efc5faa8 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java @@ -1,21 +1,22 @@ package com.fr.design.data.datapane; import com.fr.base.BaseUtils; -import com.fr.general.NameObject; import com.fr.design.constants.UIConstants; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.UserObjectRefreshJTree; import com.fr.design.icon.IconPathConstants; import com.fr.general.ComparatorUtils; +import com.fr.general.NameObject; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.JTree; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; -import java.awt.*; +import java.awt.Color; +import java.awt.Component; /** * TableData Tree @@ -31,6 +32,7 @@ public class TableDataTree extends UserObjectRefreshJTree { this.setCellRenderer(tableDataTreeCellRenderer); this.setEditable(false); } + // CellRenderer private DefaultTreeCellRenderer tableDataTreeCellRenderer = new DefaultTreeCellRenderer() { private static final long serialVersionUID = 1L; @@ -66,14 +68,7 @@ public class TableDataTree extends UserObjectRefreshJTree { this.setIcon(null); this.setText(PENDING.toString()); } - // 这里新建一个Label作为render是因为JTree在动态刷新的时候,节点上render画布的的宽度不会变,会使得一部分比较长的数据显示为"..." - UILabel label = new UILabel(); - label.setText(getText()); - label.setIcon(getIcon()); - Dimension dim = label.getPreferredSize(); - dim.height += 2; - this.setSize(dim); - this.setPreferredSize(dim); + this.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0)); this.setBackgroundNonSelectionColor(UIConstants.TREE_BACKGROUND); this.setTextSelectionColor(Color.WHITE); this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE); @@ -152,7 +147,7 @@ public class TableDataTree extends UserObjectRefreshJTree { /* * p:获得选中的NameObject = name + tabledata. - */ + */ public NameObject getSelectedNameObject() { TreePath selectedTreePath = this.getSelectionPath(); if (selectedTreePath == null) { diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java index d5a9044d5e..435d5a465a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java @@ -2,7 +2,6 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.FRContext; import com.fr.design.constants.UIConstants; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.RefreshableJTree; import com.fr.design.i18n.Toolkit; @@ -14,13 +13,13 @@ import com.fr.stable.CoreConstants; import com.fr.stable.StableUtils; import com.fr.workspace.WorkContext; +import javax.swing.BorderFactory; import javax.swing.JTree; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; import java.awt.Color; import java.awt.Component; -import java.awt.Dimension; import java.io.File; import java.util.ArrayList; import java.util.Arrays; @@ -79,14 +78,7 @@ public class EnvFileTree extends RefreshableJTree { this.setIcon(null); this.setText(PENDING.toString()); } - // 这里新建一个Label作为render是因为JTree在动态刷新的时候,节点上render画布的的宽度不会变,会使得一部分比较长的数据显示为"..." - UILabel label = new UILabel(); - label.setText(getText()); - label.setIcon(getIcon()); - this.setSize(label.getPreferredSize()); - Dimension dim = label.getPreferredSize(); - dim.height += 2; - this.setPreferredSize(dim); + this.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0)); this.setBackgroundNonSelectionColor(UIConstants.TREE_BACKGROUND); this.setTextSelectionColor(Color.WHITE); this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE); diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java index 5a223cbf0c..034c621d57 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java @@ -1,13 +1,13 @@ package com.fr.van.chart.drillmap.designer.data.comp; import com.fr.design.constants.UIConstants; -import com.fr.design.gui.ilable.UILabel; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; import com.fr.stable.StringUtils; +import javax.swing.BorderFactory; import javax.swing.JTree; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeCellRenderer; @@ -15,7 +15,6 @@ import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; import java.awt.Component; -import java.awt.Dimension; import java.util.Enumeration; /** @@ -23,7 +22,7 @@ import java.util.Enumeration; */ public class MapDataTree extends JTree { - public MapDataTree(TreeNode root){ + public MapDataTree(TreeNode root) { super(); this.setModel(model); model.setRoot(root); @@ -49,54 +48,54 @@ public class MapDataTree extends JTree { if (children.hasMoreElements()) { DefaultMutableTreeNode child = (DefaultMutableTreeNode) children.nextElement(); - if(GEOJSONTreeHelper.getInstance().isSelectableTreeNode(child)){ + if (GEOJSONTreeHelper.isSelectableTreeNode(child)) { selectTreeNode(child, m_model); - }else{ + } else { setFirstChildTreeNode(child, m_model); } } } - private void setFirstChildTreeNode(DefaultMutableTreeNode parent, DefaultTreeModel m_model){ + private void setFirstChildTreeNode(DefaultMutableTreeNode parent, DefaultTreeModel m_model) { Enumeration children = parent.children(); - if (children.hasMoreElements()){ + if (children.hasMoreElements()) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) children.nextElement(); selectTreeNode(node, m_model); } } - public void changeRootNode(TreeNode node){ + public void changeRootNode(TreeNode node) { DefaultTreeModel m_model = (DefaultTreeModel) this.getModel(); m_model.setRoot(node); } public String getSelectNodeJSONPath() { - if(this.getLastSelectedPathComponent() == null){ + if (this.getLastSelectedPathComponent() == null) { return StringUtils.EMPTY; } - DefaultMutableTreeNode currentSel = (DefaultMutableTreeNode)this.getLastSelectedPathComponent(); + DefaultMutableTreeNode currentSel = (DefaultMutableTreeNode) this.getLastSelectedPathComponent(); return CompatibleGEOJSONHelper.getJsonUrlByPathIncludeParam(currentSel.getUserObject().toString()); } //根据路径精确查找 public DefaultMutableTreeNode setSelectNodePath(String jsonUrl) { - if(StringUtils.isEmpty(jsonUrl) || CompatibleGEOJSONHelper.isDeprecated(jsonUrl)){ + if (StringUtils.isEmpty(jsonUrl) || CompatibleGEOJSONHelper.isDeprecated(jsonUrl)) { return null; } DefaultTreeModel m_model = (DefaultTreeModel) this.getModel(); DefaultMutableTreeNode root = (DefaultMutableTreeNode) m_model.getRoot(); Enumeration els = root.postorderEnumeration(); - while(els.hasMoreElements()){ + while (els.hasMoreElements()) { DefaultMutableTreeNode el = (DefaultMutableTreeNode) els.nextElement(); - if(el == null || el.getUserObject() == null){ + if (el == null || el.getUserObject() == null) { return null; } String dirPath = el.getUserObject().toString(); - String url = CompatibleGEOJSONHelper.getJsonUrlByPathIncludeParam(dirPath); + String url = CompatibleGEOJSONHelper.getJsonUrlByPathIncludeParam(dirPath); //先equals再valid原因:valid 远程下实时去服务器看有没有json文件 if (ComparatorUtils.equals(jsonUrl, url) && GEOJSONTreeHelper.isValidDirPath(dirPath)) { selectTreeNode(el, m_model); @@ -115,14 +114,7 @@ public class MapDataTree extends JTree { DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value; String name = getPresentName(treeNode); this.setText(name); - - UILabel label = new UILabel(); - label.setText(getText()); - label.setIcon(getIcon()); - this.setSize(label.getPreferredSize()); - Dimension dim = label.getPreferredSize(); - dim.height += 2; - this.setPreferredSize(dim); + this.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0)); this.setBackgroundNonSelectionColor(UIConstants.NORMAL_BACKGROUND); this.setForeground(UIConstants.FONT_COLOR); this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE); @@ -131,25 +123,25 @@ public class MapDataTree extends JTree { }; protected String getPresentName(DefaultMutableTreeNode treeNode) { - if(treeNode == null || treeNode.getUserObject() == null){ + if (treeNode == null || treeNode.getUserObject() == null) { return StringUtils.EMPTY; } return ChartGEOJSONHelper.getPresentNameWithPath(treeNode.getUserObject().toString()); } //模糊搜索 深度优先. - public void search(String text){ - if(StringUtils.isEmpty(text)){ + public void search(String text) { + if (StringUtils.isEmpty(text)) { return; } DefaultTreeModel m_model = (DefaultTreeModel) this.getModel(); DefaultMutableTreeNode root = (DefaultMutableTreeNode) m_model.getRoot(); Enumeration els = root.postorderEnumeration(); - while(els.hasMoreElements()){ + while (els.hasMoreElements()) { DefaultMutableTreeNode el = (DefaultMutableTreeNode) els.nextElement(); - String path = el.getUserObject().toString(); + String path = el.getUserObject().toString(); String fileName = ChartGEOJSONHelper.getPresentNameWithPath(path); if (StringUtils.contains(fileName, text) && GEOJSONTreeHelper.isValidDirPath(path)) { selectTreeNode(el, m_model); @@ -158,7 +150,7 @@ public class MapDataTree extends JTree { } } - public void selectTreeNode(DefaultMutableTreeNode node, DefaultTreeModel m_model){ + public void selectTreeNode(DefaultMutableTreeNode node, DefaultTreeModel m_model) { TreeNode[] nodes = m_model.getPathToRoot(node); TreePath treePath = new TreePath(nodes); setSelectionPath(treePath); 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 78b606a7fc..48938dceee 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 @@ -3,60 +3,53 @@ package com.fr.design.designer.treeview; import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; -import com.fr.design.gui.ilable.UILabel; import com.fr.log.FineLoggerFactory; +import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JTree; import javax.swing.tree.DefaultTreeCellRenderer; import java.awt.Component; -import java.awt.Dimension; public class ComponentTreeCellRenderer extends DefaultTreeCellRenderer { - public ComponentTreeCellRenderer() { - } - - @Override - public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, - boolean leaf, int row, boolean hasFocus) { - super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); - if (value instanceof XCreator) { - String name = ((XCreator) value).toData().getWidgetName(); - setText(name); - Icon icon = null; - try { - icon = XCreatorUtils.getCreatorIcon((XCreator) value); - } catch (Exception e) { - FineLoggerFactory.getLogger().info("{} has not icon or has been deleted", name); - } - if (icon != null) { - setIcon(icon); - } - } - UILabel label = new UILabel(); - label.setText(getText()); - label.setIcon(getIcon()); - Dimension dim = label.getPreferredSize(); - dim.height += 2; - this.setSize(dim); - this.setPreferredSize(dim); - this.setBackgroundNonSelectionColor(UIConstants.TREE_BACKGROUND); - return this; - } - - @Override - public Icon getClosedIcon() { - return getIcon(); - } - - @Override - public Icon getLeafIcon() { - return getIcon(); - } - - @Override - public Icon getOpenIcon() { - return getIcon(); - } -} \ No newline at end of file + public ComponentTreeCellRenderer() { + } + + @Override + public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, + boolean leaf, int row, boolean hasFocus) { + super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); + if (value instanceof XCreator) { + String name = ((XCreator) value).toData().getWidgetName(); + setText(name); + Icon icon = null; + try { + icon = XCreatorUtils.getCreatorIcon((XCreator) value); + } catch (Exception e) { + FineLoggerFactory.getLogger().info("{} has not icon or has been deleted", name); + } + if (icon != null) { + setIcon(icon); + } + } + this.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0)); + this.setBackgroundNonSelectionColor(UIConstants.TREE_BACKGROUND); + return this; + } + + @Override + public Icon getClosedIcon() { + return getIcon(); + } + + @Override + public Icon getLeafIcon() { + return getIcon(); + } + + @Override + public Icon getOpenIcon() { + return getIcon(); + } +} From 9af539cbbd2bd7b73258fe12489325991b09079a Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 24 Sep 2020 12:04:07 +0800 Subject: [PATCH 23/32] =?UTF-8?q?REPORT-39308=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E9=9D=A2=E6=9D=BF=E5=8F=82=E6=95=B0=E5=90=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=AE=8C=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/parameter/ParameterInputPane.java | 252 +++++++++--------- 1 file changed, 132 insertions(+), 120 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java index b16e6b2792..7c8f675b1e 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java @@ -20,14 +20,18 @@ import com.fr.design.editor.editor.TextEditor; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; - import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Dimension; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; @@ -37,31 +41,34 @@ import java.util.Map.Entry; /** * The dialog used to input parameter. + * * @editor zhou * @since 2012-3-26上午11:09:45 */ public class ParameterInputPane extends BasicPane { - /** - * - */ - private static final long serialVersionUID = 1L; + /** + * + */ + private static final long serialVersionUID = 1L; + + // alex:保存编辑器对应的参数的名字 + private java.util.Map editorNameMap; // Map + + private boolean allowBlank = true; - // alex:保存编辑器对应的参数的名字 - private java.util.Map editorNameMap; // Map + private FlowTableLayoutHelper flowTableLayoutHelper; - private boolean allowBlank = true; - - /** + /** * Constructor. */ public ParameterInputPane(ParameterProvider[] parameters) { this.initComponents(parameters); } - public ParameterInputPane(ParameterProvider[] parameters, boolean allowBlank) { - this.allowBlank = allowBlank; - this.initComponents(parameters); - } + public ParameterInputPane(ParameterProvider[] parameters, boolean allowBlank) { + this.allowBlank = allowBlank; + this.initComponents(parameters); + } private void initComponents(ParameterProvider[] parameters) { this.setLayout(new BorderLayout(0, 4)); @@ -71,24 +78,24 @@ public class ParameterInputPane extends BasicPane { this.add(new JScrollPane(contentPane), BorderLayout.CENTER); contentPane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters") + ":")); - FlowTableLayoutHelper flowTableLayoutHelper = new FlowTableLayoutHelper(); + flowTableLayoutHelper = new FlowTableLayoutHelper(); + + editorNameMap = new java.util.HashMap(); - editorNameMap = new java.util.HashMap(); - //Parameter list. java.util.List nameAddedList = new java.util.ArrayList(); // alex:已经加到界面中去的参数名 if (parameters != null && parameters.length > 0) { for (int i = 0; i < parameters.length; i++) { ParameterProvider parameter = parameters[i]; - + // alex:已经在界面中的参数,不加了 if (nameAddedList.contains(parameter.getName())) { - continue; - } - if(parameter instanceof StoreProcedureParameter - && ((StoreProcedureParameter) parameter).getSchema() == StoreProcedureConstants.OUT) { - continue; - } + continue; + } + if (parameter instanceof StoreProcedureParameter + && ((StoreProcedureParameter) parameter).getSchema() == StoreProcedureConstants.OUT) { + continue; + } final Object pv = parameter.getValue(); Editor[] editors = makeEditorByValue(pv); @@ -100,135 +107,140 @@ public class ParameterInputPane extends BasicPane { editPane.setPreferredSize(new Dimension(180, editPane.getPreferredSize().height)); String parameterDisplayName = parameter.getName(); - if(StringUtils.isNotBlank(parameter.getName())) { - parameterDisplayName = parameter.getName(); + if (StringUtils.isNotBlank(parameter.getName())) { + parameterDisplayName = parameter.getName(); } contentPane.add(flowTableLayoutHelper.createLabelFlowPane(parameterDisplayName + ":", editPane)); //add editor to parameter hashtable. - initTextListener(textF); + initTextListener(textF); this.editorNameMap.put(textF, parameter.getName()); nameAddedList.add(parameter.getName()); } } + } + @Override + public void addNotify() { + super.addNotify(); + // windows 高DPI下,使用getPreferredSize必须在添加到容器之后,否则得到的数值不准确,因此先放到这调整大小 flowTableLayoutHelper.adjustLabelWidth(); } protected void initTextListener(ValueEditorPane textF) { - textF.getCurrentEditor().addChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(); - } - }); - } - - private Editor[] makeEditorByValue(Object pv) { - Editor[] editors = {null}; - if (pv instanceof Integer) { - editors[0] = new IntegerEditor(); - } else if (pv instanceof Double || pv instanceof Float) { - editors[0] = new DoubleEditor(); - } else if (pv instanceof Float) { - editors[0] = new FloatEditor(); - } else if (pv instanceof Date) { - editors[0] = new DateEditor(true, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date")); - } else if (pv instanceof Boolean) { - editors[0] = new BooleanEditor(); - } else if (pv instanceof BaseFormula) { - editors = ValueEditorPaneFactory.basicEditors(); - } else { - editors[0] = new TextEditor(); - } - return editors; - } - + textF.getCurrentEditor().addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(); + } + }); + } + + private Editor[] makeEditorByValue(Object pv) { + Editor[] editors = {null}; + if (pv instanceof Integer) { + editors[0] = new IntegerEditor(); + } else if (pv instanceof Double || pv instanceof Float) { + editors[0] = new DoubleEditor(); + } else if (pv instanceof Float) { + editors[0] = new FloatEditor(); + } else if (pv instanceof Date) { + editors[0] = new DateEditor(true, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date")); + } else if (pv instanceof Boolean) { + editors[0] = new BooleanEditor(); + } else if (pv instanceof BaseFormula) { + editors = ValueEditorPaneFactory.basicEditors(); + } else { + editors[0] = new TextEditor(); + } + return editors; + } + @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters"); } /** * Update */ - public Map update() { - - java.util.Map nameValueMap = new java.util.HashMap(); - - Iterator> entryIt = this.editorNameMap.entrySet().iterator(); - while(entryIt.hasNext()) { - java.util.Map.Entry entry = entryIt.next(); - ValueEditorPane editor = entry.getKey(); - String parameterName = entry.getValue(); - - Object editorStringValue = editor.update(); - nameValueMap.put(parameterName, editorStringValue); - } - - return nameValueMap; + public Map update() { + + java.util.Map nameValueMap = new java.util.HashMap(); + + Iterator> entryIt = this.editorNameMap.entrySet().iterator(); + while (entryIt.hasNext()) { + java.util.Map.Entry entry = entryIt.next(); + ValueEditorPane editor = entry.getKey(); + String parameterName = entry.getValue(); + + Object editorStringValue = editor.update(); + nameValueMap.put(parameterName, editorStringValue); + } + + return nameValueMap; + } + + public void checkValid() throws Exception { + if (!allowBlank) { + boolean valid = true; + String error = ""; + Iterator> entryIt = this.editorNameMap.entrySet().iterator(); + while (entryIt.hasNext()) { + java.util.Map.Entry entry = entryIt.next(); + ValueEditorPane editor = entry.getKey(); + String parameterName = entry.getValue(); + Object editorStringValue = editor.update(); + if (editorStringValue == null || StringUtils.isEmpty(Utils.objectToString(editorStringValue))) { + valid = false; + error += parameterName + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Not_Null_Des") + "\n"; + } + } + if (!valid) { + throw new Exception(error); + } + } } - public void checkValid() throws Exception { - if (!allowBlank) { - boolean valid = true; - String error = ""; - Iterator> entryIt = this.editorNameMap.entrySet().iterator(); - while (entryIt.hasNext()) { - java.util.Map.Entry entry = entryIt.next(); - ValueEditorPane editor = entry.getKey(); - String parameterName = entry.getValue(); - Object editorStringValue = editor.update(); - if (editorStringValue == null || StringUtils.isEmpty(Utils.objectToString(editorStringValue))) { - valid = false; - error += parameterName + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Not_Null_Des") + "\n"; - } - } - if (!valid) { - throw new Exception(error); - } - } - } - /** * The class help to flowlayout components */ private static class FlowTableLayoutHelper { - private List labelList = new ArrayList(); + private List labelList = new ArrayList(); - public FlowTableLayoutHelper() { - } + public FlowTableLayoutHelper() { + } - public JPanel createLabelFlowPane(String text, JComponent comp) { - JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + public JPanel createLabelFlowPane(String text, JComponent comp) { + JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - UILabel textLabel = new UILabel(text); - centerPane.add(textLabel); - textLabel.setHorizontalAlignment(SwingConstants.LEFT); + UILabel textLabel = new UILabel(text); + centerPane.add(textLabel); + textLabel.setHorizontalAlignment(SwingConstants.LEFT); - this.labelList.add(textLabel); - centerPane.add(comp); + this.labelList.add(textLabel); + centerPane.add(comp); - return centerPane; - } + return centerPane; + } - public void adjustLabelWidth() { - int maxWidth = 0; + public void adjustLabelWidth() { + int maxWidth = 0; - for (int i = 0; i < labelList.size(); i++) { - maxWidth = Math.max(maxWidth, labelList.get(i).getPreferredSize().width); - } + for (int i = 0; i < labelList.size(); i++) { + maxWidth = Math.max(maxWidth, labelList.get(i).getPreferredSize().width); + } - for (int i = 0; i < labelList.size(); i++) { - UILabel label = labelList.get(i); + for (int i = 0; i < labelList.size(); i++) { + UILabel label = labelList.get(i); - Dimension labelDim = new Dimension(maxWidth, label.getPreferredSize().height); + Dimension labelDim = new Dimension(maxWidth, label.getPreferredSize().height); - label.setPreferredSize(labelDim); - label.setSize(labelDim); - label.setMinimumSize(labelDim); - } - } + label.setPreferredSize(labelDim); + label.setSize(labelDim); + label.setMinimumSize(labelDim); + } + } } -} \ No newline at end of file +} From d1108bf94a19d982729f93246acee799facda438 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 24 Sep 2020 14:03:32 +0800 Subject: [PATCH 24/32] =?UTF-8?q?MOBILE-29490=20=E3=80=90H5=E3=80=9110.4.8?= =?UTF-8?q?0=E5=8D=87=E7=BA=A7=E5=88=B010.4.90=E5=90=8E=EF=BC=8C=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=B8=AD=E6=9C=89=E4=BA=9B=E5=86=85=E5=AE=B9=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/form/util/FormDesignerUtils.java | 21 +++++++++++++++++++ .../mobile/ChartEditorDefinePane.java | 14 ++++++++++++- .../mobile/ElementCaseDefinePane.java | 12 ++++++++++- 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java index 352aa80e54..3e248f3bae 100644 --- a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java +++ b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java @@ -1,5 +1,8 @@ package com.fr.design.form.util; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XWAbsoluteBodyLayout; +import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.FormDesigner; @@ -8,6 +11,7 @@ import com.fr.design.mainframe.template.info.ComponentCreateOperate; import com.fr.design.mainframe.template.info.ComponentDeleteOperate; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WFitLayout; +import java.awt.Container; public class FormDesignerUtils { @@ -46,4 +50,21 @@ public class FormDesignerUtils { jTemplate.getProcessInfo().updateTemplateOperationInfo(new ComponentDeleteOperate(widget)); } + /** + * 判断当前UI组件是否在绝对画布块中 + * + * @param xCreator + * @return + */ + public static boolean isInAbsoluteLayout(XCreator xCreator) { + Container parent = xCreator.getParent(); + while (parent != null) { + if (parent instanceof XWAbsoluteLayout && !(parent instanceof XWAbsoluteBodyLayout)) { + return true; + } + parent = parent.getParent(); + } + return false; + } + } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java index 7427a0281b..8a9c3b4d48 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java @@ -24,6 +24,7 @@ import com.fr.design.mainframe.mobile.ui.MobileCollapsedStylePane; import com.fr.design.mainframe.mobile.ui.MobileComboBoxDialogEditor; import com.fr.form.ui.BaseChartEditor; import com.fr.form.ui.ChartEditor; +import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.mobile.MobileCollapsedStyle; import javax.swing.BorderFactory; @@ -202,8 +203,19 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle(); this.mobileCollapsedStyleEditor.setStyle(style); this.mobileCollapsedStyleEditor.setSelected(style.isCollapsedWork()); + fix(style); } + /** + * 根据组件当前位置修正下属性 + * + * @param style + */ + private void fix(MobileCollapsedStyle style) { + style.setCollapsedWork(!FormDesignerUtils.isInAbsoluteLayout(xCreator)); + } + + @Override public void update() { ChartMobileAttrProvider mobileAttr = ((BaseChartEditor)xCreator.toData()).getMobileAttr(); @@ -219,7 +231,7 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { MobileCollapsedStyle style = this.mobileCollapsedStyleEditor.getStyle(); if (style != null) { ((ChartEditor) xCreator.toData()).setMobileCollapsedStyle(style); - style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom()); + style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom() && !FormDesignerUtils.isInAbsoluteLayout(xCreator)); } DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来 } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java index 723616280c..596f046822 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java @@ -177,6 +177,16 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane { this.functionalWhenUnactivatedCheckBox.setSelected(!elementCaseEditor.isFunctionalWhenUnactivated()); this.mobileCollapsedStyleEditor.setStyle(elementCaseEditor.getMobileCollapsedStyle()); this.mobileCollapsedStyleEditor.setSelected(elementCaseEditor.getMobileCollapsedStyle().isCollapsedWork()); + fix(elementCaseEditor.getMobileCollapsedStyle()); + } + + /** + * 根据组件当前位置修正下属性 + * + * @param style + */ + private void fix(MobileCollapsedStyle style) { + style.setCollapsedWork(!FormDesignerUtils.isInAbsoluteLayout(xCreator)); } @Override @@ -207,7 +217,7 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane { } MobileCollapsedStyle style = this.mobileCollapsedStyleEditor.getStyle(); if (style != null) { - style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom()); + style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom() && !FormDesignerUtils.isInAbsoluteLayout(xCreator)); ((ElementCaseEditor) xCreator.toData()).setMobileCollapsedStyle(style); } } From 85fcea5fba367eb83b0da25c71dde38a7a43023d Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 24 Sep 2020 14:20:23 +0800 Subject: [PATCH 25/32] =?UTF-8?q?MOBILE-29490=20=E3=80=90H5=E3=80=9110.4.8?= =?UTF-8?q?0=E5=8D=87=E7=BA=A7=E5=88=B010.4.90=E5=90=8E=EF=BC=8C=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=B8=AD=E6=9C=89=E4=BA=9B=E5=86=85=E5=AE=B9=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/ui/designer/mobile/ChartEditorDefinePane.java | 4 ++-- .../widget/ui/designer/mobile/ElementCaseDefinePane.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java index 8a9c3b4d48..69e438401c 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java @@ -202,8 +202,8 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle(); this.mobileCollapsedStyleEditor.setStyle(style); - this.mobileCollapsedStyleEditor.setSelected(style.isCollapsedWork()); fix(style); + this.mobileCollapsedStyleEditor.setSelected(style.isCollapsedWork()); } /** @@ -212,7 +212,7 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { * @param style */ private void fix(MobileCollapsedStyle style) { - style.setCollapsedWork(!FormDesignerUtils.isInAbsoluteLayout(xCreator)); + style.setCollapsedWork(style.isCollapsedWork() && !FormDesignerUtils.isInAbsoluteLayout(xCreator)); } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java index 596f046822..bdd5b7d351 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java @@ -176,8 +176,8 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane { this.allowFullCheckBox.setSelected(elementCaseEditor.isAllowFullScreen()); this.functionalWhenUnactivatedCheckBox.setSelected(!elementCaseEditor.isFunctionalWhenUnactivated()); this.mobileCollapsedStyleEditor.setStyle(elementCaseEditor.getMobileCollapsedStyle()); - this.mobileCollapsedStyleEditor.setSelected(elementCaseEditor.getMobileCollapsedStyle().isCollapsedWork()); fix(elementCaseEditor.getMobileCollapsedStyle()); + this.mobileCollapsedStyleEditor.setSelected(elementCaseEditor.getMobileCollapsedStyle().isCollapsedWork()); } /** @@ -186,7 +186,7 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane { * @param style */ private void fix(MobileCollapsedStyle style) { - style.setCollapsedWork(!FormDesignerUtils.isInAbsoluteLayout(xCreator)); + style.setCollapsedWork(style.isCollapsedWork() && !FormDesignerUtils.isInAbsoluteLayout(xCreator)); } @Override From a3c061ffdfc01d122e82414d5ce0e4ccb8952d7e Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 24 Sep 2020 14:43:11 +0800 Subject: [PATCH 26/32] =?UTF-8?q?REPORT-40459=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E5=8F=B3=E4=BE=A7=E5=B1=9E=E6=80=A7=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E5=AF=8C=E6=96=87=E6=9C=AC=E7=BC=96=E8=BE=91=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=8F=98=E7=9F=AD=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=91=E5=AE=9E=E9=99=85=E4=B8=8A=E4=B8=8D?= =?UTF-8?q?=E6=98=AF=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE=E5=8F=98=E7=9F=AD?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E8=80=8C=E6=98=AF=E4=B8=8A=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E4=B8=A4=E4=B8=AALabel=E5=8F=98=E7=9F=AD=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8=E4=BD=BF=E7=94=A8TableLayout.FILL=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=EF=BC=8C=E5=90=8E=E9=9D=A2=E8=B7=9F=E7=9D=80?= =?UTF-8?q?=E7=9A=84=E8=BE=93=E5=85=A5=E6=A1=86=E8=BF=98=E6=9C=89UICombox?= =?UTF-8?q?=E5=8F=98=E9=95=BF=E4=BA=86=EF=BC=8C=E8=80=8C=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=89=8D=E9=9D=A2=E7=9A=84=E5=8D=A0=E4=BD=8D?= =?UTF-8?q?=E7=A9=BA=E7=99=BDLabel=E6=98=AF=E5=86=99=E6=AD=BBsize=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E6=B2=A1=E6=9C=89=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= =?UTF-8?q?=EF=BC=8C=E6=89=80=E4=BB=A5=E7=A9=BA=E7=99=BDLabel=E4=B8=8D?= =?UTF-8?q?=E5=8F=98=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=EF=BC=8C=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=8C=89=E9=92=AE=E6=98=BE=E5=BE=97=E7=9F=AD=E4=BA=86?= =?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=96=B9=E6=A1=88=E3=80=91?= =?UTF-8?q?=E5=B0=86=E5=8D=A0=E4=BD=8DLabel=E7=9A=84=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E4=B8=8E=E5=89=8D=E9=9D=A2=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=AE=A1=E7=AE=97=E5=AE=BD=E5=BA=A6=E7=9A=84=E4=B8=A4?= =?UTF-8?q?=E4=B8=AALabel=E4=B8=80=E8=87=B4=EF=BC=8C=E8=BF=99=E6=A0=B7?= =?UTF-8?q?=E5=90=8E=E9=9D=A2=E8=B7=9F=E7=9A=84=E4=B8=9C=E8=A5=BF=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E5=B0=B1=E9=83=BD=E6=98=AF=E4=B8=80=E8=87=B4=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/quickeditor/CellQuickEditor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 019b4cdeea..d24193dae8 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -48,7 +48,7 @@ import java.util.ArrayList; */ public abstract class CellQuickEditor extends QuickEditor { - protected static final Dimension LABEL_DIMENSION = new Dimension(60, 20); + protected static final Dimension LABEL_DIMENSION = new Dimension(GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), 20); protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; /** From 31f74c939267b32f710b70f200b075b77ffd9e68 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 24 Sep 2020 14:44:42 +0800 Subject: [PATCH 27/32] =?UTF-8?q?REPORT-38618=20=E3=80=90=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E8=A1=A8=E5=8D=95-=E4=B8=8B=E6=96=B9?= =?UTF-8?q?=E7=BC=A9=E6=94=BE=E7=BC=A9=E5=B0=8F=E4=B9=8B=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E6=8B=96=E5=85=A5tab=E5=9D=97=EF=BC=8C=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E8=BE=B9=E6=A1=86=E7=BA=BF=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/FormDesignerUI.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java index b75fbcf3ce..233ee2a96a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java @@ -22,10 +22,12 @@ import com.fr.form.main.parameter.FormParameterUI; import com.fr.page.WatermarkPainter; import com.fr.report.core.ReportUtils; import com.fr.stable.ArrayUtils; +import com.fr.stable.Constants; import javax.swing.*; import javax.swing.plaf.ComponentUI; import java.awt.AlphaComposite; +import java.awt.Color; import java.awt.Component; import java.awt.Graphics; import java.awt.Graphics2D; @@ -41,6 +43,8 @@ import java.util.ArrayList; */ public class FormDesignerUI extends ComponentUI { + private static final Color DESIGNER_BORDER_COLOR = new Color(198, 198, 198); + // 当前的设计器 private FormDesigner designer; private SelectionModel selectionModel; @@ -90,7 +94,7 @@ public class FormDesignerUI extends ComponentUI { designer.getDrawLineHelper().drawAuxiliaryLine(g); return; } - + paintBorder(g); paintSelection(g); if (DesignerMode.isAuthorityEditing()) { @@ -275,6 +279,19 @@ public class FormDesignerUI extends ComponentUI { clipg.dispose(); } + public void paintBorder(Graphics g) { + Rectangle bounds = designer.getTopContainer().getBounds(); + bounds.x = -designer.getHorizontalScaleValue(); + bounds.y = -designer.getVerticalScaleValue(); + Graphics clipg = g.create(); + clipg.clipRect(bounds.x, bounds.y, bounds.width, bounds.height); + Color oldColor = g.getColor(); + g.setColor(DESIGNER_BORDER_COLOR); + GraphHelper.draw(g, bounds, Constants.LINE_THIN); + clipg.dispose(); + g.setColor(oldColor); + } + /** * 画出当前选择、拖拽状态框 * From 465dafee980b07c8835f24816302329fc9b9812c Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 24 Sep 2020 14:50:22 +0800 Subject: [PATCH 28/32] =?UTF-8?q?=E6=8F=90=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EditingMouseListener.java | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 01de4a1dac..0e66964b43 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -177,8 +177,8 @@ public class EditingMouseListener extends MouseInputAdapter { if (designer.isDrawLineMode()) { designer.updateDrawLineMode(e); } else { - int relativeX = Math.max(0, designer.getRelativeX(e.getX())); - int relativeY = Math.max(0, designer.getRelativeY(e.getY())); + int relativeX = Math.max(0, e.getX()); + int relativeY = Math.max(0, e.getY()); if (selectionModel.hasSelectionComponent() && selectionModel.getSelection().getRelativeBounds().contains( @@ -363,7 +363,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } // component.getParent() 是报表块所在的XWTitleLayout int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xElementCase.getY(); if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -405,16 +405,7 @@ public class EditingMouseListener extends MouseInputAdapter { } private void setCoverPaneNotDisplay(XCreator component, MouseEvent e, boolean isLinkedHelpDialog) { - if (xElementCase != null) { - int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); - int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); - Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); - if (rect.contains(e.getPoint())) { - return; - } - xElementCase.displayCoverPane(false); - } if (xChartEditor != null) { xChartEditor.displayCoverPane(false); } @@ -425,6 +416,15 @@ public class EditingMouseListener extends MouseInputAdapter { if (xTopLayoutContainer != null) { xTopLayoutContainer.setMouseEnter(false); } + //不知道为什么要对XElementCase进行判断,但是直接return会有bug,所以把他放在最后 + if (xElementCase != null) { + int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); + int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); + Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); + if (!rect.contains(e.getPoint())) { + xElementCase.displayCoverPane(false); + } + } designer.repaint(); } @@ -462,7 +462,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xChartEditor.getY(); if (e.getX() + GAP > minX && e.getX() - GAP < minX + button.getWidth()) { if (e.getY() + GAP > minY && e.getY() - GAP < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -700,6 +700,7 @@ public class EditingMouseListener extends MouseInputAdapter { currentXCreator.stopEditing(); currentXCreator = null; currentEditor = null; + refreshTopXCreator(); return true; } return true; @@ -727,4 +728,19 @@ public class EditingMouseListener extends MouseInputAdapter { } currentEditor.getEditorTarget().setBounds(bounds); } + + /** + * 刷新顶层组件 + * */ + public void refreshTopXCreator(boolean isEditing){ + designer.refreshTopXCreator(isEditing); + } + + /** + * 刷新顶层组件 + * */ + public void refreshTopXCreator(){ + refreshTopXCreator(false); + } + } From a66a183f2fdb0738860a81fdba4d0156c68b6bab Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 24 Sep 2020 14:55:34 +0800 Subject: [PATCH 29/32] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EditingMouseListener.java | 38 ++++++------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 0e66964b43..f482f7c97e 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -363,7 +363,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } // component.getParent() 是报表块所在的XWTitleLayout int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xElementCase.getY(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -405,7 +405,16 @@ public class EditingMouseListener extends MouseInputAdapter { } private void setCoverPaneNotDisplay(XCreator component, MouseEvent e, boolean isLinkedHelpDialog) { + if (xElementCase != null) { + int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); + int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); + Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); + if (rect.contains(e.getPoint())) { + return; + } + xElementCase.displayCoverPane(false); + } if (xChartEditor != null) { xChartEditor.displayCoverPane(false); } @@ -416,15 +425,6 @@ public class EditingMouseListener extends MouseInputAdapter { if (xTopLayoutContainer != null) { xTopLayoutContainer.setMouseEnter(false); } - //不知道为什么要对XElementCase进行判断,但是直接return会有bug,所以把他放在最后 - if (xElementCase != null) { - int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); - int y = getParentPositionY(xElementCase, 0) - designer.getArea().getVerticalValue(); - Rectangle rect = new Rectangle(x, y, xElementCase.getWidth(), xElementCase.getHeight()); - if (!rect.contains(e.getPoint())) { - xElementCase.displayCoverPane(false); - } - } designer.repaint(); } @@ -462,7 +462,7 @@ public class EditingMouseListener extends MouseInputAdapter { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xChartEditor.getY(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); if (e.getX() + GAP > minX && e.getX() - GAP < minX + button.getWidth()) { if (e.getY() + GAP > minY && e.getY() - GAP < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -700,7 +700,6 @@ public class EditingMouseListener extends MouseInputAdapter { currentXCreator.stopEditing(); currentXCreator = null; currentEditor = null; - refreshTopXCreator(); return true; } return true; @@ -728,19 +727,4 @@ public class EditingMouseListener extends MouseInputAdapter { } currentEditor.getEditorTarget().setBounds(bounds); } - - /** - * 刷新顶层组件 - * */ - public void refreshTopXCreator(boolean isEditing){ - designer.refreshTopXCreator(isEditing); - } - - /** - * 刷新顶层组件 - * */ - public void refreshTopXCreator(){ - refreshTopXCreator(false); - } - } From b0cb486d8cbdb3e2157af082814eefc89eb8aa5f Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 24 Sep 2020 15:46:18 +0800 Subject: [PATCH 30/32] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=8BToolK?= =?UTF-8?q?it=E7=9A=84=E5=AF=BC=E5=8C=85=E9=97=AE=E9=A2=98=E5=92=8CHistory?= =?UTF-8?q?TemplateListPane=E7=9A=84=E8=BF=87=E6=97=B6=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/quickeditor/CellQuickEditor.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index d24193dae8..6c177d1334 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -3,11 +3,12 @@ package com.fr.quickeditor; import com.fr.base.GraphHelper; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.core.ActionFactory; -import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.CellElementPropertyPane; @@ -48,7 +49,7 @@ import java.util.ArrayList; */ public abstract class CellQuickEditor extends QuickEditor { - protected static final Dimension LABEL_DIMENSION = new Dimension(GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), 20); + protected static final Dimension LABEL_DIMENSION = new Dimension(GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), 20); protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; /** @@ -165,7 +166,7 @@ public abstract class CellQuickEditor extends QuickEditor { columnRowTextField.setText(columnRow.toString()); cellElement = tc.getEditingElementCase().getTemplateCellElement(cs.getColumn(), cs.getRow()); - JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jTemplate != null) { comboBox.removeActionListener(comboBoxActionListener); comboBox.removeAllItems(); @@ -208,10 +209,10 @@ public abstract class CellQuickEditor extends QuickEditor { private JPanel initTopContent() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), f}; + double[] columnSize = {GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), f}; double[] rowSize = {p, p}; - UILabel cellLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell")); - UILabel insertContentLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")); + UILabel cellLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Cell")); + UILabel insertContentLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")); initCellElementEditComboBox(); Component[][] components = new Component[][]{ new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()}, @@ -263,7 +264,7 @@ public abstract class CellQuickEditor extends QuickEditor { * 初始化添加按钮 */ private void initCellElementEditComboBox() { - JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jTemplate == null) { comboBox = new UIComboBox(); return; @@ -304,8 +305,8 @@ public abstract class CellQuickEditor extends QuickEditor { ColumnRow columnRowEdit = ColumnRow.valueOf(columnRowTextField.getText()); // barry:检查输入是否正确 if (!ColumnRow.validate(columnRowEdit)) { - Object[] options = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")}; - JOptionPane.showOptionDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Please_Input_Letters+Numbers(A1,AA1,A11....)"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Warning"), + Object[] options = {Toolkit.i18nText("Fine-Design_Report_OK")}; + JOptionPane.showOptionDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Please_Input_Letters+Numbers(A1,AA1,A11....)"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Warning"), JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]); // 重新选中当前的selection,把columnRowTextField tc.setSelection(tc.getSelection()); From e1011109d10d8cc9b6241353f27fd2970ee3d0cc Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 24 Sep 2020 16:44:24 +0800 Subject: [PATCH 31/32] =?UTF-8?q?REPORT-38537=20=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/constants/UIConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java index 15a7c87c08..93dc57a8f4 100644 --- a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java +++ b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java @@ -37,7 +37,7 @@ public interface UIConstants { public static final Image APPFIT_H3 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/H3.png"); public static final Image APPFIT_H4 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/H4.png"); - public static final Border CELL_ATTR_ZEROBORDER = BorderFactory.createEmptyBorder(0, 0, 0, 0); + public static final Border CELL_ATTR_ZEROBORDER = BorderFactory.createEmptyBorder(0, 1, 0, 0); public static final Border CELL_ATTR_EMPTYBORDER = BorderFactory.createEmptyBorder(0, 10, 0, 0); public static final Border CELL_ATTR_PRESENTBORDER = BorderFactory.createEmptyBorder(0, 5, 0, 0); public static final Border CELL_ATTR_NORMALBORDER = BorderFactory.createEmptyBorder(0, 10, 0, 15); From 1c9ead2a778f0149076c8cce25dd8bbc74b7dad5 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 24 Sep 2020 17:17:36 +0800 Subject: [PATCH 32/32] =?UTF-8?q?CHART-15947=20=E4=BF=AE=E6=94=B9=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E7=BC=96=E8=BE=91=E5=99=A8=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/editor/script/editor.js | 14 ++++++++++++++ .../script/insertcombo/combo.insert_param.model.js | 2 +- 2 files changed, 15 insertions(+), 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 2162430698..d0e49dd5f9 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 @@ -107,6 +107,16 @@ _cleanHtml: function (value) { var editorService = BI.Services.getService("bi.service.design.chart.common.editor"); + var dimensionIds = this.options.dimensionIds; + var dataIdMap = {}; + + for (var i = 0, len = dimensionIds.length; i < len; i++) { + var dimensionId = dimensionIds[i]; + var key = BI.keys(dimensionId)[0]; + + dataIdMap[key] = dimensionId[key]; + } + var result = BI.replaceAll(value, "

", ""); // 去掉image的src属性,因为数据太大了 result = value.replaceAll("", function (imageStr) { @@ -117,6 +127,10 @@ return; } str += " " + key + "=\"" + value + "\""; + + if (key === "alt" && dataIdMap[value]) { + str += " " + "data-id" + "=\"" + dataIdMap[value] + "\""; + } }); return str + " />"; diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.model.js b/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.model.js index d0a8f084ef..10db72cd0e 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.model.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.model.js @@ -21,7 +21,7 @@ return { type: "bi.design.chart.common.editor.search", text: key, - value: dId[key] + value: key }; }); }