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