|
|
@ -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);
|
|
|
|
|
|
|
|
// }
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |