Search this API

y.option
Class DoubleOptionItem

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

public class DoubleOptionItem
extends ObjectOptionItem

An option item for double values.

 

Field Summary
static java.lang.String ATTRIBUTE_LOCALE
          Attribute key used to store an editor hint which specifies that values should be parsed according specified locale.
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_PRECISION
          Attribute key used to store the display precision.
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.
 
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
DoubleOptionItem(java.lang.String name, double value)
          Creates a new instance of DoubleOptionItem.
DoubleOptionItem(java.lang.String name, java.lang.Double value)
          Creates a new instance of DoubleOptionItem.
DoubleOptionItem(java.lang.String name, double value, double minValue, double maxValue)
          Creates a new instance of DoubleOptionItem for bounded values.
DoubleOptionItem(java.lang.String name, double value, double minValue, double maxValue, int precision)
          Like DoubleOptionItem(String,double,double,double).
 
Method Summary
 java.lang.String getType()
          Returns "Double".
 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 Double.


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 Double.


ATTRIBUTE_PRECISION

public static final java.lang.String ATTRIBUTE_PRECISION
Attribute key used to store the display precision. 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.


ATTRIBUTE_LOCALE

public static final java.lang.String ATTRIBUTE_LOCALE
Attribute key used to store an editor hint which specifies that values should be parsed according specified locale. Attribute values have to be of type Locale.

Constructor Detail

DoubleOptionItem

public DoubleOptionItem(java.lang.String name,
                        java.lang.Double value)
Creates a new instance of DoubleOptionItem.

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

DoubleOptionItem

public DoubleOptionItem(java.lang.String name,
                        double value)
Creates a new instance of DoubleOptionItem.

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

DoubleOptionItem

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

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

DoubleOptionItem

public DoubleOptionItem(java.lang.String name,
                        double value,
                        double minValue,
                        double maxValue,
                        int precision)
Like DoubleOptionItem(String,double,double,double). Additionally one can specify the slider precision for the double value. The precision is measured by the the number of decimal places of the value. By default the number of decimal places is 1.

Parameters:
name - the name of this item
value - the initial double value
minValue - the minimal value the double value can have.
maxValue - the maximal value the double value can have.
precision - the slider precision for the value.
Method Detail

getType

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

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 Double
See Also:
OptionItem.publishValue(Object)

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