Package snap.view

Class ToggleButton

All Implemented Interfaces:
PropChange.DoChange, XMLArchiver.Archivable
Direct Known Subclasses:
CheckBox, RadioButton

public class ToggleButton extends ButtonBase
A ButtonBase subclass for ToggleButton.
  • Field Details

  • Constructor Details

    • ToggleButton

      public ToggleButton()
      Constructor.
    • ToggleButton

      public ToggleButton(String aStr)
      Constructor with given text.
  • Method Details

    • isSelected

      public boolean isSelected()
      Returns whether button is selected.
      Overrides:
      isSelected in class ButtonBase
    • setSelected

      public void setSelected(boolean aValue)
      Sets whether button is selected.
    • getToggleGroup

      public ToggleGroup getToggleGroup()
      Returns the button group name.
    • getGroupName

      public String getGroupName()
      Returns the button group name.
    • setGroupName

      public void setGroupName(String aName)
      Sets the button group name.
    • fireActionEvent

      protected void fireActionEvent(ViewEvent anEvent)
      Override to toggle Selected state (if no ToggleGroup or not selected).
      Overrides:
      fireActionEvent in class ButtonBase
    • getPropValue

      public Object getPropValue(String aPropName)
      Override because TeaVM hates reflection.
      Overrides:
      getPropValue in class ButtonBase
    • setPropValue

      public void setPropValue(String aPropName, Object aValue)
      Override because TeaVM hates reflection.
      Overrides:
      setPropValue in class ButtonBase
    • getValuePropName

      protected String getValuePropName()
      Returns a mapped property name name.
      Overrides:
      getValuePropName in class View
    • setOwner

      public void setOwner(ViewOwner anOwner)
      Override to add to ToggleGroup if name is set.
      Overrides:
      setOwner in class ParentView
    • toXMLView

      protected XMLElement toXMLView(XMLArchiver anArchiver)
      XML archival.
      Overrides:
      toXMLView in class ButtonBase
    • fromXMLView

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