Class DefaultMutableModuleItem<T>
- java.lang.Object
-
- org.scijava.AbstractBasicDetails
-
- org.scijava.module.AbstractModuleItem<T>
-
- org.scijava.module.DefaultMutableModuleItem<T>
-
- All Implemented Interfaces:
BasicDetails,ModuleItem<T>,MutableModuleItem<T>,Named
public class DefaultMutableModuleItem<T> extends AbstractModuleItem<T> implements MutableModuleItem<T>
DefaultMutableModuleItemimplementation, for use with customMutableModuleimplementations.- Author:
- Curtis Rueden
-
-
Constructor Summary
Constructors Constructor Description DefaultMutableModuleItem(ModuleInfo info, String name, Class<T> type)DefaultMutableModuleItem(ModuleInfo info, ModuleItem<T> item)Creates a new module item with the same values as the given item.DefaultMutableModuleItem(Module module, String name, Class<T> type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCallback()Gets the function that is called whenever this item changes.List<T>getChoices()Gets the list of possible values.intgetColumnCount()Gets the preferred width of the input field in characters (if applicable).TgetDefaultValue()Gets the default value.StringgetDescription()Gets a string describing the object.TypegetGenericType()Gets the type of the item, including Java generic parameters.StringgetInitializer()Gets the function that is called to initialize the item's value.ItemIOgetIOType()Gets the input/output type of the item.StringgetLabel()Gets the name to appear in a UI, if applicable.TgetMaximumValue()Gets the maximum allowed value (if applicable).TgetMinimumValue()Gets the minimum allowed value (if applicable).StringgetName()Gets the name of the object.StringgetPersistKey()Gets the key to use for saving the value persistently.TgetSoftMaximum()Gets the "soft" maximum value (if applicable).TgetSoftMinimum()Gets the "soft" minimum value (if applicable).NumbergetStepSize()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.StringgetValidater()Gets the function that is called to validate the item's value.ItemVisibilitygetVisibility()Gets the visibility of the item.StringgetWidgetStyle()Gets the preferred widget style to use when rendering the item in a user interface.booleanisAutoFill()Gets whether the item value is allowed to be auto-filled.booleanisPersisted()Gets whether to remember the most recent value of the parameter.booleanisRequired()Gets whether the item value must be specified (i.e., no default).voidsetAutoFill(boolean autoFill)voidsetCallback(String callback)voidsetChoices(List<? extends T> choices)voidsetColumnCount(int columnCount)voidsetDefaultValue(T defaultValue)voidsetDescription(String description)Sets a string describing the object.voidsetInitializer(String initializer)voidsetIOType(ItemIO ioType)voidsetLabel(String label)Sets the name to appear in a UI, if applicable.voidsetMaximumValue(T maximumValue)voidsetMinimumValue(T minimumValue)voidsetName(String name)Sets the name of the object.voidsetPersisted(boolean persisted)voidsetPersistKey(String persistKey)voidsetRequired(boolean required)voidsetSoftMaximum(T softMaximum)voidsetSoftMinimum(T softMinimum)voidsetStepSize(Number stepSize)voidsetValidater(String validater)voidsetVisibility(ItemVisibility visibility)voidsetWidgetStyle(String widgetStyle)-
Methods inherited from class org.scijava.module.AbstractModuleItem
callback, getDelegateClass, getInfo, getValue, initialize, isInput, isOutput, loadValue, saveValue, setValue, toString, validate
-
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.BasicDetails
get, is, set
-
Methods inherited from interface org.scijava.module.ModuleItem
callback, getInfo, getValue, initialize, isInput, isOutput, loadValue, saveValue, setValue, validate, validateMessage
-
-
-
-
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:
setIOTypein interfaceMutableModuleItem<T>
-
setVisibility
public void setVisibility(ItemVisibility visibility)
- Specified by:
setVisibilityin interfaceMutableModuleItem<T>
-
setAutoFill
public void setAutoFill(boolean autoFill)
- Specified by:
setAutoFillin interfaceMutableModuleItem<T>
-
setRequired
public void setRequired(boolean required)
- Specified by:
setRequiredin interfaceMutableModuleItem<T>
-
setPersisted
public void setPersisted(boolean persisted)
- Specified by:
setPersistedin interfaceMutableModuleItem<T>
-
setPersistKey
public void setPersistKey(String persistKey)
- Specified by:
setPersistKeyin interfaceMutableModuleItem<T>
-
setInitializer
public void setInitializer(String initializer)
- Specified by:
setInitializerin interfaceMutableModuleItem<T>
-
setValidater
public void setValidater(String validater)
- Specified by:
setValidaterin interfaceMutableModuleItem<T>
-
setCallback
public void setCallback(String callback)
- Specified by:
setCallbackin interfaceMutableModuleItem<T>
-
setWidgetStyle
public void setWidgetStyle(String widgetStyle)
- Specified by:
setWidgetStylein interfaceMutableModuleItem<T>
-
setDefaultValue
public void setDefaultValue(T defaultValue)
- Specified by:
setDefaultValuein interfaceMutableModuleItem<T>
-
setMinimumValue
public void setMinimumValue(T minimumValue)
- Specified by:
setMinimumValuein interfaceMutableModuleItem<T>
-
setMaximumValue
public void setMaximumValue(T maximumValue)
- Specified by:
setMaximumValuein interfaceMutableModuleItem<T>
-
setSoftMinimum
public void setSoftMinimum(T softMinimum)
- Specified by:
setSoftMinimumin interfaceMutableModuleItem<T>
-
setSoftMaximum
public void setSoftMaximum(T softMaximum)
- Specified by:
setSoftMaximumin interfaceMutableModuleItem<T>
-
setStepSize
public void setStepSize(Number stepSize)
- Specified by:
setStepSizein interfaceMutableModuleItem<T>
-
setColumnCount
public void setColumnCount(int columnCount)
- Specified by:
setColumnCountin interfaceMutableModuleItem<T>
-
setChoices
public void setChoices(List<? extends T> choices)
- Specified by:
setChoicesin interfaceMutableModuleItem<T>
-
getType
public Class<T> getType()
Description copied from interface:ModuleItemGets the type of the item.- Specified by:
getTypein interfaceModuleItem<T>
-
getGenericType
public Type getGenericType()
Description copied from interface:ModuleItemGets the type of the item, including Java generic parameters.For many modules, this may be the same
Classobject returned byModuleItem.getType(), but some module inputs or outputs may be backed by a generic type such asList<String>orIterable<Integer>.- Specified by:
getGenericTypein interfaceModuleItem<T>- Overrides:
getGenericTypein classAbstractModuleItem<T>- See Also:
Field.getGenericType()
-
getIOType
public ItemIO getIOType()
Description copied from interface:ModuleItemGets the input/output type of the item.- Specified by:
getIOTypein interfaceModuleItem<T>- Overrides:
getIOTypein classAbstractModuleItem<T>
-
getVisibility
public ItemVisibility getVisibility()
Description copied from interface:ModuleItemGets the visibility of the item.- Specified by:
getVisibilityin interfaceModuleItem<T>- Overrides:
getVisibilityin classAbstractModuleItem<T>
-
isAutoFill
public boolean isAutoFill()
Description copied from interface:ModuleItemGets whether the item value is allowed to be auto-filled.- Specified by:
isAutoFillin interfaceModuleItem<T>- Overrides:
isAutoFillin classAbstractModuleItem<T>
-
isRequired
public boolean isRequired()
Description copied from interface:ModuleItemGets whether the item value must be specified (i.e., no default).- Specified by:
isRequiredin interfaceModuleItem<T>- Overrides:
isRequiredin classAbstractModuleItem<T>
-
isPersisted
public boolean isPersisted()
Description copied from interface:ModuleItemGets whether to remember the most recent value of the parameter.- Specified by:
isPersistedin interfaceModuleItem<T>- Overrides:
isPersistedin classAbstractModuleItem<T>
-
getPersistKey
public String getPersistKey()
Description copied from interface:ModuleItemGets the key to use for saving the value persistently.- Specified by:
getPersistKeyin interfaceModuleItem<T>- Overrides:
getPersistKeyin classAbstractModuleItem<T>
-
getInitializer
public String getInitializer()
Description copied from interface:ModuleItemGets the function that is called to initialize the item's value.- Specified by:
getInitializerin interfaceModuleItem<T>- Overrides:
getInitializerin classAbstractModuleItem<T>
-
getValidater
public String getValidater()
Description copied from interface:ModuleItemGets the function that is called to validate the item's value.- Specified by:
getValidaterin interfaceModuleItem<T>- Overrides:
getValidaterin classAbstractModuleItem<T>
-
getCallback
public String getCallback()
Description copied from interface:ModuleItemGets 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:
getCallbackin interfaceModuleItem<T>- Overrides:
getCallbackin classAbstractModuleItem<T>
-
getWidgetStyle
public String getWidgetStyle()
Description copied from interface:ModuleItemGets the preferred widget style to use when rendering the item in a user interface.- Specified by:
getWidgetStylein interfaceModuleItem<T>- Overrides:
getWidgetStylein classAbstractModuleItem<T>
-
getDefaultValue
public T getDefaultValue()
Description copied from interface:ModuleItemGets the default value.- Specified by:
getDefaultValuein interfaceModuleItem<T>- Overrides:
getDefaultValuein classAbstractModuleItem<T>
-
getMinimumValue
public T getMinimumValue()
Description copied from interface:ModuleItemGets the minimum allowed value (if applicable).- Specified by:
getMinimumValuein interfaceModuleItem<T>- Overrides:
getMinimumValuein classAbstractModuleItem<T>
-
getMaximumValue
public T getMaximumValue()
Description copied from interface:ModuleItemGets the maximum allowed value (if applicable).- Specified by:
getMaximumValuein interfaceModuleItem<T>- Overrides:
getMaximumValuein classAbstractModuleItem<T>
-
getSoftMinimum
public T getSoftMinimum()
Description copied from interface:ModuleItemGets 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:
getSoftMinimumin interfaceModuleItem<T>- Overrides:
getSoftMinimumin classAbstractModuleItem<T>
-
getSoftMaximum
public T getSoftMaximum()
Description copied from interface:ModuleItemGets 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:
getSoftMaximumin interfaceModuleItem<T>- Overrides:
getSoftMaximumin classAbstractModuleItem<T>
-
getStepSize
public Number getStepSize()
Description copied from interface:ModuleItemGets the preferred step size to use when rendering the item in a user interface (if applicable).- Specified by:
getStepSizein interfaceModuleItem<T>- Overrides:
getStepSizein classAbstractModuleItem<T>
-
getColumnCount
public int getColumnCount()
Description copied from interface:ModuleItemGets the preferred width of the input field in characters (if applicable).- Specified by:
getColumnCountin interfaceModuleItem<T>- Overrides:
getColumnCountin classAbstractModuleItem<T>
-
getChoices
public List<T> getChoices()
Description copied from interface:ModuleItemGets the list of possible values.- Specified by:
getChoicesin interfaceModuleItem<T>- Overrides:
getChoicesin classAbstractModuleItem<T>
-
getLabel
public String getLabel()
Description copied from interface:BasicDetailsGets the name to appear in a UI, if applicable.- Specified by:
getLabelin interfaceBasicDetails- Overrides:
getLabelin classAbstractBasicDetails
-
getDescription
public String getDescription()
Description copied from interface:BasicDetailsGets a string describing the object.- Specified by:
getDescriptionin interfaceBasicDetails- Overrides:
getDescriptionin classAbstractBasicDetails
-
setLabel
public void setLabel(String label)
Description copied from interface:BasicDetailsSets the name to appear in a UI, if applicable.- Specified by:
setLabelin interfaceBasicDetails- Overrides:
setLabelin classAbstractBasicDetails
-
setDescription
public void setDescription(String description)
Description copied from interface:BasicDetailsSets a string describing the object.- Specified by:
setDescriptionin interfaceBasicDetails- Overrides:
setDescriptionin classAbstractBasicDetails
-
getName
public String getName()
Description copied from interface:NamedGets the name of the object.- Specified by:
getNamein interfaceNamed- Overrides:
getNamein classAbstractBasicDetails
-
-