From 582eda383b21e1d714b2e532b2cd2167d90f166e Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 30 Sep 2020 12:12:42 +0800 Subject: [PATCH] =?UTF-8?q?CHART-15944=20=E6=A0=87=E7=AD=BE=E5=BD=A2?= =?UTF-8?q?=E7=8A=B6=E9=80=89=E6=8B=A9=E5=90=8E=E4=B8=89=E7=A7=8D=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=9C=86=E8=A7=92=E7=81=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../border/VanChartBorderWithShapePane.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java index 8ee10d0e7e..ee3e0b02df 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java @@ -25,6 +25,8 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class VanChartBorderWithShapePane extends BasicPane { + private static final int RECTANGULAR_INDEX = 0; + private static final int DIALOG_INDEX = 1; private LineComboBox lineTypeBox; private ColorSelectBox lineColorBox; @@ -54,6 +56,7 @@ public class VanChartBorderWithShapePane extends BasicPane { this.add(detailPane, BorderLayout.SOUTH); initLineTypeListener(); + initShapeListener(); } private void initLineTypeListener() { @@ -68,6 +71,18 @@ public class VanChartBorderWithShapePane extends BasicPane { detailPane.setVisible(lineTypeBox.getSelectedLineStyle() != Constants.LINE_NONE); } + private void initShapeListener() { + borderShape.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + checkRadiusPane(); + } + }); + } + + private void checkRadiusPane() { + borderRadius.setEnabled(borderShape.getSelectedIndex() == RECTANGULAR_INDEX || borderShape.getSelectedIndex() == DIALOG_INDEX); + } + private JPanel createLineTypePane() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -118,6 +133,7 @@ public class VanChartBorderWithShapePane extends BasicPane { borderRadius.setValue(border.getRoundRadius()); checkDetailPane(); + checkRadiusPane(); } public void update(AttrBorderWithShape border) {