See: Description
Interface | Description |
---|---|
Command |
Definition of an interface for command objects.
|
CommandQueue |
Definition of an interface that describes a command queue.
|
CommandQueueListener |
Definition of an interface for listeners that want to be notified about
changes in the state of a
object. |
ScheduleAware |
Definition of an interface to be implemented by
Command objects that
are interested in the point of time they are passed to a CommandQueue
. |
Class | Description |
---|---|
CommandBase |
An abstract base class for implementations of the
Command
interface. |
CommandQueueEvent |
An event class for notifying listeners about the state of a
CommandQueue . |
CommandQueueImpl |
A command queue implementation for GUI applications.
|
CommandWrapper |
A wrapper implementation of the
Command interface. |
Enum | Description |
---|---|
CommandQueueEvent.Type |
An enumeration for the types supported by the
CommandQueueEvent class. |
This package contains the implementation of the Command pattern.
The actions provided by an application can be implemented as Command
objects. Such an object has a well-defined interface (namely the
Command
interface) and will be run in a separate thread. This is
important for the application to stay responsive even when it executes complex
tasks.
The CommandQueue
interface allows executing command objects: just
pass an object implementing the Command
interface to its
execute()
method. It will then be executed by a working thread (as
soon as one becomes available). The Command
interface provides some
methods that define a kind of life-cycle for a command object. In addition to
the main execute()
method that contains the main logic of the
command methods for error handling are available. There is also support
for updating the GUI after the execution of the command. Special care has to be
taken about this topic because GUI updates must be performed by the event
dispatch thread only.
Interested components can register itself as CommandQueueListener
s
at a command queue object. They will then receive notifications when commands
are executed or the status of the queue changes.
$Id: package.html 205 2012-01-29 18:29:57Z oheger $
Copyright © 2016 The JGUIraffe Team. All rights reserved.