78 |
*/ |
*/ |
79 |
int selectionMode = MULTIPLE_INTERVAL_SELECTION; |
int selectionMode = MULTIPLE_INTERVAL_SELECTION; |
80 |
|
|
|
|
|
81 |
/** |
/** |
82 |
* The index of the "lead" of the most recent selection. The lead is the |
* The index of the "lead" of the most recent selection. The lead is the |
83 |
* second argument in any call to {@link #setSelectionInterval}, {@link |
* second argument in any call to {@link #setSelectionInterval}, {@link |
87 |
*/ |
*/ |
88 |
int leadSelectionIndex = -1; |
int leadSelectionIndex = -1; |
89 |
|
|
|
|
|
90 |
/** |
/** |
91 |
* The index of the "anchor" of the most recent selection. The anchor is |
* The index of the "anchor" of the most recent selection. The anchor is |
92 |
* the first argument in any call to {@link #setSelectionInterval}, |
* the first argument in any call to {@link #setSelectionInterval}, |
100 |
*/ |
*/ |
101 |
int anchorSelectionIndex = -1; |
int anchorSelectionIndex = -1; |
102 |
|
|
|
|
|
103 |
/** |
/** |
104 |
* controls the range of indices provided in any {@link |
* controls the range of indices provided in any {@link |
105 |
* ListSelectionEvent} fired by the selectionModel. Let |
* ListSelectionEvent} fired by the selectionModel. Let |
117 |
*/ |
*/ |
118 |
protected boolean leadAnchorNotificationEnabled = true; |
protected boolean leadAnchorNotificationEnabled = true; |
119 |
|
|
|
|
|
120 |
/** |
/** |
121 |
* Whether the selection is currently "adjusting". Any {@link |
* Whether the selection is currently "adjusting". Any {@link |
122 |
* ListSelectionEvent} events constructed in response to changes in this |
* ListSelectionEvent} events constructed in response to changes in this |
136 |
*/ |
*/ |
137 |
BitSet sel = new BitSet(); |
BitSet sel = new BitSet(); |
138 |
|
|
|
|
|
139 |
/** |
/** |
140 |
* Gets the value of the {@link #selectionMode} property. |
* Gets the value of the {@link #selectionMode} property. |
141 |
* |
* |
285 |
leadAnchorNotificationEnabled = l; |
leadAnchorNotificationEnabled = l; |
286 |
} |
} |
287 |
|
|
|
|
|
288 |
/** |
/** |
289 |
* Gets the value of the {@link #valueIsAdjusting} property. |
* Gets the value of the {@link #valueIsAdjusting} property. |
290 |
* |
* |
320 |
return sel.isEmpty(); |
return sel.isEmpty(); |
321 |
} |
} |
322 |
|
|
|
|
|
323 |
/** |
/** |
324 |
* Gets the smallest index which is currently a member of a selection |
* Gets the smallest index which is currently a member of a selection |
325 |
* interval. |
* interval. |
326 |
* |
* |
327 |
* @return The least integer <code>i</code> such that <code>i >= |
* @return The least integer <code>i</code> such that <code>i >= |
328 |
* 0</code> and <code>i</code> is a member of a selected interval, or |
* 0</code> and <code>i</code> is a member of a selected interval, or |
329 |
* <code>-1</code> if there are no selected intervals |
* <code>-1</code> if there are no selected intervals |
330 |
* |
* |
331 |
* @see #getMaxSelectionIndex |
* @see #getMaxSelectionIndex |
332 |
*/ |
*/ |
343 |
* interval. |
* interval. |
344 |
* |
* |
345 |
* @return The greatest integer <code>i</code> such that <code>i >= |
* @return The greatest integer <code>i</code> such that <code>i >= |
346 |
* 0</code> and <code>i</code> is a member of a selected interval, or |
* 0</code> and <code>i</code> is a member of a selected interval, or |
347 |
* <code>-1</code> if there are no selected intervals |
* <code>-1</code> if there are no selected intervals |
348 |
* |
* |
349 |
* @see #getMinSelectionIndex |
* @see #getMinSelectionIndex |
350 |
*/ |
*/ |
368 |
* @param a The index to search for |
* @param a The index to search for |
369 |
* |
* |
370 |
* @return <code>true</code> if the index is a member of a selection interval, |
* @return <code>true</code> if the index is a member of a selection interval, |
371 |
* otherwise <code>false</code> |
* otherwise <code>false</code> |
372 |
*/ |
*/ |
373 |
public boolean isSelectedIndex(int a) |
public boolean isSelectedIndex(int a) |
374 |
{ |
{ |
488 |
* @param index The position to insert indices at |
* @param index The position to insert indices at |
489 |
* @param length The number of indices to insert |
* @param length The number of indices to insert |
490 |
* @param before Indicates whether to insert the indices before the index |
* @param before Indicates whether to insert the indices before the index |
491 |
* or after it |
* or after it |
492 |
*/ |
*/ |
493 |
public void insertIndexInterval(int index, |
public void insertIndexInterval(int index, |
494 |
int length, |
int length, |
565 |
* @param firstIndex The low index of the changed range |
* @param firstIndex The low index of the changed range |
566 |
* @param lastIndex The high index of the changed range |
* @param lastIndex The high index of the changed range |
567 |
* @param isAdjusting Whether this change is part of a seqence of adjustments |
* @param isAdjusting Whether this change is part of a seqence of adjustments |
568 |
* made to the selection, such as during interactive scrolling |
* made to the selection, such as during interactive scrolling |
569 |
*/ |
*/ |
570 |
protected void fireValueChanged(int firstIndex, int lastIndex, |
protected void fireValueChanged(int firstIndex, int lastIndex, |
571 |
boolean isAdjusting) |
boolean isAdjusting) |