2 include "Simantics/Model"
3 import "Simantics/Diagram"
7 // FLAGS ---------------------------
9 @deprecated "Unnecessary function."
10 toFlag :: Resource -> Flag
13 importJava "org.simantics.modeling.flags.MergeFlags" where
15 mergeAllFlagsInDiagram :: Resource -> <WriteGraph> String
18 expandAllFlagsInDiagram :: Resource -> <WriteGraph> ()
20 @JavaName mergeWithoutMetadata
21 mergeFlags :: [Resource] -> <WriteGraph> String
23 importJava "org.simantics.modeling.flags.ExpandFlags" where
24 @JavaName expandFlagWithoutMetadata
25 expandFlag :: Resource -> <WriteGraph> Vector Resource
28 importJava "org.simantics.diagram.flag.FlagUtil" where
29 setFlagExternal :: [Flag] -> Boolean -> <WriteGraph> [Resource]
31 """Joins two flags."""
32 joinFlags :: Flag -> Flag -> <WriteGraph> ()
33 joinFlags flag1 flag2 = do
35 hasType STR.ConnectionJoin,
45 @deprecated "Unnecessary function."
46 flagToElement :: Flag -> Element
47 flagToElement flag = flag
49 getFlags :: Diagram -> <ReadGraph> [Resource]
51 children = collectionToList (objects_ (singleObject dia MOD.CompositeToDiagram) L0.ConsistsOf)
52 flags = filter (\x -> isInstanceOf x DIA.Flag) children
55 getFlagByName :: Diagram -> String -> <ReadGraph> [Resource]
56 getFlagByName dia name = do
58 flags_with_name = filter (\x -> relatedValue2 x L0.HasName == name) flags