From b4d54d63480d8c510aa1e82b551a6dc5b6da2750 Mon Sep 17 00:00:00 2001 From: zheng Date: Fri, 31 Aug 2018 14:35:53 +0800 Subject: [PATCH] CHART-2893 910 --- .../designer/component/VanChartMarkerPane.java | 6 +++--- .../component/marker/VanChartCommonMarkerPane.java | 4 +++- .../series/VanChartGanttCommonMarkerPane.java | 14 ++++++++++++-- .../style/series/VanChartGanttSeriesPane.java | 4 ++-- 4 files changed, 20 insertions(+), 8 deletions(-) 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 89779c6286..e2aff03f54 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 @@ -3,7 +3,6 @@ package com.fr.van.chart.designer.component; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButtonGroup; - import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; @@ -25,7 +24,7 @@ public class VanChartMarkerPane extends BasicPane { private JPanel centerPane; private CardLayout cardLayout; - private BasicBeanPane commonMarkerPane; + private VanChartCommonMarkerPane commonMarkerPane; private BasicBeanPane imageMarkerPane; @@ -75,7 +74,7 @@ public class VanChartMarkerPane extends BasicPane { return new VanChartImageMarkerPane(); } - protected BasicBeanPane createCommonMarkerPane() { + protected VanChartCommonMarkerPane createCommonMarkerPane() { return new VanChartCommonMarkerPane(){ protected double[] getcolumnSize () { double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; @@ -111,6 +110,7 @@ public class VanChartMarkerPane extends BasicPane { commonMarkerPane.populateBean(marker); } else { imageMarkerPane.populateBean(marker); + commonMarkerPane.setDefaultValue(); } checkCenterPane(); 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 16a40fdef9..7a03bd465f 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 @@ -6,7 +6,6 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.xcombox.MarkerComboBox; import com.fr.design.layout.TableLayout; - import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -154,6 +153,9 @@ public class VanChartCommonMarkerPane extends BasicBeanPane return "commonMarker"; } + public void setDefaultValue() { + } + @Override public void populateBean(VanChartAttrMarker marker) { if(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 e2c4799fe4..04d4e46dca 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 @@ -4,11 +4,11 @@ import com.fr.base.background.ColorBackground; import com.fr.chart.chartglyph.Marker; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent; - import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; +import java.awt.Color; import java.awt.Component; /** @@ -44,6 +44,16 @@ public class VanChartGanttCommonMarkerPane extends VanChartCommonMarkerPane { @Override protected void updateColor(VanChartAttrMarker marker) { - marker.setColorBackground(ColorBackground.getInstance(colorSelect.getSelectObject())); + Color color = colorSelect.getSelectObject(); + color = color == null ? new Color(248, 182, 44) : color; + + marker.setColorBackground(ColorBackground.getInstance(color)); + } + + @Override + public void setDefaultValue() { + getMarkerPane().setSelectedMarker(Marker.createMarker(MarkerType.MARKER_STAR)); + colorSelect.setSelectObject(new Color(248, 182, 44)); } + } diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java index 92a688a71f..8b96c36940 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java @@ -9,12 +9,12 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent; - import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.gantt.VanChartGanttPlot; import com.fr.stable.CoreConstants; import com.fr.van.chart.designer.TableLayout4VanChartHelper; 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 javax.swing.JPanel; @@ -82,7 +82,7 @@ public class VanChartGanttSeriesPane extends VanChartAbstractPlotSeriesPane { protected JPanel createMarkerPane() { markerPane = new VanChartMarkerPane(){ @Override - protected BasicBeanPane createCommonMarkerPane() { + protected VanChartCommonMarkerPane createCommonMarkerPane() { return new VanChartGanttCommonMarkerPane(); }