All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.as400.vaccess.WorkingCursorAdapter
java.lang.Object
|
+----com.ibm.as400.vaccess.WorkingCursorAdapter
- public class WorkingCursorAdapter
- extends Object
- implements WorkingListener, Serializable
The WorkingCursorAdapter class represents an object that listens
for working events and sets the cursor as needed. When an event
source starts working, the cursor is changed to the "wait" cursor.
When an event source stops working, the cursor is changed back to the
original cursor.
If multiple start events are fired, then the same number of stop
events must be fired to get the cursor back to its original state.
The component property is used to determine the frame where
the cursor is changed. If no component is set, or a parent frame
is not available, then the cursor will not be changed.
The following example creates a tree model filled with
the contents of a directory in the integrated file system of an
AS/400. It will use a WorkingCursorAdapter object to change the
cursor as needed.
// Set up the tree model in a JTree.
AS400TreeModel treeModel = new AS400TreeModel ();
JTree tree = new JTree (treeModel);
// Set up the working cursor adapter.
treeModel.addWorkingListener (new WorkingCursorAdapter (tree));
// Set up the tree model to contain the contents of
// a directory.
AS400 system = new AS400 ();
VIFSDirectory directory = new VIFSDirectory (system, "/myDirectory");
treeModel.setRoot (directory);
// Create a frame and add the tree.
JFrame frame = new JFrame ();
frame.getContentPane ().add (directory);
-
WorkingCursorAdapter()
- Constructs a WorkingCursorAdapter object.
-
WorkingCursorAdapter(Component)
- Constructs a WorkingCursorAdapter object.
-
getComponent()
- Returns the component that determines the frame for
cursor changes.
-
setComponent(Component)
- Sets the component that determines the frame for
cursor changes.
-
startWorking(WorkingEvent)
- Processes a start working event.
-
stopWorking(WorkingEvent)
- Processes a stop working event.
WorkingCursorAdapter
public WorkingCursorAdapter()
- Constructs a WorkingCursorAdapter object.
WorkingCursorAdapter
public WorkingCursorAdapter(Component component)
- Constructs a WorkingCursorAdapter object.
- Parameters:
- component - The component.
getComponent
public Component getComponent()
- Returns the component that determines the frame for
cursor changes.
- Returns:
- The component, or null if none has been set.
setComponent
public void setComponent(Component component)
- Sets the component that determines the frame for
cursor changes.
- Parameters:
- component - The component.
startWorking
public synchronized void startWorking(WorkingEvent event)
- Processes a start working event. If the component has
been added to a frame, then this will set the cursor to the
wait cursor.
- Parameters:
- event - The event.
stopWorking
public synchronized void stopWorking(WorkingEvent event)
- Processes a stop working event. This will set the cursor
back to its previous form. If there are, however,
multiple calls to startWorking(), the cursor is not changed back
until all starts have matching stops.
- Parameters:
- event - The event.
All Packages Class Hierarchy This Package Previous Next Index