1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2011 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\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.scenegraph.profile;
\r
14 import org.simantics.db.Resource;
\r
15 import org.simantics.scenegraph.INode;
\r
16 import org.simantics.scenegraph.g2d.G2DSceneGraph;
\r
19 * @author Antti Villberg
\r
23 public interface EvaluationContext extends Observer {
\r
26 * @return the runtime resource this evaluation context is attached to (i.e.
\r
27 * runtime diagram resource)
\r
29 Resource getResource();
\r
32 * @return the scene graph this profile evaluation context is attached to
\r
34 G2DSceneGraph getSceneGraph();
\r
37 * Get a constant data item attached to the evaluation context by the
\r
38 * evaluation system.
\r
44 <T> T getConstant(String key);
\r
47 * Get the specified temporary property for the specified node. Temporary
\r
48 * properties are removed between each round of application of currently
\r
49 * active profile entries.
\r
51 * @param node node to get the property for
\r
52 * @param key key of property to get
\r
53 * @return <code>null</code> if property is not set for the specified node
\r
55 <T> T getTemporaryProperty(INode node, String key);
\r
58 * Set value of temporary property for the evaluation process where this
\r
59 * evaluation context is used. Temporary properties are removed between each
\r
60 * round of application of currently active profile entries.
\r
62 * @param node node to set the property for
\r
63 * @param key key of property to set
\r
64 * @param value value of the property to set
\r
66 <T> void setTemporaryProperty(INode node, String key, T value);
\r
69 * Get the specified (persistent) property for the specified node. These
\r
70 * properties stay available through the lifetime of the evaluation context
\r
71 * i.e. the lifetime of the runtime diagram it is associated with.
\r
73 * @param node node to get the property for
\r
74 * @param key key of property to get
\r
75 * @return <code>null</code> if property is not set for the specified node
\r
77 <T> T getProperty(INode node, String key);
\r
80 * Set value of temporary property for the evaluation process where this
\r
81 * evaluation context is used. These properties stay available through the
\r
82 * lifetime of the evaluation context i.e. the lifetime of the runtime
\r
83 * diagram it is associated with.
\r
85 * @param node node to set the property for
\r
86 * @param key key of property to set
\r
87 * @param value value of the property to set
\r
88 * @return previous value of property
\r
90 <T> T setProperty(INode node, String key, T value);
\r