-import "Simantics/Variables"\r
-include "Simantics/Model"\r
-import "Simantics/Misc"\r
-import "Simantics/Library"\r
-import "Simantics/Diagram"\r
-import "Simantics/Flag"\r
-//import "Simantics/DB"\r
-//import "Simantics/Entity"\r
-\r
-// --- Entity types -------------------------------------------------\r
-\r
-type DrawingTemplate = Resource\r
-type DrawingTemplateLibrary = Resource\r
-type FlagTable = Resource\r
-type VisualComposite = Resource\r
-type FlagTypeVisual = Resource\r
-type VisualFilter = Resource\r
-type Monitor = Resource\r
-type SVGImage = Resource\r
-\r
-importJava "org.simantics.modeling.template2d.ui.actions.NewDrawingTemplate" where\r
- @JavaName createDrawingTemplate\r
- """\r
- Creates new Drawing Template under the given Drawing Template library instance. Returns the created Drawing Template.\r
- """\r
- createDrawingTemplate :: DrawingTemplateLibrary -> <WriteGraph> DrawingTemplate\r
- \r
- @JavaName getDrawingTemplateLibrary\r
- """\r
- Returns the Drawing Template library folder of the given Model instance.\r
- """\r
- drawingTemplateLibraryOf :: Model -> <ReadGraph> DrawingTemplateLibrary \r
- \r
-importJava "org.simantics.modeling.template2d.ui.actions.NewFlagTable" where\r
- @JavaName createFlagTable\r
- """\r
- Creates new Flag Table under the given Drawing Template instance. Returns the created Flag Table.\r
- """\r
- createFlagTable :: DrawingTemplate -> <WriteGraph> FlagTable\r
- \r
-importJava "org.simantics.modeling.template2d.ui.actions.NewScenegraph" where\r
- @JavaName createVisualComposite\r
- """\r
- Creates new Visual Composite under the given Drawing Template instance. Returns the created Visual Composite.\r
- """\r
- createVisualComposite :: DrawingTemplate -> <WriteGraph> VisualComposite\r
- \r
-importJava "org.simantics.modeling.template2d.ui.actions.NewFlagTypeVisual" where\r
- @JavaName createNewFlagTypeVisual\r
- """\r
- Creates new FlagTypeVisual under the given Flag Table instance. Returns the created FlagTypeVisual\r
- """\r
- createFlagTypeVisual :: FlagTable -> <WriteGraph> FlagTypeVisual\r
-\r
-importJava "org.simantics.modeling.template2d.ui.actions.NewFlagTypeVisualFilter" where\r
- @JavaName createNewFilter\r
- """\r
- Creates new Filter under the given Flag Table instance. Returns the created Filter.\r
- """\r
- createFilter :: FlagTable -> <WriteGraph> VisualFilter\r
-\r
-importJava "org.simantics.modeling.template2d.ui.actions.NewMonitor" where\r
- @JavaName createNewMonitor\r
- """\r
- Creates new Monitor under the given Flag Table instance. Returns the created Monitor.\r
- """\r
- createMonitor :: FlagTable -> <WriteGraph> Monitor\r
- \r
- @JavaName createNewMonitor\r
- """\r
- Creates new Monitor under the given Visual Composite instance. Returns the created Monitor.\r
- """\r
- createMonitorInComposite :: VisualComposite -> <WriteGraph> Monitor\r
- \r
-importJava "org.simantics.modeling.template2d.ui.actions.NewSVGImage" where\r
- @JavaName createNewSVGImage\r
- """\r
- Creates new SVG image under the given Flag Table instance. Returns the created SVG Image.\r
- """\r
- createImageInTable :: FlagTable -> <WriteGraph> SVGImage\r
- \r
- @JavaName createNewSVGImage\r
- """\r
- Creates new SVG image under the given Visual Composite instance. Returns the created SVG Image.\r
- """\r
- createImageInComposite :: VisualComposite -> <WriteGraph> SVGImage\r
-\r
-importJava "org.simantics.modeling.template2d.ui.wizard.DrawingTemplateExporter" where\r
- @JavaName doExport\r
- """\r
- Exports the given Drawing Template to the given File location\r
- """\r
- exportDrawingTemplate :: File -> DrawingTemplate -> <Proc> ()\r
-\r
-importJava "org.simantics.modeling.template2d.ui.actions.AssignDrawingTemplate" where\r
- @Javaname assignTemplateToDiagram\r
- """\r
- Assigns the given Drawing Template to the given Diagram instance\r
- """\r
- assignTemplateToDiagrams :: [Diagram] -> DrawingTemplate -> <WriteGraph> ()\r
-\r
-assignTemplateToDiagram :: Diagram -> DrawingTemplate -> <WriteGraph> ()\r
-assignTemplateToDiagram diagram template = assignTemplateToDiagrams [diagram] template\r
-\r
-importJava "org.simantics.modeling.ui.SCLLibrary" where\r
- @JavaName createLibrary\r
- """\r
- Creates a new Library under the given Drawing Template parameter. Returns the created Library.\r
- """\r
- createLibraryInTemplate :: DrawingTemplate -> <Proc> Library\r
-\r
-importJava "org.simantics.modeling.ModelingUtils" where\r
- importDrawingTemplate :: Model -> File -> <Proc> Resource\r
-\r
-setMonitorPropertyValue :: Monitor -> String -> String -> <WriteGraph> ()\r
-setMonitorPropertyValue monitor property newValue = do\r
- monitorUri = uriOf (toResource monitor)\r
- completeUri = monitorUri + "#" + property + "#HasDisplayValue"\r
- propertyVariable = variable completeUri\r
- setValue propertyVariable newValue\r
- \r
-setFlagTablePropertyValue :: FlagTable -> String -> String -> <WriteGraph> ()\r
-setFlagTablePropertyValue flagTable property newValue = do\r
- flagTableUri = uriOf (toResource flagTable)\r
- completeUri = flagTableUri + "#" + property + "#HasDisplayValue"\r
- propertyVariable = variable completeUri\r
- setValue propertyVariable newValue\r
-\r
-importJava "org.simantics.modeling.ui.SCLDiagramTemplate" where\r
- templateComposite :: Variable -> <ReadGraph> Variable\r
- templateDiagram :: Variable -> <ReadGraph> Variable\r
- templateModel :: Variable -> <ReadGraph> Variable\r
-\r
-importJava "org.simantics.diagram.flag.IOTableUtil" where\r
- bindFlagToTable :: Diagram -> Flag -> Double -> Double -> <WriteGraph> Boolean\r
+import "Simantics/Variables"
+include "Simantics/Model"
+import "Simantics/Misc"
+import "Simantics/Library"
+import "Simantics/Diagram"
+import "Simantics/Flag"
+//import "Simantics/DB"
+//import "Simantics/Entity"
+
+// --- Entity types -------------------------------------------------
+
+type DrawingTemplate = Resource
+type DrawingTemplateLibrary = Resource
+type FlagTable = Resource
+type VisualComposite = Resource
+type FlagTypeVisual = Resource
+type VisualFilter = Resource
+type Monitor = Resource
+type SVGImage = Resource
+
+importJava "org.simantics.modeling.template2d.ui.actions.NewDrawingTemplate" where
+ @JavaName createDrawingTemplate
+ """
+ Creates new Drawing Template under the given Drawing Template library instance. Returns the created Drawing Template.
+ """
+ createDrawingTemplate :: DrawingTemplateLibrary -> <WriteGraph> DrawingTemplate
+
+ @JavaName getDrawingTemplateLibrary
+ """
+ Returns the Drawing Template library folder of the given Model instance.
+ """
+ drawingTemplateLibraryOf :: Model -> <ReadGraph> DrawingTemplateLibrary
+
+importJava "org.simantics.modeling.template2d.ui.actions.NewFlagTable" where
+ @JavaName createFlagTable
+ """
+ Creates new Flag Table under the given Drawing Template instance. Returns the created Flag Table.
+ """
+ createFlagTable :: DrawingTemplate -> <WriteGraph> FlagTable
+
+importJava "org.simantics.modeling.template2d.ui.actions.NewScenegraph" where
+ @JavaName createVisualComposite
+ """
+ Creates new Visual Composite under the given Drawing Template instance. Returns the created Visual Composite.
+ """
+ createVisualComposite :: DrawingTemplate -> <WriteGraph> VisualComposite
+
+importJava "org.simantics.modeling.template2d.ui.actions.NewFlagTypeVisual" where
+ @JavaName createNewFlagTypeVisual
+ """
+ Creates new FlagTypeVisual under the given Flag Table instance. Returns the created FlagTypeVisual
+ """
+ createFlagTypeVisual :: FlagTable -> <WriteGraph> FlagTypeVisual
+
+importJava "org.simantics.modeling.template2d.ui.actions.NewFlagTypeVisualFilter" where
+ @JavaName createNewFilter
+ """
+ Creates new Filter under the given Flag Table instance. Returns the created Filter.
+ """
+ createFilter :: FlagTable -> <WriteGraph> VisualFilter
+
+importJava "org.simantics.modeling.template2d.ui.actions.NewMonitor" where
+ @JavaName createNewMonitor
+ """
+ Creates new Monitor under the given Flag Table instance. Returns the created Monitor.
+ """
+ createMonitor :: FlagTable -> <WriteGraph> Monitor
+
+ @JavaName createNewMonitor
+ """
+ Creates new Monitor under the given Visual Composite instance. Returns the created Monitor.
+ """
+ createMonitorInComposite :: VisualComposite -> <WriteGraph> Monitor
+
+importJava "org.simantics.modeling.template2d.ui.actions.NewSVGImage" where
+ @JavaName createNewSVGImage
+ """
+ Creates new SVG image under the given Flag Table instance. Returns the created SVG Image.
+ """
+ createImageInTable :: FlagTable -> <WriteGraph> SVGImage
+
+ @JavaName createNewSVGImage
+ """
+ Creates new SVG image under the given Visual Composite instance. Returns the created SVG Image.
+ """
+ createImageInComposite :: VisualComposite -> <WriteGraph> SVGImage
+
+importJava "org.simantics.modeling.template2d.ui.wizard.DrawingTemplateExporter" where
+ @JavaName doExport
+ """
+ Exports the given Drawing Template to the given File location
+ """
+ exportDrawingTemplate :: File -> DrawingTemplate -> <Proc> ()
+
+importJava "org.simantics.modeling.template2d.ui.actions.AssignDrawingTemplate" where
+ @Javaname assignTemplateToDiagram
+ """
+ Assigns the given Drawing Template to the given Diagram instance
+ """
+ assignTemplateToDiagrams :: [Diagram] -> DrawingTemplate -> <WriteGraph> ()
+
+assignTemplateToDiagram :: Diagram -> DrawingTemplate -> <WriteGraph> ()
+assignTemplateToDiagram diagram template = assignTemplateToDiagrams [diagram] template
+
+importJava "org.simantics.modeling.ui.SCLLibrary" where
+ @JavaName createLibrary
+ """
+ Creates a new Library under the given Drawing Template parameter. Returns the created Library.
+ """
+ createLibraryInTemplate :: DrawingTemplate -> <Proc> Library
+
+importJava "org.simantics.modeling.ModelingUtils" where
+ importDrawingTemplate :: Model -> File -> <Proc> Resource
+
+setMonitorPropertyValue :: Monitor -> String -> String -> <WriteGraph> ()
+setMonitorPropertyValue monitor property newValue = do
+ monitorUri = uriOf monitor
+ completeUri = monitorUri + "#" + property + "#HasDisplayValue"
+ propertyVariable = variable completeUri
+ setValue propertyVariable newValue
+
+setFlagTablePropertyValue :: FlagTable -> String -> String -> <WriteGraph> ()
+setFlagTablePropertyValue flagTable property newValue = do
+ flagTableUri = uriOf flagTable
+ completeUri = flagTableUri + "#" + property + "#HasDisplayValue"
+ propertyVariable = variable completeUri
+ setValue propertyVariable newValue
+
+importJava "org.simantics.modeling.ui.SCLDiagramTemplate" where
+ templateComposite :: Variable -> <ReadGraph> Variable
+ templateDiagram :: Variable -> <ReadGraph> Variable
+ templateModel :: Variable -> <ReadGraph> Variable
+
+importJava "org.simantics.diagram.flag.IOTableUtil" where
+ bindFlagToTable :: Diagram -> Flag -> Double -> Double -> <WriteGraph> Boolean