From 280bba4f126a5dec840d6cbc8c0c8f87b1555f42 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 4 Jul 2023 10:53:16 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"Revert=20"REPORT-91839=20=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86=E4=BA=8C=E6=9C=9F?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E8=A7=84=E8=8C=83=E9=97=AE=E9=A2=98""?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b103a0de083d3cd3f10d50ab0a940d5a899cdc5e. --- .../mainframe/vcs/common/VcsHelper.java | 5 ++-- .../design/mainframe/vcs/ui/VcsMovePanel.java | 28 +++++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java index 7ec79ca938..77ab8db68e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java @@ -190,7 +190,6 @@ public class VcsHelper implements JTemplateActionListener { fireVcs.execute(new Runnable() { @Override public void run() { - String fileName = getEditingFilename(); VcsOperator operator = WorkContext.getCurrent().get(VcsOperator.class); VcsEntity entity = operator.getFileVersionByIndex(fileName, 0); @@ -213,7 +212,9 @@ public class VcsHelper implements JTemplateActionListener { } }); - fireVcs.shutdown(); + if (!fireVcs.isShutdown()) { + fireVcs.shutdown(); + } } /** diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java index d92171d26a..350d20424e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java @@ -26,7 +26,11 @@ import com.fr.workspace.server.vcs.VcsManager; import com.fr.workspace.server.vcs.v2.move.VcsMoveService; import com.fr.workspace.server.vcs.v2.move.VcsMoveStrategy; -import javax.swing.*; +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -76,7 +80,7 @@ public class VcsMovePanel extends BasicPane { private BasicPane choosePane; private CardLayout parentCard; private JPanel parentPane; - private static final JProgressBar progressBar = new JProgressBar(); + private static final JProgressBar PROGRESS_BAR = new JProgressBar(); private JPanel progressPanel; private UILabel tipLabel; @@ -141,13 +145,13 @@ public class VcsMovePanel extends BasicPane { private void initProcessPane() { JPanel processPane = new JPanel(); JPanel body = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); - progressBar.setStringPainted(true); - progressBar.setUI(new ModernUIProgressBarUI()); - progressBar.setBorderPainted(false); - progressBar.setOpaque(false); - progressBar.setBorder(null); - progressBar.setSize(BasicDialog.MEDIUM); - body.add(progressBar); + PROGRESS_BAR.setStringPainted(true); + PROGRESS_BAR.setUI(new ModernUIProgressBarUI()); + PROGRESS_BAR.setBorderPainted(false); + PROGRESS_BAR.setOpaque(false); + PROGRESS_BAR.setBorder(null); + PROGRESS_BAR.setSize(BasicDialog.MEDIUM); + body.add(PROGRESS_BAR); body.add(new UILabel(StringUtils.BLANK)); tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_While_Moving")); tipLabel.setAlignmentX(CENTER_ALIGNMENT); @@ -330,7 +334,7 @@ public class VcsMovePanel extends BasicPane { protected Void doInBackground() throws Exception { try { //开始迁移 - VcsMoveService.getInstance().startMove(new VcsMoveService.MoveServiceWhileMoving() { + VcsMoveService.getInstance().startMove(new VcsMoveService.BaseMoveServiceWhileMoving() { @Override public void publishProgress() { int num = VcsMoveService.getInstance().getCurrentMove(); @@ -338,7 +342,7 @@ public class VcsMovePanel extends BasicPane { } @Override public void prepare4Move() { - progressBar.setMaximum(VcsMoveService.getInstance().getTotal()); + PROGRESS_BAR.setMaximum(VcsMoveService.getInstance().getTotal()); } }, strategy); } catch (Exception e) { @@ -353,7 +357,7 @@ public class VcsMovePanel extends BasicPane { @Override protected void process(List chunks) { - progressBar.setValue(chunks.get(chunks.size() - 1)); + PROGRESS_BAR.setValue(chunks.get(chunks.size() - 1)); } @Override