Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / libjava / javax / swing / tree / DefaultTreeSelectionModel.java
blob4fe69f4fb148980e4c9e5b3404a0cfdfaa6966c4
1 /* DefaultTreeSelectionModel.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.beans.PropertyChangeListener;
42 import java.io.IOException;
43 import java.io.ObjectInputStream;
44 import java.io.ObjectOutputStream;
45 import java.io.Serializable;
46 import java.util.EventListener;
47 import java.util.Vector;
49 import javax.swing.DefaultListSelectionModel;
50 import javax.swing.event.EventListenerList;
51 import javax.swing.event.SwingPropertyChangeSupport;
52 import javax.swing.event.TreeSelectionEvent;
53 import javax.swing.event.TreeSelectionListener;
55 /**
56 * DefaultTreeSelectionModel
57 * @author Andrew Selkirk
59 public class DefaultTreeSelectionModel
60 implements Cloneable, Serializable, TreeSelectionModel
62 static final long serialVersionUID = 3288129636638950196L;
64 /**
65 * SELECTION_MODE_PROPERTY
67 public static final String SELECTION_MODE_PROPERTY = "selectionMode";
69 /**
70 * changeSupport
72 protected SwingPropertyChangeSupport changeSupport;
74 /**
75 * selection
77 protected TreePath[] selection;
79 /**
80 * listenerList
82 protected EventListenerList listenerList;
84 /**
85 * rowMapper
87 protected transient RowMapper rowMapper;
89 /**
90 * listSelectionModel
92 protected DefaultListSelectionModel listSelectionModel;
94 /**
95 * selectionMode
97 protected int selectionMode;
99 /**
100 * leadPath
102 protected TreePath leadPath;
105 * leadIndex
107 protected int leadIndex;
110 * leadRow
112 protected int leadRow;
115 * Constructor DefaultTreeSelectionModel
117 public DefaultTreeSelectionModel()
119 // TODO
123 * clone
124 * @exception CloneNotSupportedException TODO
125 * @return Object
127 public Object clone() throws CloneNotSupportedException
129 return null; // TODO
133 * toString
134 * @return String
136 public String toString()
138 return null; // TODO
142 * writeObject
143 * @param value0 TODO
144 * @exception IOException TODO
146 private void writeObject(ObjectOutputStream value0) throws IOException
148 // TODO
152 * readObject
153 * @param value0 TODO
154 * @exception IOException TODO
155 * @exception ClassNotFoundException TODO
157 private void readObject(ObjectInputStream value0)
158 throws IOException, ClassNotFoundException
160 // TODO
164 * setRowMapper
165 * @param value0 TODO
167 public void setRowMapper(RowMapper value0)
169 // TODO
173 * getRowMapper
174 * @return RowMapper
176 public RowMapper getRowMapper()
178 return null; // TODO
182 * setSelectionMode
183 * @param value0 TODO
185 public void setSelectionMode(int value0)
187 // TODO
191 * getSelectionMode
192 * @return int
194 public int getSelectionMode()
196 return 0; // TODO
200 * setSelectionPath
201 * @param value0 TODO
203 public void setSelectionPath(TreePath value0)
205 // TODO
209 * setSelectionPaths
210 * @param value0 TODO
212 public void setSelectionPaths(TreePath[] value0)
214 // TODO
218 * addSelectionPath
219 * @param value0 TODO
221 public void addSelectionPath(TreePath value0)
223 // TODO
227 * addSelectionPaths
228 * @param value0 TODO
230 public void addSelectionPaths(TreePath[] value0)
232 // TODO
236 * removeSelectionPath
237 * @param value0 TODO
239 public void removeSelectionPath(TreePath value0)
241 // TODO
245 * removeSelectionPaths
246 * @param value0 TODO
248 public void removeSelectionPaths(TreePath[] value0)
250 // TODO
254 * getSelectionPath
255 * @return TreePath
257 public TreePath getSelectionPath()
259 return null; // TODO
263 * getSelectionPaths
264 * @return TreePath[]
266 public TreePath[] getSelectionPaths()
268 return null; // TODO
272 * getSelectionCount
273 * @return int
275 public int getSelectionCount()
277 return 0; // TODO
281 * isPathSelected
282 * @param value0 TODO
283 * @return boolean
285 public boolean isPathSelected(TreePath value0)
287 return false; // TODO
291 * isSelectionEmpty
292 * @return boolean
294 public boolean isSelectionEmpty()
296 return false; // TODO
300 * clearSelection
302 public void clearSelection()
304 // TODO
308 * Adds a <code>TreeSelectionListener</code> object to this model.
310 * @param listener the listener to add
312 public void addTreeSelectionListener(TreeSelectionListener listener)
314 listenerList.add(TreeSelectionListener.class, listener);
318 * Removes a <code>TreeSelectionListener</code> object from this model.
320 * @param listener the listener to remove
322 public void removeTreeSelectionListener(TreeSelectionListener listener)
324 listenerList.remove(TreeSelectionListener.class, listener);
328 * Returns all <code>TreeSelectionListener</code> added to this model.
330 * @return an array of listeners
332 * @since 1.4
334 public TreeSelectionListener[] getTreeSelectionListeners()
336 return (TreeSelectionListener[]) listenerList.getListeners(TreeSelectionListener.class);
340 * fireValueChanged
342 * @param event the event to fire.
344 protected void fireValueChanged(TreeSelectionEvent event)
346 TreeSelectionListener[] listeners = getTreeSelectionListeners();
348 for (int i = listeners.length - 1; i >= 0; --i)
349 listeners[i].valueChanged(event);
353 * Returns all added listeners of a special type.
355 * @param listenerType the listener type
357 * @return an array of listeners
359 * @since 1.3
361 public EventListener[] getListeners(Class listenerType)
363 return listenerList.getListeners(listenerType);
367 * getSelectionRows
368 * @return int[]
370 public int[] getSelectionRows()
372 return null; // TODO
376 * getMinSelectionRow
377 * @return int
379 public int getMinSelectionRow()
381 return 0; // TODO
385 * getMaxSelectionRow
386 * @return int
388 public int getMaxSelectionRow()
390 return 0; // TODO
394 * isRowSelected
395 * @param value0 TODO
396 * @return boolean
398 public boolean isRowSelected(int value0)
400 return false; // TODO
404 * resetRowSelection
406 public void resetRowSelection()
408 // TODO
412 * getLeadSelectionRow
413 * @return int
415 public int getLeadSelectionRow()
417 return 0; // TODO
421 * getLeadSelectionPath
422 * @return TreePath
424 public TreePath getLeadSelectionPath()
426 return null; // TODO
430 * Adds a <code>PropertyChangeListener</code> object to this model.
432 * @param listener the listener to add.
434 public void addPropertyChangeListener(PropertyChangeListener listener)
436 changeSupport.addPropertyChangeListener(listener);
440 * Removes a <code>PropertyChangeListener</code> object from this model.
442 * @param listener the listener to remove.
444 public void removePropertyChangeListener(PropertyChangeListener listener)
446 changeSupport.removePropertyChangeListener(listener);
450 * Returns all added <code>PropertyChangeListener</code> objects.
452 * @return an array of listeners.
454 * @since 1.4
456 public PropertyChangeListener[] getPropertyChangeListeners()
458 return changeSupport.getPropertyChangeListeners();
462 * insureRowContinuity
464 protected void insureRowContinuity()
466 // TODO
470 * arePathsContiguous
471 * @param value0 TODO
472 * @return boolean
474 protected boolean arePathsContiguous(TreePath[] value0)
476 return false; // TODO
480 * canPathsBeAdded
481 * @param value0 TODO
482 * @return boolean
484 protected boolean canPathsBeAdded(TreePath[] value0)
486 return false; // TODO
490 * canPathsBeRemoved
491 * @param value0 TODO
492 * @return boolean
494 protected boolean canPathsBeRemoved(TreePath[] value0)
496 return false; // TODO
500 * notifyPathChange
501 * @param value0 TODO
502 * @param value1 TODO
504 protected void notifyPathChange(Vector value0, TreePath value1)
506 // TODO
510 * updateLeadIndex
512 protected void updateLeadIndex()
514 // TODO
518 * insureUniqueness
520 protected void insureUniqueness()
522 // TODO