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