Browse Source

CHART-12733 线型支持虚线 回退

research/11.0
shine 5 years ago
parent
commit
88181c9f58
  1. 43
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java
  2. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java
  3. 12
      designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java

43
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java

@ -2,6 +2,7 @@ package com.fr.van.chart.designer.component;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
@ -12,6 +13,8 @@ import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.type.LineStyle;
import com.fr.plugin.chart.type.LineType;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
@ -27,6 +30,9 @@ import java.util.Arrays;
public class VanChartLineTypePane extends BasicPane {
private static final long serialVersionUID = -6581862503009962973L;
//线型支持虚线 恢复用注释。下面1行删除。
protected LineComboBox lineWidth;//线型
private LineTypeComboBox lineTypeComboBox;//线型
private UISpinner lineWidthSpinner;//线宽
protected UIButtonGroup<LineStyle> lineStyle;//形态
@ -36,6 +42,8 @@ public class VanChartLineTypePane extends BasicPane {
private JPanel lineStylePane;
public VanChartLineTypePane() {
//线型支持虚线 恢复用注释。下面1行删除。
lineWidth = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
JPanel typeAndWidthPane = createTypeAndWidthPane();
@ -59,7 +67,8 @@ public class VanChartLineTypePane extends BasicPane {
lineStylePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
this.setLayout(new BorderLayout(0, 6));
this.add(typeAndWidthPane, BorderLayout.NORTH);
//线型支持虚线 恢复用注释。取消注释。
//this.add(typeAndWidthPane, BorderLayout.NORTH);
this.add(lineStylePane, BorderLayout.CENTER);
}
@ -108,6 +117,12 @@ public class VanChartLineTypePane extends BasicPane {
protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
return new Component[][]{
//线型支持虚线 恢复用注释。下面5行删除。
new Component[]{null, null},
new Component[]{
FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
UIComponentUtils.wrapWithBorderLayoutPane(lineWidth)
},
lineStyleComponent,
nullValueBreakComponent
};
@ -126,10 +141,16 @@ public class VanChartLineTypePane extends BasicPane {
}
public void checkLarge(boolean large) {
//线型支持虚线 恢复用注释。下面4行删除。
if (large) {
lineTypeComboBox.setSelectedItem(LineType.NONE);
}
lineTypeComboBox.setEnabled(!large);
lineWidth.setSelectedLineStyle(Constants.LINE_NONE);
}
lineWidth.setEnabled(!large);
//线型支持虚线 恢复用注释。取消注释。
// if (large) {
// lineTypeComboBox.setSelectedItem(LineType.NONE);
// }
// lineTypeComboBox.setEnabled(!large);
lineStyle.setEnabled(!large);
}
@ -141,8 +162,11 @@ public class VanChartLineTypePane extends BasicPane {
if (line == null) {
line = initVanChartAttrLine();
}
lineTypeComboBox.setSelectedItem(line.getLineType());
lineWidthSpinner.setValue(line.getLineWidth());
//线型支持虚线 恢复用注释。下面1行删除。
lineWidth.setSelectedLineStyle(line.getLineWidth());
//线型支持虚线 恢复用注释。取消注释。
// lineTypeComboBox.setSelectedItem(line.getLineType());
// lineWidthSpinner.setValue(line.getLineWidth());
lineStyle.setSelectedItem(line.getLineStyle());
nullValueBreak.setSelectedIndex(line.isNullValueBreak() ? 0 : 1);
}
@ -153,8 +177,11 @@ public class VanChartLineTypePane extends BasicPane {
public VanChartAttrLine update() {
VanChartAttrLine line = new VanChartAttrLine();
line.setLineType((LineType) lineTypeComboBox.getSelectedItem());
line.setLineWidth(lineWidthSpinner.getValue());
//线型支持虚线 恢复用注释。下面1行删除。
line.setLineWidth(lineWidth.getSelectedLineStyle());
//线型支持虚线 恢复用注释。取消注释。
// line.setLineType((LineType) lineTypeComboBox.getSelectedItem());
// line.setLineWidth(lineWidthSpinner.getValue());
line.setLineStyle(lineStyle.getSelectedItem());
line.setNullValueBreak(nullValueBreak.getSelectedIndex() == 0);
return line;

6
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java

@ -1,5 +1,8 @@
package com.fr.van.chart.designer.component;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import java.awt.Component;
/**
@ -11,6 +14,9 @@ public class VanChartLineWidthPane extends VanChartLineTypePane {
@Override
protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
return new Component[][]{
//线型支持虚线 恢复用注释。下面2行删除。
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineWidth},
nullValueBreakComponent
};
}

12
designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java

@ -1,9 +1,11 @@
package com.fr.van.chart.scatter.component;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.type.LineStyle;
import com.fr.plugin.chart.type.LineType;
import com.fr.stable.Constants;
import com.fr.van.chart.designer.component.VanChartLineTypePane;
import java.awt.Component;
@ -23,6 +25,9 @@ public class VanChartScatterLineTypePane extends VanChartLineTypePane {
@Override
protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
return new Component[][]{
//线型支持虚线 恢复用注释。下面2行删除。
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineWidth},
lineStyleComponent
};
}
@ -31,7 +36,10 @@ public class VanChartScatterLineTypePane extends VanChartLineTypePane {
protected VanChartAttrLine initVanChartAttrLine() {
VanChartAttrLine attrLine = new VanChartAttrLine();
//默认为无线型,且默認空值不斷開
attrLine.setLineType(LineType.NONE);
//线型支持虚线 恢复用注释。下面1行删除。
attrLine.setLineWidth(Constants.LINE_NONE);
//线型支持虚线 恢复用注释。取消注释。
//attrLine.setLineType(LineType.NONE);
attrLine.setNullValueBreak(false);
return attrLine;
}

Loading…
Cancel
Save