X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.graphviz%2Fscl%2FVisualization%2FGraphviz%2FNode.scl;h=e59cb1bfa2e8da0b20586841d4fb7aa351b96586;hb=e5a79f44f9d6ce5f38fb61c5db0d9af0a1db35a9;hp=0cbe57b6d04ae5d6e1b0175f3a6f101bdd9e6d8f;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.graphviz/scl/Visualization/Graphviz/Node.scl b/bundles/org.simantics.graphviz/scl/Visualization/Graphviz/Node.scl index 0cbe57b6d..e59cb1bfa 100644 --- a/bundles/org.simantics.graphviz/scl/Visualization/Graphviz/Node.scl +++ b/bundles/org.simantics.graphviz/scl/Visualization/Graphviz/Node.scl @@ -1,26 +1,26 @@ -import "Visualization/Graphviz/AbstractTypes" -import "Visualization/Graphviz/Property" -import "JavaBuiltin" as Java - -importJava "org.simantics.graphviz.Node" where - data Node - @JavaName "" - newPrimitiveNode :: IGraph -> Node - setLabel :: Node -> String -> () - setShape :: Node -> String -> () - @JavaName set - setGenericProperty :: Node -> String -> String -> () - -instance Identifiable Node where - identifiable = Java.unsafeCoerce - -applyNodeProperty :: Node -> Property -> () -applyNodeProperty graph (Label str) = setLabel graph str -applyNodeProperty graph (Shape str) = setShape graph str -applyNodeProperty graph (GenericProperty property str) = setGenericProperty graph property str - -newNode :: IGraph a => a -> [Property] -> Node -newNode graph properties = node - where - node = newPrimitiveNode (iGraph graph) +import "Visualization/Graphviz/AbstractTypes" +import "Visualization/Graphviz/Property" +import "JavaBuiltin" as Java + +importJava "org.simantics.graphviz.Node" where + data Node + @JavaName "" + newPrimitiveNode :: IGraph -> Node + setLabel :: Node -> String -> () + setShape :: Node -> String -> () + @JavaName set + setGenericProperty :: Node -> String -> String -> () + +instance Identifiable Node where + identifiable = Java.unsafeCoerce + +applyNodeProperty :: Node -> Property -> () +applyNodeProperty graph (Label str) = setLabel graph str +applyNodeProperty graph (Shape str) = setShape graph str +applyNodeProperty graph (GenericProperty property str) = setGenericProperty graph property str + +newNode :: IGraph a => a -> [Property] -> Node +newNode graph properties = node + where + node = newPrimitiveNode (iGraph graph) for properties (applyNodeProperty node) \ No newline at end of file