public abstract class InteractiveCommand extends DynamicCommand implements Interactive, Previewable
It is Interactive
and Previewable
, with the previews used for
interactive exploration.
Further, this class provides added convenience for keeping certain input
parameters synced with active Display
s. It listens for
DisplayActivatedEvent
s, updating the inputs specified in the
constructor when such events occur. Individual interactive commands can then
add callback methods to affected inputs, for reacting to a change in the
active display.
Constructor and Description |
---|
InteractiveCommand(String... listenerNames)
Creates a new interactive command.
|
Modifier and Type | Method and Description |
---|---|
protected <T> ModuleItem<T> |
asType(ModuleItem<?> item,
Class<T> type) |
void |
cancel()
Performs necessary cleanup in response to cancellation of the module
execution.
|
protected LogService |
log() |
protected void |
onEvent(DisplayActivatedEvent evt) |
void |
preview()
Computes a preview of the module's execution results, if available.
|
protected <T> void |
update(ModuleItem<T> item,
T newValue) |
protected void |
updateInput(ModuleItem<?> item) |
cancel, context, getCancelReason, getContext, getInfo, getInput, getOutput, isCanceled, setContext, setInput, setOutput
addInput, addInput, addOutput, addOutput, removeInput, removeOutput, run
getDelegateObject, getInputs, getOutputs, initialize, isResolved, setInputs, setOutputs, setResolved
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDelegateObject, getInputs, getOutputs, initialize, isResolved, setInputs, setOutputs, setResolved
public void preview()
Module
Runnable.run()
. Not all modules support
previews.preview
in interface Previewable
preview
in interface Module
preview
in class AbstractModule
ModuleInfo.canPreview()
public void cancel()
Module
Module.preview()
to undo
any changes made as a result of the preview.cancel
in interface Previewable
cancel
in interface Module
cancel
in class AbstractModule
ModuleInfo.canCancel()
protected void updateInput(ModuleItem<?> item)
protected <T> ModuleItem<T> asType(ModuleItem<?> item, Class<T> type)
protected <T> void update(ModuleItem<T> item, T newValue)
protected LogService log()
protected void onEvent(DisplayActivatedEvent evt)
Copyright © 2009–2015 SciJava. All rights reserved.