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()
      Creates a new Spinner.
  • 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.
    • getText

      public String getText()
      Returns the text for value.
      Overrides:
      getText in class View
    • 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.
    • arrowViewDidFireAction

      protected void arrowViewDidFireAction()
      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
    • getPropValue

      public Object getPropValue(String aPropName)
      Returns the value for given key.
      Overrides:
      getPropValue in class ParentView
    • setPropValue

      public void setPropValue(String aPropName, Object aValue)
      Sets the value for given key.
      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