public abstract class AbstractModuleInfo extends AbstractUIDetails implements ModuleInfo, Identifiable, Locatable, Versioned
ModuleInfo
implementation.
By default, ModuleItem
s are stored in HashMap
s and
ArrayList
s, internally.
APPLICATION_MENU_ROOT
Constructor and Description |
---|
AbstractModuleInfo() |
Modifier and Type | Method and Description |
---|---|
boolean |
canCancel()
Gets whether the module condones cancellation.
|
boolean |
canPreview()
Gets whether the module supports previews.
|
boolean |
canRunHeadless()
Gets whether the module condones headless execution.
|
protected void |
clearParameters()
Clears input and output parameters.
|
String |
getIdentifier()
Gets a string intended to function as an identifier for the object.
|
String |
getInitializer()
Gets the function that is called to initialize the module's values.
|
ModuleItem<?> |
getInput(String name)
Gets the input item with the given name.
|
<T> ModuleItem<T> |
getInput(String name,
Class<T> type)
Gets the input item with the given name and type.
|
String |
getLocation()
Gets the URL string defining the object's location.
|
ModuleItem<?> |
getOutput(String name)
Gets the output item with the given name.
|
<T> ModuleItem<T> |
getOutput(String name,
Class<T> type)
Gets the output item with the given name and type.
|
List<ValidityProblem> |
getProblems()
Gets the list of problems encountered while initializing the object.
|
String |
getTitle()
Gets an appropriate title for the object, for use in a user interface.
|
String |
getVersion()
Gets the version of the object.
|
protected List<ModuleItem<?>> |
inputList()
Gets
outputMap , initializing if needed. |
protected Map<String,ModuleItem<?>> |
inputMap()
Gets
inputMap , initializing if needed. |
Iterable<ModuleItem<?>> |
inputs()
Gets the list of input items.
|
boolean |
isInteractive()
Gets whether the module is intended to be run interactively.
|
boolean |
isValid()
Gets whether the object is completely valid (i.e., no problems during
initialization).
|
protected List<ModuleItem<?>> |
outputList()
Gets
outputList , initializing if needed. |
protected Map<String,ModuleItem<?>> |
outputMap()
Gets
inputList , initializing if needed. |
Iterable<ModuleItem<?>> |
outputs()
Gets the list of output items.
|
protected void |
parseParameters()
Parses input and output parameters.
|
protected void |
registerInput(ModuleItem<?> input)
Adds an input.
|
protected void |
registerOutput(ModuleItem<?> output)
Adds an output.
|
void |
update(EventService eventService)
Notifies interested parties that the module info has been modified.
|
compareTo, getIconPath, getMenuPath, getMenuRoot, getPriority, getSelectionGroup, isEnabled, isSelectable, isSelected, isVisible, setEnabled, setIconPath, setMenuPath, setMenuRoot, setPriority, setSelectable, setSelected, setSelectionGroup, setVisible, toString
get, getDescription, getLabel, getName, is, set, setDescription, setLabel, setName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createModule, getDelegateClassName, loadDelegateClass
getIconPath, getMenuPath, getMenuRoot, getSelectionGroup, isEnabled, isSelectable, isSelected, isVisible, setEnabled, setIconPath, setMenuPath, setMenuRoot, setSelectable, setSelected, setSelectionGroup, setVisible
get, getDescription, getLabel, is, set, setDescription, setLabel
getPriority, setPriority
compareTo
public ModuleItem<?> getInput(String name)
ModuleInfo
getInput
in interface ModuleInfo
public <T> ModuleItem<T> getInput(String name, Class<T> type)
ModuleInfo
getInput
in interface ModuleInfo
public ModuleItem<?> getOutput(String name)
ModuleInfo
getOutput
in interface ModuleInfo
public <T> ModuleItem<T> getOutput(String name, Class<T> type)
ModuleInfo
getOutput
in interface ModuleInfo
public Iterable<ModuleItem<?>> inputs()
ModuleInfo
inputs
in interface ModuleInfo
public Iterable<ModuleItem<?>> outputs()
ModuleInfo
outputs
in interface ModuleInfo
public boolean isInteractive()
ModuleInfo
Runnable.run()
being called whenever any of the values change.isInteractive
in interface ModuleInfo
public boolean canPreview()
ModuleInfo
Runnable.run()
. If this method returns false, then
calling Module.preview()
will have no effect.canPreview
in interface ModuleInfo
public boolean canCancel()
ModuleInfo
Module.cancel()
will
have no effect.canCancel
in interface ModuleInfo
public boolean canRunHeadless()
ModuleInfo
canRunHeadless
in interface ModuleInfo
public String getInitializer()
ModuleInfo
getInitializer
in interface ModuleInfo
public void update(EventService eventService)
ModuleInfo
For classes implementing this interface directly, this method should
publish a ModulesUpdatedEvent
to the event bus (see
update(EventService)
for an example).
update
in interface ModuleInfo
public String getTitle()
UIDetails
getTitle
in interface UIDetails
getTitle
in class AbstractUIDetails
public boolean isValid()
Validated
public List<ValidityProblem> getProblems()
Validated
getProblems
in interface Validated
Validated.isValid()
returning true.public String getIdentifier()
Identifiable
getIdentifier
in interface Identifiable
public String getLocation()
Locatable
getLocation
in interface Locatable
public String getVersion()
Versioned
getVersion
in interface Versioned
protected void parseParameters()
protected void clearParameters()
protected void registerInput(ModuleItem<?> input)
parseParameters()
methods.protected void registerOutput(ModuleItem<?> output)
parseParameters()
methods.protected Map<String,ModuleItem<?>> inputMap()
inputMap
, initializing if needed.protected Map<String,ModuleItem<?>> outputMap()
inputList
, initializing if needed.protected List<ModuleItem<?>> inputList()
outputMap
, initializing if needed.protected List<ModuleItem<?>> outputList()
outputList
, initializing if needed.Copyright © 2009–2015 SciJava. All rights reserved.