1 import "Simantics/Variables"
\r
2 include "Simantics/Model"
\r
3 import "Simantics/Misc"
\r
4 import "Simantics/Library"
\r
5 import "Simantics/Diagram"
\r
6 import "Simantics/Flag"
\r
7 //import "Simantics/DB"
\r
8 //import "Simantics/Entity"
\r
10 // --- Entity types -------------------------------------------------
\r
12 type DrawingTemplate = Resource
\r
13 type DrawingTemplateLibrary = Resource
\r
14 type FlagTable = Resource
\r
15 type VisualComposite = Resource
\r
16 type FlagTypeVisual = Resource
\r
17 type VisualFilter = Resource
\r
18 type Monitor = Resource
\r
19 type SVGImage = Resource
\r
21 importJava "org.simantics.modeling.template2d.ui.actions.NewDrawingTemplate" where
\r
22 @JavaName createDrawingTemplate
\r
24 Creates new Drawing Template under the given Drawing Template library instance. Returns the created Drawing Template.
\r
26 createDrawingTemplate :: DrawingTemplateLibrary -> <WriteGraph> DrawingTemplate
\r
28 @JavaName getDrawingTemplateLibrary
\r
30 Returns the Drawing Template library folder of the given Model instance.
\r
32 drawingTemplateLibraryOf :: Model -> <ReadGraph> DrawingTemplateLibrary
\r
34 importJava "org.simantics.modeling.template2d.ui.actions.NewFlagTable" where
\r
35 @JavaName createFlagTable
\r
37 Creates new Flag Table under the given Drawing Template instance. Returns the created Flag Table.
\r
39 createFlagTable :: DrawingTemplate -> <WriteGraph> FlagTable
\r
41 importJava "org.simantics.modeling.template2d.ui.actions.NewScenegraph" where
\r
42 @JavaName createVisualComposite
\r
44 Creates new Visual Composite under the given Drawing Template instance. Returns the created Visual Composite.
\r
46 createVisualComposite :: DrawingTemplate -> <WriteGraph> VisualComposite
\r
48 importJava "org.simantics.modeling.template2d.ui.actions.NewFlagTypeVisual" where
\r
49 @JavaName createNewFlagTypeVisual
\r
51 Creates new FlagTypeVisual under the given Flag Table instance. Returns the created FlagTypeVisual
\r
53 createFlagTypeVisual :: FlagTable -> <WriteGraph> FlagTypeVisual
\r
55 importJava "org.simantics.modeling.template2d.ui.actions.NewFlagTypeVisualFilter" where
\r
56 @JavaName createNewFilter
\r
58 Creates new Filter under the given Flag Table instance. Returns the created Filter.
\r
60 createFilter :: FlagTable -> <WriteGraph> VisualFilter
\r
62 importJava "org.simantics.modeling.template2d.ui.actions.NewMonitor" where
\r
63 @JavaName createNewMonitor
\r
65 Creates new Monitor under the given Flag Table instance. Returns the created Monitor.
\r
67 createMonitor :: FlagTable -> <WriteGraph> Monitor
\r
69 @JavaName createNewMonitor
\r
71 Creates new Monitor under the given Visual Composite instance. Returns the created Monitor.
\r
73 createMonitorInComposite :: VisualComposite -> <WriteGraph> Monitor
\r
75 importJava "org.simantics.modeling.template2d.ui.actions.NewSVGImage" where
\r
76 @JavaName createNewSVGImage
\r
78 Creates new SVG image under the given Flag Table instance. Returns the created SVG Image.
\r
80 createImageInTable :: FlagTable -> <WriteGraph> SVGImage
\r
82 @JavaName createNewSVGImage
\r
84 Creates new SVG image under the given Visual Composite instance. Returns the created SVG Image.
\r
86 createImageInComposite :: VisualComposite -> <WriteGraph> SVGImage
\r
88 importJava "org.simantics.modeling.template2d.ui.wizard.DrawingTemplateExporter" where
\r
91 Exports the given Drawing Template to the given File location
\r
93 exportDrawingTemplate :: File -> DrawingTemplate -> <Proc> ()
\r
95 importJava "org.simantics.modeling.template2d.ui.actions.AssignDrawingTemplate" where
\r
96 @Javaname assignTemplateToDiagram
\r
98 Assigns the given Drawing Template to the given Diagram instance
\r
100 assignTemplateToDiagrams :: [Diagram] -> DrawingTemplate -> <WriteGraph> ()
\r
102 assignTemplateToDiagram :: Diagram -> DrawingTemplate -> <WriteGraph> ()
\r
103 assignTemplateToDiagram diagram template = assignTemplateToDiagrams [diagram] template
\r
105 importJava "org.simantics.modeling.ui.SCLLibrary" where
\r
106 @JavaName createLibrary
\r
108 Creates a new Library under the given Drawing Template parameter. Returns the created Library.
\r
110 createLibraryInTemplate :: DrawingTemplate -> <Proc> Library
\r
112 importJava "org.simantics.modeling.ModelingUtils" where
\r
113 importDrawingTemplate :: Model -> File -> <Proc> Resource
\r
115 setMonitorPropertyValue :: Monitor -> String -> String -> <WriteGraph> ()
\r
116 setMonitorPropertyValue monitor property newValue = do
\r
117 monitorUri = uriOf (toResource monitor)
\r
118 completeUri = monitorUri + "#" + property + "#HasDisplayValue"
\r
119 propertyVariable = variable completeUri
\r
120 setValue propertyVariable newValue
\r
122 setFlagTablePropertyValue :: FlagTable -> String -> String -> <WriteGraph> ()
\r
123 setFlagTablePropertyValue flagTable property newValue = do
\r
124 flagTableUri = uriOf (toResource flagTable)
\r
125 completeUri = flagTableUri + "#" + property + "#HasDisplayValue"
\r
126 propertyVariable = variable completeUri
\r
127 setValue propertyVariable newValue
\r
129 importJava "org.simantics.modeling.ui.SCLDiagramTemplate" where
\r
130 templateComposite :: Variable -> <ReadGraph> Variable
\r
131 templateDiagram :: Variable -> <ReadGraph> Variable
\r
132 templateModel :: Variable -> <ReadGraph> Variable
\r
134 importJava "org.simantics.diagram.flag.IOTableUtil" where
\r
135 bindFlagToTable :: Diagram -> Flag -> Double -> Double -> <WriteGraph> Boolean
\r