Package org.scijava.widget
Interface InputHarvester<P,W>
-
- Type Parameters:
P- The type of UI component housing the input panel itself.W- The type of UI component housing each input widget.
- All Known Implementing Classes:
AbstractInputHarvester,AbstractInputHarvesterPlugin
public interface InputHarvester<P,W>An input harvester collectsModuleinput values, according to the following steps:- Create an
InputPanelwith widgets corresponding to the module inputs. - Present the panel, if in a UI context.
- Harvest the final widget values from the panel, updating the
Module's input values to match the harvested values. - Perform any other needed processing of the results (marking inputs as resolved, storing persisted values to preferences, etc.).
- Author:
- Curtis Rueden
-
-
Field Summary
Fields Modifier and Type Field Description static doublePRIORITY
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidbuildPanel(InputPanel<P,W> inputPanel, Module module)Populates the givenInputPanelwith widgets corresponding to the givenModuleinstance.InputPanel<P,W>createInputPanel()Constructs an emptyInputPanel.default voidharvest(Module module)Performs the harvesting process.booleanharvestInputs(InputPanel<P,W> inputPanel, Module module)Gathers input values from the user or other source.default voidprocessResults(InputPanel<P,W> inputPanel, Module module)Does any needed processing, after input values have been harvested.
-
-
-
Field Detail
-
PRIORITY
static final double PRIORITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
harvest
default void harvest(Module module) throws ModuleException
Performs the harvesting process.- Parameters:
module- The module whose inputs should be harvest.- Throws:
ModuleException- If the process goes wrong, or is canceled.
-
createInputPanel
InputPanel<P,W> createInputPanel()
Constructs an emptyInputPanel. Widgets are added later using thebuildPanel(org.scijava.widget.InputPanel<P, W>, org.scijava.module.Module)method.
-
buildPanel
void buildPanel(InputPanel<P,W> inputPanel, Module module) throws ModuleException
Populates the givenInputPanelwith widgets corresponding to the givenModuleinstance.- Parameters:
inputPanel- The panel to populate.module- The module whose inputs should be translated into widgets.- Throws:
ModuleException- if the panel cannot be populated for some reason. This may occur due to an input of unsupported type.
-
harvestInputs
boolean harvestInputs(InputPanel<P,W> inputPanel, Module module)
Gathers input values from the user or other source. For example, a graphical user interface could present a dialog box.
-
processResults
default void processResults(InputPanel<P,W> inputPanel, Module module) throws ModuleException
Does any needed processing, after input values have been harvested.- Throws:
ModuleException
-
-