From 61d948b24c129af1c9847adebd8e4e2406614c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 7 Apr 2020 13:49:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?CHART-13222=20=E8=8B=B1=E6=96=87=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=8B=E7=9A=84=E6=95=B0=E6=8D=AE=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/data/table/SeriesTypeUseComboxPane.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java index 804ca541ba..4e78591ad1 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java @@ -9,10 +9,12 @@ import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.constants.LayoutConstants; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.frpane.UIComboBoxPane; +import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.design.utils.gui.UIComponentUtils; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -59,11 +61,16 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { this.add(cardPane, BorderLayout.CENTER); dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); JPanel panel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 290, 24, dataScreeningPane); - panel.setBorder(BorderFactory.createEmptyBorder(0,10,0,10)); + panel.setBorder(BorderFactory.createEmptyBorder(0,5,0,5)); dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,5,0,5)); this.add(panel, BorderLayout.SOUTH); } + protected UIComboBox createComboBox() { + UIComboBox uiComboBox = new UIComboBox(); + UIComponentUtils.setPreferedWidth(uiComboBox, 100); + return uiComboBox; + } /** * 检查box 是否使用, hasUse, 表示上层已经使用, 否则, 则此界面都可使用 * @param hasUse 是否使用 From 4646b8e6e19cec3297cc9024e5c4b8dff8a1b598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 7 Apr 2020 16:22:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?CHART-13274=20&&=20CHART-13285=20=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E9=85=8D=E8=89=B2=E7=9A=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/combobox/ColorSchemeComboBox.java | 4 ++++ .../chart/gui/style/ChartColorAdjustPane.java | 15 ++++++--------- .../designer/component/VanChartFillStylePane.java | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java index ae076b8f37..9fcbeb2b69 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java @@ -14,6 +14,7 @@ import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; @@ -130,6 +131,9 @@ public class ColorSchemeComboBox extends UIComboBox { NORMAL } + public Set getItems() { + return colorSchemes.keySet(); + } public class ColorInfo { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java index 52bde97a6d..b053a5eb9b 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartColorAdjustPane.java @@ -58,8 +58,6 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver { private ChangeListener changeListener; - - public ChartColorAdjustPane() { this(DEFAULT_COLORS); } @@ -70,10 +68,6 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver { createContentPane(); } - public void updateColor() { - updateColor(DEFAULT_COLORS); - } - public void updateColor(Color[] colors) { createColorButton(colors); relayout(); @@ -124,8 +118,9 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver { private void createColorButton(Color[] colors) { colorButtons.clear(); - for (Color color : colors) { - colorButtons.add(createColorButton(color)); + int size = Math.min(colors.length, MAX_BUTTON); + for (int i = 0; i < size; i++) { + colorButtons.add(createColorButton(colors[i])); } } @@ -219,7 +214,9 @@ public class ChartColorAdjustPane extends JPanel implements UIObserver { hidePopupMenu(); Color color = ((ColorSelectPane) e.getSource()).getColor(); fireDisplayComponent(ColorBackground.getInstance(color)); - colorButtons.add(createColorButton(color)); + if(colorButtons.size() < MAX_BUTTON) { + colorButtons.add(createColorButton(color)); + } ChartColorAdjustPane.this.stateChanged(); relayout(); } 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 154ed5557e..c662627965 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 @@ -155,7 +155,7 @@ public class VanChartFillStylePane extends BasicBeanPane { @Override public void populateBean(AttrFillStyle condition) { String fillStyleName = condition == null ? "" : condition.getFillStyleName(); - if (StringUtils.isBlank(fillStyleName)) {//兼容处理 + if (StringUtils.isBlank(fillStyleName) || !styleSelectBox.getItems().contains(fillStyleName)) {//兼容处理 if (condition == null || condition.getColorStyle() == ChartConstants.COLOR_DEFAULT) { styleSelectBox.setSelectType(ColorSchemeComboBox.SelectType.DEFAULT);//默认 } else {