From 651b1dbb3e2cfe285897cfb3908c9c3bf2b57a7a Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 11 May 2020 16:56:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=9D=99=E6=80=81=E5=8F=98?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../marker/VanChartCommonMarkerPane.java | 60 +------------------ .../series/VanChartGanttCommonMarkerPane.java | 18 +++++- .../chart/line/VanChartLineSeriesPane.java | 3 +- .../series/VanChartMapScatterMarkerPane.java | 3 +- .../scatter/VanChartScatterSeriesPane.java | 3 +- .../VanChartScatterMarkerConditionPane.java | 3 +- 6 files changed, 27 insertions(+), 63 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java index a35b8b64a0..444bebfaa1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java @@ -41,12 +41,8 @@ public class VanChartCommonMarkerPane extends BasicBeanPane MarkerType.MARKER_DIAMOND_HOLLOW, MarkerType.MARKER_TRIANGLE_HOLLOW }; - private static Marker[] normalMarkers = null; - private static Marker[] normalMarkersWithNull = null; - private static Marker[] normalMarkersWithAuto = null; - private static Marker[] normalMarkersWithAutoAndNull = null; - private static Marker[] getNormalMarkersWithCustom(MarkerType[] types) { + protected Marker[] getNormalMarkersWithCustom(MarkerType[] types) { MarkerType[] customTypes = types == null ? new MarkerType[0] : types; Marker[] result = new Marker[customTypes.length + NORMAL_TYPES.length]; @@ -63,58 +59,6 @@ public class VanChartCommonMarkerPane extends BasicBeanPane return result; } - protected static Marker[] getNormalMarkers() { - if (normalMarkers == null) { - normalMarkers = getNormalMarkersWithCustom(new MarkerType[0]); - } - - return normalMarkers; - } - - protected static Marker[] getNormalMarkersWithNull() { - if (normalMarkersWithNull == null) { - normalMarkersWithNull = getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_NULL}); - } - - return normalMarkersWithNull; - } - - protected static Marker[] getNormalMarkersWithAuto() { - if (normalMarkersWithAuto == null) { - normalMarkersWithAuto = getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO}); - } - - return normalMarkersWithAuto; - } - - protected static Marker[] getNormalMarkersWithAutoAndNull() { - if (normalMarkersWithAutoAndNull == null) { - normalMarkersWithAutoAndNull = getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO, MarkerType.MARKER_NULL}); - } - - return normalMarkersWithAutoAndNull; - } - - //甘特图的菱形是实心的,之前写的空心。 - //兼容:模板属性不做兼容。只是之前空心做界面兼容。前台展现实心空心一样的效果,所以不用做什么 - private static final MarkerType[] GANTT_TYPES = { - MarkerType.MARKER_TRIANGLE, - MarkerType.MARKER_DIAMOND, - MarkerType.MARKER_STAR - }; - private static Marker[] ganttMarkers = null; - - protected static Marker[] getGanttMarkers() { - if (ganttMarkers == null) { - ganttMarkers = new Marker[GANTT_TYPES.length]; - int i = 0; - for (MarkerType markerType : GANTT_TYPES) { - ganttMarkers[i++] = Marker.createMarker(markerType); - } - } - return ganttMarkers; - } - public MarkerComboBox getMarkerTypeComboBox() { return markerTypeComboBox; } @@ -195,7 +139,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane } protected Marker[] getMarkers() { - return getNormalMarkersWithNull(); + return getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_NULL}); } /** diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttCommonMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttCommonMarkerPane.java index ff7b04e6f0..1a438d6d4f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttCommonMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttCommonMarkerPane.java @@ -18,11 +18,27 @@ import java.awt.Component; public class VanChartGanttCommonMarkerPane extends VanChartCommonMarkerPane { private static final int PREFERRED_WIDTH = 100; + //甘特图的菱形是实心的,之前写的空心。 + //兼容:模板属性不做兼容。只是之前空心做界面兼容。前台展现实心空心一样的效果,所以不用做什么 + private static final MarkerType[] GANTT_TYPES = { + MarkerType.MARKER_TRIANGLE, + MarkerType.MARKER_DIAMOND, + MarkerType.MARKER_STAR + }; + private ColorSelectBoxWithOutTransparent colorSelect; @Override protected Marker[] getMarkers() { - return getGanttMarkers(); + Marker[] result = new Marker[GANTT_TYPES.length]; + + int i = 0; + + for (MarkerType markerType : GANTT_TYPES) { + result[i++] = Marker.createMarker(markerType); + } + + return result; } protected Component[][] getMarkerTypeComponent() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java index 49a4f44654..5b0999ca3f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java @@ -6,6 +6,7 @@ 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.ChartStylePane; +import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartBeautyPane; import com.fr.van.chart.designer.component.VanChartMarkerPane; @@ -55,7 +56,7 @@ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane { return new VanChartCommonMarkerPane() { protected Marker[] getMarkers() { - return getNormalMarkersWithAutoAndNull(); + return getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO, MarkerType.MARKER_NULL}); } }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java index 175cc8e253..2c70860c75 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java @@ -3,6 +3,7 @@ package com.fr.van.chart.map.designer.style.series; import com.fr.chart.chartglyph.Marker; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; @@ -23,7 +24,7 @@ public class VanChartMapScatterMarkerPane extends VanChartCommonMarkerPane { @Override protected Marker[] getMarkers() { - return getNormalMarkers(); + return getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_NULL}); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java index 938f21da1e..1bbb71e4df 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java @@ -7,6 +7,7 @@ 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.ChartStylePane; +import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.van.chart.custom.component.VanChartCustomAxisConditionPane; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartLineTypePane; @@ -92,7 +93,7 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane { return new VanChartCommonMarkerPane() { protected Marker[] getMarkers() { - return getNormalMarkersWithAuto(); + return getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO}); } }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterMarkerConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterMarkerConditionPane.java index 4ac8543a60..06b617401a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterMarkerConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterMarkerConditionPane.java @@ -2,6 +2,7 @@ package com.fr.van.chart.scatter.component; import com.fr.chart.chartglyph.Marker; import com.fr.design.condition.ConditionAttributesPane; +import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.van.chart.designer.component.VanChartMarkerPane; import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; import com.fr.van.chart.designer.other.condition.item.VanChartMarkerConditionPane; @@ -18,7 +19,7 @@ public class VanChartScatterMarkerConditionPane extends VanChartMarkerConditionP return new VanChartCommonMarkerPane() { protected Marker[] getMarkers() { - return getNormalMarkersWithAuto(); + return getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO}); } }; }