org.scijava.module
Class DefaultMutableModuleItem<T>

java.lang.Object
  extended by org.scijava.AbstractBasicDetails
      extended by org.scijava.module.AbstractModuleItem<T>
          extended by org.scijava.module.DefaultMutableModuleItem<T>
All Implemented Interfaces:
BasicDetails, ModuleItem<T>, MutableModuleItem<T>, Named

public class DefaultMutableModuleItem<T>
extends AbstractModuleItem<T>
implements MutableModuleItem<T>

Default MutableModuleItem implementation, for use with custom MutableModule implementations.

Author:
Curtis Rueden

Constructor Summary
DefaultMutableModuleItem(ModuleInfo info, ModuleItem<T> item)
          Creates a new module item with the same values as the given item.
DefaultMutableModuleItem(ModuleInfo info, String name, Class<T> type)
           
DefaultMutableModuleItem(Module module, String name, Class<T> type)
           
 
Method Summary
 String getCallback()
          Gets the function that is called whenever this item changes.
 List<T> getChoices()
          Gets the list of possible values.
 int getColumnCount()
          Gets the preferred width of the input field in characters (if applicable).
 T getDefaultValue()
          Gets the default value.
 String getDescription()
          Gets a string describing the object.
 Type getGenericType()
          Gets the type of the item, including Java generic parameters.
 String getInitializer()
          Gets the function that is called to initialize the item's value.
 ItemIO getIOType()
          Gets the input/output type of the item.
 String getLabel()
          Gets the name to appear in a UI, if applicable.
 T getMaximumValue()
          Gets the maximum allowed value (if applicable).
 T getMinimumValue()
          Gets the minimum allowed value (if applicable).
 String getName()
          Gets the name of the object.
 String getPersistKey()
          Gets the key to use for saving the value persistently.
 T getSoftMaximum()
          Gets the "soft" maximum value (if applicable).
 T getSoftMinimum()
          Gets the "soft" minimum value (if applicable).
 Number getStepSize()
          Gets the preferred step size to use when rendering the item in a user interface (if applicable).
 Class<T> getType()
          Gets the type of the item.
 ItemVisibility getVisibility()
          Gets the visibility of the item.
 String getWidgetStyle()
          Gets the preferred widget style to use when rendering the item in a user interface.
 boolean isPersisted()
          Gets whether to remember the most recent value of the parameter.
 boolean isRequired()
          Gets whether the item value must be specified (i.e., no default).
 void setCallback(String callback)
           
 void setChoices(List<? extends T> choices)
           
 void setColumnCount(int columnCount)
           
 void setDefaultValue(T defaultValue)
           
 void setDescription(String description)
          Sets a string describing the object.
 void setInitializer(String initializer)
           
 void setIOType(ItemIO ioType)
           
 void setLabel(String label)
          Sets the name to appear in a UI, if applicable.
 void setMaximumValue(T maximumValue)
           
 void setMinimumValue(T minimumValue)
           
 void setName(String name)
          Sets the name of the object.
 void setPersisted(boolean persisted)
           
 void setPersistKey(String persistKey)
           
 void setRequired(boolean required)
           
 void setSoftMaximum(T softMaximum)
           
 void setSoftMinimum(T softMinimum)
           
 void setStepSize(Number stepSize)
           
 void setVisibility(ItemVisibility visibility)
           
 void setWidgetStyle(String widgetStyle)
           
 
Methods inherited from class org.scijava.module.AbstractModuleItem
callback, getDelegateClass, getInfo, getValue, initialize, isAutoFill, isInput, isOutput, loadValue, saveValue, setValue, toString
 
Methods inherited from class org.scijava.AbstractBasicDetails
get, is, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.scijava.module.ModuleItem
callback, getInfo, getValue, initialize, isAutoFill, isInput, isOutput, loadValue, saveValue, setValue
 
Methods inherited from interface org.scijava.BasicDetails
get, is, set
 

Constructor Detail

DefaultMutableModuleItem

public DefaultMutableModuleItem(Module module,
                                String name,
                                Class<T> type)

DefaultMutableModuleItem

public DefaultMutableModuleItem(ModuleInfo info,
                                String name,
                                Class<T> type)

DefaultMutableModuleItem

public DefaultMutableModuleItem(ModuleInfo info,
                                ModuleItem<T> item)
