Browse Source

CHART-12733 线型支持虚线 补充网格线 警戒线 趋势线。 回退

research/11.0
shine 5 years ago
parent
commit
a986e3d9a5
  1. 72
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java
  2. 36
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java
  3. 156
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java

72
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java

@ -1,8 +1,10 @@
package com.fr.van.chart.designer.component; package com.fr.van.chart.designer.component;
import com.fr.chart.base.AttrColor; import com.fr.chart.base.AttrColor;
import com.fr.chart.base.AttrLineStyle;
import com.fr.chart.base.LineStyleInfo; import com.fr.chart.base.LineStyleInfo;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
@ -15,6 +17,7 @@ import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.base.TrendLineType; import com.fr.plugin.chart.base.TrendLineType;
import com.fr.plugin.chart.base.VanChartAttrTrendLine; import com.fr.plugin.chart.base.VanChartAttrTrendLine;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.type.LineType; import com.fr.plugin.chart.type.LineType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -33,8 +36,12 @@ public class VanChartTrendLinePane extends BasicPane{
private UITextField trendLineName; private UITextField trendLineName;
private ColorSelectBox trendLineColor; private ColorSelectBox trendLineColor;
private LineTypeComboBox trendLineStyle;//线型
private UISpinner lineWidthSpinner;//线宽 //线型支持虚线 恢复用注释。下面1行删除。
private LineComboBox trendLineStyle;//线型
//线型支持虚线 恢复用注释。取消注释。
// private LineTypeComboBox trendLineStyle;//线型
// private UISpinner lineWidthSpinner;//线宽
private UIComboBox trendLineType;//趋势线函数类型 private UIComboBox trendLineType;//趋势线函数类型
private UISpinner prePeriod; private UISpinner prePeriod;
@ -51,11 +58,15 @@ public class VanChartTrendLinePane extends BasicPane{
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] row = {p, p, p, p, p, p};
double[] col = {f, e}; double[] col = {f, e};
trendLineName = new UITextField(); trendLineName = new UITextField();
trendLineColor = new ColorSelectBox(100); trendLineColor = new ColorSelectBox(100);
trendLineStyle = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH}); //线型支持虚线 恢复用注释。下面1行删除。
lineWidthSpinner = new UISpinner(0.5, Integer.MAX_VALUE, 0.5, 2); trendLineStyle = new LineComboBox(VanChartConstants.ALERT_LINE_STYLE);
//线型支持虚线 恢复用注释。取消注释。
// trendLineStyle = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH});
// lineWidthSpinner = new UISpinner(0.5, Integer.MAX_VALUE, 0.5, 2);
trendLineType = new UIComboBox(TYPES); trendLineType = new UIComboBox(TYPES);
prePeriod = new UISpinner(0, Integer.MAX_VALUE, 1, 0); prePeriod = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
afterPeriod = new UISpinner(0, Integer.MAX_VALUE, 1, 0); afterPeriod = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
@ -71,26 +82,42 @@ public class VanChartTrendLinePane extends BasicPane{
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Period")); UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Period"));
label.setVerticalAlignment(SwingConstants.TOP); label.setVerticalAlignment(SwingConstants.TOP);
//线型支持虚线 恢复用注释。开始删除。
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Name")), trendLineName}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Name")), trendLineName},
new Component[]{ new Component[]{
FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
UIComponentUtils.wrapWithBorderLayoutPane(trendLineStyle) UIComponentUtils.wrapWithBorderLayoutPane(trendLineStyle)
} },
};
Component[][] componentsMayHide = new Component[][]{
new Component[]{
FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")),
UIComponentUtils.wrapWithBorderLayoutPane(lineWidthSpinner)},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), trendLineColor}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), trendLineColor},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), trendLineType}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), trendLineType},
new Component[]{label, periodPane} new Component[]{label, periodPane}
}; };
//线型支持虚线 恢复用注释。结束删除。
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p,p,p}, col);
trendLineHidePane = TableLayout4VanChartHelper.createGapTableLayoutPane(componentsMayHide, new double[]{p,p,p,p}, col); //线型支持虚线 恢复用注释。取消注释。
// Component[][] components = new Component[][]{
// new Component[]{null, null},
// new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Name")), trendLineName},
// new Component[]{
// FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
// UIComponentUtils.wrapWithBorderLayoutPane(trendLineStyle)
// }
// };
//
// Component[][] componentsMayHide = new Component[][]{
// new Component[]{
// FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")),
// UIComponentUtils.wrapWithBorderLayoutPane(lineWidthSpinner)},
// new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), trendLineColor},
// new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), trendLineType},
// new Component[]{label, periodPane}
// };
// trendLineHidePane = TableLayout4VanChartHelper.createGapTableLayoutPane(componentsMayHide, row, col);
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
trendLineStyle.addActionListener(new ActionListener() { trendLineStyle.addActionListener(new ActionListener() {
@Override @Override
@ -102,7 +129,8 @@ public class VanChartTrendLinePane extends BasicPane{
checkHidePaneVisible(); checkHidePaneVisible();
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
this.add(trendLineHidePane, BorderLayout.SOUTH); //线型支持虚线 恢复用注释。取消注释。
//this.add(trendLineHidePane, BorderLayout.SOUTH);
} }
protected String title4PopupWindow(){ protected String title4PopupWindow(){
@ -115,8 +143,11 @@ public class VanChartTrendLinePane extends BasicPane{
trendLineName.setText(trendLine.getTrendLineName()); trendLineName.setText(trendLine.getTrendLineName());
LineStyleInfo lineStyleInfo = trendLine.getLineStyleInfo(); LineStyleInfo lineStyleInfo = trendLine.getLineStyleInfo();
trendLineColor.setSelectObject(lineStyleInfo.getAttrLineColor().getSeriesColor()); trendLineColor.setSelectObject(lineStyleInfo.getAttrLineColor().getSeriesColor());
trendLineStyle.setSelectedItem(lineStyleInfo.getAttrLineStyle().getLineType()); //线型支持虚线 恢复用注释。下面1行删除。
lineWidthSpinner.setValue(lineStyleInfo.getAttrLineStyle().getLineWidth()); trendLineStyle.setSelectedLineStyle(lineStyleInfo.getAttrLineStyle().getLineStyle());
//线型支持虚线 恢复用注释。取消注释。
// trendLineStyle.setSelectedItem(lineStyleInfo.getAttrLineStyle().getLineType());
// lineWidthSpinner.setValue(lineStyleInfo.getAttrLineStyle().getLineWidth());
trendLineType.setSelectedItem(trendLine.getTrendLineType()); trendLineType.setSelectedItem(trendLine.getTrendLineType());
prePeriod.setValue(trendLine.getPrePeriod()); prePeriod.setValue(trendLine.getPrePeriod());
afterPeriod.setValue(trendLine.getAfterPeriod()); afterPeriod.setValue(trendLine.getAfterPeriod());
@ -128,8 +159,11 @@ public class VanChartTrendLinePane extends BasicPane{
trendLine.setTrendLineName(trendLineName.getText()); trendLine.setTrendLineName(trendLineName.getText());
LineStyleInfo lineStyleInfo = trendLine.getLineStyleInfo(); LineStyleInfo lineStyleInfo = trendLine.getLineStyleInfo();
lineStyleInfo.getAttrLineStyle().setLineWidth(lineWidthSpinner.getValue()); //线型支持虚线 恢复用注释。下面1行删除。
lineStyleInfo.getAttrLineStyle().setLineType((LineType) trendLineStyle.getSelectedItem()); lineStyleInfo.setAttrLineStyle(new AttrLineStyle(trendLineStyle.getSelectedLineStyle()));
//线型支持虚线 恢复用注释。取消注释。
// lineStyleInfo.getAttrLineStyle().setLineWidth(lineWidthSpinner.getValue());
// lineStyleInfo.getAttrLineStyle().setLineType((LineType) trendLineStyle.getSelectedItem());
lineStyleInfo.setAttrLineColor(new AttrColor(trendLineColor.getSelectObject())); lineStyleInfo.setAttrLineColor(new AttrColor(trendLineColor.getSelectObject()));
trendLine.setTrendLineType((TrendLineType) trendLineType.getSelectedItem()); trendLine.setTrendLineType((TrendLineType) trendLineType.getSelectedItem());

36
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java

@ -5,9 +5,9 @@ import com.fr.base.Utils;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.formula.TinyFormulaPane; import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.style.FRFontPane; import com.fr.design.gui.style.FRFontPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -18,10 +18,9 @@ import com.fr.general.FRFont;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue; import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.type.LineType; import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.van.chart.designer.component.LineTypeComboBox;
import javax.swing.BoxLayout; import javax.swing.BoxLayout;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -42,8 +41,11 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
private static final long serialVersionUID = -1208941770684286439L; private static final long serialVersionUID = -1208941770684286439L;
private UIButtonGroup alertAxis; private UIButtonGroup alertAxis;
protected TinyFormulaPane alertValue; protected TinyFormulaPane alertValue;
protected LineTypeComboBox alertLineStyle;//线型 //线型支持虚线 恢复用注释。下面1行删除。
private UISpinner lineWidthSpinner;//线宽 protected LineComboBox alertLineStyle;
//线型支持虚线 恢复用注释。取消注释。
// protected LineTypeComboBox alertLineStyle;//线型
// private UISpinner lineWidthSpinner;//线宽
protected ColorSelectBox alertLineColor; protected ColorSelectBox alertLineColor;
private UIButtonGroup alertTextPosition; private UIButtonGroup alertTextPosition;
@ -64,8 +66,11 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
//設置大小,防止文本過長導致界面“變形” //設置大小,防止文本過長導致界面“變形”
alertValue.setPreferredSize(new Dimension(VALUE_WD, HT)); alertValue.setPreferredSize(new Dimension(VALUE_WD, HT));
alertLineStyle = new LineTypeComboBox(new LineType[]{LineType.NORMAL, LineType.DASH}); //线型支持虚线 恢复用注释。下面1行删除。
lineWidthSpinner = new UISpinner(0.5, Integer.MAX_VALUE, 0.5, 2); alertLineStyle = new LineComboBox(VanChartConstants.ALERT_LINE_STYLE);
//线型支持虚线 恢复用注释。取消注释。
// alertLineStyle = new LineTypeComboBox(new LineType[]{LineType.NORMAL, LineType.DASH});
// lineWidthSpinner = new UISpinner(0.5, Integer.MAX_VALUE, 0.5, 2);
alertLineColor = new ColorSelectBox(100); alertLineColor = new ColorSelectBox(100);
alertTextPosition = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Top"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Bottom")}); alertTextPosition = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Top"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Bottom")});
alertText = new TinyFormulaPane(); alertText = new TinyFormulaPane();
@ -108,7 +113,8 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Position")),alertAxis}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Position")),alertAxis},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Value")),alertValue}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Value")),alertValue},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")),alertLineStyle}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")),alertLineStyle},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Width")), lineWidthSpinner}, //线型支持虚线 恢复用注释。取消注释。
//new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Width")), lineWidthSpinner},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),alertLineColor}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),alertLineColor},
}; };
} }
@ -157,8 +163,11 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
checkPositionPane(); checkPositionPane();
alertValue.populateBean(Utils.objectToString(chartAlertValue.getAlertValueFormula())); alertValue.populateBean(Utils.objectToString(chartAlertValue.getAlertValueFormula()));
alertLineStyle.setSelectedItem(chartAlertValue.getLineStyle().getLineType()); //线型支持虚线 恢复用注释。下面1行删除。
lineWidthSpinner.setValue(chartAlertValue.getLineStyle().getLineWidth()); alertLineStyle.setSelectedLineStyle(chartAlertValue.getLineStyle().getLineStyle());
//线型支持虚线 恢复用注释。取消注释。
// alertLineStyle.setSelectedItem(chartAlertValue.getLineStyle().getLineType());
// lineWidthSpinner.setValue(chartAlertValue.getLineStyle().getLineWidth());
alertLineColor.setSelectObject(chartAlertValue.getLineColor().getSeriesColor()); alertLineColor.setSelectObject(chartAlertValue.getLineColor().getSeriesColor());
if(VanChartAttrHelper.isXAxis(chartAlertValue.getAxisName())){ if(VanChartAttrHelper.isXAxis(chartAlertValue.getAxisName())){
@ -182,8 +191,11 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
chartAlertValue.setAlertValueFormula(BaseFormula.createFormulaBuilder().build(alertValue.updateBean())); chartAlertValue.setAlertValueFormula(BaseFormula.createFormulaBuilder().build(alertValue.updateBean()));
chartAlertValue.getLineColor().setSeriesColor(alertLineColor.getSelectObject()); chartAlertValue.getLineColor().setSeriesColor(alertLineColor.getSelectObject());
chartAlertValue.getLineStyle().setLineType((LineType) alertLineStyle.getSelectedItem()); //线型支持虚线 恢复用注释。下面1行删除。
chartAlertValue.getLineStyle().setLineWidth(lineWidthSpinner.getValue()); chartAlertValue.getLineStyle().setLineStyle(alertLineStyle.getSelectedLineStyle());
//线型支持虚线 恢复用注释。取消注释。
// chartAlertValue.getLineStyle().setLineType((LineType) alertLineStyle.getSelectedItem());
// chartAlertValue.getLineStyle().setLineWidth(lineWidthSpinner.getValue());
String contentString = alertText.updateBean(); String contentString = alertText.updateBean();
Object contentObj; Object contentObj;

156
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java

@ -11,9 +11,7 @@ import com.fr.design.style.color.ColorSelectBox;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.type.LineType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.LineTypeComboBox;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -22,6 +20,7 @@ import java.awt.CardLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.Arrays;
/** /**
* 样式-背景-绘图区背景-坐标轴图表特有间隔背景网格线警戒线 * 样式-背景-绘图区背景-坐标轴图表特有间隔背景网格线警戒线
@ -41,10 +40,11 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
private ColorSelectBox verticalColorBackground; private ColorSelectBox verticalColorBackground;
protected BackgroundListControlPane customIntervalBackground; protected BackgroundListControlPane customIntervalBackground;
private LineTypeComboBox horizonLineType;//横向线型 //线型支持虚线 恢复用注释。取消注释。
private LineTypeComboBox verticalLineType;//纵向线型 // private LineTypeComboBox horizonLineType;//横向线型
private JPanel horizontalColorPane; // private LineTypeComboBox verticalLineType;//纵向线型
private JPanel verticalColorPane; // private JPanel horizontalColorPane;
// private JPanel verticalColorPane;
public VanChartAxisAreaPane() { public VanChartAxisAreaPane() {
initComponents(); initComponents();
@ -53,8 +53,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
protected void initComponents() { protected void initComponents() {
horizontalGridLine = new ColorSelectBox(100); horizontalGridLine = new ColorSelectBox(100);
verticalGridLine = new ColorSelectBox(100); verticalGridLine = new ColorSelectBox(100);
horizonLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH}); //线型支持虚线 恢复用注释。取消注释。
verticalLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH}); // horizonLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH});
// verticalLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH});
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
@ -73,58 +74,78 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
} }
//线型支持虚线 恢复用注释。删除下面方法。
protected JPanel createGridLinePane() { protected JPanel createGridLinePane() {
horizontalGridLine = new ColorSelectBox(100);
Component[][] upComponent = new Component[][]{ verticalGridLine = new ColorSelectBox(100);
Component[][] components = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{null, horizontalGridLine} new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal")), horizontalGridLine},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical")), verticalGridLine},
}; };
horizontalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(upComponent); double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
Component[][] downComponent = new Component[][]{ double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
new Component[]{null,null}, double[] row = new double[components.length];
new Component[]{null, verticalGridLine} Arrays.fill(row, p);
}; double[] col = {f, e};
verticalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(downComponent); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel);
horizonLineType.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (horizontalGridLine == null || horizonLineType == null){
return;
}
horizontalColorPane.setVisible(horizonLineType.getSelectedItem() != LineType.NONE);
}
});
verticalLineType.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (verticalGridLine == null || verticalLineType == null){
return;
}
verticalColorPane.setVisible(verticalLineType.getSelectedItem() != LineType.NONE);
} }
});
checkColorBoxVisible();
JPanel horizonLineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), horizonLineType); //线型支持虚线 恢复用注释。取消注释。
JPanel horizontal = new JPanel(new BorderLayout()); // protected JPanel createGridLinePane() {
horizontal.add(horizonLineTypePane, BorderLayout.NORTH); //
horizontal.add(horizontalColorPane, BorderLayout.CENTER); // Component[][] upComponent = new Component[][]{
// new Component[]{null, null},
JPanel verticalLineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), verticalLineType); // new Component[]{null, horizontalGridLine}
JPanel vertical = new JPanel(new BorderLayout()); // };
vertical.add(verticalLineTypePane, BorderLayout.NORTH); // horizontalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(upComponent);
vertical.add(verticalColorPane, BorderLayout.CENTER); //
// Component[][] downComponent = new Component[][]{
JPanel panel = new JPanel(new BorderLayout(0, 4)); // new Component[]{null,null},
panel.add(horizontal, BorderLayout.NORTH); // new Component[]{null, verticalGridLine}
panel.add(vertical, BorderLayout.CENTER); // };
// verticalColorPane = TableLayout4VanChartHelper.createGapTableLayoutPane(downComponent);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel); //
} // horizonLineType.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent e) {
// if (horizontalGridLine == null || horizonLineType == null){
// return;
// }
// horizontalColorPane.setVisible(horizonLineType.getSelectedItem() != LineType.NONE);
// }
// });
//
// verticalLineType.addActionListener(new ActionListener() {
// @Override
// public void actionPerformed(ActionEvent e) {
// if (verticalGridLine == null || verticalLineType == null){
// return;
// }
// verticalColorPane.setVisible(verticalLineType.getSelectedItem() != LineType.NONE);
// }
// });
//
// checkColorBoxVisible();
//
// JPanel horizonLineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), horizonLineType);
// JPanel horizontal = new JPanel(new BorderLayout());
// horizontal.add(horizonLineTypePane, BorderLayout.NORTH);
// horizontal.add(horizontalColorPane, BorderLayout.CENTER);
//
// JPanel verticalLineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), verticalLineType);
// JPanel vertical = new JPanel(new BorderLayout());
// vertical.add(verticalLineTypePane, BorderLayout.NORTH);
// vertical.add(verticalColorPane, BorderLayout.CENTER);
//
// JPanel panel = new JPanel(new BorderLayout(0, 4));
// panel.add(horizontal, BorderLayout.NORTH);
// panel.add(vertical, BorderLayout.CENTER);
//
// return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel);
// }
protected JPanel createAlertLinePane() { protected JPanel createAlertLinePane() {
alertLine = getAlertLinePane(); alertLine = getAlertLinePane();
@ -208,8 +229,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
private void populateGridLine(VanChartRectanglePlot rectanglePlot) { private void populateGridLine(VanChartRectanglePlot rectanglePlot) {
horizontalGridLine.setSelectObject(rectanglePlot.getDefaultYAxis().getMainGridColor()); horizontalGridLine.setSelectObject(rectanglePlot.getDefaultYAxis().getMainGridColor());
verticalGridLine.setSelectObject(rectanglePlot.getDefaultXAxis().getMainGridColor()); verticalGridLine.setSelectObject(rectanglePlot.getDefaultXAxis().getMainGridColor());
horizonLineType.setSelectedItem(rectanglePlot.getDefaultYAxis().getGridLineType()); //线型支持虚线 恢复用注释。取消注释。
verticalLineType.setSelectedItem(rectanglePlot.getDefaultXAxis().getGridLineType()); // horizonLineType.setSelectedItem(rectanglePlot.getDefaultYAxis().getGridLineType());
// verticalLineType.setSelectedItem(rectanglePlot.getDefaultXAxis().getGridLineType());
} }
@ -234,8 +256,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
private void updateGirdLine(VanChartRectanglePlot rectanglePlot) { private void updateGirdLine(VanChartRectanglePlot rectanglePlot) {
rectanglePlot.getDefaultYAxis().setMainGridColor(horizontalGridLine.getSelectObject()); rectanglePlot.getDefaultYAxis().setMainGridColor(horizontalGridLine.getSelectObject());
rectanglePlot.getDefaultXAxis().setMainGridColor(verticalGridLine.getSelectObject()); rectanglePlot.getDefaultXAxis().setMainGridColor(verticalGridLine.getSelectObject());
rectanglePlot.getDefaultYAxis().setGridLineType((LineType)horizonLineType.getSelectedItem()); //线型支持虚线 恢复用注释。取消注释。
rectanglePlot.getDefaultXAxis().setGridLineType((LineType)verticalLineType.getSelectedItem()); // rectanglePlot.getDefaultYAxis().setGridLineType((LineType)horizonLineType.getSelectedItem());
// rectanglePlot.getDefaultXAxis().setGridLineType((LineType)verticalLineType.getSelectedItem());
} }
/** /**
@ -255,12 +278,13 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
} }
private void checkColorBoxVisible() { private void checkColorBoxVisible() {
if (horizontalColorPane != null && horizonLineType != null){ //线型支持虚线 恢复用注释。取消注释。
horizontalColorPane.setVisible(horizonLineType.getSelectedItem() != LineType.NONE); // if (horizontalColorPane != null && horizonLineType != null){
} // horizontalColorPane.setVisible(horizonLineType.getSelectedItem() != LineType.NONE);
// }
if (verticalColorPane != null && verticalLineType != null){ //
verticalColorPane.setVisible(verticalLineType.getSelectedItem() != LineType.NONE); // if (verticalColorPane != null && verticalLineType != null){
} // verticalColorPane.setVisible(verticalLineType.getSelectedItem() != LineType.NONE);
// }
} }
} }
Loading…
Cancel
Save