JHotDraw 7rev733

org.jhotdraw.gui
Interface ActivityModel

All Superinterfaces:
javax.swing.BoundedRangeModel
All Known Implementing Classes:
DefaultActivityModel

public interface ActivityModel
extends javax.swing.BoundedRangeModel

Describes the progress of a activity. An activity is typically a long running background task which has been directly initiated or scheduled by the user.

Every progress model should add itself to the ActivityManager after it has been created.


Design Patterns

Framework
The interfaces and classes listed below define a framework for progress management.
Contract: ActivityManager, ActivityModel, JActivityWindow, JActivityIndicator.

Version:
$Id$
Author:
Werner Randelshofer

Field Summary
static java.lang.String CANCELABLE_PROPERTY
           
static java.lang.String CANCELED_PROPERTY
           
static java.lang.String CLOSED_PROPERTY
           
static java.lang.String ERROR_PROPERTY
           
static java.lang.String INDETERMINATE_PROPERTY
           
static java.lang.String NOTE_PROPERTY
           
static java.lang.String WARNING_PROPERTY
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a property change listener.
 void cancel()
          Cancels the operation.
 void close()
          Indicate that the operation is closed.
 java.lang.String getError()
          Specifies the error message that is displayed along with the progress message.
 java.lang.String getNote()
          Specifies the additional note that is displayed along with the progress message.
 java.lang.Object getOwner()
          Gets the owner of the progress model.
 java.lang.String getTitle()
          Returns the title of the progress model.
 java.lang.String getWarning()
          Specifies the warning message that is displayed along with the progress message.
 boolean isCancelable()
          Returns true if the operation can be canceled.
 boolean isCanceled()
          Returns true if the user has hit the Cancel button in the progress dialog.
 boolean isClosed()
          Returns true if the operation is completed.
 boolean isIndeterminate()
          Returns true if the progress observer is set to indeterminate.
 void printf(java.lang.String format, java.lang.Object... args)
          Sets a formatted note.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a property change listener.
 void setCancelable(boolean b)
          Set cancelable to false if the operation can not be canceled.
 void setDoCancel(java.lang.Runnable doCancel)
          The specified Runnable is executed when the user presses the cancel button.
 void setError(java.lang.String message)
          Specifies the additional error message that is displayed along with the progress message.
 void setIndeterminate(boolean newValue)
          Sets the progress observer to indeterminate.
 void setNote(java.lang.String note)
          Specifies the additional note that is displayed along with the progress message.
 void setWarning(java.lang.String message)
          Specifies the additional warning message that is displayed along with the progress message.
 
Methods inherited from interface javax.swing.BoundedRangeModel
addChangeListener, getExtent, getMaximum, getMinimum, getValue, getValueIsAdjusting, removeChangeListener, setExtent, setMaximum, setMinimum, setRangeProperties, setValue, setValueIsAdjusting
 

Field Detail

INDETERMINATE_PROPERTY

static final java.lang.String INDETERMINATE_PROPERTY
See Also:
Constant Field Values

NOTE_PROPERTY

static final java.lang.String NOTE_PROPERTY
See Also:
Constant Field Values

WARNING_PROPERTY

static final java.lang.String WARNING_PROPERTY
See Also:
Constant Field Values

ERROR_PROPERTY

static final java.lang.String ERROR_PROPERTY
See Also:
Constant Field Values

CANCELABLE_PROPERTY

static final java.lang.String CANCELABLE_PROPERTY
See Also:
Constant Field Values

CANCELED_PROPERTY

static final java.lang.String CANCELED_PROPERTY
See Also:
Constant Field Values

CLOSED_PROPERTY

static final java.lang.String CLOSED_PROPERTY
See Also:
Constant Field Values
Method Detail

getOwner

java.lang.Object getOwner()
Gets the owner of the progress model. This is typically a View or a Application.


setCancelable

void setCancelable(boolean b)
Set cancelable to false if the operation can not be canceled.


isCancelable

boolean isCancelable()
Returns true if the operation can be canceled.


setDoCancel

void setDoCancel(java.lang.Runnable doCancel)
The specified Runnable is executed when the user presses the cancel button.


setIndeterminate

void setIndeterminate(boolean newValue)
Sets the progress observer to indeterminate.


isIndeterminate

boolean isIndeterminate()
Returns true if the progress observer is set to indeterminate.


close

void close()
Indicate that the operation is closed. If the progress model added itself to the ActivityManager it MUST remove itself now.


isClosed

boolean isClosed()
Returns true if the operation is completed.


cancel

void cancel()
Cancels the operation. This method must be invoked from the user event dispatch thread.


isCanceled

boolean isCanceled()
Returns true if the user has hit the Cancel button in the progress dialog.


setNote

void setNote(java.lang.String note)
Specifies the additional note that is displayed along with the progress message. Used, for example, to show which file is currently being copied during a multiple-file copy.

Parameters:
note - a String specifying the note to display
See Also:
getNote()

printf

void printf(java.lang.String format,
            java.lang.Object... args)
Sets a formatted note.


getNote

java.lang.String getNote()
Specifies the additional note that is displayed along with the progress message.

Returns:
a String specifying the note to display
See Also:
setNote(java.lang.String)

setWarning

void setWarning(java.lang.String message)
Specifies the additional warning message that is displayed along with the progress message. Used, for example, to show which files couldn't be copied during a multiple-file copy..

Parameters:
message - a String specifying the message to display, or null if there is no warning.
See Also:
getWarning()

getWarning

java.lang.String getWarning()
Specifies the warning message that is displayed along with the progress message.

Returns:
a String specifying the message to display, or null if there is no warning.

setError

void setError(java.lang.String message)
Specifies the additional error message that is displayed along with the progress message. Used, for example, to show which files couldn't be copied during a multiple-file copy..

Parameters:
message - a String specifying the message to display, or null if there is no error.
See Also:
getWarning()

getError

java.lang.String getError()
Specifies the error message that is displayed along with the progress message.

Returns:
a String specifying the message to display, or null if there is no error.

addPropertyChangeListener

void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a property change listener.


removePropertyChangeListener

void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a property change listener.


getTitle

java.lang.String getTitle()
Returns the title of the progress model.


Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.