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 collects Module input values, according to the following steps:

  1. Create an InputPanel with widgets corresponding to the module inputs.
  2. Present the panel, if in a UI context.
  3. Harvest the final widget values from the panel, updating the Module's input values to match the harvested values.
  4. Perform any other needed processing of the results (marking inputs as resolved, storing persisted values to preferences, etc.).

Author:
Curtis Rueden

Field Summary
static double PRIORITY
           
 
Method Summary
 void buildPanel(InputPanel<P,W> inputPanel, Module module)
          Populates the given InputPanel with widgets corresponding to the given Module instance.
 InputPanel<P,W> createInputPanel()
          Constructs an empty InputPanel.
 void harvest(Module module)
          Performs the harvesting process.
 boolean harvestInputs(InputPanel<P,W> inputPanel, Module module)
          Gathers input values from the user or other source.
 void processResults(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

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 empty InputPanel. Widgets are added later using the buildPanel(org.scijava.widget.InputPanel, org.scijava.module.Module) method.


buildPanel

void buildPanel(InputPanel<P,W> inputPanel,
                Module module)
                throws ModuleException
Populates the given InputPanel with widgets corresponding to the given Module instance.

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

void processResults(InputPanel<P,W> inputPanel,
                    Module module)
                    throws ModuleException
Does any needed processing, after input values have been harvested.

Throws:
ModuleException


Copyright © 2009–2014 SciJava. All rights reserved.