Package snap.view
Class ViewList
A class to manage a list of views.
-
Field Summary
FieldsFields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds the given view to this list at given index.get
(int anIndex) Returns the view at the given index.View[]
getAll()
Returns the contained views as an array.getFirst()
Returns the last view of this list.<T extends View>
TgetHitView
(View aView, Class<T> aClass, double anInset) Returns the first view of given class (optional) intersecting given view.getLast()
Returns the last view of this list.View[]
Returns the managed children.getViewAtXY
(double aX, double aY) Returns the view at given point X/Y.<T extends View>
TgetViewIntersectingShape
(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[]getViewsIntersectingShape
(Shape aShape, Class<T> aClass) Returns the views of given class (optional) hit by given shape.int
Returns the index of the given child in this node's children list.iterator()
Override to iterate directly on internal array to avoid co-modification when children added/removed during iterating.protected View
removeView
(int anIndex) Remove's the view at the given index from this list.int
size()
Returns the number of views in this list.Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Field Details
-
_managed
-
-
Constructor Details
-
ViewList
public ViewList()Constructor.
-
-
Method Details
-
size
public int size()Returns the number of views in this list.- Specified by:
size
in interfaceCollection<View>
- Specified by:
size
in interfaceList<View>
- Specified by:
size
in classAbstractCollection<View>
-
get
Returns the view at the given index. -
addView
Adds the given view to this list at given index. -
removeView
Remove's the view at the given index from this list. -
indexOf
Returns the index of the given child in this node's children list. -
getFirst
Returns the last view of this list. -
getLast
Returns the last view of this list. -
getAll
Returns the contained views as an array. -
getViewAtXY
Returns the view at given point X/Y. -
getViewIntersectingShape
Returns the first view of given class (optional) hit by given shape, excluding given view (optional). -
getViewsIntersectingShape
Returns the views of given class (optional) hit by given shape. -
getHitView
Returns the first view of given class (optional) intersecting given view. -
getManaged
Returns the managed children. -
iterator
Override to iterate directly on internal array to avoid co-modification when children added/removed during iterating.
-