-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in 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
+/*******************************************************************************
+ * 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.scenegraph;
import java.io.Serializable;
import java.lang.annotation.Target;
/**
- * @author J-P Laine\r
- * \r
- * @see Node\r
- * @see ParentNode\r
+ * @author J-P Laine
+ *
+ * @see Node
+ * @see ParentNode
*/
public interface INode extends Serializable {
public static enum Location { LOCAL, REMOTE };
- /**\r
- * Tell the MethodInterceptor to synchronize the given fields after the\r
- * method call.\r
- * \r
- * @author J-P Laine\r
+ /**
+ * Tell the MethodInterceptor to synchronize the given fields after the
+ * method call.
+ *
+ * @author J-P Laine
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
String[] value(); // Field name(s)
}
- /**\r
- * Tell the MethodInterceptor to remotely call this method if we are on the\r
- * client side. Notice that the method type must be void, thus it cannot\r
- * return value.\r
- * \r
- * @author J-P Laine\r
+ /**
+ * Tell the MethodInterceptor to remotely call this method if we are on the
+ * client side. Notice that the method type must be void, thus it cannot
+ * return value.
+ *
+ * @author J-P Laine
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ServerSide {
}
- /**\r
- * Tell the MethodInterceptor to remotely call this method if we are on the\r
- * server side. Notice that the method type must be void, thus it cannot\r
- * return value.\r
- * \r
- * @author J-P Laine\r
+ /**
+ * Tell the MethodInterceptor to remotely call this method if we are on the
+ * server side. Notice that the method type must be void, thus it cannot
+ * return value.
+ *
+ * @author J-P Laine
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ClientSide {
- }\r
-\r
- /**\r
- * Tag method as setter for a property identified by string. Basically used\r
- * by the automatic graph to node property synchronizer.\r
- * \r
- * @author J-P Laine\r
- */\r
- @Retention(RetentionPolicy.RUNTIME)\r
- @Target(ElementType.METHOD)\r
- public @interface PropertySetter {\r
- String value(); // Property name\r
- }\r
-\r
- /**\r
- * \r
- * @return unique node identifier\r
+ }
+
+ /**
+ * Tag method as setter for a property identified by string. Basically used
+ * by the automatic graph to node property synchronizer.
+ *
+ * @author J-P Laine
+ */
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(ElementType.METHOD)
+ public @interface PropertySetter {
+ String value(); // Property name
+ }
+
+ /**
+ *
+ * @return unique node identifier
*/
- public Long getId();
-\r
- /**\r
- * @return root node of the scene graph or <code>null</code> if this node is\r
- * not part of a properly rooted scene graph hierarchy\r
- */\r
- public ParentNode<?> getRootNode();\r
-\r
- /**\r
- * @return Parent node reference or <code>null</code> if not set\r
+ public long getId();
+
+ /**
+ * @return root node of the scene graph or <code>null</code> if this node is
+ * not part of a properly rooted scene graph hierarchy
+ */
+ public ParentNode<?> getRootNode();
+
+ /**
+ * @return Parent node reference or <code>null</code> if not set
*/
public ParentNode<?> getParent();
-\r
- /**\r
- * Set parent node. This method is for scene graph internal use only and\r
- * should not be called outside the scene graph structure. This method\r
- * simply sets the parent node parent field, and does not affect on parent\r
- * node (i.e., should be called only from parent node).\r
+
+ /**
+ * Set parent node. This method is for scene graph internal use only and
+ * should not be called outside the scene graph structure. This method
+ * simply sets the parent node parent field, and does not affect on parent
+ * node (i.e., should be called only from parent node).
*/
public void setParent(ParentNode<?> parent);
-\r
- /**\r
- * Initialize node. This is called immediately after the node is added to\r
- * the scene graph tree through any of the node addition methods in\r
- * {@link ParentNode}.\r
- * \r
- * @see ParentNode#addNode(Class)\r
- * @see ParentNode#addNode(String, Class)\r
- * @see ParentNode#getOrCreateNode(String, Class)\r
+
+ /**
+ * Initialize node. This is called immediately after the node is added to
+ * the scene graph tree through any of the node addition methods in
+ * {@link ParentNode}.
+ *
+ * @see ParentNode#addNode(Class)
+ * @see ParentNode#addNode(String, Class)
+ * @see ParentNode#getOrCreateNode(String, Class)
*/
public void init();
- public void attach();\r
- \r
- /**\r
- * Perform cleanup for this node and for the child nodes. Any resources\r
- * (including child nodes) related to this node are unusable after this\r
- * operation. This method is for scene graph internal use only, thus should\r
- * not be called outside the scene graph structure.\r
+
+ /**
+ * Perform cleanup for this node and for the child nodes. Any resources
+ * (including child nodes) related to this node are unusable after this
+ * operation. This method is for scene graph internal use only, thus should
+ * not be called outside the scene graph structure.
*/
public void cleanup();
-\r
- /**\r
- * Remove this node and its children from the scene graph.\r
+
+ /**
+ * Remove this node and its children from the scene graph.
*/
public void remove();
-\r
- /**\r
- * Delete this node, and move its children under its parent.\r
- * \r
- * <p>\r
- * Note: this method has no effect if the node has no parent.\r
- */\r
- public void delete();\r
-\r
- /**\r
- * Append parent node for this node. The new node will be placed between\r
- * parent node and this node. In order to call this method the node must be\r
- * a child of another node, hence parent must be not null.\r
- */\r
- public <TC> TC appendParent(String id, Class<TC> nc);\r
+
+ /**
+ * Delete this node, and move its children under its parent.
+ *
+ * <p>
+ * Note: this method has no effect if the node has no parent.
+ */
+ public void delete();
+
+ /**
+ * Append parent node for this node. The new node will be placed between
+ * parent node and this node. In order to call this method the node must be
+ * a child of another node, hence parent must be not null.
+ */
+ public <TC> TC appendParent(String id, Class<TC> nc);
@Override
public String toString();
- /**\r
- * @return simple name for this node class\r
- */\r
- public String getSimpleClassName();\r
-\r
+ /**
+ * @return simple name for this node class
+ */
+ public String getSimpleClassName();
+
}