|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
net.sf.jaxodraw.object.JaxoObjectList<E>
E
- the element type of this list.public class JaxoObjectList<E extends JaxoObject>
Implementation of JaxoList. This should ensure that only JaxoObjects are added as elements.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
JaxoObjectList()
Just calls super(). |
|
JaxoObjectList(Collection<? extends E> c)
Add all elements of c to this List. |
|
JaxoObjectList(int initialCapacity)
Just calls super(initialCapacity). |
Method Summary | |
---|---|
JaxoList<E> |
copyOf()
Returns a copy of this JaxoList, i.e., a new JaxoList with copies of equal JaxoObjects at equal positions. |
Rectangle |
getBounds()
Returns the smallest bounding box that contains all the JaxoObjects of this JaxoList. |
Rectangle |
getBoundsExcept(Collection<? extends E> excludes)
Returns the smallest bounding box that contains all the JaxoObjects of this JaxoList except the ones contained in 'except'. |
Rectangle |
intersection(Rectangle inside)
Intersection of the bounding box of this JaxoList with the given Rectangle. |
boolean |
isCopy(JaxoList<E> list)
Determines if this JaxoList is a copy of the specified one. |
void |
move(int index,
int newIndex)
Move the object at 'index' to 'newIndex', leaving all other elements in order. |
void |
moveAllObjects(int deltaX,
int deltaY)
Displaces all JaxoObjects by the same amount. |
void |
paint(JaxoGraphics2D g)
Call paint(g) on all elements of JaxoObjects. |
void |
paintClipped(JaxoGraphics2D g)
Call paint on all elements of JaxoObjects if they intersect the current clipping area of the given graphics context. |
void |
paintClippedExcept(Collection<? extends E> excludes,
JaxoGraphics2D g)
Call paint on all elements of JaxoObjects that are not contained in 'excludes' and that intersect the current clipping area of the given graphics context. |
void |
paintExcept(Collection<? extends E> excludes,
JaxoGraphics2D g)
Call paint on all elements of JaxoObjects that are not contained in 'excludes'. |
boolean |
removeMarkedObjects()
Removes all marked JaxoObjects from this list. |
void |
setColor(Color c)
Sets the color of all JaxoObjects in this list. |
boolean |
toEnd(E object)
Moves the specified JaxoObject to the last position in this list. |
boolean |
toFront(E object)
Moves the specified JaxoObject to the first position in this list. |
Methods inherited from class java.util.ArrayList |
---|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray |
Constructor Detail |
---|
public JaxoObjectList()
public JaxoObjectList(Collection<? extends E> c)
c
- the collection whose elements are to be placed into this list.public JaxoObjectList(int initialCapacity)
initialCapacity
- the initial capacity of the list.Method Detail |
---|
public void paint(JaxoGraphics2D g)
paint
in interface JaxoList<E extends JaxoObject>
g
- The graphics context to paint to.JaxoObject.paint(JaxoGraphics2D)
public void paintClipped(JaxoGraphics2D g)
paintClipped
in interface JaxoList<E extends JaxoObject>
g
- The graphics context to paint to.JaxoObject.paint(JaxoGraphics2D)
,
Graphics.hitClip(int,int,int,int)
public void paintExcept(Collection<? extends E> excludes, JaxoGraphics2D g)
paintExcept
in interface JaxoList<E extends JaxoObject>
excludes
- The JaxoObjects to exlude.g
- The graphics context to paint to.JaxoObject.paint(JaxoGraphics2D)
public void paintClippedExcept(Collection<? extends E> excludes, JaxoGraphics2D g)
paintClippedExcept
in interface JaxoList<E extends JaxoObject>
excludes
- The JaxoObjects to exlude.g
- The graphics context to paint to.JaxoObject.paint(JaxoGraphics2D)
,
Graphics.hitClip(int,int,int,int)
public JaxoList<E> copyOf()
copyOf
in interface JaxoList<E extends JaxoObject>
public boolean isCopy(JaxoList<E> list)
isCopy
in interface JaxoList<E extends JaxoObject>
list
- The JaxoList to compare against.
public void moveAllObjects(int deltaX, int deltaY)
moveAllObjects
in interface JaxoList<E extends JaxoObject>
deltaX
- The displacement in x directiondeltaY
- The displacement in y directionpublic void setColor(Color c)
setColor
in interface JaxoList<E extends JaxoObject>
c
- The color to set.public void move(int index, int newIndex)
move
in interface JaxoList<E extends JaxoObject>
index
- The index of the object to move.newIndex
- The new index of the object.public boolean toEnd(E object)
toEnd
in interface JaxoList<E extends JaxoObject>
object
- The JaxoObject to move.
public boolean toFront(E object)
toFront
in interface JaxoList<E extends JaxoObject>
object
- The JaxoObject to move.
public boolean removeMarkedObjects()
removeMarkedObjects
in interface JaxoList<E extends JaxoObject>
public Rectangle getBounds()
getBounds
in interface JaxoList<E extends JaxoObject>
public Rectangle getBoundsExcept(Collection<? extends E> excludes)
getBoundsExcept
in interface JaxoList<E extends JaxoObject>
excludes
- objects to exclude, may be null.
public Rectangle intersection(Rectangle inside)
intersection
in interface JaxoList<E extends JaxoObject>
inside
- The Rectangle to intersect with.
JaxoList.getBounds()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |