Package snap.view

Class ChildView

All Implemented Interfaces:
PropChange.DoChange, XMLArchiver.Archivable, ViewHost
Direct Known Subclasses:
ColView, GameView, GridView, PageView, RowView, SpringView, StackView, SwitchView

public class ChildView extends ParentView implements ViewHost
A ChildView is a ParentView (and ViewHost) that allows children to be modified.
  • Constructor Details

    • ChildView

      public ChildView()
  • Method Details

    • addChild

      public void addChild(View aChild)
      Adds the given child to the end of this view's children list.
      Overrides:
      addChild in class ParentView
    • addChild

      public void addChild(View aChild, int anIndex)
      Adds the given child to this view's children list at the given index.
      Overrides:
      addChild in class ParentView
    • removeChild

      public View removeChild(int anIndex)
      Remove's the child at the given index from this view's children list.
      Overrides:
      removeChild in class ParentView
    • removeChild

      public int removeChild(View aChild)
      Removes the given child from this view's children list.
      Overrides:
      removeChild in class ParentView
    • removeChildren

      public void removeChildren()
      Removes all children from this view (in reverse order).
      Overrides:
      removeChildren in class ParentView
    • setChildren

      public void setChildren(View... theChildren)
      Sets children to given list.
      Overrides:
      setChildren in class ParentView
    • getGuestCount

      public int getGuestCount()
      ViewHost method: Returns the number of guest views.
      Specified by:
      getGuestCount in interface ViewHost
    • getGuest

      public View getGuest(int anIndex)
      ViewHost method: Returns the guest view at given index.
      Specified by:
      getGuest in interface ViewHost
    • addGuest

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

      public View removeGuest(int anIndex)
      ViewHost method: Remove's guest at given index from this host's guest (children) list.
      Specified by:
      removeGuest in interface ViewHost