Browse Source

整理轴标签界面create方法

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
b916ee4182
  1. 55
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

55
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

@ -208,6 +208,23 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
} }
protected JPanel createLabelPane(double[] row, double[] col) { protected JPanel createLabelPane(double[] row, double[] col) {
initLabelComponents();
labelGapPane = createLabelGapPane(row, col);
labelPanel = createLabelDetailPanel();
addComponentsListener();
JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel);
JPanel labelPane = new JPanel(new BorderLayout());
labelPane.add(showLabelPane, BorderLayout.NORTH);
labelPane.add(labelPanel, BorderLayout.CENTER);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, labelPane);
}
private void initLabelComponents() {
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")});
labelDisplayComboBox = new AxisLabelDisplayComboBox(); labelDisplayComboBox = new AxisLabelDisplayComboBox();
@ -218,7 +235,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
labelTextRotation = new UINumberDragPane(-ROTATION_MAX, ROTATION_MAX); labelTextRotation = new UINumberDragPane(-ROTATION_MAX, ROTATION_MAX);
labelGapStyle = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), Toolkit.i18nText("Fine-Design_Chart_Fixed")}); labelGapStyle = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), Toolkit.i18nText("Fine-Design_Chart_Fixed")});
labelGapValue = new UITextField(); labelGapValue = new UITextField();
}
private JPanel createLabelGapPane(double[] row, double[] col) {
Component[][] gapComponents = new Component[][]{ Component[][] gapComponents = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{ new Component[]{
@ -231,42 +250,48 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
JPanel gapDetailPane = TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, row, col); JPanel gapDetailPane = TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, row, col);
labelGapValuePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText(""), labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); labelGapValuePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText(""), labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
labelGapPane = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
labelGapPane.add(gapDetailPane, BorderLayout.CENTER); panel.add(gapDetailPane, BorderLayout.CENTER);
labelGapPane.add(labelGapValuePane, BorderLayout.SOUTH); panel.add(labelGapValuePane, BorderLayout.SOUTH);
JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel); return panel;
}
private JPanel createLabelDetailPanel() {
JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
labelPanel = new JPanel(new BorderLayout()); panel.add(labelDisplayPane, BorderLayout.NORTH);
labelPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); panel.add(labelTextAttrPane, BorderLayout.CENTER);
labelPanel.add(labelDisplayPane, BorderLayout.NORTH); panel.add(labelGapPane, BorderLayout.SOUTH);
labelPanel.add(labelTextAttrPane, BorderLayout.CENTER);
labelPanel.add(labelGapPane, BorderLayout.SOUTH);
return panel;
}
private void addComponentsListener() {
// 显示/隐藏
showLabel.addActionListener(new ActionListener() { showLabel.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
checkLabelPane(); checkLabelPane();
} }
}); });
// 间隔/缩略/换行
labelDisplayComboBox.addActionListener(new ActionListener() { labelDisplayComboBox.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
checkLabelGapPane(); checkLabelGapPane();
} }
}); });
// 自动/固定
labelGapStyle.addActionListener(new ActionListener() { labelGapStyle.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
checkLabelGapValuePane(); checkLabelGapValuePane();
} }
}); });
JPanel labelPane = new JPanel(new BorderLayout());
labelPane.add(showLabelPane, BorderLayout.NORTH);
labelPane.add(labelPanel, BorderLayout.CENTER);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, labelPane);
} }
// protected JPanel createLabelPane(double[] row, double[] col){ // protected JPanel createLabelPane(double[] row, double[] col){

Loading…
Cancel
Save