Skip to content
Snippets Groups Projects
Commit 9d8095cf authored by Lukas Ladenberger's avatar Lukas Ladenberger
Browse files

fixed PROBPLUGIN-40

parent b7416463
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ public class PasteCommand extends Command { ...@@ -22,6 +22,7 @@ public class PasteCommand extends Command {
private CopyPasteHelper cHelper; private CopyPasteHelper cHelper;
// List with mapping original BControl ==> cloned BControl
private HashMap<BControl, BControl> list = new HashMap<BControl, BControl>(); private HashMap<BControl, BControl> list = new HashMap<BControl, BControl>();
private List<BControl> parentControls = new ArrayList<BControl>(); private List<BControl> parentControls = new ArrayList<BControl>();
...@@ -68,6 +69,7 @@ public class PasteCommand extends Command { ...@@ -68,6 +69,7 @@ public class PasteCommand extends Command {
BControl control = (BControl) it.next(); BControl control = (BControl) it.next();
control.setParent(parent); control.setParent(parent);
try { try {
BControl clone = (BControl) control.clone(); BControl clone = (BControl) control.clone();
clone.setParent(parent); clone.setParent(parent);
int x = Integer.valueOf(Integer.valueOf(clone int x = Integer.valueOf(Integer.valueOf(clone
......
...@@ -10,7 +10,6 @@ import org.eclipse.draw2d.FreeformLayer; ...@@ -10,7 +10,6 @@ import org.eclipse.draw2d.FreeformLayer;
import org.eclipse.draw2d.FreeformLayout; import org.eclipse.draw2d.FreeformLayout;
import org.eclipse.draw2d.LayoutAnimator; import org.eclipse.draw2d.LayoutAnimator;
import org.eclipse.draw2d.LayoutListener; import org.eclipse.draw2d.LayoutListener;
import org.eclipse.draw2d.MarginBorder;
import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.draw2d.geometry.Rectangle;
public class VisualizationFigure extends FreeformLayer { public class VisualizationFigure extends FreeformLayer {
...@@ -19,7 +18,6 @@ public class VisualizationFigure extends FreeformLayer { ...@@ -19,7 +18,6 @@ public class VisualizationFigure extends FreeformLayer {
public VisualizationFigure() { public VisualizationFigure() {
setLayoutManager(new FreeformLayout()); setLayoutManager(new FreeformLayout());
setBorder(new MarginBorder(5));
addLayoutListener(layoutListener); addLayoutListener(layoutListener);
} }
......
...@@ -650,8 +650,6 @@ public abstract class BControl implements IAdaptable, Cloneable { ...@@ -650,8 +650,6 @@ public abstract class BControl implements IAdaptable, Cloneable {
clonedControl.setParent(getParent()); clonedControl.setParent(getParent());
String newID = clonedControl.getID();
Map<String, AbstractAttribute> newProperties = new HashMap<String, AbstractAttribute>(); Map<String, AbstractAttribute> newProperties = new HashMap<String, AbstractAttribute>();
for (Entry<String, AbstractAttribute> e : getAttributes().entrySet()) { for (Entry<String, AbstractAttribute> e : getAttributes().entrySet()) {
AbstractAttribute idAtr = e.getValue().clone(); AbstractAttribute idAtr = e.getValue().clone();
...@@ -659,7 +657,8 @@ public abstract class BControl implements IAdaptable, Cloneable { ...@@ -659,7 +657,8 @@ public abstract class BControl implements IAdaptable, Cloneable {
} }
clonedControl.setAttributes(newProperties); clonedControl.setAttributes(newProperties);
clonedControl.setAttributeValue(AttributeConstants.ATTRIBUTE_ID, newID); clonedControl.setAttributeValue(AttributeConstants.ATTRIBUTE_ID,
getVisualization().getMaxIDString(type));
clonedControl.setChildrenArray(new BControlList()); clonedControl.setChildrenArray(new BControlList());
Iterator<BControl> it = getChildrenArray().iterator(); Iterator<BControl> it = getChildrenArray().iterator();
......
...@@ -23,6 +23,7 @@ import org.eclipse.draw2d.ConnectionAnchor; ...@@ -23,6 +23,7 @@ import org.eclipse.draw2d.ConnectionAnchor;
import org.eclipse.draw2d.Figure; import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.FlowLayout; import org.eclipse.draw2d.FlowLayout;
import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.ConnectionEditPart; import org.eclipse.gef.ConnectionEditPart;
import org.eclipse.gef.NodeEditPart; import org.eclipse.gef.NodeEditPart;
import org.eclipse.gef.Request; import org.eclipse.gef.Request;
...@@ -173,10 +174,10 @@ public abstract class BMSAbstractEditPart extends AbstractGraphicalEditPart ...@@ -173,10 +174,10 @@ public abstract class BMSAbstractEditPart extends AbstractGraphicalEditPart
protected void refreshEditLayout(IFigure figure, BControl control) { protected void refreshEditLayout(IFigure figure, BControl control) {
if (!(control instanceof Visualization)) { if (!(control instanceof Visualization)) {
if (getFigure().getParent() != null) figure.setPreferredSize(control.getDimension());
getFigure().getParent().setConstraint((IFigure) figure, if (figure.getParent() != null)
control.getLayout()); figure.getParent().setConstraint(figure,
getFigure().setPreferredSize(control.getDimension()); new Rectangle(control.getLayout()));
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment