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=0c11d348ab62fcc3860437b1e8a72f779f5349d5;hb=f48fa9bd04b1802047c1eba99ad73eb4234a46c2;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..0c11d348a 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,13 @@ 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.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; @@ -151,7 +155,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 +190,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"); + }