]> gerrit.simantics Code Review - simantics/3d.git/blob - org.simantics.g3d/src/org/simantics/g3d/scenegraph/NodeMap.java
Use generics type variable for mapping db object.
[simantics/3d.git] / org.simantics.g3d / src / org / simantics / g3d / scenegraph / NodeMap.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;
13
14 import java.util.Collection;
15
16 import org.simantics.g3d.scenegraph.base.INode;
17 import org.simantics.g3d.scenegraph.base.NodeListener;
18 import org.simantics.g3d.scenegraph.base.ParentNode;
19 import org.simantics.objmap.graph.IMapping;
20
21 public interface NodeMap<DBObject,T,E extends INode> {
22
23         public Collection<T> getRenderObjects(E node);
24         
25         public void updateRenderObjectsFor(E node);
26         
27         public E getNode(T t);
28         
29         public ParentNode<E> getRootNode();
30         
31         /**
32          * Commit changes to the database.
33          */
34         public void commit(String message);
35         
36         
37         /**
38          * Deletes (Disposes) the map. 
39          */
40         public void delete();
41         
42         
43         /**
44          * Track changes that are going to be committed into the database.
45          * 
46          * Disabling change tracking causes commit() to do nothing. 
47          * @param enabled
48          */
49         public void setChangeTracking(boolean enabled);
50         public boolean  isChangeTracking();
51         
52         
53         /**
54          * Add listener for all scene-graph events.
55          * @param listener
56          */
57         public void addListener(NodeListener listener);
58         
59         public void removeListener(NodeListener listener);
60         
61         public IMapping<DBObject, E> getMapping();
62 }