1 /*******************************************************************************
2 * Copyright (c) 2007, 2011 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.scenegraph.profile;
14 import org.simantics.db.Resource;
15 import org.simantics.scenegraph.INode;
16 import org.simantics.scenegraph.g2d.G2DSceneGraph;
19 * @author Antti Villberg
23 public interface EvaluationContext extends Observer {
26 * @return the runtime resource this evaluation context is attached to (i.e.
27 * runtime diagram resource)
29 Resource getResource();
32 * @return the scene graph this profile evaluation context is attached to
34 G2DSceneGraph getSceneGraph();
37 * Get a constant data item attached to the evaluation context by the
44 <T> T getConstant(String key);
47 * Get the specified temporary property for the specified node. Temporary
48 * properties are removed between each round of application of currently
49 * active profile entries.
51 * @param node node to get the property for
52 * @param key key of property to get
53 * @return <code>null</code> if property is not set for the specified node
55 <T> T getTemporaryProperty(INode node, String key);
58 * Set value of temporary property for the evaluation process where this
59 * evaluation context is used. Temporary properties are removed between each
60 * round of application of currently active profile entries.
62 * @param node node to set the property for
63 * @param key key of property to set
64 * @param value value of the property to set
66 <T> void setTemporaryProperty(INode node, String key, T value);
69 * Get the specified (persistent) property for the specified node. These
70 * properties stay available through the lifetime of the evaluation context
71 * i.e. the lifetime of the runtime diagram it is associated with.
73 * @param node node to get the property for
74 * @param key key of property to get
75 * @return <code>null</code> if property is not set for the specified node
77 <T> T getProperty(INode node, String key);
80 * Set value of temporary property for the evaluation process where this
81 * evaluation context is used. These properties stay available through the
82 * lifetime of the evaluation context i.e. the lifetime of the runtime
83 * diagram it is associated with.
85 * @param node node to set the property for
86 * @param key key of property to set
87 * @param value value of the property to set
88 * @return previous value of property
90 <T> T setProperty(INode node, String key, T value);