From 5821dda7d9331151f0eaa7cefb2f4973f0c9f2a7 Mon Sep 17 00:00:00 2001 From: shine Date: Thu, 11 Nov 2021 16:53:13 +0800 Subject: [PATCH] =?UTF-8?q?CHART-21665=20design=20fix:=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E5=88=BB=E5=BA=A6=E9=85=8D=E8=89=B2=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/style/series/UIColorPickerPane.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java index 6529efce05..8a0c2c5cb5 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java @@ -29,8 +29,6 @@ import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.util.ArrayList; -import java.util.List; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -42,6 +40,8 @@ import java.awt.LayoutManager; import java.awt.Point; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.List; public class UIColorPickerPane extends BasicPane implements UIObserver { private static final int MARGIN_TOP = 7; @@ -691,14 +691,18 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { fillStyleCombox.setSelectObject(mainColor); designTypeButtonGroup.setSelectedIndex(hotAreaColor.getUseType()); - double value = (double) hotAreaColor.getAreaNumber(); + int value = hotAreaColor.getAreaNumber(); UIColorPickerPane.this.add(textGroup); UIColorPickerPane.this.add(colorGroup); Color[] colors = hotAreaColor.initColor(); BaseFormula[] values = hotAreaColor.initValues(); + if (value != colors.length && hotAreaColor.getUseType() == MapHotAreaColor.CUSTOM) { + colors = getColorArray(mainColor, value); + values = getValueArray(value); + } refreshGroupPane(colors, values); this.initContainerLister(); - regionNumPane.populateBean(value); + regionNumPane.populateBean((double) value); refreshPane(); }