aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/javax/swing/tree
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/javax/swing/tree')
-rw-r--r--libjava/classpath/javax/swing/tree/AbstractLayoutCache.java90
-rw-r--r--libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java138
-rw-r--r--libjava/classpath/javax/swing/tree/DefaultTreeCellEditor.java148
-rw-r--r--libjava/classpath/javax/swing/tree/DefaultTreeCellRenderer.java190
-rw-r--r--libjava/classpath/javax/swing/tree/DefaultTreeModel.java128
-rw-r--r--libjava/classpath/javax/swing/tree/DefaultTreeSelectionModel.java112
-rw-r--r--libjava/classpath/javax/swing/tree/ExpandVetoException.java12
-rw-r--r--libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java150
-rw-r--r--libjava/classpath/javax/swing/tree/MutableTreeNode.java4
-rw-r--r--libjava/classpath/javax/swing/tree/RowMapper.java4
-rw-r--r--libjava/classpath/javax/swing/tree/TreeCellEditor.java12
-rw-r--r--libjava/classpath/javax/swing/tree/TreeCellRenderer.java8
-rw-r--r--libjava/classpath/javax/swing/tree/TreeNode.java35
-rw-r--r--libjava/classpath/javax/swing/tree/TreePath.java62
-rw-r--r--libjava/classpath/javax/swing/tree/TreeSelectionModel.java2
-rw-r--r--libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java122
16 files changed, 608 insertions, 609 deletions
diff --git a/libjava/classpath/javax/swing/tree/AbstractLayoutCache.java b/libjava/classpath/javax/swing/tree/AbstractLayoutCache.java
index 4a6899f..29ce165 100644
--- a/libjava/classpath/javax/swing/tree/AbstractLayoutCache.java
+++ b/libjava/classpath/javax/swing/tree/AbstractLayoutCache.java
@@ -45,7 +45,7 @@ import javax.swing.event.TreeModelEvent;
/**
* class AbstractLayoutCache
- *
+ *
* @author Andrew Selkirk
*/
public abstract class AbstractLayoutCache
@@ -69,7 +69,7 @@ public abstract class AbstractLayoutCache
* the method is overridden, like if {@link FixedHeightLayoutCache}. If the
* method is not overridden and the property is not set, the InternalError is
* thrown.
- *
+ *
* @param value the last node in the path
* @param row the node row
* @param depth the indentation depth
@@ -116,7 +116,7 @@ public abstract class AbstractLayoutCache
/**
* setNodeDimensions
- *
+ *
* @param dimensions TODO
*/
public void setNodeDimensions(NodeDimensions dimensions)
@@ -126,7 +126,7 @@ public abstract class AbstractLayoutCache
/**
* getNodeDimensions
- *
+ *
* @return NodeDimensions
*/
public NodeDimensions getNodeDimensions()
@@ -139,7 +139,7 @@ public abstract class AbstractLayoutCache
* (unless the method is overridden, like if
* {@link FixedHeightLayoutCache}. If the method is not overridden and
* the property is not set, the InternalError is thrown.
- *
+ *
* @param value the last node in the path
* @param row the node row
* @param depth the indentation depth
@@ -152,13 +152,13 @@ public abstract class AbstractLayoutCache
Rectangle d = null;
if (nodeDimensions != null)
d = nodeDimensions.getNodeDimensions(value, row, depth, expanded,
- bounds);
+ bounds);
return d;
}
/**
* Sets the model that provides the tree data.
- *
+ *
* @param model the model
*/
public void setModel(TreeModel model)
@@ -168,7 +168,7 @@ public abstract class AbstractLayoutCache
/**
* Returns the model that provides the tree data.
- *
+ *
* @return the model
*/
public TreeModel getModel()
@@ -178,7 +178,7 @@ public abstract class AbstractLayoutCache
/**
* setRootVisible
- *
+ *
* @param visible <code>true</code> if root should be visible,
* <code>false</code> otherwise
*/
@@ -189,7 +189,7 @@ public abstract class AbstractLayoutCache
/**
* isRootVisible
- *
+ *
* @return <code>true</code> if root is visible,
* <code>false</code> otherwise
*/
@@ -200,7 +200,7 @@ public abstract class AbstractLayoutCache
/**
* setRowHeight
- *
+ *
* @param height the row height
*/
public void setRowHeight(int height)
@@ -211,7 +211,7 @@ public abstract class AbstractLayoutCache
/**
* getRowHeight
- *
+ *
* @return the row height
*/
public int getRowHeight()
@@ -221,7 +221,7 @@ public abstract class AbstractLayoutCache
/**
* setSelectionModel
- *
+ *
* @param model the model
*/
public void setSelectionModel(TreeSelectionModel model)
@@ -231,12 +231,12 @@ public abstract class AbstractLayoutCache
treeSelectionModel = model;
if (treeSelectionModel != null)
treeSelectionModel.setRowMapper(this);
-
+
}
/**
* getSelectionModel
- *
+ *
* @return the model
*/
public TreeSelectionModel getSelectionModel()
@@ -246,7 +246,7 @@ public abstract class AbstractLayoutCache
/**
* Get the sum of heights for all rows. This class provides a general not
- * optimized implementation that is overridded in derived classes
+ * optimized implementation that is overridded in derived classes
* ({@link VariableHeightLayoutCache}, {@link FixedHeightLayoutCache}) for
* the better performance.
*/
@@ -265,10 +265,10 @@ public abstract class AbstractLayoutCache
/**
* Get the maximal width. This class provides a general not
- * optimized implementation that is overridded in derived classes
+ * optimized implementation that is overridded in derived classes
* ({@link VariableHeightLayoutCache}, {@link FixedHeightLayoutCache}) for
* the better performance.
- *
+ *
* @param rect the rectangle that is used during the method work
*/
public int getPreferredWidth(Rectangle rect)
@@ -279,7 +279,7 @@ public abstract class AbstractLayoutCache
for (int i = 0; i < n; i++)
{
TreePath path = getPathForRow(i);
- r.setBounds(0, 0, 0, 0);
+ r.setBounds(0, 0, 0, 0);
r = getBounds(path, r);
if (r.x + r.width > maximalWidth)
maximalWidth = r.x + r.width;
@@ -292,90 +292,90 @@ public abstract class AbstractLayoutCache
}
/**
* 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<TreePath> getVisiblePathsFrom(TreePath path);
/**
* getVisibleChildCount
- *
+ *
* @param path the tree path
- *
+ *
* @return int
*/
public abstract int getVisibleChildCount(TreePath path);
/**
* 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();
@@ -387,35 +387,35 @@ public abstract class AbstractLayoutCache
/**
* 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);
@@ -426,7 +426,7 @@ public abstract class AbstractLayoutCache
* one. To have the benefit from the bulk conversion, the method must be
* overridden in the derived classes. The default method delegates work
* to the {@link #getRowForPath(TreePath)}.
- *
+ *
* @param paths the tree paths the array of the tree pathes.
* @return the array of the matching tree rows.
*/
@@ -445,7 +445,7 @@ public abstract class AbstractLayoutCache
/**
* Returns true if this layout supposes that all rows have the fixed
* height.
- *
+ *
* @return boolean true if all rows in the tree must have the fixed
* height (false by default).
*/
diff --git a/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java b/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java
index e4cc978..260c385 100644
--- a/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java
+++ b/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java
@@ -101,7 +101,7 @@ public class DefaultMutableTreeNode
/**
* Creates a <code>DefaultMutableTreeNode</code> object with the given
- * user object attached to it. This is equivalent to
+ * user object attached to it. This is equivalent to
* <code>DefaultMutableTreeNode(userObject, true)</code>.
*
* @param userObject the user object (<code>null</code> permitted).
@@ -126,7 +126,7 @@ public class DefaultMutableTreeNode
}
/**
- * Returns a clone of the node. The clone contains a shallow copy of the
+ * Returns a clone of the node. The clone contains a shallow copy of the
* user object, and does not copy the parent node or the child nodes.
*
* @return A clone of the node.
@@ -159,24 +159,24 @@ public class DefaultMutableTreeNode
*
* @param child the child node (<code>null</code> not permitted).
*
- * @throws IllegalStateException if {@link #getAllowsChildren()} returns
+ * @throws IllegalStateException if {@link #getAllowsChildren()} returns
* <code>false</code>.
* @throws IllegalArgumentException if {@link #isNodeAncestor} returns
- * <code>true</code>.
- * @throws IllegalArgumentException if <code>child</code> is
+ * <code>true</code>.
+ * @throws IllegalArgumentException if <code>child</code> is
* <code>null</code>.
*/
public void add(MutableTreeNode child)
{
if (! allowsChildren)
throw new IllegalStateException();
-
+
if (child == null)
throw new IllegalArgumentException();
if (isNodeAncestor(child))
throw new IllegalArgumentException("Cannot add ancestor node.");
-
+
children.add(child);
child.setParent(this);
}
@@ -194,10 +194,10 @@ public class DefaultMutableTreeNode
/**
* Removes the child with the given index from this node.
*
- * @param index the index (in the range <code>0</code> to
+ * @param index the index (in the range <code>0</code> to
* <code>getChildCount() - 1</code>).
- *
- * @throws ArrayIndexOutOfBoundsException if <code>index</code> is outside
+ *
+ * @throws ArrayIndexOutOfBoundsException if <code>index</code> is outside
* the valid range.
*/
public void remove(int index)
@@ -207,12 +207,12 @@ public class DefaultMutableTreeNode
}
/**
- * Removes the given child from this node and sets its parent to
+ * Removes the given child from this node and sets its parent to
* <code>null</code>.
*
* @param node the child node (<code>null</code> not permitted).
- *
- * @throws IllegalArgumentException if <code>node</code> is not a child of
+ *
+ * @throws IllegalArgumentException if <code>node</code> is not a child of
* this node.
* @throws IllegalArgumentException if <code>node</code> is null.
*/
@@ -259,8 +259,8 @@ public class DefaultMutableTreeNode
*
* @param node the child node (<code>null</code> not permitted).
* @param index the index.
- *
- * @throws IllegalArgumentException if <code>node</code> is
+ *
+ * @throws IllegalArgumentException if <code>node</code> is
* </code>null</code>.
*/
public void insert(MutableTreeNode node, int index)
@@ -270,7 +270,7 @@ public class DefaultMutableTreeNode
if (node == null)
throw new IllegalArgumentException("Null 'node' argument.");
-
+
if (isNodeAncestor(node))
throw new IllegalArgumentException("Cannot insert ancestor node.");
@@ -298,7 +298,7 @@ public class DefaultMutableTreeNode
{
if (children.size() == 0)
return EMPTY_ENUMERATION;
-
+
return children.elements();
}
@@ -337,11 +337,11 @@ public class DefaultMutableTreeNode
/**
* Returns the index of the specified child node, or -1 if the node is not
* in fact a child of this node.
- *
+ *
* @param node the node (<code>null</code> not permitted).
- *
+ *
* @return The index of the specified child node, or -1.
- *
+ *
* @throws IllegalArgumentException if <code>node</code> is <code>null</code>.
*/
public int getIndex(TreeNode node)
@@ -352,7 +352,7 @@ public class DefaultMutableTreeNode
}
/**
- * Sets the flag that controls whether or not this node allows the addition /
+ * Sets the flag that controls whether or not this node allows the addition /
* insertion of child nodes. If the flag is set to <code>false</code>, any
* existing children are removed.
*
@@ -422,9 +422,9 @@ public class DefaultMutableTreeNode
* <li>the parent node (if there is one);</li>
* <li>any ancestor of the parent node;</li>
* </ul>
- * If <code>node</code> is <code>null</code>, this method returns
+ * If <code>node</code> is <code>null</code>, this method returns
* <code>false</code>.
- *
+ *
* @param node the node (<code>null</code> permitted).
*
* @return A boolean.
@@ -450,9 +450,9 @@ public class DefaultMutableTreeNode
* <li>the child nodes belonging to this tree node, if there are any;</li>
* <li>any descendants of the child nodes;</li>
* </ul>
- * If <code>node</code> is <code>null</code>, this method returns
+ * If <code>node</code> is <code>null</code>, this method returns
* <code>false</code>.
- *
+ *
* @param node the node (<code>null</code> permitted).
*
* @return A boolean.
@@ -463,7 +463,7 @@ public class DefaultMutableTreeNode
return false;
TreeNode current = node;
-
+
while (current != null
&& current != this)
current = current.getParent();
@@ -533,7 +533,7 @@ public class DefaultMutableTreeNode
TreeNode node = getChildAt(0);
int depth = 0;
int current = 1;
-
+
while (! stack.empty())
{
if (node.getChildCount() != 0)
@@ -549,7 +549,7 @@ public class DefaultMutableTreeNode
int size;
int index;
-
+
do
{
node = node.getParent();
@@ -606,7 +606,7 @@ public class DefaultMutableTreeNode
{
if (depth == 0)
return null;
-
+
return new TreeNode[depth];
}
@@ -624,7 +624,7 @@ public class DefaultMutableTreeNode
{
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();
@@ -640,7 +640,7 @@ public class DefaultMutableTreeNode
{
TreeNode current = this;
TreeNode check = current.getParent();
-
+
while (check != null)
{
current = check;
@@ -675,7 +675,7 @@ public class DefaultMutableTreeNode
// Return next sibling (if needed the sibling of some parent).
DefaultMutableTreeNode node = this;
DefaultMutableTreeNode sibling;
-
+
do
{
sibling = node.getNextSibling();
@@ -683,7 +683,7 @@ public class DefaultMutableTreeNode
}
while (sibling == null &&
node != null);
-
+
// Return sibling.
return sibling;
}
@@ -698,7 +698,7 @@ public class DefaultMutableTreeNode
// Return null if no parent.
if (parent == null)
return null;
-
+
DefaultMutableTreeNode sibling = getPreviousSibling();
// Return parent if no sibling.
@@ -769,7 +769,7 @@ public class DefaultMutableTreeNode
{
if (node == null)
throw new IllegalArgumentException();
-
+
TreeNode parent = this;
Vector<TreeNode> nodes = new Vector<TreeNode>();
nodes.add(this);
@@ -782,13 +782,13 @@ public class DefaultMutableTreeNode
if (parent != node)
throw new IllegalArgumentException();
-
+
return nodes.elements();
}
/**
- * Returns <code>true</code> if <code>node</code> is a child of this tree
- * node, and <code>false</code> otherwise. If <code>node</code> is
+ * Returns <code>true</code> if <code>node</code> is a child of this tree
+ * node, and <code>false</code> otherwise. If <code>node</code> is
* <code>null</code>, this method returns <code>false</code>.
*
* @param node the node (<code>null</code> permitted).
@@ -807,7 +807,7 @@ public class DefaultMutableTreeNode
* Returns the first child node belonging to this tree node.
*
* @return The first child node.
- *
+ *
* @throws NoSuchElementException if this tree node has no children.
*/
public TreeNode getFirstChild()
@@ -819,7 +819,7 @@ public class DefaultMutableTreeNode
* Returns the last child node belonging to this tree node.
*
* @return The last child node.
- *
+ *
* @throws NoSuchElementException if this tree node has no children.
*/
public TreeNode getLastChild()
@@ -828,15 +828,15 @@ public class DefaultMutableTreeNode
}
/**
- * Returns the next child after the specified <code>node</code>, or
- * <code>null</code> if there is no child after the specified
+ * Returns the next child after the specified <code>node</code>, or
+ * <code>null</code> if there is no child after the specified
* <code>node</code>.
*
* @param node a child of this node (<code>null</code> not permitted).
*
* @return The next child, or <code>null</code>.
- *
- * @throws IllegalArgumentException if <code>node</code> is not a child of
+ *
+ * @throws IllegalArgumentException if <code>node</code> is not a child of
* this node, or is <code>null</code>.
*/
public TreeNode getChildAfter(TreeNode node)
@@ -853,15 +853,15 @@ public class DefaultMutableTreeNode
}
/**
- * Returns the previous child before the specified <code>node</code>, or
- * <code>null</code> if there is no child before the specified
+ * Returns the previous child before the specified <code>node</code>, or
+ * <code>null</code> if there is no child before the specified
* <code>node</code>.
*
* @param node a child of this node (<code>null</code> not permitted).
*
* @return The previous child, or <code>null</code>.
- *
- * @throws IllegalArgumentException if <code>node</code> is not a child of
+ *
+ * @throws IllegalArgumentException if <code>node</code> is not a child of
* this node, or is <code>null</code>.
*/
public TreeNode getChildBefore(TreeNode node)
@@ -913,8 +913,8 @@ public class DefaultMutableTreeNode
/**
* Returns the next sibling for this tree node. If this node has no parent,
- * or this node is the last child of its parent, this method returns
- * <code>null</code>.
+ * or this node is the last child of its parent, this method returns
+ * <code>null</code>.
*
* @return The next sibling, or <code>null</code>.
*/
@@ -924,7 +924,7 @@ public class DefaultMutableTreeNode
return null;
int index = parent.getIndex(this) + 1;
-
+
if (index == parent.getChildCount())
return null;
@@ -932,9 +932,9 @@ public class DefaultMutableTreeNode
}
/**
- * Returns the previous sibling for this tree node. If this node has no
- * parent, or this node is the first child of its parent, this method returns
- * <code>null</code>.
+ * Returns the previous sibling for this tree node. If this node has no
+ * parent, or this node is the first child of its parent, this method returns
+ * <code>null</code>.
*
* @return The previous sibling, or <code>null</code>.
*/
@@ -952,7 +952,7 @@ public class DefaultMutableTreeNode
}
/**
- * Returns <code>true</code> if this tree node is a lead node (that is, it
+ * Returns <code>true</code> if this tree node is a lead node (that is, it
* has no children), and <code>false</otherwise>.
*
* @return A boolean.
@@ -963,8 +963,8 @@ public class DefaultMutableTreeNode
}
/**
- * Returns the first leaf node that is a descendant of this node. Recall
- * that a node is its own descendant, so if this node has no children then
+ * Returns the first leaf node that is a descendant of this node. Recall
+ * that a node is its own descendant, so if this node has no children then
* it is returned as the first leaf.
*
* @return The first leaf node.
@@ -972,7 +972,7 @@ public class DefaultMutableTreeNode
public DefaultMutableTreeNode getFirstLeaf()
{
TreeNode current = this;
-
+
while (current.getChildCount() > 0)
current = current.getChildAt(0);
@@ -980,8 +980,8 @@ public class DefaultMutableTreeNode
}
/**
- * Returns the last leaf node that is a descendant of this node. Recall
- * that a node is its own descendant, so if this node has no children then
+ * Returns the last leaf node that is a descendant of this node. Recall
+ * that a node is its own descendant, so if this node has no children then
* it is returned as the last leaf.
*
* @return The first leaf node.
@@ -990,7 +990,7 @@ public class DefaultMutableTreeNode
{
TreeNode current = this;
int size = current.getChildCount();
-
+
while (size > 0)
{
current = current.getChildAt(size - 1);
@@ -1001,7 +1001,7 @@ public class DefaultMutableTreeNode
}
/**
- * Returns the next leaf node after this tree node.
+ * Returns the next leaf node after this tree node.
*
* @return The next leaf node, or <code>null</code>.
*/
@@ -1047,7 +1047,7 @@ public class DefaultMutableTreeNode
while (e.hasMoreElements())
{
TreeNode current = (TreeNode) e.nextElement();
-
+
if (current.isLeaf())
count++;
}
@@ -1082,7 +1082,7 @@ public class DefaultMutableTreeNode
TreeNode node = queue.removeFirst();
Enumeration<TreeNode> children =
- (Enumeration<TreeNode>) node.children();
+ (Enumeration<TreeNode>) node.children();
while (children.hasMoreElements())
queue.add(children.nextElement());
@@ -1095,10 +1095,10 @@ public class DefaultMutableTreeNode
*/
static class PreorderEnumeration implements Enumeration<TreeNode>
{
- TreeNode next;
+ TreeNode next;
Stack<Enumeration<TreeNode>> childrenEnums =
- new Stack<Enumeration<TreeNode>>();
+ new Stack<Enumeration<TreeNode>>();
@SuppressWarnings("unchecked")
PreorderEnumeration(TreeNode node)
@@ -1138,7 +1138,7 @@ public class DefaultMutableTreeNode
return child;
}
-
+
// If no children are left, we return to a higher level.
childrenEnums.pop();
@@ -1161,7 +1161,7 @@ public class DefaultMutableTreeNode
Stack<TreeNode> nodes = new Stack<TreeNode>();
Stack<Enumeration<TreeNode>> childrenEnums =
- new Stack<Enumeration<TreeNode>>();
+ new Stack<Enumeration<TreeNode>>();
@SuppressWarnings("unchecked")
PostorderEnumeration(TreeNode node)
@@ -1194,7 +1194,7 @@ public class DefaultMutableTreeNode
nodes.push(node);
Enumeration<TreeNode> newChildren =
- (Enumeration<TreeNode>) node.children();
+ (Enumeration<TreeNode>) node.children();
childrenEnums.push(newChildren);
return traverse(newChildren);
diff --git a/libjava/classpath/javax/swing/tree/DefaultTreeCellEditor.java b/libjava/classpath/javax/swing/tree/DefaultTreeCellEditor.java
index 0489798..9ee0a14 100644
--- a/libjava/classpath/javax/swing/tree/DefaultTreeCellEditor.java
+++ b/libjava/classpath/javax/swing/tree/DefaultTreeCellEditor.java
@@ -68,7 +68,7 @@ import javax.swing.event.TreeSelectionListener;
/**
* Participates in the tree cell editing.
- *
+ *
* @author Andrew Selkirk
* @author Audrius Meskauskas
*/
@@ -77,8 +77,8 @@ public class DefaultTreeCellEditor
{
/**
* This container that appears on the tree during editing session.
- * It contains the editing component displays various other editor -
- * specific parts like editing icon.
+ * It contains the editing component displays various other editor -
+ * specific parts like editing icon.
*/
public class EditorContainer extends Container
{
@@ -86,7 +86,7 @@ public class DefaultTreeCellEditor
* Use v 1.5 serial version UID for interoperability.
*/
static final long serialVersionUID = 6470339600449699810L;
-
+
/**
* Creates an <code>EditorContainer</code> object.
*/
@@ -103,11 +103,11 @@ public class DefaultTreeCellEditor
{
// Do nothing here.
}
-
+
/**
* Overrides Container.paint to paint the node's icon and use the selection
* color for the background.
- *
+ *
* @param g -
* the specified Graphics window
*/
@@ -175,8 +175,8 @@ public class DefaultTreeCellEditor
/**
* Use v 1.5 serial version UID for interoperability.
*/
- static final long serialVersionUID = -6629304544265300143L;
-
+ static final long serialVersionUID = -6629304544265300143L;
+
/**
* The border of the text field.
*/
@@ -194,9 +194,9 @@ public class DefaultTreeCellEditor
/**
* Gets the font of this component.
- * @return this component's font; if a font has not been set for
+ * @return this component's font; if a font has not been set for
* this component, the font of its parent is returned (if the parent
- * is not null, otherwise null is returned).
+ * is not null, otherwise null is returned).
*/
public Font getFont()
{
@@ -222,9 +222,9 @@ public class DefaultTreeCellEditor
}
/**
- * Overrides JTextField.getPreferredSize to return the preferred size
+ * Overrides JTextField.getPreferredSize to return the preferred size
* based on current font, if set, or else use renderer's font.
- *
+ *
* @return the Dimension of this textfield.
*/
public Dimension getPreferredSize()
@@ -237,9 +237,9 @@ public class DefaultTreeCellEditor
return renderer.getPreferredSize();
}
}
-
+
private EventListenerList listenerList = new EventListenerList();
-
+
/**
* Editor handling the editing.
*/
@@ -261,8 +261,8 @@ public class DefaultTreeCellEditor
protected transient Component editingComponent;
/**
- * As of Java 2 platform v1.4 this field should no longer be used.
- * If you wish to provide similar behavior you should directly
+ * As of Java 2 platform v1.4 this field should no longer be used.
+ * If you wish to provide similar behavior you should directly
* override isCellEditable.
*/
protected boolean canEdit;
@@ -306,12 +306,12 @@ public class DefaultTreeCellEditor
* Font to paint with, null indicates font of renderer is to be used.
*/
protected Font font;
-
+
/**
- * Constructs a DefaultTreeCellEditor object for a JTree using the
- * specified renderer and a default editor. (Use this constructor
+ * Constructs a DefaultTreeCellEditor object for a JTree using the
+ * specified renderer and a default editor. (Use this constructor
* for normal editing.)
- *
+ *
* @param tree - a JTree object
* @param renderer - a DefaultTreeCellRenderer object
*/
@@ -321,10 +321,10 @@ public class DefaultTreeCellEditor
}
/**
- * Constructs a DefaultTreeCellEditor object for a JTree using the specified
- * renderer and the specified editor. (Use this constructor
+ * Constructs a DefaultTreeCellEditor object for a JTree using the specified
+ * renderer and the specified editor. (Use this constructor
* for specialized editing.)
- *
+ *
* @param tree - a JTree object
* @param renderer - a DefaultTreeCellRenderer object
* @param editor - a TreeCellEditor object
@@ -341,10 +341,10 @@ public class DefaultTreeCellEditor
Color c = UIManager.getColor("Tree.editorBorderSelectionColor");
setBorderSelectionColor(c);
}
-
+
/**
* writeObject
- *
+ *
* @param value0
* TODO
* @exception IOException
@@ -386,12 +386,12 @@ public class DefaultTreeCellEditor
}
/**
- * Sets the font to edit with. null indicates the renderers
- * font should be used. This will NOT override any font you have
- * set in the editor the receiver was instantied with. If null for
- * an editor was passed in, a default editor will be created that
+ * Sets the font to edit with. null indicates the renderers
+ * font should be used. This will NOT override any font you have
+ * set in the editor the receiver was instantied with. If null for
+ * an editor was passed in, a default editor will be created that
* will pick up this font.
- *
+ *
* @param font - the editing Font
*/
public void setFont(Font font)
@@ -404,7 +404,7 @@ public class DefaultTreeCellEditor
/**
* Gets the font used for editing.
- *
+ *
* @return the editing font
*/
public Font getFont()
@@ -414,20 +414,20 @@ public class DefaultTreeCellEditor
/**
* Configures the editor. Passed onto the realEditor.
- * Sets an initial value for the editor. This will cause
- * the editor to stopEditing and lose any partially edited value
- * if the editor is editing when this method is called.
- * Returns the component that should be added to the client's Component
- * hierarchy. Once installed in the client's hierarchy this component will
- * then be able to draw and receive user input.
- *
+ * Sets an initial value for the editor. This will cause
+ * the editor to stopEditing and lose any partially edited value
+ * if the editor is editing when this method is called.
+ * Returns the component that should be added to the client's Component
+ * hierarchy. Once installed in the client's hierarchy this component will
+ * then be able to draw and receive user input.
+ *
* @param tree - the JTree that is asking the editor to edit; this parameter can be null
* @param value - the value of the cell to be edited
* @param isSelected - true is the cell is to be rendered with selection highlighting
* @param expanded - true if the node is expanded
* @param leaf - true if the node is a leaf node
* @param row - the row index of the node being edited
- *
+ *
* @return the component for editing
*/
public Component getTreeCellEditorComponent(JTree tree, Object value,
@@ -461,19 +461,19 @@ public class DefaultTreeCellEditor
/**
* Returns the value currently being edited (requests it from the
* {@link #realEditor}.
- *
+ *
* @return the value currently being edited
*/
public Object getCellEditorValue()
{
return realEditor.getCellEditorValue();
}
-
+
/**
- * If the realEditor returns true to this message, prepareForEditing
+ * If the realEditor returns true to this message, prepareForEditing
* is messaged and true is returned.
- *
- * @param event - the event the editor should use to consider whether to
+ *
+ * @param event - the event the editor should use to consider whether to
* begin editing or not
* @return true if editing can be started
*/
@@ -507,7 +507,7 @@ public class DefaultTreeCellEditor
}
if (! realEditor.isCellEditable(event))
ret = false;
- else
+ else
{
if (canEditImmediately(event))
ret = true;
@@ -519,12 +519,12 @@ public class DefaultTreeCellEditor
if (ret)
prepareForEditing();
return ret;
-
+
}
/**
* Messages the realEditor for the return value.
- *
+ *
* @param event -
* the event the editor should use to start editing
* @return true if the editor would like the editing cell to be selected;
@@ -570,7 +570,7 @@ public class DefaultTreeCellEditor
/**
* Adds a <code>CellEditorListener</code> object to this editor.
- *
+ *
* @param listener
* the listener to add
*/
@@ -603,7 +603,7 @@ public class DefaultTreeCellEditor
/**
* Resets lastPath.
- *
+ *
* @param e - the event that characterizes the change.
*/
public void valueChanged(TreeSelectionEvent e)
@@ -621,10 +621,10 @@ public class DefaultTreeCellEditor
// if (timer != null)
// timer.stop();
}
-
+
/**
* Messaged when the timer fires.
- *
+ *
* @param e the event that characterizes the action.
*/
public void actionPerformed(ActionEvent e)
@@ -636,7 +636,7 @@ public class DefaultTreeCellEditor
/**
* Sets the tree currently editing for. This is needed to add a selection
* listener.
- *
+ *
* @param newTree -
* the new tree to be edited
*/
@@ -657,7 +657,7 @@ public class DefaultTreeCellEditor
/**
* Returns true if event is a MouseEvent and the click count is 1.
- *
+ *
* @param event - the event being studied
* @return true if editing should start
*/
@@ -674,7 +674,7 @@ public class DefaultTreeCellEditor
}
/**
- * Starts the editing timer (if one installed).
+ * Starts the editing timer (if one installed).
*/
protected void startEditingTimer()
{
@@ -687,33 +687,33 @@ public class DefaultTreeCellEditor
}
/**
- * Returns true if event is null, or it is a MouseEvent with
+ * Returns true if event is null, or it is a MouseEvent with
* a click count > 2 and inHitRegion returns true.
- *
+ *
* @param event - the event being studied
- * @return true if event is null, or it is a MouseEvent with
- * a click count > 2 and inHitRegion returns true
+ * @return true if event is null, or it is a MouseEvent with
+ * a click count > 2 and inHitRegion returns true
*/
protected boolean canEditImmediately(EventObject event)
{
if (event == null || !(event instanceof MouseEvent) || (((MouseEvent) event).
- getClickCount() > 2 && inHitRegion(((MouseEvent) event).getX(),
+ getClickCount() > 2 && inHitRegion(((MouseEvent) event).getX(),
((MouseEvent) event).getY())))
return true;
return false;
}
/**
- * Returns true if the passed in location is a valid mouse location
+ * Returns true if the passed in location is a valid mouse location
* to start editing from. This is implemented to return false if x is
- * less than or equal to the width of the icon and icon
- * gap displayed by the renderer. In other words this returns true if
- * the user clicks over the text part displayed by the renderer, and
+ * less than or equal to the width of the icon and icon
+ * gap displayed by the renderer. In other words this returns true if
+ * the user clicks over the text part displayed by the renderer, and
* false otherwise.
- *
+ *
* @param x - the x-coordinate of the point
* @param y - the y-coordinate of the point
- *
+ *
* @return true if the passed in location is a valid mouse location
*/
protected boolean inHitRegion(int x, int y)
@@ -725,11 +725,11 @@ public class DefaultTreeCellEditor
/**
* determineOffset
* @param tree -
- * @param value -
- * @param isSelected -
- * @param expanded -
- * @param leaf -
- * @param row -
+ * @param value -
+ * @param isSelected -
+ * @param expanded -
+ * @param leaf -
+ * @param row -
*/
protected void determineOffset(JTree tree, Object value, boolean isSelected,
boolean expanded, boolean leaf, int row)
@@ -755,7 +755,7 @@ public class DefaultTreeCellEditor
}
/**
- * Invoked just before editing is to start. Will add the
+ * Invoked just before editing is to start. Will add the
* editingComponent to the editingContainer.
*/
protected void prepareForEditing()
@@ -766,7 +766,7 @@ public class DefaultTreeCellEditor
/**
* Creates the container to manage placement of editingComponent.
- *
+ *
* @return the container to manage the placement of the editingComponent.
*/
protected Container createContainer()
@@ -775,9 +775,9 @@ public class DefaultTreeCellEditor
}
/**
- * This is invoked if a TreeCellEditor is not supplied in the constructor.
+ * This is invoked if a TreeCellEditor is not supplied in the constructor.
* It returns a TextField editor.
- *
+ *
* @return a new TextField editor
*/
protected TreeCellEditor createTreeCellEditor()
diff --git a/libjava/classpath/javax/swing/tree/DefaultTreeCellRenderer.java b/libjava/classpath/javax/swing/tree/DefaultTreeCellRenderer.java
index b9c8401..a2c8fc2 100644
--- a/libjava/classpath/javax/swing/tree/DefaultTreeCellRenderer.java
+++ b/libjava/classpath/javax/swing/tree/DefaultTreeCellRenderer.java
@@ -1,6 +1,6 @@
-/* DefaultTreeCellRenderer.java
+/* DefaultTreeCellRenderer.java
Copyright (C) 2002, 2004, 2006, Free Software Foundation, Inc.
-
+
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
@@ -54,7 +54,7 @@ import javax.swing.plaf.UIResource;
/**
* A default implementation of the {@link TreeCellRenderer} interface.
- *
+ *
* @author Andrew Selkirk
*/
public class DefaultTreeCellRenderer
@@ -79,62 +79,62 @@ public class DefaultTreeCellRenderer
/**
* The icon used to represent non-leaf nodes that are closed.
- *
+ *
* @see #setClosedIcon(Icon)
*/
protected transient Icon closedIcon;
/**
* The icon used to represent leaf nodes.
- *
+ *
* @see #setLeafIcon(Icon)
*/
protected transient Icon leafIcon;
/**
* The icon used to represent non-leaf nodes that are open.
- *
+ *
* @see #setOpenIcon(Icon)
*/
protected transient Icon openIcon;
/**
* The color used for text in selected cells.
- *
+ *
* @see #setTextSelectionColor(Color)
*/
protected Color textSelectionColor;
/**
* The color used for text in non-selected cells.
- *
+ *
* @see #setTextNonSelectionColor(Color)
*/
protected Color textNonSelectionColor;
/**
* The background color for selected cells.
- *
+ *
* @see #setBackgroundSelectionColor(Color)
*/
protected Color backgroundSelectionColor;
/**
* The background color for non-selected cells.
- *
+ *
* @see #setBackgroundNonSelectionColor(Color)
*/
protected Color backgroundNonSelectionColor;
/**
* The border color for selected tree cells.
- *
+ *
* @see #setBorderSelectionColor(Color)
*/
protected Color borderSelectionColor;
/**
- * Creates a new tree cell renderer with defaults appropriate for the
+ * Creates a new tree cell renderer with defaults appropriate for the
* current {@link LookAndFeel}.
*/
public DefaultTreeCellRenderer()
@@ -154,9 +154,9 @@ public class DefaultTreeCellRenderer
/**
* Returns the default icon for non-leaf tree cells that are open (expanded).
- * The icon is fetched from the defaults table for the current
+ * The icon is fetched from the defaults table for the current
* {@link LookAndFeel} using the key <code>Tree.openIcon</code>.
- *
+ *
* @return The default icon.
*/
public Icon getDefaultOpenIcon()
@@ -165,10 +165,10 @@ public class DefaultTreeCellRenderer
}
/**
- * Returns the default icon for non-leaf tree cells that are closed (not
- * expanded). The icon is fetched from the defaults table for the current
+ * Returns the default icon for non-leaf tree cells that are closed (not
+ * expanded). The icon is fetched from the defaults table for the current
* {@link LookAndFeel} using the key <code>Tree.closedIcon</code>.
- *
+ *
* @return The default icon.
*/
public Icon getDefaultClosedIcon()
@@ -177,10 +177,10 @@ public class DefaultTreeCellRenderer
}
/**
- * Returns the default icon for leaf tree cells. The icon is fetched from
- * the defaults table for the current {@link LookAndFeel} using the key
+ * Returns the default icon for leaf tree cells. The icon is fetched from
+ * the defaults table for the current {@link LookAndFeel} using the key
* <code>Tree.leafIcon</code>.
- *
+ *
* @return The default icon.
*/
public Icon getDefaultLeafIcon()
@@ -191,9 +191,9 @@ public class DefaultTreeCellRenderer
/**
* Sets the icon to be displayed for non-leaf nodes that are open (expanded).
* Set this to <code>null</code> if no icon is required.
- *
+ *
* @param icon the icon (<code>null</code> permitted).
- *
+ *
* @see #getOpenIcon()
*/
public void setOpenIcon(Icon icon)
@@ -202,11 +202,11 @@ public class DefaultTreeCellRenderer
}
/**
- * Returns the icon displayed for non-leaf nodes that are open (expanded).
+ * Returns the icon displayed for non-leaf nodes that are open (expanded).
* The default value is initialised from the {@link LookAndFeel}.
- *
+ *
* @return The open icon (possibly <code>null</code>).
- *
+ *
* @see #setOpenIcon(Icon)
*/
public Icon getOpenIcon()
@@ -215,11 +215,11 @@ public class DefaultTreeCellRenderer
}
/**
- * Sets the icon to be displayed for non-leaf nodes that are closed. Set
+ * Sets the icon to be displayed for non-leaf nodes that are closed. Set
* this to <code>null</code> if no icon is required.
- *
+ *
* @param icon the icon (<code>null</code> permitted).
- *
+ *
* @see #getClosedIcon()
*/
public void setClosedIcon(Icon icon)
@@ -228,11 +228,11 @@ public class DefaultTreeCellRenderer
}
/**
- * Returns the icon displayed for non-leaf nodes that are closed. The
+ * Returns the icon displayed for non-leaf nodes that are closed. The
* default value is initialised from the {@link LookAndFeel}.
- *
+ *
* @return The closed icon (possibly <code>null</code>).
- *
+ *
* @see #setClosedIcon(Icon)
*/
public Icon getClosedIcon()
@@ -241,11 +241,11 @@ public class DefaultTreeCellRenderer
}
/**
- * Sets the icon to be displayed for leaf nodes. Set this to
+ * Sets the icon to be displayed for leaf nodes. Set this to
* <code>null</code> if no icon is required.
- *
+ *
* @param icon the icon (<code>null</code> permitted).
- *
+ *
* @see #getLeafIcon()
*/
public void setLeafIcon(Icon icon)
@@ -254,11 +254,11 @@ public class DefaultTreeCellRenderer
}
/**
- * Returns the icon displayed for leaf nodes. The default value is
+ * Returns the icon displayed for leaf nodes. The default value is
* initialised from the {@link LookAndFeel}.
- *
+ *
* @return The leaf icon (possibly <code>null</code>).
- *
+ *
* @see #setLeafIcon(Icon)
*/
public Icon getLeafIcon()
@@ -268,9 +268,9 @@ public class DefaultTreeCellRenderer
/**
* Sets the text color for tree cells that are selected.
- *
+ *
* @param c the color (<code>null</code> permitted).
- *
+ *
* @see #getTextSelectionColor()
*/
public void setTextSelectionColor(Color c)
@@ -282,9 +282,9 @@ public class DefaultTreeCellRenderer
* Returns the text color for tree cells that are selected.
* The default value is obtained from the {@link LookAndFeel} defaults
* table using the key <code>Tree.selectionForeground</code>.
- *
+ *
* @return The text color for tree cells that are selected.
- *
+ *
* @see #setTextSelectionColor(Color)
*/
public Color getTextSelectionColor()
@@ -294,9 +294,9 @@ public class DefaultTreeCellRenderer
/**
* Sets the text color for tree cells that are not selected.
- *
+ *
* @param c the color (<code>null</code> permitted).
- *
+ *
* @see #getTextNonSelectionColor()
*/
public void setTextNonSelectionColor(Color c)
@@ -308,9 +308,9 @@ public class DefaultTreeCellRenderer
* Returns the text color for tree cells that are not selected.
* The default value is obtained from the {@link LookAndFeel} defaults
* table using the key <code>Tree.selectionForeground</code>.
- *
+ *
* @return The background color for tree cells that are not selected.
- *
+ *
* @see #setTextgroundNonSelectionColor(Color)
*/
public Color getTextNonSelectionColor()
@@ -320,9 +320,9 @@ public class DefaultTreeCellRenderer
/**
* Sets the background color for tree cells that are selected.
- *
+ *
* @param c the color (<code>null</code> permitted).
- *
+ *
* @see #getBackgroundSelectionColor()
*/
public void setBackgroundSelectionColor(Color c)
@@ -334,9 +334,9 @@ public class DefaultTreeCellRenderer
* Returns the background color for tree cells that are selected.
* The default value is obtained from the {@link LookAndFeel} defaults
* table using the key <code>Tree.selectionBackground</code>.
- *
+ *
* @return The background color for tree cells that are selected.
- *
+ *
* @see #setBackgroundSelectionColor(Color)
*/
public Color getBackgroundSelectionColor()
@@ -346,9 +346,9 @@ public class DefaultTreeCellRenderer
/**
* Sets the background color for tree cells that are not selected.
- *
+ *
* @param c the color (<code>null</code> permitted).
- *
+ *
* @see #getBackgroundNonSelectionColor()
*/
public void setBackgroundNonSelectionColor(Color c)
@@ -360,9 +360,9 @@ public class DefaultTreeCellRenderer
* Returns the background color for tree cells that are not selected.
* The default value is obtained from the {@link LookAndFeel} defaults
* table using the key <code>Tree.textBackground</code>.
- *
+ *
* @return The background color for tree cells that are not selected.
- *
+ *
* @see #setBackgroundNonSelectionColor(Color)
*/
public Color getBackgroundNonSelectionColor()
@@ -372,9 +372,9 @@ public class DefaultTreeCellRenderer
/**
* Sets the border color for tree cells that are selected.
- *
+ *
* @param c the color (<code>null</code> permitted).
- *
+ *
* @see #getBorderSelectionColor()
*/
public void setBorderSelectionColor(Color c)
@@ -386,9 +386,9 @@ public class DefaultTreeCellRenderer
* Returns the border color for tree cells that are selected.
* The default value is obtained from the {@link LookAndFeel} defaults
* table using the key <code>Tree.selectionBorderColor</code>.
- *
+ *
* @return The border color for tree cells that are selected.
- *
+ *
* @see #setBorderSelectionColor(Color)
*/
public Color getBorderSelectionColor()
@@ -398,9 +398,9 @@ public class DefaultTreeCellRenderer
/**
* Sets the font.
- *
+ *
* @param f the font.
- *
+ *
* @see #getFont()
*/
public void setFont(Font f)
@@ -412,7 +412,7 @@ public class DefaultTreeCellRenderer
/**
* Sets the background color.
- *
+ *
* @param c the color.
*/
public void setBackground(Color c)
@@ -425,7 +425,7 @@ public class DefaultTreeCellRenderer
/**
* Returns a component (in fact <code>this</code>) that can be used to
* render a tree cell with the specified state.
- *
+ *
* @param tree the tree that the cell belongs to.
* @param val the cell value.
* @param selected indicates whether or not the cell is selected.
@@ -433,7 +433,7 @@ public class DefaultTreeCellRenderer
* @param leaf indicates whether or not the cell is a leaf in the tree.
* @param row the row index.
* @param hasFocus indicates whether or not the cell has the focus.
- *
+ *
* @return <code>this</code>.
*/
public Component getTreeCellRendererComponent(JTree tree, Object val,
@@ -461,7 +461,7 @@ public class DefaultTreeCellRenderer
{
super.setBackground(getBackgroundSelectionColor());
setForeground(getTextSelectionColor());
-
+
if (hasFocus)
setBorderSelectionColor(UIManager.getLookAndFeelDefaults().
getColor("Tree.selectionBorderColor"));
@@ -480,9 +480,9 @@ public class DefaultTreeCellRenderer
/**
* Returns the current font.
- *
+ *
* @return The current font.
- *
+ *
* @see #setFont(Font)
*/
public Font getFont()
@@ -492,7 +492,7 @@ public class DefaultTreeCellRenderer
/**
* Paints the value. The background is filled based on selected.
- *
+ *
* @param g the graphics device.
*/
public void paint(Graphics g)
@@ -504,25 +504,25 @@ public class DefaultTreeCellRenderer
else
{
bgColor = getBackgroundNonSelectionColor();
- if (bgColor == null)
+ if (bgColor == null)
bgColor = getBackground();
}
// Paint background.
int xOffset = -1;
if (bgColor != null)
{
- xOffset = getXOffset();
- g.setColor(bgColor);
- g.fillRect(xOffset, 0, getWidth() - xOffset, getHeight());
+ xOffset = getXOffset();
+ g.setColor(bgColor);
+ g.fillRect(xOffset, 0, getWidth() - xOffset, getHeight());
}
if (hasFocus)
{
if (drawsFocusBorderAroundIcon)
xOffset = 0;
- else if (xOffset == -1)
+ else if (xOffset == -1)
xOffset = getXOffset();
- paintFocus(g, xOffset, 0, getWidth() - xOffset, getHeight());
+ paintFocus(g, xOffset, 0, getWidth() - xOffset, getHeight());
}
super.paint(g);
}
@@ -536,7 +536,7 @@ public class DefaultTreeCellRenderer
if (col != null)
{
g.setColor(col);
- g.drawRect(x, y, w - 1, h - 1);
+ g.drawRect(x, y, w - 1, h - 1);
}
}
@@ -557,7 +557,7 @@ public class DefaultTreeCellRenderer
/**
* Returns the preferred size of the cell.
- *
+ *
* @return The preferred size of the cell.
*/
public Dimension getPreferredSize()
@@ -565,7 +565,7 @@ public class DefaultTreeCellRenderer
Dimension size = super.getPreferredSize();
size.width += 3;
return size;
- }
+ }
/**
* For performance reasons, this method is overridden to do nothing.
@@ -573,7 +573,7 @@ public class DefaultTreeCellRenderer
public void validate()
{
// Overridden for performance reasons.
- }
+ }
/**
* For performance reasons, this method is overridden to do nothing.
@@ -581,11 +581,11 @@ public class DefaultTreeCellRenderer
public void revalidate()
{
// Overridden for performance reasons.
- }
+ }
/**
* For performance reasons, this method is overridden to do nothing.
- *
+ *
* @param tm ignored
* @param x coordinate of the region to mark as dirty
* @param y coordinate of the region to mark as dirty
@@ -595,26 +595,26 @@ public class DefaultTreeCellRenderer
public void repaint(long tm, int x, int y, int width, int height)
{
// Overridden for performance reasons.
- }
+ }
/**
* For performance reasons, this method is overridden to do nothing.
- *
+ *
* @param area the area to repaint.
*/
public void repaint(Rectangle area)
{
// Overridden for performance reasons.
- }
+ }
/**
* For performance reasons, this method is overridden to do nothing.
- *
+ *
* @param name the property name.
* @param oldValue the old value.
* @param newValue the new value.
*/
- protected void firePropertyChange(String name, Object oldValue,
+ protected void firePropertyChange(String name, Object oldValue,
Object newValue)
{
// Overridden for performance reasons.
@@ -622,7 +622,7 @@ public class DefaultTreeCellRenderer
/**
* For performance reasons, this method is overridden to do nothing.
- *
+ *
* @param name the property name.
* @param oldValue the old value.
* @param newValue the new value.
@@ -634,7 +634,7 @@ public class DefaultTreeCellRenderer
/**
* For performance reasons, this method is overridden to do nothing.
- *
+ *
* @param name the property name.
* @param oldValue the old value.
* @param newValue the new value.
@@ -646,7 +646,7 @@ public class DefaultTreeCellRenderer
/**
* For performance reasons, this method is overridden to do nothing.
- *
+ *
* @param name the property name.
* @param oldValue the old value.
* @param newValue the new value.
@@ -654,11 +654,11 @@ public class DefaultTreeCellRenderer
public void firePropertyChange(String name, short oldValue, short newValue)
{
// Overridden for performance reasons.
- }
+ }
/**
* For performance reasons, this method is overridden to do nothing.
- *
+ *
* @param name the property name.
* @param oldValue the old value.
* @param newValue the new value.
@@ -670,7 +670,7 @@ public class DefaultTreeCellRenderer
/**
* For performance reasons, this method is overridden to do nothing.
- *
+ *
* @param name the property name.
* @param oldValue the old value.
* @param newValue the new value.
@@ -682,7 +682,7 @@ public class DefaultTreeCellRenderer
/**
* For performance reasons, this method is overridden to do nothing.
- *
+ *
* @param name the property name.
* @param oldValue the old value.
* @param newValue the new value.
@@ -694,7 +694,7 @@ public class DefaultTreeCellRenderer
/**
* For performance reasons, this method is overridden to do nothing.
- *
+ *
* @param name the property name.
* @param oldValue the old value.
* @param newValue the new value.
@@ -706,15 +706,15 @@ public class DefaultTreeCellRenderer
/**
* For performance reasons, this method is overridden to do nothing.
- *
+ *
* @param name the property name.
* @param oldValue the old value.
* @param newValue the new value.
*/
- public void firePropertyChange(String name, boolean oldValue,
+ public void firePropertyChange(String name, boolean oldValue,
boolean newValue)
{
// Overridden for performance reasons.
- }
+ }
-}
+}
diff --git a/libjava/classpath/javax/swing/tree/DefaultTreeModel.java b/libjava/classpath/javax/swing/tree/DefaultTreeModel.java
index afee7ea..0fa4445 100644
--- a/libjava/classpath/javax/swing/tree/DefaultTreeModel.java
+++ b/libjava/classpath/javax/swing/tree/DefaultTreeModel.java
@@ -1,6 +1,6 @@
-/* DefaultTreeModel.java --
+/* DefaultTreeModel.java --
Copyright (C) 2002, 2004, 2005, 2006, Free Software Foundation, Inc.
-
+
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
@@ -49,7 +49,7 @@ import javax.swing.event.TreeModelListener;
/**
* DefaultTreeModel
- *
+ *
* @author Andrew Selkirk
*/
public class DefaultTreeModel
@@ -74,7 +74,7 @@ public class DefaultTreeModel
/**
* Constructor DefaultTreeModel where any node can have children.
- *
+ *
* @param root the tree root.
*/
public DefaultTreeModel(TreeNode root)
@@ -85,9 +85,9 @@ public class DefaultTreeModel
/**
* Create the DefaultTreeModel that may check if the nodes can have
* children or not.
- *
+ *
* @param aRoot the tree root.
- * @param asksAllowsChildren if true, each node is asked if it can have
+ * @param asksAllowsChildren if true, each node is asked if it can have
* children. If false, the model does not care about this, supposing, that
* any node can have children.
*/
@@ -101,7 +101,7 @@ public class DefaultTreeModel
/**
* writeObject
- *
+ *
* @param obj the object.
* @exception IOException TODO
*/
@@ -112,7 +112,7 @@ public class DefaultTreeModel
/**
* readObject
- *
+ *
* @param value0 TODO
* @exception IOException TODO
* @exception ClassNotFoundException TODO
@@ -125,7 +125,7 @@ public class DefaultTreeModel
/**
* asksAllowsChildren
- *
+ *
* @return boolean
*/
public boolean asksAllowsChildren()
@@ -135,7 +135,7 @@ public class DefaultTreeModel
/**
* setAsksAllowsChildren
- *
+ *
* @param value TODO
*/
public void setAsksAllowsChildren(boolean value)
@@ -145,7 +145,7 @@ public class DefaultTreeModel
/**
* setRoot
- *
+ *
* @param root the root node.
*/
public void setRoot(TreeNode root)
@@ -155,7 +155,7 @@ public class DefaultTreeModel
/**
* getRoot
- *
+ *
* @return Object
*/
public Object getRoot()
@@ -165,7 +165,7 @@ public class DefaultTreeModel
/**
* getIndexOfChild
- *
+ *
* @param parent TODO
* @param child TODO
* @return int
@@ -182,7 +182,7 @@ public class DefaultTreeModel
/**
* getChild
- *
+ *
* @param node TODO
* @param idx TODO
* @return Object
@@ -197,7 +197,7 @@ public class DefaultTreeModel
/**
* getChildCount
- *
+ *
* @param node TODO
* @return int
*/
@@ -214,7 +214,7 @@ public class DefaultTreeModel
* {@link #asksAllowsChildren} is true, then this checks if the TreeNode
* allows children, otherwise it returns the TreeNode's <code>leaf</code>
* property.
- *
+ *
* @param node the node to check
*
* @return boolean <code>true</code> if the node is a leaf node,
@@ -275,7 +275,7 @@ public class DefaultTreeModel
* changed. It will fire the events, necessary to update the layout caches and
* repaint the tree. The tree will <i>not</i> be properly refreshed if you
* call the JTree.repaint instead.
- *
+ *
* @param node - the tree node, from which the tree nodes have changed
* (inclusive). If you do not know this node, call {@link #reload()}
* instead.
@@ -296,14 +296,14 @@ public class DefaultTreeModel
}
/**
- * Messaged when the user has altered the value for the item
- * identified by path to newValue. If newValue signifies a truly new
+ * Messaged when the user has altered the value for the item
+ * identified by path to newValue. If newValue signifies a truly new
* value the model should post a treeNodesChanged event.
- * This sets the user object of the TreeNode identified by
- * path and posts a node changed. If you use custom user objects
- * in the TreeModel you're going to need to subclass this and set
+ * This sets the user object of the TreeNode identified by
+ * path and posts a node changed. If you use custom user objects
+ * in the TreeModel you're going to need to subclass this and set
* the user object of the changed node to something meaningful.
- *
+ *
* @param path - path to the node that the user has altered
* @param newValue - the new value from the TreeCellEditor
*/
@@ -314,7 +314,7 @@ public class DefaultTreeModel
{
((MutableTreeNode) node).setUserObject(newValue);
int[] ci = null;
- Object[] c = null;
+ Object[] c = null;
Object[] parentPath = path.getPath();
if (path.getPathCount() > 1)
{
@@ -327,17 +327,17 @@ public class DefaultTreeModel
c[0] = node;
parentPath = path.getParentPath().getPath();
}
-
+
fireTreeNodesChanged(this, parentPath, ci, c);
}
}
/**
* Invoked this to insert newChild at location index in parents children.
- * This will then message nodesWereInserted to create the appropriate event.
- * This is the preferred way to add children as it will create the
+ * This will then message nodesWereInserted to create the appropriate event.
+ * This is the preferred way to add children as it will create the
* appropriate event.
- *
+ *
* @param newChild is the node to add to the parent's children
* @param parent is the parent of the newChild
* @param index is the index of the newChild
@@ -353,10 +353,10 @@ public class DefaultTreeModel
}
/**
- * Message this to remove node from its parent. This will message
- * nodesWereRemoved to create the appropriate event. This is the preferred
+ * Message this to remove node from its parent. This will message
+ * nodesWereRemoved to create the appropriate event. This is the preferred
* way to remove a node as it handles the event creation for you.
- *
+ *
* @param node to be removed
*/
public void removeNodeFromParent(MutableTreeNode node)
@@ -373,7 +373,7 @@ public class DefaultTreeModel
/**
* Invoke this method after you've changed how node is to be represented
* in the tree.
- *
+ *
* @param node that was changed
*/
public void nodeChanged(TreeNode node)
@@ -387,10 +387,10 @@ public class DefaultTreeModel
}
/**
- * Invoke this method after you've inserted some TreeNodes
- * into node. childIndices should be the index of the new elements and must
+ * Invoke this method after you've inserted some TreeNodes
+ * into node. childIndices should be the index of the new elements and must
* be sorted in ascending order.
- *
+ *
* @param parent that had a child added to
* @param childIndices of the children added
*/
@@ -403,26 +403,26 @@ public class DefaultTreeModel
}
/**
- * Invoke this method after you've removed some TreeNodes from node.
- * childIndices should be the index of the removed elements and
- * must be sorted in ascending order. And removedChildren should be the
+ * Invoke this method after you've removed some TreeNodes from node.
+ * childIndices should be the index of the removed elements and
+ * must be sorted in ascending order. And removedChildren should be the
* array of the children objects that were removed.
- *
+ *
* @param parent that had a child added to
* @param childIndices of the children added
* @param removedChildren are all the children removed from parent.
*/
- public void nodesWereRemoved(TreeNode parent, int[] childIndices,
+ public void nodesWereRemoved(TreeNode parent, int[] childIndices,
Object[] removedChildren)
{
- fireTreeNodesRemoved(this, getPathToRoot(parent), childIndices,
+ fireTreeNodesRemoved(this, getPathToRoot(parent), childIndices,
removedChildren);
}
/**
- * Invoke this method after you've changed how the children identified by
+ * Invoke this method after you've changed how the children identified by
* childIndices are to be represented in the tree.
- *
+ *
* @param node that is the parent of the children that changed in a tree.
* @param childIndices are the child nodes that changed.
*/
@@ -435,9 +435,9 @@ public class DefaultTreeModel
}
/**
- * Invoke this method if you've totally changed the children of node and
+ * Invoke this method if you've totally changed the children of node and
* its childrens children. This will post a treeStructureChanged event.
- *
+ *
* @param node that had its children and grandchildren changed.
*/
public void nodeStructureChanged(TreeNode node)
@@ -456,10 +456,10 @@ public class DefaultTreeModel
}
/**
- * Builds the parents of node up to and including the root node, where
- * the original node is the last element in the returned array. The
+ * Builds the parents of node up to and including the root node, where
+ * the original node is the last element in the returned array. The
* length of the returned array gives the node's depth in the tree.
- *
+ *
* @param node - the TreeNode to get the path for
* @return TreeNode[] - the path from node to the root
*/
@@ -469,14 +469,14 @@ public class DefaultTreeModel
}
/**
- * Builds the parents of node up to and including the root node, where
- * the original node is the last element in the returned array. The
+ * Builds the parents of node up to and including the root node, where
+ * the original node is the last element in the returned array. The
* length of the returned array gives the node's depth in the tree.
- *
+ *
* @param node - the TreeNode to get the path for
- * @param depth - an int giving the number of steps already taken
+ * @param depth - an int giving the number of steps already taken
* towards the root (on recursive calls), used to size the returned array
- * @return an array of TreeNodes giving the path from the root to the
+ * @return an array of TreeNodes giving the path from the root to the
* specified node
*/
protected TreeNode[] getPathToRoot(TreeNode node, int depth)
@@ -485,7 +485,7 @@ public class DefaultTreeModel
{
if (depth == 0)
return null;
-
+
return new TreeNode[depth];
}
@@ -496,7 +496,7 @@ public class DefaultTreeModel
/**
* Registers a listere to the model.
- *
+ *
* @param listener the listener to add
*/
public void addTreeModelListener(TreeModelListener listener)
@@ -506,7 +506,7 @@ public class DefaultTreeModel
/**
* Removes a listener from the model.
- *
+ *
* @param listener the listener to remove
*/
public void removeTreeModelListener(TreeModelListener listener)
@@ -516,9 +516,9 @@ public class DefaultTreeModel
/**
* Returns all registered <code>TreeModelListener</code> listeners.
- *
+ *
* @return an array of listeners.
- *
+ *
* @since 1.4
*/
public TreeModelListener[] getTreeModelListeners()
@@ -528,10 +528,10 @@ public class DefaultTreeModel
}
/**
- * Notifies all listeners that have registered interest for notification
- * on this event type. The event instance is lazily created using the parameters
+ * Notifies all listeners that have registered interest for notification
+ * on this event type. The event instance is lazily created using the parameters
* passed into the fire method.
- *
+ *
* @param source the node being changed
* @param path the path to the root node
* @param childIndices the indices of the changed elements
@@ -551,7 +551,7 @@ public class DefaultTreeModel
/**
* 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
@@ -570,7 +570,7 @@ public class DefaultTreeModel
/**
* 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
@@ -589,7 +589,7 @@ public class DefaultTreeModel
/**
* 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
diff --git a/libjava/classpath/javax/swing/tree/DefaultTreeSelectionModel.java b/libjava/classpath/javax/swing/tree/DefaultTreeSelectionModel.java
index b2806f2..29add0e 100644
--- a/libjava/classpath/javax/swing/tree/DefaultTreeSelectionModel.java
+++ b/libjava/classpath/javax/swing/tree/DefaultTreeSelectionModel.java
@@ -1,6 +1,6 @@
-/* DefaultTreeSelectionModel.java
+/* DefaultTreeSelectionModel.java
Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
-
+
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
@@ -63,7 +63,7 @@ import javax.swing.event.TreeSelectionListener;
* listeners are notified about the path and not the row changes. If you
* specifically need to track the row changes, register the listener for the
* expansion events.
- *
+ *
* @author Andrew Selkirk
* @author Audrius Meskauskas
*/
@@ -195,13 +195,13 @@ public class DefaultTreeSelectionModel
* Creates a clone of this DefaultTreeSelectionModel with the same selection.
* The cloned instance will have the same registered listeners, the listeners
* themselves will not be cloned. The selection will be cloned.
- *
+ *
* @exception CloneNotSupportedException should not be thrown here
* @return a copy of this DefaultTreeSelectionModel
*/
public Object clone() throws CloneNotSupportedException
{
- DefaultTreeSelectionModel cloned =
+ DefaultTreeSelectionModel cloned =
(DefaultTreeSelectionModel) super.clone();
cloned.changeSupport = null;
cloned.selection = (TreePath[]) selection.clone();
@@ -217,10 +217,10 @@ public class DefaultTreeSelectionModel
/**
* Returns a string that shows this object's properties.
* The returned string lists the selected tree rows, if any.
- *
+ *
* @return a string that shows this object's properties
*/
- public String toString()
+ public String toString()
{
if (isSelectionEmpty())
return "[selection empty]";
@@ -239,7 +239,7 @@ public class DefaultTreeSelectionModel
/**
* writeObject
- *
+ *
* @param value0 TODO
* @exception IOException TODO
*/
@@ -250,7 +250,7 @@ public class DefaultTreeSelectionModel
/**
* readObject
- *
+ *
* @param value0 TODO
* @exception IOException TODO
* @exception ClassNotFoundException TODO
@@ -263,7 +263,7 @@ public class DefaultTreeSelectionModel
/**
* Sets the RowMapper that should be used to map between paths and their rows.
- *
+ *
* @param mapper the RowMapper to set
* @see RowMapper
*/
@@ -276,7 +276,7 @@ public class DefaultTreeSelectionModel
/**
* Returns the RowMapper that is currently used to map between paths and their
* rows.
- *
+ *
* @return the current RowMapper
* @see RowMapper
*/
@@ -289,7 +289,7 @@ public class DefaultTreeSelectionModel
* 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 #getSelectionMode
* @see #SINGLE_TREE_SELECTION
@@ -314,7 +314,7 @@ public class DefaultTreeSelectionModel
/**
* Returns the current selection mode.
- *
+ *
* @return the current selection mode
* @see #setSelectionMode
* @see #SINGLE_TREE_SELECTION
@@ -329,7 +329,7 @@ public class DefaultTreeSelectionModel
/**
* 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)
@@ -339,10 +339,10 @@ public class DefaultTreeSelectionModel
paths = new TreePath[]{ path };
setSelectionPaths(paths);
}
-
+
/**
* Get the number of the tree row for the given path.
- *
+ *
* @param path the tree path
* @return the tree row for this path or -1 if the path is not visible.
*/
@@ -373,7 +373,7 @@ public class DefaultTreeSelectionModel
* 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[] paths)
@@ -468,10 +468,10 @@ public class DefaultTreeSelectionModel
* 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.
- *
- * The lead path is changed to the added path. This also happen if the
+ *
+ * The lead path is changed to the added path. This also happen if the
* passed path was already selected before.
- *
+ *
* @param path the path to add to the selection
*/
public void addSelectionPath(TreePath path)
@@ -487,7 +487,7 @@ public class DefaultTreeSelectionModel
* 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[] paths)
@@ -568,7 +568,7 @@ public class DefaultTreeSelectionModel
/**
* 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 path)
@@ -580,7 +580,7 @@ public class DefaultTreeSelectionModel
/**
* Removes the paths from the selection. If this changes the selection the
* registered TreeSelectionListeners are notified.
- *
+ *
* @param paths the paths to remove
*/
public void removeSelectionPaths(TreePath[] paths)
@@ -639,7 +639,7 @@ public class DefaultTreeSelectionModel
/**
* 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()
@@ -652,7 +652,7 @@ public class DefaultTreeSelectionModel
/**
* Returns the complete selection.
- *
+ *
* @return the complete selection
*/
public TreePath[] getSelectionPaths()
@@ -662,7 +662,7 @@ public class DefaultTreeSelectionModel
/**
* Returns the number of paths in the selection.
- *
+ *
* @return the number of paths in the selection
*/
public int getSelectionCount()
@@ -675,7 +675,7 @@ public class DefaultTreeSelectionModel
/**
* 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
@@ -695,7 +695,7 @@ public class DefaultTreeSelectionModel
/**
* Checks if the selection is empty.
- *
+ *
* @return <code>true</code> if the selection is empty, <code>false</code>
* otherwise
*/
@@ -729,7 +729,7 @@ public class DefaultTreeSelectionModel
/**
* Adds a <code>TreeSelectionListener</code> object to this model.
- *
+ *
* @param listener the listener to add
*/
public void addTreeSelectionListener(TreeSelectionListener listener)
@@ -739,7 +739,7 @@ public class DefaultTreeSelectionModel
/**
* Removes a <code>TreeSelectionListener</code> object from this model.
- *
+ *
* @param listener the listener to remove
*/
public void removeTreeSelectionListener(TreeSelectionListener listener)
@@ -749,7 +749,7 @@ public class DefaultTreeSelectionModel
/**
* Returns all <code>TreeSelectionListener</code> added to this model.
- *
+ *
* @return an array of listeners
* @since 1.4
*/
@@ -760,7 +760,7 @@ public class DefaultTreeSelectionModel
/**
* fireValueChanged
- *
+ *
* @param event the event to fire.
*/
protected void fireValueChanged(TreeSelectionEvent event)
@@ -773,7 +773,7 @@ public class DefaultTreeSelectionModel
/**
* Returns all added listeners of a special type.
- *
+ *
* @param listenerType the listener type
* @return an array of listeners
* @since 1.3
@@ -785,7 +785,7 @@ public class DefaultTreeSelectionModel
/**
* Returns the currently selected rows.
- *
+ *
* @return the currently selected rows
*/
public int[] getSelectionRows()
@@ -802,7 +802,7 @@ public class DefaultTreeSelectionModel
{
if (rows[i] == -1)
invisible++;
-
+
}
// Clean up invisible rows.
if (invisible > 0)
@@ -831,7 +831,7 @@ public class DefaultTreeSelectionModel
/**
* Returns the smallest row index from the selection.
- *
+ *
* @return the smallest row index from the selection
*/
public int getMinSelectionRow()
@@ -841,7 +841,7 @@ public class DefaultTreeSelectionModel
/**
* Returns the largest row index from the selection.
- *
+ *
* @return the largest row index from the selection
*/
public int getMaxSelectionRow()
@@ -851,7 +851,7 @@ public class DefaultTreeSelectionModel
/**
* 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
@@ -899,7 +899,7 @@ public class DefaultTreeSelectionModel
/**
* getLeadSelectionRow
- *
+ *
* @return int
*/
public int getLeadSelectionRow()
@@ -909,7 +909,7 @@ public class DefaultTreeSelectionModel
/**
* getLeadSelectionPath
- *
+ *
* @return TreePath
*/
public TreePath getLeadSelectionPath()
@@ -919,7 +919,7 @@ public class DefaultTreeSelectionModel
/**
* Adds a <code>PropertyChangeListener</code> object to this model.
- *
+ *
* @param listener the listener to add.
*/
public void addPropertyChangeListener(PropertyChangeListener listener)
@@ -931,7 +931,7 @@ public class DefaultTreeSelectionModel
/**
* Removes a <code>PropertyChangeListener</code> object from this model.
- *
+ *
* @param listener the listener to remove.
*/
public void removePropertyChangeListener(PropertyChangeListener listener)
@@ -942,7 +942,7 @@ public class DefaultTreeSelectionModel
/**
* Returns all added <code>PropertyChangeListener</code> objects.
- *
+ *
* @return an array of listeners.
* @since 1.4
*/
@@ -1000,12 +1000,12 @@ public class DefaultTreeSelectionModel
&& selection.length > 1)
setSelectionPath(selection[0]);
}
-
+
/**
* Returns <code>true</code> if the paths are contiguous (take subsequent
* rows in the diplayed tree view. The method returns <code>true</code> if
* 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
@@ -1038,7 +1038,7 @@ public class DefaultTreeSelectionModel
selected.set(row);
valid++;
}
-
+
}
}
int max = valid + min;
@@ -1057,7 +1057,7 @@ public class DefaultTreeSelectionModel
* <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
@@ -1107,11 +1107,11 @@ public class DefaultTreeSelectionModel
return false;
return true;
}
-
+
/**
* 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
@@ -1121,20 +1121,20 @@ public class DefaultTreeSelectionModel
if (rowMapper == null || isSelectionEmpty()
|| selectionMode == DISCONTIGUOUS_TREE_SELECTION)
return true;
-
+
HashSet<TreePath> set = new HashSet<TreePath>();
for (int i = 0; i < selection.length; i++)
set.add(selection[i]);
-
+
for (int i = 0; i < paths.length; i++)
set.remove(paths[i]);
-
+
TreePath[] remaining = new TreePath[set.size()];
Iterator<TreePath> iter = set.iterator();
-
+
for (int i = 0; i < remaining.length; i++)
remaining[i] = iter.next();
-
+
return arePathsContiguous(remaining);
}
@@ -1142,12 +1142,12 @@ public class DefaultTreeSelectionModel
* Notify the installed listeners that the given patches have changed. This
* method will call listeners if invoked, but it is not called from the
* implementation of this class.
- *
+ *
* @param vPaths the vector of the changed patches
* @param oldLeadSelection the old selection index
*/
protected void notifyPathChange(Vector<PathPlaceHolder> vPaths,
- TreePath oldLeadSelection)
+ TreePath oldLeadSelection)
{
int numChangedPaths = vPaths.size();
diff --git a/libjava/classpath/javax/swing/tree/ExpandVetoException.java b/libjava/classpath/javax/swing/tree/ExpandVetoException.java
index 57531d5..fd6330c 100644
--- a/libjava/classpath/javax/swing/tree/ExpandVetoException.java
+++ b/libjava/classpath/javax/swing/tree/ExpandVetoException.java
@@ -43,7 +43,7 @@ import javax.swing.event.TreeExpansionEvent;
* ExpandVetoException
* @author Andrew Selkirk
*/
-public class ExpandVetoException extends Exception
+public class ExpandVetoException extends Exception
{
/**
@@ -56,21 +56,21 @@ public class ExpandVetoException extends Exception
* Constructor ExpandVetoException
* @param event Tree Expansion Event
*/
- public ExpandVetoException(TreeExpansionEvent event)
+ public ExpandVetoException(TreeExpansionEvent event)
{
super();
this.event = event;
- }
+ }
/**
* Constructor ExpandVetoException
* @param event Tree Expansion Event
* @param message Message
*/
- public ExpandVetoException(TreeExpansionEvent event, String message)
+ public ExpandVetoException(TreeExpansionEvent event, String message)
{
super(message);
this.event = event;
- }
+ }
-}
+}
diff --git a/libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java b/libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java
index 89f05d3..6ff2e35 100644
--- a/libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java
+++ b/libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java
@@ -55,13 +55,13 @@ import javax.swing.event.TreeModelEvent;
* have the same fixed height. This may be not the case, for instance, if leaves
* and branches have different height, of if the tree rows may have arbitrary
* variable height. This class will also work if the NodeDimensions are not
- * set.
- *
+ * set.
+ *
* @author Audrius Meskauskas
- * @author Andrew Selkirk
+ * @author Andrew Selkirk
*/
public class FixedHeightLayoutCache
- extends VariableHeightLayoutCache
+ extends VariableHeightLayoutCache
{
/**
* The cached node record.
@@ -74,47 +74,47 @@ public class FixedHeightLayoutCache
depth = aDepth;
parent = aParent;
node = aNode;
-
- isExpanded = expanded.contains(aNode);
+
+ isExpanded = expanded.contains(aNode);
}
-
+
/**
* The row, where the tree node is displayed.
*/
- final int row;
-
+ final int row;
+
/**
* The nesting depth
*/
final int depth;
-
+
/**
* The parent of the given node, null for the root node.
*/
final Object parent;
-
+
/**
* This node.
*/
final Object node;
-
+
/**
* True for the expanded nodes. The value is calculated in constructor.
* Using this field saves one hashtable access operation.
*/
final boolean isExpanded;
-
+
/**
* The cached bounds of the tree row.
*/
Rectangle bounds;
-
+
/**
* The path from the tree top to the given node (computed under first
* demand)
*/
private TreePath path;
-
+
/**
* Get the path for this node. The derived class is returned,
* making check for the last child of some parent easier.
@@ -155,7 +155,7 @@ public class FixedHeightLayoutCache
}
return path;
}
-
+
/**
* Get the rectangle bounds (compute, if required).
*/
@@ -164,37 +164,37 @@ public class FixedHeightLayoutCache
// This method may be called in the context when the tree rectangle is
// not known. To work around this, it is assumed near infinitely large.
if (bounds == null)
- bounds = getNodeDimensions(node, row, depth, isExpanded,
+ bounds = getNodeDimensions(node, row, depth, isExpanded,
new Rectangle());
- return bounds;
+ return bounds;
}
}
-
+
/**
* The set of all expanded tree nodes.
*/
Set<Object> expanded = new HashSet<Object>();
-
+
/**
* Maps nodes to the row numbers.
*/
Hashtable<Object,NodeRecord> nodes = new Hashtable<Object,NodeRecord>();
-
+
/**
* Maps row numbers to nodes.
*/
Hashtable<Integer,Object> row2node = new Hashtable<Integer,Object>();
-
+
/**
* If true, the row map must be recomputed before using.
*/
boolean dirty;
-
+
/**
* The cumulative height of all rows.
*/
int totalHeight;
-
+
/**
* The maximal width.
*/
@@ -208,21 +208,21 @@ public class FixedHeightLayoutCache
public FixedHeightLayoutCache()
{
// Nothing to do here.
- }
+ }
/**
* Get the total number of rows in the tree. Every displayed node occupies the
* single row. The root node row is included if the root node is set as
* visible (false by default).
- *
+ *
* @return int the number of the displayed rows.
*/
public int getRowCount()
{
if (dirty) update();
return row2node.size();
- }
-
+ }
+
/**
* Refresh the row map.
*/
@@ -230,7 +230,7 @@ public class FixedHeightLayoutCache
{
nodes.clear();
row2node.clear();
-
+
totalHeight = maximalWidth = 0;
Object root = treeModel.getRoot();
@@ -250,7 +250,7 @@ public class FixedHeightLayoutCache
}
dirty = false;
}
-
+
/**
* Recursively counts all rows in the tree.
*/
@@ -258,10 +258,10 @@ public class FixedHeightLayoutCache
{
Integer n = new Integer(row2node.size());
row2node.put(n, node);
-
+
NodeRecord nr = new NodeRecord(n.intValue(), depth, node, parent);
nodes.put(node, nr);
-
+
// For expanded nodes and for the root node.
if (expanded.contains(node))
{
@@ -277,7 +277,7 @@ public class FixedHeightLayoutCache
/**
* Discard the bound information for the given path.
- *
+ *
* @param path the path, for that the bound information must be recomputed.
*/
public void invalidatePathBounds(TreePath path)
@@ -285,7 +285,7 @@ public class FixedHeightLayoutCache
NodeRecord r = (NodeRecord) nodes.get(path.getLastPathComponent());
if (r != null)
r.bounds = null;
- }
+ }
/**
* Mark all cached information as invalid.
@@ -293,11 +293,11 @@ public class FixedHeightLayoutCache
public void invalidateSizes()
{
dirty = true;
- }
+ }
/**
* Set the expanded state of the given path. The expansion states must be
- * always updated when expanding and colapsing the tree nodes. Otherwise
+ * always updated when expanding and colapsing the tree nodes. Otherwise
* other methods will not work correctly after the nodes are collapsed or
* expanded.
*
@@ -310,23 +310,23 @@ public class FixedHeightLayoutCache
expanded.add(path.getLastPathComponent());
else
expanded.remove(path.getLastPathComponent());
-
+
dirty = true;
}
-
+
/**
* Get the expanded state for the given tree path.
- *
+ *
* @return true if the given path is expanded, false otherwise.
*/
public boolean isExpanded(TreePath path)
{
return expanded.contains(path.getLastPathComponent());
- }
+ }
/**
* Get bounds for the given tree path.
- *
+ *
* @param path the tree path
* @param rect the rectangle that will be reused to return the result.
* @return Rectangle the bounds of the last line, defined by the given path.
@@ -356,11 +356,11 @@ public class FixedHeightLayoutCache
rect.setRect(r.bounds);
}
return rect;
- }
+ }
/**
* Get the path, the last element of that is displayed in the given row.
- *
+ *
* @param row the row
* @return TreePath the path
*/
@@ -376,11 +376,11 @@ public class FixedHeightLayoutCache
NodeRecord r = nodes.get(last);
return r.getPath();
}
- }
+ }
/**
* Get the row, displaying the last node of the given path.
- *
+ *
* @param path the path
* @return int the row number or -1 if the end of the path is not visible.
*/
@@ -388,7 +388,7 @@ public class FixedHeightLayoutCache
{
if (path == null)
return -1;
-
+
if (dirty) update();
NodeRecord r = nodes.get(path.getLastPathComponent());
@@ -396,11 +396,11 @@ public class FixedHeightLayoutCache
return - 1;
else
return r.row;
- }
+ }
/**
* Get the path, closest to the given point.
- *
+ *
* @param x the point x coordinate
* @param y the point y coordinate
* @return the tree path, closest to the the given point
@@ -414,7 +414,7 @@ public class FixedHeightLayoutCache
NodeRecord best = null;
NodeRecord r;
Enumeration<NodeRecord> en = nodes.elements();
-
+
int dist = Integer.MAX_VALUE;
while (en.hasMoreElements() && dist > 0)
@@ -440,8 +440,8 @@ public class FixedHeightLayoutCache
return null;
else
return best.getPath();
- }
-
+ }
+
/**
* Get the closest distance from this point till the given rectangle. Only
* vertical distance is taken into consideration.
@@ -461,22 +461,22 @@ public class FixedHeightLayoutCache
* is not expanded, 0 is returned. Otherwise, the number of children is
* obtained from the model as the number of children for the last path
* component.
- *
+ *
* @param path the tree path
* @return int the number of the visible childs (for row).
*/
- public int getVisibleChildCount(TreePath path)
+ public int getVisibleChildCount(TreePath path)
{
if (isExpanded(path))
- return 0;
+ return 0;
else
return treeModel.getChildCount(path.getLastPathComponent());
- }
+ }
/**
* Get the enumeration over all visible paths that start from the given
* parent path.
- *
+ *
* @param parentPath the parent path
* @return the enumeration over pathes
*/
@@ -500,9 +500,9 @@ public class FixedHeightLayoutCache
/**
* Return the expansion state of the given tree path. The expansion state
- * must be previously set with the
+ * must be previously set with the
* {@link #setExpandedState(TreePath, boolean)}
- *
+ *
* @param path the path being checked
* @return true if the last node of the path is expanded, false otherwise.
*/
@@ -513,44 +513,44 @@ public class FixedHeightLayoutCache
/**
* The listener method, called when the tree nodes are changed.
- *
+ *
* @param event the change event
*/
public void treeNodesChanged(TreeModelEvent event)
{
dirty = true;
- }
+ }
/**
* The listener method, called when the tree nodes are inserted.
- *
+ *
* @param event the change event
*/
public void treeNodesInserted(TreeModelEvent event)
{
dirty = true;
- }
+ }
/**
* The listener method, called when the tree nodes are removed.
- *
+ *
* @param event the change event
*/
public void treeNodesRemoved(TreeModelEvent event)
{
dirty = true;
- }
+ }
/**
- * Called when the tree structure has been changed.
- *
+ * Called when the tree structure has been changed.
+ *
* @param event the change event
*/
public void treeStructureChanged(TreeModelEvent event)
{
dirty = true;
- }
-
+ }
+
/**
* Set the tree model that will provide the data.
*/
@@ -561,11 +561,11 @@ public class FixedHeightLayoutCache
expanded.add(treeModel.getRoot());
dirty = true;
}
-
+
/**
* Inform the instance if the tree root node is visible. If this method
* is not called, it is assumed that the tree root node is not visible.
- *
+ *
* @param visible true if the tree root node is visible, false
* otherwise.
*/
@@ -600,7 +600,7 @@ public class FixedHeightLayoutCache
{
if (dirty)
update();
-
+
maximalWidth = 0;
Enumeration<NodeRecord> en = nodes.elements();
while (en.hasMoreElements())
@@ -612,17 +612,17 @@ public class FixedHeightLayoutCache
}
return maximalWidth;
}
-
+
/**
* Returns true if this layout supposes that all rows have the fixed
* height.
- *
+ *
* @return boolean true if all rows in the tree must have the fixed
* height (true by default).
*/
protected boolean isFixedRowHeight()
{
- return true;
+ return true;
}
-
+
}
diff --git a/libjava/classpath/javax/swing/tree/MutableTreeNode.java b/libjava/classpath/javax/swing/tree/MutableTreeNode.java
index 9f0ff4d..4a0f4b6 100644
--- a/libjava/classpath/javax/swing/tree/MutableTreeNode.java
+++ b/libjava/classpath/javax/swing/tree/MutableTreeNode.java
@@ -39,7 +39,7 @@ package javax.swing.tree;
/**
* MutableTreeNode public interface
-
+
* @author Andrew Selkirk
*/
public interface MutableTreeNode extends TreeNode
@@ -79,7 +79,7 @@ public interface MutableTreeNode extends TreeNode
void remove(MutableTreeNode node);
/**
- * Sets a user object, the data represented by the node.
+ * Sets a user object, the data represented by the node.
*
* @param object the data
*/
diff --git a/libjava/classpath/javax/swing/tree/RowMapper.java b/libjava/classpath/javax/swing/tree/RowMapper.java
index 59eb1e3..d62b703 100644
--- a/libjava/classpath/javax/swing/tree/RowMapper.java
+++ b/libjava/classpath/javax/swing/tree/RowMapper.java
@@ -41,7 +41,7 @@ package javax.swing.tree;
* RowMapper public interface
* @author Andrew Selkirk
*/
-public interface RowMapper
+public interface RowMapper
{
/**
@@ -51,4 +51,4 @@ public interface RowMapper
*/
int[] getRowsForPaths(TreePath[] path);
-} \ No newline at end of file
+}
diff --git a/libjava/classpath/javax/swing/tree/TreeCellEditor.java b/libjava/classpath/javax/swing/tree/TreeCellEditor.java
index 8951f31..614f98d 100644
--- a/libjava/classpath/javax/swing/tree/TreeCellEditor.java
+++ b/libjava/classpath/javax/swing/tree/TreeCellEditor.java
@@ -46,26 +46,26 @@ import javax.swing.JTree;
/**
* A <code>TreeCellEditor</code> is used by the {@link JTree} component to
* edit individual tree elements (nodes).
- *
+ *
* @author Andrew Selkirk
*/
public interface TreeCellEditor extends CellEditor
{
/**
- * Returns a component that has been configured to edit one element (or
+ * Returns a component that has been configured to edit one element (or
* node) in a {@link JTree} component. The arguments to this method are used
* to pass in the value and state of the element to be edited.
- *
+ *
* @param tree the tree.
* @param value the value to render.
* @param isSelected is the tree element selected?
* @param expanded is the tree element expanded?
* @param leaf is the tree element a leaf node?
* @param row the row index.
- *
+ *
* @return A component that is configured for editing the tree element.
*/
Component getTreeCellEditorComponent(JTree tree, Object value,
- boolean isSelected, boolean expanded,
- boolean leaf, int row);
+ boolean isSelected, boolean expanded,
+ boolean leaf, int row);
}
diff --git a/libjava/classpath/javax/swing/tree/TreeCellRenderer.java b/libjava/classpath/javax/swing/tree/TreeCellRenderer.java
index b7eeb9c..fdfc0a1 100644
--- a/libjava/classpath/javax/swing/tree/TreeCellRenderer.java
+++ b/libjava/classpath/javax/swing/tree/TreeCellRenderer.java
@@ -45,16 +45,16 @@ import javax.swing.JTree;
/**
* A <code>TreeCellRenderer</code> is used by the {@link JTree} component to
* paint individual tree elements (nodes).
- *
+ *
* @author Andrew Selkirk
*/
public interface TreeCellRenderer
{
/**
- * Returns a component that has been configured to display one element (or
+ * Returns a component that has been configured to display one element (or
* node) in a {@link JTree} component. The arguments to this method are used
* to pass in the value and state of the element to be rendered.
- *
+ *
* @param tree the tree.
* @param value the value to render.
* @param selected is the tree element selected?
@@ -62,7 +62,7 @@ public interface TreeCellRenderer
* @param leaf is the tree element a leaf node?
* @param row the row index.
* @param hasFocus does the tree element have the focus?
- *
+ *
* @return A component that is configured for rendering the tree element.
*/
Component getTreeCellRendererComponent(JTree tree, Object value,
diff --git a/libjava/classpath/javax/swing/tree/TreeNode.java b/libjava/classpath/javax/swing/tree/TreeNode.java
index 53d52f0a..b68b498 100644
--- a/libjava/classpath/javax/swing/tree/TreeNode.java
+++ b/libjava/classpath/javax/swing/tree/TreeNode.java
@@ -42,16 +42,16 @@ import java.util.Enumeration;
/**
* A tree node.
- *
+ *
* @author Andrew Selkirk
*/
-public interface TreeNode
+public interface TreeNode
{
/**
* Returns the parent node for this tree node, or <code>null</code> if this
* node has no parent.
- *
+ *
* @return The parent node (possibly <code>null</code>).
*/
TreeNode getParent();
@@ -59,56 +59,55 @@ public interface TreeNode
/**
* Returns the index of the specified child node, or -1 if the node is not
* in fact a child of this node.
- *
+ *
* @param node the node (<code>null</code> not permitted).
- *
+ *
* @return The index of the specified child node, or -1.
- *
+ *
* @throws IllegalArgumentException if <code>node</code> is <code>null</code>.
*/
int getIndex(TreeNode node);
/**
* Returns the child node at the given index.
- *
- * @param index the index (in the range <code>0</code> to
+ *
+ * @param index the index (in the range <code>0</code> to
* <code>getChildCount() - 1</code>).
- *
+ *
* @return The child node at the given index.
*/
TreeNode getChildAt(int index);
/**
* Returns the number of children for this node.
- *
+ *
* @return The number of children for this node.
*/
int getChildCount();
/**
- * Returns <code>true</code> if this node allows children, and
+ * Returns <code>true</code> if this node allows children, and
* <code>false</code> otherwise.
- *
+ *
* @return A boolean.
*/
boolean getAllowsChildren();
/**
- * Returns <code>true</code> if this node is a leaf node, and
+ * Returns <code>true</code> if this node is a leaf node, and
* <code>false</code> otherwise.
- *
+ *
* @return A boolean.
*/
boolean isLeaf();
/**
- * Returns an enumeration of the children of this node, or an empty
+ * Returns an enumeration of the children of this node, or an empty
* enumeration if this node has no children.
- *
+ *
* @return An enumeration of the children of this node.
*/
@SuppressWarnings("unchecked") // Required for API compatibility
Enumeration children();
-}
-
+}
diff --git a/libjava/classpath/javax/swing/tree/TreePath.java b/libjava/classpath/javax/swing/tree/TreePath.java
index 1c4d787..7649706 100644
--- a/libjava/classpath/javax/swing/tree/TreePath.java
+++ b/libjava/classpath/javax/swing/tree/TreePath.java
@@ -45,7 +45,7 @@ import java.util.Arrays;
* A <code>TreePath</code> represents a sequence of tree elements that form
* a path starting from the root of a tree. A tree element can be represented
* by any {@link Object}.
- *
+ *
* @author Andrew Selkirk
*/
public class TreePath implements Serializable
@@ -57,7 +57,7 @@ public class TreePath implements Serializable
* assumes that the TreePath is immutable, so it is marked final here.
*/
private final Object[] path;
-
+
/**
* The parent path (to be reused).
*/
@@ -68,9 +68,9 @@ public class TreePath implements Serializable
* Creates a path from the list of objects representing tree elements. The
* incoming array is copied so that subsequent changes do not affect this
* tree path.
- *
+ *
* @param path the elements in the path (<code>null</code> not permitted).
- *
+ *
* @throws IllegalArgumentException if <code>path</code> is <code>null</code>.
*/
public TreePath(Object[] path)
@@ -83,10 +83,10 @@ public class TreePath implements Serializable
/**
* Creates a new path from a single element.
- *
+ *
* @param element the element (<code>null</code> not permitted).
- *
- * @throws IllegalArgumentException if <code>element</code> is
+ *
+ * @throws IllegalArgumentException if <code>element</code> is
* <code>null</code>.
*/
public TreePath(Object element)
@@ -98,7 +98,7 @@ public class TreePath implements Serializable
/**
* Creates a new tree path by adding the specified <code>element</code> to
* the <code>path</code>.
- *
+ *
* @param path a tree path.
* @param element a path element.
*/
@@ -117,7 +117,7 @@ public class TreePath implements Serializable
/**
* Creates a new tree path using the first <code>length</code> elements
* from the given array.
- *
+ *
* @param path the path elements.
* @param length the path length.
*/
@@ -139,7 +139,7 @@ public class TreePath implements Serializable
/**
* Returns a hashcode for the path.
- *
+ *
* @return A hashcode.
*/
public int hashCode()
@@ -148,7 +148,7 @@ public class TreePath implements Serializable
}
/**
- * Tests this path for equality with an arbitrary object. An object is
+ * Tests this path for equality with an arbitrary object. An object is
* considered equal to this path if and only if:
* <ul>
* <li>the object is not <code>null</code>;</li>
@@ -156,9 +156,9 @@ public class TreePath implements Serializable
* <li>the object contains the same elements in the same order as this
* {@link TreePath};</li>
* </ul>
- *
+ *
* @param object the object (<code>null</code> permitted).
- *
+ *
* @return <code>true</code> if <code>obj</code> is equal to this tree path,
* and <code>false</code> otherwise.
*/
@@ -188,7 +188,7 @@ public class TreePath implements Serializable
/**
* Returns a string representation of this path.
- *
+ *
* @return A string representation of this path.
*/
public String toString()
@@ -201,7 +201,7 @@ public class TreePath implements Serializable
/**
* Returns an array containing the path elements.
- *
+ *
* @return An array containing the path elements.
*/
public Object[] getPath()
@@ -211,7 +211,7 @@ public class TreePath implements Serializable
/**
* Returns the last object in the path.
- *
+ *
* @return The last object in the path.
*/
public Object getLastPathComponent()
@@ -221,7 +221,7 @@ public class TreePath implements Serializable
/**
* Returns the number of elements in the path.
- *
+ *
* @return The number of elements in the path.
*/
public int getPathCount()
@@ -231,29 +231,29 @@ public class TreePath implements Serializable
/**
* Returns the element at the specified position in the path.
- *
- * @param position the element position (<code>0 &lt N - 1</code>, where
+ *
+ * @param position the element position (<code>0 &lt N - 1</code>, where
* <code>N</code> is the number of elements in the path).
- *
+ *
* @return The element at the specified position.
- *
+ *
* @throws IllegalArgumentException if <code>position</code> is outside the
* valid range.
*/
public Object getPathComponent(int position)
{
- if (position < 0 || position >= getPathCount())
+ if (position < 0 || position >= getPathCount())
throw new IllegalArgumentException("Invalid position: " + position);
return path[position];
}
/**
* Returns <code>true</code> if <code>path</code> is a descendant of this
- * path, and <code>false</code> otherwise. If <code>path</code> is
+ * path, and <code>false</code> otherwise. If <code>path</code> is
* <code>null</code>, this method returns <code>false</code>.
- *
+ *
* @param path the path to check (<code>null</code> permitted).
- *
+ *
* @return <code>true</code> if <code>path</code> is a descendant of this
* path, and <code>false</code> otherwise
*/
@@ -270,16 +270,16 @@ public class TreePath implements Serializable
otherPathLength--;
path = path.getParentPath();
}
-
+
return equals(path);
}
/**
* Creates a new path that is equivalent to this path plus the specified
* element.
- *
+ *
* @param element the element.
- *
+ *
* @return A tree path.
*/
public TreePath pathByAddingChild(Object element)
@@ -291,7 +291,7 @@ public class TreePath implements Serializable
* Returns the parent path, which is a path containing all the same elements
* as this path, except for the last one. If this path contains only one
* element, the method returns <code>null</code>.
- *
+ *
* @return The parent path, or <code>null</code> if this path has only one
* element.
*/
@@ -301,12 +301,12 @@ public class TreePath implements Serializable
// is what the JDK does.
if (path.length <= 1)
return null;
-
+
// Reuse the parent path, if possible. The parent path is requested
// during the tree repainting, so reusing generates a lot less garbage.
if (parentPath == null)
parentPath = new TreePath(this.getPath(), path.length - 1);
-
+
return parentPath;
}
}
diff --git a/libjava/classpath/javax/swing/tree/TreeSelectionModel.java b/libjava/classpath/javax/swing/tree/TreeSelectionModel.java
index 9bdc99b..f2ba02a 100644
--- a/libjava/classpath/javax/swing/tree/TreeSelectionModel.java
+++ b/libjava/classpath/javax/swing/tree/TreeSelectionModel.java
@@ -46,7 +46,7 @@ import javax.swing.event.TreeSelectionListener;
* TreeSelectionModel public interface
* @author Andrew Selkirk
*/
-public interface TreeSelectionModel
+public interface TreeSelectionModel
{
int SINGLE_TREE_SELECTION = 1;
diff --git a/libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java b/libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java
index aac6869..0887061 100644
--- a/libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java
+++ b/libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java
@@ -53,11 +53,11 @@ import javax.swing.event.TreeModelEvent;
/**
* The fixed height tree layout. This class requires the NodeDimensions to be
* set and ignores the row height property.
- *
+ *
* @specnote the methods, of this class, returning TreePath, actually returns
* the derived class GnuPath that provides additional information for optimized
* painting. See the GnuPath code for details.
- *
+ *
* @author Audrius Meskauskas
*/
public class VariableHeightLayoutCache
@@ -80,27 +80,27 @@ public class VariableHeightLayoutCache
isExpanded = expanded.contains(aNode);
bounds = new Rectangle(0, -1, 0, 0);
}
-
+
/**
* The row, where the tree node is displayed.
*/
- final int row;
-
+ final int row;
+
/**
* The nesting depth
*/
final int depth;
-
+
/**
* The parent of the given node, null for the root node.
*/
final Object parent;
-
+
/**
* This node.
*/
final Object node;
-
+
/**
* True for the expanded nodes. The value is calculated in constructor.
* Using this field saves one hashtable access operation.
@@ -111,13 +111,13 @@ public class VariableHeightLayoutCache
* The cached bounds of the tree row.
*/
Rectangle bounds;
-
+
/**
* The path from the tree top to the given node (computed under first
* demand)
*/
private TreePath path;
-
+
/**
* Get the path for this node. The derived class is returned, making check
* for the last child of some parent easier.
@@ -158,41 +158,41 @@ public class VariableHeightLayoutCache
}
return path;
}
-
+
/**
* Get the rectangle bounds (compute, if required).
*/
Rectangle getBounds()
{
- return bounds;
+ return bounds;
}
}
-
+
/**
* The set of all expanded tree nodes.
*/
Set<Object> expanded = new HashSet<Object>();
-
+
/**
* Maps nodes to the row numbers.
*/
Hashtable<Object,NodeRecord> nodes = new Hashtable<Object,NodeRecord>();
-
+
/**
* Maps row numbers to nodes.
*/
ArrayList<Object> row2node = new ArrayList<Object>();
-
+
/**
* If true, the row map must be recomputed before using.
*/
boolean dirty;
-
+
/**
* The cumulative height of all rows.
*/
int totalHeight;
-
+
/**
* The maximal width.
*/
@@ -206,21 +206,21 @@ public class VariableHeightLayoutCache
public VariableHeightLayoutCache()
{
// Nothing to do here.
- }
+ }
/**
* Get the total number of rows in the tree. Every displayed node occupies the
* single row. The root node row is included if the root node is set as
* visible (false by default).
- *
+ *
* @return int the number of the displayed rows.
*/
public int getRowCount()
{
if (dirty) update();
return row2node.size();
- }
-
+ }
+
/**
* Refresh the row map.
*/
@@ -228,7 +228,7 @@ public class VariableHeightLayoutCache
{
nodes.clear();
row2node.clear();
-
+
totalHeight = maximalWidth = 0;
if (treeModel == null)
@@ -238,7 +238,7 @@ public class VariableHeightLayoutCache
countRows(root, null, 0, 0);
dirty = false;
}
-
+
/**
* Recursively counts all rows in the tree.
*/
@@ -287,7 +287,7 @@ public class VariableHeightLayoutCache
/**
* Discard the bound information for the given path.
- *
+ *
* @param path the path, for that the bound information must be recomputed.
*/
public void invalidatePathBounds(TreePath path)
@@ -295,7 +295,7 @@ public class VariableHeightLayoutCache
NodeRecord r = nodes.get(path.getLastPathComponent());
if (r != null)
r.bounds = null;
- }
+ }
/**
* Mark all cached information as invalid.
@@ -303,11 +303,11 @@ public class VariableHeightLayoutCache
public void invalidateSizes()
{
dirty = true;
- }
+ }
/**
* Set the expanded state of the given path. The expansion states must be
- * always updated when expanding and colapsing the tree nodes. Otherwise
+ * always updated when expanding and colapsing the tree nodes. Otherwise
* other methods will not work correctly after the nodes are collapsed or
* expanded.
*
@@ -327,20 +327,20 @@ public class VariableHeightLayoutCache
dirty = true;
}
-
+
/**
* Get the expanded state for the given tree path.
- *
+ *
* @return true if the given path is expanded, false otherwise.
*/
public boolean isExpanded(TreePath path)
{
return expanded.contains(path.getLastPathComponent());
- }
+ }
/**
* Get bounds for the given tree path.
- *
+ *
* @param path the tree path
* @param rect the rectangle that will be reused to return the result.
* @return Rectangle the bounds of the last line, defined by the given path.
@@ -366,11 +366,11 @@ public class VariableHeightLayoutCache
result.setBounds(r.bounds);
}
return result;
- }
+ }
/**
* Get the path, the last element of that is displayed in the given row.
- *
+ *
* @param row the row
* @return TreePath the path
*/
@@ -389,11 +389,11 @@ public class VariableHeightLayoutCache
path = record.getPath();
}
return path;
- }
+ }
/**
* Get the row, displaying the last node of the given path.
- *
+ *
* @param path the path
* @return int the row number or -1 if the end of the path is not visible.
*/
@@ -410,11 +410,11 @@ public class VariableHeightLayoutCache
return - 1;
else
return r.row;
- }
+ }
/**
* Get the path, closest to the given point.
- *
+ *
* @param x the point x coordinate
* @param y the point y coordinate
* @return the tree path, closest to the the given point
@@ -428,7 +428,7 @@ public class VariableHeightLayoutCache
NodeRecord best = null;
NodeRecord r;
Enumeration<NodeRecord> en = nodes.elements();
-
+
int dist = Integer.MAX_VALUE;
while (en.hasMoreElements() && dist > 0)
@@ -454,8 +454,8 @@ public class VariableHeightLayoutCache
return null;
else
return best.getPath();
- }
-
+ }
+
/**
* Get the closest distance from this point till the given rectangle. Only
* vertical distance is taken into consideration.
@@ -475,22 +475,22 @@ public class VariableHeightLayoutCache
* is not expanded, 0 is returned. Otherwise, the number of children is
* obtained from the model as the number of children for the last path
* component.
- *
+ *
* @param path the tree path
* @return int the number of the visible childs (for row).
*/
- public int getVisibleChildCount(TreePath path)
+ public int getVisibleChildCount(TreePath path)
{
if (! isExpanded(path) || treeModel == null)
- return 0;
+ return 0;
else
return treeModel.getChildCount(path.getLastPathComponent());
- }
+ }
/**
* Get the enumeration over all visible paths that start from the given
* parent path.
- *
+ *
* @param parentPath the parent path
* @return the enumeration over pathes
*/
@@ -514,9 +514,9 @@ public class VariableHeightLayoutCache
/**
* Return the expansion state of the given tree path. The expansion state
- * must be previously set with the
+ * must be previously set with the
* {@link #setExpandedState(TreePath, boolean)}
- *
+ *
* @param path the path being checked
* @return true if the last node of the path is expanded, false otherwise.
*/
@@ -527,44 +527,44 @@ public class VariableHeightLayoutCache
/**
* The listener method, called when the tree nodes are changed.
- *
+ *
* @param event the change event
*/
public void treeNodesChanged(TreeModelEvent event)
{
dirty = true;
- }
+ }
/**
* The listener method, called when the tree nodes are inserted.
- *
+ *
* @param event the change event
*/
public void treeNodesInserted(TreeModelEvent event)
{
dirty = true;
- }
+ }
/**
* The listener method, called when the tree nodes are removed.
- *
+ *
* @param event the change event
*/
public void treeNodesRemoved(TreeModelEvent event)
{
dirty = true;
- }
+ }
/**
- * Called when the tree structure has been changed.
- *
+ * Called when the tree structure has been changed.
+ *
* @param event the change event
*/
public void treeStructureChanged(TreeModelEvent event)
{
dirty = true;
- }
-
+ }
+
/**
* Set the tree model that will provide the data.
*/
@@ -578,11 +578,11 @@ public class VariableHeightLayoutCache
expanded.add(treeModel.getRoot());
}
}
-
+
/**
* Inform the instance if the tree root node is visible. If this method
* is not called, it is assumed that the tree root node is not visible.
- *
+ *
* @param visible true if the tree root node is visible, false
* otherwise.
*/
@@ -616,7 +616,7 @@ public class VariableHeightLayoutCache
{
if (dirty)
update();
-
+
maximalWidth = 0;
Enumeration<NodeRecord> en = nodes.elements();
while (en.hasMoreElements())