From 4b95b5c5b98845ecf9eaa4ca3721ecfa3a872c96 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 15 Jun 2020 15:59:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?CHART-14228=20=E5=90=91=E4=B8=8B=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E7=BD=91=E6=A0=BC=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../background/VanChartAxisAreaPane.java | 58 +++++++++++++++++-- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java index b781d0bb6..b7488cf3d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java @@ -20,6 +20,7 @@ import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.CardLayout; +import java.awt.Color; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -48,10 +49,29 @@ public class VanChartAxisAreaPane extends BasicBeanPane { private JPanel horizontalColorPane; private JPanel verticalColorPane; + private Color horizontalColor; + private Color verticalColor; + public VanChartAxisAreaPane() { initComponents(); } + public Color getHorizontalColor() { + return horizontalColor; + } + + public void setHorizontalColor(Color horizontalColor) { + this.horizontalColor = horizontalColor; + } + + public Color getVerticalColor() { + return verticalColor; + } + + public void setVerticalColor(Color verticalColor) { + this.verticalColor = verticalColor; + } + private void initComponents() { horizontalColorBox = new ColorSelectBox(PREFERRED_WIDTH); verticalColorBox = new ColorSelectBox(PREFERRED_WIDTH); @@ -252,14 +272,44 @@ public class VanChartAxisAreaPane extends BasicBeanPane { VanChartAxis defaultXAxis = rectanglePlot.getDefaultXAxis(); VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis(); + // CHART-14241 10.0.6向下兼容10.0.5的设计器,分三种情况: + // 1、选中线型为无时,设置颜色为null + // 2、选中线型不为空,但是上次选中的线型为空时,使用上次保存下的color + // 3、选中前后均不为空时,正常set即可 if (defaultXAxis != null) { - defaultXAxis.setMainGridColor(verticalColorBox.getSelectObject()); - defaultXAxis.setGridLineType((LineType) verticalLineType.getSelectedItem()); + LineType selectVerticalType = (LineType) this.verticalLineType.getSelectedItem(); + Color selectVerticalColor = verticalColorBox.getSelectObject(); + + setVerticalColor(selectVerticalColor); + + if (selectVerticalType == LineType.NONE) { + defaultXAxis.setMainGridColor(null); + defaultXAxis.setGridLineType(LineType.NONE); + } else if (defaultXAxis.getGridLineType() == LineType.NONE) { + defaultXAxis.setMainGridColor(getVerticalColor()); + defaultXAxis.setGridLineType(selectVerticalType); + } else { + defaultXAxis.setMainGridColor(selectVerticalColor); + defaultXAxis.setGridLineType(selectVerticalType); + } } if (defaultYAxis != null) { - defaultYAxis.setMainGridColor(horizontalColorBox.getSelectObject()); - defaultYAxis.setGridLineType((LineType) horizonLineType.getSelectedItem()); + LineType selectHorizontalType = (LineType) this.horizonLineType.getSelectedItem(); + Color selectHorizontalColor = horizontalColorBox.getSelectObject(); + + setHorizontalColor(selectHorizontalColor); + + if (selectHorizontalType == LineType.NONE) { + defaultYAxis.setMainGridColor(null); + defaultYAxis.setGridLineType(LineType.NONE); + } else if (defaultYAxis.getGridLineType() == LineType.NONE) { + defaultYAxis.setMainGridColor(getHorizontalColor()); + defaultYAxis.setGridLineType(selectHorizontalType); + } else { + defaultYAxis.setMainGridColor(selectHorizontalColor); + defaultYAxis.setGridLineType(selectHorizontalType); + } } } From 5a33788f4639baa5d2f4b8f99fdcd916a5af689d Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 15 Jun 2020 17:31:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../background/VanChartAxisAreaPane.java | 58 ++----------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java index b7488cf3d..b781d0bb6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java @@ -20,7 +20,6 @@ import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.CardLayout; -import java.awt.Color; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -49,29 +48,10 @@ public class VanChartAxisAreaPane extends BasicBeanPane { private JPanel horizontalColorPane; private JPanel verticalColorPane; - private Color horizontalColor; - private Color verticalColor; - public VanChartAxisAreaPane() { initComponents(); } - public Color getHorizontalColor() { - return horizontalColor; - } - - public void setHorizontalColor(Color horizontalColor) { - this.horizontalColor = horizontalColor; - } - - public Color getVerticalColor() { - return verticalColor; - } - - public void setVerticalColor(Color verticalColor) { - this.verticalColor = verticalColor; - } - private void initComponents() { horizontalColorBox = new ColorSelectBox(PREFERRED_WIDTH); verticalColorBox = new ColorSelectBox(PREFERRED_WIDTH); @@ -272,44 +252,14 @@ public class VanChartAxisAreaPane extends BasicBeanPane { VanChartAxis defaultXAxis = rectanglePlot.getDefaultXAxis(); VanChartAxis defaultYAxis = rectanglePlot.getDefaultYAxis(); - // CHART-14241 10.0.6向下兼容10.0.5的设计器,分三种情况: - // 1、选中线型为无时,设置颜色为null - // 2、选中线型不为空,但是上次选中的线型为空时,使用上次保存下的color - // 3、选中前后均不为空时,正常set即可 if (defaultXAxis != null) { - LineType selectVerticalType = (LineType) this.verticalLineType.getSelectedItem(); - Color selectVerticalColor = verticalColorBox.getSelectObject(); - - setVerticalColor(selectVerticalColor); - - if (selectVerticalType == LineType.NONE) { - defaultXAxis.setMainGridColor(null); - defaultXAxis.setGridLineType(LineType.NONE); - } else if (defaultXAxis.getGridLineType() == LineType.NONE) { - defaultXAxis.setMainGridColor(getVerticalColor()); - defaultXAxis.setGridLineType(selectVerticalType); - } else { - defaultXAxis.setMainGridColor(selectVerticalColor); - defaultXAxis.setGridLineType(selectVerticalType); - } + defaultXAxis.setMainGridColor(verticalColorBox.getSelectObject()); + defaultXAxis.setGridLineType((LineType) verticalLineType.getSelectedItem()); } if (defaultYAxis != null) { - LineType selectHorizontalType = (LineType) this.horizonLineType.getSelectedItem(); - Color selectHorizontalColor = horizontalColorBox.getSelectObject(); - - setHorizontalColor(selectHorizontalColor); - - if (selectHorizontalType == LineType.NONE) { - defaultYAxis.setMainGridColor(null); - defaultYAxis.setGridLineType(LineType.NONE); - } else if (defaultYAxis.getGridLineType() == LineType.NONE) { - defaultYAxis.setMainGridColor(getHorizontalColor()); - defaultYAxis.setGridLineType(selectHorizontalType); - } else { - defaultYAxis.setMainGridColor(selectHorizontalColor); - defaultYAxis.setGridLineType(selectHorizontalType); - } + defaultYAxis.setMainGridColor(horizontalColorBox.getSelectObject()); + defaultYAxis.setGridLineType((LineType) horizonLineType.getSelectedItem()); } } From 2c404034f1754dbd9c0ed9692c2b5e3d95fc1ef2 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 16 Jun 2020 11:16:11 +0800 Subject: [PATCH 3/3] =?UTF-8?q?CHART-14264=20=E4=BF=AE=E6=94=B9=E9=85=8D?= =?UTF-8?q?=E8=89=B2=E9=9D=A2=E6=9D=BF=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/component/VanChartFillStylePane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java index 7173f9678..8f3f83c5b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java @@ -144,8 +144,9 @@ public class VanChartFillStylePane extends BasicBeanPane implemen double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double[] columnSize = {f, e}; - double[] rowSize = {p, p}; + double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ + new Component[]{null, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Match_Color_Scheme")), styleSelectBox}, new Component[]{null, customPane},