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

    Fields
    Modifier and Type
    Field
    Description
    protected static final String
     
    protected static final String
     
    protected SNT
     
    protected SNTService
     
    protected org.scijava.app.StatusService
     
    protected SNTUI
     
    protected org.scijava.ui.UIService
     

    Fields inherited from class org.scijava.command.DynamicCommand

    moduleService, pluginService
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    cancel(String reason)
     
    protected void
     
    protected JDialog
    Finds the SciJava-generated prompt dialog by its title and attaches a WindowAdapter that resets the UI state to SNTUI.READY when the dialog is closed.
    protected JDialog
    Variant of getPromptWithCloseHandler(String) that runs an extra action when the dialog is closing (e.g., cleaning up listeners).
    protected void
    init(boolean abortIfInactive)
     
    boolean
     
    protected void
    msg(String msg, String title)
     
    protected void
     
    protected void
     
    protected void
     
    protected void
     
    protected void
    resetUI(boolean validateDimensions)
     
    protected void
    resetUI(boolean validateDimensions, int state)
     
    void
    run()
     
    protected void
    status(String statusMsg, boolean temporaryMsg)
     

    Methods inherited from class org.scijava.command.DynamicCommand

    context, getCancelReason, getContext, getInfo, getInput, getOutput, saveInputs, setContext, setInput, setOutput, uncancel

    Methods inherited from class org.scijava.module.AbstractModule

    getDelegateObject, getInputs, getOutputs, initialize, isInputResolved, isOutputResolved, preview, resolveInput, resolveOutput, setInputs, setOutputs, unresolveInput, unresolveOutput

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.scijava.module.Module

    getDelegateObject, getInputs, getOutputs, initialize, isInputResolved, isOutputResolved, isResolved, preview, resolveInput, resolveOutput, setInputs, setOutputs, setResolved, unresolveInput, unresolveOutput

    Methods inherited from interface org.scijava.module.MutableModule

    addInput, addInput, addOutput, addOutput, removeInput, removeOutput
  • Field Details

    • HEADER_HTML

      protected static final String HEADER_HTML
      See Also:
    • EMPTY_LABEL

      protected static final String EMPTY_LABEL
      See Also:
    • statusService

      protected org.scijava.app.StatusService statusService
    • uiService

      protected org.scijava.ui.UIService uiService
    • sntService

      protected SNTService sntService
    • snt

      protected SNT snt
    • ui

      protected SNTUI ui
  • Constructor Details

    • CommonDynamicCmd

      public CommonDynamicCmd()
  • Method Details

    • init

      protected void init(boolean abortIfInactive)
    • status

      protected void status(String statusMsg, boolean temporaryMsg)
    • isCanceled

      public boolean isCanceled()
      Specified by:
      isCanceled in interface org.scijava.Cancelable
      Overrides:
      isCanceled in class org.scijava.command.DynamicCommand
    • cancel

      public void cancel()
      Specified by:
      cancel in interface org.scijava.module.Module
      Overrides:
      cancel in class org.scijava.module.AbstractModule
    • cancel

      public void cancel(String reason)
      Specified by:
      cancel in interface org.scijava.Cancelable
      Overrides:
      cancel in class org.scijava.command.DynamicCommand
    • error

      protected void error(String msg)
    • msg

      protected void msg(String msg, String title)
    • notifyLoadingStart

      protected void notifyLoadingStart(Viewer3D recViewer)
    • notifyLoadingEnd

      protected void notifyLoadingEnd(Viewer3D recViewer)
    • resetUI

      protected void resetUI()
    • resetUI

      protected void resetUI(boolean validateDimensions)
    • resetUI

      protected void resetUI(boolean validateDimensions, int state)
    • getPromptWithCloseHandler

      protected JDialog getPromptWithCloseHandler(String title)
      Finds the SciJava-generated prompt dialog by its title and attaches a WindowAdapter that resets the UI state to SNTUI.READY when the dialog is closed. This is necessary because init(boolean) sets the state to SNTUI.RUNNING_CMD, but if the user dismisses the dialog without running the command, nothing else resets it.

      Subclasses implementing Interactive should call this method early (e.g., from run()) 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 via getInfo().setLabel() — must be unique across open dialogs
      Returns:
      the dialog, or null if not yet created by SciJava
    • getPromptWithCloseHandler

      protected JDialog getPromptWithCloseHandler(String title, Runnable extraOnClose)
      Variant of getPromptWithCloseHandler(String) that runs an extra action when the dialog is closing (e.g., cleaning up listeners).
      Parameters:
      title - the dialog title
      extraOnClose - additional action to run on windowClosing, or null for none. Runs before the UI state is reset.
      Returns:
      the dialog, or null if not yet created
    • notifyExternalDataLoaded

      protected void notifyExternalDataLoaded()
    • run

      public void run()