From 9fa7771d6e2e33c32d02477a783305fc206488c7 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 3 Aug 2020 14:17:28 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=201.FRGUIPanelFactory=E4=B8=AD=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=E4=B8=80=E7=A7=8D=E5=9E=82=E7=9B=B4=E5=B8=83=E5=B1=80?= =?UTF-8?q?=EF=BC=8C=E6=B0=B4=E5=B9=B3=E5=B1=85=E5=B7=A6=EF=BC=8C=E7=AB=96?= =?UTF-8?q?=E7=9B=B4=E9=A1=B6=E5=AF=B9=E9=BD=90=EF=BC=8C=E7=94=A8=E4=BB=A5?= =?UTF-8?q?=E6=BB=A1=E8=B6=B3bug=E6=8F=90=E5=87=BA=E8=80=85=E7=9A=84?= =?UTF-8?q?=E9=9C=80=E6=B1=82=202.=E5=AF=B9VerticalFlowLayout=E4=B8=AD?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E6=B3=A8=E9=87=8A=E9=94=99=E8=AF=AF(?= =?UTF-8?q?=E5=8E=9F=E6=9C=AC=E7=9A=84=E6=B3=A8=E9=87=8A=E4=B8=AD=E6=98=AF?= =?UTF-8?q?=E5=B7=A6=E5=AF=B9=E9=BD=90=E5=B1=85=E4=B8=AD=E5=AF=B9=E9=BD=90?= =?UTF-8?q?=E5=92=8C=E5=8F=B3=E5=AF=B9=E9=BD=90=EF=BC=8C=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E5=8D=B4=E4=B8=BAtop=EF=BC=8Ccenter=E5=92=8Cbottom=EF=BC=8C?= =?UTF-8?q?=E7=BB=8F=E8=BF=87=E8=B0=83=E8=AF=95=E5=8F=91=E7=8E=B0=E8=BF=99?= =?UTF-8?q?=E5=87=A0=E4=B8=AA=E5=8F=98=E9=87=8F=E5=AE=9E=E5=88=99=E4=BB=A3?= =?UTF-8?q?=E8=A1=A8=E4=BA=86=E7=AB=96=E7=9B=B4=E6=96=B9=E5=90=91=E4=B8=8A?= =?UTF-8?q?=E7=9A=84=E9=A1=B6=E5=AF=B9=E9=BD=90=EF=BC=8C=E5=B1=85=E4=B8=AD?= =?UTF-8?q?=E5=AF=B9=E9=BD=90=E5=92=8C=E5=BA=95=E5=AF=B9=E9=BD=90)?= =?UTF-8?q?=E5=92=8C=E5=91=BD=E5=90=8D=E9=94=99=E8=AF=AF(dealWith=E5=86=99?= =?UTF-8?q?=E6=88=90=E4=BA=86dialWith)=E8=BF=9B=E8=A1=8C=E4=BA=86=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=203.=E4=B8=BAVerticalFlowLayout=E4=B8=AD=E9=87=8D?= =?UTF-8?q?=E5=86=99=E7=9A=84=E5=87=A0=E4=B8=AA=E6=96=B9=E6=B3=95=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BA=86@Override=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/PreferencePane.java | 6 +--- .../fr/design/layout/FRGUIPaneFactory.java | 18 +++++++++- .../fr/design/layout/VerticalFlowLayout.java | 33 +++++++++++-------- 3 files changed, 38 insertions(+), 19 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 57d9bbcb9..0ccb5d3e7 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -256,7 +256,7 @@ public class PreferencePane extends BasicPane { } private void createVcsSettingPane(JPanel generalPane) { - JPanel vcsPane = FRGUIPaneFactory.createVerticalTitledBorderPane(i18nText("Fine-Design_Vcs_Title")); + JPanel vcsPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(i18nText("Fine-Design_Vcs_Title")); generalPane.add(vcsPane); remindVcsLabel = new UILabel(i18nText("Fine-Design_Vcs_Remind")); remindVcsLabel.setVisible(!VcsHelper.getInstance().needInit()); @@ -449,10 +449,6 @@ public class PreferencePane extends BasicPane { JPanel colorSettingPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Preference_Setting_Colors")); generalPane.add(colorSettingPane); - new UILabel(i18nText("Fine-Design_Basic_Preference_Grid_Line_Color")); - - new UILabel(i18nText("Fine-Design_Basic_Preference_Pagination_Line_Color")); - gridLineColorTBButton = new UIColorButton(IOUtils.readIcon("/com/fr/design/images/gui/color/foreground.png")); gridLineColorTBButton.setEnabled(this.isEnabled()); diff --git a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java index 80efde739..f63d8f576 100644 --- a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java @@ -168,6 +168,22 @@ public class FRGUIPaneFactory { return jp; } + /** + * 创建一个带标题边框面板,垂直居左布局,组件顶对齐 + * + * @param string 边框标题 + * @return JPanel对象 + */ + public static JPanel createTopVerticalTitledBorderPane(String string) { + JPanel jp = new JPanel(); + UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string); + jp.setBorder(explainBorder); + VerticalFlowLayout layout = new VerticalFlowLayout(VerticalFlowLayout.TOP); + layout.setAlignLeft(true); + jp.setLayout(layout); + return jp; + } + /** * 创建一个带标题边框面板并且居中显示 * @@ -584,4 +600,4 @@ public class FRGUIPaneFactory { return h; } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/layout/VerticalFlowLayout.java b/designer-base/src/main/java/com/fr/design/layout/VerticalFlowLayout.java index 5d5131ff4..c857c7301 100644 --- a/designer-base/src/main/java/com/fr/design/layout/VerticalFlowLayout.java +++ b/designer-base/src/main/java/com/fr/design/layout/VerticalFlowLayout.java @@ -16,20 +16,17 @@ import java.awt.LayoutManager; public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { /** - * This value indicates that each row of components - * should be left-justified. + * 竖直方向上将子组件设置为顶对齐方式 */ public static final int TOP = 0; /** - * This value indicates that each row of components - * should be centered. + * 竖直方向上将子组件设置为居中对齐方式 */ public static final int CENTER = 1; /** - * This value indicates that each row of components - * should be right-justified. + * 竖直方向上将子组件设置为底对齐方式 */ public static final int BOTTOM = 2; @@ -71,7 +68,9 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { */ int newAlign; // This is the one we actually use - // 当列宽不一致时,是否需要左对齐(默认居中对齐) + /** + * 当列宽不一致时,是否需要将水平方向设置成左对齐(默认水平方向为居中对齐) + */ boolean isAlignLeft = false; /** @@ -220,6 +219,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { * @param name the name of the component * @param comp the component to be added */ + @Override public void addLayoutComponent(String name, Component comp) { } @@ -230,6 +230,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { * @param comp the component to remove * @see java.awt.Container#removeAll */ + @Override public void removeLayoutComponent(Component comp) { } @@ -244,6 +245,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { * @see #minimumLayoutSize * @see java.awt.Container#getPreferredSize */ + @Override public Dimension preferredLayoutSize(Container target) { synchronized (target.getTreeLock()) { Dimension dim = new Dimension(0, 0); @@ -255,7 +257,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { if (m.isVisible()) { Dimension d = m.getPreferredSize(); - firstVisibleComponent = dialWithDim4PreferredLayoutSize(dim, d, firstVisibleComponent); + firstVisibleComponent = dealWithDim4PreferredLayoutSize(dim, d, firstVisibleComponent); } } Insets insets = target.getInsets(); @@ -265,7 +267,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { } } - protected boolean dialWithDim4PreferredLayoutSize(Dimension dim, Dimension d, boolean firstVisibleComponent) { + protected boolean dealWithDim4PreferredLayoutSize(Dimension dim, Dimension d, boolean firstVisibleComponent) { dim.width = Math.max(dim.width, d.width); if (firstVisibleComponent) { firstVisibleComponent = false; @@ -289,6 +291,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { * @see java.awt.Container * @see java.awt.Container#doLayout */ + @Override public Dimension minimumLayoutSize(Container target) { synchronized (target.getTreeLock()) { Dimension dim = new Dimension(0, 0); @@ -300,7 +303,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { if (m.isVisible()) { Dimension d = m.getMinimumSize(); - firstVisibleComponent = dialWithDim4MinimumLayoutSize(dim, d, i, firstVisibleComponent); + firstVisibleComponent = dealWithDim4MinimumLayoutSize(dim, d, i, firstVisibleComponent); } } Insets insets = target.getInsets(); @@ -310,7 +313,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { } } - protected boolean dialWithDim4MinimumLayoutSize(Dimension dim, Dimension d, int i, boolean firstVisibleComponent) { + protected boolean dealWithDim4MinimumLayoutSize(Dimension dim, Dimension d, int i, boolean firstVisibleComponent) { dim.width = Math.max(dim.width, d.width); if (i > 0) { dim.height += vgap; @@ -370,6 +373,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { * @see java.awt.Container * @see java.awt.Container#doLayout */ + @Override public void layoutContainer(Container target) { synchronized (target.getTreeLock()) { Insets insets = target.getInsets(); @@ -410,7 +414,9 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { protected int[] dealWithDim4LayoutContainer(Container target, Insets insets, Dimension d, int x, int y, int roww, int start, int maxlen, int i, boolean ltr) { if ((y == 0) || ((y + d.height) <= maxlen)) { - if (y > 0) y += vgap; + if (y > 0) { + y += vgap; + } y += d.height; roww = Math.max(roww, d.width); } else { @@ -449,6 +455,7 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { * * @return a string representation of this layout */ + @Override public String toString() { String str = ""; switch (this.newAlign) { @@ -465,4 +472,4 @@ public class VerticalFlowLayout implements LayoutManager, java.io.Serializable { return getClass().getName() + "[hgap=" + hgap + ",vgap=" + vgap + str + "]"; } -} \ No newline at end of file +} From c5773e35f494a516ad44ae7b28e8a6a97e26f0c8 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 3 Aug 2020 17:45:03 +0800 Subject: [PATCH 2/5] =?UTF-8?q?REPORT-31986=20=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E9=BB=98=E8=AE=A4=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=BC=A9=E7=95=A5=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/TableDataCreatorProducer.java | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataCreatorProducer.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataCreatorProducer.java index dcb38c14e..bebcd14e2 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataCreatorProducer.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataCreatorProducer.java @@ -71,28 +71,42 @@ public class TableDataCreatorProducer { } public TableDataNameObjectCreator[] createServerTableDataCreator() { - TableDataNameObjectCreator dataBase = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Database_Query"), "/com/fr/design/images/data/dock/serverdatabase.png", DBTableData.class, + TableDataNameObjectCreator dataBase = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Database_Query"), + "ds", + "/com/fr/design/images/data/dock/serverdatabase.png", DBTableData.class, DBTableDataPane.class); - TableDataNameObjectCreator ds_Class = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Class"), "/com/fr/design/images/data/dock/serverclasstabledata.png", ClassTableData.class, + TableDataNameObjectCreator ds_Class = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Class"), + "Class", + "/com/fr/design/images/data/dock/serverclasstabledata.png", ClassTableData.class, ClassTableDataPane.class); - TableDataNameObjectCreator table = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Embedded"), "/com/fr/design/images/data/dock/serverdatatable.png", EmbeddedTableData.class, + TableDataNameObjectCreator table = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Embedded"), + "Embedded", + "/com/fr/design/images/data/dock/serverdatatable.png", EmbeddedTableData.class, EmbeddedTableDataPane.class); - TableDataNameObjectCreator fileTable = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_File"), "/com/fr/design/images/data/file.png", FileTableData.class, + TableDataNameObjectCreator fileTable = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_File"), + "File", + "/com/fr/design/images/data/file.png", FileTableData.class, FileTableDataSmallPane.class); - TableDataNameObjectCreator treeTable = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Tree"), "/com/fr/design/images/data/tree.png", + TableDataNameObjectCreator treeTable = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Tree"), + "Tree", + "/com/fr/design/images/data/tree.png", RecursionTableData.class, GlobalTreeTableDataPane.class) { public boolean isNeedParameterWhenPopulateJControlPane() { return true; } }; - TableDataNameObjectCreator multiTable = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Relation"), "/com/fr/design/images/data/multi.png", + TableDataNameObjectCreator multiTable = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Relation"), + "Multi", + "/com/fr/design/images/data/multi.png", ConditionTableData.class, GlobalMultiTDTableDataPane.class) { public boolean isNeedParameterWhenPopulateJControlPane() { return true; } }; - TableDataNameObjectCreator storeProcedure = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Stored_Procedure"), "/com/fr/design/images/data/store_procedure.png", + TableDataNameObjectCreator storeProcedure = new TableDataNameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Type_Stored_Procedure"), + "Proc", + "/com/fr/design/images/data/store_procedure.png", StoreProcedure.class, ProcedureDataPane.class) { @Override public boolean shouldInsertSeparator() { From 1d2507a4719f9626a9fbfd2c9c42dc951aa4d3e9 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 3 Aug 2020 23:06:59 +0800 Subject: [PATCH 3/5] =?UTF-8?q?CHART-11549=20=E4=BF=AE=E6=94=B9=E7=AE=B1?= =?UTF-8?q?=E5=9E=8B=E5=9B=BE=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/box/VanChartBoxBorderPane.java | 83 +++++++++++++++++++ .../chart/box/VanChartBoxConditionPane.java | 19 +++-- .../fr/van/chart/box/VanChartBoxPlotPane.java | 6 ++ .../van/chart/box/VanChartBoxSeriesPane.java | 30 ++++--- .../VanChartBoxBorderConditionPane.java | 49 +++++++++++ .../VanChartBoxNormalMarkerConditionPane.java | 50 +++++++++++ ...VanChartBoxOutlierMarkerConditionPane.java | 50 +++++++++++ .../component/VanChartMarkerPane.java | 8 +- 8 files changed, 277 insertions(+), 18 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxBorderPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxBorderConditionPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxNormalMarkerConditionPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxOutlierMarkerConditionPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxBorderPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxBorderPane.java new file mode 100644 index 000000000..ac8375651 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxBorderPane.java @@ -0,0 +1,83 @@ +package com.fr.van.chart.box; + +import com.fr.base.background.ColorBackground; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.plugin.chart.base.AttrBorderWithWidth; +import com.fr.stable.StringUtils; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.background.VanChartMarkerBackgroundPane; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; + +public class VanChartBoxBorderPane extends BasicBeanPane { + + private VanChartMarkerBackgroundPane colorBackground; + private UISpinner lineWidth; + + public VanChartBoxBorderPane() { + colorBackground = new VanChartMarkerBackgroundPane() { + + protected Component[][] getPaneComponents() { + return new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), typeComboBox}, + new Component[]{null, centerPane}, + }; + } + }; + lineWidth = new UISpinner(0.5, Double.MAX_VALUE, 0.5, 0.5); + + Component[][] components = new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")), lineWidth}, + new Component[]{colorBackground, null} + }; + + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + + double[] columnSize = {f, e}; + double[] rowSize = {p, p, p}; + + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + this.setLayout(new BorderLayout()); + this.add(panel, BorderLayout.CENTER); + } + + public void populateBean(AttrBorderWithWidth border) { + if (border.getBorderColor() != null) { + this.colorBackground.populate(ColorBackground.getInstance(border.getBorderColor())); + } + + this.lineWidth.setValue(border.getLineWidth()); + } + + public AttrBorderWithWidth updateBean() { + AttrBorderWithWidth border = new AttrBorderWithWidth(); + + ColorBackground colorBackground = this.colorBackground.update(); + + if (colorBackground == null) { + border.setBorderColor(null); + } else { + border.setBorderColor(colorBackground.getColor()); + } + + if (this.lineWidth != null) { + border.setLineWidth(this.lineWidth.getValue()); + } + + return border; + } + + protected String title4PopupWindow() { + return StringUtils.EMPTY; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxConditionPane.java index c0412a9f3..3ae76a247 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxConditionPane.java @@ -2,15 +2,19 @@ package com.fr.van.chart.box; import com.fr.chart.base.AttrAlpha; import com.fr.chart.base.AttrBackground; -import com.fr.chart.base.AttrBorder; import com.fr.chart.chartattr.Plot; import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; import com.fr.design.chart.series.SeriesCondition.LabelAlphaPane; +import com.fr.plugin.chart.base.AttrBorderWithWidth; +import com.fr.plugin.chart.box.VanChartAttrNormalMarker; +import com.fr.plugin.chart.box.VanChartAttrOutlierMarker; import com.fr.plugin.chart.box.VanChartBoxPlot; import com.fr.plugin.chart.type.ConditionKeyType; -import com.fr.van.chart.column.VanChartColumnLabelBorderPane; -import com.fr.van.chart.designer.other.condition.item.VanChartColumnSeriesColorConditionPane; +import com.fr.van.chart.box.condition.VanChartBoxBorderConditionPane; +import com.fr.van.chart.box.condition.VanChartBoxNormalMarkerConditionPane; +import com.fr.van.chart.box.condition.VanChartBoxOutlierMarkerConditionPane; +import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; import java.awt.Dimension; @@ -27,9 +31,14 @@ public class VanChartBoxConditionPane extends DataSeriesConditionPane { } protected void addBasicAction() { - classPaneMap.put(AttrBackground.class, new VanChartColumnSeriesColorConditionPane(this)); + classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this)); classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this)); - classPaneMap.put(AttrBorder.class, new VanChartColumnLabelBorderPane(this)); + classPaneMap.put(AttrBorderWithWidth.class, new VanChartBoxBorderConditionPane(this)); + + if (((VanChartBoxPlot) plot).isDetailed()) { + classPaneMap.put(VanChartAttrNormalMarker.class, new VanChartBoxNormalMarkerConditionPane(this)); + classPaneMap.put(VanChartAttrOutlierMarker.class, new VanChartBoxOutlierMarkerConditionPane(this)); + } } protected void addStyleAction() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotPane.java index 2679f7eba..f019bc99e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotPane.java @@ -3,6 +3,7 @@ package com.fr.van.chart.box; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.box.BoxIndependentVanChart; import com.fr.plugin.chart.box.VanChartBoxPlot; import com.fr.van.chart.designer.type.AbstractVanChartTypePane; @@ -42,4 +43,9 @@ public class VanChartBoxPlotPane extends AbstractVanChartTypePane { return BoxIndependentVanChart.BoxVanChartTypes[0]; } + protected VanChartTools createVanChartTools() { + VanChartTools tools = new VanChartTools(); + tools.setSort(false); + return tools; + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java index 617d3e5e7..8f0b5480b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java @@ -9,7 +9,6 @@ import com.fr.plugin.chart.box.VanChartBoxPlot; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartBeautyPane; import com.fr.van.chart.designer.component.VanChartMarkerPane; -import com.fr.van.chart.designer.component.border.VanChartBorderPane; import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane; import javax.swing.JPanel; @@ -18,6 +17,8 @@ import java.awt.Component; public class VanChartBoxSeriesPane extends VanChartAbstractPlotSeriesPane { + private VanChartBoxBorderPane boxBorderPane; + private JPanel normalMarker; private JPanel outlierMarker; @@ -36,7 +37,7 @@ public class VanChartBoxSeriesPane extends VanChartAbstractPlotSeriesPane { double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ - new Component[]{createBorderPane()}, + new Component[]{createBoxBorderPane()}, new Component[]{createNormalValuePane()}, new Component[]{createOutlierValuePane()} }; @@ -46,20 +47,21 @@ public class VanChartBoxSeriesPane extends VanChartAbstractPlotSeriesPane { return contentPane; } - protected VanChartBorderPane createDiffBorderPane() { - return new VanChartBorderPane(); + private JPanel createBoxBorderPane() { + boxBorderPane = new VanChartBoxBorderPane(); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), boxBorderPane); } private JPanel createNormalValuePane() { normalValuePane = new VanChartMarkerPane(); - normalMarker = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Engine_Chart_Normal_Value"), normalValuePane); + normalMarker = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Normal_Value"), normalValuePane); return normalMarker; } private JPanel createOutlierValuePane() { outlierValuePane = new VanChartMarkerPane(); - outlierMarker = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Engine_Chart_Outlier_Value"), outlierValuePane); + outlierMarker = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Outlier_Value"), outlierValuePane); return outlierMarker; } @@ -85,10 +87,13 @@ public class VanChartBoxSeriesPane extends VanChartAbstractPlotSeriesPane { super.populateBean(plot); if (plot instanceof VanChartBoxPlot) { - normalValuePane.populate(((VanChartBoxPlot) plot).getNormalValue()); - outlierValuePane.populate(((VanChartBoxPlot) plot).getOutlierValue()); + VanChartBoxPlot boxPlot = (VanChartBoxPlot) plot; + + boxBorderPane.populateBean(boxPlot.getBorder()); + normalValuePane.populate(boxPlot.getNormalValue()); + outlierValuePane.populate(boxPlot.getOutlierValue()); - checkMarkerPane(((VanChartBoxPlot) plot).isDetailed()); + checkMarkerPane(boxPlot.isDetailed()); } } @@ -98,8 +103,11 @@ public class VanChartBoxSeriesPane extends VanChartAbstractPlotSeriesPane { } if (plot instanceof VanChartBoxPlot) { - ((VanChartBoxPlot) plot).setNormalValue(normalValuePane.update()); - ((VanChartBoxPlot) plot).setOutlierValue(outlierValuePane.update()); + VanChartBoxPlot boxPlot = (VanChartBoxPlot) plot; + + boxPlot.setBorder(boxBorderPane.updateBean()); + boxPlot.setNormalValue(normalValuePane.update()); + boxPlot.setOutlierValue(outlierValuePane.update()); } super.updateBean(plot); diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxBorderConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxBorderConditionPane.java new file mode 100644 index 000000000..737c903d4 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxBorderConditionPane.java @@ -0,0 +1,49 @@ +package com.fr.van.chart.box.condition; + +import com.fr.chart.base.DataSeriesCondition; +import com.fr.design.condition.ConditionAttributesPane; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.base.AttrBorderWithWidth; +import com.fr.van.chart.box.VanChartBoxBorderPane; +import com.fr.van.chart.designer.other.condition.item.AbstractNormalMultiLineConditionPane; + +import javax.swing.JPanel; + +public class VanChartBoxBorderConditionPane extends AbstractNormalMultiLineConditionPane { + private VanChartBoxBorderPane borderPane; + + protected JPanel initContentPane() { + borderPane = new VanChartBoxBorderPane(); + return borderPane; + } + + public VanChartBoxBorderConditionPane(ConditionAttributesPane conditionAttributesPane) { + super(conditionAttributesPane); + } + + public String nameForPopupMenuItem() { + return Toolkit.i18nText("Fine-Design_Chart_Border"); + } + + protected String getItemLabelString() { + return nameForPopupMenuItem(); + } + + protected String title4PopupWindow() { + return nameForPopupMenuItem(); + } + + public void setDefault() { + borderPane.populateBean(new AttrBorderWithWidth()); + } + + public void populate(DataSeriesCondition condition) { + if (condition instanceof AttrBorderWithWidth) { + this.borderPane.populateBean((AttrBorderWithWidth) condition); + } + } + + public DataSeriesCondition update() { + return this.borderPane.updateBean(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxNormalMarkerConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxNormalMarkerConditionPane.java new file mode 100644 index 000000000..f3c28262b --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxNormalMarkerConditionPane.java @@ -0,0 +1,50 @@ +package com.fr.van.chart.box.condition; + +import com.fr.chart.base.DataSeriesCondition; +import com.fr.design.condition.ConditionAttributesPane; +import com.fr.plugin.chart.base.VanChartAttrMarker; +import com.fr.plugin.chart.box.VanChartAttrNormalMarker; +import com.fr.plugin.chart.marker.type.MarkerType; +import com.fr.van.chart.designer.component.VanChartMarkerPane; +import com.fr.van.chart.designer.other.condition.item.VanChartMarkerConditionPane; + +public class VanChartBoxNormalMarkerConditionPane extends VanChartMarkerConditionPane { + + public VanChartBoxNormalMarkerConditionPane(ConditionAttributesPane conditionAttributesPane) { + super(conditionAttributesPane); + } + + public String nameForPopupMenuItem() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Normal_Value"); + } + + protected String getItemLabelString() { + return nameForPopupMenuItem(); + } + + protected void initMarkerPane() { + markerPane = new VanChartMarkerPane() { + + protected VanChartAttrMarker createNewAttrMarker() { + return new VanChartAttrNormalMarker(); + } + }; + } + + public void setDefault() { + VanChartAttrNormalMarker normalMarker = new VanChartAttrNormalMarker(); + normalMarker.setMarkerType(MarkerType.MARKER_CIRCLE); + + markerPane.populate(new VanChartAttrNormalMarker()); + } + + public void populate(DataSeriesCondition condition) { + if (condition instanceof VanChartAttrNormalMarker) { + markerPane.populate((VanChartAttrNormalMarker) condition); + } + } + + public DataSeriesCondition update() { + return markerPane.update(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxOutlierMarkerConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxOutlierMarkerConditionPane.java new file mode 100644 index 000000000..1f6c6a2e1 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxOutlierMarkerConditionPane.java @@ -0,0 +1,50 @@ +package com.fr.van.chart.box.condition; + +import com.fr.chart.base.DataSeriesCondition; +import com.fr.design.condition.ConditionAttributesPane; +import com.fr.plugin.chart.base.VanChartAttrMarker; +import com.fr.plugin.chart.box.VanChartAttrOutlierMarker; +import com.fr.plugin.chart.marker.type.MarkerType; +import com.fr.van.chart.designer.component.VanChartMarkerPane; +import com.fr.van.chart.designer.other.condition.item.VanChartMarkerConditionPane; + +public class VanChartBoxOutlierMarkerConditionPane extends VanChartMarkerConditionPane { + + public VanChartBoxOutlierMarkerConditionPane(ConditionAttributesPane conditionAttributesPane) { + super(conditionAttributesPane); + } + + public String nameForPopupMenuItem() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Outlier_Value"); + } + + protected String getItemLabelString() { + return nameForPopupMenuItem(); + } + + public void setDefault() { + VanChartAttrOutlierMarker outlierMarker = new VanChartAttrOutlierMarker(); + outlierMarker.setMarkerType(MarkerType.MARKER_CIRCLE_HOLLOW); + + markerPane.populate(outlierMarker); + } + + protected void initMarkerPane() { + markerPane = new VanChartMarkerPane() { + + protected VanChartAttrMarker createNewAttrMarker() { + return new VanChartAttrOutlierMarker(); + } + }; + } + + public void populate(DataSeriesCondition condition) { + if (condition instanceof VanChartAttrOutlierMarker) { + markerPane.populate((VanChartAttrOutlierMarker) condition); + } + } + + public DataSeriesCondition update() { + return markerPane.update(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java index 58d717af1..1f8b55cfb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java @@ -104,9 +104,13 @@ public class VanChartMarkerPane extends BasicPane { return Toolkit.i18nText("Fine-Design_Chart_Marker"); } + protected VanChartAttrMarker createNewAttrMarker(){ + return new VanChartAttrMarker(); + } + public void populate(VanChartAttrMarker marker) { if(marker == null){ - marker = new VanChartAttrMarker(); + marker = createNewAttrMarker(); } commonORCustom.setSelectedIndex(marker.isCommon() ? 0 : 1); if(marker.isCommon()){ @@ -120,7 +124,7 @@ public class VanChartMarkerPane extends BasicPane { } public VanChartAttrMarker update() { - VanChartAttrMarker marker = new VanChartAttrMarker(); + VanChartAttrMarker marker = createNewAttrMarker(); if(commonORCustom.getSelectedIndex() == 0){ commonMarkerPane.updateBean(marker); } else { From a1e2338e01a0bac442f9438e459f374f2e250974 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 3 Aug 2020 23:25:14 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=85=A8=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/van/chart/box/VanChartBoxBorderPane.java | 2 +- .../box/condition/VanChartBoxNormalMarkerConditionPane.java | 3 ++- .../box/condition/VanChartBoxOutlierMarkerConditionPane.java | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxBorderPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxBorderPane.java index ac8375651..a5a9bec1b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxBorderPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxBorderPane.java @@ -26,7 +26,7 @@ public class VanChartBoxBorderPane extends BasicBeanPane { protected Component[][] getPaneComponents() { return new Component[][]{ new Component[]{null, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), typeComboBox}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), typeComboBox}, new Component[]{null, centerPane}, }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxNormalMarkerConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxNormalMarkerConditionPane.java index f3c28262b..017867dec 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxNormalMarkerConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxNormalMarkerConditionPane.java @@ -2,6 +2,7 @@ package com.fr.van.chart.box.condition; import com.fr.chart.base.DataSeriesCondition; import com.fr.design.condition.ConditionAttributesPane; +import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.box.VanChartAttrNormalMarker; import com.fr.plugin.chart.marker.type.MarkerType; @@ -15,7 +16,7 @@ public class VanChartBoxNormalMarkerConditionPane extends VanChartMarkerConditio } public String nameForPopupMenuItem() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Normal_Value"); + return Toolkit.i18nText("Fine-Design_Chart_Normal_Value"); } protected String getItemLabelString() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxOutlierMarkerConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxOutlierMarkerConditionPane.java index 1f6c6a2e1..0c33a788c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxOutlierMarkerConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/condition/VanChartBoxOutlierMarkerConditionPane.java @@ -2,6 +2,7 @@ package com.fr.van.chart.box.condition; import com.fr.chart.base.DataSeriesCondition; import com.fr.design.condition.ConditionAttributesPane; +import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.box.VanChartAttrOutlierMarker; import com.fr.plugin.chart.marker.type.MarkerType; @@ -15,7 +16,7 @@ public class VanChartBoxOutlierMarkerConditionPane extends VanChartMarkerConditi } public String nameForPopupMenuItem() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Outlier_Value"); + return Toolkit.i18nText("Fine-Design_Chart_Outlier_Value"); } protected String getItemLabelString() { From 0ac0a2e411a1c7ae2b13e77777c810f9a291773e Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 4 Aug 2020 15:33:25 +0800 Subject: [PATCH 5/5] =?UTF-8?q?CHART-11549=20=E7=AE=B1=E5=9E=8B=E5=9B=BE?= =?UTF-8?q?=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/van/chart/box/VanChartBoxTooltipContentPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java index 870250d65..2b449785e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java @@ -62,7 +62,7 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { }; outlier = new VanChartFormatPaneWithCheckBox(parent, showOnPane) { protected String getCheckBoxText() { - return Toolkit.i18nText("Fine-Engine_Chart_Outlier_Value"); + return Toolkit.i18nText("Fine-Design_Chart_Outlier_Value"); } }; }