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
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.RequestProcessor;
\r
15 import org.simantics.db.Resource;
\r
18 * This interface is not intended to be implemented directly. Extend
\r
19 * {@link StyleBase} instead.
\r
22 * @author Antti Villberg
\r
24 public interface Style {
\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
34 * @param runtimeDiagram
\r
35 * @param configuration
\r
39 void activate(RequestProcessor backend, Resource runtimeDiagram, Resource entry, Group group, EvaluationContext observer);
\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
48 * @param runtimeDiagram
\r
49 * @param configuration
\r
53 void deactivate(Resource runtimeDiagram, Resource entry, Group group, EvaluationContext observer);
\r
56 * Perform complete re-application of this style on the current set of
\r
57 * observed diagram items.
\r
60 * Must always be invoked from the canvas context thread.
\r
62 * @param context the canvas context in which the style is to be applied
\r
65 * @param observer profile system observer for this canvas context
\r
67 void apply(Resource entry, Group group, EvaluationContext observer);
\r