configurationOfComponentType :: UserComponent -> <ReadGraph> Resource
configurationOfComponentType component = do
- config = singleObject (toResource component) STR.IsDefinedBy
+ config = singleObject component STR.IsDefinedBy
config
importJava "org.simantics.modeling.flags.LiftFlag" where
flagToTerminal :: Flag -> <WriteGraph> Resource
flagToTerminal flag = do
- result = liftFlag (toResource flag)
+ result = liftFlag flag
if result == Nothing
- then singleObject (toResource flag) DIA.IsLiftedAs
- else do
- show result
- (toResource flag)
-
+ then singleObject flag DIA.IsLiftedAs
+ else flag
+
+@deprecated "Calling this function is unnecessary."
configToDiagram :: Resource -> Diagram
-configToDiagram config = do
- fromResource config
+configToDiagram config = config
populateTerminalToSymbol :: Resource -> (Double, Double) -> <WriteGraph> Element
-populateTerminalToSymbol terminal (x, y) = do
+populateTerminalToSymbol terminal (x, y) = element
+ where
uc = singleObject terminal L0.PartOf
symbol = singleObject uc MOD.ComponentTypeToSymbol
diagram = singleObject symbol STR.IsDefinedBy
(toDoubleArray [1,0,0,1,x,y])
addToGraph diagram terminal element
addCommentMetadata ("Populated terminal " + (show element) + " to user component " + (show uc))
- (fromResource element)
+
importJava "org.simantics.modeling.symbolEditor.PopulateTerminal" where
addToGraph :: Resource -> Resource -> Resource -> <WriteGraph> ()