X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fadapter%2FDefinedElementFactory.java;h=10855496becc36fce003acafba8e0cac4fb3489a;hb=617b9475710b80a125597f222f9777224972ce72;hp=e7bb472e4ed610450bdbb19a62df5be9f30d67de;hpb=c26409b1caf2f1e560d37c5befd11b442399c3fe;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/DefinedElementFactory.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/DefinedElementFactory.java index e7bb472e4..10855496b 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/DefinedElementFactory.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/DefinedElementFactory.java @@ -20,6 +20,8 @@ import java.util.concurrent.atomic.AtomicInteger; import org.simantics.databoard.Bindings; import org.simantics.db.AsyncReadGraph; import org.simantics.db.Resource; +import org.simantics.db.common.primitiverequest.PossibleAdapter; +import org.simantics.db.common.procedure.adapter.AsyncProcedureAdapter; import org.simantics.db.common.procedure.adapter.ProcedureAdapter; import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener; import org.simantics.db.common.procedure.guarded.GuardedAsyncProcedureWrapper; @@ -37,15 +39,14 @@ import org.simantics.g2d.diagram.IDiagram; import org.simantics.g2d.element.ElementClass; import org.simantics.g2d.element.ElementUtils; import org.simantics.g2d.element.IElement; +import org.simantics.g2d.element.handler.impl.DefaultParameters; import org.simantics.g2d.element.handler.impl.DefaultTransform; import org.simantics.g2d.element.handler.impl.ObjectTerminal; import org.simantics.g2d.element.handler.impl.SimpleElementLayers; import org.simantics.g2d.element.handler.impl.StaticObjectAdapter; import org.simantics.g2d.element.handler.impl.StaticSymbolImageInitializer; import org.simantics.g2d.element.handler.impl.StaticSymbolImpl; -import org.simantics.g2d.element.handler.impl.Terminals; import org.simantics.g2d.element.handler.impl.TextImpl; -import org.simantics.g2d.elementclass.ImageClass; import org.simantics.g2d.elementclass.PlainElementPropertySetter; import org.simantics.g2d.tooltip.TerminalTooltipProvider; import org.simantics.g2d.tooltip.TooltipParticipant; @@ -228,6 +229,7 @@ public class DefinedElementFactory extends ElementFactoryAdapter { TextImpl.INSTANCE, new StaticObjectAdapter(elementType), DefaultTransform.INSTANCE, + DefaultParameters.INSTANCE, StaticSymbolImageInitializer.INSTANCE, new StaticSymbolImpl(img), DefinedElementHandler.INSTANCE, @@ -257,6 +259,17 @@ public class DefinedElementFactory extends ElementFactoryAdapter { // This is needed for terminal tooltips. e.setHint(TooltipParticipant.TOOLTIP_KEY, TerminalTooltipProvider.INSTANCE); + graph.asyncRequest(new PossibleAdapter(element, ElementFactory.class), new AsyncProcedureAdapter() { + @Override + public void execute(AsyncReadGraph graph, ElementFactory factory) { + if (factory != null) { + graph.asyncRequest(new GetElementClassRequest(factory, element, canvas, diagram)); + } + } + }); + + ElementFactoryUtil.readParameters(graph, element, e); + GuardedAsyncProcedureWrapper guard = new GuardedAsyncProcedureWrapper(procedure, 1); ElementFactoryUtil.readTransform(graph, element, e, guard);