org.scijava.app
Class DefaultStatusService

java.lang.Object
  extended by org.scijava.AbstractContextual
      extended by org.scijava.plugin.AbstractRichPlugin
          extended by org.scijava.service.AbstractService
              extended by org.scijava.app.DefaultStatusService
All Implemented Interfaces:
Comparable<Prioritized>, StatusService, Contextual, Disposable, HasPluginInfo, RichPlugin, SciJavaPlugin, Prioritized, SciJavaService, Service

public class DefaultStatusService
extends AbstractService
implements StatusService

Default service for status notifications.

Author:
Curtis Rueden

Constructor Summary
DefaultStatusService()
           
 
Method Summary
 void clearStatus()
          Clears the status message.
 String getStatusMessage(String appName, StatusEvent statusEvent)
          Gets the status message of the given event.
protected  void publish(StatusEvent statusEvent)
          Publish the status event to the event service.
 void showProgress(int value, int maximum)
          Updates the progress bar.
 void showStatus(int progress, int maximum, String message)
          Updates the status message and progress bar.
 void showStatus(int progress, int maximum, String message, boolean warn)
          Updates the status message and progress bar, optionally flagging the status notification as a warning.
 void showStatus(String message)
          Updates the status message.
 void warn(String message)
          Issues a warning message.
 
Methods inherited from class org.scijava.service.AbstractService
dispose, getContext, initialize, registerEventHandlers, setContext, toString
 
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
compareTo, getInfo, getPriority, setInfo, setPriority
 
Methods inherited from class org.scijava.AbstractContextual
context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.scijava.service.Service
initialize, registerEventHandlers
 
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
 
Methods inherited from interface org.scijava.Prioritized
getPriority, setPriority
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
 
Methods inherited from interface org.scijava.Disposable
dispose
 

Constructor Detail

DefaultStatusService

public DefaultStatusService()
Method Detail

showProgress

public void showProgress(int value,
                         int maximum)
Description copied from interface: StatusService
Updates the progress bar.

Specified by:
showProgress in interface StatusService

showStatus

public void showStatus(String message)
Description copied from interface: StatusService
Updates the status message.

Specified by:
showStatus in interface StatusService

showStatus

public void showStatus(int progress,
                       int maximum,
                       String message)
Description copied from interface: StatusService
Updates the status message and progress bar.

Specified by:
showStatus in interface StatusService

warn

public void warn(String message)
Description copied from interface: StatusService
Issues a warning message.

Specified by:
warn in interface StatusService

showStatus

public void showStatus(int progress,
                       int maximum,
                       String message,
                       boolean warn)
Description copied from interface: StatusService
Updates the status message and progress bar, optionally flagging the status notification as a warning.

Specified by:
showStatus in interface StatusService
Parameters:
progress - New progress value
maximum - New progress maximum
message - New status message
warn - Whether or not this notification constitutes a warning

clearStatus

public void clearStatus()
Description copied from interface: StatusService
Clears the status message.

Specified by:
clearStatus in interface StatusService

getStatusMessage

public String getStatusMessage(String appName,
                               StatusEvent statusEvent)
Description copied from interface: StatusService
Gets the status message of the given event. In the case of the empty string (""), an alternative default string will be returned instead using the application version of the given application.

Specified by:
getStatusMessage in interface StatusService
See Also:
StatusEvent.getStatusMessage(), App.getInfo(boolean)

publish

protected void publish(StatusEvent statusEvent)
Publish the status event to the event service. The default behavior is to publish status asynchronously. You can change this behavior by overriding this method in a derived class.

Parameters:
statusEvent - the event to send to status listeners.


Copyright © 2009–2014 SciJava. All rights reserved.