From 62dd7459a4dee5008b32d473ee6b584be910cfe8 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 12 Jun 2020 16:43:33 +0800 Subject: [PATCH] =?UTF-8?q?CHART-14220=20=E8=B0=83=E6=95=B4=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E5=B1=9E=E6=80=A7=E4=B8=AD=E9=85=8D=E8=89=B2=E7=9A=84?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...anChartColumnSeriesColorConditionPane.java | 53 ++++++++++--------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartColumnSeriesColorConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartColumnSeriesColorConditionPane.java index 293270e63..eee538195 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartColumnSeriesColorConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartColumnSeriesColorConditionPane.java @@ -3,10 +3,8 @@ package com.fr.van.chart.designer.other.condition.item; import com.fr.base.background.ColorBackground; import com.fr.chart.base.AttrBackground; import com.fr.chart.base.DataSeriesCondition; -import com.fr.design.condition.ConditionAttrSingleConditionPane; import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.style.background.gradient.FixedGradientBar; @@ -20,7 +18,7 @@ import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -public class VanChartColumnSeriesColorConditionPane extends ConditionAttrSingleConditionPane { +public class VanChartColumnSeriesColorConditionPane extends AbstractNormalMultiLineConditionPane { private UIButtonGroup matchColorTypeBox; @@ -31,41 +29,47 @@ public class VanChartColumnSeriesColorConditionPane extends ConditionAttrSingleC private JPanel colorGradientPane; public VanChartColumnSeriesColorConditionPane(ConditionAttributesPane conditionAttributesPane) { - this(conditionAttributesPane, true); + super(conditionAttributesPane, null); } - public VanChartColumnSeriesColorConditionPane(ConditionAttributesPane conditionAttributesPane, boolean isRemove) { - super(conditionAttributesPane, isRemove); + protected String getItemLabelString() { + return nameForPopupMenuItem(); + } - if (isRemove) { - this.add(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Match_Color"))); - } + protected JPanel initContentPane() { + colorSelectionBox = new ColorSelectBox(80); + colorGradient = new FixedGradientBar(4, 150); + + colorSelectPane = createJPanelWithComponent(colorSelectionBox); + colorGradientPane = createJPanelWithComponent(colorGradient); - this.add(createComponents()); + JPanel panel = new JPanel(); + + panel.setLayout(new BorderLayout()); + + panel.add(initColorButtonPane(), BorderLayout.NORTH); + panel.add(colorSelectPane, BorderLayout.CENTER); + panel.add(colorGradientPane, BorderLayout.SOUTH); initListener(); + + return panel; } - private JPanel createComponents() { + private JPanel initColorButtonPane() { String[] names = new String[]{ Toolkit.i18nText("Fine-Design_Chart_Solid_Color"), Toolkit.i18nText("Fine-Design_Chart_Style_TopDownShade") }; matchColorTypeBox = new UIButtonGroup(names); - colorSelectionBox = new ColorSelectBox(80); - colorGradient = new FixedGradientBar(4, 150); - colorSelectPane = createJPanelWithComponent(colorSelectionBox); - colorGradientPane = createJPanelWithComponent(colorGradient); + double p = TableLayout.PREFERRED; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - JPanel panel = new JPanel(); - panel.setLayout(new BorderLayout()); - panel.add(createJPanelWithComponent(matchColorTypeBox), BorderLayout.NORTH); - panel.add(colorSelectPane, BorderLayout.CENTER); - panel.add(colorGradientPane, BorderLayout.SOUTH); + Component[][] components = new Component[][]{new Component[]{matchColorTypeBox}}; - return panel; + return TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p}, new double[]{e}); } private void initListener() { @@ -137,14 +141,13 @@ public class VanChartColumnSeriesColorConditionPane extends ConditionAttrSingleC private JPanel createJPanelWithComponent(Component component) { double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; Component[][] components = new Component[][]{ - new Component[]{null, null}, - new Component[]{null, component}, + new Component[]{null}, + new Component[]{component} }; - return TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p}, new double[]{f, e}); + return TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p}, new double[]{e}); } } \ No newline at end of file