X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Felement%2FElementHints.java;h=53cac820ef6f376a37a0432e84ec8278a001f356;hb=refs%2Fchanges%2F33%2F4333%2F1;hp=f272044f1952791e580a992ff383070081e0740d;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/element/ElementHints.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/element/ElementHints.java index f272044f1..53cac820e 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/element/ElementHints.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/element/ElementHints.java @@ -20,18 +20,20 @@ import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; import java.util.Collection; import java.util.HashMap; +import java.util.Map; import java.util.Set; +import java.util.function.Consumer; import org.simantics.g2d.canvas.Hints; import org.simantics.g2d.connection.ConnectionEntity; import org.simantics.g2d.connection.IConnectionAdvisor; -import org.simantics.g2d.element.handler.SceneGraph; import org.simantics.g2d.element.handler.EdgeVisuals.ArrowType; import org.simantics.g2d.element.handler.EdgeVisuals.StrokeType; +import org.simantics.g2d.element.handler.SceneGraph; import org.simantics.g2d.image.Image; import org.simantics.g2d.utils.Alignment; import org.simantics.scenegraph.Node; -import org.simantics.utils.datastructures.Callback; +import org.simantics.scenegraph.g2d.color.ColorFilter; import org.simantics.utils.datastructures.hints.IHintContext.Key; import org.simantics.utils.datastructures.hints.IHintContext.KeyOf; @@ -49,13 +51,18 @@ public class ElementHints { * For attaching a callback to an element that is invoked when KEY_SG_NODE * is initialized and set. */ - public static final Key KEY_SG_CALLBACK = new SceneGraphNodeKey(Callback.class, "SG_NODE_CALLBACK"); + public static final Key KEY_SG_CALLBACK = new SceneGraphNodeKey(Consumer.class, "SG_NODE_CALLBACK"); /** * For describing the local affine transformation of an element. */ public static final Key KEY_TRANSFORM = new KeyOf(AffineTransform.class, "TRANSFORM"); + /** + * For describing representation parameters of an element. + */ + public static final Key KEY_PARAMETERS = new KeyOf(Map.class, "PARAMETERS"); + /** * For defining the rectangular boundaries of an element. */ @@ -101,6 +108,7 @@ public class ElementHints { /** Source of data in external data model */ public static final Key KEY_OBJECT = new KeyOf(Object.class, "OBJECT"); + public static final Key KEY_TYPE_CLASS = new KeyOf(String.class, "TYPE_CLASS"); /** * Used for identifying elements that should be ignored in all matters @@ -177,6 +185,11 @@ public class ElementHints { */ public static final Key KEY_ELEMENT_PROPERTIES = new KeyOf(Properties.class, "ELEMENT_PROPERTIES"); + /** + * Color filter to be applied when rendering nodes. + */ + public static final Key KEY_COLOR_FILTER = new KeyOf(ColorFilter.class, "COLOR_FILTER"); + public static class Properties extends HashMap { private static final long serialVersionUID = 6986415032113675720L; }