org.scijava.widget
Class AbstractInputPanel<P,W>

java.lang.Object
  extended by org.scijava.widget.AbstractInputPanel<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 Implemented Interfaces:
InputPanel<P,W>, UIComponent<P>

public abstract class AbstractInputPanel<P,W>
extends Object
implements InputPanel<P,W>

Abstract superclass of UI-specific InputPanel implementations.

Author:
Curtis Rueden

Field Summary
protected  Map<String,InputWidget<?,W>> widgets
          Table of widgets.
 
Constructor Summary
AbstractInputPanel()
           
 
Method Summary
 void addWidget(InputWidget<?,W> widget)
          Adds a widget to the panel.
 Object getValue(String name)
          Returns the value of the given widget's input.
 int getWidgetCount()
          Gets the number of active widgets in the input panel.
 boolean hasWidgets()
          Gets whether the input panel has any active widgets.
 boolean isMessageOnly()
          Returns true if the input panel consists of only messages.
 void refresh()
          Updates the widgets to reflect the most recent parameter value(s).
 boolean supports(InputWidget<?,?> widget)
          Gets whether the given widget would be appropriate for the given panel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.scijava.widget.InputPanel
getWidgetComponentType
 
Methods inherited from interface org.scijava.widget.UIComponent
getComponent, getComponentType
 

Field Detail

widgets

protected Map<String,InputWidget<?,W>> widgets
Table of widgets.

Constructor Detail

AbstractInputPanel

public AbstractInputPanel()
Method Detail

supports

public boolean supports(InputWidget<?,?> widget)
Description copied from interface: InputPanel
Gets whether the given widget would be appropriate for the given panel.

Specified by:
supports in interface InputPanel<P,W>

addWidget

public void addWidget(InputWidget<?,W> widget)
Description copied from interface: InputPanel
Adds a widget to the panel.

Specified by:
addWidget in interface InputPanel<P,W>

getValue

public Object getValue(String name)
Description copied from interface: InputPanel
Returns the value of the given widget's input.

Specified by:
getValue in interface InputPanel<P,W>
Parameters:
name - unique name identifying this field

getWidgetCount

public int getWidgetCount()
Description copied from interface: InputPanel
Gets the number of active widgets in the input panel.

Specified by:
getWidgetCount in interface InputPanel<P,W>

hasWidgets

public boolean hasWidgets()
Description copied from interface: InputPanel
Gets whether the input panel has any active widgets.

Specified by:
hasWidgets in interface InputPanel<P,W>

isMessageOnly

public boolean isMessageOnly()
Description copied from interface: InputPanel
Returns true if the input panel consists of only messages.

Specified by:
isMessageOnly in interface InputPanel<P,W>

refresh

public void refresh()
Description copied from interface: InputPanel
Updates the widgets to reflect the most recent parameter value(s).

Specified by:
refresh in interface InputPanel<P,W>


Copyright © 2009–2014 SciJava. All rights reserved.