]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scenegraph.profile/src/org/simantics/scenegraph/profile/Style.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.scenegraph.profile / src / org / simantics / scenegraph / profile / Style.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 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
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.scenegraph.profile;\r
13 \r
14 import org.simantics.db.RequestProcessor;\r
15 import org.simantics.db.Resource;\r
16 \r
17 /**\r
18  * This interface is not intended to be implemented directly. Extend\r
19  * {@link StyleBase} instead.\r
20  * \r
21  * @see StyleBase\r
22  * @author Antti Villberg\r
23  */\r
24 public interface Style {\r
25 \r
26     /**\r
27      * Activates this style. Intended to start tracking the diagram items\r
28      * contained by the specified group and to request style applications\r
29      * whenever necessary through the specified profile observer. If a style\r
30      * instance is already active, re-activation should not do anything. A style\r
31      * can be re-activated after being deactivated.\r
32      * \r
33      * @param backend\r
34      * @param runtimeDiagram\r
35      * @param configuration\r
36      * @param group\r
37      * @param observer\r
38      */\r
39     void activate(RequestProcessor backend, Resource runtimeDiagram, Resource entry, Group group, EvaluationContext observer);\r
40 \r
41     /**\r
42      * Deactivates this style. Intended to stop tracking the currently tracked\r
43      * group of diagram items and clean the diagram scene graph up by\r
44      * removing/disabling all scene graph contributions produced by this style.\r
45      * Deactivating an inactive style does nothing.\r
46      * \r
47      * @param backend\r
48      * @param runtimeDiagram\r
49      * @param configuration\r
50      * @param group\r
51      * @param observer\r
52      */\r
53     void deactivate(Resource runtimeDiagram, Resource entry, Group group, EvaluationContext observer);\r
54 \r
55     /**\r
56      * Perform complete re-application of this style on the current set of\r
57      * observed diagram items.\r
58      * \r
59      * <p>\r
60      * Must always be invoked from the canvas context thread.\r
61      * \r
62      * @param context the canvas context in which the style is to be applied\r
63      * @param diagram\r
64      * @param group\r
65      * @param observer profile system observer for this canvas context\r
66      */\r
67     void apply(Resource entry, Group group, EvaluationContext observer);\r
68 \r
69 }\r