1 package org.simantics.modeling.ui;
\r
3 import org.simantics.db.ReadGraph;
\r
4 import org.simantics.db.exception.DatabaseException;
\r
5 import org.simantics.db.layer0.variable.Variable;
\r
6 import org.simantics.diagram.function.PredefinedVariables;
\r
7 import org.simantics.scenegraph.loader.ScenegraphLoaderUtils;
\r
9 public class SCLDiagramTemplate {
\r
11 public static Variable templateDiagram(ReadGraph graph, Variable self) throws DatabaseException {
\r
12 Variable selection = ScenegraphLoaderUtils.getVariableSelection(graph, self);
\r
13 return PredefinedVariables.getInstance().getPredefinedVariable(graph, selection, "diagram");
\r
16 public static Variable templateComposite(ReadGraph graph, Variable self) throws DatabaseException {
\r
17 Variable selection = ScenegraphLoaderUtils.getVariableSelection(graph, self);
\r
18 return PredefinedVariables.getInstance().getPredefinedVariable(graph, selection, "diagramComposite");
\r
21 public static Variable templateModel(ReadGraph graph, Variable self) throws DatabaseException {
\r
22 Variable selection = ScenegraphLoaderUtils.getVariableSelection(graph, self);
\r
23 return PredefinedVariables.getInstance().getPredefinedVariable(graph, selection, "model");
\r