]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.graphviz/scl/Visualization/Graphviz/Edge.scl
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.graphviz / scl / Visualization / Graphviz / Edge.scl
1 import "Visualization/Graphviz/AbstractTypes"\r
2 import "Visualization/Graphviz/Property"\r
3 \r
4 importJava "org.simantics.graphviz.Edge" where\r
5     data Edge\r
6     @JavaName "<init>"\r
7     newPrimitiveEdge :: Identifiable -> Identifiable -> <Proc> Edge\r
8     setLabel :: Edge -> String -> <Proc> ()\r
9     @JavaName set\r
10     setGenericProperty :: Edge -> String -> String -> <Proc> ()\r
11     \r
12 applyEdgeProperty :: Edge -> Property -> <Proc> ()\r
13 applyEdgeProperty graph (Label str) = setLabel graph str\r
14 applyEdgeProperty graph (GenericProperty property str) = setGenericProperty graph property str\r
15     \r
16 newEdge :: Identifiable a => Identifiable b => a -> b -> [Property] -> <Proc> Edge\r
17 newEdge node1 node2 properties = edge\r
18   where\r
19     edge = newPrimitiveEdge (identifiable node1) (identifiable node2)\r
20     for properties (applyEdgeProperty edge)