X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.graphviz%2Fscl%2FVisualization%2FGraphviz%2FEdge.scl;fp=bundles%2Forg.simantics.graphviz%2Fscl%2FVisualization%2FGraphviz%2FEdge.scl;h=f8a0316e01b76156ec563f74a7ccc93e01e6dcb6;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git 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 index 000000000..f8a0316e0 --- /dev/null +++ b/bundles/org.simantics.graphviz/scl/Visualization/Graphviz/Edge.scl @@ -0,0 +1,20 @@ +import "Visualization/Graphviz/AbstractTypes" +import "Visualization/Graphviz/Property" + +importJava "org.simantics.graphviz.Edge" where + data Edge + @JavaName "" + newPrimitiveEdge :: Identifiable -> Identifiable -> Edge + setLabel :: Edge -> String -> () + @JavaName set + setGenericProperty :: Edge -> String -> String -> () + +applyEdgeProperty :: Edge -> Property -> () +applyEdgeProperty graph (Label str) = setLabel graph str +applyEdgeProperty graph (GenericProperty property str) = setGenericProperty graph property str + +newEdge :: Identifiable a => Identifiable b => a -> b -> [Property] -> Edge +newEdge node1 node2 properties = edge + where + edge = newPrimitiveEdge (identifiable node1) (identifiable node2) + for properties (applyEdgeProperty edge) \ No newline at end of file