From 1023ff0713ac4c656b370f9620ea9644b032f66d Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Fri, 30 Sep 2022 14:36:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-81222=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8E=92=E5=BA=8F=E5=85=88=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E9=A6=96=E4=B8=AA=E5=86=8D=E7=82=B9=E5=87=BB=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=EF=BC=8C=E4=B8=8A=E4=B8=8B=E7=AE=AD=E5=A4=B4?= =?UTF-8?q?=E7=BD=AE=E7=81=B0=E6=98=BE=E7=A4=BA=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 按钮交互逻bug --- .../actions/help/alphafine/component/CustomSortPane.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java index 747b8d8ce..adb63730d 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java @@ -153,7 +153,11 @@ public class CustomSortPane extends JPanel { if (order == 0) { top.setEnabled(false); up.setEnabled(false); + down.setEnabled(true); + bottom.setEnabled(true); } else if (order == sortItemPane.getComponentCount() - 1) { + up.setEnabled(true); + top.setEnabled(true); down.setEnabled(false); bottom.setEnabled(false); } else { From 3ce6caba58ad04bfb4abf8250f472ed240241fd8 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Fri, 30 Sep 2022 14:46:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-81222=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8E=92=E5=BA=8F=E5=85=88=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E9=A6=96=E4=B8=AA=E5=86=8D=E7=82=B9=E5=87=BB=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=EF=BC=8C=E4=B8=8A=E4=B8=8B=E7=AE=AD=E5=A4=B4?= =?UTF-8?q?=E7=BD=AE=E7=81=B0=E6=98=BE=E7=A4=BA=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 按钮交互逻bug --- .../alphafine/component/CustomSortPane.java | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java index adb63730d..c544bbac0 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java +++ b/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,23 +155,26 @@ public class CustomSortPane extends JPanel { private void disableButton() { int order = sortItemPane.getComponentZOrder(selectedLabel); if (order == 0) { - top.setEnabled(false); - up.setEnabled(false); - down.setEnabled(true); - bottom.setEnabled(true); + setToolbarEnable(false, false, true, true); } else if (order == sortItemPane.getComponentCount() - 1) { - up.setEnabled(true); - top.setEnabled(true); - 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 selectedTab = new HashSet<>();