Package org.scijava
Class SciJava
-
- All Implemented Interfaces:
Comparable<Prioritized>,Contextual,Disposable,Gateway,Identifiable,Locatable,Logged,HasPluginInfo,RichPlugin,SciJavaPlugin,Prioritized,Versioned
public class SciJava extends AbstractGateway
Main entry point into SciJava. This class enables working with SciJava services in a simple way, while retaining extensibility (i.e., access to third-party services).- Author:
- Curtis Rueden
-
-
Constructor Summary
Constructors Constructor Description SciJava()Creates a new SciJava application context with all available services.SciJava(boolean empty)Creates a new Scijava application context.SciJava(Class... serviceClasses)Creates a new SciJava application context with the specified services (and any required service dependencies).SciJava(Collection<Class<? extends Service>> serviceClasses)Creates a new SciJava application context with the specified services (and any required service dependencies).SciJava(Context context)Creates a new SciJava application context which wraps the given existing SciJava context.
-
Method Summary
-
Methods inherited from class org.scijava.AbstractGateway
app, appEvent, command, console, convert, display, event, eventHistory, get, get, getApp, getInfo, getShortName, getTitle, getVersion, icon, input, io, launch, location, log, main, menu, module, object, options, platform, plugin, prefs, recentFile, script, startup, status, text, thread, tool, ui, widget
-
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
getInfo, getPriority, setInfo, setPriority, toString
-
Methods inherited from class org.scijava.AbstractContextual
context, getContext
-
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.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
-
-
-
-
Constructor Detail
-
SciJava
public SciJava()
Creates a new SciJava application context with all available services.
-
SciJava
public SciJava(boolean empty)
Creates a new Scijava application context.- Parameters:
empty- If true, the context will be empty; otherwise, it will be initialized with all available services.
-
SciJava
public SciJava(Class... serviceClasses)
Creates a new SciJava application context with the specified services (and any required service dependencies).Developer's note: This constructor's argument is raw (i.e.,
Class...instead ofClass<? extends Service>...) because otherwise, downstream invocations (e.g.,new SciJava(LogService.class)) yield the potentially confusing warning:Type safety: A generic array of
Class<? extends Service>is created for a varargs parameterTo avoid this, we have opted to use raw types and suppress the relevant warning here instead.
- Parameters:
serviceClasses- A list of types that implement theServiceinterface (e.g.,LogService.class).- Throws:
ClassCastException- If any of the given arguments do not implement theServiceinterface.
-
SciJava
public SciJava(Collection<Class<? extends Service>> serviceClasses)
Creates a new SciJava application context with the specified services (and any required service dependencies).- Parameters:
serviceClasses- A collection of types that implement theServiceinterface (e.g.,LogService.class).
-
-