Package snap.view

Interface ViewHost

All Known Implementing Classes:
BoxView, ChildView, CollapseView, ColView, GameView, GridView, PageView, RowView, ScaleBox, Scroller, ScrollView, SplitView, SpringView, StackView, SwitchView, TitleView

public interface ViewHost
An interface for Views primarily intended to hold other (arbitrary) views.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    addGuest(View aChild)
    Adds the given view to the end of this view's guest list.
    void
    addGuest(View aChild, int anIndex)
    ViewHost method: Adds the given view to this host's guest (children) list at given index.
    static void
    fromXMLGuests(ViewHost aHost, XMLArchiver anArchiver, XMLElement anElement)
    XML unarchival of ViewHost.Guests.
    getGuest(int anIndex)
    ViewHost method: Returns the guest view at given index.
    int
    ViewHost method: Returns the number of guest views.
    default View[]
    Returns the array of guests.
    static View[]
    Returns the guests array.
    static ViewHost
    getHost(View aView)
    Returns whether given view parent is a ViewHost and view is one of its guests.
    static int
    ViewHost helper method.
    static int
    indexOfGuest(ViewHost aHost, View aView)
    ViewHost helper method.
    removeGuest(int anIndex)
    ViewHost method: Remove's guest at given index from this host's guest (children) list.
    default int
    Removes the given child from this view's children list.
    static void
    toXMLGuests(ViewHost aHost, XMLArchiver anArchiver, XMLElement anElement)
    XML archival of ViewHost.Guests.
  • Method Details

    • getGuestCount

      int getGuestCount()
      ViewHost method: Returns the number of guest views.
    • getGuest

      View getGuest(int anIndex)
      ViewHost method: Returns the guest view at given index.
    • addGuest

      void addGuest(View aChild, int anIndex)
      ViewHost method: Adds the given view to this host's guest (children) list at given index.
    • removeGuest

      View removeGuest(int anIndex)
      ViewHost method: Remove's guest at given index from this host's guest (children) list.
    • addGuest

      default void addGuest(View aChild)
      Adds the given view to the end of this view's guest list.
    • removeGuest

      default int removeGuest(View aView)
      Removes the given child from this view's children list.
    • getGuests

      default View[] getGuests()
      Returns the array of guests.
    • getGuests

      static View[] getGuests(ViewHost aHost)
      Returns the guests array.
    • getHost

      static ViewHost getHost(View aView)
      Returns whether given view parent is a ViewHost and view is one of its guests.
    • indexOfGuest

      static int indexOfGuest(ViewHost aHost, View aView)
      ViewHost helper method.
    • indexInHost

      static int indexInHost(View aView)
      ViewHost helper method.
    • toXMLGuests

      static void toXMLGuests(ViewHost aHost, XMLArchiver anArchiver, XMLElement anElement)
      XML archival of ViewHost.Guests.
    • fromXMLGuests

      static void fromXMLGuests(ViewHost aHost, XMLArchiver anArchiver, XMLElement anElement)
      XML unarchival of ViewHost.Guests.