From 01ebd7c8e9b3cd76520ffd681793bbf052d70baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 29 Apr 2020 15:00:12 +0800 Subject: [PATCH] =?UTF-8?q?CHART-13744=20=E9=A2=84=E5=AE=9A=E9=85=8D?= =?UTF-8?q?=E8=89=B2=E6=96=B0=E5=A2=9E=E9=85=8D=E8=89=B2=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E4=B8=8D=E6=AD=A3=E5=B8=B8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/module/ChartPreFillStylePane.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java index de85cfcdba..d174340cad 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java @@ -12,6 +12,7 @@ import com.fr.design.style.background.gradient.FixedGradientBar; import javax.swing.JPanel; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.awt.BorderLayout; import java.awt.CardLayout; @@ -25,6 +26,7 @@ import java.awt.event.ActionListener; /** * 预定义的图表配色界面. + * * @author kunsnat E-mail:kunsnat@gmail.com * @version 创建时间:2013-8-21 下午03:16:27 */ @@ -78,7 +80,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { }; this.setLayout(new BorderLayout()); - this.add(TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize), BorderLayout.WEST); + this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.WEST); } private void initListener() { @@ -131,6 +133,11 @@ public class ChartPreFillStylePane extends BasicBeanPane { if (colorList.size() > 0) { colorAdjustPane.updateColor(colorList.toArray(new Color[colorList.size()])); + } else { + List resultList = new ArrayList<>(); + Collections.addAll(resultList, ChartColorAdjustPane.DEFAULT_COLORS); + condition.setColorList(resultList); + colorAdjustPane.updateColor(ChartColorAdjustPane.DEFAULT_COLORS); } } } @@ -141,7 +148,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { List colorList = new ArrayList(); - if(gradientButton.isSelected()) { + if (gradientButton.isSelected()) { chartColorMatching.setGradient(true); Color start = colorGradient.getSelectColorPointBtnP1().getColorInner(); @@ -152,7 +159,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { chartColorMatching.setGradient(false); Color[] colors = colorAdjustPane.getColors(); - for(Color color : colors) { + for (Color color : colors) { colorList.add(color); } }