From 0ae062a012093257e24ac28e39dce5d965c7a9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 18 Nov 2021 17:46:59 +0800 Subject: [PATCH] REPORT-62275 --- .../designer/beans/adapters/layout/FRNoFixLayoutAdapter.java | 1 - .../com/fr/design/designer/beans/models/SelectionModel.java | 5 ----- .../java/com/fr/design/mainframe/FormCreatorDropTarget.java | 5 +++-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRNoFixLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRNoFixLayoutAdapter.java index b278e0ffe..3f0c61e63 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRNoFixLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRNoFixLayoutAdapter.java @@ -145,7 +145,6 @@ public class FRNoFixLayoutAdapter extends AbstractLayoutAdapter { @Override public void dragStart(XCreator xCreator, SelectionModel selectionModel) { selectionModel.removeCreator(xCreator, xCreator.getWidth(), xCreator.getHeight()); - selectionModel.fireCreatorDeleted(); selectionModel.setSelectedCreator(container); } diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index 28456f799..31bb62531 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -584,9 +584,4 @@ public class SelectionModel { selection.setSelectedCreators(rebuildSelection); fireCreatorSelected(); } - - public void fireCreatorDeleted() { - designer.getEditListenerTable().fireCreatorModified(selection.getSelectedCreator(), - DesignerEvent.CREATOR_DELETED); - } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java index 2b9a4f6be..6a0ad0952 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -166,11 +166,12 @@ public class FormCreatorDropTarget extends DropTarget { private void undoWhenDropFail() { JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); - if (jt != null && jt.getUndoManager().canUndo()) { + if (jt != null) { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - jt.undo(); + FormUndoState current = (FormUndoState) jt.getUndoState(); + current.applyState(); } }); }