|
|
@ -28,9 +28,6 @@ import javax.swing.event.ChangeEvent; |
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.Dimension; |
|
|
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Created by Mitisky on 15/12/7. |
|
|
|
* Created by Mitisky on 15/12/7. |
|
|
@ -42,6 +39,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
private UIButtonGroup<Integer> position; |
|
|
|
private UIButtonGroup<Integer> position; |
|
|
|
private UIButtonGroup<Boolean> autoAdjust; |
|
|
|
private UIButtonGroup<Boolean> autoAdjust; |
|
|
|
|
|
|
|
private UIButtonGroup<Integer> orientation; |
|
|
|
private UIToggleButton tractionLine; |
|
|
|
private UIToggleButton tractionLine; |
|
|
|
|
|
|
|
|
|
|
|
private ColorSelectBox backgroundColor; |
|
|
|
private ColorSelectBox backgroundColor; |
|
|
@ -157,8 +155,11 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
positionPane = new JPanel(); |
|
|
|
positionPane = new JPanel(); |
|
|
|
checkPositionPane(title); |
|
|
|
checkPositionPane(title); |
|
|
|
panel.add(positionPane, BorderLayout.CENTER); |
|
|
|
panel.add(positionPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hasLabelOrientationPane()) { |
|
|
|
|
|
|
|
panel.add(createLabelOrientationPane(), BorderLayout.CENTER); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (plot.isSupportLeadLine()) { |
|
|
|
if (plot.isSupportLeadLine()) { |
|
|
|
tractionLine = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Show_Guideline")); |
|
|
|
tractionLine = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Show_Guideline")); |
|
|
@ -168,7 +169,25 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
} else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) { |
|
|
|
} else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) { |
|
|
|
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust"), autoAdjust), BorderLayout.SOUTH); |
|
|
|
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust"), autoAdjust), BorderLayout.SOUTH); |
|
|
|
} |
|
|
|
} |
|
|
|
return panel; |
|
|
|
|
|
|
|
|
|
|
|
return getLabelLayoutPane(panel, Toolkit.i18nText("Fine-Design_Form_Attr_Layout")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected JPanel getLabelLayoutPane(JPanel panel, String title) { |
|
|
|
|
|
|
|
return createTableLayoutPaneWithTitle(title, panel); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected boolean hasLabelOrientationPane() { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel createLabelOrientationPane() { |
|
|
|
|
|
|
|
orientation = new UIButtonGroup<>(new String[]{ |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Text_Orientation"), orientation); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void checkPositionPane(String title) { |
|
|
|
protected void checkPositionPane(String title) { |
|
|
@ -205,13 +224,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ |
|
|
|
protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ |
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(comps,row,col); |
|
|
|
return TableLayoutHelper.createTableLayoutPane(comps, row, col); |
|
|
|
return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Form_Attr_Layout"), panel); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void initPositionListener() { |
|
|
|
protected void initPositionListener() { |
|
|
|
position.addChangeListener(new ChangeListener() { |
|
|
|
position.addChangeListener(new ChangeListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -267,11 +283,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
if(position != null){ |
|
|
|
if(position != null){ |
|
|
|
position.setSelectedItem(detail.getPosition()); |
|
|
|
position.setSelectedItem(detail.getPosition()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(orientation != null){ |
|
|
|
|
|
|
|
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() == true ? 0 : 1); |
|
|
|
autoAdjust.setSelectedIndex(detail.isAutoAdjust() ? 0 : 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(backgroundColor != null){ |
|
|
|
if(backgroundColor != null){ |
|
|
@ -294,6 +313,9 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
detail.setAutoAdjust(autoAdjust != null && autoAdjust.getSelectedItem()); |
|
|
|
detail.setAutoAdjust(autoAdjust != null && autoAdjust.getSelectedItem()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(orientation != null){ |
|
|
|
|
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|