From 5a33788f4639baa5d2f4b8f99fdcd916a5af689d Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 15 Jun 2020 17:31:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=BC=E5=AE=B9=E6=96=B9?= =?UTF-8?q?=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()); } }