1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2012 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.sysdyn.ui.handlers.newComponents;
\r
14 import org.simantics.db.ReadGraph;
\r
15 import org.simantics.db.Resource;
\r
16 import org.simantics.db.WriteGraph;
\r
17 import org.simantics.db.exception.DatabaseException;
\r
18 import org.simantics.sysdyn.SysdynResource;
\r
19 import org.simantics.sysdyn.manager.SysdynGameExperimentBase;
\r
22 * Handler for creating a new Game Experiment
\r
23 * @author Teemu Lempinen
\r
26 public class NewGameExperimentNodeHandler extends NewExperimentNodeHandler {
\r
28 protected Resource getExperimentType(ReadGraph g) {
\r
29 return SysdynResource.getInstance(g).GameExperiment;
\r
33 * Override to do experiment-specific alterations
\r
35 protected void configureExperiment(WriteGraph graph, Resource experiment) throws DatabaseException {
\r
36 SysdynResource sr = SysdynResource.getInstance(graph);
\r
37 graph.claimLiteral(experiment, sr.GameExperiment_stepDuration, SysdynGameExperimentBase.DEFAULT_STEP_DURATION);
\r
38 graph.claimLiteral(experiment, sr.GameExperiment_stepLength, SysdynGameExperimentBase.DEFAULT_STEP_LENGTH);
\r
41 protected String getNameSuggestion() {
\r
42 return "Game Experiment";
\r