]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.g3d/src/org/simantics/g3d/scenegraph/NodeMap.java
Adding exact INode type as generic parameter to NodeMap interface
[simantics/3d.git] / org.simantics.g3d / src / org / simantics / g3d / scenegraph / NodeMap.java
index 7e0f31e6439c02112d4ce45ba0b350eab263fb0a..6324d90e9f8be9b85f50c02af69286301accc16f 100644 (file)
@@ -1,59 +1,62 @@
-/*******************************************************************************\r
- * Copyright (c) 2012, 2013 Association for Decentralized Information Management in\r
- * Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- *     VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.g3d.scenegraph;\r
-\r
-import java.util.Collection;\r
-\r
-import org.simantics.g3d.scenegraph.base.INode;\r
-import org.simantics.g3d.scenegraph.base.NodeListener;\r
-import org.simantics.g3d.scenegraph.base.ParentNode;\r
-\r
-public interface NodeMap<T> {\r
-\r
-       public Collection<T> getRenderObjects(INode node);\r
-       \r
-       public void updateRenderObjectsFor(INode node);\r
-       \r
-       public INode getNode(T t);\r
-       \r
-       public ParentNode<IG3DNode> getRootNode();\r
-       \r
-       /**\r
-        * Commit changes to the database.\r
-        */\r
-       public void commit();\r
-       \r
-       \r
-       /**\r
-        * Deletes (Disposes) the map. \r
-        */\r
-       public void delete();\r
-       \r
-       \r
-       /**\r
-        * Track changes that are going to be committed into the database.\r
-        * \r
-        * Disabling change tracking causes commit() to do nothing. \r
-        * @param enabled\r
-        */\r
-       public void setChangeTracking(boolean enabled);\r
-       public boolean  isChangeTracking();\r
-       \r
-       \r
-       /**\r
-        * Add listener for all scene-graph events.\r
-        * @param listener\r
-        */\r
-       public void addListener(NodeListener listener);\r
-       \r
-       public void removeListener(NodeListener listener);\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 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.g3d.scenegraph;
+
+import java.util.Collection;
+
+import org.simantics.g3d.scenegraph.base.INode;
+import org.simantics.g3d.scenegraph.base.NodeListener;
+import org.simantics.g3d.scenegraph.base.ParentNode;
+import org.simantics.objmap.graph.IMapping;
+
+public interface NodeMap<T,E extends INode> {
+
+       public Collection<T> getRenderObjects(E node);
+       
+       public void updateRenderObjectsFor(E node);
+       
+       public E getNode(T t);
+       
+       public ParentNode<E> getRootNode();
+       
+       /**
+        * Commit changes to the database.
+        */
+       public void commit();
+       
+       
+       /**
+        * Deletes (Disposes) the map. 
+        */
+       public void delete();
+       
+       
+       /**
+        * Track changes that are going to be committed into the database.
+        * 
+        * Disabling change tracking causes commit() to do nothing. 
+        * @param enabled
+        */
+       public void setChangeTracking(boolean enabled);
+       public boolean  isChangeTracking();
+       
+       
+       /**
+        * Add listener for all scene-graph events.
+        * @param listener
+        */
+       public void addListener(NodeListener listener);
+       
+       public void removeListener(NodeListener listener);
+       
+       public IMapping<Object, E> getMapping();
+}