From 83c85c6a09845757eb703be29420237881863057 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 22 Sep 2020 11:47:38 +0800 Subject: [PATCH 01/11] =?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 000000000..3243bad71 --- /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 000000000..e80f6310d --- /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 aeaefa5b3..b518b1ec8 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 f06e7c1c7..e1febb26b 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 bd1b9a175..9bc21a044 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 576d0211c..253a6f832 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 02/11] =?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 b518b1ec8..9ea26a5c5 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 253a6f832..b159af755 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 4f8a3ef91f831f67b44398c61f3cbca27f09d897 Mon Sep 17 00:00:00 2001 From: "Jimmy.Zheng" Date: Wed, 23 Sep 2020 10:55:50 +0800 Subject: [PATCH 03/11] 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 8b5c62657..8964ff8de 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 46cdae35b..6103e6800 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 f3c2c203a860e1d06f748fdf5c9415e497bce178 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 23 Sep 2020 11:34:46 +0800 Subject: [PATCH 04/11] =?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 478929662..4514e39b9 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 63eff9047..fabf1e669 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 000000000..536149587 --- /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 b159af755..22f8ace78 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 12abfe93d64c1612bfc61ab26709a09bed5a5974 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 23 Sep 2020 15:40:09 +0800 Subject: [PATCH 05/11] =?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 000000000..27eb74d9b --- /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 3189374da..1f50c2ddf 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 38c8fa79a8eff43e559b257964ce2e5a316084b4 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 23 Sep 2020 17:07:31 +0800 Subject: [PATCH 06/11] =?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 2f2d8eb5b..0e66964b4 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 07/11] =?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 608ee2e16..51ad13af1 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 08/11] =?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 4c1935eef..dafaef060 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 09/11] =?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 51ad13af1..ca9616511 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 10/11] =?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 8f49b6e50..94efc5faa 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 d5a9044d5..435d5a465 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 5a223cbf0..034c621d5 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 78b606a7f..48938dcee 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 11/11] =?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 b16e6b279..7c8f675b1 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 +}