|
|
@ -58,13 +58,19 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
private VanChartStylePane parent; |
|
|
|
private VanChartStylePane parent; |
|
|
|
private Plot plot; |
|
|
|
private Plot plot; |
|
|
|
|
|
|
|
private boolean inCondition; |
|
|
|
|
|
|
|
|
|
|
|
public VanChartPlotLabelDetailPane(Plot plot, VanChartStylePane parent) { |
|
|
|
public VanChartPlotLabelDetailPane(Plot plot, VanChartStylePane parent, boolean inCondition) { |
|
|
|
|
|
|
|
this.inCondition = inCondition; |
|
|
|
this.parent = parent; |
|
|
|
this.parent = parent; |
|
|
|
this.plot = plot; |
|
|
|
this.plot = plot; |
|
|
|
initLabelDetailPane(plot); |
|
|
|
initLabelDetailPane(plot); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isInCondition() { |
|
|
|
|
|
|
|
return inCondition; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public BasicBeanPane<AttrTooltipContent> getDataLabelContentPane() { |
|
|
|
public BasicBeanPane<AttrTooltipContent> getDataLabelContentPane() { |
|
|
|
return dataLabelContentPane; |
|
|
|
return dataLabelContentPane; |
|
|
|
} |
|
|
|
} |
|
|
@ -77,11 +83,11 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
return parent; |
|
|
|
return parent; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void initLabelDetailPane (Plot plot) { |
|
|
|
protected void initLabelDetailPane(Plot plot) { |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
initToolTipContentPane(plot); |
|
|
|
initToolTipContentPane(plot); |
|
|
|
JPanel contentPane = createLabelPane(plot); |
|
|
|
JPanel contentPane = createLabelPane(plot); |
|
|
|
this.add(contentPane,BorderLayout.CENTER); |
|
|
|
this.add(contentPane, BorderLayout.CENTER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Plot getPlot() { |
|
|
|
public Plot getPlot() { |
|
|
@ -94,7 +100,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
//默认从factory中取
|
|
|
|
//默认从factory中取
|
|
|
|
protected void initToolTipContentPane(Plot plot) { |
|
|
|
protected void initToolTipContentPane(Plot plot) { |
|
|
|
dataLabelContentPane = PlotFactory.createPlotLabelContentPane(plot, parent, VanChartPlotLabelDetailPane.this); |
|
|
|
dataLabelContentPane = PlotFactory.createPlotLabelContentPane(plot, parent, VanChartPlotLabelDetailPane.this, inCondition); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createLabelPane(Plot plot) { |
|
|
|
private JPanel createLabelPane(Plot plot) { |
|
|
@ -109,12 +115,12 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { |
|
|
|
protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { |
|
|
|
if(hasLabelPosition(plot)){ |
|
|
|
if (hasLabelPosition(plot)) { |
|
|
|
|
|
|
|
|
|
|
|
// 仅饼图、柱形图、条形图、折线图、面积图含有边框和背景
|
|
|
|
// 仅饼图、柱形图、条形图、折线图、面积图含有边框和背景
|
|
|
|
if (hasBorderAndBackground(plot)) { |
|
|
|
if (hasBorderAndBackground(plot)) { |
|
|
|
return new Component[][]{ |
|
|
|
return new Component[][]{ |
|
|
|
new Component[]{dataLabelContentPane,null}, |
|
|
|
new Component[]{dataLabelContentPane, null}, |
|
|
|
new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null}, |
|
|
|
new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null}, |
|
|
|
new Component[]{createLabelBorderPane(), null}, |
|
|
|
new Component[]{createLabelBorderPane(), null}, |
|
|
|
new Component[]{createLabelBackgroundPane(), null} |
|
|
|
new Component[]{createLabelBackgroundPane(), null} |
|
|
@ -122,25 +128,25 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return new Component[][]{ |
|
|
|
return new Component[][]{ |
|
|
|
new Component[]{dataLabelContentPane,null}, |
|
|
|
new Component[]{dataLabelContentPane, null}, |
|
|
|
new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null} |
|
|
|
new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null} |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return new Component[][]{ |
|
|
|
return new Component[][]{ |
|
|
|
new Component[]{dataLabelContentPane,null} |
|
|
|
new Component[]{dataLabelContentPane, null} |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createLabelBorderPane() { |
|
|
|
private JPanel createLabelBorderPane() { |
|
|
|
borderPane = new VanChartBorderWithShapePane(); |
|
|
|
borderPane = new VanChartBorderWithShapePane(); |
|
|
|
borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); |
|
|
|
borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); |
|
|
|
|
|
|
|
|
|
|
|
return borderPaneWithTitle; |
|
|
|
return borderPaneWithTitle; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createLabelBackgroundPane() { |
|
|
|
private JPanel createLabelBackgroundPane() { |
|
|
|
backgroundPane = new VanChartBackgroundWithOutImagePane(){ |
|
|
|
backgroundPane = new VanChartBackgroundWithOutImagePane() { |
|
|
|
|
|
|
|
|
|
|
|
protected Component[][] getPaneComponents() { |
|
|
|
protected Component[][] getPaneComponents() { |
|
|
|
return new Component[][]{ |
|
|
|
return new Component[][]{ |
|
|
@ -162,7 +168,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected double[] getLabelPaneRowSize(Plot plot, double p) { |
|
|
|
protected double[] getLabelPaneRowSize(Plot plot, double p) { |
|
|
|
return hasLabelPosition(plot) ? new double[]{p,p,p,p,p} : new double[]{p,p,p}; |
|
|
|
return hasLabelPosition(plot) ? new double[]{p, p, p, p, p} : new double[]{p, p, p}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected boolean hasLabelPosition(Plot plot) { |
|
|
|
protected boolean hasLabelPosition(Plot plot) { |
|
|
@ -282,7 +288,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ |
|
|
|
protected JPanel getLabelPositionPane(Component[][] comps, double[] row, double[] col) { |
|
|
|
return TableLayoutHelper.createTableLayoutPane(comps, row, col); |
|
|
|
return TableLayoutHelper.createTableLayoutPane(comps, row, col); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -295,8 +301,8 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected ChartTextAttrPane initTextFontPane () { |
|
|
|
protected ChartTextAttrPane initTextFontPane() { |
|
|
|
return new ChartTextAttrPane(){ |
|
|
|
return new ChartTextAttrPane() { |
|
|
|
protected Component[][] getComponents(JPanel buttonPane) { |
|
|
|
protected Component[][] getComponents(JPanel buttonPane) { |
|
|
|
return new Component[][]{ |
|
|
|
return new Component[][]{ |
|
|
|
new Component[]{null, null}, |
|
|
|
new Component[]{null, null}, |
|
|
@ -317,7 +323,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void checkAllUse() { |
|
|
|
private void checkAllUse() { |
|
|
|
if(tractionLine == null){ |
|
|
|
if (tractionLine == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
checkPositionEnabled(); |
|
|
|
checkPositionEnabled(); |
|
|
@ -341,33 +347,33 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
tractionLinePane.setVisible(position.getSelectedItem() == Constants.OUTSIDE); |
|
|
|
tractionLinePane.setVisible(position.getSelectedItem() == Constants.OUTSIDE); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void checkPane(){ |
|
|
|
protected void checkPane() { |
|
|
|
checkPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")); |
|
|
|
checkPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void populate(AttrLabelDetail detail) { |
|
|
|
public void populate(AttrLabelDetail detail) { |
|
|
|
checkPane(); |
|
|
|
checkPane(); |
|
|
|
dataLabelContentPane.populateBean(detail.getContent()); |
|
|
|
dataLabelContentPane.populateBean(detail.getContent()); |
|
|
|
if(position != null){ |
|
|
|
if (position != null) { |
|
|
|
position.setSelectedItem(detail.getPosition()); |
|
|
|
position.setSelectedItem(detail.getPosition()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(orientation != null){ |
|
|
|
if (orientation != null) { |
|
|
|
orientation.setSelectedIndex(detail.isHorizontal() ? 0 : 1); |
|
|
|
orientation.setSelectedIndex(detail.isHorizontal() ? 0 : 1); |
|
|
|
} |
|
|
|
} |
|
|
|
if(tractionLine != null){ |
|
|
|
if (tractionLine != null) { |
|
|
|
tractionLine.setSelected(detail.isShowGuidLine()); |
|
|
|
tractionLine.setSelected(detail.isShowGuidLine()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(autoAdjust != null){ |
|
|
|
if (autoAdjust != null) { |
|
|
|
autoAdjust.setSelectedIndex(detail.isAutoAdjust() ? 0 : 1); |
|
|
|
autoAdjust.setSelectedIndex(detail.isAutoAdjust() ? 0 : 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(backgroundColor != null){ |
|
|
|
if (backgroundColor != null) { |
|
|
|
backgroundColor.setSelectObject(detail.getBackgroundColor()); |
|
|
|
backgroundColor.setSelectObject(detail.getBackgroundColor()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(borderPane != null){ |
|
|
|
if (borderPane != null) { |
|
|
|
borderPane.populate(detail.getBorder()); |
|
|
|
borderPane.populate(detail.getBorder()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(backgroundPane != null){ |
|
|
|
if (backgroundPane != null) { |
|
|
|
backgroundPane.populate(detail.getBackground()); |
|
|
|
backgroundPane.populate(detail.getBackground()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -379,28 +385,28 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
public void update(AttrLabelDetail detail) { |
|
|
|
public void update(AttrLabelDetail detail) { |
|
|
|
detail.setContent(dataLabelContentPane.updateBean()); |
|
|
|
detail.setContent(dataLabelContentPane.updateBean()); |
|
|
|
|
|
|
|
|
|
|
|
if(position != null && position.getSelectedItem() != null){ |
|
|
|
if (position != null && position.getSelectedItem() != null) { |
|
|
|
detail.setPosition(position.getSelectedItem()); |
|
|
|
detail.setPosition(position.getSelectedItem()); |
|
|
|
|
|
|
|
|
|
|
|
} else if(position != null){ |
|
|
|
} else if (position != null) { |
|
|
|
position.setSelectedItem(detail.getPosition()); |
|
|
|
position.setSelectedItem(detail.getPosition()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
detail.setAutoAdjust(autoAdjust != null && autoAdjust.getSelectedItem()); |
|
|
|
detail.setAutoAdjust(autoAdjust != null && autoAdjust.getSelectedItem()); |
|
|
|
|
|
|
|
|
|
|
|
if(orientation != null){ |
|
|
|
if (orientation != null) { |
|
|
|
detail.setHorizontal(orientation.getSelectedIndex() == 0); |
|
|
|
detail.setHorizontal(orientation.getSelectedIndex() == 0); |
|
|
|
} |
|
|
|
} |
|
|
|
if(tractionLine != null){ |
|
|
|
if (tractionLine != null) { |
|
|
|
detail.setShowGuidLine(tractionLine.isSelected() && detail.getPosition() == Constants.OUTSIDE); |
|
|
|
detail.setShowGuidLine(tractionLine.isSelected() && detail.getPosition() == Constants.OUTSIDE); |
|
|
|
} |
|
|
|
} |
|
|
|
if(backgroundColor != null){ |
|
|
|
if (backgroundColor != null) { |
|
|
|
detail.setBackgroundColor(backgroundColor.getSelectObject()); |
|
|
|
detail.setBackgroundColor(backgroundColor.getSelectObject()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(borderPane != null){ |
|
|
|
if (borderPane != null) { |
|
|
|
borderPane.update(detail.getBorder()); |
|
|
|
borderPane.update(detail.getBorder()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(backgroundPane != null){ |
|
|
|
if (backgroundPane != null) { |
|
|
|
backgroundPane.update(detail.getBackground()); |
|
|
|
backgroundPane.update(detail.getBackground()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|