diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index b6143dc17f..d1c27847ad 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -37,6 +37,8 @@ import java.awt.Component; public class VanChartPlotLabelDetailPane extends BasicPane { private static final long serialVersionUID = -22438250307946275L; + private static final int HORIZONTAL_INDEX = 0; + private BasicBeanPane dataLabelContentPane; private UIButtonGroup position; @@ -52,6 +54,9 @@ public class VanChartPlotLabelDetailPane extends BasicPane { private JPanel positionPane; private Integer[] oldPositionValues; + private JPanel borderPaneWithTitle; + private JPanel backgroundPaneWithTitle; + private VanChartStylePane parent; private Plot plot; @@ -126,8 +131,9 @@ public class VanChartPlotLabelDetailPane extends BasicPane { private JPanel createLabelBorderPane() { borderPane = new VanChartBorderWithShapePane(); + borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); + return borderPaneWithTitle; } private JPanel createLabelBackgroundPane() { @@ -143,7 +149,9 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } }; - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane); + backgroundPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane); + + return backgroundPaneWithTitle; } protected double[] getLabelStyleRowSize(double p) { @@ -228,6 +236,12 @@ public class VanChartPlotLabelDetailPane extends BasicPane { Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), }); + orientation.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + checkOrientation(); + } + }); + return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Text_Orientation"), orientation); } @@ -310,6 +324,16 @@ public class VanChartPlotLabelDetailPane extends BasicPane { tractionLine.setSelected(position.getSelectedItem() == Constants.OUTSIDE); checkPositionEnabled(); } + + private void checkOrientation() { + if (orientation != null && borderPaneWithTitle != null && backgroundPaneWithTitle != null) { + boolean horizontal = orientation.getSelectedIndex() == HORIZONTAL_INDEX; + + borderPaneWithTitle.setVisible(horizontal); + backgroundPaneWithTitle.setVisible(horizontal); + } + } + private void checkPositionEnabled() { tractionLinePane.setVisible(position.getSelectedItem() == Constants.OUTSIDE); } @@ -345,6 +369,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } checkAllUse(); + checkOrientation(); }