Package rma.swing

Class RmaJIntegerField

All Implemented Interfaces:
FocusListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, DocumentListener, Scrollable, SwingConstants, Modifiable, ModifiedEventControl, UnitsComponent, EditableComponent, FormManagementListener, RmaValidComponent

public class RmaJIntegerField extends RmaJTextField implements UnitsComponent
extension of the JTextField to only allow decimal integer type numbers.
See Also:
  • Constructor Details

    • RmaJIntegerField

      public RmaJIntegerField()
      Instantiates a new rMA integer field.
    • RmaJIntegerField

      public RmaJIntegerField(int value, int columns)
      Instantiates a new rMA integer field.
      Parameters:
      value - the value
      columns - the columns
  • Method Details

    • getValueUndefined

      public int getValueUndefined(int undefinedValue)
      return the value of this field. If not defined return undefinedValue. if the field has had it's value set with setValue() and hasn't modified by the user return the original setValue() value, not the displayed contents of the field.
      Parameters:
      undefinedValue - the undefined value
      Returns:
      the value undefined
    • getValueUndefined

      public int getValueUndefined()
      return the value of this field. If not defined return UNDEF_INT. if the field has had it's value set with setValue() and hasn't modified by the user return the original setValue() value, not the displayed contents of the field.
      Returns:
      the value undefined
    • getValue

      public int getValue()
      Gets the value.
      Returns:
      the value
    • getValueAsDbl

      public double getValueAsDbl()
      Gets the value as dbl.
      Returns:
      the value as dbl
    • getTextAsDbl

      public Double getTextAsDbl()
      Gets the text as dbl.
      Returns:
      the text as dbl
    • getTextAsInteger

      public Integer getTextAsInteger()
      Gets the text as integer.
      Returns:
      the text as integer
    • setValue

      public void setValue(ParamInteger param)
      Sets the value.
      Parameters:
      param - the new value
    • setValue

      public void setValue(int value)
      Sets the value.
      Parameters:
      value - the new value
    • setText

      public void setText(String text)
      Overrides:
      setText in class JTextComponent
    • setValue

      public void setValue(double value)
      Sets the value.
      Parameters:
      value - the new value
    • createDefaultModel

      protected Document createDefaultModel()
      Description copied from class: RmaJTextField
      Creates the default implementation of the model to be used at construction if one isn't explicitly given. An instance of RMADocument is returned.
      Overrides:
      createDefaultModel in class RmaJTextField
      Returns:
      the default model implementation
    • setMinValue

      public void setMinValue(int min)
      Sets the min value.
      Parameters:
      min - the new min value
    • getMinValue

      public int getMinValue()
      Gets the min value.
      Returns:
      the min value
    • setMaxValue

      public void setMaxValue(int max)
      Sets the max value.
      Parameters:
      max - the new max value
    • getMaxValue

      public int getMaxValue()
      Gets the max value.
      Returns:
      the max value
    • validateData

      protected boolean validateData(boolean showErrorMsg)
      Overrides:
      validateData in class RmaJTextField
    • getDisplayUnitsString

      public String getDisplayUnitsString(int unitSystem)
      Description copied from interface: UnitsComponent
      This method allows the retrieves the units string for a given units system
      Specified by:
      getDisplayUnitsString in interface UnitsComponent
      See Also:
    • setDisplayScaleFactor

      public void setDisplayScaleFactor(int paramId, double scaleFactor)
      Description copied from interface: UnitsComponent
      Sets a scaling factor to use when displaying the data.
      Specified by:
      setDisplayScaleFactor in interface UnitsComponent
      Parameters:
      paramId - This is the identifier of the paramater to scale. If the data is not of this type then it is ignored
      scaleFactor - This is the scaling factor *to* be multiplied to the value when it is rendered
    • setDisplayUnitsSystem

      public void setDisplayUnitsSystem(int ut)
      Description copied from interface: UnitsComponent
      Sets the current Unit System for this object
      Specified by:
      setDisplayUnitsSystem in interface UnitsComponent
    • setMaxLength

      public void setMaxLength(int length)
      Overrides:
      setMaxLength in class RmaJTextField