public class ScrollerCoupling
extends java.lang.Object
Coupled scrollers will move together - when one moves, the others move.
Constructor and Description |
---|
ScrollerCoupling(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
addScroller(AbstractPamScroller aScroller)
Add a new scroller to the coupling
|
int |
getScrollerCount() |
void |
notifyOthers(AbstractPamScroller scroller)
Notify other scrollers in the set that a scroller has
changed then pass them a reference to the changed
scroller so that they can copy information from it.
|
boolean |
removeScroller(AbstractPamScroller aScroller)
Remove a scroller form a coupling
|
public void addScroller(AbstractPamScroller aScroller)
aScroller
- public void notifyOthers(AbstractPamScroller scroller)
This function holds a lock since as soon as another scroller is changed, it's likely to call back to this same function and set up an infinite loop. The lock will exit the function if set to avoid this situation.
scroller
- scroller which changes.public boolean removeScroller(AbstractPamScroller aScroller)
aScroller
- public int getScrollerCount()