]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - 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
diff --git a/bundles/org.simantics.graphviz/scl/Visualization/Graphviz/Edge.scl b/bundles/org.simantics.graphviz/scl/Visualization/Graphviz/Edge.scl
new file mode 100644 (file)
index 0000000..f8a0316
--- /dev/null
@@ -0,0 +1,20 @@
+import "Visualization/Graphviz/AbstractTypes"\r
+import "Visualization/Graphviz/Property"\r
+\r
+importJava "org.simantics.graphviz.Edge" where\r
+    data Edge\r
+    @JavaName "<init>"\r
+    newPrimitiveEdge :: Identifiable -> Identifiable -> <Proc> Edge\r
+    setLabel :: Edge -> String -> <Proc> ()\r
+    @JavaName set\r
+    setGenericProperty :: Edge -> String -> String -> <Proc> ()\r
+    \r
+applyEdgeProperty :: Edge -> Property -> <Proc> ()\r
+applyEdgeProperty graph (Label str) = setLabel graph str\r
+applyEdgeProperty graph (GenericProperty property str) = setGenericProperty graph property str\r
+    \r
+newEdge :: Identifiable a => Identifiable b => a -> b -> [Property] -> <Proc> Edge\r
+newEdge node1 node2 properties = edge\r
+  where\r
+    edge = newPrimitiveEdge (identifiable node1) (identifiable node2)\r
+    for properties (applyEdgeProperty edge)
\ No newline at end of file