ilog.views.swing
Class IlvThreadedActivityMonitor

java.lang.Object
  extended by ilog.views.swing.IlvThreadedActivityMonitor

public class IlvThreadedActivityMonitor
extends Object

This class manages a list of threaded activities. Activities (i.e. tasks) shall notify this controller of their progress. All activity listeners registered with this controller will be notified in their turn of any activity progress.

Since:
JViews 7.5

Nested Class Summary
static class IlvThreadedActivityMonitor.ActivityEvent
          An event representing a change in an activity
static interface IlvThreadedActivityMonitor.ActivityListener
          An activity listener that will be notified of activity changes in this IlvThreadedActivityMonitor.
 
Field Summary
static int INDETERMINATE
          This value is used to indicate that the progress is indeterminate
 
Constructor Summary
IlvThreadedActivityMonitor()
          Default constructor.
 
Method Summary
 void addActivityListener(IlvThreadedActivityMonitor.ActivityListener listener)
          Adds an activity listener to this controller
 int getOverallProgress()
          Gets the overall progress of all tasks being monitored
 String getOverallStatus()
          Gets the overall status of all tasks being monitored
 void registerThreadedActivity(Object activity)
          Register an task to be monitored.
 void removeActivityListener(IlvThreadedActivityMonitor.ActivityListener listener)
          Removes an activity listener from this controller
 void unregisterThreadedActivity(Object activity)
          Removes this task from the list of tasks being monitored
 void updateActivityProgress(Object activity, int progress, String message)
          Updates the status of the specified activity with specified progress parameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDETERMINATE

public static int INDETERMINATE
This value is used to indicate that the progress is indeterminate

Constructor Detail

IlvThreadedActivityMonitor

public IlvThreadedActivityMonitor()
Default constructor. Creates a monitor for threaded activities.

Method Detail

registerThreadedActivity

public void registerThreadedActivity(Object activity)
Register an task to be monitored. An task could be any object, its only contract being to notify this activity controller of its progress.

Parameters:
activity - the object whose task should be monitored

addActivityListener

public void addActivityListener(IlvThreadedActivityMonitor.ActivityListener listener)
Adds an activity listener to this controller

Parameters:
listener - the ActivityListener to add

removeActivityListener

public void removeActivityListener(IlvThreadedActivityMonitor.ActivityListener listener)
Removes an activity listener from this controller

Parameters:
listener - the ActivityListener to remove

unregisterThreadedActivity

public void unregisterThreadedActivity(Object activity)
Removes this task from the list of tasks being monitored

Parameters:
activity - the object whose activity should be monitored

getOverallProgress

public int getOverallProgress()
Gets the overall progress of all tasks being monitored

Returns:
overall progress of all tasks (in percentage)

getOverallStatus

public String getOverallStatus()
Gets the overall status of all tasks being monitored

Returns:
a string describing an overall status (i.e. a summary)

updateActivityProgress

public void updateActivityProgress(Object activity,
                                   int progress,
                                   String message)
Updates the status of the specified activity with specified progress parameters

Parameters:
activity - the activity whose status must be updated
progress - the progress of the activity in percent
message - the message to display on the progress bar, or null for percentage display.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.