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