1 import "Visualization/Graphviz/AbstractTypes"
2 import "Visualization/Graphviz/Property"
3 import "JavaBuiltin" as Java
5 importJava "org.simantics.graphviz.Graph" where
8 newPrimitiveGraph :: <Proc> Graph
9 setLabel :: Graph -> String -> <Proc> ()
10 setRankdir :: Graph -> String -> <Proc> ()
12 setGenericProperty :: Graph -> String -> String -> <Proc> ()
14 instance IGraph Graph where
15 iGraph = Java.unsafeCoerce
17 applyGraphProperty :: Graph -> Property -> <Proc> ()
18 applyGraphProperty graph (Label str) = setLabel graph str
19 applyGraphProperty graph (Rankdir str) = setRankdir graph str
20 applyGraphProperty graph (GenericProperty property str) = setGenericProperty graph property str
22 newGraph :: [Property] -> <Proc> Graph
23 newGraph properties = graph
25 graph = newPrimitiveGraph
26 for properties (applyGraphProperty graph)