diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java index 3f49ebe3fc..5bdfe3c298 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java @@ -352,7 +352,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { @Override public void dragging(DraggingModel model) { FormDesigner designer = model.getDesigner(); - MouseEvent dragEvent = model.getDragEvent(); + MouseEvent dragEvent = model.getCurrentDragEvent(); designer.getStateModel().dragging(dragEvent); } diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java index db40eec0f7..e0d97ff1ce 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java @@ -1253,8 +1253,8 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { @Override public void dragging(DraggingModel model) { FormDesigner designer = model.getDesigner(); - MouseEvent lastPressEvent = model.getLastPressEvent(); - MouseEvent dragEvent = model.getDragEvent(); + MouseEvent lastPressEvent = model.getStartDragEvent(); + MouseEvent dragEvent = model.getCurrentDragEvent(); XCreator creator = model.getCreator(); if ((lastPressEvent == null) || (creator == null)) { return; diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/DraggingModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/DraggingModel.java index 47a50327e4..95e003faf3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/DraggingModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/DraggingModel.java @@ -10,8 +10,8 @@ import java.awt.event.MouseEvent; public class DraggingModel { private FormDesigner designer; private XCreator creator; - private MouseEvent lastPressEvent; - private MouseEvent dragEvent; + private MouseEvent startDragEvent; + private MouseEvent currentDragEvent; private int creatorLeftTopX = -999; // 隐藏 private int creatorLeftTopY = -999; // 隐藏 @@ -24,13 +24,13 @@ public class DraggingModel { return this; } - public DraggingModel lastPressEvent(MouseEvent lastPressEvent) { - this.lastPressEvent = lastPressEvent; + public DraggingModel startDragEvent(MouseEvent startDragEvent) { + this.startDragEvent = startDragEvent; return this; } - public DraggingModel dragEvent(MouseEvent dragEvent) { - this.dragEvent = dragEvent; + public DraggingModel currentDragEvent(MouseEvent dragEvent) { + this.currentDragEvent = dragEvent; return this; } @@ -43,12 +43,12 @@ public class DraggingModel { return designer; } - public MouseEvent getLastPressEvent() { - return lastPressEvent; + public MouseEvent getStartDragEvent() { + return startDragEvent; } - public MouseEvent getDragEvent() { - return dragEvent; + public MouseEvent getCurrentDragEvent() { + return currentDragEvent; } public XCreator getCreator() { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index de03fb61b5..e50bf7049c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -4,12 +4,10 @@ import com.fr.base.vcs.DesignerMode; import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.ComponentAdapter; -import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.events.DesignerEditor; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.location.Location; -import com.fr.design.designer.beans.models.DraggingModel; import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.beans.models.StateModel; import com.fr.design.designer.creator.XBorderStyleWidgetCreator; @@ -465,15 +463,7 @@ public class EditingMouseListener extends MouseInputAdapter { return; } - designer.setDraggingModel(new DraggingModel() - .designer(designer) - .creator(lastXCreator) - .lastPressEvent(lastPressEvent) - .dragEvent(e)); - XLayoutContainer container = designer.getDraggingHotspotLayout(); - LayoutAdapter adapter = container.getLayoutAdapter(); - adapter.dragging(designer.getDraggingModel()); - + designer.startDraggingFormWidget(lastXCreator, lastPressEvent, e); e.translatePoint(oldX - e.getX(), oldY - e.getY()); designer.repaint(); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 66626b1711..4ddc20cc8b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -9,6 +9,7 @@ import com.fr.design.actions.UpdateAction; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.designer.TargetComponent; import com.fr.design.designer.beans.AdapterBus; +import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.Painter; import com.fr.design.designer.beans.actions.CopyAction; import com.fr.design.designer.beans.actions.CutAction; @@ -1218,7 +1219,7 @@ public class FormDesigner extends TargetComponent