Browse Source

Pull request #1745: CHART-14218 & CHART-14220 调整条件属性中配色的布局方式、调整颜色面板组件顺序、渐变时配色面板隐藏

Merge in DESIGN/design from ~QINGHUI.LIU/design:release/10.0 to release/10.0

* commit '8dd7b88c1cc3a8878fad58926a82a716398b9ea2':
  CHART-14220 调整条件属性中配色的布局方式
  CHART-14218 调整颜色面板组件顺序、渐变时配色面板隐藏
feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
d3d0fef393
  1. 7
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java
  2. 53
      designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartColumnSeriesColorConditionPane.java
  3. 22
      designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java
  4. 13
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelSeriesPane.java
  5. 9
      designer-chart/src/main/java/com/fr/van/chart/radar/VanChartRadarSeriesPane.java
  6. 2
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java

7
designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java

@ -2,6 +2,7 @@ package com.fr.van.chart.bubble;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.i18n.Toolkit;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -53,7 +54,7 @@ public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane {
//设置色彩面板内容
@Override
protected void setColorPaneContent(JPanel panel) {
panel.add(createAlphaPane(), BorderLayout.CENTER);
panel.add(createAlphaPane(), BorderLayout.SOUTH);
}
@Override
@ -67,7 +68,7 @@ public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane {
@Override
public String getPaneTitle() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Axis");
return Toolkit.i18nText("Fine-Design_Chart_Custom_Axis");
}
};
stackAndAxisEditExpandablePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane);
@ -76,7 +77,7 @@ public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane {
private JPanel createBubblePane() {
bubblePane = new VanChartBubblePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Bubble"), bubblePane);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Bubble"), bubblePane);
}
protected void populateCondition(ConditionAttr defaultAttr) {

53
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<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);
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});
}
}

22
designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java

@ -6,6 +6,7 @@ import com.fr.base.chart.chartdata.model.NormalDataModel;
import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.base.GradientStyle;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.gui.frpane.UINumberDragPane;
@ -22,6 +23,7 @@ import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.base.VanChartAttrTrendLine;
import com.fr.plugin.chart.type.GradientType;
import com.fr.van.chart.custom.style.VanChartCustomStylePane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartAreaSeriesFillColorPane;
@ -114,7 +116,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
stylePane = createStylePane();
vanChartFillStylePane = getVanChartFillStylePane();
if (vanChartFillStylePane != null) {
panel.add(vanChartFillStylePane, BorderLayout.NORTH);
panel.add(vanChartFillStylePane, BorderLayout.CENTER);
}
setColorPaneContent(panel);
JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Color"), panel);
@ -122,10 +124,16 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
return panel.getComponentCount() == 0 ? null : colorPane;
}
//设置色彩面板内容
//设置色彩面板内容: 风格居上,配色居中,不透明度居下
protected void setColorPaneContent(JPanel panel) {
if (stylePane != null) {
panel.add(stylePane, BorderLayout.CENTER);
panel.add(stylePane, BorderLayout.NORTH);
}
}
private void checkFillStylePane(GradientStyle gradientStyle) {
if (vanChartFillStylePane != null) {
vanChartFillStylePane.setVisible(gradientStyle.getGradientType() != GradientType.CUSTOM);
}
}
@ -276,7 +284,9 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
}
if (stylePane != null) {//风格
stylePane.populateBean(((VanChartPlot)plot).getGradientStyle());
GradientStyle gradientStyle = ((VanChartPlot) plot).getGradientStyle();
stylePane.populateBean(gradientStyle);
checkFillStylePane(gradientStyle);
}
//大数据模式 恢复用注释。下面3行删除。
@ -335,7 +345,9 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
}
if (stylePane != null) {//风格
((VanChartPlot)plot).setGradientStyle(stylePane.updateBean());
GradientStyle gradientStyle = stylePane.updateBean();
((VanChartPlot) plot).setGradientStyle(gradientStyle);
checkFillStylePane(gradientStyle);
}
//大数据模式 恢复用注释。下面3行删除。

13
designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelSeriesPane.java

@ -1,6 +1,7 @@
package com.fr.van.chart.funnel.designer.style;
import com.fr.chart.chartattr.Plot;
import com.fr.design.i18n.Toolkit;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
@ -43,14 +44,14 @@ public class VanChartFunnelSeriesPane extends VanChartAbstractPlotSeriesPane {
//设置色彩面板内容
protected void setColorPaneContent (JPanel panel) {
if (stylePane != null) {
panel.add(stylePane, BorderLayout.CENTER);
panel.add(stylePane, BorderLayout.NORTH);
}
panel.add(createAlphaPane(), BorderLayout.SOUTH);
}
private JPanel createFunnelStylePane() {
useSameSlantAngle = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Same_Slant_Angle"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Diff_Slant_Angle")});
sort = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Auto_Sort"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Origin")});
useSameSlantAngle = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Same_Slant_Angle"), Toolkit.i18nText("Fine-Design_Chart_Use_Diff_Slant_Angle")});
sort = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto_Sort"), Toolkit.i18nText("Fine-Design_Chart_Origin")});
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
@ -59,13 +60,13 @@ public class VanChartFunnelSeriesPane extends VanChartAbstractPlotSeriesPane {
double[] rowSize = {p,p,p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Continuity")), useSameSlantAngle},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sort")), sort},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Continuity")), useSameSlantAngle},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Sort")), sort},
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Name"), panel);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Style_Name"), panel);
}
public void populateBean(Plot plot) {

9
designer-chart/src/main/java/com/fr/van/chart/radar/VanChartRadarSeriesPane.java

@ -1,6 +1,7 @@
package com.fr.van.chart.radar;
import com.fr.chart.chartattr.Plot;
import com.fr.design.i18n.Toolkit;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -59,15 +60,15 @@ public class VanChartRadarSeriesPane extends VanChartAbstractPlotSeriesPane {
//设置色彩面板内容
protected void setColorPaneContent (JPanel panel) {
if(plot instanceof VanChartRadarPlot && ((VanChartRadarPlot)plot).isStackChart()) {
panel.add(createAlphaPane(), BorderLayout.CENTER);
panel.add(createAlphaPane(), BorderLayout.SOUTH);
}
}
private JPanel createRadarTypePane() {
radarType = new UIButtonGroup<String>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Circle"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Polygonal")},
radarType = new UIButtonGroup<String>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Circle"), Toolkit.i18nText("Fine-Design_Chart_Polygonal")},
new String[]{RadarType.CIRCLE.getType(), RadarType.POLYGON.getType()});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Shape"), radarType);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present"), panel);
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Shape"), radarType);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Style_Present"), panel);
}
protected VanChartLineTypePane getLineTypePane() {

2
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java

@ -54,7 +54,7 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane {
//设置色彩面板内容
protected void setColorPaneContent(JPanel panel) {
panel.add(createAlphaPane(), BorderLayout.CENTER);
panel.add(createAlphaPane(), BorderLayout.SOUTH);
}
@Override

Loading…
Cancel
Save