From 18f0756d586e39d3e32907f14b3f2cd3b6226010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 27 Nov 2019 17:25:52 +0800 Subject: [PATCH] =?UTF-8?q?CHART-11446=20=E6=9C=AA=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E7=81=B0=E5=8C=96=E4=BA=86combox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chartx/component/AbstractMultiComponentPane.java | 8 ++++++-- .../AbstractMultiComponentPaneWithUISpinner.java | 8 ++++++-- .../fr/design/chartx/component/MultiComboBoxPane.java | 9 +-------- .../component/MultiComboBoxPaneWithUISpinner.java | 10 +--------- .../chartx/fields/AbstractDataSetFieldsPane.java | 6 +++--- .../fields/diff/MultiCategoryDataSetFieldsPane.java | 2 +- .../chartx/fields/diff/MultiPieDataSetFieldsPane.java | 2 +- 7 files changed, 19 insertions(+), 26 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java index 6474cad0b..f82e4b253 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java @@ -10,13 +10,13 @@ import com.fr.general.IOUtils; import javax.swing.BoxLayout; import javax.swing.JComponent; import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.List; /** @@ -168,4 +168,8 @@ public abstract class AbstractMultiComponentPane extends J updateField(comboBox, temp); } } + + public void checkEnable(boolean hasUse){ + addButton.setEnabled(hasUse); + } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPaneWithUISpinner.java b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPaneWithUISpinner.java index 5f0e6500b..f784c4a86 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPaneWithUISpinner.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPaneWithUISpinner.java @@ -11,10 +11,10 @@ import com.fr.stable.AssistUtils; import javax.swing.JComponent; import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.awt.Component; import java.util.ArrayList; import java.util.List; +import java.awt.BorderLayout; +import java.awt.Component; /** * Created by shine on 2019/6/18. @@ -148,4 +148,8 @@ public abstract class AbstractMultiComponentPaneWithUISpinner { private List currentBoxItems = new ArrayList(); - private boolean hasUse = false; public void setCurrentBoxItems(List currentBoxItems) { this.currentBoxItems = currentBoxItems; } - public void setHasUse(boolean hasUse) { - this.hasUse = hasUse; - } - @Override protected UIComboBox createFirstFieldComponent() { return new UIComboBoxWithNone(); @@ -31,9 +26,7 @@ public class MultiComboBoxPane extends AbstractMultiComponentPane { @Override protected UIComboBox createOtherFieldComponent() { - UIComboBox uiComboBox = new UIComboBox(currentBoxItems.toArray(new Object[currentBoxItems.size()])); - uiComboBox.setEnabled(hasUse); - return uiComboBox; + return new UIComboBox(currentBoxItems.toArray(new Object[currentBoxItems.size()])); } @Override diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/MultiComboBoxPaneWithUISpinner.java b/designer-chart/src/main/java/com/fr/design/chartx/component/MultiComboBoxPaneWithUISpinner.java index 1b77d163e..8b20768e2 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/MultiComboBoxPaneWithUISpinner.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/MultiComboBoxPaneWithUISpinner.java @@ -13,8 +13,6 @@ import java.util.List; public class MultiComboBoxPaneWithUISpinner extends AbstractMultiComponentPaneWithUISpinner { private List currentBoxList = new ArrayList(); - private boolean hasUse = false; - @Override protected void initComps() { currentBoxList = new ArrayList(); @@ -25,15 +23,9 @@ public class MultiComboBoxPaneWithUISpinner extends AbstractMultiComponentPaneWi this.currentBoxList = currentBoxList; } - public void setHasUse(boolean hasUse) { - this.hasUse = hasUse; - } - @Override protected UIComboBox createJComponent() { - UIComboBox uiComboBox = new UIComboBox(currentBoxList.toArray(new Object[currentBoxList.size()])); - uiComboBox.setEnabled(hasUse); - return uiComboBox; + return new UIComboBox(currentBoxList.toArray(new Object[currentBoxList.size()])); } @Override diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java index 82cc89a62..9e8848ebc 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java @@ -17,10 +17,10 @@ import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.SwingConstants; -import java.awt.BorderLayout; -import java.awt.Component; import java.util.Arrays; import java.util.List; +import java.awt.BorderLayout; +import java.awt.Component; import static com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper.refreshBoxItems; @@ -95,7 +95,7 @@ public abstract class AbstractDataSetFieldsPane