]> gerrit.simantics Code Review - simantics/3d.git/blob - org.simantics.g3d/src/org/simantics/g3d/scenegraph/base/INode.java
Further refactoring of SCL interfaces
[simantics/3d.git] / org.simantics.g3d / src / org / simantics / g3d / scenegraph / base / INode.java
1 /*******************************************************************************
2  * Copyright (c) 2012, 2013 Association for Decentralized Information Management in
3  * Industry THTH ry.
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
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.g3d.scenegraph.base;
13
14 import java.util.List;
15
16
17
18
19
20 public interface INode {
21         
22         /**
23      * 
24      * @return unique node identifier
25      */
26    // public Long getId();
27
28          /**
29      * @return root node of the scene graph or <code>null</code> if this node is
30      *         not part of a properly rooted scene graph hierarchy
31      */
32     public ParentNode<?> getRootNode();
33
34     /**
35      * @return Parent node reference or <code>null</code> if not set
36      */
37     public ParentNode<?> getParent();
38     
39     public String getParentRel();
40     /**
41      * Set parent node. This method is for scene graph internal use only and
42      * should not be called outside the scene graph structure. This method
43      * simply sets the parent node parent field, and does not affect on parent
44      * node (i.e., should be called only from parent node).
45      */
46     public void setParent(ParentNode<?> parent, String name);
47
48     /**
49      * Perform cleanup for this node and for the child nodes. Any resources
50      * (including child nodes) related to this node are unusable after this
51      * operation. This method is for scene graph internal use only, thus should
52      * not be called outside the scene graph structure.
53      */
54     public void cleanup();
55     /**
56      * Remove this node and its children from the scene graph.
57      */
58     public void remove();
59     
60     public void deattach();
61
62     
63     public void addListener(NodeListener listener);
64         public void removeListener(NodeListener listener);
65         
66         public List<NodeListener> getListeners();
67
68 }