1 package org.simantics.modeling.ui;
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;
9 public class SCLDiagramTemplate {
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"); //$NON-NLS-1$
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"); //$NON-NLS-1$
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"); //$NON-NLS-1$