org.scijava.platform
Class DefaultAppEventService

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

public class DefaultAppEventService
extends AbstractService
implements AppEventService

Default service for handling application-level events.

An AppAboutEvent triggers a callback to about(). An AppPreferencesEvent triggers a callback to prefs(). Finally, an AppQuitEvent triggers a callback to quit(). Note that this class's implementations of the former two methods do nothing, and the latter simply disposes the application context with no user checks.

Author:
Curtis Rueden

Constructor Summary
DefaultAppEventService()
           
 
Method Summary
 void about()
          Displays an About ImageJ dialog.
 List<Class<? extends Command>> getCommands()
          Gets the commands associated with this service.
protected  void onEvent(AppAboutEvent event)
           
protected  void onEvent(AppPreferencesEvent event)
           
protected  void onEvent(AppQuitEvent event)
           
 void prefs()
          Displays the ImageJ preferences dialog.
 void quit()
          Quits ImageJ, prompting the user about any unsaved work first.
 
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

DefaultAppEventService

public DefaultAppEventService()
Method Detail

about

public void about()
Description copied from interface: AppEventService
Displays an About ImageJ dialog.

Specified by:
about in interface AppEventService

prefs

public void prefs()
Description copied from interface: AppEventService
Displays the ImageJ preferences dialog.

Specified by:
prefs in interface AppEventService

quit

public void quit()
Description copied from interface: AppEventService
Quits ImageJ, prompting the user about any unsaved work first.

Specified by:
quit in interface AppEventService

getCommands

public List<Class<? extends Command>> getCommands()
Description copied from interface: AppEventService
Gets the commands associated with this service.

Specified by:
getCommands in interface AppEventService

onEvent

protected void onEvent(AppAboutEvent event)

onEvent

protected void onEvent(AppPreferencesEvent event)

onEvent

protected void onEvent(AppQuitEvent event)


Copyright © 2009–2014 SciJava. All rights reserved.