1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 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.RequestProcessor;
15 import org.simantics.db.Resource;
18 * This interface is not intended to be implemented directly. Extend
19 * {@link StyleBase} instead.
22 * @author Antti Villberg
24 public interface Style {
27 * Activates this style. Intended to start tracking the diagram items
28 * contained by the specified group and to request style applications
29 * whenever necessary through the specified profile observer. If a style
30 * instance is already active, re-activation should not do anything. A style
31 * can be re-activated after being deactivated.
34 * @param runtimeDiagram
35 * @param configuration
39 void activate(RequestProcessor backend, Resource runtimeDiagram, Resource entry, Group group, EvaluationContext observer);
42 * Deactivates this style. Intended to stop tracking the currently tracked
43 * group of diagram items and clean the diagram scene graph up by
44 * removing/disabling all scene graph contributions produced by this style.
45 * Deactivating an inactive style does nothing.
48 * @param runtimeDiagram
49 * @param configuration
53 void deactivate(Resource runtimeDiagram, Resource entry, Group group, EvaluationContext observer);
56 * Perform complete re-application of this style on the current set of
57 * observed diagram items.
60 * Must always be invoked from the canvas context thread.
62 * @param context the canvas context in which the style is to be applied
65 * @param observer profile system observer for this canvas context
67 void apply(Resource entry, Group group, EvaluationContext observer);