Browse Source

CHART-11446 未选择数据集灰化了combox

research/11.0
白岳 5 years ago
parent
commit
18f0756d58
  1. 8
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java
  2. 8
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPaneWithUISpinner.java
  3. 9
      designer-chart/src/main/java/com/fr/design/chartx/component/MultiComboBoxPane.java
  4. 10
      designer-chart/src/main/java/com/fr/design/chartx/component/MultiComboBoxPaneWithUISpinner.java
  5. 6
      designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java
  6. 2
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryDataSetFieldsPane.java
  7. 2
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiPieDataSetFieldsPane.java

8
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<T extends JComponent> extends J
updateField(comboBox, temp);
}
}
public void checkEnable(boolean hasUse){
addButton.setEnabled(hasUse);
}
}

8
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<T extends JCompone
updateField(comboBox, temp);
}
}
public void checkEnable(boolean hasUse){
levelNumSpinner.setEnabled(hasUse);
}
}

9
designer-chart/src/main/java/com/fr/design/chartx/component/MultiComboBoxPane.java

@ -14,16 +14,11 @@ import java.util.List;
public class MultiComboBoxPane extends AbstractMultiComponentPane<UIComboBox> {
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<UIComboBox> {
@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

10
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<UIComboBox> {
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

6
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<T extends AbstractColumnFieldCol
protected abstract UIComboBox[] filedComboBoxes();
public void checkBoxUse(boolean hasUse) {
for (Component component : fieldComponents()) {
for (Component component : filedComboBoxes()) {
component.setEnabled(hasUse);
}
}

2
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiCategoryDataSetFieldsPane.java

@ -52,7 +52,7 @@ public class MultiCategoryDataSetFieldsPane extends AbstractDataSetFieldsWithSer
@Override
public void checkBoxUse(boolean hasUse) {
super.checkBoxUse(hasUse);
multiCategoryPane.setHasUse(hasUse);
multiCategoryPane.checkEnable(hasUse);
}
@Override

2
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/MultiPieDataSetFieldsPane.java

@ -93,7 +93,7 @@ public class MultiPieDataSetFieldsPane extends AbstractDataSetFieldsPane<MultiPi
@Override
public void checkBoxUse(boolean hasUse) {
super.checkBoxUse(hasUse);
levelComboBoxPane.setHasUse(hasUse);
levelComboBoxPane.checkEnable(hasUse);
}
@Override

Loading…
Cancel
Save