Search this API

y.option
Class IntOptionItem

java.lang.Object
  extended by y.option.OptionItem
      extended by y.option.ObjectOptionItem
          extended by y.option.IntOptionItem
All Implemented Interfaces:
AttributeOwner, BackupValueOwner, PropertyChangeReporter, VetoableChangeReporter

public class IntOptionItem
extends ObjectOptionItem

An option item for integer values.

 
Your browser does not support SVG content.

Field Summary
static java.lang.String ATTRIBUTE_MAX_VALUE
          Attribute key to specify an upper bound for accepted values.
static java.lang.String ATTRIBUTE_MIN_VALUE
          Attribute key to specify a lower bound for accepted values.
static java.lang.String ATTRIBUTE_UNSIGNED
          Attribute key used to store an editor hint which specifies that values should be displayed without any sign prefix.
protected  boolean hasBounds
          Subclasses should not access this field, but check for ATTRIBUTE_MIN_VALUE and/or ATTRIBUTE_MAX_VALUE instead.
protected  int max
          Subclasses should not access this field, but check for ATTRIBUTE_MAX_VALUE instead.
protected  int min
          Subclasses should not access this field, but check for ATTRIBUTE_MIN_VALUE instead.
 
Fields inherited from class y.option.OptionItem
ATTRIBUTE_CONTEXT, ATTRIBUTE_GROUPS, ATTRIBUTE_LONG_DESCRIPTION, COLOR_UNDEFINED, name, PROPERTY_CLASS_TYPE, PROPERTY_ENABLED, PROPERTY_TIP_TEXT, PROPERTY_VALUE, PROPERTY_VALUE_UNDEFINED, UNDEFINED
 
Constructor Summary
IntOptionItem(java.lang.String name, int value)
          Creates a new instance of IntOptionItem.
IntOptionItem(java.lang.String name, java.lang.Integer value)
          Creates a new instance of IntOptionItem.
IntOptionItem(java.lang.String name, int value, int minValue, int maxValue)
          Creates a new instance of IntOptionItem for bounded values.
 
Method Summary
 java.lang.String getType()
          Returns "Int".
 void setValue(java.lang.Object value)
          Sets the value of this option item.
 
Methods inherited from class y.option.ObjectOptionItem
getBackupValue, getValue, resetValue
 
Methods inherited from class y.option.OptionItem
addEditor, addEditorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, adoptEditorValue, checkEditorValue, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getAttribute, getClassType, getEditor, getEditor, getEditors, getName, getStringValue, getTipText, isEnabled, isValueUndefined, publishEnabled, publishValue, publishValueUndefined, removeAttribute, removeEditor, removeEditorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener, setAttribute, setClassType, setEnabled, setStringValue, setTipText, setValueUndefined, wantsVisibleName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_MIN_VALUE

public static final java.lang.String ATTRIBUTE_MIN_VALUE
Attribute key to specify a lower bound for accepted values. Attribute values have to be of type Integer.


ATTRIBUTE_MAX_VALUE

public static final java.lang.String ATTRIBUTE_MAX_VALUE
Attribute key to specify an upper bound for accepted values. Attribute values have to be of type Integer.


ATTRIBUTE_UNSIGNED

public static final java.lang.String ATTRIBUTE_UNSIGNED
Attribute key used to store an editor hint which specifies that values should be displayed without any sign prefix. Attribute values have to be of type Boolean.


min

protected int min
Subclasses should not access this field, but check for ATTRIBUTE_MIN_VALUE instead.


max

protected int max
Subclasses should not access this field, but check for ATTRIBUTE_MAX_VALUE instead.


hasBounds

protected boolean hasBounds
Subclasses should not access this field, but check for ATTRIBUTE_MIN_VALUE and/or ATTRIBUTE_MAX_VALUE instead.

Constructor Detail

IntOptionItem

public IntOptionItem(java.lang.String name,
                     java.lang.Integer value)
Creates a new instance of IntOptionItem.

Parameters:
name - the name of this item
value - the initial integer value

IntOptionItem

public IntOptionItem(java.lang.String name,
                     int value)
Creates a new instance of IntOptionItem.

Parameters:
name - the name of this item
value - the initial integer value

IntOptionItem

public IntOptionItem(java.lang.String name,
                     int value,
                     int minValue,
                     int maxValue)
Creates a new instance of IntOptionItem for bounded values.

Parameters:
name - the name of this item
value - the initial integer value
minValue - the minimal value the integer value can have.
maxValue - the maximal value the integer value can have.
Method Detail

getType

public java.lang.String getType()
Returns "Int".

Overrides:
getType in class ObjectOptionItem

setValue

public void setValue(java.lang.Object value)
Sets the value of this option item.

Note:
No bounds check is performed.

Overrides:
setValue in class ObjectOptionItem
Throws:
java.lang.IllegalArgumentException - if the specified value is not of type Integer
See Also:
OptionItem.publishValue(Object)

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.