Package snap.view

Class SwitchView

All Implemented Interfaces:
PropChange.DoChange, Selectable, XMLArchiver.Archivable, ViewHost

public class SwitchView extends ChildView implements Selectable
A pane to show a specific child pane from a list.
  • Constructor Details

    • SwitchView

      public SwitchView()
  • Method Details

    • getPane

      public View getPane(String aName)
      Returns the view with the given name.
    • getSelIndex

      public int getSelIndex()
      Returns the SwitchView's selected index.
      Specified by:
      getSelIndex in interface Selectable
    • setSelIndex

      public void setSelIndex(int anIndex)
      Sets the SwitchView's selected index.
      Specified by:
      setSelIndex in interface Selectable
    • getSelectedPane

      public View getSelectedPane()
      Returns the currently visible view.
    • setSelectedPane

      public void setSelectedPane(View aPane)
      Sets the given view as the selected view.
    • getSelectedName

      public String getSelectedName()
      Returns the selected name.
    • setSelectedName

      public void setSelectedName(String aName)
      Sets the selected pane to the first with the given name.
    • getValuePropName

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

      protected double getPrefWidthImpl(double aH)
      Override to return preferred width of content.
      Overrides:
      getPrefWidthImpl in class View
    • getPrefHeightImpl

      protected double getPrefHeightImpl(double aW)
      Override to return preferred height of content.
      Overrides:
      getPrefHeightImpl in class View
    • layoutImpl

      protected void layoutImpl()
      Override to layout content.
      Overrides:
      layoutImpl 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 for children.
      Overrides:
      fromXMLView in class ParentView