package org.simantics.modeling.ui; import org.simantics.db.ReadGraph; import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.variable.Variable; import org.simantics.diagram.function.PredefinedVariables; import org.simantics.scenegraph.loader.ScenegraphLoaderUtils; public class SCLDiagramTemplate { public static Variable templateDiagram(ReadGraph graph, Variable self) throws DatabaseException { Variable selection = ScenegraphLoaderUtils.getVariableSelection(graph, self); return PredefinedVariables.getInstance().getPredefinedVariable(graph, selection, "diagram"); } public static Variable templateComposite(ReadGraph graph, Variable self) throws DatabaseException { Variable selection = ScenegraphLoaderUtils.getVariableSelection(graph, self); return PredefinedVariables.getInstance().getPredefinedVariable(graph, selection, "diagramComposite"); } public static Variable templateModel(ReadGraph graph, Variable self) throws DatabaseException { Variable selection = ScenegraphLoaderUtils.getVariableSelection(graph, self); return PredefinedVariables.getInstance().getPredefinedVariable(graph, selection, "model"); } }