summaryrefslogtreecommitdiffstats
path: root/libjava/javax/swing/tree
diff options
context:
space:
mode:
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-09 04:26:17 +0000
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-09 04:26:17 +0000
commit71946bc3b406beb3d1fb9b447204e4236d645c43 (patch)
treecdf9958b411887bead2263ea8ef0bdfc8eae6319 /libjava/javax/swing/tree
parent0fc014c9ce8232f14be66144bf5a4c08a3e5ffe7 (diff)
downloadppe42-gcc-71946bc3b406beb3d1fb9b447204e4236d645c43.tar.gz
ppe42-gcc-71946bc3b406beb3d1fb9b447204e4236d645c43.zip
AWT/Swing merge from GNU Classpath.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56147 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/javax/swing/tree')
-rw-r--r--libjava/javax/swing/tree/AbstractLayoutCache.java371
-rw-r--r--libjava/javax/swing/tree/DefaultMutableTreeNode.java1017
-rw-r--r--libjava/javax/swing/tree/DefaultTreeCellEditor.java489
-rw-r--r--libjava/javax/swing/tree/DefaultTreeCellRenderer.java450
-rw-r--r--libjava/javax/swing/tree/DefaultTreeModel.java371
-rw-r--r--libjava/javax/swing/tree/DefaultTreeSelectionModel.java451
-rw-r--r--libjava/javax/swing/tree/ExpandVetoException.java83
-rw-r--r--libjava/javax/swing/tree/FixedHeightLayoutCache.java235
-rw-r--r--libjava/javax/swing/tree/MutableTreeNode.java83
-rw-r--r--libjava/javax/swing/tree/RowMapper.java54
-rw-r--r--libjava/javax/swing/tree/TreeCellEditor.java65
-rw-r--r--libjava/javax/swing/tree/TreeCellRenderer.java66
-rw-r--r--libjava/javax/swing/tree/TreeModel.java109
-rw-r--r--libjava/javax/swing/tree/TreeNode.java99
-rw-r--r--libjava/javax/swing/tree/TreePath.java295
-rw-r--r--libjava/javax/swing/tree/TreeSelectionModel.java83
-rw-r--r--libjava/javax/swing/tree/VariableHeightLayoutCache.java260
17 files changed, 4581 insertions, 0 deletions
diff --git a/libjava/javax/swing/tree/AbstractLayoutCache.java b/libjava/javax/swing/tree/AbstractLayoutCache.java
new file mode 100644
index 00000000000..5be988ca604
--- /dev/null
+++ b/libjava/javax/swing/tree/AbstractLayoutCache.java
@@ -0,0 +1,371 @@
+/* AbstractLayoutCache.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+// Imports
+import java.awt.*;
+import java.util.*;
+import javax.swing.event.*;
+
+/**
+ * AbstractLayoutCache
+ * @author Andrew Selkirk
+ */
+public abstract class AbstractLayoutCache implements RowMapper {
+
+ //-------------------------------------------------------------
+ // Classes ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * NodeDimensions
+ */
+ public abstract static class NodeDimensions {
+
+ //-------------------------------------------------------------
+ // Initialization ---------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * Constructor NodeDimensions
+ */
+ public NodeDimensions() {
+ // TODO
+ } // NodeDimensions()
+
+
+ //-------------------------------------------------------------
+ // Methods ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * getNodeDimensions
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ * @param value3 TODO
+ * @param value4 TODO
+ * @returns Rectangle
+ */
+ public abstract Rectangle getNodeDimensions(Object value0, int value1, int value2, boolean value3, Rectangle value4);
+
+
+ } // NodeDimensions
+
+
+ //-------------------------------------------------------------
+ // Variables --------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * nodeDimensions
+ */
+ protected NodeDimensions nodeDimensions;
+
+ /**
+ * treeModel
+ */
+ protected TreeModel treeModel;
+
+ /**
+ * treeSelectionModel
+ */
+ protected TreeSelectionModel treeSelectionModel;
+
+ /**
+ * rootVisible
+ */
+ protected boolean rootVisible;
+
+ /**
+ * rowHeight
+ */
+ protected int rowHeight;
+
+
+ //-------------------------------------------------------------
+ // Initialization ---------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * Constructor AbstractLayoutCache
+ */
+ public AbstractLayoutCache() {
+ // TODO
+ } // AbstractLayoutCache()
+
+
+ //-------------------------------------------------------------
+ // Methods ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * setNodeDimensions
+ * @param value0 TODO
+ */
+ public void setNodeDimensions(NodeDimensions value0) {
+ // TODO
+ } // setNodeDimensions()
+
+ /**
+ * getNodeDimensions
+ * @returns NodeDimensions
+ */
+ public NodeDimensions getNodeDimensions() {
+ return null; // TODO
+ } // getNodeDimensions()
+
+ /**
+ * getNodeDimensions
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ * @param value3 TODO
+ * @param value4 TODO
+ * @returns Rectangle
+ */
+ protected Rectangle getNodeDimensions(Object value0, int value1, int value2, boolean value3, Rectangle value4) {
+ return null; // TODO
+ } // getNodeDimensions()
+
+ /**
+ * setModel
+ * @param value0 TODO
+ */
+ public void setModel(TreeModel value0) {
+ // TODO
+ } // setModel()
+
+ /**
+ * getModel
+ * @returns TreeModel
+ */
+ public TreeModel getModel() {
+ return null; // TODO
+ } // getModel()
+
+ /**
+ * setRootVisible
+ * @param value0 TODO
+ */
+ public void setRootVisible(boolean value0) {
+ // TODO
+ } // setRootVisible()
+
+ /**
+ * isRootVisible
+ * @returns boolean
+ */
+ public boolean isRootVisible() {
+ return false; // TODO
+ } // isRootVisible()
+
+ /**
+ * setRowHeight
+ * @param value0 TODO
+ */
+ public void setRowHeight(int value0) {
+ // TODO
+ } // setRowHeight()
+
+ /**
+ * getRowHeight
+ * @returns int
+ */
+ public int getRowHeight() {
+ return 0; // TODO
+ } // getRowHeight()
+
+ /**
+ * setSelectionModel
+ * @param value0 TODO
+ */
+ public void setSelectionModel(TreeSelectionModel value0) {
+ // TODO
+ } // setSelectionModel()
+
+ /**
+ * getSelectionModel
+ * @returns TreeSelectionModel
+ */
+ public TreeSelectionModel getSelectionModel() {
+ return null; // TODO
+ } // getSelectionModel()
+
+ /**
+ * getPreferredHeight
+ * @returns int
+ */
+ public int getPreferredHeight() {
+ return 0; // TODO
+ } // getPreferredHeight()
+
+ /**
+ * getPreferredWidth
+ * @param value0 TODO
+ * @returns int
+ */
+ public int getPreferredWidth(Rectangle value0) {
+ return 0; // TODO
+ } // getPreferredWidth()
+
+ /**
+ * isExpanded
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public abstract boolean isExpanded(TreePath value0);
+
+ /**
+ * getBounds
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns Rectangle
+ */
+ public abstract Rectangle getBounds(TreePath value0, Rectangle value1);
+
+ /**
+ * getPathForRow
+ * @param value0 TODO
+ * @returns TreePath
+ */
+ public abstract TreePath getPathForRow(int value0);
+
+ /**
+ * getRowForPath
+ * @param value0 TODO
+ * @returns int
+ */
+ public abstract int getRowForPath(TreePath value0);
+
+ /**
+ * getPathClosestTo
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns TreePath
+ */
+ public abstract TreePath getPathClosestTo(int value0, int value1);
+
+ /**
+ * getVisiblePathsFrom
+ * @param value0 TODO
+ * @returns Enumeration
+ */
+ public abstract Enumeration getVisiblePathsFrom(TreePath value0);
+
+ /**
+ * getVisibleChildCount
+ * @param value0 TODO
+ * @returns int
+ */
+ public abstract int getVisibleChildCount(TreePath value0);
+
+ /**
+ * setExpandedState
+ * @param value0 TODO
+ * @param value1 TODO
+ */
+ public abstract void setExpandedState(TreePath value0, boolean value1);
+
+ /**
+ * getExpandedState
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public abstract boolean getExpandedState(TreePath value0);
+
+ /**
+ * getRowCount
+ * @returns int
+ */
+ public abstract int getRowCount();
+
+ /**
+ * invalidateSizes
+ */
+ public abstract void invalidateSizes();
+
+ /**
+ * invalidatePathBounds
+ * @param value0 TODO
+ */
+ public abstract void invalidatePathBounds(TreePath value0);
+
+ /**
+ * treeNodesChanged
+ * @param value0 TODO
+ */
+ public abstract void treeNodesChanged(TreeModelEvent value0);
+
+ /**
+ * treeNodesInserted
+ * @param value0 TODO
+ */
+ public abstract void treeNodesInserted(TreeModelEvent value0);
+
+ /**
+ * treeNodesRemoved
+ * @param value0 TODO
+ */
+ public abstract void treeNodesRemoved(TreeModelEvent value0);
+
+ /**
+ * treeStructureChanged
+ * @param value0 TODO
+ */
+ public abstract void treeStructureChanged(TreeModelEvent value0);
+
+ /**
+ * getRowsForPaths
+ * @param value0 TODO
+ * @returns int[]
+ */
+ public int[] getRowsForPaths(TreePath[] value0) {
+ return null; // TODO
+ } // getRowsForPaths()
+
+ /**
+ * isFixedRowHeight
+ * @returns boolean
+ */
+ protected boolean isFixedRowHeight() {
+ return false; // TODO
+ } // isFixedRowHeight()
+
+
+} // AbstractLayoutCache
diff --git a/libjava/javax/swing/tree/DefaultMutableTreeNode.java b/libjava/javax/swing/tree/DefaultMutableTreeNode.java
new file mode 100644
index 00000000000..288b0edc1c9
--- /dev/null
+++ b/libjava/javax/swing/tree/DefaultMutableTreeNode.java
@@ -0,0 +1,1017 @@
+/* DefaultMutableTreeNode.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+// Imports
+import java.io.*;
+import java.util.*;
+
+/**
+ * DefaultMutableTreeNode
+ * @author Andrew Selkirk
+ */
+public class DefaultMutableTreeNode implements Cloneable, MutableTreeNode, Serializable {
+
+ //-------------------------------------------------------------
+ // Variables --------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * EMPTY_ENUMERATION
+ */
+ public static final Enumeration EMPTY_ENUMERATION = null; // TODO
+
+ /**
+ * parent
+ */
+ protected MutableTreeNode parent = null;
+
+ /**
+ * children
+ */
+ protected Vector children = new Vector();
+
+ /**
+ * userObject
+ */
+ protected transient Object userObject = "";
+
+ /**
+ * allowsChildren
+ */
+ protected boolean allowsChildren = true;
+
+
+ //-------------------------------------------------------------
+ // Initialization ---------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * Constructor DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode() {
+ // TODO
+ } // DefaultMutableTreeNode()
+
+ /**
+ * Constructor DefaultMutableTreeNode
+ * @param value0 TODO
+ */
+ public DefaultMutableTreeNode(Object userObject) {
+ this.userObject = userObject;
+ } // DefaultMutableTreeNode()
+
+ /**
+ * Constructor DefaultMutableTreeNode
+ * @param value0 TODO
+ * @param value1 TODO
+ */
+ public DefaultMutableTreeNode(Object userObject, boolean allowsChildren) {
+ this.userObject = userObject;
+ this.allowsChildren = allowsChildren;
+ } // DefaultMutableTreeNode()
+
+
+ //-------------------------------------------------------------
+ // Methods ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * clone
+ * @returns Object
+ */
+ public Object clone() {
+ return null; // TODO
+ } // clone()
+
+ /**
+ * toString
+ * @returns String
+ */
+ public String toString() {
+ if (userObject == null) {
+ return null;
+ } // if
+ return userObject.toString();
+ } // toString()
+
+ /**
+ * add
+ * @param value0 TODO
+ */
+ public void add(MutableTreeNode child) {
+ children.add(child);
+ child.setParent(this);
+ } // add()
+
+ /**
+ * getParent
+ * @returns TreeNode
+ */
+ public TreeNode getParent() {
+ return parent;
+ } // getParent()
+
+ /**
+ * remove
+ * @param value0 TODO
+ */
+ public void remove(int index) {
+ children.remove(index);
+ } // remove()
+
+ /**
+ * remove
+ * @param value0 TODO
+ */
+ public void remove(MutableTreeNode node) {
+ children.remove(node);
+ } // remove()
+
+ /**
+ * writeObject
+ * @param value0 TODO
+ * @exception IOException TODO
+ */
+ private void writeObject(ObjectOutputStream value0) throws IOException {
+ // TODO
+ } // writeObject()
+
+ /**
+ * readObject
+ * @param value0 TODO
+ * @exception IOException TODO
+ * @exception ClassNotFoundException TODO
+ */
+ private void readObject(ObjectInputStream value0) throws IOException, ClassNotFoundException {
+ // TODO
+ } // readObject()
+
+ /**
+ * insert
+ * @param value0 TODO
+ * @param value1 TODO
+ */
+ public void insert(MutableTreeNode node, int index) {
+ children.insertElementAt(node, index);
+ } // insert()
+
+ /**
+ * getPath
+ * @returns TreeNode[]
+ */
+ public TreeNode[] getPath() {
+
+ // Variables
+ TreeNode[] path;
+ int size;
+ int index;
+ TreeNode current;
+
+ // Determine length of Path
+ size = getLevel() + 1;
+
+ // Create Path
+ path = new TreeNode[size];
+ current = this;
+ for (index = size - 1; index >= 0; index--) {
+ path[index] = current;
+ current = current.getParent();
+ } // for
+
+ // Return Path
+ return path;
+
+ } // getPath()
+
+ /**
+ * children
+ * @returns Enumeration
+ */
+ public Enumeration children() {
+ return children.elements();
+ } // children()
+
+ /**
+ * setParent
+ * @param value0 TODO
+ */
+ public void setParent(MutableTreeNode node) {
+ parent = node;
+ } // setParent()
+
+ /**
+ * getChildAt
+ * @param value0 TODO
+ * @returns TreeNode
+ */
+ public TreeNode getChildAt(int index) {
+ return (TreeNode) children.elementAt(index);
+ } // getChildAt()
+
+ /**
+ * getChildCount
+ * @returns int
+ */
+ public int getChildCount() {
+ return children.size();
+ } // getChildCount()
+
+ /**
+ * getIndex
+ * @param value0 TODO
+ * @returns int
+ */
+ public int getIndex(TreeNode node) {
+ return children.indexOf(node);
+ } // getIndex()
+
+ /**
+ * setAllowsChildren
+ * @param value0 TODO
+ */
+ public void setAllowsChildren(boolean allowsChildren) {
+ this.allowsChildren = allowsChildren;
+ } // setAllowsChildren()
+
+ /**
+ * getAllowsChildren
+ * @returns boolean
+ */
+ public boolean getAllowsChildren() {
+ return allowsChildren;
+ } // getAllowsChildren()
+
+ /**
+ * setUserObject
+ * @param value0 TODO
+ */
+ public void setUserObject(Object userObject) {
+ this.userObject = userObject;
+ } // setUserObject()
+
+ /**
+ * getUserObject
+ * @returns Object
+ */
+ public Object getUserObject() {
+ return userObject;
+ } // getUserObject()
+
+ /**
+ * removeFromParent
+ */
+ public void removeFromParent() {
+ parent = null;
+ // TODO
+ } // removeFromParent()
+
+ /**
+ * removeAllChildren
+ */
+ public void removeAllChildren() {
+ children.removeAllElements();
+ } // removeAllChildren()
+
+ /**
+ * isNodeAncestor
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean isNodeAncestor(TreeNode node) {
+
+ // Variables
+ TreeNode current;
+
+ // Sanity Check
+ if (node == null) {
+ return false;
+ } // if
+
+ // Search For Ancestor
+ current = this;
+ while (current != null && current != node) {
+ current = current.getParent();
+ } // while
+
+ // Check for Ancestor
+ if (current == node) {
+ return true;
+ } // if
+
+ // Otherwise, no
+ return false;
+
+ } // isNodeAncestor()
+
+ /**
+ * isNodeDescendant
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean isNodeDescendant(DefaultMutableTreeNode node) {
+
+ // Variables
+ TreeNode current;
+
+ // Sanity Check
+ if (node == null) {
+ return false;
+ } // if
+
+ // Search For Descendant
+ current = node;
+ while (current != null && current != this) {
+ current = current.getParent();
+ } // while
+
+ // Check for Descendant
+ if (current == this) {
+ return true;
+ } // if
+
+ // Otherwise, no
+ return false;
+
+ } // isNodeDescendant()
+
+ /**
+ * getSharedAncestor
+ * @param value0 TODO
+ * @returns TreeNode
+ */
+ public TreeNode getSharedAncestor(DefaultMutableTreeNode node) {
+
+ // Variables
+ ArrayList list;
+ TreeNode current;
+
+ // Get List of Path Elements for this node
+ current = this;
+ list = new ArrayList();
+ while (current != null) {
+ list.add(current);
+ current = current.getParent();
+ } // while
+
+ // Check if any path element of node are in list
+ current = node;
+ while (current != null) {
+ if (list.contains(current) == true) {
+ return current;
+ } // if
+ current = current.getParent();
+ } // while
+
+ // Unable to locate shared ancestor
+ return null;
+
+ } // getSharedAncestor()
+
+ /**
+ * isNodeRelated
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean isNodeRelated(DefaultMutableTreeNode node) {
+
+ // Sanity Check
+ if (node == null) {
+ return false;
+ } // if
+
+ // Check for the same root
+ if (node.getRoot() == getRoot()) {
+ return true;
+ } // if
+
+ // Nodes are not related
+ return false;
+
+ } // isNodeRelated()
+
+ /**
+ * getDepth
+ * @returns int
+ */
+ public int getDepth() {
+
+ // Variables
+ TreeNode node;
+ int depth;
+ int current;
+ int size;
+ Stack stack;
+ int index;
+
+ // Check for children
+ if (allowsChildren == false || children.size() == 0) {
+ return 0;
+ } // if
+
+ // Process Depths
+ stack = new Stack();
+ stack.push(new Integer(0));
+ node = getChildAt(0);
+//System.out.println(" * Descend: 0-0");
+ depth = 0;
+ current = 1;
+ while (stack.empty() == false) {
+
+ // Check if node has children
+ if (node.getChildCount() != 0) {
+ node = node.getChildAt(0);
+ stack.push(new Integer(0));
+ current++;
+// System.out.println(" * Descend: 0-" + current);
+
+ // Check for next sibling
+ } else {
+
+ // Check Depth
+ if (current > depth) {
+ depth = current;
+ } // if
+
+ do {
+
+ // Traverse to Parent
+ node = node.getParent();
+ size = node.getChildCount();
+ current--;
+ index = ((Integer) stack.pop()).intValue();
+// System.out.println(" * Ascend from: " + index + "-" + current);
+ index++;
+
+ } while (index >= size && node != this);
+
+ // Check for child
+ if (index < size) {
+ node = node.getChildAt(index);
+ stack.push(new Integer(index));
+ current++;
+// System.out.println(" * Descend: " + index + "-" + current);
+ } // if
+
+ } // if
+
+ } // while
+
+ return depth;
+
+ } // getDepth()
+
+ static Random random = new Random(System.currentTimeMillis());
+
+ public static void growTree(DefaultMutableTreeNode root) {
+
+ // Variables
+ int size;
+ int index;
+ DefaultMutableTreeNode node;
+ DefaultMutableTreeNode current;
+
+ current = root;
+ index = 0;
+// while (current != root) {
+ do {
+
+// if (random.nextInt(3) < 2) {
+ if (random.nextBoolean()) {
+ node = new DefaultMutableTreeNode(String.valueOf(index));
+ index++;
+ current.add(node);
+ current = node;
+ } else {
+ current = (DefaultMutableTreeNode) current.getParent();
+ } // if
+
+// } // while
+ } while (current != root && current != null);
+
+ System.out.println("Number of nodes: " + index);
+
+/*
+ // Calc # children
+ size = random.nextInt(4);
+
+ for (index = 0; index < size; index++) {
+
+ // Create Node
+ node = new DefaultMutableTreeNode(String.valueOf(index));
+ growTree(node);
+
+ // Add Node to root
+ root.add(node);
+
+ } // for
+*/
+ } // growTree()
+
+ public static void main(String[] argv) {
+/*
+ DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("node1");
+ DefaultMutableTreeNode node2 = new DefaultMutableTreeNode("node2");
+ DefaultMutableTreeNode node3 = new DefaultMutableTreeNode("node3");
+ DefaultMutableTreeNode node4 = new DefaultMutableTreeNode("node4");
+ DefaultMutableTreeNode node5 = new DefaultMutableTreeNode("node5");
+ DefaultMutableTreeNode node6 = new DefaultMutableTreeNode("node6");
+ DefaultMutableTreeNode node7 = new DefaultMutableTreeNode("node7");
+ DefaultMutableTreeNode node8 = new DefaultMutableTreeNode("node8");
+
+ node1.add(node2);
+ node1.add(node3);
+ node2.add(node4);
+ node2.add(node5);
+ node3.add(node6);
+ node3.add(node7);
+ node5.add(node8);
+
+ System.out.println("Depth (node1): " + node1.getDepth());
+ System.out.println("Depth (node2): " + node2.getDepth());
+ System.out.println("Depth (node3): " + node3.getDepth());
+*/
+
+ System.out.println("Create tree...");
+ DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
+ growTree(root);
+ System.out.println("Find depth...");
+ System.out.println("Depth (root): " + root.getDepth());
+
+ } // main
+
+ /**
+ * getLevel
+ * @returns int
+ */
+ public int getLevel() {
+
+ // Variables
+ TreeNode current;
+ int count;
+
+ // Lookup Parent
+ count = -1;
+ current = this;
+ do {
+ current = current.getParent();
+ count++;
+ } while (current != null);
+
+ return count;
+
+ } // getLevel()
+
+ /**
+ * getPathToRoot
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns TreeNode[]
+ */
+ protected TreeNode[] getPathToRoot(TreeNode value0, int value1) {
+ return null; // TODO
+ } // getPathToRoot()
+
+ /**
+ * getUserObjectPath
+ * @returns Object[]
+ */
+ public Object[] getUserObjectPath() {
+
+ // Variables
+ TreeNode[] path;
+ Object[] object;
+ int size;
+ int index;
+
+ // Get Path for Tree Nodes
+ path = getPath();
+
+ // Construct Object Path
+ object = new Object[path.length];
+ for (index = 0; index < path.length; index++) {
+ object[index] = ((DefaultMutableTreeNode) path[index]).getUserObject();
+ } // for
+
+ // Return Object Path
+ return object;
+
+ } // getUserObjectPath()
+
+ /**
+ * getRoot
+ * @returns TreeNode
+ */
+ public TreeNode getRoot() {
+
+ // Variables
+ TreeNode current;
+ TreeNode check;
+
+ // Lookup Parent
+ current = this;
+ check = current.getParent();
+ while (check != null) {
+ current = check;
+ check = current.getParent();
+ } // while
+
+ return current;
+
+ } // getRoot()
+
+ /**
+ * isRoot
+ * @returns boolean
+ */
+ public boolean isRoot() {
+ return (parent == null);
+ } // isRoot()
+
+ /**
+ * getNextNode
+ * @returns DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getNextNode() {
+ return null; // TODO
+ } // getNextNode()
+
+ /**
+ * getPreviousNode
+ * @returns DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getPreviousNode() {
+ return null; // TODO
+ } // getPreviousNode()
+
+ /**
+ * preorderEnumeration
+ * @returns Enumeration
+ */
+ public Enumeration preorderEnumeration() {
+ return null; // TODO
+ } // preorderEnumeration()
+
+ /**
+ * postorderEnumeration
+ * @returns Enumeration
+ */
+ public Enumeration postorderEnumeration() {
+ return null; // TODO
+ } // postorderEnumeration()
+
+ /**
+ * breadthFirstEnumeration
+ * @returns Enumeration
+ */
+ public Enumeration breadthFirstEnumeration() {
+ return null; // TODO
+ } // breadthFirstEnumeration()
+
+ /**
+ * depthFirstEnumeration
+ * @returns Enumeration
+ */
+ public Enumeration depthFirstEnumeration() {
+ return null; // TODO
+ } // depthFirstEnumeration()
+
+ /**
+ * pathFromAncestorEnumeration
+ * @param value0 TODO
+ * @returns Enumeration
+ */
+ public Enumeration pathFromAncestorEnumeration(TreeNode value0) {
+ return null; // TODO
+ } // pathFromAncestorEnumeration()
+
+ /**
+ * isNodeChild
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean isNodeChild(TreeNode node) {
+
+ // Variables
+ TreeNode current;
+ int index;
+
+ // Sanity Check
+ if (node == null) {
+ return false;
+ } // if
+
+ // Process Path
+ current = node;
+ while (current != null) {
+ if (current == this) {
+ return true;
+ } // if
+ current = current.getParent();
+ } // while
+
+ // Node not located in path, not child
+ return false;
+
+ } // isNodeChild()
+
+ /**
+ * getFirstChild
+ * @returns TreeNode
+ */
+ public TreeNode getFirstChild() {
+ return (TreeNode) children.firstElement();
+ } // getFirstChild()
+
+ /**
+ * getLastChild
+ * @returns TreeNode
+ */
+ public TreeNode getLastChild() {
+ return (TreeNode) children.lastElement();
+ } // getLastChild()
+
+ /**
+ * getChildAfter
+ * @param value0 TODO
+ * @returns TreeNode
+ */
+ public TreeNode getChildAfter(TreeNode node) {
+
+ // Variables
+ int index;
+
+ // Check node
+ if (node == null || node.getParent() != this) {
+ throw new IllegalArgumentException();
+ } // if
+
+ // Get index of child node
+ index = getIndex(node);
+
+ // Check for child after
+ index++;
+ if (index == getChildCount()) {
+ return null;
+ } // if
+
+ // Retrieve Child After
+ return getChildAt(index);
+
+ } // getChildAfter()
+
+ /**
+ * getChildBefore
+ * @param value0 TODO
+ * @returns TreeNode
+ */
+ public TreeNode getChildBefore(TreeNode node) {
+
+ // Variables
+ int index;
+
+ // Check node
+ if (node == null || node.getParent() != this) {
+ throw new IllegalArgumentException();
+ } // if
+
+ // Get index of child node
+ index = getIndex(node);
+
+ // Check for child before
+ index--;
+ if (index < 0) {
+ return null;
+ } // if
+
+ // Retrieve Child Before
+ return getChildAt(index);
+
+ } // getChildBefore()
+
+ /**
+ * isNodeSibling
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean isNodeSibling(TreeNode node) {
+
+ // Variables
+ int index;
+
+ // Check for null
+ if (node == null) {
+ return false;
+ } // if
+
+ // Check if nodes share a parent
+ if (node.getParent() == getParent() && getParent() != null) {
+ return true;
+ } // if
+
+ // Nodes are not siblings
+ return false;
+
+ } // isNodeSibling()
+
+ /**
+ * getSiblingCount
+ * @returns int
+ */
+ public int getSiblingCount() {
+
+ // Variables
+
+ // Check for no parent
+ if (parent == null) {
+ return 1;
+ } // if
+
+ // Calculate sibling count from parent's child count
+ return parent.getChildCount();
+
+ } // getSiblingCount()
+
+ /**
+ * getNextSibling
+ * @returns DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getNextSibling() {
+
+ // Variables
+ int index;
+ int size;
+
+ // Check for Parent
+ if (parent == null) {
+ return null;
+ } // if
+
+ // Get Index of this node
+ index = parent.getIndex(this);
+
+ // Check for Next Sibling
+ size = parent.getChildCount();
+ index++;
+ if (index == size) {
+ return null;
+ } // if
+
+ return (DefaultMutableTreeNode) parent.getChildAt(index);
+
+ } // getNextSibling()
+
+ /**
+ * getPreviousSibling
+ * @returns DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getPreviousSibling() {
+
+ // Variables
+ int index;
+
+ // Check for Parent
+ if (parent == null) {
+ return null;
+ } // if
+
+ // Get Index of this node
+ index = parent.getIndex(this);
+
+ // Check for Previous Sibling
+ index--;
+ if (index < 0) {
+ return null;
+ } // if
+
+ return (DefaultMutableTreeNode) parent.getChildAt(index);
+
+ } // getPreviousSibling()
+
+ /**
+ * isLeaf
+ * @returns boolean
+ */
+ public boolean isLeaf() {
+ return (children.size() == 0); // TODO: check allowsChildren??
+ } // isLeaf()
+
+ /**
+ * getFirstLeaf
+ * @returns DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getFirstLeaf() {
+
+ // Variables
+ TreeNode current;
+
+ current = this;
+ while (current.getChildCount() > 0) {
+ current = current.getChildAt(0);
+ } // while
+
+ return (DefaultMutableTreeNode) current;
+
+ } // getFirstLeaf()
+
+ /**
+ * getLastLeaf
+ * @returns DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getLastLeaf() {
+
+ // Variables
+ TreeNode current;
+ int size;
+
+ current = this;
+ size = current.getChildCount();
+ while (size > 0) {
+ current = current.getChildAt(size - 1);
+ size = current.getChildCount();
+ } // while
+
+ return (DefaultMutableTreeNode) current;
+
+ } // getLastLeaf()
+
+ /**
+ * getNextLeaf
+ * @returns DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getNextLeaf() {
+ return null; // TODO
+ } // getNextLeaf()
+
+ /**
+ * getPreviousLeaf
+ * @returns DefaultMutableTreeNode
+ */
+ public DefaultMutableTreeNode getPreviousLeaf() {
+ return null; // TODO
+ } // getPreviousLeaf()
+
+ /**
+ * getLeafCount
+ * @returns int
+ */
+ public int getLeafCount() {
+
+ // Variables
+ Enumeration enum;
+ int count;
+ TreeNode current;
+
+ // Get Enumeration of all descendants
+ enum = depthFirstEnumeration();
+
+ // Process Nodes
+ count = 0;
+ while (enum.hasMoreElements() == true) {
+ current = (TreeNode) enum.nextElement();
+ if (current.isLeaf() == true) {
+ count++;
+ } // if
+ } // if
+
+ return count;
+
+ } // getLeafCount()
+
+
+} // DefaultMutableTreeNode
diff --git a/libjava/javax/swing/tree/DefaultTreeCellEditor.java b/libjava/javax/swing/tree/DefaultTreeCellEditor.java
new file mode 100644
index 00000000000..732077b3adb
--- /dev/null
+++ b/libjava/javax/swing/tree/DefaultTreeCellEditor.java
@@ -0,0 +1,489 @@
+/* DefaultTreeCellEditor.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+// Imports
+import java.awt.*;
+import java.awt.event.*;
+import java.io.*;
+import java.util.*;
+import javax.swing.*;
+import javax.swing.border.*;
+import javax.swing.event.*;
+
+/**
+ * DefaultTreeCellEditor
+ * @author Andrew Selkirk
+ */
+public class DefaultTreeCellEditor implements ActionListener, TreeCellEditor, TreeSelectionListener {
+
+ //-------------------------------------------------------------
+ // Classes ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * EditorContainer
+ */
+ public class EditorContainer extends Container {
+
+ //-------------------------------------------------------------
+ // Variables --------------------------------------------------
+ //-------------------------------------------------------------
+
+
+ //-------------------------------------------------------------
+ // Initialization ---------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * Constructor EditorContainer
+ * @param value0 TODO
+ */
+ public EditorContainer(DefaultTreeCellEditor value0) {
+ // TODO
+ } // EditorContainer()
+
+
+ //-------------------------------------------------------------
+ // Methods ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * getPreferredSize
+ * @returns Dimension
+ */
+ public Dimension getPreferredSize() {
+ return null; // TODO
+ } // getPreferredSize()
+
+ /**
+ * paint
+ * @param value0 TODO
+ */
+ public void paint(Graphics value0) {
+ // TODO
+ } // paint()
+
+ /**
+ * doLayout
+ */
+ public void doLayout() {
+ // TODO
+ } // doLayout()
+
+
+ } // EditorContainer
+
+ /**
+ * DefaultTextField
+ */
+ public class DefaultTextField extends JTextField {
+
+ //-------------------------------------------------------------
+ // Variables --------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * border
+ */
+ protected Border border;
+
+
+ //-------------------------------------------------------------
+ // Initialization ---------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * Constructor DefaultTextField
+ * @param value0 TODO
+ * @param value1 TODO
+ */
+ public DefaultTextField(DefaultTreeCellEditor value0, Border value1) {
+ // TODO
+ } // DefaultTextField()
+
+
+ //-------------------------------------------------------------
+ // Methods ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * getFont
+ * @returns Font
+ */
+ public Font getFont() {
+ return null; // TODO
+ } // getFont()
+
+ /**
+ * getBorder
+ * @returns Border
+ */
+ public Border getBorder() {
+ return null; // TODO
+ } // getBorder()
+
+ /**
+ * getPreferredSize
+ * @returns Dimension
+ */
+ public Dimension getPreferredSize() {
+ return null; // TODO
+ } // getPreferredSize()
+
+
+ } // DefaultTextField
+
+
+ //-------------------------------------------------------------
+ // Variables --------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * realEditor
+ */
+ protected TreeCellEditor realEditor;
+
+ /**
+ * renderer
+ */
+ protected DefaultTreeCellRenderer renderer;
+
+ /**
+ * editingContainer
+ */
+ protected Container editingContainer;
+
+ /**
+ * editingComponent
+ */
+ protected transient Component editingComponent;
+
+ /**
+ * canEdit
+ */
+ protected boolean canEdit;
+
+ /**
+ * offset
+ */
+ protected transient int offset;
+
+ /**
+ * tree
+ */
+ protected transient JTree tree;
+
+ /**
+ * lastPath
+ */
+ protected transient TreePath lastPath;
+
+ /**
+ * timer
+ */
+ protected transient javax.swing.Timer timer; // TODO
+
+ /**
+ * lastRow
+ */
+ protected transient int lastRow;
+
+ /**
+ * borderSelectionColor
+ */
+ protected Color borderSelectionColor;
+
+ /**
+ * editingIcon
+ */
+ protected transient Icon editingIcon;
+
+ /**
+ * font
+ */
+ protected Font font;
+
+
+ //-------------------------------------------------------------
+ // Initialization ---------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * Constructor DefaultTreeCellEditor
+ * @param value0 TODO
+ * @param value1 TODO
+ */
+ public DefaultTreeCellEditor(JTree value0, DefaultTreeCellRenderer value1) {
+ // TODO
+ } // DefaultTreeCellEditor()
+
+ /**
+ * Constructor DefaultTreeCellEditor
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ */
+ public DefaultTreeCellEditor(JTree value0, DefaultTreeCellRenderer value1, TreeCellEditor value2) {
+ // TODO
+ } // DefaultTreeCellEditor()
+
+
+ //-------------------------------------------------------------
+ // Methods ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * writeObject
+ * @param value0 TODO
+ * @exception IOException TODO
+ */
+ private void writeObject(ObjectOutputStream value0) throws IOException {
+ // TODO
+ } // writeObject()
+
+ /**
+ * readObject
+ * @param value0 TODO
+ * @exception IOException TODO
+ * @exception ClassNotFoundException TODO
+ */
+ private void readObject(ObjectInputStream value0) throws IOException, ClassNotFoundException {
+ // TODO
+ } // readObject()
+
+ /**
+ * setBorderSelectionColor
+ * @param value0 TODO
+ */
+ public void setBorderSelectionColor(Color value0) {
+ // TODO
+ } // setBorderSelectionColor()
+
+ /**
+ * getBorderSelectionColor
+ * @returns Color
+ */
+ public Color getBorderSelectionColor() {
+ return null; // TODO
+ } // getBorderSelectionColor()
+
+ /**
+ * setFont
+ * @param value0 TODO
+ */
+ public void setFont(Font value0) {
+ // TODO
+ } // setFont()
+
+ /**
+ * getFont
+ * @returns Font
+ */
+ public Font getFont() {
+ return null; // TODO
+ } // getFont()
+
+ /**
+ * getTreeCellEditorComponent
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ * @param value3 TODO
+ * @param value4 TODO
+ * @param value5 TODO
+ * @returns Component
+ */
+ public Component getTreeCellEditorComponent(JTree value0, Object value1, boolean value2, boolean value3, boolean value4, int value5) {
+ return null; // TODO
+ } // getTreeCellEditorComponent()
+
+ /**
+ * getCellEditorValue
+ * @returns Object
+ */
+ public Object getCellEditorValue() {
+ return null; // TODO
+ } // getCellEditorValue()
+
+ /**
+ * isCellEditable
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean isCellEditable(EventObject value0) {
+ return false; // TODO
+ } // isCellEditable()
+
+ /**
+ * shouldSelectCell
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean shouldSelectCell(EventObject value0) {
+ return false; // TODO
+ } // shouldSelectCell()
+
+ /**
+ * stopCellEditing
+ * @returns boolean
+ */
+ public boolean stopCellEditing() {
+ return false; // TODO
+ } // stopCellEditing()
+
+ /**
+ * cancelCellEditing
+ */
+ public void cancelCellEditing() {
+ // TODO
+ } // cancelCellEditing()
+
+ /**
+ * addCellEditorListener
+ * @param value0 TODO
+ */
+ public void addCellEditorListener(CellEditorListener value0) {
+ // TODO
+ } // addCellEditorListener()
+
+ /**
+ * removeCellEditorListener
+ * @param value0 TODO
+ */
+ public void removeCellEditorListener(CellEditorListener value0) {
+ // TODO
+ } // removeCellEditorListener()
+
+ /**
+ * valueChanged
+ * @param value0 TODO
+ */
+ public void valueChanged(TreeSelectionEvent value0) {
+ // TODO
+ } // valueChanged()
+
+ /**
+ * actionPerformed
+ * @param value0 TODO
+ */
+ public void actionPerformed(ActionEvent value0) {
+ // TODO
+ } // actionPerformed()
+
+ /**
+ * setTree
+ * @param value0 TODO
+ */
+ protected void setTree(JTree value0) {
+ // TODO
+ } // setTree()
+
+ /**
+ * shouldStartEditingTimer
+ * @param value0 TODO
+ * @returns boolean
+ */
+ protected boolean shouldStartEditingTimer(EventObject value0) {
+ return false; // TODO
+ } // shouldStartEditingTimer()
+
+ /**
+ * startEditingTimer
+ */
+ protected void startEditingTimer() {
+ // TODO
+ } // startEditingTimer()
+
+ /**
+ * canEditImmediately
+ * @param value0 TODO
+ * @returns boolean
+ */
+ protected boolean canEditImmediately(EventObject value0) {
+ return false; // TODO
+ } // canEditImmediately()
+
+ /**
+ * inHitRegion
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns boolean
+ */
+ protected boolean inHitRegion(int value0, int value1) {
+ return false; // TODO
+ } // inHitRegion()
+
+ /**
+ * determineOffset
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ * @param value3 TODO
+ * @param value4 TODO
+ * @param value5 TODO
+ */
+ protected void determineOffset(JTree value0, Object value1, boolean value2, boolean value3, boolean value4, int value5) {
+ // TODO
+ } // determineOffset()
+
+ /**
+ * prepareForEditing
+ */
+ protected void prepareForEditing() {
+ // TODO
+ } // prepareForEditing()
+
+ /**
+ * createContainer
+ * @returns Container
+ */
+ protected Container createContainer() {
+ return null; // TODO
+ } // createContainer()
+
+ /**
+ * createTreeCellEditor
+ * @returns TreeCellEditor
+ */
+ protected TreeCellEditor createTreeCellEditor() {
+ return null; // TODO
+ } // createTreeCellEditor()
+
+
+} // DefaultTreeCellEditor
diff --git a/libjava/javax/swing/tree/DefaultTreeCellRenderer.java b/libjava/javax/swing/tree/DefaultTreeCellRenderer.java
new file mode 100644
index 00000000000..ab534be96a4
--- /dev/null
+++ b/libjava/javax/swing/tree/DefaultTreeCellRenderer.java
@@ -0,0 +1,450 @@
+/* DefaultTreeCellRenderer.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+// Imports
+import java.awt.*;
+import javax.swing.*;
+
+/**
+ * DefaultTreeCellRenderer
+ * @author Andrew Selkirk
+ */
+public class DefaultTreeCellRenderer extends JLabel implements TreeCellRenderer {
+
+ //-------------------------------------------------------------
+ // Variables --------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * selected
+ */
+ protected boolean selected;
+
+ /**
+ * hasFocus
+ */
+ protected boolean hasFocus;
+
+ /**
+ * drawsFocusBorderAroundIcon
+ */
+ private boolean drawsFocusBorderAroundIcon;
+
+ /**
+ * closedIcon
+ */
+ protected transient Icon closedIcon;
+
+ /**
+ * leafIcon
+ */
+ protected transient Icon leafIcon;
+
+ /**
+ * openIcon
+ */
+ protected transient Icon openIcon;
+
+ /**
+ * textSelectionColor
+ */
+ protected Color textSelectionColor;
+
+ /**
+ * textNonSelectionColor
+ */
+ protected Color textNonSelectionColor;
+
+ /**
+ * backgroundSelectionColor
+ */
+ protected Color backgroundSelectionColor;
+
+ /**
+ * backgroundNonSelectionColor
+ */
+ protected Color backgroundNonSelectionColor;
+
+ /**
+ * borderSelectionColor
+ */
+ protected Color borderSelectionColor;
+
+
+ //-------------------------------------------------------------
+ // Initialization ---------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * Constructor DefaultTreeCellRenderer
+ */
+ public DefaultTreeCellRenderer() {
+ // TODO
+ } // DefaultTreeCellRenderer()
+
+
+ //-------------------------------------------------------------
+ // Methods ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * getDefaultOpenIcon
+ * @returns Icon
+ */
+ public Icon getDefaultOpenIcon() {
+ return null; // TODO
+ } // getDefaultOpenIcon()
+
+ /**
+ * getDefaultClosedIcon
+ * @returns Icon
+ */
+ public Icon getDefaultClosedIcon() {
+ return null; // TODO
+ } // getDefaultClosedIcon()
+
+ /**
+ * getDefaultLeafIcon
+ * @returns Icon
+ */
+ public Icon getDefaultLeafIcon() {
+ return null; // TODO
+ } // getDefaultLeafIcon()
+
+ /**
+ * setOpenIcon
+ * @param value0 TODO
+ */
+ public void setOpenIcon(Icon value0) {
+ // TODO
+ } // setOpenIcon()
+
+ /**
+ * getOpenIcon
+ * @returns Icon
+ */
+ public Icon getOpenIcon() {
+ return null; // TODO
+ } // getOpenIcon()
+
+ /**
+ * setClosedIcon
+ * @param value0 TODO
+ */
+ public void setClosedIcon(Icon value0) {
+ // TODO
+ } // setClosedIcon()
+
+ /**
+ * getClosedIcon
+ * @returns Icon
+ */
+ public Icon getClosedIcon() {
+ return null; // TODO
+ } // getClosedIcon()
+
+ /**
+ * setLeafIcon
+ * @param value0 TODO
+ */
+ public void setLeafIcon(Icon value0) {
+ // TODO
+ } // setLeafIcon()
+
+ /**
+ * getLeafIcon
+ * @returns Icon
+ */
+ public Icon getLeafIcon() {
+ return null; // TODO
+ } // getLeafIcon()
+
+ /**
+ * setTextSelectionColor
+ * @param value0 TODO
+ */
+ public void setTextSelectionColor(Color value0) {
+ // TODO
+ } // setTextSelectionColor()
+
+ /**
+ * getTextSelectionColor
+ * @returns Color
+ */
+ public Color getTextSelectionColor() {
+ return null; // TODO
+ } // getTextSelectionColor()
+
+ /**
+ * setTextNonSelectionColor
+ * @param value0 TODO
+ */
+ public void setTextNonSelectionColor(Color value0) {
+ // TODO
+ } // setTextNonSelectionColor()
+
+ /**
+ * getTextNonSelectionColor
+ * @returns Color
+ */
+ public Color getTextNonSelectionColor() {
+ return null; // TODO
+ } // getTextNonSelectionColor()
+
+ /**
+ * setBackgroundSelectionColor
+ * @param value0 TODO
+ */
+ public void setBackgroundSelectionColor(Color value0) {
+ // TODO
+ } // setBackgroundSelectionColor()
+
+ /**
+ * getBackgroundSelectionColor
+ * @returns Color
+ */
+ public Color getBackgroundSelectionColor() {
+ return null; // TODO
+ } // getBackgroundSelectionColor()
+
+ /**
+ * setBackgroundNonSelectionColor
+ * @param value0 TODO
+ */
+ public void setBackgroundNonSelectionColor(Color value0) {
+ // TODO
+ } // setBackgroundNonSelectionColor()
+
+ /**
+ * getBackgroundNonSelectionColor
+ * @returns Color
+ */
+ public Color getBackgroundNonSelectionColor() {
+ return null; // TODO
+ } // getBackgroundNonSelectionColor()
+
+ /**
+ * setBorderSelectionColor
+ * @param value0 TODO
+ */
+ public void setBorderSelectionColor(Color value0) {
+ // TODO
+ } // setBorderSelectionColor()
+
+ /**
+ * getBorderSelectionColor
+ * @returns Color
+ */
+ public Color getBorderSelectionColor() {
+ return null; // TODO
+ } // getBorderSelectionColor()
+
+ /**
+ * setFont
+ * @param value0 TODO
+ */
+ public void setFont(Font value0) {
+ // TODO
+ } // setFont()
+
+ /**
+ * setBackground
+ * @param value0 TODO
+ */
+ public void setBackground(Color value0) {
+ // TODO
+ } // setBackground()
+
+ /**
+ * getTreeCellRendererComponent
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ * @param value3 TODO
+ * @param value4 TODO
+ * @param value5 TODO
+ * @param value6 TODO
+ * @returns Component
+ */
+ public Component getTreeCellRendererComponent(JTree value0, Object value1, boolean value2, boolean value3, boolean value4, int value5, boolean value6) {
+ return null; // TODO
+ } // getTreeCellRendererComponent()
+
+ /**
+ * paint
+ * @param value0 TODO
+ */
+ public void paint(Graphics value0) {
+ // TODO
+ } // paint()
+
+ /**
+ * getPreferredSize
+ * @returns Dimension
+ */
+ public Dimension getPreferredSize() {
+ return null; // TODO
+ } // getPreferredSize()
+
+ /**
+ * validate
+ */
+ public void validate() {
+ // TODO
+ } // validate()
+
+ /**
+ * revalidate
+ */
+ public void revalidate() {
+ // TODO
+ } // revalidate()
+
+ /**
+ * repaint
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ * @param value3 TODO
+ * @param value4 TODO
+ */
+ public void repaint(long value0, int value1, int value2, int value3, int value4) {
+ // TODO
+ } // repaint()
+
+ /**
+ * repaint
+ * @param value0 TODO
+ */
+ public void repaint(Rectangle value0) {
+ // TODO
+ } // repaint()
+
+ /**
+ * firePropertyChange
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ */
+ protected void firePropertyChange(String value0, Object value1, Object value2) {
+ // TODO
+ } // firePropertyChange()
+
+ /**
+ * firePropertyChange
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ */
+ public void firePropertyChange(String value0, byte value1, byte value2) {
+ // TODO
+ } // firePropertyChange()
+
+ /**
+ * firePropertyChange
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ */
+ public void firePropertyChange(String value0, char value1, char value2) {
+ // TODO
+ } // firePropertyChange()
+
+ /**
+ * firePropertyChange
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ */
+ public void firePropertyChange(String value0, short value1, short value2) {
+ // TODO
+ } // firePropertyChange()
+
+ /**
+ * firePropertyChange
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ */
+ public void firePropertyChange(String value0, int value1, int value2) {
+ // TODO
+ } // firePropertyChange()
+
+ /**
+ * firePropertyChange
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ */
+ public void firePropertyChange(String value0, long value1, long value2) {
+ // TODO
+ } // firePropertyChange()
+
+ /**
+ * firePropertyChange
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ */
+ public void firePropertyChange(String value0, float value1, float value2) {
+ // TODO
+ } // firePropertyChange()
+
+ /**
+ * firePropertyChange
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ */
+ public void firePropertyChange(String value0, double value1, double value2) {
+ // TODO
+ } // firePropertyChange()
+
+ /**
+ * firePropertyChange
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ */
+ public void firePropertyChange(String value0, boolean value1, boolean value2) {
+ // TODO
+ } // firePropertyChange()
+
+
+} // DefaultTreeCellRenderer
diff --git a/libjava/javax/swing/tree/DefaultTreeModel.java b/libjava/javax/swing/tree/DefaultTreeModel.java
new file mode 100644
index 00000000000..daf3f1100b5
--- /dev/null
+++ b/libjava/javax/swing/tree/DefaultTreeModel.java
@@ -0,0 +1,371 @@
+/* DefaultTreeModel.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+// Imports
+import java.io.*;
+import java.util.*;
+import javax.swing.event.*;
+
+/**
+ * DefaultTreeModel
+ * @author Andrew Selkirk
+ */
+public class DefaultTreeModel implements Serializable, TreeModel {
+
+ //-------------------------------------------------------------
+ // Variables --------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * root
+ */
+ protected TreeNode root = null;
+
+ /**
+ * listenerList
+ */
+ protected EventListenerList listenerList = new EventListenerList();
+
+ /**
+ * asksAllowsChildren
+ */
+ protected boolean asksAllowsChildren;
+
+
+ //-------------------------------------------------------------
+ // Initialization ---------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * Constructor DefaultTreeModel
+ * @param value0 TODO
+ */
+ public DefaultTreeModel(TreeNode root) {
+ setRoot(root);
+ } // DefaultTreeModel()
+
+ /**
+ * Constructor DefaultTreeModel
+ * @param value0 TODO
+ * @param value1 TODO
+ */
+ public DefaultTreeModel(TreeNode root, boolean asksAllowsChildren) {
+ setRoot(root);
+ this.asksAllowsChildren = asksAllowsChildren;
+ } // DefaultTreeModel()
+
+
+ //-------------------------------------------------------------
+ // Methods ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * writeObject
+ * @param value0 TODO
+ * @exception IOException TODO
+ */
+ private void writeObject(ObjectOutputStream value0) throws IOException {
+ // TODO
+ } // writeObject()
+
+ /**
+ * readObject
+ * @param value0 TODO
+ * @exception IOException TODO
+ * @exception ClassNotFoundException TODO
+ */
+ private void readObject(ObjectInputStream value0) throws IOException, ClassNotFoundException {
+ // TODO
+ } // readObject()
+
+ /**
+ * asksAllowsChildren
+ * @returns boolean
+ */
+ public boolean asksAllowsChildren() {
+ return asksAllowsChildren;
+ } // asksAllowsChildren()
+
+ /**
+ * setAsksAllowsChildren
+ * @param value0 TODO
+ */
+ public void setAsksAllowsChildren(boolean value) {
+ asksAllowsChildren = value; // TODO
+ } // setAsksAllowsChildren()
+
+ /**
+ * setRoot
+ * @param value0 TODO
+ */
+ public void setRoot(TreeNode root) {
+
+ // Sanity Check
+ if (root == null) {
+ throw new IllegalArgumentException("null root");
+ } // if
+
+ // Set new root
+ this.root = root;
+
+ // TODO
+ } // setRoot()
+
+ /**
+ * getRoot
+ * @returns Object
+ */
+ public Object getRoot() {
+ return root;
+ } // getRoot()
+
+ /**
+ * getIndexOfChild
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns int
+ */
+ public int getIndexOfChild(Object parent, Object child) {
+ return 0; // TODO
+ } // getIndexOfChild()
+
+ /**
+ * getChild
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns Object
+ */
+ public Object getChild(Object value0, int value1) {
+ return null; // TODO
+ } // getChild()
+
+ /**
+ * getChildCount
+ * @param value0 TODO
+ * @returns int
+ */
+ public int getChildCount(Object value0) {
+ return 0; // TODO
+ } // getChildCount()
+
+ /**
+ * isLeaf
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean isLeaf(Object value0) {
+ return false; // TODO
+ } // isLeaf()
+
+ /**
+ * reload
+ */
+ public void reload() {
+ // TODO
+ } // reload()
+
+ /**
+ * reload
+ * @param value0 TODO
+ */
+ public void reload(TreeNode value0) {
+ // TODO
+ } // reload()
+
+ /**
+ * valueForPathChanged
+ * @param value0 TODO
+ * @param value1 TODO
+ */
+ public void valueForPathChanged(TreePath value0, Object value1) {
+ // TODO
+ } // valueForPathChanged()
+
+ /**
+ * insertNodeInto
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ */
+ public void insertNodeInto(MutableTreeNode value0, MutableTreeNode value1, int value2) {
+ // TODO
+ } // insertNodeInto()
+
+ /**
+ * removeNodeFromParent
+ * @param value0 TODO
+ */
+ public void removeNodeFromParent(MutableTreeNode value0) {
+ // TODO
+ } // removeNodeFromParent()
+
+ /**
+ * nodeChanged
+ * @param value0 TODO
+ */
+ public void nodeChanged(TreeNode value0) {
+ // TODO
+ } // nodeChanged()
+
+ /**
+ * nodesWereInserted
+ * @param value0 TODO
+ * @param value1 TODO
+ */
+ public void nodesWereInserted(TreeNode value0, int[] value1) {
+ // TODO
+ } // nodesWereInserted()
+
+ /**
+ * nodesWereRemoved
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ */
+ public void nodesWereRemoved(TreeNode value0, int[] value1, Object[] value2) {
+ // TODO
+ } // nodesWereRemoved()
+
+ /**
+ * nodesChanged
+ * @param value0 TODO
+ * @param value1 TODO
+ */
+ public void nodesChanged(TreeNode value0, int[] value1) {
+ // TODO
+ } // nodesChanged()
+
+ /**
+ * nodeStructureChanged
+ * @param value0 TODO
+ */
+ public void nodeStructureChanged(TreeNode value0) {
+ // TODO
+ } // nodeStructureChanged()
+
+ /**
+ * getPathToRoot
+ * @param value0 TODO
+ * @returns TreeNode[]
+ */
+ public TreeNode[] getPathToRoot(TreeNode value0) {
+ return null; // TODO
+ } // getPathToRoot()
+
+ /**
+ * getPathToRoot
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns TreeNode[]
+ */
+ protected TreeNode[] getPathToRoot(TreeNode value0, int value1) {
+ return null; // TODO
+ } // getPathToRoot()
+
+ /**
+ * addTreeModelListener
+ * @param value0 TODO
+ */
+ public void addTreeModelListener(TreeModelListener listener) {
+ listenerList.add(TreeModelListener.class, listener);
+ } // addTreeModelListener()
+
+ /**
+ * removeTreeModelListener
+ * @param value0 TODO
+ */
+ public void removeTreeModelListener(TreeModelListener listener) {
+ listenerList.remove(TreeModelListener.class, listener);
+ } // removeTreeModelListener()
+
+ /**
+ * fireTreeNodesChanged
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ * @param value3 TODO
+ */
+ protected void fireTreeNodesChanged(Object value0, Object[] value1, int[] value2, Object[] value3) {
+ // TODO
+ } // fireTreeNodesChanged()
+
+ /**
+ * fireTreeNodesInserted
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ * @param value3 TODO
+ */
+ protected void fireTreeNodesInserted(Object value0, Object[] value1, int[] value2, Object[] value3) {
+ // TODO
+ } // fireTreeNodesInserted()
+
+ /**
+ * fireTreeNodesRemoved
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ * @param value3 TODO
+ */
+ protected void fireTreeNodesRemoved(Object value0, Object[] value1, int[] value2, Object[] value3) {
+ // TODO
+ } // fireTreeNodesRemoved()
+
+ /**
+ * fireTreeStructureChanged
+ * @param value0 TODO
+ * @param value1 TODO
+ * @param value2 TODO
+ * @param value3 TODO
+ */
+ protected void fireTreeStructureChanged(Object value0, Object[] value1, int[] value2, Object[] value3) {
+ // TODO
+ } // fireTreeStructureChanged()
+
+ /**
+ * getListeners
+ * @param value0 TODO
+ * @returns EventListener[]
+ */
+ public EventListener[] getListeners(Class classType) {
+ return listenerList.getListeners(classType);
+ } // getListeners()
+
+
+} // DefaultTreeModel
diff --git a/libjava/javax/swing/tree/DefaultTreeSelectionModel.java b/libjava/javax/swing/tree/DefaultTreeSelectionModel.java
new file mode 100644
index 00000000000..f772c188c13
--- /dev/null
+++ b/libjava/javax/swing/tree/DefaultTreeSelectionModel.java
@@ -0,0 +1,451 @@
+/* DefaultTreeSelectionModel.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+// Imports
+import java.beans.*;
+import java.io.*;
+import java.util.*;
+import javax.swing.*;
+import javax.swing.event.*;
+
+/**
+ * DefaultTreeSelectionModel
+ * @author Andrew Selkirk
+ */
+public class DefaultTreeSelectionModel implements Cloneable, Serializable, TreeSelectionModel {
+
+ //-------------------------------------------------------------
+ // Variables --------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * SELECTION_MODE_PROPERTY
+ */
+ public static final String SELECTION_MODE_PROPERTY = "selectionMode";
+
+ /**
+ * changeSupport
+ */
+ protected SwingPropertyChangeSupport changeSupport;
+
+ /**
+ * selection
+ */
+ protected TreePath[] selection;
+
+ /**
+ * listenerList
+ */
+ protected EventListenerList listenerList;
+
+ /**
+ * rowMapper
+ */
+ protected transient RowMapper rowMapper;
+
+ /**
+ * listSelectionModel
+ */
+ protected DefaultListSelectionModel listSelectionModel;
+
+ /**
+ * selectionMode
+ */
+ protected int selectionMode;
+
+ /**
+ * leadPath
+ */
+ protected TreePath leadPath;
+
+ /**
+ * leadIndex
+ */
+ protected int leadIndex;
+
+ /**
+ * leadRow
+ */
+ protected int leadRow;
+
+
+ //-------------------------------------------------------------
+ // Initialization ---------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * Constructor DefaultTreeSelectionModel
+ */
+ public DefaultTreeSelectionModel() {
+ // TODO
+ } // DefaultTreeSelectionModel()
+
+
+ //-------------------------------------------------------------
+ // Methods ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * clone
+ * @exception CloneNotSupportedException TODO
+ * @returns Object
+ */
+ public Object clone() throws CloneNotSupportedException {
+ return null; // TODO
+ } // clone()
+
+ /**
+ * toString
+ * @returns String
+ */
+ public String toString() {
+ return null; // TODO
+ } // toString()
+
+ /**
+ * writeObject
+ * @param value0 TODO
+ * @exception IOException TODO
+ */
+ private void writeObject(ObjectOutputStream value0) throws IOException {
+ // TODO
+ } // writeObject()
+
+ /**
+ * readObject
+ * @param value0 TODO
+ * @exception IOException TODO
+ * @exception ClassNotFoundException TODO
+ */
+ private void readObject(ObjectInputStream value0) throws IOException, ClassNotFoundException {
+ // TODO
+ } // readObject()
+
+ /**
+ * setRowMapper
+ * @param value0 TODO
+ */
+ public void setRowMapper(RowMapper value0) {
+ // TODO
+ } // setRowMapper()
+
+ /**
+ * getRowMapper
+ * @returns RowMapper
+ */
+ public RowMapper getRowMapper() {
+ return null; // TODO
+ } // getRowMapper()
+
+ /**
+ * setSelectionMode
+ * @param value0 TODO
+ */
+ public void setSelectionMode(int value0) {
+ // TODO
+ } // setSelectionMode()
+
+ /**
+ * getSelectionMode
+ * @returns int
+ */
+ public int getSelectionMode() {
+ return 0; // TODO
+ } // getSelectionMode()
+
+ /**
+ * setSelectionPath
+ * @param value0 TODO
+ */
+ public void setSelectionPath(TreePath value0) {
+ // TODO
+ } // setSelectionPath()
+
+ /**
+ * setSelectionPaths
+ * @param value0 TODO
+ */
+ public void setSelectionPaths(TreePath[] value0) {
+ // TODO
+ } // setSelectionPaths()
+
+ /**
+ * addSelectionPath
+ * @param value0 TODO
+ */
+ public void addSelectionPath(TreePath value0) {
+ // TODO
+ } // addSelectionPath()
+
+ /**
+ * addSelectionPaths
+ * @param value0 TODO
+ */
+ public void addSelectionPaths(TreePath[] value0) {
+ // TODO
+ } // addSelectionPaths()
+
+ /**
+ * removeSelectionPath
+ * @param value0 TODO
+ */
+ public void removeSelectionPath(TreePath value0) {
+ // TODO
+ } // removeSelectionPath()
+
+ /**
+ * removeSelectionPaths
+ * @param value0 TODO
+ */
+ public void removeSelectionPaths(TreePath[] value0) {
+ // TODO
+ } // removeSelectionPaths()
+
+ /**
+ * getSelectionPath
+ * @returns TreePath
+ */
+ public TreePath getSelectionPath() {
+ return null; // TODO
+ } // getSelectionPath()
+
+ /**
+ * getSelectionPaths
+ * @returns TreePath[]
+ */
+ public TreePath[] getSelectionPaths() {
+ return null; // TODO
+ } // getSelectionPaths()
+
+ /**
+ * getSelectionCount
+ * @returns int
+ */
+ public int getSelectionCount() {
+ return 0; // TODO
+ } // getSelectionCount()
+
+ /**
+ * isPathSelected
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean isPathSelected(TreePath value0) {
+ return false; // TODO
+ } // isPathSelected()
+
+ /**
+ * isSelectionEmpty
+ * @returns boolean
+ */
+ public boolean isSelectionEmpty() {
+ return false; // TODO
+ } // isSelectionEmpty()
+
+ /**
+ * clearSelection
+ */
+ public void clearSelection() {
+ // TODO
+ } // clearSelection()
+
+ /**
+ * addTreeSelectionListener
+ * @param value0 TODO
+ */
+ public void addTreeSelectionListener(TreeSelectionListener value0) {
+ // TODO
+ } // addTreeSelectionListener()
+
+ /**
+ * removeTreeSelectionListener
+ * @param value0 TODO
+ */
+ public void removeTreeSelectionListener(TreeSelectionListener value0) {
+ // TODO
+ } // removeTreeSelectionListener()
+
+ /**
+ * fireValueChanged
+ * @param value0 TODO
+ */
+ protected void fireValueChanged(TreeSelectionEvent value0) {
+ // TODO
+ } // fireValueChanged()
+
+ /**
+ * getListeners
+ * @param value0 TODO
+ * @returns EventListener[]
+ */
+ public EventListener[] getListeners(Class value0) {
+ return null; // TODO
+ } // getListeners()
+
+ /**
+ * getSelectionRows
+ * @returns int[]
+ */
+ public int[] getSelectionRows() {
+ return null; // TODO
+ } // getSelectionRows()
+
+ /**
+ * getMinSelectionRow
+ * @returns int
+ */
+ public int getMinSelectionRow() {
+ return 0; // TODO
+ } // getMinSelectionRow()
+
+ /**
+ * getMaxSelectionRow
+ * @returns int
+ */
+ public int getMaxSelectionRow() {
+ return 0; // TODO
+ } // getMaxSelectionRow()
+
+ /**
+ * isRowSelected
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean isRowSelected(int value0) {
+ return false; // TODO
+ } // isRowSelected()
+
+ /**
+ * resetRowSelection
+ */
+ public void resetRowSelection() {
+ // TODO
+ } // resetRowSelection()
+
+ /**
+ * getLeadSelectionRow
+ * @returns int
+ */
+ public int getLeadSelectionRow() {
+ return 0; // TODO
+ } // getLeadSelectionRow()
+
+ /**
+ * getLeadSelectionPath
+ * @returns TreePath
+ */
+ public TreePath getLeadSelectionPath() {
+ return null; // TODO
+ } // getLeadSelectionPath()
+
+ /**
+ * addPropertyChangeListener
+ * @param value0 TODO
+ */
+ public synchronized void addPropertyChangeListener(PropertyChangeListener value0) {
+ // TODO
+ } // addPropertyChangeListener()
+
+ /**
+ * removePropertyChangeListener
+ * @param value0 TODO
+ */
+ public synchronized void removePropertyChangeListener(PropertyChangeListener value0) {
+ // TODO
+ } // removePropertyChangeListener()
+
+ /**
+ * insureRowContinuity
+ */
+ protected void insureRowContinuity() {
+ // TODO
+ } // insureRowContinuity()
+
+ /**
+ * arePathsContiguous
+ * @param value0 TODO
+ * @returns boolean
+ */
+ protected boolean arePathsContiguous(TreePath[] value0) {
+ return false; // TODO
+ } // arePathsContiguous()
+
+ /**
+ * canPathsBeAdded
+ * @param value0 TODO
+ * @returns boolean
+ */
+ protected boolean canPathsBeAdded(TreePath[] value0) {
+ return false; // TODO
+ } // canPathsBeAdded()
+
+ /**
+ * canPathsBeRemoved
+ * @param value0 TODO
+ * @returns boolean
+ */
+ protected boolean canPathsBeRemoved(TreePath[] value0) {
+ return false; // TODO
+ } // canPathsBeRemoved()
+
+ /**
+ * notifyPathChange
+ * @param value0 TODO
+ * @param value1 TODO
+ */
+ protected void notifyPathChange(Vector value0, TreePath value1) {
+ // TODO
+ } // notifyPathChange()
+
+ /**
+ * updateLeadIndex
+ */
+ protected void updateLeadIndex() {
+ // TODO
+ } // updateLeadIndex()
+
+ /**
+ * insureUniqueness
+ */
+ protected void insureUniqueness() {
+ // TODO
+ } // insureUniqueness()
+
+
+} // DefaultTreeSelectionModel
diff --git a/libjava/javax/swing/tree/ExpandVetoException.java b/libjava/javax/swing/tree/ExpandVetoException.java
new file mode 100644
index 00000000000..5edf09a11e1
--- /dev/null
+++ b/libjava/javax/swing/tree/ExpandVetoException.java
@@ -0,0 +1,83 @@
+/* ExpandVetoException.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+// Imports
+import javax.swing.event.TreeExpansionEvent;
+
+/**
+ * ExpandVetoException
+ * @author Andrew Selkirk
+ */
+public class ExpandVetoException extends Exception {
+
+ //-------------------------------------------------------------
+ // Variables --------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * event
+ */
+ protected TreeExpansionEvent event = null;
+
+
+ //-------------------------------------------------------------
+ // Initialization ---------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * Constructor ExpandVetoException
+ * @param event Tree Expansion Event
+ */
+ public ExpandVetoException(TreeExpansionEvent event) {
+ super();
+ this.event = event;
+ } // ExpandVetoException()
+
+ /**
+ * Constructor ExpandVetoException
+ * @param event Tree Expansion Event
+ * @param message Message
+ */
+ public ExpandVetoException(TreeExpansionEvent event, String message) {
+ super(message);
+ this.event = event;
+ } // ExpandVetoException()
+
+
+} // ExpandVetoException
diff --git a/libjava/javax/swing/tree/FixedHeightLayoutCache.java b/libjava/javax/swing/tree/FixedHeightLayoutCache.java
new file mode 100644
index 00000000000..279eec0278b
--- /dev/null
+++ b/libjava/javax/swing/tree/FixedHeightLayoutCache.java
@@ -0,0 +1,235 @@
+/* FixedHeightLayoutCache.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+// Imports
+import java.awt.*;
+import java.util.*;
+import javax.swing.event.*;
+
+/**
+ * FixedHeightLayoutCache
+ * @author Andrew Selkirk
+ */
+public class FixedHeightLayoutCache extends AbstractLayoutCache {
+
+ //-------------------------------------------------------------
+ // Variables --------------------------------------------------
+ //-------------------------------------------------------------
+
+
+ //-------------------------------------------------------------
+ // Initialization ---------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * Constructor FixedHeightLayoutCache
+ */
+ public FixedHeightLayoutCache() {
+ // TODO
+ } // FixedHeightLayoutCache()
+
+
+ //-------------------------------------------------------------
+ // Methods ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * setModel
+ * @param value0 TODO
+ */
+ public void setModel(TreeModel value0) {
+ // TODO
+ } // setModel()
+
+ /**
+ * setRootVisible
+ * @param value0 TODO
+ */
+ public void setRootVisible(boolean value0) {
+ // TODO
+ } // setRootVisible()
+
+ /**
+ * setRowHeight
+ * @param value0 TODO
+ */
+ public void setRowHeight(int value0) {
+ // TODO
+ } // setRowHeight()
+
+ /**
+ * getRowCount
+ * @returns int
+ */
+ public int getRowCount() {
+ return 0; // TODO
+ } // getRowCount()
+
+ /**
+ * invalidatePathBounds
+ * @param value0 TODO
+ */
+ public void invalidatePathBounds(TreePath value0) {
+ // TODO
+ } // invalidatePathBounds()
+
+ /**
+ * invalidateSizes
+ */
+ public void invalidateSizes() {
+ // TODO
+ } // invalidateSizes()
+
+ /**
+ * isExpanded
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean isExpanded(TreePath value0) {
+ return false; // TODO
+ } // isExpanded()
+
+ /**
+ * getBounds
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns Rectangle
+ */
+ public Rectangle getBounds(TreePath value0, Rectangle value1) {
+ return null; // TODO
+ } // getBounds()
+
+ /**
+ * getPathForRow
+ * @param value0 TODO
+ * @returns TreePath
+ */
+ public TreePath getPathForRow(int value0) {
+ return null; // TODO
+ } // getPathForRow()
+
+ /**
+ * getRowForPath
+ * @param value0 TODO
+ * @returns int
+ */
+ public int getRowForPath(TreePath value0) {
+ return 0; // TODO
+ } // getRowForPath()
+
+ /**
+ * getPathClosestTo
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns TreePath
+ */
+ public TreePath getPathClosestTo(int value0, int value1) {
+ return null; // TODO
+ } // getPathClosestTo()
+
+ /**
+ * getVisibleChildCount
+ * @param value0 TODO
+ * @returns int
+ */
+ public int getVisibleChildCount(TreePath value0) {
+ return 0; // TODO
+ } // getVisibleChildCount()
+
+ /**
+ * getVisiblePathsFrom
+ * @param value0 TODO
+ * @returns Enumeration
+ */
+ public Enumeration getVisiblePathsFrom(TreePath value0) {
+ return null; // TODO
+ } // getVisiblePathsFrom()
+
+ /**
+ * setExpandedState
+ * @param value0 TODO
+ * @param value1 TODO
+ */
+ public void setExpandedState(TreePath value0, boolean value1) {
+ // TODO
+ } // setExpandedState()
+
+ /**
+ * getExpandedState
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean getExpandedState(TreePath value0) {
+ return false; // TODO
+ } // getExpandedState()
+
+ /**
+ * treeNodesChanged
+ * @param value0 TODO
+ */
+ public void treeNodesChanged(TreeModelEvent value0) {
+ // TODO
+ } // treeNodesChanged()
+
+ /**
+ * treeNodesInserted
+ * @param value0 TODO
+ */
+ public void treeNodesInserted(TreeModelEvent value0) {
+ // TODO
+ } // treeNodesInserted()
+
+ /**
+ * treeNodesRemoved
+ * @param value0 TODO
+ */
+ public void treeNodesRemoved(TreeModelEvent value0) {
+ // TODO
+ } // treeNodesRemoved()
+
+ /**
+ * treeStructureChanged
+ * @param value0 TODO
+ */
+ public void treeStructureChanged(TreeModelEvent value0) {
+ // TODO
+ } // treeStructureChanged()
+
+
+} // FixedHeightLayoutCache
diff --git a/libjava/javax/swing/tree/MutableTreeNode.java b/libjava/javax/swing/tree/MutableTreeNode.java
new file mode 100644
index 00000000000..e550459d59b
--- /dev/null
+++ b/libjava/javax/swing/tree/MutableTreeNode.java
@@ -0,0 +1,83 @@
+/* MutableTreeNode.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+/**
+ * MutableTreeNode interface
+ * @author Andrew Selkirk
+ */
+public interface MutableTreeNode extends TreeNode {
+
+ /**
+ * insert
+ * @param child MutableTreeNode
+ * @param index Index
+ */
+ public void insert(MutableTreeNode child, int index);
+
+ /**
+ * remove
+ * @param index Index
+ */
+ public void remove(int index);
+
+ /**
+ * remove
+ * @param node MutableTreeNode
+ */
+ public void remove(MutableTreeNode node);
+
+ /**
+ * setUserObject
+ * @param object Object
+ */
+ public void setUserObject(Object object);
+
+ /**
+ * removeFromParent
+ */
+ public void removeFromParent();
+
+ /**
+ * setParent
+ * @param parent MutableTreeNode
+ */
+ public void setParent(MutableTreeNode parent);
+
+
+} // MutableTreeNode
diff --git a/libjava/javax/swing/tree/RowMapper.java b/libjava/javax/swing/tree/RowMapper.java
new file mode 100644
index 00000000000..4cc82fb30cd
--- /dev/null
+++ b/libjava/javax/swing/tree/RowMapper.java
@@ -0,0 +1,54 @@
+/* RowMapper.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+/**
+ * RowMapper interface
+ * @author Andrew Selkirk
+ */
+public interface RowMapper {
+
+ /**
+ * getRowsForPaths
+ * @param path TreePath
+ * @return TODO
+ */
+ public int[] getRowsForPaths(TreePath[] path);
+
+
+} // RowMapper
diff --git a/libjava/javax/swing/tree/TreeCellEditor.java b/libjava/javax/swing/tree/TreeCellEditor.java
new file mode 100644
index 00000000000..c55b97d339a
--- /dev/null
+++ b/libjava/javax/swing/tree/TreeCellEditor.java
@@ -0,0 +1,65 @@
+/* TreeCellEditor.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+// Imports
+import java.awt.Component;
+import javax.swing.JTree;
+
+/**
+ * TreeCellEditor interface
+ * @author Andrew Selkirk
+ */
+public interface TreeCellEditor {
+
+ /**
+ * getTreeCellEditorComponent
+ * @param tree TODO
+ * @param value TODO
+ * @param isSelected TODO
+ * @param expanded TODO
+ * @param leaf TODO
+ * @param row TODO
+ * @returns TODO
+ */
+ public Component getTreeCellEditorComponent(JTree tree,
+ Object value, boolean isSelected, boolean expanded,
+ boolean leaf, int row);
+
+
+} // TreeCellEditor
diff --git a/libjava/javax/swing/tree/TreeCellRenderer.java b/libjava/javax/swing/tree/TreeCellRenderer.java
new file mode 100644
index 00000000000..59c9db1963c
--- /dev/null
+++ b/libjava/javax/swing/tree/TreeCellRenderer.java
@@ -0,0 +1,66 @@
+/* TreeCellRenderer.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+// Imports
+import java.awt.Component;
+import javax.swing.JTree;
+
+/**
+ * TreeCellRenderer interface
+ * @author Andrew Selkirk
+ */
+public interface TreeCellRenderer {
+
+ /**
+ * getTreeCellRendererComponent
+ * @param tree TODO
+ * @param value TODO
+ * @param selected TODO
+ * @param expanded TODO
+ * @param leaf TODO
+ * @param row TODO
+ * @param us TODO
+ * @returns TODO
+ */
+ public Component getTreeCellRendererComponent(JTree tree,
+ Object value, boolean selected, boolean expanded,
+ boolean leaf, int row, boolean hasFocus);
+
+
+} // TreeCellRenderer
diff --git a/libjava/javax/swing/tree/TreeModel.java b/libjava/javax/swing/tree/TreeModel.java
new file mode 100644
index 00000000000..6763544fb9e
--- /dev/null
+++ b/libjava/javax/swing/tree/TreeModel.java
@@ -0,0 +1,109 @@
+/* TreeModel.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+// Imports
+import javax.swing.event.*;
+
+/**
+ * TreeModel interface
+ * @author Andrew Selkirk
+ */
+public interface TreeModel {
+
+ //-------------------------------------------------------------
+ // Methods ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * getRoot
+ * @returns Object
+ */
+ public abstract Object getRoot();
+
+ /**
+ * getChild
+ * @param parent TODO
+ * @param index TODO
+ * @returns Object
+ */
+ public abstract Object getChild(Object parent, int index);
+
+ /**
+ * getChildCount
+ * @param parent TODO
+ * @returns int
+ */
+ public abstract int getChildCount(Object parent);
+
+ /**
+ * isLeaf
+ * @param node TODO
+ * @returns boolean
+ */
+ public abstract boolean isLeaf(Object node);
+
+ /**
+ * valueForPathChanged
+ * @param path TODO
+ * @param newvalue TODO
+ */
+ public abstract void valueForPathChanged(TreePath path, Object newvalue);
+
+ /**
+ * getIndexOfChild
+ * @param parent TODO
+ * @param ild TODO
+ * @returns int
+ */
+ public abstract int getIndexOfChild(Object parent, Object child);
+
+ /**
+ * addTreeModelListener
+ * @param listener TODO
+ */
+ public abstract void addTreeModelListener(TreeModelListener listener);
+
+ /**
+ * removeTreeModelListener
+ * @param listener TODO
+ */
+ public abstract void removeTreeModelListener(TreeModelListener listener);
+
+
+} // TreeModel
diff --git a/libjava/javax/swing/tree/TreeNode.java b/libjava/javax/swing/tree/TreeNode.java
new file mode 100644
index 00000000000..46464d2d73e
--- /dev/null
+++ b/libjava/javax/swing/tree/TreeNode.java
@@ -0,0 +1,99 @@
+/* TreeNode.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+// Imports
+import java.util.*;
+
+/**
+ * TreeNode interface
+ * @author Andrew Selkirk
+ */
+public interface TreeNode {
+
+ //-------------------------------------------------------------
+ // Methods ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * getParent
+ * @returns TreeNode
+ */
+ public TreeNode getParent();
+
+ /**
+ * getIndex
+ * @param node TODO
+ * @returns int
+ */
+ public int getIndex(TreeNode node);
+
+ /**
+ * getChildAt
+ * @param index TODO
+ * @returns TreeNode
+ */
+ public TreeNode getChildAt(int index);
+
+ /**
+ * getChildCount
+ * @returns int
+ */
+ public int getChildCount();
+
+ /**
+ * getAllowsChildren
+ * @returns boolean
+ */
+ public abstract boolean getAllowsChildren();
+
+ /**
+ * isLeaf
+ * @returns boolean
+ */
+ public boolean isLeaf();
+
+ /**
+ * children
+ * @returns Enumeration
+ */
+ public Enumeration children();
+
+
+} // TreeNode
+
diff --git a/libjava/javax/swing/tree/TreePath.java b/libjava/javax/swing/tree/TreePath.java
new file mode 100644
index 00000000000..56899cf9280
--- /dev/null
+++ b/libjava/javax/swing/tree/TreePath.java
@@ -0,0 +1,295 @@
+/* TreePath.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+// Imports
+import java.io.*;
+
+/**
+ * TreePath
+ * @author Andrew Selkirk
+ */
+public class TreePath implements Serializable {
+
+ //-------------------------------------------------------------
+ // Variables --------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * path
+ */
+ private Object[] path = null;
+
+
+ //-------------------------------------------------------------
+ // Initialization ---------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * Constructor TreePath
+ * @param path TODO
+ */
+ public TreePath(Object[] path) {
+
+ // Create Path
+ this.path = new Object[path.length];
+ System.arraycopy(path, 0, this.path, 0, path.length);
+
+ } // TreePath()
+
+ /**
+ * Constructor TreePath
+ * @param element TODO
+ */
+ public TreePath(Object element) {
+
+ // Create Path
+ path = new Object[1];
+ path[0] = element;
+
+ } // TreePath()
+
+ /**
+ * Constructor TreePath
+ * @param path TODO
+ * @param element TODO
+ */
+ protected TreePath(TreePath path, Object element) {
+
+ // Variables
+ Object[] treepath;
+
+ // Get Tree Path
+ treepath = path.getPath();
+
+ // Create Tree Path
+ this.path = new Object[treepath.length + 1];
+ System.arraycopy(treepath, 0, this.path, 0, treepath.length);
+ this.path[treepath.length] = element;
+
+ } // TreePath()
+
+ /**
+ * Constructor TreePath
+ * @param path TODO
+ * @param length TODO
+ */
+ protected TreePath(Object[] path, int length) {
+
+ // Create Path
+ this.path = new Object[length];
+ System.arraycopy(path, 0, this.path, 0, length);
+
+ } // TreePath()
+
+ /**
+ * Constructor TreePath
+ */
+ protected TreePath() {
+ path = new Object[0];
+ } // TreePath()
+
+
+ //-------------------------------------------------------------
+ // Methods ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * hashCode
+ * @returns int
+ */
+ public int hashCode() {
+ return getLastPathComponent().hashCode();
+ } // hashCode()
+
+ /**
+ * equals
+ * @param object TODO
+ * @returns boolean
+ */
+ public boolean equals(Object object) {
+
+ // Variables
+ Object[] treepath;
+ int index;
+
+ // Check for TreePath
+ if (object instanceof TreePath) {
+
+ // Get Path Elements
+ treepath = ((TreePath) object).getPath();
+
+ // Check length
+ if (treepath.length != path.length) {
+ return false;
+ } // if
+
+ // Check Elements
+ for (index = 0; index < path.length; index++) {
+ if (treepath[index] != path[index]) {
+ return false;
+ } // if
+ } // for
+
+ // Tree Path's are equals
+ return true;
+
+ } // if
+
+ // Unequal
+ return false;
+
+ } // equals()
+
+ /**
+ * toString
+ * @returns String
+ */
+ public String toString() {
+ return null; // TODO
+ } // toString()
+
+ /**
+ * writeObject
+ * @param value0 TODO
+ * @exception IOException TODO
+ */
+ private void writeObject(ObjectOutputStream value0) throws IOException {
+ // TODO
+ } // writeObject()
+
+ /**
+ * readObject
+ * @param value0 TODO
+ * @exception IOException TODO
+ * @exception ClassNotFoundException TODO
+ */
+ private void readObject(ObjectInputStream value0) throws IOException, ClassNotFoundException {
+ // TODO
+ } // readObject()
+
+ /**
+ * getPath
+ * @returns Object[]
+ */
+ public Object[] getPath() {
+ return path;
+ } // getPath()
+
+ /**
+ * getLastPathComponent
+ * @returns Object
+ */
+ public Object getLastPathComponent() {
+ return path[path.length - 1];
+ } // getLastPathComponent()
+
+ /**
+ * getPathCount
+ * @returns int
+ */
+ public int getPathCount() {
+ return path.length;
+ } // getPathCount()
+
+ /**
+ * getPathComponent
+ * @param position TODO
+ * @returns Object
+ */
+ public Object getPathComponent(int position) {
+ return path[position];
+ } // getPathComponent()
+
+ /**
+ * isDescendant
+ * @param path TODO
+ * @returns boolean
+ */
+ public boolean isDescendant(TreePath path) {
+
+ // Variables
+ Object[] treepath;
+ int index;
+ int index2;
+
+ // Get Descendant path
+ treepath = path.getPath();
+
+ // Locate Start Index
+ index = 0;
+ index2 = 0;
+ while (treepath[index] != this.path[index2]) {
+ index++;
+ } // while
+
+ // Verify Paths
+ while (treepath[index] == this.path[index2]) {
+ index++;
+ index2++;
+ } // while
+
+ // Check for descendant
+ if (index2 != this.path.length) {
+ return false;
+ } // if
+
+ // Is Descendant
+ return true;
+
+ } // isDescendant()
+
+ /**
+ * pathByAddingChild
+ * @param element TODO
+ * @returns TreePath
+ */
+ public TreePath pathByAddingChild(Object element) {
+ return new TreePath(this, element);
+ } // pathByAddingChild()
+
+ /**
+ * getParentPath
+ * @returns TreePath
+ */
+ public TreePath getParentPath() {
+ return new TreePath(this.getPath(), path.length - 1);
+ } // getParentPath()
+
+
+} // TreePath
diff --git a/libjava/javax/swing/tree/TreeSelectionModel.java b/libjava/javax/swing/tree/TreeSelectionModel.java
new file mode 100644
index 00000000000..ef8e0b44772
--- /dev/null
+++ b/libjava/javax/swing/tree/TreeSelectionModel.java
@@ -0,0 +1,83 @@
+/* TreeSelectionModel.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+// Imports
+import java.beans.PropertyChangeListener;
+import javax.swing.event.TreeSelectionListener;
+
+/**
+ * TreeSelectionModel interface
+ * @author Andrew Selkirk
+ */
+public interface TreeSelectionModel {
+
+ public static final int SINGLE_TREE_SELECTION = 1;
+ public static final int CONTIGUOUS_TREE_SELECTION = 2;
+ public static final int DISCONTIGUOUS_TREE_SELECTION = 4;
+
+ public void setSelectionMode(int mode);
+ public int getSelectionMode();
+ public void setSelectionPath(TreePath path);
+ public void setSelectionPaths(TreePath[] paths);
+ public void addSelectionPath(TreePath path);
+ public void addSelectionPaths(TreePath[] paths);
+ public void removeSelectionPath(TreePath path);
+ public void removeSelectionPaths(TreePath[] paths);
+ public TreePath getSelectionPath();
+ public TreePath[] getSelectionPaths();
+ public int getSelectionCount();
+ public boolean isPathSelected(TreePath path);
+ public boolean isSelectionEmpty();
+ public void clearSelection();
+ public void setRowMapper(RowMapper newMapper);
+ public RowMapper getRowMapper();
+ public int[] getSelectionRows();
+ public int getMinSelectionRow();
+ public int getMaxSelectionRow();
+ public boolean isRowSelected(int row);
+ public void resetRowSelection();
+ public int getLeadSelectionRow();
+ public TreePath getLeadSelectionPath();
+ public void addPropertyChangeListener(PropertyChangeListener listener);
+ public void removePropertyChangeListener(PropertyChangeListener listener);
+ public void addTreeSelectionListener(TreeSelectionListener x);
+ public void removeTreeSelectionListener(TreeSelectionListener x);
+
+
+} // TreeSelectionModel
diff --git a/libjava/javax/swing/tree/VariableHeightLayoutCache.java b/libjava/javax/swing/tree/VariableHeightLayoutCache.java
new file mode 100644
index 00000000000..8e9015399a6
--- /dev/null
+++ b/libjava/javax/swing/tree/VariableHeightLayoutCache.java
@@ -0,0 +1,260 @@
+/* VariableHeightLayoutCache.java --
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.tree;
+
+// Imports
+import java.awt.*;
+import java.util.*;
+import javax.swing.event.*;
+
+/**
+ * VariableHeightLayoutCache
+ * @author Andrew Selkirk
+ */
+public class VariableHeightLayoutCache extends AbstractLayoutCache {
+
+ //-------------------------------------------------------------
+ // Variables --------------------------------------------------
+ //-------------------------------------------------------------
+
+
+ //-------------------------------------------------------------
+ // Initialization ---------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * Constructor VariableHeightLayoutCache
+ */
+ public VariableHeightLayoutCache() {
+ // TODO
+ } // VariableHeightLayoutCache()
+
+
+ //-------------------------------------------------------------
+ // Methods ----------------------------------------------------
+ //-------------------------------------------------------------
+
+ /**
+ * setModel
+ * @param value0 TODO
+ */
+ public void setModel(TreeModel value0) {
+ // TODO
+ } // setModel()
+
+ /**
+ * setRootVisible
+ * @param value0 TODO
+ */
+ public void setRootVisible(boolean value0) {
+ // TODO
+ } // setRootVisible()
+
+ /**
+ * setRowHeight
+ * @param value0 TODO
+ */
+ public void setRowHeight(int value0) {
+ // TODO
+ } // setRowHeight()
+
+ /**
+ * setNodeDimensions
+ * @param value0 TODO
+ */
+ public void setNodeDimensions(NodeDimensions value0) {
+ // TODO
+ } // setNodeDimensions()
+
+ /**
+ * setExpandedState
+ * @param value0 TODO
+ * @param value1 TODO
+ */
+ public void setExpandedState(TreePath value0, boolean value1) {
+ // TODO
+ } // setExpandedState()
+
+ /**
+ * getExpandedState
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean getExpandedState(TreePath value0) {
+ return false; // TODO
+ } // getExpandedState()
+
+ /**
+ * getBounds
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns Rectangle
+ */
+ public Rectangle getBounds(TreePath value0, Rectangle value1) {
+ return null; // TODO
+ } // getBounds()
+
+ /**
+ * getPathForRow
+ * @param value0 TODO
+ * @returns TreePath
+ */
+ public TreePath getPathForRow(int value0) {
+ return null; // TODO
+ } // getPathForRow()
+
+ /**
+ * getRowForPath
+ * @param value0 TODO
+ * @returns int
+ */
+ public int getRowForPath(TreePath value0) {
+ return 0; // TODO
+ } // getRowForPath()
+
+ /**
+ * getRowCount
+ * @returns int
+ */
+ public int getRowCount() {
+ return 0; // TODO
+ } // getRowCount()
+
+ /**
+ * invalidatePathBounds
+ * @param value0 TODO
+ */
+ public void invalidatePathBounds(TreePath value0) {
+ // TODO
+ } // invalidatePathBounds()
+
+ /**
+ * getPreferredHeight
+ * @returns int
+ */
+ public int getPreferredHeight() {
+ return 0; // TODO
+ } // getPreferredHeight()
+
+ /**
+ * getPreferredWidth
+ * @param value0 TODO
+ * @returns int
+ */
+ public int getPreferredWidth(Rectangle value0) {
+ return 0; // TODO
+ } // getPreferredWidth()
+
+ /**
+ * getPathClosestTo
+ * @param value0 TODO
+ * @param value1 TODO
+ * @returns TreePath
+ */
+ public TreePath getPathClosestTo(int value0, int value1) {
+ return null; // TODO
+ } // getPathClosestTo()
+
+ /**
+ * getVisiblePathsFrom
+ * @param value0 TODO
+ * @returns Enumeration
+ */
+ public Enumeration getVisiblePathsFrom(TreePath value0) {
+ return null; // TODO
+ } // getVisiblePathsFrom()
+
+ /**
+ * getVisibleChildCount
+ * @param value0 TODO
+ * @returns int
+ */
+ public int getVisibleChildCount(TreePath value0) {
+ return 0; // TODO
+ } // getVisibleChildCount()
+
+ /**
+ * invalidateSizes
+ */
+ public void invalidateSizes() {
+ // TODO
+ } // invalidateSizes()
+
+ /**
+ * isExpanded
+ * @param value0 TODO
+ * @returns boolean
+ */
+ public boolean isExpanded(TreePath value0) {
+ return false; // TODO
+ } // isExpanded()
+
+ /**
+ * treeNodesChanged
+ * @param value0 TODO
+ */
+ public void treeNodesChanged(TreeModelEvent value0) {
+ // TODO
+ } // treeNodesChanged()
+
+ /**
+ * treeNodesInserted
+ * @param value0 TODO
+ */
+ public void treeNodesInserted(TreeModelEvent value0) {
+ // TODO
+ } // treeNodesInserted()
+
+ /**
+ * treeNodesRemoved
+ * @param value0 TODO
+ */
+ public void treeNodesRemoved(TreeModelEvent value0) {
+ // TODO
+ } // treeNodesRemoved()
+
+ /**
+ * treeStructureChanged
+ * @param value0 TODO
+ */
+ public void treeStructureChanged(TreeModelEvent value0) {
+ // TODO
+ } // treeStructureChanged()
+
+
+} // VariableHeightLayoutCache
OpenPOWER on IntegriCloud