X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Felement%2Fhandler%2FSceneGraph.java;fp=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Felement%2Fhandler%2FSceneGraph.java;h=8bf97ab57f5ea9ad0afb0d8a22086e4064d6bdd2;hp=d63aefdbd5fb52a02eb9b366ebc5b99df715f245;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/SceneGraph.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/SceneGraph.java index d63aefdbd..8bf97ab57 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/SceneGraph.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/SceneGraph.java @@ -1,71 +1,71 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.g2d.element.handler; - -import org.simantics.g2d.diagram.participant.ElementPainter; -import org.simantics.g2d.element.IElement; -import org.simantics.g2d.element.SceneGraphNodeKey; -import org.simantics.scenegraph.g2d.G2DNode; -import org.simantics.scenegraph.g2d.G2DParentNode; - -/** - * Scene graph node update handler of an element. - * - *

- * This handler is responsible for making sure that the scene graph is in sync - * with the element's current state. - * - *

- * An element may have multiple scene graph handlers. Painting order of the - * scene graph nodes is defined by the z-indexes given to the nodes created by - * each {@link SceneGraph} handler. - * - * @author J-P Laine - * - * @see {@link G2DNode} for scene graph - * @see ElementPainter - */ -public interface SceneGraph extends ElementHandler { - - /** - * Updates the renderable representation of the specified element, i.e. its - * scene graph parts to match the current state of the element. - * - *

- * This method will be called whenever the g2d framework decides that an - * element is dirty. This means that implementations must be prepared to - * have this method be called multiple times. - * - *

- * Generally implementations should create a scene graph node or nodes only - * on the first invocation, store that in the element with a - * {@link SceneGraphNodeKey} and on each call initialize the created - * node/nodes with the values stored in the element. - * - * @param e element to update into the scene graph - * @param parent scene graph parent node for this element - * - * TODO: the method is badly named since it can be invoked multiple - * times. initOrUpdate would be more suitable but that just sounds - * bad and the whole thing feels like bad design anyway. - */ - void init(final IElement e, final G2DParentNode parent); - - /** - * Remove any scene graph node references from the specified element and - * from the scene graph. - * - * @param e the element whose scene graph references to clean up - */ - void cleanup(final IElement e); - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.g2d.element.handler; + +import org.simantics.g2d.diagram.participant.ElementPainter; +import org.simantics.g2d.element.IElement; +import org.simantics.g2d.element.SceneGraphNodeKey; +import org.simantics.scenegraph.g2d.G2DNode; +import org.simantics.scenegraph.g2d.G2DParentNode; + +/** + * Scene graph node update handler of an element. + * + *

+ * This handler is responsible for making sure that the scene graph is in sync + * with the element's current state. + * + *

+ * An element may have multiple scene graph handlers. Painting order of the + * scene graph nodes is defined by the z-indexes given to the nodes created by + * each {@link SceneGraph} handler. + * + * @author J-P Laine + * + * @see {@link G2DNode} for scene graph + * @see ElementPainter + */ +public interface SceneGraph extends ElementHandler { + + /** + * Updates the renderable representation of the specified element, i.e. its + * scene graph parts to match the current state of the element. + * + *

+ * This method will be called whenever the g2d framework decides that an + * element is dirty. This means that implementations must be prepared to + * have this method be called multiple times. + * + *

+ * Generally implementations should create a scene graph node or nodes only + * on the first invocation, store that in the element with a + * {@link SceneGraphNodeKey} and on each call initialize the created + * node/nodes with the values stored in the element. + * + * @param e element to update into the scene graph + * @param parent scene graph parent node for this element + * + * TODO: the method is badly named since it can be invoked multiple + * times. initOrUpdate would be more suitable but that just sounds + * bad and the whole thing feels like bad design anyway. + */ + void init(final IElement e, final G2DParentNode parent); + + /** + * Remove any scene graph node references from the specified element and + * from the scene graph. + * + * @param e the element whose scene graph references to clean up + */ + void cleanup(final IElement e); + +}