Package org.scijava.app
Class DefaultStatusService
- java.lang.Object
-
- org.scijava.AbstractContextual
-
- org.scijava.plugin.AbstractRichPlugin
-
- org.scijava.service.AbstractService
-
- org.scijava.app.DefaultStatusService
-
- All Implemented Interfaces:
Comparable<Prioritized>,StatusService,Contextual,Disposable,Identifiable,Initializable,Locatable,Logged,HasPluginInfo,RichPlugin,SciJavaPlugin,Prioritized,SciJavaService,Service,Versioned
public class DefaultStatusService extends AbstractService implements StatusService
Default service for status notifications.- Author:
- Curtis Rueden
-
-
Constructor Summary
Constructors Constructor Description DefaultStatusService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearStatus()Clears the status message.StringgetStatusMessage(String appName, StatusEvent statusEvent)Gets the status message of the given event.protected voidpublish(StatusEvent statusEvent)Publish the status event to the event service.voidshowProgress(int value, int maximum)Updates the progress bar.voidshowStatus(int progress, int maximum, String message)Updates the status message and progress bar.voidshowStatus(int progress, int maximum, String message, boolean warn)Updates the status message and progress bar, optionally flagging the status notification as a warning.voidshowStatus(String message)Updates the status message.voidwarn(String message)Issues a warning message.-
Methods inherited from class org.scijava.service.AbstractService
getContext, setContext, toString
-
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
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.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.Disposable
dispose
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.service.Service
initialize, registerEventHandlers
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
showProgress
public void showProgress(int value, int maximum)Description copied from interface:StatusServiceUpdates the progress bar.- Specified by:
showProgressin interfaceStatusService
-
showStatus
public void showStatus(String message)
Description copied from interface:StatusServiceUpdates the status message.- Specified by:
showStatusin interfaceStatusService
-
showStatus
public void showStatus(int progress, int maximum, String message)Description copied from interface:StatusServiceUpdates the status message and progress bar.- Specified by:
showStatusin interfaceStatusService
-
warn
public void warn(String message)
Description copied from interface:StatusServiceIssues a warning message.- Specified by:
warnin interfaceStatusService
-
showStatus
public void showStatus(int progress, int maximum, String message, boolean warn)Description copied from interface:StatusServiceUpdates the status message and progress bar, optionally flagging the status notification as a warning.- Specified by:
showStatusin interfaceStatusService- Parameters:
progress- New progress valuemaximum- New progress maximummessage- New status messagewarn- Whether or not this notification constitutes a warning
-
clearStatus
public void clearStatus()
Description copied from interface:StatusServiceClears the status message.- Specified by:
clearStatusin interfaceStatusService
-
getStatusMessage
public String getStatusMessage(String appName, StatusEvent statusEvent)
Description copied from interface:StatusServiceGets 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:
getStatusMessagein interfaceStatusService- 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.
-
-