Creates a new module item with the same values as the given item.

Method Detail

setIOType

public void setIOType(ItemIO ioType)
Specified by:
setIOType in interface MutableModuleItem<T>

setVisibility

public void setVisibility(ItemVisibility visibility)
Specified by:
setVisibility in interface MutableModuleItem<T>

setRequired

public void setRequired(boolean required)
Specified by:
setRequired in interface MutableModuleItem<T>

setPersisted

public void setPersisted(boolean persisted)
Specified by:
setPersisted in interface MutableModuleItem<T>

setPersistKey

public void setPersistKey(String persistKey)
Specified by:
setPersistKey in interface MutableModuleItem<T>

setInitializer

public void setInitializer(String initializer)
Specified by:
setInitializer in interface MutableModuleItem<T>

setCallback

public void setCallback(String callback)
Specified by:
setCallback in interface MutableModuleItem<T>

setWidgetStyle

public void setWidgetStyle(String widgetStyle)
Specified by:
setWidgetStyle in interface MutableModuleItem<T>

setDefaultValue

public void setDefaultValue(T defaultValue)
Specified by:
setDefaultValue in interface MutableModuleItem<T>

setMinimumValue

public void setMinimumValue(T minimumValue)
Specified by:
setMinimumValue in interface MutableModuleItem<T>

setMaximumValue

public void setMaximumValue(T maximumValue)
Specified by:
setMaximumValue in interface MutableModuleItem<T>

setSoftMinimum

public void setSoftMinimum(T softMinimum)
Specified by:
setSoftMinimum in interface MutableModuleItem<T>

setSoftMaximum

public void setSoftMaximum(T softMaximum)
Specified by:
setSoftMaximum in interface MutableModuleItem<T>

setStepSize

public void setStepSize(Number stepSize)
Specified by:
setStepSize in interface MutableModuleItem<T>

setColumnCount

public void setColumnCount(int columnCount)
Specified by:
setColumnCount in interface MutableModuleItem<T>

setChoices

public void setChoices(List<? extends T> choices)
Specified by:
setChoices in interface MutableModuleItem<T>

getType

public Class<T> getType()
Description copied from interface: ModuleItem
Gets the type of the item.

Specified by:
getType in interface ModuleItem<T>

getGenericType

public Type getGenericType()
Description copied from interface: ModuleItem
Gets the type of the item, including Java generic parameters.

For many modules, this may be the same Class object returned by ModuleItem.getType(), but some module inputs or outputs may be backed by a generic type such as List<String> or Iterable<Integer>.

Specified by:
getGenericType in interface ModuleItem<T>
Overrides:
getGenericType in class AbstractModuleItem<T>
See Also:
Field.getGenericType()

getIOType

public ItemIO getIOType()
Description copied from interface: ModuleItem
Gets the input/output type of the item.

Specified by:
getIOType in interface ModuleItem<T>
Overrides:
getIOType in class AbstractModuleItem<T>

getVisibility

public ItemVisibility getVisibility()
Description copied from interface: ModuleItem
Gets the visibility of the item.

Specified by:
getVisibility in interface ModuleItem<T>
Overrides:
getVisibility in class AbstractModuleItem<T>

isRequired

public boolean isRequired()
Description copied from interface: ModuleItem
Gets whether the item value must be specified (i.e., no default).

Specified by:
isRequired in interface ModuleItem<T>
Overrides:
isRequired in class AbstractModuleItem<T>

isPersisted

public boolean isPersisted()
Description copied from interface: ModuleItem
Gets whether to remember the most recent value of the parameter.

Specified by:
isPersisted in interface ModuleItem<T>
Overrides:
isPersisted in class AbstractModuleItem<T>

getPersistKey

public String getPersistKey()
Description copied from interface: ModuleItem
Gets the key to use for saving the value persistently.

Specified by:
getPersistKey in interface ModuleItem<T>
Overrides:
getPersistKey in class AbstractModuleItem<T>

getInitializer

public String getInitializer()
Description copied from interface: ModuleItem
Gets the function that is called to initialize the item's value.

Specified by:
getInitializer in interface ModuleItem<T>
Overrides:
getInitializer in class AbstractModuleItem<T>

getCallback

public String getCallback()
Description copied from interface: ModuleItem
Gets the function that is called whenever this item changes.

