Class PIAPercentField

All Implemented Interfaces:
PAppComponent, PAppFieldComponent, PClientComponent, PCollectDataListener, PComponent, PComponentAttribute, PFieldBean, PLightComponent, PViewDataChangeListener, CyclerListener, ImageObserver, MenuContainer, Serializable, Remote, EventListener, Accessible, Scrollable, SwingConstants

public class PIAPercentField extends PIANumberField
Input field for percent values. Assumes data entered is a percent, so getValue() returns decimal value of the percentage, i.e. (entered value divided by 100). The value set is assumed to be a decimal and will be converted to a percent representation by moving the decimal point two fields to before the data is displayed. Example: if 42.69 is entered, getValue() will return 0.4269. Field should be labeled with a '%' sign to its right.
Author:
max
See Also:
  • Constructor Details

    • PIAPercentField

      public PIAPercentField()
  • Method Details

    • setLightData

      public void setLightData(Object field)
      Set's the value of the field. Will convert to percent representation by moving decimal point two fields to the right.
      Specified by:
      setLightData in interface PLightComponent
      Overrides:
      setLightData in class PIANumberField
      Parameters:
      field - Must be an instance of BigDecimal or null;
    • getValue

      public Object getValue()
      Returns value entered into the field divided by 100.
      Overrides:
      getValue in class DecimalTextField
      Returns:
      BigDecimal object