diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/command/PasteCommand.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/command/PasteCommand.java index 1136ff70658f845e0ba18e58ce42383d78b7483a..69c559860c9735aedbe07560ebc97c95a4e8609c 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/command/PasteCommand.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/command/PasteCommand.java @@ -22,6 +22,7 @@ public class PasteCommand extends Command { private CopyPasteHelper cHelper; + // List with mapping original BControl ==> cloned BControl private HashMap<BControl, BControl> list = new HashMap<BControl, BControl>(); private List<BControl> parentControls = new ArrayList<BControl>(); @@ -68,6 +69,7 @@ public class PasteCommand extends Command { BControl control = (BControl) it.next(); control.setParent(parent); try { + BControl clone = (BControl) control.clone(); clone.setParent(parent); int x = Integer.valueOf(Integer.valueOf(clone diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/VisualizationFigure.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/VisualizationFigure.java index 1e500bd187ed3d160bc07115b5fb3b22da3724f9..b2b647d2a08de4b9008f5922c86e17c3401cc102 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/VisualizationFigure.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/figure/VisualizationFigure.java @@ -10,7 +10,6 @@ import org.eclipse.draw2d.FreeformLayer; import org.eclipse.draw2d.FreeformLayout; import org.eclipse.draw2d.LayoutAnimator; import org.eclipse.draw2d.LayoutListener; -import org.eclipse.draw2d.MarginBorder; import org.eclipse.draw2d.geometry.Rectangle; public class VisualizationFigure extends FreeformLayer { @@ -19,7 +18,6 @@ public class VisualizationFigure extends FreeformLayer { public VisualizationFigure() { setLayoutManager(new FreeformLayout()); - setBorder(new MarginBorder(5)); addLayoutListener(layoutListener); } diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BControl.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BControl.java index e364f3ab867997dd3b775c6934cdddd33899944c..b30279045306fc5718669306c8d2044712238383 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BControl.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/BControl.java @@ -650,8 +650,6 @@ public abstract class BControl implements IAdaptable, Cloneable { clonedControl.setParent(getParent()); - String newID = clonedControl.getID(); - Map<String, AbstractAttribute> newProperties = new HashMap<String, AbstractAttribute>(); for (Entry<String, AbstractAttribute> e : getAttributes().entrySet()) { AbstractAttribute idAtr = e.getValue().clone(); @@ -659,7 +657,8 @@ public abstract class BControl implements IAdaptable, Cloneable { } clonedControl.setAttributes(newProperties); - clonedControl.setAttributeValue(AttributeConstants.ATTRIBUTE_ID, newID); + clonedControl.setAttributeValue(AttributeConstants.ATTRIBUTE_ID, + getVisualization().getMaxIDString(type)); clonedControl.setChildrenArray(new BControlList()); Iterator<BControl> it = getChildrenArray().iterator(); diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BMSAbstractEditPart.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BMSAbstractEditPart.java index 951a270cb5619f44b8fd3fdd1b8ec1a4decd10d5..90de631cfaa0f809698aefb6057e6922cfab1b02 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BMSAbstractEditPart.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/part/BMSAbstractEditPart.java @@ -23,6 +23,7 @@ import org.eclipse.draw2d.ConnectionAnchor; import org.eclipse.draw2d.Figure; import org.eclipse.draw2d.FlowLayout; import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.gef.ConnectionEditPart; import org.eclipse.gef.NodeEditPart; import org.eclipse.gef.Request; @@ -173,10 +174,10 @@ public abstract class BMSAbstractEditPart extends AbstractGraphicalEditPart protected void refreshEditLayout(IFigure figure, BControl control) { if (!(control instanceof Visualization)) { - if (getFigure().getParent() != null) - getFigure().getParent().setConstraint((IFigure) figure, - control.getLayout()); - getFigure().setPreferredSize(control.getDimension()); + figure.setPreferredSize(control.getDimension()); + if (figure.getParent() != null) + figure.getParent().setConstraint(figure, + new Rectangle(control.getLayout())); } }