This mechanism enables interdependent items of various types. For example, two int parameters "width" and "height" could update each other when another boolean "Preserve aspect ratio" flag is set.

Specified by:
getCallback in interface ModuleItem<T>
Overrides:
getCallback in class AbstractModuleItem<T>

getWidgetStyle

public String getWidgetStyle()
Description copied from interface: ModuleItem
Gets the preferred widget style to use when rendering the item in a user interface.

Specified by:
getWidgetStyle in interface ModuleItem<T>
Overrides:
getWidgetStyle in class AbstractModuleItem<T>

getDefaultValue

public T getDefaultValue()
Description copied from interface: ModuleItem
Gets the default value.

Specified by:
getDefaultValue in interface ModuleItem<T>
Overrides:
getDefaultValue in class AbstractModuleItem<T>

getMinimumValue

public T getMinimumValue()
Description copied from interface: ModuleItem
Gets the minimum allowed value (if applicable).

Specified by:
getMinimumValue in interface ModuleItem<T>
Overrides:
getMinimumValue in class AbstractModuleItem<T>

getMaximumValue

public T getMaximumValue()
Description copied from interface: ModuleItem
Gets the maximum allowed value (if applicable).

Specified by:
getMaximumValue in interface ModuleItem<T>
Overrides:
getMaximumValue in class AbstractModuleItem<T>

getSoftMinimum

public T getSoftMinimum()
Description copied from interface: ModuleItem
Gets the "soft" minimum value (if applicable).

The soft minimum is a hint for use in bounded scenarios, such as rendering in a user interface with a slider or scroll bar widget; the parameter value will not actually be clamped to the soft bounds, but they may be used in certain circumstances where appropriate.

Specified by:
getSoftMinimum in interface ModuleItem<T>
Overrides:
getSoftMinimum in class AbstractModuleItem<T>

getSoftMaximum

public T getSoftMaximum()
Description copied from interface: ModuleItem
Gets the "soft" maximum value (if applicable).

The soft maximum is a hint for use in bounded scenarios, such as rendering in a user interface with a slider or scroll bar widget; the parameter value will not actually be clamped to the soft bounds, but they may be used in certain circumstances where appropriate.

Specified by:
getSoftMaximum in interface ModuleItem<T>
Overrides:
getSoftMaximum in class AbstractModuleItem<T>

getStepSize

public Number getStepSize()
Description copied from interface: ModuleItem
Gets the preferred step size to use when rendering the item in a user interface (if applicable).

Specified by:
getStepSize in interface ModuleItem<T>
Overrides:
getStepSize in class AbstractModuleItem<T>

getColumnCount

public int getColumnCount()
Description copied from interface: ModuleItem
Gets the preferred width of the input field in characters (if applicable).

Specified by:
getColumnCount in interface ModuleItem<T>
Overrides:
getColumnCount in class AbstractModuleItem<T>

getChoices

public List<T> getChoices()
Description copied from interface: ModuleItem
Gets the list of possible values.

Specified by:
getChoices in interface ModuleItem<T>
Overrides:
getChoices in class AbstractModuleItem<T>

getLabel

public String getLabel()
Description copied from interface: BasicDetails
Gets the name to appear in a UI, if applicable.

Specified by:
getLabel in interface BasicDetails
Overrides:
getLabel in class AbstractBasicDetails

getDescription

public String getDescription()
Description copied from interface: BasicDetails
Gets a string describing the object.

Specified by:
getDescription in interface BasicDetails
Overrides:
getDescription in class AbstractBasicDetails

setLabel

public void setLabel(String label)
Description copied from interface: BasicDetails
Sets the name to appear in a UI, if applicable.

Specified by:
setLabel in interface BasicDetails
Overrides:
setLabel in class AbstractBasicDetails

setDescription

public void setDescription(String description)
Description copied from interface: BasicDetails
Sets a string describing the object.

Specified by:
setDescription in interface BasicDetails
Overrides:
setDescription in class AbstractBasicDetails

getName

public String getName()
Description copied from interface: Named
Gets the name of the object.

Specified by:
getName in interface Named
Overrides:
getName in class AbstractBasicDetails

setName

public void setName(String name)
Description copied from interface: Named
Sets the name of the object.

Specified by:
setName in interface Named
Overrides:
setName in class AbstractBasicDetails


Copyright © 2009–2015 SciJava. All rights reserved.