Package sc.fiji.snt.gui.cmds
Class CommonDynamicCmd
java.lang.Object
org.scijava.module.AbstractModule
org.scijava.module.DefaultMutableModule
org.scijava.command.DynamicCommand
sc.fiji.snt.gui.cmds.CommonDynamicCmd
- All Implemented Interfaces:
Runnable,org.scijava.Cancelable,org.scijava.command.Command,org.scijava.Contextual,org.scijava.module.Module,org.scijava.module.MutableModule,org.scijava.plugin.SciJavaPlugin
- Direct Known Subclasses:
AlongPathDetectorCmd,AnalyzerCmd,AnnotationDensityCmd,AnnotationGraphGeneratorCmd,BackupManagerCmd,BinaryTracerCommonCmd,BrainAnnotationCmd,ChooseDatasetCmd,ColorMapReconstructionCmd,ComputeSecondaryImg,CostFunctionSelectionCmd,DistributionBPCmd,DistributionCPCmd,DuplicateCmd,FigCreatorCmd,FilterOrTagPathsByAngleCmd,GraphGeneratorCmd,GroupAnalyzerCmd,GrowthAnalyzerCmd,GWDTTracerCommonCmd,ImportSeedPointsCmd,InsectBrainImporterCmd,InterpolateRadiiCmd,JSONImporterCmd,LabelProximityDetectorCmd,LabkitLoaderCmd,LoadReconstructionCmd,LoadSeedsFromROIsCmd,LocalThicknessCmd,MLImporterCmd,NDFImporterCmd,NodeProfiler,OpenDatasetCmd,PathAnalyzerCmd,PathMatcherCmd,PathProfiler,PathSpineAnalysisCmd,PathTimeAnalysisCmd,PeripathDetectorCmd,PlotterCmd,RemoteSWCImporterCmd,RestoreSessionCmd,RootAngleAnalyzerCmd,SaveMeasurementsCmd,SaveSessionCmd,ShollAnalysisBulkTreeCmd,ShollAnalysisTreeCmd,SomaDetectorCmd,TranslateReconstructionsCmd,TreeMapperCmd,TwoDHistCmd,WekaModelLoader
public class CommonDynamicCmd
extends org.scijava.command.DynamicCommand
Command class for GUI commands extending DynamicCommand
- Author:
- Tiago Ferreira
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected SNTprotected SNTServiceprotected org.scijava.app.StatusServiceprotected SNTUIprotected org.scijava.ui.UIServiceFields inherited from class org.scijava.command.DynamicCommand
moduleService, pluginService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()voidprotected voidprotected JDialoggetPromptWithCloseHandler(String title) Finds the SciJava-generated prompt dialog by its title and attaches aWindowAdapterthat resets the UI state toSNTUI.READYwhen the dialog is closed.protected JDialoggetPromptWithCloseHandler(String title, Runnable extraOnClose) Variant ofgetPromptWithCloseHandler(String)that runs an extra action when the dialog is closing (e.g., cleaning up listeners).protected voidinit(boolean abortIfInactive) booleanprotected voidprotected voidprotected voidnotifyLoadingEnd(Viewer3D recViewer) protected voidnotifyLoadingStart(Viewer3D recViewer) protected voidresetUI()protected voidresetUI(boolean validateDimensions) protected voidresetUI(boolean validateDimensions, int state) voidrun()protected voidMethods inherited from class org.scijava.command.DynamicCommand
context, getCancelReason, getContext, getInfo, getInput, getOutput, saveInputs, setContext, setInput, setOutput, uncancelMethods inherited from class org.scijava.module.AbstractModule
getDelegateObject, getInputs, getOutputs, initialize, isInputResolved, isOutputResolved, preview, resolveInput, resolveOutput, setInputs, setOutputs, unresolveInput, unresolveOutputMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.scijava.module.Module
getDelegateObject, getInputs, getOutputs, initialize, isInputResolved, isOutputResolved, isResolved, preview, resolveInput, resolveOutput, setInputs, setOutputs, setResolved, unresolveInput, unresolveOutputMethods inherited from interface org.scijava.module.MutableModule
addInput, addInput, addOutput, addOutput, removeInput, removeOutput
-
Field Details
-
HEADER_HTML
- See Also:
-
EMPTY_LABEL
- See Also:
-
statusService
protected org.scijava.app.StatusService statusService -
uiService
protected org.scijava.ui.UIService uiService -
sntService
-
snt
-
ui
-
-
Constructor Details
-
CommonDynamicCmd
public CommonDynamicCmd()
-
-
Method Details
-
init
protected void init(boolean abortIfInactive) -
status
-
isCanceled
public boolean isCanceled()- Specified by:
isCanceledin interfaceorg.scijava.Cancelable- Overrides:
isCanceledin classorg.scijava.command.DynamicCommand
-
cancel
public void cancel()- Specified by:
cancelin interfaceorg.scijava.module.Module- Overrides:
cancelin classorg.scijava.module.AbstractModule
-
cancel
- Specified by:
cancelin interfaceorg.scijava.Cancelable- Overrides:
cancelin classorg.scijava.command.DynamicCommand
-
error
-
msg
-
notifyLoadingStart
-
notifyLoadingEnd
-
resetUI
protected void resetUI() -
resetUI
protected void resetUI(boolean validateDimensions) -
resetUI
protected void resetUI(boolean validateDimensions, int state) -
getPromptWithCloseHandler
Finds the SciJava-generated prompt dialog by its title and attaches aWindowAdapterthat resets the UI state toSNTUI.READYwhen the dialog is closed. This is necessary becauseinit(boolean)sets the state toSNTUI.RUNNING_CMD, but if the user dismisses the dialog without running the command, nothing else resets it.Subclasses implementing
Interactiveshould call this method early (e.g., fromrun()) to ensure the listener is attached before the user can close the dialog. The dialog is cached: repeated calls are no-ops once it has been found.- Parameters:
title- the exact title set viagetInfo().setLabel()— must be unique across open dialogs- Returns:
- the dialog, or
nullif not yet created by SciJava
-
getPromptWithCloseHandler
Variant ofgetPromptWithCloseHandler(String)that runs an extra action when the dialog is closing (e.g., cleaning up listeners).- Parameters:
title- the dialog titleextraOnClose- additional action to run onwindowClosing, ornullfor none. Runs before the UI state is reset.- Returns:
- the dialog, or
nullif not yet created
-
notifyExternalDataLoaded
protected void notifyExternalDataLoaded() -
run
public void run()
-