|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.scijava.AbstractContextual
org.scijava.widget.DefaultWidgetModel
public class DefaultWidgetModel
The backing data model for a particular InputWidget.
| Constructor Summary | |
|---|---|
DefaultWidgetModel(Context context,
InputPanel<?,?> inputPanel,
Module module,
ModuleItem<?> item,
List<?> objectPool)
|
|
| Method Summary | |
|---|---|
void |
callback()
Executes the callback associated with this widget's associated input. |
String[] |
getChoices()
Gets the multiple choice list for the module input. |
ModuleItem<?> |
getItem()
Gets the module input's associated item descriptor. |
Number |
getMax()
Gets the maximum value for the module input. |
Number |
getMin()
Gets the minimum value for the module input. |
Module |
getModule()
Gets the module's associated module instance. |
List<?> |
getObjectPool()
Gets the available objects for use with the widget. |
InputPanel<?,?> |
getPanel()
Gets the input panel intended to house the widget. |
Number |
getSoftMax()
Gets the "soft" maximum value for the module input. |
Number |
getSoftMin()
Gets the "soft" minimum value for the module input. |
Number |
getStepSize()
Gets the step size between values for the module input. |
String |
getText()
Gets the input's value rendered as a string. |
Object |
getValue()
Gets the current value of the module input. |
String |
getWidgetLabel()
Gets the text to use when labeling this widget. |
boolean |
isBoolean()
Gets whether the input is a boolean type (i.e., Boolean or
boolean). |
boolean |
isCharacter()
Gets whether the input is a character type (i.e., Character or
char). |
boolean |
isInitialized()
Gets the widget's initialization state. |
boolean |
isMessage()
Gets whether the input is a message. |
boolean |
isMultipleChoice()
Gets whether the input provides a restricted set of choices. |
boolean |
isNumber()
Gets whether the input is a number type (e.g., int, float
or any Number implementation. |
boolean |
isStyle(String style)
Gets whether the widget is the given style. |
boolean |
isText()
Gets whether the input is a text type (i.e., String,
Character or char. |
boolean |
isType(Class<?> type)
Gets whether the input is compatible with the given type. |
void |
setInitialized(boolean initialized)
Toggles the widget's initialization state. |
void |
setValue(Object value)
Sets the current value of the module input. |
| Methods inherited from class org.scijava.AbstractContextual |
|---|
context, getContext, setContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.scijava.Contextual |
|---|
context, getContext, setContext |
| Constructor Detail |
|---|
public DefaultWidgetModel(Context context,
InputPanel<?,?> inputPanel,
Module module,
ModuleItem<?> item,
List<?> objectPool)
| Method Detail |
|---|
public InputPanel<?,?> getPanel()
WidgetModel
getPanel in interface WidgetModelpublic Module getModule()
WidgetModel
getModule in interface WidgetModelpublic ModuleItem<?> getItem()
WidgetModel
getItem in interface WidgetModelpublic List<?> getObjectPool()
WidgetModelObjectWidgets typically display a dropdown combo box providing
multiple choice selection between these objects.
Note that this list does not represent a constraint in allowed widget values, but rather provides a list of possibilities in cases where the realm of values is not defined by the type in some other way.
getObjectPool in interface WidgetModelObjectWidgetpublic String getWidgetLabel()
WidgetModelBasicDetails.getLabel()).
Otherwise, a capitalized version of the item's name is given (i.e.,
Named.getName()).
getWidgetLabel in interface WidgetModelpublic boolean isStyle(String style)
WidgetModelstyle.equals(getItem().getWidgetStyle()).
isStyle in interface WidgetModelpublic Object getValue()
WidgetModel
In the case of inputs with a limited set of choices (i.e.,
ChoiceWidgets and ObjectWidgets), this method ensures the
value is in the set; if not, it returns the first item of the set.
getValue in interface WidgetModelpublic void setValue(Object value)
WidgetModel
setValue in interface WidgetModelpublic void callback()
WidgetModel
callback in interface WidgetModelpublic Number getMin()
WidgetModel
getMin in interface WidgetModelpublic Number getMax()
WidgetModel
getMax in interface WidgetModelpublic Number getSoftMin()
WidgetModel
getSoftMin in interface WidgetModelWidgetModel.getMin() if none.ModuleItem.getSoftMinimum()public Number getSoftMax()
WidgetModel
getSoftMax in interface WidgetModelWidgetModel.getMax() if none.ModuleItem.getSoftMaximum()public Number getStepSize()
WidgetModel
getStepSize in interface WidgetModelpublic String[] getChoices()
WidgetModel
getChoices in interface WidgetModelChoiceWidgetpublic String getText()
WidgetModel
getText in interface WidgetModelpublic boolean isMessage()
WidgetModel
isMessage in interface WidgetModelItemVisibility.MESSAGEpublic boolean isText()
WidgetModelString,
Character or char.
isText in interface WidgetModelpublic boolean isCharacter()
WidgetModelCharacter or
char).
isCharacter in interface WidgetModelpublic boolean isNumber()
WidgetModelint, float
or any Number implementation.
isNumber in interface WidgetModelpublic boolean isBoolean()
WidgetModelBoolean or
boolean).
isBoolean in interface WidgetModelpublic boolean isMultipleChoice()
WidgetModel
isMultipleChoice in interface WidgetModelpublic boolean isType(Class<?> type)
WidgetModel
isType in interface WidgetModelpublic void setInitialized(boolean initialized)
WidgetModelInputPanel.
setInitialized in interface WidgetModelpublic boolean isInitialized()
WidgetModelInputPanel.
isInitialized in interface WidgetModel
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||