Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / libjava / javax / swing / tree / AbstractLayoutCache.java
blob6fb75f77f69551d897d53da6e9119d0c69917d01
1 /* AbstractLayoutCache.java --
2 Copyright (C) 2002, 2004 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package javax.swing.tree;
41 import java.awt.Rectangle;
42 import java.util.Enumeration;
44 import javax.swing.event.TreeModelEvent;
46 /**
47 * class AbstractLayoutCache
49 * @author Andrew Selkirk
51 public abstract class AbstractLayoutCache implements RowMapper
53 /**
54 * class NodeDimensions
56 public abstract static class NodeDimensions
58 /**
59 * Creates <code>NodeDimensions</code> object.
61 public NodeDimensions()
63 // Do nothing here.
66 /**
67 * getNodeDimensions
69 * @param value0 TODO
70 * @param value1 TODO
71 * @param value2 TODO
72 * @param value3 TODO
73 * @param value4 TODO
74 * @return Rectangle
76 public abstract Rectangle getNodeDimensions(Object value0, int value1,
77 int value2, boolean value3,
78 Rectangle value4);
81 /**
82 * nodeDimensions
84 protected NodeDimensions nodeDimensions;
86 /**
87 * treeModel
89 protected TreeModel treeModel;
91 /**
92 * treeSelectionModel
94 protected TreeSelectionModel treeSelectionModel;
96 /**
97 * rootVisible
99 protected boolean rootVisible;
102 * rowHeight
104 protected int rowHeight;
107 * Constructor AbstractLayoutCache
109 public AbstractLayoutCache()
111 // Do nothing here.
115 * setNodeDimensions
117 * @param dimensions TODO
119 public void setNodeDimensions(NodeDimensions dimensions)
121 nodeDimensions = dimensions;
125 * getNodeDimensions
127 * @return NodeDimensions
129 public NodeDimensions getNodeDimensions()
131 return nodeDimensions;
135 * getNodeDimensions
137 * @param value0 TODO
138 * @param value1 TODO
139 * @param value2 TODO
140 * @param value3 TODO
141 * @param value4 TODO
143 * @return Rectangle
145 protected Rectangle getNodeDimensions(Object value0, int value1, int value2, boolean value3, Rectangle value4)
147 return null; // TODO
151 * Sets the model that provides the tree data.
153 * @param the model
155 public void setModel(TreeModel model)
157 treeModel = model;
161 * Returns the model that provides the tree data.
163 * @return the model
165 public TreeModel getModel()
167 return treeModel;
171 * setRootVisible
173 * @param visible <code>true</code> if root should be visible,
174 * <code>false</code> otherwise
176 public void setRootVisible(boolean visible)
178 rootVisible = visible;
182 * isRootVisible
184 * @return <code>true</code> if root is visible,
185 * <code>false</code> otherwise
187 public boolean isRootVisible()
189 return rootVisible;
193 * setRowHeight
195 * @param height the row height
197 public void setRowHeight(int height)
199 rowHeight = height;
203 * getRowHeight
205 * @return the row height
207 public int getRowHeight()
209 return rowHeight;
213 * setSelectionModel
215 * @param model the model
217 public void setSelectionModel(TreeSelectionModel model)
219 treeSelectionModel = model;
223 * getSelectionModel
225 * @return the model
227 public TreeSelectionModel getSelectionModel()
229 return treeSelectionModel;
233 * getPreferredHeight
235 * @return int
237 public int getPreferredHeight()
239 return 0; // TODO
243 * getPreferredWidth
245 * @param value0 TODO
247 * @return int
249 public int getPreferredWidth(Rectangle value0)
251 return 0; // TODO
255 * isExpanded
257 * @param value0 TODO
259 * @return boolean
261 public abstract boolean isExpanded(TreePath value0);
264 * getBounds
266 * @param value0 TODO
267 * @param value1 TODO
269 * @return Rectangle
271 public abstract Rectangle getBounds(TreePath value0, Rectangle value1);
274 * getPathForRow
276 * @param row the row
278 * @return the tree path
280 public abstract TreePath getPathForRow(int row);
283 * getRowForPath
285 * @param path the tree path
287 * @return the row
289 public abstract int getRowForPath(TreePath path);
292 * getPathClosestTo
294 * @param value0 TODO
295 * @param value1 TODO
297 * @return the tree path
299 public abstract TreePath getPathClosestTo(int value0, int value1);
302 * getVisiblePathsFrom
304 * @param path the tree path
306 * @return Enumeration
308 public abstract Enumeration getVisiblePathsFrom(TreePath path);
311 * getVisibleChildCount
313 * @param path the tree path
315 * @return int
317 public abstract int getVisibleChildCount(TreePath value0);
320 * setExpandedState
322 * @param value0 TODO
324 * @param value1 TODO
326 public abstract void setExpandedState(TreePath value0, boolean value1);
329 * getExpandedState
331 * @param path the tree path
333 * @return boolean
335 public abstract boolean getExpandedState(TreePath path);
338 * getRowCount
340 * @return the number of rows
342 public abstract int getRowCount();
345 * invalidateSizes
347 public abstract void invalidateSizes();
350 * invalidatePathBounds
352 * @param path the tree path
354 public abstract void invalidatePathBounds(TreePath path);
357 * treeNodesChanged
359 * @param event the event to send
361 public abstract void treeNodesChanged(TreeModelEvent event);
364 * treeNodesInserted
366 * @param event the event to send
368 public abstract void treeNodesInserted(TreeModelEvent event);
371 * treeNodesRemoved
373 * @param event the event to send
375 public abstract void treeNodesRemoved(TreeModelEvent event);
378 * treeStructureChanged
380 * @param event the event to send
382 public abstract void treeStructureChanged(TreeModelEvent event);
385 * getRowsForPaths
387 * @param paths the tree paths
389 * @return an array of rows
391 public int[] getRowsForPaths(TreePath[] paths)
393 return null; // TODO
397 * isFixedRowHeight
399 * @return boolean
401 protected boolean isFixedRowHeight()
403 return false; // TODO