Package com.nomagic.ui
Class ProgressWaitCursor
java.lang.Object
com.nomagic.ui.ProgressWaitCursor
Mouse wait cursor handling helper for progress monitors.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ProgressWaitCursor
Creates instance ofProgressWaitCursor
which shows waiting mouse cursor and filters out all mouse and key events.void
Initializes mouse wait cursor for all application windowsvoid
Removes mouse wait cursor and restores the original cursors for all application windowsvoid
trackCursor
(Component progressComponent, MouseEvent mouseEvent, boolean waitCursorExpected) Tracks mouse cursor changes when mouse enters/leaves progress component.
-
Constructor Details
-
ProgressWaitCursor
public ProgressWaitCursor()Creates a new progress wait cursor handling helper
-
-
Method Details
-
createProgressWaitCursorIgnoringMouseAndKeyEvents
Creates instance ofProgressWaitCursor
which shows waiting mouse cursor and filters out all mouse and key events. Therefore user will not be able to interact with any components whileProgressWaitCursor
is not removed.- Returns:
- instance of
ProgressWaitCursor
-
initializeWaitCursor
public void initializeWaitCursor()Initializes mouse wait cursor for all application windows -
removeWaitCursor
public void removeWaitCursor()Removes mouse wait cursor and restores the original cursors for all application windows -
trackCursor
public void trackCursor(Component progressComponent, MouseEvent mouseEvent, boolean waitCursorExpected) Tracks mouse cursor changes when mouse enters/leaves progress component. This method is typically invoked fromEventQueueDispatcher.customDispatchMouseEvent()
and ensures that cursor changes to default cursor when mouse is over progress component or to wait cursor when mouse is over rest of controls/windows.- Parameters:
progressComponent
- the progress component over which mouse cursor changes to default cursormouseEvent
- pending mouse eventwaitCursorExpected
-true
indicates that mouse cursor should change to wait cursor,false
indicates that mouse cursor should change to default cursor- See Also:
-