|
|
|
@ -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<DataSeriesCondition> { |
|
|
|
|
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); |
|
|
|
|
|
|
|
|
|
if (isRemove) { |
|
|
|
|
this.add(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Match_Color"))); |
|
|
|
|
protected String getItemLabelString() { |
|
|
|
|
return nameForPopupMenuItem(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.add(createComponents()); |
|
|
|
|
protected JPanel initContentPane() { |
|
|
|
|
colorSelectionBox = new ColorSelectBox(80); |
|
|
|
|
colorGradient = new FixedGradientBar(4, 150); |
|
|
|
|
|
|
|
|
|
colorSelectPane = createJPanelWithComponent(colorSelectionBox); |
|
|
|
|
colorGradientPane = createJPanelWithComponent(colorGradient); |
|
|
|
|
|
|
|
|
|
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}); |
|
|
|
|
} |
|
|
|
|
} |