From c17a088c673b899c17f2fbe9799b733ad6d002cd Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 28 Apr 2020 15:31:27 +0800 Subject: [PATCH] =?UTF-8?q?CHART-13031=20=E9=9B=B7=E8=BE=BE=E5=9B=BE?= =?UTF-8?q?=E3=80=81=E9=9D=A2=E7=A7=AF=E5=9B=BE=E7=9A=84=E7=B3=BB=E5=88=97?= =?UTF-8?q?=E7=BA=BF=E5=9E=8B=E5=92=8C=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E7=BA=BF=E5=9E=8B=E4=B8=8D=E6=94=AF=E6=8C=81=E8=99=9A=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/area/VanChartAreaConditionPane.java | 4 +-- .../chart/area/VanChartAreaSeriesPane.java | 6 ++++ .../component/VanChartLineTypePane.java | 30 ++++++++++++------- .../VanChartLineTypePaneWithoutDashed.java | 11 +++++++ .../component/VanChartLineWidthPane.java | 2 +- ...artLineTypeConditionPaneWithoutDashed.java | 16 ++++++++++ .../VanChartScatterLineTypePane.java | 4 +-- 7 files changed, 57 insertions(+), 16 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePaneWithoutDashed.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineTypeConditionPaneWithoutDashed.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaConditionPane.java index c2de07ada9..f0ec07136a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaConditionPane.java @@ -20,7 +20,7 @@ import com.fr.van.chart.designer.other.condition.item.VanChartAreaFillColorCondi import com.fr.van.chart.designer.other.condition.item.VanChartDataSheetContentPane; import com.fr.van.chart.designer.other.condition.item.VanChartEffectConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; -import com.fr.van.chart.designer.other.condition.item.VanChartLineTypeConditionPane; +import com.fr.van.chart.designer.other.condition.item.VanChartLineTypeConditionPaneWithoutDashed; import com.fr.van.chart.designer.other.condition.item.VanChartMarkerConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartTooltipConditionPane; @@ -50,7 +50,7 @@ public class VanChartAreaConditionPane extends DataSeriesConditionPane { classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this)); classPaneMap.put(VanChartAttrTrendLine.class, new VanChartTrendLineConditionPane(this)); classPaneMap.put(AttrAreaSeriesFillColorBackground.class, new VanChartAreaFillColorConditionPane(this, plot)); - classPaneMap.put(VanChartAttrLine.class, new VanChartLineTypeConditionPane(this)); + classPaneMap.put(VanChartAttrLine.class, new VanChartLineTypeConditionPaneWithoutDashed(this)); classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot)); //是否使用数据表 if (plot.getDataSheet().isVisible()) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java index d3b511b1f2..97c1c89fe3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java @@ -7,6 +7,8 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.van.chart.column.VanChartCustomStackAndAxisConditionPane; import com.fr.van.chart.designer.component.VanChartBeautyPane; +import com.fr.van.chart.designer.component.VanChartLineTypePane; +import com.fr.van.chart.designer.component.VanChartLineTypePaneWithoutDashed; import com.fr.van.chart.line.VanChartLineSeriesPane; import javax.swing.JPanel; @@ -49,4 +51,8 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane { protected VanChartBeautyPane createStylePane() { return new VanChartBeautyPane(); } + + protected VanChartLineTypePane getLineTypePane() { + return new VanChartLineTypePaneWithoutDashed(); + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java index 0221029092..10c3308b3c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java @@ -34,7 +34,7 @@ public class VanChartLineTypePane extends BasicPane { private LineTypeComboBox lineTypeComboBox;//线型 private UISpinner lineWidthSpinner;//线宽 - protected UIButtonGroup lineStyle;//形态 + private UIButtonGroup lineStyle;//形态 private UIButtonGroup nullValueBreak;//空值断开 private JPanel lineWidthPane; @@ -44,7 +44,7 @@ public class VanChartLineTypePane extends BasicPane { JPanel typeAndWidthPane = createTypeAndWidthPane(); - createLineStyle(); + lineStyle = createLineStyle(); nullValueBreak = new UIButtonGroup(new String[]{ Toolkit.i18nText("Fine-Design_Chart_Open"), @@ -72,7 +72,7 @@ public class VanChartLineTypePane extends BasicPane { private JPanel createTypeAndWidthPane() { - lineTypeComboBox = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); + lineTypeComboBox = createLineType(); lineWidthSpinner = new UISpinner(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE); @@ -85,6 +85,7 @@ public class VanChartLineTypePane extends BasicPane { }); Component[][] lineTypeComps = new Component[][]{ + new Component[]{null, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineTypeComboBox} }; Component[][] lineWidthComps = new Component[][]{ @@ -94,10 +95,10 @@ public class VanChartLineTypePane extends BasicPane { }; double p = TableLayout.PREFERRED, f = TableLayout.FILL, e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] row = {p}, col = {f, e}; + double[] col = {f, e}; - JPanel lineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineTypeComps, row, col); - lineWidthPane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineWidthComps, row, col); + JPanel lineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineTypeComps, new double[]{p, p}, col); + lineWidthPane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineWidthComps, new double[]{p}, col); JPanel contentPane = new JPanel(new BorderLayout(0, 6)); @@ -107,10 +108,17 @@ public class VanChartLineTypePane extends BasicPane { return contentPane; } - protected void createLineStyle() { - String[] textArray = new String[]{Toolkit.i18nText("Fine-Design_Chart_Normal_Line"), - Toolkit.i18nText("Fine-Design_Chart_StepLine"), Toolkit.i18nText("Fine-Design_Chart_CurveLine")}; - lineStyle = new UIButtonGroup(textArray, LineStyle.values()); + protected LineTypeComboBox createLineType() { + return new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); + } + + protected UIButtonGroup createLineStyle() { + String[] textArray = new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Normal_Line"), + Toolkit.i18nText("Fine-Design_Chart_StepLine"), + Toolkit.i18nText("Fine-Design_Chart_CurveLine")}; + + return new UIButtonGroup<>(textArray, LineStyle.values()); } protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) { @@ -128,7 +136,7 @@ public class VanChartLineTypePane extends BasicPane { private void checkLineStyle() { if (lineStylePane != null && lineTypeComboBox != null) { - lineStylePane.setVisible(!ComparatorUtils.equals(lineTypeComboBox.getSelectedItem(),LineType.NONE)); + lineStylePane.setVisible(!ComparatorUtils.equals(lineTypeComboBox.getSelectedItem(), LineType.NONE)); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePaneWithoutDashed.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePaneWithoutDashed.java new file mode 100644 index 0000000000..55e75f88bc --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePaneWithoutDashed.java @@ -0,0 +1,11 @@ +package com.fr.van.chart.designer.component; + +import com.fr.plugin.chart.type.LineType; + +public class VanChartLineTypePaneWithoutDashed extends VanChartLineTypePane{ + + @Override + protected LineTypeComboBox createLineType() { + return new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID}); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java index 48f622654e..46f461e69d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java @@ -5,7 +5,7 @@ import java.awt.Component; /** * 线型+线宽+空值断开 */ -public class VanChartLineWidthPane extends VanChartLineTypePane { +public class VanChartLineWidthPane extends VanChartLineTypePaneWithoutDashed { private static final long serialVersionUID = 4537158946119294689L; @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineTypeConditionPaneWithoutDashed.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineTypeConditionPaneWithoutDashed.java new file mode 100644 index 0000000000..f9ec11dbc7 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineTypeConditionPaneWithoutDashed.java @@ -0,0 +1,16 @@ +package com.fr.van.chart.designer.other.condition.item; + +import com.fr.design.condition.ConditionAttributesPane; +import com.fr.van.chart.designer.component.VanChartLineTypePane; +import com.fr.van.chart.designer.component.VanChartLineTypePaneWithoutDashed; + +public class VanChartLineTypeConditionPaneWithoutDashed extends VanChartLineTypeConditionPane { + + public VanChartLineTypeConditionPaneWithoutDashed(ConditionAttributesPane conditionAttributesPane) { + super(conditionAttributesPane); + } + + protected VanChartLineTypePane createLinePane() { + return new VanChartLineTypePaneWithoutDashed(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java index 100b111a50..340b93f147 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java @@ -15,12 +15,12 @@ import java.awt.Component; public class VanChartScatterLineTypePane extends VanChartLineTypePane { @Override - protected void createLineStyle() { + protected UIButtonGroup createLineStyle() { String[] textArray = new String[]{ Toolkit.i18nText("Fine-Design_Chart_Normal_Line"), Toolkit.i18nText("Fine-Design_Chart_CurveLine")}; - lineStyle = new UIButtonGroup<>(textArray, new LineStyle[]{LineStyle.NORMAL, LineStyle.CURVE}); + return new UIButtonGroup<>(textArray, new LineStyle[]{LineStyle.NORMAL, LineStyle.CURVE}); } @Override