Package snap.view

Class Spinner<T>

All Implemented Interfaces:
PropChange.DoChange, XMLArchiver.Archivable

public class Spinner<T> extends ParentView
A control to show a text value with convenient up/down buttons.
  • Field Details

  • Constructor Details

    • Spinner

      public Spinner()
      Constructor.
  • Method Details

    • getTextField

      public TextField getTextField()
      Returns the text field.
    • getValue

      public T getValue()
      Returns the spinner value.
    • setValue

      public void setValue(T aValue)
      Sets the spinner value.
    • getValueAsString

      public String getValueAsString()
      Returns the text for value.
    • getValueClass

      public Class<?> getValueClass()
      Returns the value type.
    • getMin

      public double getMin()
      Returns the spinner min.
    • setMin

      public void setMin(double aValue)
      Sets the spinner min.
    • getMax

      public double getMax()
      Returns the spinner max.
    • setMax

      public void setMax(double aValue)
      Sets the spinner min.
    • getStep

      public double getStep()
      Returns the spinner step size.
    • setStep

      public void setStep(double aValue)
      Sets the spinner step size.
    • handleAarrowViewActionEvent

      protected void handleAarrowViewActionEvent()
      Called when ArrowView fires action.
    • increment

      public void increment()
      Increments spinner.
    • decrement

      public void decrement()
      Increments spinner.
    • textChanged

      public void textChanged()
      Called when text changes.
    • getPrefWidthImpl

      protected double getPrefWidthImpl(double aH)
      Returns the preferred width.
      Overrides:
      getPrefWidthImpl in class View
    • getPrefHeightImpl

      protected double getPrefHeightImpl(double aW)
      Returns the preferred height.
      Overrides:
      getPrefHeightImpl in class View
    • layoutImpl

      protected void layoutImpl()
      Layout children.
      Overrides:
      layoutImpl in class ParentView
    • setAlign

      public void setAlign(Pos aPos)
      Override to forward to StringView.
      Overrides:
      setAlign in class View
    • initProps

      protected void initProps(PropSet aPropSet)
      Override to support props for this class.
      Overrides:
      initProps in class ParentView
    • getPropValue

      public Object getPropValue(String aPropName)
      Override to support props for this class.
      Overrides:
      getPropValue in class ParentView
    • setPropValue

      public void setPropValue(String aPropName, Object aValue)
      Override to support props for this class.
      Overrides:
      setPropValue in class ParentView
    • toXMLView

      public XMLElement toXMLView(XMLArchiver anArchiver)
      XML archival.
      Overrides:
      toXMLView in class ParentView
    • fromXMLView

      public void fromXMLView(XMLArchiver anArchiver, XMLElement anElement)
      XML unarchival.
      Overrides:
      fromXMLView in class ParentView