1 import "Visualization/Graphviz/AbstractTypes"
2 import "Visualization/Graphviz/Property"
3 import "JavaBuiltin" as Java
5 importJava "org.simantics.graphviz.Node" where
8 newPrimitiveNode :: IGraph -> <Proc> Node
9 setLabel :: Node -> String -> <Proc> ()
10 setShape :: Node -> String -> <Proc> ()
12 setGenericProperty :: Node -> String -> String -> <Proc> ()
14 instance Identifiable Node where
15 identifiable = Java.unsafeCoerce
17 applyNodeProperty :: Node -> Property -> <Proc> ()
18 applyNodeProperty graph (Label str) = setLabel graph str
19 applyNodeProperty graph (Shape str) = setShape graph str
20 applyNodeProperty graph (GenericProperty property str) = setGenericProperty graph property str
22 newNode :: IGraph a => a -> [Property] -> <Proc> Node
23 newNode graph properties = node
25 node = newPrimitiveNode (iGraph graph)
26 for properties (applyNodeProperty node)