public class CursorManager extends Object
setNewCursor(Cursor, Object)
Modifier and Type | Field and Description |
---|---|
private CopyOnWriteArrayList<Component> |
components |
private LinkedHashMap<Object,Cursor> |
cursors |
Constructor and Description |
---|
CursorManager(Component forComponent)
Creates a new NavigationCursorManager
|
Modifier and Type | Method and Description |
---|---|
void |
addComponent(Component forComponent)
Adds a component that this manager should send cursor changes to.
|
private Cursor |
getCurrentCursor() |
void |
removeComponent(Component forComponent)
Removes a component that this manager should send cursor changes to.
|
void |
resetCursor(Object reference)
Remove the new cursor that was set with the given reference object.
|
void |
setNewCursor(Cursor cursor,
Object reference)
Set new cursor.
|
private void |
updateCursor() |
private final LinkedHashMap<Object,Cursor> cursors
private final CopyOnWriteArrayList<Component> components
public CursorManager(Component forComponent)
forComponent
- The initial component the cursor should be managed for.public void addComponent(Component forComponent)
forComponent
- The component.public void removeComponent(Component forComponent)
forComponent
- The component.public void setNewCursor(Cursor cursor, Object reference)
cursor
- The new cursor to use.reference
- A reference object that can be passed to the next set/reset calls to identify the caller.public void resetCursor(Object reference)
reference
- A reference object that can be passed to the next set/reset calls to identify the caller.private void updateCursor()
private Cursor getCurrentCursor()