diff options
author | Tom Tromey <tromey@redhat.com> | 2005-07-16 01:27:14 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2005-07-16 01:27:14 +0000 |
commit | b0fa81eea9a270f23d6ad67ca7a6d25c18d20da1 (patch) | |
tree | 8762d1f992e2f725a6bde1ff966ed6f1e5f4f823 /libjava/javax/swing/tree | |
parent | ea54b29342c8506acb4f858c68340c44b72e3532 (diff) | |
download | gcc-b0fa81eea9a270f23d6ad67ca7a6d25c18d20da1.zip gcc-b0fa81eea9a270f23d6ad67ca7a6d25c18d20da1.tar.gz gcc-b0fa81eea9a270f23d6ad67ca7a6d25c18d20da1.tar.bz2 |
Major merge with Classpath.
Removed many duplicate files.
* HACKING: Updated.x
* classpath: Imported new directory.
* standard.omit: New file.
* Makefile.in, aclocal.m4, configure: Rebuilt.
* sources.am: New file.
* configure.ac: Run Classpath configure script. Moved code around
to support. Disable xlib AWT peers (temporarily).
* Makefile.am (SUBDIRS): Added 'classpath'
(JAVAC): Removed.
(AM_CPPFLAGS): Added more -I options.
(BOOTCLASSPATH): Simplified.
Completely redid how sources are built.
Include sources.am.
* include/Makefile.am (tool_include__HEADERS): Removed jni.h.
* include/jni.h: Removed (in Classpath).
* scripts/classes.pl: Updated to look at built classes.
* scripts/makemake.tcl: New file.
* testsuite/libjava.jni/jni.exp (gcj_jni_compile_c_to_so): Added
-I options.
(gcj_jni_invocation_compile_c_to_binary): Likewise.
From-SVN: r102082
Diffstat (limited to 'libjava/javax/swing/tree')
17 files changed, 0 insertions, 4931 deletions
diff --git a/libjava/javax/swing/tree/AbstractLayoutCache.java b/libjava/javax/swing/tree/AbstractLayoutCache.java deleted file mode 100644 index 6b66c0b..0000000 --- a/libjava/javax/swing/tree/AbstractLayoutCache.java +++ /dev/null @@ -1,405 +0,0 @@ -/* AbstractLayoutCache.java -- - Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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; - -import java.awt.Rectangle; -import java.util.Enumeration; - -import javax.swing.event.TreeModelEvent; - -/** - * class AbstractLayoutCache - * - * @author Andrew Selkirk - */ -public abstract class AbstractLayoutCache implements RowMapper -{ - /** - * class NodeDimensions - */ - public abstract static class NodeDimensions - { - /** - * Creates <code>NodeDimensions</code> object. - */ - public NodeDimensions() - { - // Do nothing here. - } - - /** - * getNodeDimensions - * - * @param value0 TODO - * @param value1 TODO - * @param value2 TODO - * @param value3 TODO - * @param value4 TODO - * @return Rectangle - */ - public abstract Rectangle getNodeDimensions(Object value0, int value1, - int value2, boolean value3, - Rectangle value4); - } - - /** - * nodeDimensions - */ - protected NodeDimensions nodeDimensions; - - /** - * treeModel - */ - protected TreeModel treeModel; - - /** - * treeSelectionModel - */ - protected TreeSelectionModel treeSelectionModel; - - /** - * rootVisible - */ - protected boolean rootVisible; - - /** - * rowHeight - */ - protected int rowHeight; - - /** - * Constructor AbstractLayoutCache - */ - public AbstractLayoutCache() - { - // Do nothing here. - } - - /** - * setNodeDimensions - * - * @param dimensions TODO - */ - public void setNodeDimensions(NodeDimensions dimensions) - { - nodeDimensions = dimensions; - } - - /** - * getNodeDimensions - * - * @return NodeDimensions - */ - public NodeDimensions getNodeDimensions() - { - return nodeDimensions; - } - - /** - * getNodeDimensions - * - * @param value0 TODO - * @param value1 TODO - * @param value2 TODO - * @param value3 TODO - * @param value4 TODO - * - * @return Rectangle - */ - protected Rectangle getNodeDimensions(Object value0, int value1, int value2, boolean value3, Rectangle value4) - { - return null; // TODO - } - - /** - * Sets the model that provides the tree data. - * - * @param the model - */ - public void setModel(TreeModel model) - { - treeModel = model; - } - - /** - * Returns the model that provides the tree data. - * - * @return the model - */ - public TreeModel getModel() - { - return treeModel; - } - - /** - * setRootVisible - * - * @param visible <code>true</code> if root should be visible, - * <code>false</code> otherwise - */ - public void setRootVisible(boolean visible) - { - rootVisible = visible; - } - - /** - * isRootVisible - * - * @return <code>true</code> if root is visible, - * <code>false</code> otherwise - */ - public boolean isRootVisible() - { - return rootVisible; - } - - /** - * setRowHeight - * - * @param height the row height - */ - public void setRowHeight(int height) - { - rowHeight = height; - } - - /** - * getRowHeight - * - * @return the row height - */ - public int getRowHeight() - { - return rowHeight; - } - - /** - * setSelectionModel - * - * @param model the model - */ - public void setSelectionModel(TreeSelectionModel model) - { - treeSelectionModel = model; - } - - /** - * getSelectionModel - * - * @return the model - */ - public TreeSelectionModel getSelectionModel() - { - return treeSelectionModel; - } - - /** - * getPreferredHeight - * - * @return int - */ - public int getPreferredHeight() - { - return 0; // TODO - } - - /** - * getPreferredWidth - * - * @param value0 TODO - * - * @return int - */ - public int getPreferredWidth(Rectangle value0) - { - return 0; // TODO - } - - /** - * isExpanded - * - * @param value0 TODO - * - * @return boolean - */ - public abstract boolean isExpanded(TreePath value0); - - /** - * getBounds - * - * @param value0 TODO - * @param value1 TODO - * - * @return Rectangle - */ - public abstract Rectangle getBounds(TreePath value0, Rectangle value1); - - /** - * getPathForRow - * - * @param row the row - * - * @return the tree path - */ - public abstract TreePath getPathForRow(int row); - - /** - * getRowForPath - * - * @param path the tree path - * - * @return the row - */ - public abstract int getRowForPath(TreePath path); - - /** - * getPathClosestTo - * - * @param value0 TODO - * @param value1 TODO - * - * @return the tree path - */ - public abstract TreePath getPathClosestTo(int value0, int value1); - - /** - * getVisiblePathsFrom - * - * @param path the tree path - * - * @return Enumeration - */ - public abstract Enumeration getVisiblePathsFrom(TreePath path); - - /** - * getVisibleChildCount - * - * @param path the tree path - * - * @return int - */ - public abstract int getVisibleChildCount(TreePath value0); - - /** - * setExpandedState - * - * @param value0 TODO - * - * @param value1 TODO - */ - public abstract void setExpandedState(TreePath value0, boolean value1); - - /** - * getExpandedState - * - * @param path the tree path - * - * @return boolean - */ - public abstract boolean getExpandedState(TreePath path); - - /** - * getRowCount - * - * @return the number of rows - */ - public abstract int getRowCount(); - - /** - * invalidateSizes - */ - public abstract void invalidateSizes(); - - /** - * invalidatePathBounds - * - * @param path the tree path - */ - public abstract void invalidatePathBounds(TreePath path); - - /** - * treeNodesChanged - * - * @param event the event to send - */ - public abstract void treeNodesChanged(TreeModelEvent event); - - /** - * treeNodesInserted - * - * @param event the event to send - */ - public abstract void treeNodesInserted(TreeModelEvent event); - - /** - * treeNodesRemoved - * - * @param event the event to send - */ - public abstract void treeNodesRemoved(TreeModelEvent event); - - /** - * treeStructureChanged - * - * @param event the event to send - */ - public abstract void treeStructureChanged(TreeModelEvent event); - - /** - * getRowsForPaths - * - * @param paths the tree paths - * - * @return an array of rows - */ - public int[] getRowsForPaths(TreePath[] paths) - { - return null; // TODO - } - - /** - * isFixedRowHeight - * - * @return boolean - */ - protected boolean isFixedRowHeight() - { - return false; // TODO - } -} diff --git a/libjava/javax/swing/tree/DefaultMutableTreeNode.java b/libjava/javax/swing/tree/DefaultMutableTreeNode.java deleted file mode 100644 index ed86cb3..0000000 --- a/libjava/javax/swing/tree/DefaultMutableTreeNode.java +++ /dev/null @@ -1,954 +0,0 @@ -/* DefaultMutableTreeNode.java -- - Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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; - -import gnu.java.util.EmptyEnumeration; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.Stack; -import java.util.Vector; - -/** - * DefaultMutableTreeNode - * - * @author Andrew Selkirk - */ -public class DefaultMutableTreeNode - implements Cloneable, MutableTreeNode, Serializable -{ - private static final long serialVersionUID = -4298474751201349152L; - - /** - * EMPTY_ENUMERATION - */ - public static final Enumeration EMPTY_ENUMERATION = - EmptyEnumeration.getInstance(); - - /** - * parent - */ - protected MutableTreeNode parent; - - /** - * children - */ - protected Vector children = new Vector(); - - /** - * userObject - */ - protected transient Object userObject; - - /** - * allowsChildren - */ - protected boolean allowsChildren; - - /** - * Creates a <code>DefaultMutableTreeNode</code> object. - * This node allows to add child nodes. - */ - public DefaultMutableTreeNode() - { - this(null, true); - } - - /** - * Creates a <code>DefaultMutableTreeNode</code> object with the given - * user object attached to it. This node allows to add child nodes. - * - * @param userObject the user object - */ - public DefaultMutableTreeNode(Object userObject) - { - this(userObject, true); - } - - /** - * Creates a <code>DefaultMutableTreeNode</code> object with the given - * user object attached to it. - * - * @param userObject the user object - * @param allowsChildren <code>true</code> if the code allows to add child - * nodes, <code>false</code> otherwise - */ - public DefaultMutableTreeNode(Object userObject, boolean allowsChildren) - { - this.userObject = userObject; - this.allowsChildren = allowsChildren; - } - - /** - * clone - * - * @return Object - */ - public Object clone() - { - try - { - return super.clone(); - // TODO: Do we need to do more here ? - } - catch (CloneNotSupportedException e) - { - // This never happens. - return null; - } - } - - /** - * Returns a string representation of this node - * - * @return a human-readable String representing this node - */ - public String toString() - { - if (userObject == null) - return null; - - return userObject.toString(); - } - - /** - * Adds a new child node to this node. - * - * @param child the child node - * - * @throws IllegalArgumentException if <code>child</code> is null - * @throws IllegalStateException if the node does not allow children - */ - public void add(MutableTreeNode child) - { - if (child == null) - throw new IllegalArgumentException(); - - if (! allowsChildren) - throw new IllegalStateException(); - - children.add(child); - child.setParent(this); - } - - /** - * Returns the parent node of this node. - * - * @return the parent node - */ - public TreeNode getParent() - { - return parent; - } - - /** - * Removes the child with the given index from this node - * - * @param index the index - */ - public void remove(int index) - { - children.remove(index); - } - - /** - * Removes the given child from this node. - * - * @param node the child node - */ - public void remove(MutableTreeNode node) - { - children.remove(node); - } - - /** - * writeObject - * - * @param stream the output stream - * - * @exception IOException If an error occurs - */ - private void writeObject(ObjectOutputStream stream) - throws IOException - { - // TODO: Implement me. - } - - /** - * readObject - * - * @param stream the input stream - * - * @exception IOException If an error occurs - * @exception ClassNotFoundException TODO - */ - private void readObject(ObjectInputStream stream) - throws IOException, ClassNotFoundException - { - // TODO: Implement me. - } - - /** - * Inserts given child node at the given index. - * - * @param node the child node - * @param value the index. - */ - public void insert(MutableTreeNode node, int index) - { - children.insertElementAt(node, index); - } - - /** - * Returns a path to this node from the root. - * - * @return an array of tree nodes - */ - public TreeNode[] getPath() - { - return getPathToRoot(this, 0); - } - - /** - * Returns an enumeration containing all children of this node. - * <code>EMPTY_ENUMERATION</code> is returned if this node has no children. - * - * @return an enumeration of tree nodes - */ - public Enumeration children() - { - if (children.size() == 0) - return EMPTY_ENUMERATION; - - return children.elements(); - } - - /** - * Set the parent node for this node. - * - * @param node the parent node - */ - public void setParent(MutableTreeNode node) - { - parent = node; - } - - /** - * Returns the child node at a given index. - * - * @param index the index - * - * @return the child node - */ - public TreeNode getChildAt(int index) - { - return (TreeNode) children.elementAt(index); - } - - /** - * Returns the number of children of this node. - * - * @return the number of children - */ - public int getChildCount() - { - return children.size(); - } - - /** - * Returns the child index for a given node. - * - * @param node this node - * - * @return the index - */ - public int getIndex(TreeNode node) - { - return children.indexOf(node); - } - - /** - * setAllowsChildren - * - * @param allowsChildren TODO - */ - public void setAllowsChildren(boolean allowsChildren) - { - this.allowsChildren = allowsChildren; - } - - /** - * getAllowsChildren - * - * @return boolean - */ - public boolean getAllowsChildren() - { - return allowsChildren; - } - - /** - * Sets the user object for this node - * - * @param userObject the user object - */ - public void setUserObject(Object userObject) - { - this.userObject = userObject; - } - - /** - * Returns the user object attached to this node. <code>null</code> is - * returned when no user object is set. - * - * @return the user object - */ - public Object getUserObject() - { - return userObject; - } - - /** - * Removes this node from its parent. - */ - public void removeFromParent() - { - // FIXME: IS this implementation really correct ? - parent = null; - } - - /** - * Removes all child nodes from this node. - */ - public void removeAllChildren() - { - children.removeAllElements(); - } - - /** - * isNodeAncestor - * - * @param node TODO - * - * @return boolean - */ - public boolean isNodeAncestor(TreeNode node) - { - if (node == null) - return false; - - TreeNode current = this; - - while (current != null - && current != node) - current = current.getParent(); - - return current == node; - } - - /** - * isNodeDescendant - * - * @param node0 TODO - * - * @return boolean - */ - public boolean isNodeDescendant(DefaultMutableTreeNode node) - { - if (node == null) - return false; - - TreeNode current = node; - - while (current != null - && current != this) - current = current.getParent(); - - return current == this; - } - - /** - * getSharedAncestor - * - * @param node TODO - * - * @return TreeNode - */ - public TreeNode getSharedAncestor(DefaultMutableTreeNode node) - { - TreeNode current = this; - ArrayList list = new ArrayList(); - - while (current != null) - { - list.add(current); - current = current.getParent(); - } - - current = node; - - while (current != null) - { - if (list.contains(current)) - return current; - - current = current.getParent(); - } - - return null; - } - - /** - * isNodeRelated - * - * @param node TODO - * - * @return boolean - */ - public boolean isNodeRelated(DefaultMutableTreeNode node) - { - if (node == null) - return false; - - return node.getRoot() == getRoot(); - } - - /** - * getDepth - * - * @return int - */ - public int getDepth() - { - if ((! allowsChildren) - || children.size() == 0) - return 0; - - Stack stack = new Stack(); - stack.push(new Integer(0)); - TreeNode node = getChildAt(0); - int depth = 0; - int current = 1; - - while (! stack.empty()) - { - if (node.getChildCount() != 0) - { - node = node.getChildAt(0); - stack.push(new Integer(0)); - current++; - } - else - { - if (current > depth) - depth = current; - - int size; - int index; - - do - { - node = node.getParent(); - size = node.getChildCount(); - index = ((Integer) stack.pop()).intValue() + 1; - current--; - } - while (index >= size - && node != this); - - if (index < size) - { - node = node.getChildAt(index); - stack.push(new Integer(index)); - current++; - } - } - } - - return depth; - } - - /** - * getLevel - * - * @return int - */ - public int getLevel() - { - int count = -1; - TreeNode current = this; - - do - { - current = current.getParent(); - count++; - } - while (current != null); - - return count; - } - - /** - * getPathToRoot - * - * @param node TODO - * @param depth TODO - * - * @return TreeNode[] - */ - protected TreeNode[] getPathToRoot(TreeNode node, int depth) - { - if (node == null) - { - if (depth == 0) - return null; - - return new TreeNode[depth]; - } - - TreeNode[] path = getPathToRoot(node.getParent(), depth + 1); - path[path.length - depth - 1] = node; - return path; - } - - /** - * getUserObjectPath - * - * @return Object[] - */ - public Object[] getUserObjectPath() - { - TreeNode[] path = getPathToRoot(this, 0); - Object[] object = new Object[path.length]; - - for (int index = 0; index < path.length; ++index) - object[index] = ((DefaultMutableTreeNode) path[index]).getUserObject(); - - return object; - } - - /** - * Returns the root node by iterating the parents of this node. - * - * @return the root node - */ - public TreeNode getRoot() - { - TreeNode current = this; - TreeNode check = current.getParent(); - - while (check != null) - { - current = check; - check = current.getParent(); - } - - return current; - } - - /** - * Tells whether this node is the root node or not. - * - * @return <code>true</code> if this is the root node, - * <code>false</code>otherwise - */ - public boolean isRoot() - { - return parent == null; - } - - /** - * getNextNode - * - * @return DefaultMutableTreeNode - */ - public DefaultMutableTreeNode getNextNode() - { - // Return first child. - if (getChildCount() != 0) - return (DefaultMutableTreeNode) getChildAt(0); - - // Return next sibling (if needed the sibling of some parent). - DefaultMutableTreeNode node = this; - DefaultMutableTreeNode sibling; - - do - { - sibling = node.getNextSibling(); - node = (DefaultMutableTreeNode) node.getParent(); - } - while (sibling == null && - node != null); - - // Return sibling. - return sibling; - } - - /** - * getPreviousNode - * - * @return DefaultMutableTreeNode - */ - public DefaultMutableTreeNode getPreviousNode() - { - // Return null if no parent. - if (parent == null) - return null; - - DefaultMutableTreeNode sibling = getPreviousSibling(); - - // Return parent if no sibling. - if (sibling == null) - return (DefaultMutableTreeNode) parent; - - // Return last leaf of sibling. - if (sibling.getChildCount() != 0) - return sibling.getLastLeaf(); - - // Return sibling. - return sibling; - } - - /** - * preorderEnumeration - * - * @return Enumeration - */ - public Enumeration preorderEnumeration() - { - return null; // TODO: Implement me. - } - - /** - * postorderEnumeration - * - * @return Enumeration - */ - public Enumeration postorderEnumeration() - { - return null; // TODO: Implement me. - } - - /** - * breadthFirstEnumeration - * - * @return Enumeration - */ - public Enumeration breadthFirstEnumeration() - { - return null; // TODO: Implement me. - } - - /** - * depthFirstEnumeration - * - * @return Enumeration - */ - public Enumeration depthFirstEnumeration() - { - return postorderEnumeration(); - } - - /** - * pathFromAncestorEnumeration - * - * @param node TODO - * - * @return Enumeration - */ - public Enumeration pathFromAncestorEnumeration(TreeNode node) - { - if (node == null) - throw new IllegalArgumentException(); - - TreeNode parent = this; - Vector nodes = new Vector(); - nodes.add(this); - - while (parent != node && parent != null) - { - parent = parent.getParent(); - nodes.add(0, parent); - } - - if (parent != node) - throw new IllegalArgumentException(); - - return nodes.elements(); - } - - /** - * isNodeChild - * - * @param node TODO - * - * @return boolean - */ - public boolean isNodeChild(TreeNode node) - { - if (node == null) - return false; - - return node.getParent() == this; - } - - /** - * getFirstChild - * - * @return TreeNode - */ - public TreeNode getFirstChild() - { - return (TreeNode) children.firstElement(); - } - - /** - * getLastChild - * - * @return TreeNode - */ - public TreeNode getLastChild() - { - return (TreeNode) children.lastElement(); - } - - /** - * getChildAfter - * - * @param node TODO - * - * @return TreeNode - */ - public TreeNode getChildAfter(TreeNode node) - { - if (node == null - || node.getParent() != this) - throw new IllegalArgumentException(); - - int index = getIndex(node) + 1; - - if (index == getChildCount()) - return null; - - return getChildAt(index); - } - - /** - * getChildBefore - * - * @param node TODO - * - * @return TreeNode - */ - public TreeNode getChildBefore(TreeNode node) - { - if (node == null - || node.getParent() != this) - throw new IllegalArgumentException(); - - int index = getIndex(node) - 1; - - if (index < 0) - return null; - - return getChildAt(index); - } - - /** - * isNodeSibling - * - * @param node TODO - * - * @return boolean - */ - public boolean isNodeSibling(TreeNode node) - { - if (node == null) - return false; - - return (node.getParent() == getParent() - && getParent() != null); - } - - /** - * getSiblingCount - * - * @return int - */ - public int getSiblingCount() - { - if (parent == null) - return 1; - - return parent.getChildCount(); - } - - /** - * getNextSibling - * - * @return DefaultMutableTreeNode - */ - public DefaultMutableTreeNode getNextSibling() - { - if (parent == null) - return null; - - int index = parent.getIndex(this) + 1; - - if (index == parent.getChildCount()) - return null; - - return (DefaultMutableTreeNode) parent.getChildAt(index); - } - - /** - * getPreviousSibling - * - * @return DefaultMutableTreeNode - */ - public DefaultMutableTreeNode getPreviousSibling() - { - if (parent == null) - return null; - - int index = parent.getIndex(this) - 1; - - if (index < 0) - return null; - - return (DefaultMutableTreeNode) parent.getChildAt(index); - } - - /** - * isLeaf - * - * @return boolean - */ - public boolean isLeaf() - { - return children.size() == 0; - } - - /** - * getFirstLeaf - * - * @return DefaultMutableTreeNode - */ - public DefaultMutableTreeNode getFirstLeaf() - { - TreeNode current = this; - - while (current.getChildCount() > 0) - current = current.getChildAt(0); - - return (DefaultMutableTreeNode) current; - } - - /** - * getLastLeaf - * - * @return DefaultMutableTreeNode - */ - public DefaultMutableTreeNode getLastLeaf() - { - TreeNode current = this; - int size = current.getChildCount(); - - while (size > 0) - { - current = current.getChildAt(size - 1); - size = current.getChildCount(); - } - - return (DefaultMutableTreeNode) current; - } - - /** - * getNextLeaf - * - * @return DefaultMutableTreeNode - */ - public DefaultMutableTreeNode getNextLeaf() - { - if (parent == null) - return null; - - return null; - //return parent.getChildAfter(this); - } - - /** - * getPreviousLeaf - * - * @return DefaultMutableTreeNode - */ - public DefaultMutableTreeNode getPreviousLeaf() - { - if (parent == null) - return null; - - return null; - //return parent.getChildBefore(this); - } - - /** - * getLeafCount - * - * @return int - */ - public int getLeafCount() - { - int count = 0; - Enumeration e = depthFirstEnumeration(); - - while (e.hasMoreElements()) - { - TreeNode current = (TreeNode) e.nextElement(); - - if (current.isLeaf()) - count++; - } - - return count; - } -} diff --git a/libjava/javax/swing/tree/DefaultTreeCellEditor.java b/libjava/javax/swing/tree/DefaultTreeCellEditor.java deleted file mode 100644 index e509d2c..0000000 --- a/libjava/javax/swing/tree/DefaultTreeCellEditor.java +++ /dev/null @@ -1,516 +0,0 @@ -/* DefaultTreeCellEditor.java -- - Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.util.EventObject; - -import javax.swing.Icon; -import javax.swing.JTextField; -import javax.swing.JTree; -import javax.swing.border.Border; -import javax.swing.event.CellEditorListener; -import javax.swing.event.EventListenerList; -import javax.swing.event.TreeSelectionEvent; -import javax.swing.event.TreeSelectionListener; - -/** - * DefaultTreeCellEditor - * @author Andrew Selkirk - */ -public class DefaultTreeCellEditor - implements ActionListener, TreeCellEditor, TreeSelectionListener -{ - /** - * EditorContainer - */ - public class EditorContainer extends Container - { - /** - * Creates an <code>EditorContainer</code> object. - */ - public EditorContainer() - { - // Do nothing here. - } - - /** - * This method only exists for API compatibility and is useless as it does - * nothing. It got probably introduced by accident. - */ - public void EditorContainer() - { - // Do nothing here. - } - - /** - * getPreferredSize - * @return Dimension - */ - public Dimension getPreferredSize() - { - return null; // TODO - } - - /** - * paint - * @param value0 TODO - */ - public void paint(Graphics value0) - { - // TODO - } - - /** - * doLayout - */ - public void doLayout() - { - // TODO - } - } - - /** - * DefaultTextField - */ - public class DefaultTextField extends JTextField - { - /** - * border - */ - protected Border border; - - /** - * Creates a <code>DefaultTextField</code> object. - * - * @param border the border to use - */ - public DefaultTextField(Border border) - { - this.border = border; - } - - /** - * getFont - * @return Font - */ - public Font getFont() - { - return null; // TODO - } - - /** - * Returns the border of the text field. - * - * @return the border - */ - public Border getBorder() - { - return border; - } - - /** - * getPreferredSize - * @return Dimension - */ - public Dimension getPreferredSize() - { - return null; // TODO - } - } - - private EventListenerList listenerList = new EventListenerList(); - - /** - * 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; - - /** - * Constructor DefaultTreeCellEditor - * @param value0 TODO - * @param value1 TODO - */ - public DefaultTreeCellEditor(JTree value0, DefaultTreeCellRenderer value1) - { - // TODO - } - - /** - * Constructor DefaultTreeCellEditor - * @param value0 TODO - * @param value1 TODO - * @param value2 TODO - */ - public DefaultTreeCellEditor(JTree value0, DefaultTreeCellRenderer value1, - TreeCellEditor value2) - { - // TODO - } - - /** - * writeObject - * @param value0 TODO - * @exception IOException TODO - */ - private void writeObject(ObjectOutputStream value0) throws IOException - { - // TODO - } - - /** - * readObject - * @param value0 TODO - * @exception IOException TODO - * @exception ClassNotFoundException TODO - */ - private void readObject(ObjectInputStream value0) - throws IOException, ClassNotFoundException - { - // TODO - } - - /** - * setBorderSelectionColor - * @param value0 TODO - */ - public void setBorderSelectionColor(Color value0) - { - // TODO - } - - /** - * getBorderSelectionColor - * @return Color - */ - public Color getBorderSelectionColor() - { - return null; // TODO - } - - /** - * setFont - * @param value0 TODO - */ - public void setFont(Font value0) - { - // TODO - } - - /** - * getFont - * @return Font - */ - public Font getFont() - { - return null; // TODO - } - - /** - * getTreeCellEditorComponent - * @param value0 TODO - * @param value1 TODO - * @param value2 TODO - * @param value3 TODO - * @param value4 TODO - * @param value5 TODO - * @return Component - */ - public Component getTreeCellEditorComponent(JTree value0, Object value1, - boolean value2, boolean value3, - boolean value4, int value5) - { - return null; // TODO - } - - /** - * getCellEditorValue - * @return Object - */ - public Object getCellEditorValue() - { - return null; // TODO - } - - /** - * isCellEditable - * @param value0 TODO - * @return boolean - */ - public boolean isCellEditable(EventObject value0) - { - return false; // TODO - } - - /** - * shouldSelectCell - * @param value0 TODO - * @return boolean - */ - public boolean shouldSelectCell(EventObject value0) - { - return false; // TODO - } - - /** - * stopCellEditing - * @return boolean - */ - public boolean stopCellEditing() - { - return false; // TODO - } - - /** - * cancelCellEditing - */ - public void cancelCellEditing() - { - // TODO - } - - /** - * Adds a <code>CellEditorListener</code> object to this editor. - * - * @param listener the listener to add - */ - public void addCellEditorListener(CellEditorListener listener) - { - listenerList.add(CellEditorListener.class, listener); - } - - /** - * Removes a <code>CellEditorListener</code> object. - * - * @param listener the listener to remove - */ - public void removeCellEditorListener(CellEditorListener listener) - { - listenerList.remove(CellEditorListener.class, listener); - } - - /** - * Returns all added <code>CellEditorListener</code> objects to this editor. - * - * @return an array of listeners - * - * @since 1.4 - */ - public CellEditorListener[] getCellEditorListeners() - { - return (CellEditorListener[]) listenerList.getListeners(CellEditorListener.class); - } - - /** - * valueChanged - * @param value0 TODO - */ - public void valueChanged(TreeSelectionEvent value0) - { - // TODO - } - - /** - * actionPerformed - * @param value0 TODO - */ - public void actionPerformed(ActionEvent value0) - { - // TODO - } - - /** - * setTree - * @param value0 TODO - */ - protected void setTree(JTree value0) - { - // TODO - } - - /** - * shouldStartEditingTimer - * @param value0 TODO - * @return boolean - */ - protected boolean shouldStartEditingTimer(EventObject value0) - { - return false; // TODO - } - - /** - * startEditingTimer - */ - protected void startEditingTimer() - { - // TODO - } - - /** - * canEditImmediately - * @param value0 TODO - * @return boolean - */ - protected boolean canEditImmediately(EventObject value0) - { - return false; // TODO - } - - /** - * inHitRegion - * @param value0 TODO - * @param value1 TODO - * @return boolean - */ - protected boolean inHitRegion(int value0, int value1) - { - return false; // TODO - } - - /** - * 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 - } - - /** - * prepareForEditing - */ - protected void prepareForEditing() - { - // TODO - } - - /** - * createContainer - * @return Container - */ - protected Container createContainer() - { - return null; // TODO - } - - /** - * createTreeCellEditor - * @return TreeCellEditor - */ - protected TreeCellEditor createTreeCellEditor() - { - return null; // TODO - } -} diff --git a/libjava/javax/swing/tree/DefaultTreeCellRenderer.java b/libjava/javax/swing/tree/DefaultTreeCellRenderer.java deleted file mode 100644 index 690ad5b..0000000 --- a/libjava/javax/swing/tree/DefaultTreeCellRenderer.java +++ /dev/null @@ -1,497 +0,0 @@ -/* DefaultTreeCellRenderer.java -- - Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.Graphics; -import java.awt.Rectangle; - -import javax.swing.Icon; -import javax.swing.JLabel; -import javax.swing.JTree; -import javax.swing.UIDefaults; -import javax.swing.UIManager; -import javax.swing.plaf.UIResource; - -/** - * 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() { - UIDefaults defaults = UIManager.getLookAndFeelDefaults(); - - setLeafIcon(getDefaultLeafIcon()); - setOpenIcon(getDefaultOpenIcon()); - setClosedIcon(getDefaultClosedIcon()); - - setTextNonSelectionColor(defaults.getColor("Tree.textForeground")); - setTextSelectionColor(defaults.getColor("Tree.selectionForeground")); - setBackgroundNonSelectionColor(defaults.getColor("Tree.textBackground")); - setBackgroundSelectionColor(defaults.getColor("Tree.selectionBackground")); - setBorderSelectionColor(defaults.getColor("Tree.selectionBorderColor")); - } - - - //------------------------------------------------------------- - // Methods ---------------------------------------------------- - //------------------------------------------------------------- - - /** - * getDefaultOpenIcon - * @returns Icon - */ - public Icon getDefaultOpenIcon() { - return UIManager.getLookAndFeelDefaults().getIcon("Tree.openIcon"); - } - - /** - * getDefaultClosedIcon - * @returns Icon - */ - public Icon getDefaultClosedIcon() { - return UIManager.getLookAndFeelDefaults().getIcon("Tree.closedIcon"); - } - - /** - * getDefaultLeafIcon - * @returns Icon - */ - public Icon getDefaultLeafIcon() { - return UIManager.getLookAndFeelDefaults().getIcon("Tree.leafIcon"); - } - - /** - * setOpenIcon - * @param value0 TODO - */ - public void setOpenIcon(Icon i) { - openIcon = i; - } - - /** - * getOpenIcon - * @returns Icon - */ - public Icon getOpenIcon() { - return openIcon; - } - - /** - * setClosedIcon - * @param value0 TODO - */ - public void setClosedIcon(Icon i) { - closedIcon = i; - } - - /** - * getClosedIcon - * @returns Icon - */ - public Icon getClosedIcon() { - return closedIcon; - } - - /** - * setLeafIcon - * @param value0 TODO - */ - public void setLeafIcon(Icon i) { - leafIcon = i; - } - - /** - * getLeafIcon - * @returns Icon - */ - public Icon getLeafIcon() { - return leafIcon; - } - - /** - * setTextSelectionColor - * @param value0 TODO - */ - public void setTextSelectionColor(Color c) { - textSelectionColor = c; - } - - /** - * getTextSelectionColor - * @returns Color - */ - public Color getTextSelectionColor() { - return textSelectionColor; - } - - /** - * setTextNonSelectionColor - * @param value0 TODO - */ - public void setTextNonSelectionColor(Color c) { - textNonSelectionColor = c; - } - - /** - * getTextNonSelectionColor - * @returns Color - */ - public Color getTextNonSelectionColor() { - return textNonSelectionColor; - } - - /** - * setBackgroundSelectionColor - * @param value0 TODO - */ - public void setBackgroundSelectionColor(Color c) { - backgroundSelectionColor = c; - } - - /** - * getBackgroundSelectionColor - * @returns Color - */ - public Color getBackgroundSelectionColor() { - return backgroundSelectionColor; - } - - /** - * setBackgroundNonSelectionColor - * @param value0 TODO - */ - public void setBackgroundNonSelectionColor(Color c) { - backgroundNonSelectionColor = c; - } - - /** - * getBackgroundNonSelectionColor - * @returns Color - */ - public Color getBackgroundNonSelectionColor() { - return backgroundNonSelectionColor; - } - - /** - * setBorderSelectionColor - * @param value0 TODO - */ - public void setBorderSelectionColor(Color c) { - borderSelectionColor = c; - } - - /** - * getBorderSelectionColor - * @returns Color - */ - public Color getBorderSelectionColor() { - return borderSelectionColor; - } - - /** - * setFont - * @param value0 TODO - */ - public void setFont(Font f) { - if (f != null && f instanceof UIResource) - f = null; - super.setFont(f); - } - - /** - * setBackground - * @param value0 TODO - */ - public void setBackground(Color c) { - if (c != null && c instanceof UIResource) - c = null; - super.setBackground(c); - } - - /** - * 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 tree, - Object val, - boolean selected, - boolean expanded, - boolean leaf, - int row, - boolean hasFocus) { - this.selected = selected; - this.hasFocus = hasFocus; - - if (leaf) - setIcon(getLeafIcon()); - else if (expanded) - setIcon(getOpenIcon()); - else - setIcon(getClosedIcon()); - - setText(val.toString()); - setHorizontalAlignment(LEFT); - setVerticalAlignment(TOP); - - return this; - } - - /** - * paint - * @param value0 TODO - */ - public void paint(Graphics g) { - super.paint(g); - } - - /** - * 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 deleted file mode 100644 index 6056d16..0000000 --- a/libjava/javax/swing/tree/DefaultTreeModel.java +++ /dev/null @@ -1,451 +0,0 @@ -/* DefaultTreeModel.java -- - Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.util.EventListener; - -import javax.swing.event.EventListenerList; -import javax.swing.event.TreeModelEvent; -import javax.swing.event.TreeModelListener; - -/** - * DefaultTreeModel - * @author Andrew Selkirk - */ -public class DefaultTreeModel - implements Serializable, TreeModel -{ - static final long serialVersionUID = -2621068368932566998L; - - /** - * root - */ - protected TreeNode root = null; - - /** - * listenerList - */ - protected EventListenerList listenerList = new EventListenerList(); - - /** - * asksAllowsChildren - */ - protected boolean asksAllowsChildren; - - /** - * Constructor DefaultTreeModel - * @param value0 TODO - */ - public DefaultTreeModel(TreeNode root) - { - setRoot(root); - } - - /** - * Constructor DefaultTreeModel - * @param value0 TODO - * @param value1 TODO - */ - public DefaultTreeModel(TreeNode root, boolean asksAllowsChildren) - { - setRoot(root); - this.asksAllowsChildren = asksAllowsChildren; - } - - /** - * writeObject - * @param value0 TODO - * @exception IOException TODO - */ - private void writeObject(ObjectOutputStream value0) throws IOException - { - // TODO - } - - /** - * readObject - * @param value0 TODO - * @exception IOException TODO - * @exception ClassNotFoundException TODO - */ - private void readObject(ObjectInputStream value0) - throws IOException, ClassNotFoundException - { - // TODO - } - - /** - * asksAllowsChildren - * @return boolean - */ - public boolean asksAllowsChildren() - { - return asksAllowsChildren; - } - - /** - * setAsksAllowsChildren - * @param value0 TODO - */ - public void setAsksAllowsChildren(boolean value) - { - asksAllowsChildren = value; // TODO - } - - /** - * setRoot - * @param value0 TODO - */ - public void setRoot(TreeNode root) - { - // Sanity Check - if (root == null) - { - throw new IllegalArgumentException("null root"); - } - // Set new root - this.root = root; - - // TODO - } - - /** - * getRoot - * @return Object - */ - public Object getRoot() - { - return root; - } - - /** - * getIndexOfChild - * @param value0 TODO - * @param value1 TODO - * @return int - */ - public int getIndexOfChild(Object parent, Object child) - { - return 0; // TODO - } - - /** - * getChild - * @param value0 TODO - * @param value1 TODO - * @return Object - */ - public Object getChild(Object node, int idx) - { - if (node instanceof TreeNode) - return ((TreeNode)node).getChildAt(idx); - else - return null; - } - - /** - * getChildCount - * @param value0 TODO - * @return int - */ - public int getChildCount(Object node) - { - if (node instanceof TreeNode) - return ((TreeNode)node).getChildCount(); - else - return 0; - } - - /** - * isLeaf - * @param value0 TODO - * @return boolean - */ - public boolean isLeaf(Object node) - { - if (node instanceof TreeNode) - return ((TreeNode)node).isLeaf(); - else - return true; - } - - /** - * reload - */ - public void reload() - { - // TODO - } - - /** - * reload - * @param value0 TODO - */ - public void reload(TreeNode value0) - { - // TODO - } - - /** - * valueForPathChanged - * @param value0 TODO - * @param value1 TODO - */ - public void valueForPathChanged(TreePath value0, Object value1) - { - // TODO - } - - /** - * insertNodeInto - * @param value0 TODO - * @param value1 TODO - * @param value2 TODO - */ - public void insertNodeInto(MutableTreeNode value0, MutableTreeNode value1, - int value2) - { - // TODO - } - - /** - * removeNodeFromParent - * @param value0 TODO - */ - public void removeNodeFromParent(MutableTreeNode value0) - { - // TODO - } - - /** - * nodeChanged - * @param value0 TODO - */ - public void nodeChanged(TreeNode value0) - { - // TODO - } - - /** - * nodesWereInserted - * @param value0 TODO - * @param value1 TODO - */ - public void nodesWereInserted(TreeNode value0, int[] value1) - { - // TODO - } - - /** - * nodesWereRemoved - * @param value0 TODO - * @param value1 TODO - * @param value2 TODO - */ - public void nodesWereRemoved(TreeNode value0, int[] value1, Object[] value2) - { - // TODO - } - - /** - * nodesChanged - * @param value0 TODO - * @param value1 TODO - */ - public void nodesChanged(TreeNode value0, int[] value1) - { - // TODO - } - - /** - * nodeStructureChanged - * @param value0 TODO - */ - public void nodeStructureChanged(TreeNode value0) - { - // TODO - } - - /** - * getPathToRoot - * @param value0 TODO - * @return TreeNode[] - */ - public TreeNode[] getPathToRoot(TreeNode value0) - { - return null; // TODO - } - - /** - * getPathToRoot - * @param value0 TODO - * @param value1 TODO - * @return TreeNode[] - */ - protected TreeNode[] getPathToRoot(TreeNode value0, int value1) - { - return null; // TODO - } - - /** - * Registers a listere to the model. - * - * @param listener the listener to add - */ - public void addTreeModelListener(TreeModelListener listener) - { - listenerList.add(TreeModelListener.class, listener); - } - - /** - * Removes a listener from the model. - * - * @param listener the listener to remove - */ - public void removeTreeModelListener(TreeModelListener listener) - { - listenerList.remove(TreeModelListener.class, listener); - } - - /** - * Returns all registered <code>TreeModelListener</code> listeners. - * - * @return an array of listeners. - * - * @since 1.4 - */ - public TreeModelListener[] getTreeModelListeners() - { - return (TreeModelListener[]) listenerList.getListeners(TreeModelListener.class); - } - - /** - * fireTreeNodesChanged - * - * @param source the node being changed - * @param path the path to the root node - * @param childIndices the indices of the changed elements - * @param children the changed elements - */ - protected void fireTreeNodesChanged(Object source, Object[] path, - int[] childIndices, Object[] children) - { - TreeModelEvent event = - new TreeModelEvent(source, path, childIndices, children); - TreeModelListener[] listeners = getTreeModelListeners(); - - for (int i = listeners.length - 1; i >= 0; --i) - listeners[i].treeNodesChanged(event); - } - - /** - * fireTreeNodesInserted - * - * @param source the node where new nodes got inserted - * @param path the path to the root node - * @param childIndices the indices of the new elements - * @param children the new elements - */ - protected void fireTreeNodesInserted(Object source, Object[] path, - int[] childIndices, Object[] children) - { - TreeModelEvent event = - new TreeModelEvent(source, path, childIndices, children); - TreeModelListener[] listeners = getTreeModelListeners(); - - for (int i = listeners.length - 1; i >= 0; --i) - listeners[i].treeNodesInserted(event); - } - - /** - * fireTreeNodesRemoved - * - * @param source the node where nodes got removed- - * @param path the path to the root node - * @param childIndices the indices of the removed elements - * @param children the removed elements - */ - protected void fireTreeNodesRemoved(Object source, Object[] path, - int[] childIndices, Object[] children) - { - TreeModelEvent event = - new TreeModelEvent(source, path, childIndices, children); - TreeModelListener[] listeners = getTreeModelListeners(); - - for (int i = listeners.length - 1; i >= 0; --i) - listeners[i].treeNodesRemoved(event); - } - - /** - * fireTreeStructureChanged - * - * @param source the node where the model has changed - * @param path the path to the root node - * @param childIndices the indices of the affected elements - * @param children the affected elements - */ - protected void fireTreeStructureChanged(Object source, Object[] path, - int[] childIndices, Object[] children) - { - TreeModelEvent event = - new TreeModelEvent(source, path, childIndices, children); - TreeModelListener[] listeners = getTreeModelListeners(); - - for (int i = listeners.length - 1; i >= 0; --i) - listeners[i].treeStructureChanged(event); - } - - /** - * Returns the registered listeners of a given type. - * - * @param listenerType the listener type to return - * - * @return an array of listeners - * - * @since 1.3 - */ - public EventListener[] getListeners(Class listenerType) - { - return listenerList.getListeners(listenerType); - } -} diff --git a/libjava/javax/swing/tree/DefaultTreeSelectionModel.java b/libjava/javax/swing/tree/DefaultTreeSelectionModel.java deleted file mode 100644 index 536a6e7..0000000 --- a/libjava/javax/swing/tree/DefaultTreeSelectionModel.java +++ /dev/null @@ -1,646 +0,0 @@ -/* DefaultTreeSelectionModel.java -- - Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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; - -import java.beans.PropertyChangeListener; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.util.EventListener; -import java.util.Vector; - -import javax.swing.DefaultListSelectionModel; -import javax.swing.event.EventListenerList; -import javax.swing.event.SwingPropertyChangeSupport; -import javax.swing.event.TreeSelectionEvent; -import javax.swing.event.TreeSelectionListener; - -/** - * DefaultTreeSelectionModel - * @author Andrew Selkirk - */ -public class DefaultTreeSelectionModel - implements Cloneable, Serializable, TreeSelectionModel -{ - static final long serialVersionUID = 3288129636638950196L; - - /** - * SELECTION_MODE_PROPERTY - */ - public static final String SELECTION_MODE_PROPERTY = "selectionMode"; - - /** - * Our Swing property change support. - */ - protected SwingPropertyChangeSupport changeSupport; - - /** - * The current selection. - */ - protected TreePath[] selection; - - /** - * Our TreeSelectionListeners. - */ - protected EventListenerList listenerList; - - /** - * The current RowMapper. - */ - protected transient RowMapper rowMapper; - - /** - * The current listSelectionModel. - */ - protected DefaultListSelectionModel listSelectionModel; - - /** - * The current selection mode. - */ - protected int selectionMode; - - /** - * The path that has been added last. - */ - protected TreePath leadPath; - - /** - * The index of the last added path. - */ - protected int leadIndex; - - /** - * The row of the last added path according to the RowMapper. - */ - protected int leadRow; - - /** - * Constructs a new DefaultTreeSelectionModel. - */ - public DefaultTreeSelectionModel() - { - setSelectionMode(DISCONTIGUOUS_TREE_SELECTION); - listenerList = new EventListenerList(); - } - - /** - * Creates a clone of this DefaultTreeSelectionModel with the same - * selection. - * - * @exception CloneNotSupportedException should not be thrown here - * - * @return a clone of this DefaultTreeSelectionModel - */ - public Object clone() throws CloneNotSupportedException - { - return null; // TODO - } - - /** - * Returns a string that shows this object's properties. - * - * @return a string that shows this object's properties - */ - public String toString() - { - return null; // TODO - } - - /** - * writeObject - * @param value0 TODO - * @exception IOException TODO - */ - private void writeObject(ObjectOutputStream value0) throws IOException - { - // TODO - } - - /** - * readObject - * @param value0 TODO - * @exception IOException TODO - * @exception ClassNotFoundException TODO - */ - private void readObject(ObjectInputStream value0) - throws IOException, ClassNotFoundException - { - // TODO - } - - /** - * Sets the RowMapper that should be used to map between paths and their - * rows. - * - * @param rowMapper the RowMapper to set - * - * @see {@link RowMapper - */ - public void setRowMapper(RowMapper value0) - { - // TODO - } - - /** - * Returns the RowMapper that is currently used to map between paths and - * their rows. - * - * @return the current RowMapper - * - * @see {@link RowMapper - */ - public RowMapper getRowMapper() - { - return rowMapper; - } - - /** - * Sets the current selection mode. Possible values are - * {@link #SINGLE_TREE_SELECTION}, {@link CONTIGUOUS_TREE_SELECTION} - * and {@link #DISCONTIGUOUS_TREE_SELECTION}. - * - * @param mode the selection mode to be set - * - * @see {@link #getSelectionMode} - * @see {@link #SINGLE_TREE_SELECTION} - * @see {@link #CONTIGUOUS_TREE_SELECTION} - * @see {@link #DISCONTIGUOUS_TREE_SELECTION} - */ - public void setSelectionMode(int mode) - { - selectionMode = mode; - } - - /** - * Returns the current selection mode. - * - * @return the current selection mode - * - * @see {@link #setSelectionMode} - * @see {@link #SINGLE_TREE_SELECTION} - * @see {@link #CONTIGUOUS_TREE_SELECTION} - * @see {@link #DISCONTIGUOUS_TREE_SELECTION} - */ - public int getSelectionMode() - { - return selectionMode; - } - - /** - * Sets this path as the only selection. - * - * If this changes the selection the registered TreeSelectionListeners - * are notified. - * - * @param path the path to set as selection - */ - public void setSelectionPath(TreePath path) - { - selection = new TreePath[] { path }; - } - - /** - * Sets the paths as selection. This method checks for duplicates and - * removes them. - * - * If this changes the selection the registered TreeSelectionListeners - * are notified. - * - * @param paths the paths to set as selection - */ - public void setSelectionPaths(TreePath[] value0) - { - // TODO - } - - /** - * Adds a path to the list of selected paths. This method checks if the - * path is already selected and doesn't add the same path twice. - * - * If this changes the selection the registered TreeSelectionListeners - * are notified. - * - * @param path the path to add to the selection - */ - public void addSelectionPath(TreePath value0) - { - // TODO - } - - /** - * Adds the paths to the list of selected paths. This method checks if the - * paths are already selected and doesn't add the same path twice. - * - * If this changes the selection the registered TreeSelectionListeners - * are notified. - * - * @param paths the paths to add to the selection - */ - public void addSelectionPaths(TreePath[] value0) - { - // TODO - } - - /** - * Removes the path from the selection. - * - * If this changes the selection the registered TreeSelectionListeners - * are notified. - * - * @param path the path to remove - */ - public void removeSelectionPath(TreePath value0) - { - // TODO - } - - /** - * Removes the paths from the selection. - * - * If this changes the selection the registered TreeSelectionListeners - * are notified. - * - * @param paths the path to remove - */ - public void removeSelectionPaths(TreePath[] value0) - { - // TODO - } - - /** - * Returns the first path in the selection. This is especially useful - * when the selectionMode is {@link #SINGLE_TREE_SELECTION}. - * - * @return the first path in the selection - */ - public TreePath getSelectionPath() - { - if ((selection == null) || (selection.length == 0)) - return null; - else - return selection[0]; - } - - /** - * Returns the complete selection. - * - * @return the complete selection - */ - public TreePath[] getSelectionPaths() - { - return selection; - } - - /** - * Returns the number of paths in the selection. - * - * @return the number of paths in the selection - */ - public int getSelectionCount() - { - if (selection == null) - return 0; - else - return selection.length; - } - - /** - * Checks if a given path is in the selection. - * - * @param path the path to check - * - * @return <code>true</code> if the path is in the selection, - * <code>false</code> otherwise - */ - public boolean isPathSelected(TreePath value0) - { - return false; // TODO - } - - /** - * Checks if the selection is empty. - * - * @return <code>true</code> if the selection is empty, - * <code>false</code> otherwise - */ - public boolean isSelectionEmpty() - { - return ((selection == null) || (selection.length == 0)); - } - - /** - * Removes all paths from the selection. - */ - public void clearSelection() - { - // TODO - } - - /** - * Adds a <code>TreeSelectionListener</code> object to this model. - * - * @param listener the listener to add - */ - public void addTreeSelectionListener(TreeSelectionListener listener) - { - listenerList.add(TreeSelectionListener.class, listener); - } - - /** - * Removes a <code>TreeSelectionListener</code> object from this model. - * - * @param listener the listener to remove - */ - public void removeTreeSelectionListener(TreeSelectionListener listener) - { - listenerList.remove(TreeSelectionListener.class, listener); - } - - /** - * Returns all <code>TreeSelectionListener</code> added to this model. - * - * @return an array of listeners - * - * @since 1.4 - */ - public TreeSelectionListener[] getTreeSelectionListeners() - { - return (TreeSelectionListener[]) listenerList.getListeners(TreeSelectionListener.class); - } - - /** - * fireValueChanged - * - * @param event the event to fire. - */ - protected void fireValueChanged(TreeSelectionEvent event) - { - TreeSelectionListener[] listeners = getTreeSelectionListeners(); - - for (int i = listeners.length - 1; i >= 0; --i) - listeners[i].valueChanged(event); - } - - /** - * Returns all added listeners of a special type. - * - * @param listenerType the listener type - * - * @return an array of listeners - * - * @since 1.3 - */ - public EventListener[] getListeners(Class listenerType) - { - return listenerList.getListeners(listenerType); - } - - /** - * Returns the currently selected rows. - * - * @return the currently selected rows - */ - public int[] getSelectionRows() - { - if (rowMapper == null) - return null; - else - return rowMapper.getRowsForPaths(selection); - } - - /** - * Returns the smallest row index from the selection. - * - * @return the smallest row index from the selection - */ - public int getMinSelectionRow() - { - if ((rowMapper == null) || (selection == null) || (selection.length == 0)) - return -1; - else { - int[] rows = rowMapper.getRowsForPaths(selection); - int minRow = Integer.MAX_VALUE; - for (int index = 0; index < rows.length; index++) - minRow = Math.min(minRow, rows[index]); - return minRow; - } - } - - /** - * Returns the largest row index from the selection. - * - * @return the largest row index from the selection - */ - public int getMaxSelectionRow() - { - if ((rowMapper == null) || (selection == null) || (selection.length == 0)) - return -1; - else { - int[] rows = rowMapper.getRowsForPaths(selection); - int maxRow = -1; - for (int index = 0; index < rows.length; index++) - maxRow = Math.max(maxRow, rows[index]); - return maxRow; - } - } - - /** - * Checks if a particular row is selected. - * - * @param row the index of the row to check - * - * @return <code>true</code> if the row is in this selection, - * <code>false</code> otherwise - */ - public boolean isRowSelected(int value0) - { - return false; // TODO - } - - /** - * Updates the mappings from TreePaths to row indices. - */ - public void resetRowSelection() - { - // TODO - } - - /** - * getLeadSelectionRow - * @return int - */ - public int getLeadSelectionRow() - { - if ((rowMapper == null) || (leadPath == null)) - return -1; - else - return rowMapper.getRowsForPaths(new TreePath[]{ leadPath })[0]; - } - - /** - * getLeadSelectionPath - * @return TreePath - */ - public TreePath getLeadSelectionPath() - { - return leadPath; - } - - /** - * Adds a <code>PropertyChangeListener</code> object to this model. - * - * @param listener the listener to add. - */ - public void addPropertyChangeListener(PropertyChangeListener listener) - { - changeSupport.addPropertyChangeListener(listener); - } - - /** - * Removes a <code>PropertyChangeListener</code> object from this model. - * - * @param listener the listener to remove. - */ - public void removePropertyChangeListener(PropertyChangeListener listener) - { - changeSupport.removePropertyChangeListener(listener); - } - - /** - * Returns all added <code>PropertyChangeListener</code> objects. - * - * @return an array of listeners. - * - * @since 1.4 - */ - public PropertyChangeListener[] getPropertyChangeListeners() - { - return changeSupport.getPropertyChangeListeners(); - } - - /** - * Makes sure the currently selected paths are valid according to the - * current selectionMode. - * - * If the selectionMode is set to {@link CONTIGUOUS_TREE_SELECTION} - * and the selection isn't contiguous then the selection is reset to - * the first set of contguous paths. - * - * If the selectionMode is set to {@link SINGLE_TREE_SELECTION} - * and the selection has more than one path, the selection is reset to - * the contain only the first path. - */ - protected void insureRowContinuity() - { - // TODO - } - - /** - * Returns <code>true</code> if the paths are contiguous or we - * have no RowMapper assigned. - * - * @param paths the paths to check for continuity - * @return <code>true</code> if the paths are contiguous or we - * have no RowMapper assigned - */ - protected boolean arePathsContiguous(TreePath[] value0) - { - return false; // TODO - } - - /** - * Checks if the paths can be added. This returns <code>true</code> if: - * <ul> - * <li><code>paths</code> is <code>null</code> or empty</li> - * <li>we have no RowMapper assigned</li> - * <li>nothing is currently selected</li> - * <li>selectionMode is {@link DISCONTIGUOUS_TREE_SELECTION</li> - * <li>adding the paths to the selection still results in a contiguous set - * of paths</li> - * - * @param paths the paths to check - * - * @return <code>true</code> if the paths can be added with respect to the - * selectionMode - */ - protected boolean canPathsBeAdded(TreePath[] value0) - { - return false; // TODO - } - - /** - * Checks if the paths can be removed without breaking the continuity of - * the selection according to selectionMode. - * - * @param paths the paths to check - * @return <code>true</code> if the paths can be removed with respect to the - * selectionMode - */ - protected boolean canPathsBeRemoved(TreePath[] value0) - { - return false; // TODO - } - - /** - * notifyPathChange - * @param value0 TODO - * @param value1 TODO - */ - protected void notifyPathChange(Vector value0, TreePath value1) - { - // TODO - } - - /** - * Updates the lead index instance field. - */ - protected void updateLeadIndex() - { - // TODO - } - - /** - * Deprecated and not used. - */ - protected void insureUniqueness() - { - // TODO - } -} diff --git a/libjava/javax/swing/tree/ExpandVetoException.java b/libjava/javax/swing/tree/ExpandVetoException.java deleted file mode 100644 index 1c8827c..0000000 --- a/libjava/javax/swing/tree/ExpandVetoException.java +++ /dev/null @@ -1,83 +0,0 @@ -/* 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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 deleted file mode 100644 index 79c7e05..0000000 --- a/libjava/javax/swing/tree/FixedHeightLayoutCache.java +++ /dev/null @@ -1,236 +0,0 @@ -/* FixedHeightLayoutCache.java -- - Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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; - -import java.awt.Rectangle; -import java.util.Enumeration; - -import javax.swing.event.TreeModelEvent; - -/** - * 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 deleted file mode 100644 index a527521..0000000 --- a/libjava/javax/swing/tree/MutableTreeNode.java +++ /dev/null @@ -1,104 +0,0 @@ -/* MutableTreeNode.java -- - Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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 public interface - - * @author Andrew Selkirk - */ -public interface MutableTreeNode extends TreeNode -{ - /** - * Inserts a node as child at a given index. - * - * @param child the note to insert - * @param index the index - * - * @see #remove(int) - * @see #remove(MutableTreeNode) - * @see #setParent(MutableTreeNode) - */ - void insert(MutableTreeNode child, int index); - - /** - * Removes the child node a given index. - * - * @param index the index - * - * @see #add(MutableTreeNode,int) - * @see #remove(MutableTreeNode) - * @see #removeFromParent() - */ - void remove(int index); - - /** - * Removes a given child node. - * - * @param node the node to remove - * - * @see #add(MutableTreeNode,int) - * @see #remove(int) - * @see #removeFromParent() - */ - void remove(MutableTreeNode node); - - /** - * Sets a user object, the data represented by the node. - * - * @param object the data - */ - void setUserObject(Object object); - - /** - * Removes this node from its parent. - * - * @see #remove(int) - * @see #remove(MutableTreeNode) - */ - void removeFromParent(); - - /** - * Sets the parent of the node. - * - * @param parent the parent - * - * @see insert(MutableTreeNode,int) - */ - void setParent(MutableTreeNode parent); -} diff --git a/libjava/javax/swing/tree/RowMapper.java b/libjava/javax/swing/tree/RowMapper.java deleted file mode 100644 index 690efb7..0000000 --- a/libjava/javax/swing/tree/RowMapper.java +++ /dev/null @@ -1,54 +0,0 @@ -/* 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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 public interface - * @author Andrew Selkirk - */ -public interface RowMapper { - - /** - * getRowsForPaths - * @param path TreePath - * @return TODO - */ - int[] getRowsForPaths(TreePath[] path); - - -} // RowMapper diff --git a/libjava/javax/swing/tree/TreeCellEditor.java b/libjava/javax/swing/tree/TreeCellEditor.java deleted file mode 100644 index 691cbc1..0000000 --- a/libjava/javax/swing/tree/TreeCellEditor.java +++ /dev/null @@ -1,65 +0,0 @@ -/* TreeCellEditor.java -- - Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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; - -import java.awt.Component; - -import javax.swing.CellEditor; -import javax.swing.JTree; - -/** - * TreeCellEditor public interface - * @author Andrew Selkirk - */ -public interface TreeCellEditor extends CellEditor -{ - /** - * getTreeCellEditorComponent - * @param tree TODO - * @param value TODO - * @param isSelected TODO - * @param expanded TODO - * @param leaf TODO - * @param row TODO - * @return TODO - */ - Component getTreeCellEditorComponent(JTree tree, Object value, - boolean isSelected, boolean expanded, - boolean leaf, int row); -} diff --git a/libjava/javax/swing/tree/TreeCellRenderer.java b/libjava/javax/swing/tree/TreeCellRenderer.java deleted file mode 100644 index ebbe3fa..0000000 --- a/libjava/javax/swing/tree/TreeCellRenderer.java +++ /dev/null @@ -1,67 +0,0 @@ -/* TreeCellRenderer.java -- - Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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; - -import java.awt.Component; - -import javax.swing.JTree; - -/** - * TreeCellRenderer public 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 - */ - 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 deleted file mode 100644 index 759aaac..0000000 --- a/libjava/javax/swing/tree/TreeModel.java +++ /dev/null @@ -1,109 +0,0 @@ -/* 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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; - -import javax.swing.event.TreeModelListener; - -/** - * TreeModel public interface - * @author Andrew Selkirk - */ -public interface TreeModel { - - //------------------------------------------------------------- - // Methods ---------------------------------------------------- - //------------------------------------------------------------- - - /** - * getRoot - * @returns Object - */ - Object getRoot(); - - /** - * getChild - * @param parent TODO - * @param index TODO - * @returns Object - */ - Object getChild(Object parent, int index); - - /** - * getChildCount - * @param parent TODO - * @returns int - */ - int getChildCount(Object parent); - - /** - * isLeaf - * @param node TODO - * @returns boolean - */ - boolean isLeaf(Object node); - - /** - * valueForPathChanged - * @param path TODO - * @param newvalue TODO - */ - void valueForPathChanged(TreePath path, Object newvalue); - - /** - * getIndexOfChild - * @param parent TODO - * @param ild TODO - * @returns int - */ - int getIndexOfChild(Object parent, Object child); - - /** - * addTreeModelListener - * @param listener TODO - */ - void addTreeModelListener(TreeModelListener listener); - - /** - * removeTreeModelListener - * @param listener TODO - */ - void removeTreeModelListener(TreeModelListener listener); - - -} // TreeModel diff --git a/libjava/javax/swing/tree/TreeNode.java b/libjava/javax/swing/tree/TreeNode.java deleted file mode 100644 index fb8f880..0000000 --- a/libjava/javax/swing/tree/TreeNode.java +++ /dev/null @@ -1,99 +0,0 @@ -/* 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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; - -import java.util.Enumeration; - -/** - * TreeNode public interface - * @author Andrew Selkirk - */ -public interface TreeNode { - - //------------------------------------------------------------- - // Methods ---------------------------------------------------- - //------------------------------------------------------------- - - /** - * getParent - * @returns TreeNode - */ - TreeNode getParent(); - - /** - * getIndex - * @param node TODO - * @returns int - */ - int getIndex(TreeNode node); - - /** - * getChildAt - * @param index TODO - * @returns TreeNode - */ - TreeNode getChildAt(int index); - - /** - * getChildCount - * @returns int - */ - int getChildCount(); - - /** - * getAllowsChildren - * @returns boolean - */ - boolean getAllowsChildren(); - - /** - * isLeaf - * @returns boolean - */ - boolean isLeaf(); - - /** - * children - * @returns Enumeration - */ - Enumeration children(); - - -} // TreeNode - diff --git a/libjava/javax/swing/tree/TreePath.java b/libjava/javax/swing/tree/TreePath.java deleted file mode 100644 index cb947b9..0000000 --- a/libjava/javax/swing/tree/TreePath.java +++ /dev/null @@ -1,300 +0,0 @@ -/* 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - -/** - * TreePath - * @author Andrew Selkirk - */ -public class TreePath implements Serializable -{ - static final long serialVersionUID = 4380036194768077479L; - - //------------------------------------------------------------- - // 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 deleted file mode 100644 index 4072ccc..0000000 --- a/libjava/javax/swing/tree/TreeSelectionModel.java +++ /dev/null @@ -1,84 +0,0 @@ -/* TreeSelectionModel.java -- - Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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; - -import java.beans.PropertyChangeListener; - -import javax.swing.event.TreeSelectionListener; - -/** - * TreeSelectionModel public interface - * @author Andrew Selkirk - */ -public interface TreeSelectionModel { - - int SINGLE_TREE_SELECTION = 1; - int CONTIGUOUS_TREE_SELECTION = 2; - int DISCONTIGUOUS_TREE_SELECTION = 4; - - void setSelectionMode(int mode); - int getSelectionMode(); - void setSelectionPath(TreePath path); - void setSelectionPaths(TreePath[] paths); - void addSelectionPath(TreePath path); - void addSelectionPaths(TreePath[] paths); - void removeSelectionPath(TreePath path); - void removeSelectionPaths(TreePath[] paths); - TreePath getSelectionPath(); - TreePath[] getSelectionPaths(); - int getSelectionCount(); - boolean isPathSelected(TreePath path); - boolean isSelectionEmpty(); - void clearSelection(); - void setRowMapper(RowMapper newMapper); - RowMapper getRowMapper(); - int[] getSelectionRows(); - int getMinSelectionRow(); - int getMaxSelectionRow(); - boolean isRowSelected(int row); - void resetRowSelection(); - int getLeadSelectionRow(); - TreePath getLeadSelectionPath(); - void addPropertyChangeListener(PropertyChangeListener listener); - void removePropertyChangeListener(PropertyChangeListener listener); - void addTreeSelectionListener(TreeSelectionListener x); - void removeTreeSelectionListener(TreeSelectionListener x); - - -} // TreeSelectionModel diff --git a/libjava/javax/swing/tree/VariableHeightLayoutCache.java b/libjava/javax/swing/tree/VariableHeightLayoutCache.java deleted file mode 100644 index 2f93be8..0000000 --- a/libjava/javax/swing/tree/VariableHeightLayoutCache.java +++ /dev/null @@ -1,261 +0,0 @@ -/* VariableHeightLayoutCache.java -- - Copyright (C) 2002, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 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; - -import java.awt.Rectangle; -import java.util.Enumeration; - -import javax.swing.event.TreeModelEvent; - -/** - * 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 |