diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 | 
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 | 
| commit | 65bf3316cf384588453604be6b4f0ed3751a8b0f (patch) | |
| tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/classpath/javax/swing/tree/AbstractLayoutCache.java | |
| parent | 8fc56618a84446beccd45b80381cdfe0e94050df (diff) | |
| download | ppe42-gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.tar.gz ppe42-gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.zip | |
Merged gcj-eclipse branch to trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120621 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/javax/swing/tree/AbstractLayoutCache.java')
| -rw-r--r-- | libjava/classpath/javax/swing/tree/AbstractLayoutCache.java | 27 | 
1 files changed, 19 insertions, 8 deletions
| diff --git a/libjava/classpath/javax/swing/tree/AbstractLayoutCache.java b/libjava/classpath/javax/swing/tree/AbstractLayoutCache.java index 155343f5bcc..4a6899fbeae 100644 --- a/libjava/classpath/javax/swing/tree/AbstractLayoutCache.java +++ b/libjava/classpath/javax/swing/tree/AbstractLayoutCache.java @@ -149,9 +149,11 @@ public abstract class AbstractLayoutCache    protected Rectangle getNodeDimensions(Object value, int row, int depth,                                          boolean expanded, Rectangle bounds)    { -    if (nodeDimensions == null) -      throw new InternalError("The NodeDimensions are not set"); -    return nodeDimensions.getNodeDimensions(value, row, depth, expanded, bounds); +    Rectangle d = null; +    if (nodeDimensions != null) +      d = nodeDimensions.getNodeDimensions(value, row, depth, expanded, +					   bounds); +    return d;    }    /** @@ -224,7 +226,12 @@ public abstract class AbstractLayoutCache     */    public void setSelectionModel(TreeSelectionModel model)    { +    if (treeSelectionModel != null) +      treeSelectionModel.setRowMapper(null);      treeSelectionModel = model; +    if (treeSelectionModel != null) +      treeSelectionModel.setRowMapper(this); +        }    /** @@ -337,7 +344,7 @@ public abstract class AbstractLayoutCache     *      * @return Enumeration     */ -  public abstract Enumeration getVisiblePathsFrom(TreePath path); +  public abstract Enumeration<TreePath> getVisiblePathsFrom(TreePath path);    /**     * getVisibleChildCount @@ -425,9 +432,13 @@ public abstract class AbstractLayoutCache     */    public int[] getRowsForPaths(TreePath[] paths)    { -    int[] rows = new int[paths.length]; -    for (int i = 0; i < rows.length; i++) -      rows[i] = getRowForPath(paths[i]); +    int[] rows = null; +    if (paths != null) +      { +        rows = new int[paths.length]; +        for (int i = 0; i < rows.length; i++) +          rows[i] = getRowForPath(paths[i]); +      }      return rows;    } @@ -440,6 +451,6 @@ public abstract class AbstractLayoutCache     */    protected boolean isFixedRowHeight()    { -    return false;  +    return rowHeight > 0;    }  } | 

