|
|
|
@ -1252,12 +1252,12 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
instantiateCreator(xCreator); |
|
|
|
|
draggingModel = new DraggingModel() |
|
|
|
|
.designer(this) |
|
|
|
|
.creator(xCreator) |
|
|
|
|
.startDragEvent(startDragEvent) |
|
|
|
|
.currentDragEvent(currentDragEvent) |
|
|
|
|
.dragNewWidget(true); |
|
|
|
|
.currentDragEvent(currentDragEvent); |
|
|
|
|
this.setDropTarget(new FormCreatorDropTarget(this, xCreator)); |
|
|
|
|
repaint(); |
|
|
|
|
} |
|
|
|
@ -1273,12 +1273,12 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
|
|
|
|
|
if (currentDragEvent == null || this.getDropTarget() != null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
backUpCreator(xCreator); |
|
|
|
|
draggingModel = new DraggingModel() |
|
|
|
|
.designer(this) |
|
|
|
|
.creator(xCreator) |
|
|
|
|
.startDragEvent(startDragEvent) |
|
|
|
|
.currentDragEvent(currentDragEvent) |
|
|
|
|
.dragNewWidget(false); |
|
|
|
|
.currentDragEvent(currentDragEvent); |
|
|
|
|
XLayoutContainer container = this.getDraggingHotspotLayout(); |
|
|
|
|
LayoutAdapter adapter = container.getLayoutAdapter(); |
|
|
|
|
adapter.dragging(this.getDraggingModel()); |
|
|
|
@ -1990,27 +1990,25 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
|
|
|
|
|
return spacingLineDrawer; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void instantiateCreator(XCreator creator) { |
|
|
|
|
ModelUtil.renameWidgetName(this.getTarget(), creator); |
|
|
|
|
creator.addNotify(); |
|
|
|
|
|
|
|
|
|
ComponentAdapter adapter = new CompositeComponentAdapter(this, creator); |
|
|
|
|
adapter.initialize(); |
|
|
|
|
creator.putClientProperty(AdapterBus.CLIENT_PROPERTIES, adapter); |
|
|
|
|
} |
|
|
|
|
public void instantiateCreator(XCreator creator) { |
|
|
|
|
if (creator != null) { |
|
|
|
|
ModelUtil.renameWidgetName(this.getTarget(), creator); |
|
|
|
|
creator.addNotify(); |
|
|
|
|
|
|
|
|
|
public void addNewWidget(XCreator creator, int x, int y) { |
|
|
|
|
instantiateCreator(creator); |
|
|
|
|
addWidgetToForm(creator, x, y); |
|
|
|
|
ComponentAdapter adapter = new CompositeComponentAdapter(this, creator); |
|
|
|
|
adapter.initialize(); |
|
|
|
|
creator.putClientProperty(AdapterBus.CLIENT_PROPERTIES, adapter); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void changeWidgetPlace(XCreator creator, int x, int y) { |
|
|
|
|
creator.backupCurrentSize(); |
|
|
|
|
creator.backupParent(); |
|
|
|
|
addWidgetToForm(creator, x, y); |
|
|
|
|
public void backUpCreator(XCreator creator) { |
|
|
|
|
if (creator != null) { |
|
|
|
|
creator.backupCurrentSize(); |
|
|
|
|
creator.backupParent(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void addWidgetToForm(XCreator creator, int x, int y) { |
|
|
|
|
public void addWidgetToForm(XCreator creator, int x, int y) { |
|
|
|
|
if(creator == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|