X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fadapter%2FGraphToDiagramSynchronizer.java;h=14b9f148a1baa1d8f5fe1ab320d40e0370ccc202;hb=052c827e209230bd428e74180caed3620280a31f;hp=37471eb3a1186fa8dc1c993e7d0f267f178a5f91;hpb=90a52d58489b6c518b13dde238923125c8f63eec;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GraphToDiagramSynchronizer.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GraphToDiagramSynchronizer.java index 37471eb3a..14b9f148a 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GraphToDiagramSynchronizer.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GraphToDiagramSynchronizer.java @@ -129,6 +129,7 @@ import org.simantics.g2d.element.IElementClassProvider; import org.simantics.g2d.element.handler.EdgeVisuals.EdgeEnd; import org.simantics.g2d.element.handler.ElementHandler; import org.simantics.g2d.element.handler.ElementLayerListener; +import org.simantics.g2d.element.handler.ElementLayers; import org.simantics.g2d.element.handler.TerminalTopology; import org.simantics.g2d.element.impl.Element; import org.simantics.g2d.layers.ILayer; @@ -768,16 +769,14 @@ public class GraphToDiagramSynchronizer extends AbstractDisposable implements ID // If the element class is our own, there's no point in creating // a copy of it. - if (ec.contains(elementLayerListener)) - return ec; + /*if (ec.contains(elementLayerListener)) + return ec;*/ List all = ec.getAll(); - List result = new ArrayList(all.size()); + List result = new ArrayList(all); for (ElementHandler eh : all) { - if (eh instanceof ElementLayerListenerImpl) + if (eh instanceof ElementLayers) result.add(elementLayerListener); - else - result.add(eh); } return ElementClass.compile(result, false).setId(ec.getId()); } @@ -1173,7 +1172,7 @@ public class GraphToDiagramSynchronizer extends AbstractDisposable implements ID * A common handler for all elements that is used to listen to changes in * element visibility and focusability on diagram layers. */ - class ElementLayerListenerImpl implements ElementLayerListener { + public class ElementLayerListenerImpl implements ElementLayerListener { private static final long serialVersionUID = -3410052116598828129L; @Override