|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A SelectableListener can be added to a Selectable instance to be notified
about changes to its Selection or position. There are two different types
of changes: Those that are happening in a situation of continuing changes,
so that they are likely to be followed by another change soon and those
that are happening at the end of such a situation and are likely to be
the last change for a while.
A listener should always decide whether it has to be notified about
each single change even if it is only a temporary one if it only has to know
if a permanent change is made to the Selectable.
For Selection changes there are the two methods selectionChanged
and selectionPermanentChanged. The first will be called whenever
a change to the selection is made and the second one only when this change
seems to be permanent for the next while.
Because it is likely that a Selectable´s position may change very often in
some situations, another approach is taken for position changes: When the
Selectable comes into a situation, where it is likely that the position
will change continuously, positionWillChange() is called, so
that the listener can decide, whether it wants to start a separate Thread for
continuous observation of the Selectable´s position or not. When this
situation is over and no continuous changes are expected any more,
positionWontChange() is called. This informs the listener that
it can the continuous observation. positionChanged() will only
be called when a change seems to be permanent for a while.
| Method Summary | |
|---|---|
void |
positionChanged(Selectable s,
int pos)
Notification about a change of the Selectable´s position that is likely to be permanent for a while. |
void |
positionWillChange(Selectable s)
Notification that the Selectable is going into a state where continuous change of its position is expected. |
void |
positionWontChange(Selectable s)
Notification that the Selectable is leaving a state where continuous change of its position was expected. |
void |
selectionChanged(Selectable s,
Selection sel)
Notification about a change of the Selectable´s selection that is likely be followed by more changes soon. |
void |
selectionPermanentChanged(Selectable s,
Selection sel)
Notification about a change of the Selectable´s selection that is likely to be permanent for a while. |
| Method Detail |
|---|
void positionChanged(Selectable s,
int pos)
s - The Selectable that sends this notificationpos - The new positionvoid positionWillChange(Selectable s)
s - The Selectable that sends this notificationvoid positionWontChange(Selectable s)
s - The Selectable that sends this notification
void selectionChanged(Selectable s,
Selection sel)
s - The Selectable that sends this notificationsel - The new Selection
void selectionPermanentChanged(Selectable s,
Selection sel)
s - The Selectable that sends this notificationsel - The new Selection
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||