|
|
@ -113,7 +113,7 @@ public class HeaderAreaPane extends JPanel { |
|
|
|
SortColumnRowPane columnRowPane; |
|
|
|
SortColumnRowPane columnRowPane; |
|
|
|
JLayeredPane jLayeredPane; |
|
|
|
JLayeredPane jLayeredPane; |
|
|
|
UIComboBox uiComboBox; |
|
|
|
UIComboBox uiComboBox; |
|
|
|
boolean populateBeaning; |
|
|
|
boolean showHeaderArea; |
|
|
|
|
|
|
|
|
|
|
|
AreaJLayeredPane() { |
|
|
|
AreaJLayeredPane() { |
|
|
|
this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); |
|
|
|
this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); |
|
|
@ -132,36 +132,37 @@ public class HeaderAreaPane extends JPanel { |
|
|
|
uiComboBox.addItemListener(new ItemListener() { |
|
|
|
uiComboBox.addItemListener(new ItemListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
if (e.getStateChange() != uiComboBox.getSelectedIndex()) { |
|
|
|
if ((showHeaderArea ? 1 : 0) != uiComboBox.getSelectedIndex()) { |
|
|
|
setSortColumnRowPaneShow(uiComboBox.getSelectedIndex() == 1); |
|
|
|
triggerItemChanged(uiComboBox.getSelectedIndex()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
uiComboBox.setEnabled(false); |
|
|
|
uiComboBox.setEnabled(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void setSortColumnRowPaneShow(boolean show) { |
|
|
|
void triggerItemChanged(Integer index) { |
|
|
|
if (show) { |
|
|
|
setSortColumnRowPaneShow(index == 1); |
|
|
|
jLayeredPane.setLayer(columnRowPane, JLayeredPane.POPUP_LAYER); |
|
|
|
if (index == 1) { |
|
|
|
jLayeredPane.setLayer(uiComboBox, JLayeredPane.MODAL_LAYER); |
|
|
|
|
|
|
|
if (!populateBeaning) { |
|
|
|
|
|
|
|
ColumnRow columnRow = columnRowPane.updateBean(); |
|
|
|
ColumnRow columnRow = columnRowPane.updateBean(); |
|
|
|
if (cellSelectionManager.isNotSelectables(columnRow)) { |
|
|
|
if (cellSelectionManager.isNotSelectables(columnRow)) { |
|
|
|
columnRowPane.setColumnRow(ColumnRow.ERROR); |
|
|
|
columnRowPane.setColumnRow(ColumnRow.ERROR); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
cellSelectionManager.addNotSelectables(columnRow); |
|
|
|
cellSelectionManager.addNotSelectables(columnRow); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
cellSelectionManager.removeNotSelectables(columnRowPane.updateBean()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setSortColumnRowPaneShow(boolean show) { |
|
|
|
|
|
|
|
if (show) { |
|
|
|
|
|
|
|
jLayeredPane.setLayer(columnRowPane, JLayeredPane.POPUP_LAYER); |
|
|
|
|
|
|
|
jLayeredPane.setLayer(uiComboBox, JLayeredPane.MODAL_LAYER); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
jLayeredPane.setLayer(uiComboBox, JLayeredPane.POPUP_LAYER); |
|
|
|
jLayeredPane.setLayer(uiComboBox, JLayeredPane.POPUP_LAYER); |
|
|
|
jLayeredPane.setLayer(columnRowPane, JLayeredPane.MODAL_LAYER); |
|
|
|
jLayeredPane.setLayer(columnRowPane, JLayeredPane.MODAL_LAYER); |
|
|
|
if (!populateBeaning) { |
|
|
|
|
|
|
|
cellSelectionManager.removeNotSelectables(columnRowPane.updateBean()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
showHeaderArea = show; |
|
|
|
refresh(); |
|
|
|
refresh(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -175,16 +176,11 @@ public class HeaderAreaPane extends JPanel { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void populateBean(ColumnRow columnRow, boolean showHeaderArea, boolean enabled) { |
|
|
|
public void populateBean(ColumnRow columnRow, boolean showHeaderArea, boolean enabled) { |
|
|
|
populateBeaning = true; |
|
|
|
|
|
|
|
cellSelectionManager.build(); |
|
|
|
cellSelectionManager.build(); |
|
|
|
columnRowPane.populateBean(columnRow, enabled, cellSelectionManager); |
|
|
|
columnRowPane.populateBean(columnRow, enabled, cellSelectionManager); |
|
|
|
if (showHeaderArea) { |
|
|
|
setSortColumnRowPaneShow(showHeaderArea); |
|
|
|
uiComboBox.setSelectedIndex(1); |
|
|
|
uiComboBox.setSelectedIndex(showHeaderArea ? 1 : 0); |
|
|
|
} else { |
|
|
|
|
|
|
|
uiComboBox.setSelectedIndex(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
uiComboBox.setEnabled(enabled); |
|
|
|
uiComboBox.setEnabled(enabled); |
|
|
|
populateBeaning = false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ColumnRow updateBean() { |
|
|
|
public ColumnRow updateBean() { |
|
|
|