Class CursorManager

java.lang.Object
org.openstreetmap.josm.gui.util.CursorManager

public class CursorManager extends Object
This class manages multiple cursors for multiple components. All components share the same cursor that was last set using setNewCursor(Cursor, Object)
  • Field Details

  • Constructor Details

    • CursorManager

      public CursorManager(Component forComponent)
      Creates a new NavigationCursorManager
      Parameters:
      forComponent - The initial component the cursor should be managed for.
  • Method Details

    • addComponent

      public void addComponent(Component forComponent)
      Adds a component that this manager should send cursor changes to.
      Parameters:
      forComponent - The component.
    • removeComponent

      public void removeComponent(Component forComponent)
      Removes a component that this manager should send cursor changes to. The current cursor is not reset.
      Parameters:
      forComponent - The component.
    • setNewCursor

      public void setNewCursor(Cursor cursor, Object reference)
      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

      public void resetCursor(Object reference)
      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

      private void updateCursor()
    • getCurrentCursor