--- /dev/null
+// TreeNode.java\r
+// $Id: TreeNode.java,v 1.1 2010/06/15 12:20:36 smhuang Exp $\r
+// Author: Jean-Michel.Leon@sophia.inria.fr\r
+// (c) COPYRIGHT MIT and INRIA, 1997.\r
+// Please first read the full copyright statement in file COPYRIGHT.html\r
+\r
+package org.w3c.tools.widgets;\r
+\r
+import java.awt.Image;\r
+\r
+/**\r
+ * The representation of a node of a TreeBrowser.\r
+ *\r
+ * A TreeNode is used internally by the TreeBrowser to store informations\r
+ * related to a node.\r
+ *\r
+ * It is also given as parameter in the notifications the TreeBrowser send to\r
+ * handlers.\r
+ *\r
+ * @see org.w3c.tools.widgets.TreeBrowser\r
+ * @see org.w3c.tools.widgets.NodeHandler\r
+ */\r
+public class TreeNode {\r
+\r
+ public static final int NOCHILD = -1;\r
+\r
+ Object item;\r
+ String label ;\r
+ Image icon;\r
+ NodeHandler handler = null ;\r
+ int level;\r
+ int children = NOCHILD;\r
+ boolean selected = false;\r
+\r
+ \r
+ TreeNode(Object item, String label,\r
+ NodeHandler handler, Image icon, int level) {\r
+ this.item = item;\r
+ this.label = label;\r
+ this.icon = icon;\r
+ this.level = level;\r
+ this.handler = handler;\r
+ }\r
+\r
+ \r
+ /**\r
+ * Gets the item.\r
+ */ \r
+ public Object getItem() {\r
+ return item;\r
+ }\r
+\r
+ /**\r
+ * Gets the label.\r
+ *\r
+ * @see #setLabel\r
+ */ \r
+ public String getLabel() {\r
+ return label;\r
+ }\r
+\r
+ /**\r
+ * Gets the current Icon.\r
+ *\r
+ * @see #setIcon\r
+ */\r
+ public Image getIcon() {\r
+ return icon;\r
+ }\r
+\r
+ /**\r
+ * Gets the handler.\r
+ */\r
+ public NodeHandler getHandler() {\r
+ return handler;\r
+ }\r
+\r
+ /**\r
+ * Gets the children\r
+ */\r
+ public int getChildren() {\r
+ return children;\r
+ }\r
+\r
+ /**\r
+ * Checks if the Node is selected.\r
+ */\r
+ public boolean isSelected() {\r
+ return selected;\r
+ }\r
+\r
+ /**\r
+ * Sets the icon.\r
+ *\r
+ * @see #getIcon\r
+ */\r
+ public void setIcon(Image i) {\r
+ icon = i;\r
+ }\r
+\r
+ /**\r
+ * Sets the label.\r
+ *\r
+ * @see #getLabel\r
+ */\r
+ public void setLabel(String l) {\r
+ label = l;\r
+ }\r
+\r
+ /**\r
+ * Sets the children\r
+ *\r
+ * @see #getChildren\r
+ */\r
+ public void setChildren(int children) {\r
+ this.children = children;\r
+ }\r
+}\r