Browse Source

REPORT-64149

feature/x
方磊 3 years ago
parent
commit
b02eac522f
  1. 26
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  2. 2
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideCreateUtils.java

26
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -1214,20 +1214,6 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
this.repaint();
}
/**
* 拖拽准备
*
* @param xCreator 组件
*/
public void startDraggingBean(XCreator xCreator) {
// 根据所选择的组件的BeanInfo生成相应的AddingModel
// AddingModel和StateModel不一样,适合当前选择的组件相关的
addingModel = new AddingModel(this, xCreator);
this.setDropTarget(new FormCreatorDropTarget(this));
// 触发状态添加模式事件
repaint();
}
/**
* 拖入新的组件
*
@ -1236,11 +1222,13 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @param currentDragEvent
*/
public void startDraggingNewWidget(XCreator xCreator, MouseEvent startDragEvent, MouseEvent currentDragEvent) {
draggingModel = new DraggingModel()
.designer(this)
.creator(xCreator)
.startDragEvent(startDragEvent)
.currentDragEvent(currentDragEvent);
if (startDragEvent != null && currentDragEvent != null) {
draggingModel = new DraggingModel()
.designer(this)
.creator(xCreator)
.startDragEvent(startDragEvent)
.currentDragEvent(currentDragEvent);
}
addingModel = new AddingModel(this, xCreator);
this.setDropTarget(new FormCreatorDropTarget(this));
repaint();

2
designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideCreateUtils.java

@ -139,7 +139,7 @@ public class GuideCreateUtils {
designer.setDropTarget(new FormCreatorDropTarget(designer));
designer.repaint();
} else {
designer.startDraggingBean(xCreator);
designer.startDraggingNewWidget(xCreator, null, null);
}
FormCreatorDropTarget dropTarget = (FormCreatorDropTarget) designer.getDropTarget();

Loading…
Cancel
Save