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 15cba5c8d6..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 @@ -32,7 +32,6 @@ public class VanChartCommonMarkerPane extends BasicBeanPane private JPanel markerConfigPane; private static final MarkerType[] NORMAL_TYPES = { - MarkerType.MARKER_NULL, MarkerType.MARKER_CIRCLE, MarkerType.MARKER_SQUARE, MarkerType.MARKER_DIAMOND, @@ -42,77 +41,22 @@ public class VanChartCommonMarkerPane extends BasicBeanPane MarkerType.MARKER_DIAMOND_HOLLOW, MarkerType.MARKER_TRIANGLE_HOLLOW }; - private static Marker[] normalMarkers = null; - - protected static Marker[] getNormalMarkers() { - if (normalMarkers == null) { - normalMarkers = new Marker[NORMAL_TYPES.length]; - int i = 0; - for (MarkerType markerType : NORMAL_TYPES) { - normalMarkers[i++] = Marker.createMarker(markerType); - } - } - return normalMarkers; - } - private static Marker[] normalMarkersWithAuto = null; + protected Marker[] getNormalMarkersWithCustom(MarkerType[] types) { + MarkerType[] customTypes = types == null ? new MarkerType[0] : types; + Marker[] result = new Marker[customTypes.length + NORMAL_TYPES.length]; - protected static Marker[] getNormalMarkersWithAuto() { - if (normalMarkersWithAuto == null) { - normalMarkersWithAuto = new Marker[NORMAL_TYPES.length + 1]; - normalMarkersWithAuto[0] = Marker.createMarker(MarkerType.MARKER_AUTO); + int i = 0; - int i = 1; - - for (MarkerType markerType : NORMAL_TYPES) { - normalMarkersWithAuto[i++] = Marker.createMarker(markerType); - } + for (MarkerType markerType : customTypes) { + result[i++] = Marker.createMarker(markerType); } - return normalMarkersWithAuto; - } - //没有无这个选项 - private static final MarkerType[] MAP_TYPES = { - MarkerType.MARKER_CIRCLE, - MarkerType.MARKER_SQUARE, - MarkerType.MARKER_DIAMOND, - MarkerType.MARKER_TRIANGLE, - MarkerType.MARKER_CIRCLE_HOLLOW, - MarkerType.MARKER_SQUARE_HOLLOW, - MarkerType.MARKER_DIAMOND_HOLLOW, - MarkerType.MARKER_TRIANGLE_HOLLOW - }; - private static Marker[] mapMarkers = null; - - protected static Marker[] getMapScatterMarkers() { - if (mapMarkers == null) { - mapMarkers = new Marker[MAP_TYPES.length]; - int i = 0; - for (MarkerType markerType : MAP_TYPES) { - mapMarkers[i++] = Marker.createMarker(markerType); - } + for (MarkerType markerType : NORMAL_TYPES) { + result[i++] = Marker.createMarker(markerType); } - return mapMarkers; - } - //甘特图的菱形是实心的,之前写的空心。 - //兼容:模板属性不做兼容。只是之前空心做界面兼容。前台展现实心空心一样的效果,所以不用做什么 - 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; + return result; } public MarkerComboBox getMarkerTypeComboBox() { @@ -184,7 +128,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane if (markerConfigPane != null && markerTypeComboBox != null) { MarkerType type = MarkerType.parse(markerTypeComboBox.getSelectedMarkder().getMarkerType()); - markerConfigPane.setVisible(!(type == MarkerType.MARKER_AUTO || type == MarkerType.MARKER_NULL)); + markerConfigPane.setVisible(type != MarkerType.MARKER_NULL); } } @@ -195,7 +139,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane } protected Marker[] getMarkers() { - return getNormalMarkers(); + 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 974bc5e42d..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 getNormalMarkersWithAuto(); + 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 4041152f45..8d8c16ebaa 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 getMapScatterMarkers(); + return getNormalMarkersWithCustom(new MarkerType[0]); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java index 10b762350d..ce91afe7e7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java @@ -17,10 +17,10 @@ import com.fr.plugin.chart.scatter.attr.ScatterAttrTooltip; import com.fr.van.chart.bubble.VanChartBubbleConditionSelectionPane; import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.other.condition.item.VanChartEffectConditionPane; -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.VanChartTrendLineConditionPane; import com.fr.van.chart.scatter.component.VanChartScatterLineTypeConditionPane; +import com.fr.van.chart.scatter.component.VanChartScatterMarkerConditionPane; import com.fr.van.chart.scatter.component.label.VanChartScatterLabelConditionPane; import com.fr.van.chart.scatter.component.tooltip.VanChartScatterTooltipConditionPane; import com.fr.van.chart.scatter.large.VanChartLargeModelMarkerConditionPane; @@ -56,7 +56,7 @@ public class VanChartScatterConditionPane extends DataSeriesConditionPane { classPaneMap.put(VanChartAttrMarker.class, new VanChartLargeModelMarkerConditionPane(this)); } else { classPaneMap.put(VanChartAttrLine.class, new VanChartScatterLineTypeConditionPane(this)); - classPaneMap.put(VanChartAttrMarker.class, new VanChartMarkerConditionPane(this)); + classPaneMap.put(VanChartAttrMarker.class, new VanChartScatterMarkerConditionPane(this)); classPaneMap.put(ScatterAttrLabel.class, new VanChartScatterLabelConditionPane(this, plot)); classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getScatterPlotDefaultEffect())); } 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 c6d7f8af6c..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 @@ -1,13 +1,18 @@ package com.fr.van.chart.scatter; import com.fr.chart.chartattr.Plot; +import com.fr.chart.chartglyph.Marker; import com.fr.design.beans.BasicBeanPane; +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; +import com.fr.van.chart.designer.component.VanChartMarkerPane; +import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane; import com.fr.van.chart.designer.style.series.VanChartStackedAndAxisListControlPane; import com.fr.van.chart.scatter.component.VanChartScatterLineTypePane; @@ -63,7 +68,7 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane { @Override public String getPaneTitle() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Axis"); + return Toolkit.i18nText("Fine-Design_Chart_Custom_Axis"); } }; stackAndAxisEditExpandablePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane); @@ -81,4 +86,19 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane { checkLinePane(); } + + protected JPanel createMarkerPane() { + markerPane = new VanChartMarkerPane() { + protected VanChartCommonMarkerPane createCommonMarkerPane() { + + return new VanChartCommonMarkerPane() { + protected Marker[] getMarkers() { + return getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO}); + } + }; + } + }; + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); + } } 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 new file mode 100644 index 0000000000..06b617401a --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterMarkerConditionPane.java @@ -0,0 +1,28 @@ +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; + +public class VanChartScatterMarkerConditionPane extends VanChartMarkerConditionPane { + + public VanChartScatterMarkerConditionPane(ConditionAttributesPane conditionAttributesPane) { + super(conditionAttributesPane); + } + + protected void initMarkerPane() { + markerPane = new VanChartMarkerPane() { + protected VanChartCommonMarkerPane createCommonMarkerPane() { + + return new VanChartCommonMarkerPane() { + protected Marker[] getMarkers() { + return getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO}); + } + }; + } + }; + } +}