|
|
@ -21,7 +21,7 @@ import java.awt.event.ActionListener; |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 样式-背景-绘图区背景-坐标轴图表特有(间隔背景、网格线、警戒线) |
|
|
|
* 样式-背景-绘图区背景-坐标轴图表特有(间隔背景、网格线、警戒线) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{ |
|
|
|
public class VanChartAxisAreaPane extends BasicBeanPane<Plot> { |
|
|
|
private static final long serialVersionUID = -1880497996650835504L; |
|
|
|
private static final long serialVersionUID = -1880497996650835504L; |
|
|
|
|
|
|
|
|
|
|
|
protected ColorSelectBox horizontalGridLine; |
|
|
|
protected ColorSelectBox horizontalGridLine; |
|
|
@ -36,50 +36,50 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{ |
|
|
|
private ColorSelectBox verticalColorBackground; |
|
|
|
private ColorSelectBox verticalColorBackground; |
|
|
|
protected BackgroundListControlPane customIntervalBackground; |
|
|
|
protected BackgroundListControlPane customIntervalBackground; |
|
|
|
|
|
|
|
|
|
|
|
public VanChartAxisAreaPane(){ |
|
|
|
public VanChartAxisAreaPane() { |
|
|
|
initComponents(); |
|
|
|
initComponents(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void initComponents(){ |
|
|
|
protected void initComponents() { |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double[] columnSize = { f }; |
|
|
|
double[] columnSize = {f}; |
|
|
|
double[] rowSize = {p,p,p}; |
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{createGridLinePane(new double[]{p,p,p}, new double[]{p,f})}, |
|
|
|
new Component[]{createGridLinePane(new double[]{p, p, p}, new double[]{p, f})}, |
|
|
|
new Component[]{createAlertLinePane()}, |
|
|
|
new Component[]{createAlertLinePane()}, |
|
|
|
new Component[]{createIntervalPane(new double[]{p,p,p,p}, new double[]{p,f})}, |
|
|
|
new Component[]{createIntervalPane(new double[]{p, p, p, p}, new double[]{p, f})}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.add(panel,BorderLayout.CENTER); |
|
|
|
this.add(panel, BorderLayout.CENTER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createGridLinePane(double[] row, double[] col){ |
|
|
|
private JPanel createGridLinePane(double[] row, double[] col) { |
|
|
|
horizontalGridLine = new ColorSelectBox(100); |
|
|
|
horizontalGridLine = new ColorSelectBox(100); |
|
|
|
verticalGridLine = new ColorSelectBox(100); |
|
|
|
verticalGridLine = new ColorSelectBox(100); |
|
|
|
Component[][] components = getGridLinePaneComponents(); |
|
|
|
Component[][] components = getGridLinePaneComponents(); |
|
|
|
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); |
|
|
|
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); |
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("ChartF-Grid_Line"),panel); |
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("ChartF-Grid_Line"), panel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected Component[][] getGridLinePaneComponents() { |
|
|
|
protected Component[][] getGridLinePaneComponents() { |
|
|
|
return new Component[][]{ |
|
|
|
return new Component[][]{ |
|
|
|
new Component[]{null,null}, |
|
|
|
new Component[]{null, null}, |
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalGridLine}, |
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")), horizontalGridLine}, |
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalGridLine}, |
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")), verticalGridLine}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createAlertLinePane(){ |
|
|
|
protected JPanel createAlertLinePane() { |
|
|
|
alertLine = new AlertLineListControlPane(); |
|
|
|
alertLine = new AlertLineListControlPane(); |
|
|
|
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"),alertLine); |
|
|
|
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"), alertLine); |
|
|
|
alertLine.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); |
|
|
|
alertLine.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15)); |
|
|
|
return panel; |
|
|
|
return panel; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createIntervalPane(double[] row, double[] col){ |
|
|
|
protected JPanel createIntervalPane(double[] row, double[] col) { |
|
|
|
isDefaultIntervalBackground = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_IntervalBackground"), Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")}); |
|
|
|
isDefaultIntervalBackground = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_IntervalBackground"), Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")}); |
|
|
|
horizontalColorBackground = new ColorSelectBox(100); |
|
|
|
horizontalColorBackground = new ColorSelectBox(100); |
|
|
|
verticalColorBackground = new ColorSelectBox(100); |
|
|
|
verticalColorBackground = new ColorSelectBox(100); |
|
|
@ -100,33 +100,33 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{ |
|
|
|
JPanel intervalPane = new JPanel(new BorderLayout(0, 6)); |
|
|
|
JPanel intervalPane = new JPanel(new BorderLayout(0, 6)); |
|
|
|
intervalPane.add(isDefaultIntervalBackground, BorderLayout.NORTH); |
|
|
|
intervalPane.add(isDefaultIntervalBackground, BorderLayout.NORTH); |
|
|
|
intervalPane.add(centerPane, BorderLayout.CENTER); |
|
|
|
intervalPane.add(centerPane, BorderLayout.CENTER); |
|
|
|
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"),intervalPane); |
|
|
|
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"), intervalPane); |
|
|
|
intervalPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); |
|
|
|
intervalPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15)); |
|
|
|
return panel; |
|
|
|
return panel; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected Component[][] getIntervalPaneComponents() { |
|
|
|
protected Component[][] getIntervalPaneComponents() { |
|
|
|
return new Component[][]{ |
|
|
|
return new Component[][]{ |
|
|
|
new Component[]{null,null}, |
|
|
|
new Component[]{null, null}, |
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalColorBackground}, |
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")), horizontalColorBackground}, |
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalColorBackground}, |
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")), verticalColorBackground}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void checkCardPane(){ |
|
|
|
private void checkCardPane() { |
|
|
|
if(isDefaultIntervalBackground.getSelectedIndex() == 0){ |
|
|
|
if (isDefaultIntervalBackground.getSelectedIndex() == 0) { |
|
|
|
cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_IntervalBackground")); |
|
|
|
cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_IntervalBackground")); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")); |
|
|
|
cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected String title4PopupWindow(){ |
|
|
|
protected String title4PopupWindow() { |
|
|
|
return ""; |
|
|
|
return ""; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void populateBean(Plot plot){ |
|
|
|
public void populateBean(Plot plot) { |
|
|
|
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot)plot; |
|
|
|
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
populateGridLine(rectanglePlot); |
|
|
|
populateGridLine(rectanglePlot); |
|
|
@ -146,22 +146,22 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void updateBean(Plot plot){ |
|
|
|
public void updateBean(Plot plot) { |
|
|
|
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot)plot; |
|
|
|
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; |
|
|
|
|
|
|
|
|
|
|
|
updateGirdLine(rectanglePlot); |
|
|
|
updateGirdLine(rectanglePlot); |
|
|
|
|
|
|
|
|
|
|
|
alertLine.update(plot); |
|
|
|
alertLine.update(plot); |
|
|
|
|
|
|
|
|
|
|
|
rectanglePlot.setIsDefaultIntervalBackground(isDefaultIntervalBackground.getSelectedIndex() == 0); |
|
|
|
rectanglePlot.setIsDefaultIntervalBackground(isDefaultIntervalBackground.getSelectedIndex() == 0); |
|
|
|
if(rectanglePlot.isDefaultIntervalBackground()){ |
|
|
|
if (rectanglePlot.isDefaultIntervalBackground()) { |
|
|
|
rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(horizontalColorBackground.getSelectObject()); |
|
|
|
rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(horizontalColorBackground.getSelectObject()); |
|
|
|
rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(verticalColorBackground.getSelectObject()); |
|
|
|
rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(verticalColorBackground.getSelectObject()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(null); |
|
|
|
rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(null); |
|
|
|
rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(null); |
|
|
|
rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(null); |
|
|
|
} |
|
|
|
} |
|
|
|
customIntervalBackground.update(plot,isDefaultIntervalBackground.getSelectedIndex() == 0); |
|
|
|
customIntervalBackground.update(plot, isDefaultIntervalBackground.getSelectedIndex() == 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void updateGirdLine(VanChartRectanglePlot rectanglePlot) { |
|
|
|
protected void updateGirdLine(VanChartRectanglePlot rectanglePlot) { |
|
|
@ -171,6 +171,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Y軸和雷達圖的極軸也是相等的 |
|
|
|
* Y軸和雷達圖的極軸也是相等的 |
|
|
|
|
|
|
|
* |
|
|
|
* @param axisName |
|
|
|
* @param axisName |
|
|
|
* @param valueAxisName |
|
|
|
* @param valueAxisName |
|
|
|
* @return |
|
|
|
* @return |
|
|
@ -180,7 +181,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{ |
|
|
|
ComparatorUtils.equals(VanChartAttrHelper.RADAR_Y_AXIS_PREFIX, axisName); |
|
|
|
ComparatorUtils.equals(VanChartAttrHelper.RADAR_Y_AXIS_PREFIX, axisName); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Plot updateBean(){ |
|
|
|
public Plot updateBean() { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |