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;
16 import org.simantics.db.exception.DatabaseException;
19 * This interface is not intended to be implemented directly. Extend
20 * {@link StyleBase} instead.
23 * @author Antti Villberg
25 public interface Style {
28 * Activates this style. Intended to start tracking the diagram items
29 * contained by the specified group and to request style applications
30 * whenever necessary through the specified profile observer. If a style
31 * instance is already active, re-activation should not do anything. A style
32 * can be re-activated after being deactivated.
35 * @param runtimeDiagram
36 * @param configuration
40 void activate(RequestProcessor backend, Resource runtimeDiagram, Resource entry, Group group, EvaluationContext observer) throws DatabaseException;
43 * Deactivates this style. Intended to stop tracking the currently tracked
44 * group of diagram items and clean the diagram scene graph up by
45 * removing/disabling all scene graph contributions produced by this style.
46 * Deactivating an inactive style does nothing.
49 * @param runtimeDiagram
50 * @param configuration
54 void deactivate(Resource runtimeDiagram, Resource entry, Group group, EvaluationContext observer);
57 * Perform complete re-application of this style on the current set of
58 * observed diagram items.
61 * Must always be invoked from the canvas context thread.
63 * @param context the canvas context in which the style is to be applied
66 * @param observer profile system observer for this canvas context
68 void apply(Resource entry, Group group, EvaluationContext observer);