|
|
@ -9,7 +9,6 @@ import com.fr.design.mainframe.chart.PaneTitleConstants; |
|
|
|
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; |
|
|
|
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; |
|
|
|
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto; |
|
|
|
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto; |
|
|
|
import com.fr.design.style.color.ColorSelectBox; |
|
|
|
import com.fr.design.style.color.ColorSelectBox; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.plugin.chart.attr.axis.VanChartAxis; |
|
|
|
import com.fr.plugin.chart.attr.axis.VanChartAxis; |
|
|
|
import com.fr.plugin.chart.attr.axis.VanChartGaugeAxis; |
|
|
|
import com.fr.plugin.chart.attr.axis.VanChartGaugeAxis; |
|
|
|
import com.fr.plugin.chart.gauge.VanChartGaugePlot; |
|
|
|
import com.fr.plugin.chart.gauge.VanChartGaugePlot; |
|
|
@ -18,7 +17,6 @@ import com.fr.plugin.chart.type.GaugeStyle; |
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
|
|
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
|
|
|
import com.fr.van.chart.designer.style.axis.VanChartValueAxisPane; |
|
|
|
import com.fr.van.chart.designer.style.axis.VanChartValueAxisPane; |
|
|
|
import com.fr.van.chart.designer.style.axis.component.MinMaxValuePaneWithOutTick; |
|
|
|
|
|
|
|
import com.fr.van.chart.designer.style.axis.component.VanChartMinMaxValuePane; |
|
|
|
import com.fr.van.chart.designer.style.axis.component.VanChartMinMaxValuePane; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.BorderFactory; |
|
|
@ -43,19 +41,19 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { |
|
|
|
public VanChartGaugeDetailAxisPane() { |
|
|
|
public VanChartGaugeDetailAxisPane() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createContentPane(boolean isXAxis){ |
|
|
|
protected JPanel createContentPane(boolean isXAxis) { |
|
|
|
if(gaugeStyle == null){ |
|
|
|
if (gaugeStyle == null) { |
|
|
|
gaugeStyle = GaugeStyle.POINTER; |
|
|
|
gaugeStyle = GaugeStyle.POINTER; |
|
|
|
} |
|
|
|
} |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double[] columnSize = {f, p}; |
|
|
|
double[] columnSize = {f, p}; |
|
|
|
double[] rowSize = {p,p,p,p,p,p,p,p}; |
|
|
|
double[] rowSize = {p, p, p, p, p, p, p, p}; |
|
|
|
return TableLayoutHelper.createTableLayoutPane(getPanelComponents(p, f, columnSize), rowSize, columnSize); |
|
|
|
return TableLayoutHelper.createTableLayoutPane(getPanelComponents(p, f, columnSize), rowSize, columnSize); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Component[][] getPanelComponents(double p, double f, double[] columnSize) { |
|
|
|
private Component[][] getPanelComponents(double p, double f, double[] columnSize) { |
|
|
|
switch (gaugeStyle){ |
|
|
|
switch (gaugeStyle) { |
|
|
|
case THERMOMETER: |
|
|
|
case THERMOMETER: |
|
|
|
return new Component[][]{ |
|
|
|
return new Component[][]{ |
|
|
|
new Component[]{createLabelPane(new double[]{p, p}, columnSize), null}, |
|
|
|
new Component[]{createLabelPane(new double[]{p, p}, columnSize), null}, |
|
|
@ -80,12 +78,12 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createLabelPane(double[] row, double[] col){ |
|
|
|
protected JPanel createLabelPane(double[] row, double[] col) { |
|
|
|
showLabel = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")}); |
|
|
|
showLabel = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")}); |
|
|
|
labelTextAttrPane = getChartTextAttrPane(); |
|
|
|
labelTextAttrPane = getChartTextAttrPane(); |
|
|
|
labelPanel = new JPanel(new BorderLayout()); |
|
|
|
labelPanel = new JPanel(new BorderLayout()); |
|
|
|
labelPanel.add(labelTextAttrPane); |
|
|
|
labelPanel.add(labelTextAttrPane); |
|
|
|
labelPanel.setBorder(BorderFactory.createEmptyBorder(0,15,0,0)); |
|
|
|
labelPanel.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 0)); |
|
|
|
JPanel panel = new JPanel(new BorderLayout(0, 6)); |
|
|
|
JPanel panel = new JPanel(new BorderLayout(0, 6)); |
|
|
|
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel), BorderLayout.NORTH); |
|
|
|
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel), BorderLayout.NORTH); |
|
|
|
panel.add(labelPanel, BorderLayout.CENTER); |
|
|
|
panel.add(labelPanel, BorderLayout.CENTER); |
|
|
@ -96,7 +94,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, panel); |
|
|
|
JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, panel); |
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); |
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15)); |
|
|
|
return jPanel; |
|
|
|
return jPanel; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -108,11 +106,40 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createValueDefinition(){ |
|
|
|
private JPanel createValueDefinition() { |
|
|
|
switch (gaugeStyle){ |
|
|
|
switch (gaugeStyle) { |
|
|
|
case RING: |
|
|
|
case RING: |
|
|
|
case SLOT: |
|
|
|
case SLOT: |
|
|
|
minMaxValuePane = new MinMaxValuePaneWithOutTick(); |
|
|
|
minMaxValuePane = new VanChartMinMaxValuePane() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
protected double[] getRowSize(double p) { |
|
|
|
|
|
|
|
return new double[]{p}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
protected Component[][] getShowComponents(JPanel minPaneWithCheckBox, JPanel maxPaneWithCheckBox, JPanel mainPaneWithCheckBox, JPanel secPaneWithCheckBox) { |
|
|
|
|
|
|
|
return new Component[][]{ |
|
|
|
|
|
|
|
{minPaneWithCheckBox}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case THERMOMETER: |
|
|
|
|
|
|
|
minMaxValuePane = new VanChartMinMaxValuePane() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
protected double[] getRowSize(double p) { |
|
|
|
|
|
|
|
return new double[]{p, p, p}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
protected Component[][] getShowComponents(JPanel minPaneWithCheckBox, JPanel maxPaneWithCheckBox, JPanel mainPaneWithCheckBox, JPanel secPaneWithCheckBox) { |
|
|
|
|
|
|
|
return new Component[][]{ |
|
|
|
|
|
|
|
{minPaneWithCheckBox}, |
|
|
|
|
|
|
|
{mainPaneWithCheckBox}, |
|
|
|
|
|
|
|
{secPaneWithCheckBox}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
minMaxValuePane = new VanChartMinMaxValuePane(); |
|
|
|
minMaxValuePane = new VanChartMinMaxValuePane(); |
|
|
@ -121,7 +148,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { |
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), minMaxValuePane); |
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), minMaxValuePane); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createTickColorPane(double[] row, double[] col){ |
|
|
|
private JPanel createTickColorPane(double[] row, double[] col) { |
|
|
|
mainTickColor = new ColorSelectBox(100); |
|
|
|
mainTickColor = new ColorSelectBox(100); |
|
|
|
secTickColor = new ColorSelectBox(100); |
|
|
|
secTickColor = new ColorSelectBox(100); |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
@ -130,20 +157,20 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { |
|
|
|
}; |
|
|
|
}; |
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); |
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); |
|
|
|
JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_TickColor"), panel); |
|
|
|
JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_TickColor"), panel); |
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); |
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15)); |
|
|
|
return jPanel; |
|
|
|
return jPanel; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private boolean isMulti(GaugeStyle style){ |
|
|
|
private boolean isMulti(GaugeStyle style) { |
|
|
|
return style == GaugeStyle.POINTER || style == GaugeStyle.POINTER_SEMI; |
|
|
|
return style == GaugeStyle.POINTER || style == GaugeStyle.POINTER_SEMI; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private boolean samePane(GaugeStyle style1, GaugeStyle style2){ |
|
|
|
private boolean samePane(GaugeStyle style1, GaugeStyle style2) { |
|
|
|
return style1 == style2 || (isMulti(style1) && isMulti(style2)); |
|
|
|
return style1 == style2 || (isMulti(style1) && isMulti(style2)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void populateBean(VanChartGaugePlot gaugePlot, VanChartStylePane parent){ |
|
|
|
public void populateBean(VanChartGaugePlot gaugePlot, VanChartStylePane parent) { |
|
|
|
if(!samePane(gaugePlot.getGaugeStyle(), gaugeStyle)){ |
|
|
|
if (!samePane(gaugePlot.getGaugeStyle(), gaugeStyle)) { |
|
|
|
gaugeStyle = gaugePlot.getGaugeStyle(); |
|
|
|
gaugeStyle = gaugePlot.getGaugeStyle(); |
|
|
|
reLayoutPane(false); |
|
|
|
reLayoutPane(false); |
|
|
|
parent.initAllListeners(); |
|
|
|
parent.initAllListeners(); |
|
|
@ -151,23 +178,23 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { |
|
|
|
populateBean(gaugePlot.getGaugeAxis()); |
|
|
|
populateBean(gaugePlot.getGaugeAxis()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void populateBean(VanChartAxis axis){ |
|
|
|
public void populateBean(VanChartAxis axis) { |
|
|
|
VanChartGaugeAxis gaugeAxis = (VanChartGaugeAxis)axis; |
|
|
|
VanChartGaugeAxis gaugeAxis = (VanChartGaugeAxis) axis; |
|
|
|
if(mainTickColor != null){ |
|
|
|
if (mainTickColor != null) { |
|
|
|
mainTickColor.setSelectObject(gaugeAxis.getMainTickColor()); |
|
|
|
mainTickColor.setSelectObject(gaugeAxis.getMainTickColor()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(secTickColor != null){ |
|
|
|
if (secTickColor != null) { |
|
|
|
secTickColor.setSelectObject(gaugeAxis.getSecTickColor()); |
|
|
|
secTickColor.setSelectObject(gaugeAxis.getSecTickColor()); |
|
|
|
} |
|
|
|
} |
|
|
|
super.populateBean(gaugeAxis); |
|
|
|
super.populateBean(gaugeAxis); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void updateBean(VanChartAxis axis) { |
|
|
|
public void updateBean(VanChartAxis axis) { |
|
|
|
VanChartGaugeAxis gaugeAxis = (VanChartGaugeAxis)axis; |
|
|
|
VanChartGaugeAxis gaugeAxis = (VanChartGaugeAxis) axis; |
|
|
|
if(mainTickColor != null){ |
|
|
|
if (mainTickColor != null) { |
|
|
|
gaugeAxis.setMainTickColor(mainTickColor.getSelectObject()); |
|
|
|
gaugeAxis.setMainTickColor(mainTickColor.getSelectObject()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(secTickColor != null){ |
|
|
|
if (secTickColor != null) { |
|
|
|
gaugeAxis.setSecTickColor(secTickColor.getSelectObject()); |
|
|
|
gaugeAxis.setSecTickColor(secTickColor.getSelectObject()); |
|
|
|
} |
|
|
|
} |
|
|
|
super.updateBean(gaugeAxis); |
|
|
|
super.updateBean(gaugeAxis); |
|
|
|