1 |
/* DefaultTreeSelectionModel.java -- |
/* DefaultTreeSelectionModel.java -- |
2 |
Copyright (C) 2002 Free Software Foundation, Inc. |
Copyright (C) 2002, 2004 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
45 |
import java.io.Serializable; |
import java.io.Serializable; |
46 |
import java.util.EventListener; |
import java.util.EventListener; |
47 |
import java.util.Vector; |
import java.util.Vector; |
48 |
|
|
49 |
import javax.swing.DefaultListSelectionModel; |
import javax.swing.DefaultListSelectionModel; |
|
import javax.swing.event.SwingPropertyChangeSupport; |
|
50 |
import javax.swing.event.EventListenerList; |
import javax.swing.event.EventListenerList; |
51 |
|
import javax.swing.event.SwingPropertyChangeSupport; |
52 |
import javax.swing.event.TreeSelectionEvent; |
import javax.swing.event.TreeSelectionEvent; |
53 |
import javax.swing.event.TreeSelectionListener; |
import javax.swing.event.TreeSelectionListener; |
54 |
|
|
61 |
{ |
{ |
62 |
static final long serialVersionUID = 3288129636638950196L; |
static final long serialVersionUID = 3288129636638950196L; |
63 |
|
|
64 |
//------------------------------------------------------------- |
/** |
65 |
// Variables -------------------------------------------------- |
* SELECTION_MODE_PROPERTY |
66 |
//------------------------------------------------------------- |
*/ |
67 |
|
public static final String SELECTION_MODE_PROPERTY = "selectionMode"; |
68 |
/** |
|
69 |
* SELECTION_MODE_PROPERTY |
/** |
70 |
*/ |
* changeSupport |
71 |
public static final String SELECTION_MODE_PROPERTY = "selectionMode"; |
*/ |
72 |
|
protected SwingPropertyChangeSupport changeSupport; |
73 |
/** |
|
74 |
* changeSupport |
/** |
75 |
*/ |
* selection |
76 |
protected SwingPropertyChangeSupport changeSupport; |
*/ |
77 |
|
protected TreePath[] selection; |
78 |
/** |
|
79 |
* selection |
/** |
80 |
*/ |
* listenerList |
81 |
protected TreePath[] selection; |
*/ |
82 |
|
protected EventListenerList listenerList; |
83 |
/** |
|
84 |
* listenerList |
/** |
85 |
*/ |
* rowMapper |
86 |
protected EventListenerList listenerList; |
*/ |
87 |
|
protected transient RowMapper rowMapper; |
88 |
/** |
|
89 |
* rowMapper |
/** |
90 |
*/ |
* listSelectionModel |
91 |
protected transient RowMapper rowMapper; |
*/ |
92 |
|
protected DefaultListSelectionModel listSelectionModel; |
93 |
/** |
|
94 |
* listSelectionModel |
/** |
95 |
*/ |
* selectionMode |
96 |
protected DefaultListSelectionModel listSelectionModel; |
*/ |
97 |
|
protected int selectionMode; |
98 |
/** |
|
99 |
* selectionMode |
/** |
100 |
*/ |
* leadPath |
101 |
protected int selectionMode; |
*/ |
102 |
|
protected TreePath leadPath; |
103 |
/** |
|
104 |
* leadPath |
/** |
105 |
*/ |
* leadIndex |
106 |
protected TreePath leadPath; |
*/ |
107 |
|
protected int leadIndex; |
108 |
/** |
|
109 |
* leadIndex |
/** |
110 |
*/ |
* leadRow |
111 |
protected int leadIndex; |
*/ |
112 |
|
protected int leadRow; |
113 |
/** |
|
114 |
* leadRow |
/** |
115 |
*/ |
* Constructor DefaultTreeSelectionModel |
116 |
protected int leadRow; |
*/ |
117 |
|
public DefaultTreeSelectionModel() |
118 |
|
{ |
119 |
//------------------------------------------------------------- |
// TODO |
120 |
// Initialization --------------------------------------------- |
} |
121 |
//------------------------------------------------------------- |
|
122 |
|
/** |
123 |
/** |
* clone |
124 |
* Constructor DefaultTreeSelectionModel |
* @exception CloneNotSupportedException TODO |
125 |
*/ |
* @return Object |
126 |
public DefaultTreeSelectionModel() { |
*/ |
127 |
// TODO |
public Object clone() throws CloneNotSupportedException |
128 |
} // DefaultTreeSelectionModel() |
{ |
129 |
|
return null; // TODO |
130 |
|
} |
131 |
//------------------------------------------------------------- |
|
132 |
// Methods ---------------------------------------------------- |
/** |
133 |
//------------------------------------------------------------- |
* toString |
134 |
|
* @return String |
135 |
/** |
*/ |
136 |
* clone |
public String toString() |
137 |
* @exception CloneNotSupportedException TODO |
{ |
138 |
* @returns Object |
return null; // TODO |
139 |
*/ |
} |
140 |
public Object clone() throws CloneNotSupportedException { |
|
141 |
return null; // TODO |
/** |
142 |
} // clone() |
* writeObject |
143 |
|
* @param value0 TODO |
144 |
/** |
* @exception IOException TODO |
145 |
* toString |
*/ |
146 |
* @returns String |
private void writeObject(ObjectOutputStream value0) throws IOException |
147 |
*/ |
{ |
148 |
public String toString() { |
// TODO |
149 |
return null; // TODO |
} |
150 |
} // toString() |
|
151 |
|
/** |
152 |
/** |
* readObject |
153 |
* writeObject |
* @param value0 TODO |
154 |
* @param value0 TODO |
* @exception IOException TODO |
155 |
* @exception IOException TODO |
* @exception ClassNotFoundException TODO |
156 |
*/ |
*/ |
157 |
private void writeObject(ObjectOutputStream value0) throws IOException { |
private void readObject(ObjectInputStream value0) |
158 |
// TODO |
throws IOException, ClassNotFoundException |
159 |
} // writeObject() |
{ |
160 |
|
// TODO |
161 |
/** |
} |
162 |
* readObject |
|
163 |
* @param value0 TODO |
/** |
164 |
* @exception IOException TODO |
* setRowMapper |
165 |
* @exception ClassNotFoundException TODO |
* @param value0 TODO |
166 |
*/ |
*/ |
167 |
private void readObject(ObjectInputStream value0) throws IOException, ClassNotFoundException { |
public void setRowMapper(RowMapper value0) |
168 |
// TODO |
{ |
169 |
} // readObject() |
// TODO |
170 |
|
} |
171 |
/** |
|
172 |
* setRowMapper |
/** |
173 |
* @param value0 TODO |
* getRowMapper |
174 |
*/ |
* @return RowMapper |
175 |
public void setRowMapper(RowMapper value0) { |
*/ |
176 |
// TODO |
public RowMapper getRowMapper() |
177 |
} // setRowMapper() |
{ |
178 |
|
return null; // TODO |
179 |
/** |
} |
180 |
* getRowMapper |
|
181 |
* @returns RowMapper |
/** |
182 |
*/ |
* setSelectionMode |
183 |
public RowMapper getRowMapper() { |
* @param value0 TODO |
184 |
return null; // TODO |
*/ |
185 |
} // getRowMapper() |
public void setSelectionMode(int value0) |
186 |
|
{ |
187 |
/** |
// TODO |
188 |
* setSelectionMode |
} |
189 |
* @param value0 TODO |
|
190 |
*/ |
/** |
191 |
public void setSelectionMode(int value0) { |
* getSelectionMode |
192 |
// TODO |
* @return int |
193 |
} // setSelectionMode() |
*/ |
194 |
|
public int getSelectionMode() |
195 |
/** |
{ |
196 |
* getSelectionMode |
return 0; // TODO |
197 |
* @returns int |
} |
198 |
*/ |
|
199 |
public int getSelectionMode() { |
/** |
200 |
return 0; // TODO |
* setSelectionPath |
201 |
} // getSelectionMode() |
* @param value0 TODO |
202 |
|
*/ |
203 |
/** |
public void setSelectionPath(TreePath value0) |
204 |
* setSelectionPath |
{ |
205 |
* @param value0 TODO |
// TODO |
206 |
*/ |
} |
207 |
public void setSelectionPath(TreePath value0) { |
|
208 |
// TODO |
/** |
209 |
} // setSelectionPath() |
* setSelectionPaths |
210 |
|
* @param value0 TODO |
211 |
/** |
*/ |
212 |
* setSelectionPaths |
public void setSelectionPaths(TreePath[] value0) |
213 |
* @param value0 TODO |
{ |
214 |
*/ |
// TODO |
215 |
public void setSelectionPaths(TreePath[] value0) { |
} |
216 |
// TODO |
|
217 |
} // setSelectionPaths() |
/** |
218 |
|
* addSelectionPath |
219 |
/** |
* @param value0 TODO |
220 |
* addSelectionPath |
*/ |
221 |
* @param value0 TODO |
public void addSelectionPath(TreePath value0) |
222 |
*/ |
{ |
223 |
public void addSelectionPath(TreePath value0) { |
// TODO |
224 |
// TODO |
} |
225 |
} // addSelectionPath() |
|
226 |
|
/** |
227 |
/** |
* addSelectionPaths |
228 |
* addSelectionPaths |
* @param value0 TODO |
229 |
* @param value0 TODO |
*/ |
230 |
*/ |
public void addSelectionPaths(TreePath[] value0) |
231 |
public void addSelectionPaths(TreePath[] value0) { |
{ |
232 |
// TODO |
// TODO |
233 |
} // addSelectionPaths() |
} |
234 |
|
|
235 |
/** |
/** |
236 |
* removeSelectionPath |
* removeSelectionPath |
237 |
* @param value0 TODO |
* @param value0 TODO |
238 |
*/ |
*/ |
239 |
public void removeSelectionPath(TreePath value0) { |
public void removeSelectionPath(TreePath value0) |
240 |
// TODO |
{ |
241 |
} // removeSelectionPath() |
// TODO |
242 |
|
} |
243 |
/** |
|
244 |
* removeSelectionPaths |
/** |
245 |
* @param value0 TODO |
* removeSelectionPaths |
246 |
*/ |
* @param value0 TODO |
247 |
public void removeSelectionPaths(TreePath[] value0) { |
*/ |
248 |
// TODO |
public void removeSelectionPaths(TreePath[] value0) |
249 |
} // removeSelectionPaths() |
{ |
250 |
|
// TODO |
251 |
/** |
} |
252 |
* getSelectionPath |
|
253 |
* @returns TreePath |
/** |
254 |
*/ |
* getSelectionPath |
255 |
public TreePath getSelectionPath() { |
* @return TreePath |
256 |
return null; // TODO |
*/ |
257 |
} // getSelectionPath() |
public TreePath getSelectionPath() |
258 |
|
{ |
259 |
/** |
return null; // TODO |
260 |
* getSelectionPaths |
} |
261 |
* @returns TreePath[] |
|
262 |
*/ |
/** |
263 |
public TreePath[] getSelectionPaths() { |
* getSelectionPaths |
264 |
return null; // TODO |
* @return TreePath[] |
265 |
} // getSelectionPaths() |
*/ |
266 |
|
public TreePath[] getSelectionPaths() |
267 |
/** |
{ |
268 |
* getSelectionCount |
return null; // TODO |
269 |
* @returns int |
} |
270 |
*/ |
|
271 |
public int getSelectionCount() { |
/** |
272 |
return 0; // TODO |
* getSelectionCount |
273 |
} // getSelectionCount() |
* @return int |
274 |
|
*/ |
275 |
/** |
public int getSelectionCount() |
276 |
* isPathSelected |
{ |
277 |
* @param value0 TODO |
return 0; // TODO |
278 |
* @returns boolean |
} |
279 |
*/ |
|
280 |
public boolean isPathSelected(TreePath value0) { |
/** |
281 |
return false; // TODO |
* isPathSelected |
282 |
} // isPathSelected() |
* @param value0 TODO |
283 |
|
* @return boolean |
284 |
/** |
*/ |
285 |
* isSelectionEmpty |
public boolean isPathSelected(TreePath value0) |
286 |
* @returns boolean |
{ |
287 |
*/ |
return false; // TODO |
288 |
public boolean isSelectionEmpty() { |
} |
289 |
return false; // TODO |
|
290 |
} // isSelectionEmpty() |
/** |
291 |
|
* isSelectionEmpty |
292 |
/** |
* @return boolean |
293 |
* clearSelection |
*/ |
294 |
*/ |
public boolean isSelectionEmpty() |
295 |
public void clearSelection() { |
{ |
296 |
// TODO |
return false; // TODO |
297 |
} // clearSelection() |
} |
298 |
|
|
299 |
/** |
/** |
300 |
* addTreeSelectionListener |
* clearSelection |
301 |
* @param value0 TODO |
*/ |
302 |
*/ |
public void clearSelection() |
303 |
public void addTreeSelectionListener(TreeSelectionListener value0) { |
{ |
304 |
// TODO |
// TODO |
305 |
} // addTreeSelectionListener() |
} |
306 |
|
|
307 |
/** |
/** |
308 |
* removeTreeSelectionListener |
* Adds a <code>TreeSelectionListener</code> object to this model. |
309 |
* @param value0 TODO |
* |
310 |
*/ |
* @param listener the listener to add |
311 |
public void removeTreeSelectionListener(TreeSelectionListener value0) { |
*/ |
312 |
// TODO |
public void addTreeSelectionListener(TreeSelectionListener listener) |
313 |
} // removeTreeSelectionListener() |
{ |
314 |
|
listenerList.add(TreeSelectionListener.class, listener); |
315 |
/** |
} |
316 |
* fireValueChanged |
|
317 |
* @param value0 TODO |
/** |
318 |
*/ |
* Removes a <code>TreeSelectionListener</code> object from this model. |
319 |
protected void fireValueChanged(TreeSelectionEvent value0) { |
* |
320 |
// TODO |
* @param listener the listener to remove |
321 |
} // fireValueChanged() |
*/ |
322 |
|
public void removeTreeSelectionListener(TreeSelectionListener listener) |
323 |
/** |
{ |
324 |
* getListeners |
listenerList.remove(TreeSelectionListener.class, listener); |
325 |
* @param value0 TODO |
} |
326 |
* @returns EventListener[] |
|
327 |
*/ |
/** |
328 |
public EventListener[] getListeners(Class value0) { |
* Returns all <code>TreeSelectionListener</code> added to this model. |
329 |
return null; // TODO |
* |
330 |
} // getListeners() |
* @return an array of listeners |
331 |
|
* |
332 |
/** |
* @since 1.4 |
333 |
* getSelectionRows |
*/ |
334 |
* @returns int[] |
public TreeSelectionListener[] getTreeSelectionListeners() |
335 |
*/ |
{ |
336 |
public int[] getSelectionRows() { |
return (TreeSelectionListener[]) listenerList.getListeners(TreeSelectionListener.class); |
337 |
return null; // TODO |
} |
338 |
} // getSelectionRows() |
|
339 |
|
/** |
340 |
/** |
* fireValueChanged |
341 |
* getMinSelectionRow |
* |
342 |
* @returns int |
* @param event the event to fire. |
343 |
*/ |
*/ |
344 |
public int getMinSelectionRow() { |
protected void fireValueChanged(TreeSelectionEvent event) |
345 |
return 0; // TODO |
{ |
346 |
} // getMinSelectionRow() |
TreeSelectionListener[] listeners = getTreeSelectionListeners(); |
347 |
|
|
348 |
/** |
for (int i = listeners.length - 1; i >= 0; --i) |
349 |
* getMaxSelectionRow |
listeners[i].valueChanged(event); |
350 |
* @returns int |
} |
351 |
*/ |
|
352 |
public int getMaxSelectionRow() { |
/** |
353 |
return 0; // TODO |
* Returns all added listeners of a special type. |
354 |
} // getMaxSelectionRow() |
* |
355 |
|
* @param listenerType the listener type |
356 |
/** |
* |
357 |
* isRowSelected |
* @return an array of listeners |
358 |
* @param value0 TODO |
* |
359 |
* @returns boolean |
* @since 1.3 |
360 |
*/ |
*/ |
361 |
public boolean isRowSelected(int value0) { |
public EventListener[] getListeners(Class listenerType) |
362 |
return false; // TODO |
{ |
363 |
} // isRowSelected() |
return listenerList.getListeners(listenerType); |
364 |
|
} |
365 |
/** |
|
366 |
* resetRowSelection |
/** |
367 |
*/ |
* getSelectionRows |
368 |
public void resetRowSelection() { |
* @return int[] |
369 |
// TODO |
*/ |
370 |
} // resetRowSelection() |
public int[] getSelectionRows() |
371 |
|
{ |
372 |
/** |
return null; // TODO |
373 |
* getLeadSelectionRow |
} |
374 |
* @returns int |
|
375 |
*/ |
/** |
376 |
public int getLeadSelectionRow() { |
* getMinSelectionRow |
377 |
return 0; // TODO |
* @return int |
378 |
} // getLeadSelectionRow() |
*/ |
379 |
|
public int getMinSelectionRow() |
380 |
/** |
{ |
381 |
* getLeadSelectionPath |
return 0; // TODO |
382 |
* @returns TreePath |
} |
383 |
*/ |
|
384 |
public TreePath getLeadSelectionPath() { |
/** |
385 |
return null; // TODO |
* getMaxSelectionRow |
386 |
} // getLeadSelectionPath() |
* @return int |
387 |
|
*/ |
388 |
/** |
public int getMaxSelectionRow() |
389 |
* addPropertyChangeListener |
{ |
390 |
* @param value0 TODO |
return 0; // TODO |
391 |
*/ |
} |
392 |
public synchronized void addPropertyChangeListener(PropertyChangeListener value0) { |
|
393 |
// TODO |
/** |
394 |
} // addPropertyChangeListener() |
* isRowSelected |
395 |
|
* @param value0 TODO |
396 |
/** |
* @return boolean |
397 |
* removePropertyChangeListener |
*/ |
398 |
* @param value0 TODO |
public boolean isRowSelected(int value0) |
399 |
*/ |
{ |
400 |
public synchronized void removePropertyChangeListener(PropertyChangeListener value0) { |
return false; // TODO |
401 |
// TODO |
} |
402 |
} // removePropertyChangeListener() |
|
403 |
|
/** |
404 |
/** |
* resetRowSelection |
405 |
* insureRowContinuity |
*/ |
406 |
*/ |
public void resetRowSelection() |
407 |
protected void insureRowContinuity() { |
{ |
408 |
// TODO |
// TODO |
409 |
} // insureRowContinuity() |
} |
410 |
|
|
411 |
/** |
/** |
412 |
* arePathsContiguous |
* getLeadSelectionRow |
413 |
* @param value0 TODO |
* @return int |
414 |
* @returns boolean |
*/ |
415 |
*/ |
public int getLeadSelectionRow() |
416 |
protected boolean arePathsContiguous(TreePath[] value0) { |
{ |
417 |
return false; // TODO |
return 0; // TODO |
418 |
} // arePathsContiguous() |
} |
419 |
|
|
420 |
/** |
/** |
421 |
* canPathsBeAdded |
* getLeadSelectionPath |
422 |
* @param value0 TODO |
* @return TreePath |
423 |
* @returns boolean |
*/ |
424 |
*/ |
public TreePath getLeadSelectionPath() |
425 |
protected boolean canPathsBeAdded(TreePath[] value0) { |
{ |
426 |
return false; // TODO |
return null; // TODO |
427 |
} // canPathsBeAdded() |
} |
428 |
|
|
429 |
/** |
/** |
430 |
* canPathsBeRemoved |
* Adds a <code>PropertyChangeListener</code> object to this model. |
431 |
* @param value0 TODO |
* |
432 |
* @returns boolean |
* @param listener the listener to add. |
433 |
*/ |
*/ |
434 |
protected boolean canPathsBeRemoved(TreePath[] value0) { |
public void addPropertyChangeListener(PropertyChangeListener listener) |
435 |
return false; // TODO |
{ |
436 |
} // canPathsBeRemoved() |
changeSupport.addPropertyChangeListener(listener); |
437 |
|
} |
438 |
/** |
|
439 |
* notifyPathChange |
/** |
440 |
* @param value0 TODO |
* Removes a <code>PropertyChangeListener</code> object from this model. |
441 |
* @param value1 TODO |
* |
442 |
*/ |
* @param listener the listener to remove. |
443 |
protected void notifyPathChange(Vector value0, TreePath value1) { |
*/ |
444 |
// TODO |
public void removePropertyChangeListener(PropertyChangeListener listener) |
445 |
} // notifyPathChange() |
{ |
446 |
|
changeSupport.removePropertyChangeListener(listener); |
447 |
/** |
} |
448 |
* updateLeadIndex |
|
449 |
*/ |
/** |
450 |
protected void updateLeadIndex() { |
* Returns all added <code>PropertyChangeListener</code> objects. |
451 |
// TODO |
* |
452 |
} // updateLeadIndex() |
* @return an array of listeners. |
453 |
|
* |
454 |
/** |
* @since 1.4 |
455 |
* insureUniqueness |
*/ |
456 |
*/ |
public PropertyChangeListener[] getPropertyChangeListeners() |
457 |
protected void insureUniqueness() { |
{ |
458 |
// TODO |
return changeSupport.getPropertyChangeListeners(); |
459 |
} // insureUniqueness() |
} |
460 |
|
|
461 |
|
/** |
462 |
} // DefaultTreeSelectionModel |
* insureRowContinuity |
463 |
|
*/ |
464 |
|
protected void insureRowContinuity() |
465 |
|
{ |
466 |
|
// TODO |
467 |
|
} |
468 |
|
|
469 |
|
/** |
470 |
|
* arePathsContiguous |
471 |
|
* @param value0 TODO |
472 |
|
* @return boolean |
473 |
|
*/ |
474 |
|
protected boolean arePathsContiguous(TreePath[] value0) |
475 |
|
{ |
476 |
|
return false; // TODO |
477 |
|
} |
478 |
|
|
479 |
|
/** |
480 |
|
* canPathsBeAdded |
481 |
|
* @param value0 TODO |
482 |
|
* @return boolean |
483 |
|
*/ |
484 |
|
protected boolean canPathsBeAdded(TreePath[] value0) |
485 |
|
{ |
486 |
|
return false; // TODO |
487 |
|
} |
488 |
|
|
489 |
|
/** |
490 |
|
* canPathsBeRemoved |
491 |
|
* @param value0 TODO |
492 |
|
* @return boolean |
493 |
|
*/ |
494 |
|
protected boolean canPathsBeRemoved(TreePath[] value0) |
495 |
|
{ |
496 |
|
return false; // TODO |
497 |
|
} |
498 |
|
|
499 |
|
/** |
500 |
|
* notifyPathChange |
501 |
|
* @param value0 TODO |
502 |
|
* @param value1 TODO |
503 |
|
*/ |
504 |
|
protected void notifyPathChange(Vector value0, TreePath value1) |
505 |
|
{ |
506 |
|
// TODO |
507 |
|
} |
508 |
|
|
509 |
|
/** |
510 |
|
* updateLeadIndex |
511 |
|
*/ |
512 |
|
protected void updateLeadIndex() |
513 |
|
{ |
514 |
|
// TODO |
515 |
|
} |
516 |
|
|
517 |
|
/** |
518 |
|
* insureUniqueness |
519 |
|
*/ |
520 |
|
protected void insureUniqueness() |
521 |
|
{ |
522 |
|
// TODO |
523 |
|
} |
524 |
|
} |