Package snap.view

Class ViewList

java.lang.Object
snap.view.ViewList

public class ViewList extends Object
A class to manage a list of views.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected View[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    add(View aView)
    Adds the given view to end of this list.
    protected void
    add(View aView, int anIndex)
    Adds the given view to this list at given index.
    get(int anIndex)
    Returns the view at the given index.
    Returns the contained views as an array.
    Returns the last view of this list.
    <T extends View>
    T
    getHitView(View aView, Class<T> aClass, double anInset)
    Returns the first view of given class (optional) intersecting given view.
    Returns the last view of this list.
    Returns the managed children.
    getView(String aName)
    Returns the child with given name.
    getViewAt(double aX, double aY)
    Returns the view at given point.
    Returns the view at given point.
    <T extends View>
    T
    getViewAt(Shape aShape, Class<T> aClass, View aView)
    Returns the first view of given class (optional) hit by given shape, excluding given view (optional).
    <T extends View>
    T[]
    Returns the views of given class (optional) hit by given shape.
    int
    indexOf(View aView)
    Returns the index of the given child in this node's children list.
    protected View
    remove(int anIndex)
    Remove's the view at the given index from this list.
    protected int
    remove(View aView)
    Removes the given view from this list.
    protected void
    Removes all children from this node (in reverse order).
    protected void
    setAll(View... theViews)
    Sets views to given list.
    int
    Returns the number of views in this list.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _managed

      protected View[] _managed
  • Constructor Details

    • ViewList

      public ViewList()
  • Method Details

    • size

      public int size()
      Returns the number of views in this list.
    • get

      public View get(int anIndex)
      Returns the view at the given index.
    • getAll

      public View[] getAll()
      Returns the contained views as an array.
    • add

      protected void add(View aView)
      Adds the given view to end of this list.
    • add

      protected void add(View aView, int anIndex)
      Adds the given view to this list at given index.
    • remove

      protected View remove(int anIndex)
      Remove's the view at the given index from this list.
    • remove

      protected int remove(View aView)
      Removes the given view from this list.
    • removeAll

      protected void removeAll()
      Removes all children from this node (in reverse order).
    • setAll

      protected void setAll(View... theViews)
      Sets views to given list.
    • getView

      public View getView(String aName)
      Returns the child with given name.
    • indexOf

      public int indexOf(View aView)
      Returns the index of the given child in this node's children list.
    • getFirst

      public View getFirst()
      Returns the last view of this list.
    • getLast

      public View getLast()
      Returns the last view of this list.
    • getViewAt

      public View getViewAt(Point aPnt)
      Returns the view at given point.
    • getViewAt

      public View getViewAt(double aX, double aY)
      Returns the view at given point.
    • getViewAt

      public <T extends View> T getViewAt(Shape aShape, Class<T> aClass, View aView)
      Returns the first view of given class (optional) hit by given shape, excluding given view (optional).
    • getViewsIntersectingShape

      public <T extends View> T[] getViewsIntersectingShape(Shape aShape, Class<T> aClass)
      Returns the views of given class (optional) hit by given shape.
    • getHitView

      public <T extends View> T getHitView(View aView, Class<T> aClass, double anInset)
      Returns the first view of given class (optional) intersecting given view.
    • getManaged

      public View[] getManaged()
      Returns the managed children.