Package org.openstreetmap.josm.gui.util
Class CursorManager
java.lang.Object
org.openstreetmap.josm.gui.util.CursorManager
This class manages multiple cursors for multiple components.
All components share the same cursor that was last set using
setNewCursor(Cursor, Object)-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CopyOnWriteArrayList<Component>private final LinkedHashMap<Object,Cursor> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponent(Component forComponent) Adds a component that this manager should send cursor changes to.private CursorvoidremoveComponent(Component forComponent) Removes a component that this manager should send cursor changes to.voidresetCursor(Object reference) Remove the new cursor that was set with the given reference object.voidsetNewCursor(Cursor cursor, Object reference) Set new cursor.private void
-
Field Details
-
cursors
-
components
-
-
Constructor Details
-
CursorManager
Creates a new NavigationCursorManager- Parameters:
forComponent- The initial component the cursor should be managed for.
-
-
Method Details
-
addComponent
Adds a component that this manager should send cursor changes to.- Parameters:
forComponent- The component.
-
removeComponent
Removes a component that this manager should send cursor changes to. The current cursor is not reset.- Parameters:
forComponent- The component.
-
setNewCursor
Set new cursor.- Parameters:
cursor- The new cursor to use.reference- A reference object that can be passed to the next set/reset calls to identify the caller.
-
resetCursor
Remove the new cursor that was set with the given reference object. and reset to previous- Parameters:
reference- A reference object that can be passed to the next set/reset calls to identify the caller.
-
updateCursor
-
getCurrentCursor
-