net.sf.doolin.gui.field
Class FieldDecimal<V>

java.lang.Object
  extended by net.sf.doolin.bus.bean.Bean
      extended by net.sf.doolin.gui.field.AbstractFieldDescriptor<V>
          extended by net.sf.doolin.gui.field.AbstractPropertyFieldDescriptor<V>
              extended by net.sf.doolin.gui.field.FieldDecimal<V>
Type Parameters:
V - Type of object for the view
All Implemented Interfaces:
Serializable, IBean, FieldDescriptor<V>

public class FieldDecimal<V>
extends AbstractPropertyFieldDescriptor<V>

Field for an BigDecimal value.

It uses a JFormattedTextField component.

The bounds of the component are defined, by order or priority:

  1. property path - either setMinimumProperty(String) or setMaximumProperty(String)
  2. direct value - either setMinimum(BigDecimal) or setMaximum(BigDecimal)
  3. null (unbounded)

See Also:
Serialized Form

Constructor Summary
FieldDecimal()
           
 
Method Summary
protected  BigDecimal computeMaximum(GUIView<V> view)
           
protected  BigDecimal computeMinimum(GUIView<V> view)
           
 Field<V> createField(GUIView<V> view)
          Creates a field.
 int getFractionDigits()
           
 int getIntegerDigits()
           
 BigDecimal getMaximum()
          Gets the maximum.
 String getMaximumProperty()
          Returns the path to the property that contains the maximum value for this field.
 BigDecimal getMinimum()
          Gets the minimum.
 String getMinimumProperty()
          Returns the path to the property that contains the minimum value for this field.
protected  BigDecimal getValue(JFormattedTextField field, boolean useFieldValue)
           
 boolean isFractionShowAll()
           
 boolean isStrictMax()
           
 boolean isStrictMin()
           
 void setFractionDigits(int fractionDigits)
           
 void setFractionShowAll(boolean fractionShowAll)
           
 void setIntegerDigits(int integerDigits)
           
 void setMaximum(BigDecimal maximum)
          Sets the maximum.
 void setMaximumProperty(String maximumProperty)
          Sets the path to the property that contains the maximum value for this field.
 void setMinimum(BigDecimal minimum)
          Sets the minimum.
 void setMinimumProperty(String minimumProperty)
          Sets the path to the property that contains the minimum value for this field.
 void setStrictMax(boolean strictMax)
           
 void setStrictMin(boolean strictMin)
           
 
Methods inherited from class net.sf.doolin.gui.field.AbstractPropertyFieldDescriptor
getAdapter, getProperty, getPropertyPath, setAdapter, setProperty, setPropertyPath, subscribe, subscribe
 
Methods inherited from class net.sf.doolin.gui.field.AbstractFieldDescriptor
getActionFactory, getConstraint, getDisplayStateHandler, getIconService, getName, getStyle, getTransferHandler, onInit, onShow, setActionFactory, setConstraint, setDisplayState, setDisplayStateHandler, setIconService, setName, setStyle, setTransferHandler
 
Methods inherited from class net.sf.doolin.bus.bean.Bean
getBeanNotificationSupport, getParentBean, notify, setParentBean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldDecimal

public FieldDecimal()
Method Detail

computeMaximum

protected BigDecimal computeMaximum(GUIView<V> view)

computeMinimum

protected BigDecimal computeMinimum(GUIView<V> view)

createField

public Field<V> createField(GUIView<V> view)
Creates a field.

Parameters:
view - Owning view
Returns:
Created field

getFractionDigits

public int getFractionDigits()

getIntegerDigits

public int getIntegerDigits()

getMaximum

public BigDecimal getMaximum()
Gets the maximum.

Returns:
the maximum

getMaximumProperty

public String getMaximumProperty()
Returns the path to the property that contains the maximum value for this field.

Returns:
Property path

getMinimum

public BigDecimal getMinimum()
Gets the minimum.

Returns:
the minimum

getMinimumProperty

public String getMinimumProperty()
Returns the path to the property that contains the minimum value for this field.

Returns:
Property path

getValue

protected BigDecimal getValue(JFormattedTextField field,
                              boolean useFieldValue)

isFractionShowAll

public boolean isFractionShowAll()

isStrictMax

public boolean isStrictMax()

isStrictMin

public boolean isStrictMin()

setFractionDigits

public void setFractionDigits(int fractionDigits)

setFractionShowAll

public void setFractionShowAll(boolean fractionShowAll)

setIntegerDigits

public void setIntegerDigits(int integerDigits)

setMaximum

public void setMaximum(BigDecimal maximum)
Sets the maximum.

Parameters:
maximum - the new maximum

setMaximumProperty

public void setMaximumProperty(String maximumProperty)
Sets the path to the property that contains the maximum value for this field.

Parameters:
maximumProperty - Property path

setMinimum

public void setMinimum(BigDecimal minimum)
Sets the minimum.

Parameters:
minimum - the new minimum

setMinimumProperty

public void setMinimumProperty(String minimumProperty)
Sets the path to the property that contains the minimum value for this field.

Parameters:
minimumProperty - Property path

setStrictMax

public void setStrictMax(boolean strictMax)

setStrictMin

public void setStrictMin(boolean strictMin)


Copyright © 2011. All Rights Reserved.