diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/BMotionSelectionSynchronizer.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/BMotionSelectionSynchronizer.java index 2a3753c6242a62bf1ae3897773c38acf261ff0f1..69891a07f7a660d48bd101972cb780b570ce730e 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/BMotionSelectionSynchronizer.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/BMotionSelectionSynchronizer.java @@ -16,27 +16,16 @@ import de.bmotionstudio.gef.editor.model.BControl; public class BMotionSelectionSynchronizer extends SelectionSynchronizer { - private BMotionStudioEditor editor; - - public BMotionSelectionSynchronizer(BMotionStudioEditor editor) { - this.editor = editor; - } - protected EditPart convert(EditPartViewer viewer, EditPart part) { EditPart p = super.convert(viewer, part); if (viewer instanceof ScrollingGraphicalViewer || viewer instanceof TreeViewer) { Object model = part.getModel(); if (model instanceof BControl) { - BControl control = (BControl) model; - String id = control.getID(); - BControl editControl = editor.getEditPage().getVisualization() - .getBControl(id); - Object temp = viewer.getEditPartRegistry().get(editControl); + Object temp = viewer.getEditPartRegistry().get(model); EditPart newPart = null; - if (temp != null) { + if (temp != null) newPart = (EditPart) temp; - } return newPart; } } diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/BMotionStudioEditorPage.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/BMotionStudioEditorPage.java index 4ab8aad00d2d3ebebaa117f4ab4f408c5b01bb09..38ddeb19632431e6baa08b70600459407bf4ac7c 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/BMotionStudioEditorPage.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/BMotionStudioEditorPage.java @@ -645,8 +645,7 @@ public class BMotionStudioEditorPage extends GraphicalEditorWithFlyoutPalette { @Override public SelectionSynchronizer getSelectionSynchronizer() { if (bmotionSelectionSynchronizer == null) - bmotionSelectionSynchronizer = new BMotionSelectionSynchronizer( - bmotionStudioEditor); + bmotionSelectionSynchronizer = new BMotionSelectionSynchronizer(); return bmotionSelectionSynchronizer; } diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/Visualization.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/Visualization.java index 76572aa8d7e3ed9d17ea22b44068332fb696749f..1de47b1b81c7c6e2a4d2a4ebfe2ce9a0a621f517 100644 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/Visualization.java +++ b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/model/Visualization.java @@ -231,13 +231,21 @@ public class Visualization extends BControl { } private BControl getBControl(String ID, List<BControl> children) { - for (BControl bcontrol : children) { - if (bcontrol.getID().equals(ID)) { - return bcontrol; + for (BControl control : children) { + if (control.getID().equals(ID)) { + return control; + } + for (BConnection c : control.getSourceConnections()) { + if (c.getIcon().equals(ID)) + return c; + } + for (BConnection c : control.getTargetConnections()) { + if (c.getIcon().equals(ID)) + return c; } - if (bcontrol.getChildrenArray().size() > 0) { + if (control.getChildrenArray().size() > 0) { BControl childControl = getBControl(ID, - bcontrol.getChildrenArray()); + control.getChildrenArray()); if (childControl != null) return childControl; }