X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Fdiagram%2FDiagramHints.java;h=9b36d845f9673d27868ff7c03e01f1664d30c620;hb=0bc1e827754b507fc0d7dee0390550253ab88378;hp=367cebcce67fb91caba55ad502c9c1050e75508e;hpb=0bb744e04ba4c0ac9304fa88caf8e4ba3e9bd2ed;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/DiagramHints.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/DiagramHints.java index 367cebcce..9b36d845f 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/DiagramHints.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/DiagramHints.java @@ -20,9 +20,14 @@ import java.util.Map; import org.simantics.g2d.canvas.ICanvasContext; import org.simantics.g2d.canvas.ICanvasParticipant; import org.simantics.g2d.connection.IConnectionAdvisor; +import org.simantics.g2d.diagram.handler.impl.PickContextImpl; +import org.simantics.g2d.diagram.participant.ElementPainter; +import org.simantics.g2d.element.IElement; +import org.simantics.g2d.element.handler.ElementLayerListener; import org.simantics.g2d.layers.ILayers; import org.simantics.g2d.layers.ILayersEditor; import org.simantics.g2d.routing.IRouter2; +import org.simantics.scenegraph.INode; import org.simantics.scenegraph.g2d.snap.ISnapAdvisor; import org.simantics.utils.datastructures.hints.IHintContext.Key; import org.simantics.utils.datastructures.hints.IHintContext.KeyOf; @@ -91,6 +96,8 @@ public class DiagramHints { public static final Key KEY_LAYERS_EDITOR = new KeyOf(ILayersEditor.class, "LAYERS_EDITOR"); + public static final Key KEY_ELEMENT_LAYER_LISTENER = new KeyOf(ElementLayerListener.class, "ELEMENT_LAYER_LISTENER"); + public static final Key KEY_FIXED_LAYERS = new KeyOf(String[].class, "FIXED_LAYERS"); public static final Key KEY_MUTATOR = new KeyOf(DiagramMutator.class, "MUTATIONS"); @@ -151,7 +158,7 @@ public class DiagramHints { /** * A Hint for other participants to use for showing the context menu at the - * contol position specified by the Point2D argument. + * control position specified by the Point2D argument. */ public static final Key SHOW_POPUP_MENU = new KeyOf(Point2D.class, "SHOW_POPUP_MENU_CMD"); @@ -186,4 +193,14 @@ public class DiagramHints { */ public static final Key SELECTION_PADDING_SCALE_FACTOR = new KeyOf(Double.class, "SELECTION_PADDING_SCALE_FACTOR"); + /** + * An optional cache map that maps scene graph {@link INode}s to + * {@link IElement}s to speed up IElement lookups based on SG nodes. + * + * @since 1.36.0 + * @see PickContextImpl + * @see ElementPainter + */ + public static final Key NODE_TO_ELEMENT_MAP = new KeyOf(Map.class, "NODE_TO_ELEMENT_MAP"); + }