Browse Source

Pull request #10212: REPORT-81222【运营产品化二期】自定义排序先点击首个再点击最后一个,上下箭头置灰显示有问题

Merge in DESIGN/design from ~LINK.ZHAO/design:feature/x to feature/x

* commit '3ce6caba58ad04bfb4abf8250f472ed240241fd8':
  REPORT-81222【运营产品化二期】自定义排序先点击首个再点击最后一个,上下箭头置灰显示有问题
  REPORT-81222【运营产品化二期】自定义排序先点击首个再点击最后一个,上下箭头置灰显示有问题
feature/x
Link.Zhao-赵展 2 years ago
parent
commit
863e054a44
  1. 27
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java

27
designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java

@ -85,6 +85,7 @@ public class CustomSortPane extends JPanel {
top.addActionListener(e -> {
SwingUtilities.invokeLater(() -> {
sortItemPane.setComponentZOrder(selectedLabel, 0);
setToolbarEnable(false, false, true, true);
CustomSortPane.this.revalidate();
CustomSortPane.this.repaint();
refreshCurrentOrder();
@ -94,6 +95,7 @@ public class CustomSortPane extends JPanel {
bottom.addActionListener(e -> {
SwingUtilities.invokeLater(() -> {
sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentCount() - 1);
setToolbarEnable(true, true, false, false);
CustomSortPane.this.revalidate();
CustomSortPane.this.repaint();
refreshCurrentOrder();
@ -103,6 +105,7 @@ public class CustomSortPane extends JPanel {
up.addActionListener(e -> {
SwingUtilities.invokeLater(() -> {
sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentZOrder(selectedLabel) - 1);
setToolbarEnable(true, true, true, true);
CustomSortPane.this.revalidate();
CustomSortPane.this.repaint();
refreshCurrentOrder();
@ -112,6 +115,7 @@ public class CustomSortPane extends JPanel {
down.addActionListener(e -> {
SwingUtilities.invokeLater(() -> {
sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentZOrder(selectedLabel) + 1);
setToolbarEnable(true, true, true, true);
CustomSortPane.this.revalidate();
CustomSortPane.this.repaint();
refreshCurrentOrder();
@ -151,19 +155,26 @@ public class CustomSortPane extends JPanel {
private void disableButton() {
int order = sortItemPane.getComponentZOrder(selectedLabel);
if (order == 0) {
top.setEnabled(false);
up.setEnabled(false);
setToolbarEnable(false, false, true, true);
} else if (order == sortItemPane.getComponentCount() - 1) {
down.setEnabled(false);
bottom.setEnabled(false);
setToolbarEnable(true, true, false, false);
} else {
up.setEnabled(true);
top.setEnabled(true);
down.setEnabled(true);
bottom.setEnabled(true);
setToolbarEnable(true, true, true, true);
}
}
/**
* 设置 置顶上移下移置底 按钮的状态
* true启用
* false关闭
*/
private void setToolbarEnable(boolean top, boolean up, boolean down, boolean bottom) {
this.top.setEnabled(top);
this.up.setEnabled(up);
this.down.setEnabled(down);
this.bottom.setEnabled(bottom);
}
private void refreshCurrentOrder() {
String[] currentTabOrder = parentPane.getCurrentOrder();
HashSet<String> selectedTab = new HashSet<>();

Loading…
Cancel
Save