]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/SCLDiagramTemplate.java
Option for exporting tg and pgraph with sharedlibrary
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / SCLDiagramTemplate.java
1 package org.simantics.modeling.ui;
2
3 import org.simantics.db.ReadGraph;
4 import org.simantics.db.exception.DatabaseException;
5 import org.simantics.db.layer0.variable.Variable;
6 import org.simantics.diagram.function.PredefinedVariables;
7 import org.simantics.scenegraph.loader.ScenegraphLoaderUtils;
8
9 public class SCLDiagramTemplate {
10
11     public static Variable templateDiagram(ReadGraph graph, Variable self) throws DatabaseException {
12         Variable selection = ScenegraphLoaderUtils.getVariableSelection(graph, self);
13         return PredefinedVariables.getInstance().getPredefinedVariable(graph, selection, "diagram");
14     }
15
16     public static Variable templateComposite(ReadGraph graph, Variable self) throws DatabaseException {
17         Variable selection = ScenegraphLoaderUtils.getVariableSelection(graph, self);
18         return PredefinedVariables.getInstance().getPredefinedVariable(graph, selection, "diagramComposite");
19     }
20
21     public static Variable templateModel(ReadGraph graph, Variable self) throws DatabaseException {
22         Variable selection = ScenegraphLoaderUtils.getVariableSelection(graph, self);
23         return PredefinedVariables.getInstance().getPredefinedVariable(graph, selection, "model");
24     }
25
26 }