|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.batik.gvt.AbstractGraphicsNode
org.apache.batik.gvt.CompositeGraphicsNode
public class CompositeGraphicsNode
A CompositeGraphicsNode is a graphics node that can contain graphics nodes.
Note: this class is a 'little bit aware of' other threads, but not really threadsafe.
Field Summary | |
---|---|
protected Rectangle2D |
backgroundEnableRgn
This flag indicates if this node has BackgroundEnable = 'new'. |
protected GraphicsNode[] |
children
The children of this composite graphics node. |
protected int |
count
The number of children of this composite graphics node. |
protected int |
modCount
The number of times the children list has been structurally modified. |
static Rectangle2D |
NULL_RECT
|
static Rectangle2D |
VIEWPORT
|
Fields inherited from class org.apache.batik.gvt.AbstractGraphicsNode |
---|
changeCompletedEvent, changeStartedEvent, clip, composite, enableBackgroundGraphicsNodeRable, filter, graphicsNodeRable, hints, inverseTransform, isVisible, listeners, mask, parent, pointerEventType, root, transform, weakRef |
Fields inherited from interface org.apache.batik.gvt.GraphicsNode |
---|
ALL, FILL, IDENTITY, NONE, PAINTED, STROKE, VISIBLE, VISIBLE_FILL, VISIBLE_PAINTED, VISIBLE_STROKE |
Constructor Summary | |
---|---|
CompositeGraphicsNode()
Constructs a new empty CompositeGraphicsNode. |
Method Summary | |
---|---|
void |
add(int index,
Object o)
Inserts the specified graphics node at the specified position in this children list. |
boolean |
add(Object o)
Adds the specified graphics node to this composite graphics node. |
boolean |
addAll(Collection c)
Not supported - Throws UnsupportedOperationException exception. |
boolean |
addAll(int index,
Collection c)
Not supported - Throws UnsupportedOperationException exception. |
void |
clear()
Not supported - Throws UnsupportedOperationException exception. |
boolean |
contains(Object node)
Returns true if this composite graphics node contains the specified graphics node, false otherwise. |
boolean |
contains(Point2D p)
Returns true if the specified Point2D is inside the boundary of this node, false otherwise. |
boolean |
containsAll(Collection c)
Returns true if this composite graphics node contains all the graphics node in the specified collection, false otherwise. |
void |
ensureCapacity(int minCapacity)
Increases the capacity of the children list, if necessary, to ensure that it can hold at least the number of graphics nodes specified by the minimum capacity argument. |
Object |
get(int index)
Returns the graphics node at the specified position in the children list. |
Rectangle2D |
getBackgroundEnable()
Returns the region defining the background enable property. |
List |
getChildren()
Returns the list of children. |
Rectangle2D |
getGeometryBounds()
Returns the bounds of the area covered by this node, without taking any of its rendering attributes into account. |
Shape |
getOutline()
Returns the outline of this node. |
Rectangle2D |
getPrimitiveBounds()
Returns the bounds of the area covered by this node's primitive paint. |
Rectangle2D |
getSensitiveBounds()
Returns the bounds of the sensitive area covered by this node, This includes the stroked area but does not include the effects of clipping, masking or filtering. |
static Rectangle2D |
getTransformedBBox(Rectangle2D r2d,
AffineTransform t)
Transforms a Rectangle 2D by an affine transform. |
Rectangle2D |
getTransformedGeometryBounds(AffineTransform txf)
Returns the bounds of the area covered by this node, without taking any of its rendering attribute into accoun. |
Rectangle2D |
getTransformedPrimitiveBounds(AffineTransform txf)
Returns the bounds of this node's primitivePaint after applying the input transform (if any), concatenated with this node's transform (if any). |
Rectangle2D |
getTransformedSensitiveBounds(AffineTransform txf)
Returns the bounds of the sensitive area covered by this node, This includes the stroked area but does not include the effects of clipping, masking or filtering. |
int |
indexOf(Object node)
Returns the index in the children list of the specified graphics node or -1 if the children list does not contain this graphics node. |
protected void |
invalidateGeometryCache()
Invalidates the cached geometric bounds. |
boolean |
isEmpty()
Returns true if this composite graphics node does not contain graphics node, false otherwise. |
Iterator |
iterator()
Returns an iterator over the children of this graphics node. |
int |
lastIndexOf(Object node)
Returns the index in this children list of the last occurence of the specified graphics node, or -1 if the list does not contain this graphics node. |
ListIterator |
listIterator()
Returns an iterator over the children of this graphics node. |
ListIterator |
listIterator(int index)
Returns an iterator over the children of this graphics node, starting at the specified position in the children list. |
GraphicsNode |
nodeHitAt(Point2D p)
Returns the GraphicsNode containing point p if this node or one of its children is sensitive to mouse events at p. |
void |
primitivePaint(Graphics2D g2d)
Paints this node without applying Filter, Mask, Composite, and clip. |
Object |
remove(int index)
Removes the graphics node at the specified position in the children list. |
boolean |
remove(Object o)
Removes the first instance of the specified graphics node from the children list. |
boolean |
removeAll(Collection c)
Not supported - Throws UnsupportedOperationException exception. |
boolean |
retainAll(Collection c)
Not supported - Throws UnsupportedOperationException exception. |
Object |
set(int index,
Object o)
Replaces the graphics node at the specified position in the children list with the specified graphics node. |
void |
setBackgroundEnable(Rectangle2D bgRgn)
Sets the enable background property to the specified rectangle. |
protected void |
setRoot(RootGraphicsNode newRoot)
Sets the root node of this grahics node and modify all its children. |
void |
setVisible(boolean isVisible)
Sets if this node is visible or not depending on the specified value. |
int |
size()
Returns the number of children of this composite graphics node. |
List |
subList(int fromIndex,
int toIndex)
Not supported - Throws UnsupportedOperationException exception. |
Object[] |
toArray()
Returns an array containing all of the graphics node in the children list of this composite graphics node in the correct order. |
Object[] |
toArray(Object[] a)
Returns an array containing all of the graphics node in the children list of this composite graphics node in the correct order. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
equals, hashCode |
Field Detail |
---|
public static final Rectangle2D VIEWPORT
public static final Rectangle2D NULL_RECT
protected GraphicsNode[] children
protected volatile int count
protected volatile int modCount
protected Rectangle2D backgroundEnableRgn
Constructor Detail |
---|
public CompositeGraphicsNode()
Method Detail |
---|
public List getChildren()
public void setBackgroundEnable(Rectangle2D bgRgn)
bgRgn
- the region that defines the background enable propertypublic Rectangle2D getBackgroundEnable()
public void setVisible(boolean isVisible)
setVisible
in interface GraphicsNode
setVisible
in class AbstractGraphicsNode
isVisible
- If true this node is visiblepublic void primitivePaint(Graphics2D g2d)
primitivePaint
in interface GraphicsNode
g2d
- the Graphics2D to useprotected void invalidateGeometryCache()
invalidateGeometryCache
in class AbstractGraphicsNode
public Rectangle2D getPrimitiveBounds()
getPrimitiveBounds
in interface GraphicsNode
public static Rectangle2D getTransformedBBox(Rectangle2D r2d, AffineTransform t)
public Rectangle2D getTransformedPrimitiveBounds(AffineTransform txf)
getTransformedPrimitiveBounds
in interface GraphicsNode
getTransformedPrimitiveBounds
in class AbstractGraphicsNode
txf
- the affine transform with which this node's transform should
be concatenated. Should not be null.public Rectangle2D getGeometryBounds()
getGeometryBounds
in interface GraphicsNode
public Rectangle2D getTransformedGeometryBounds(AffineTransform txf)
getTransformedGeometryBounds
in interface GraphicsNode
getTransformedGeometryBounds
in class AbstractGraphicsNode
txf
- the affine transform with which this node's transform should
be concatenated. Should not be null.public Rectangle2D getSensitiveBounds()
getSensitiveBounds
in interface GraphicsNode
public Rectangle2D getTransformedSensitiveBounds(AffineTransform txf)
getTransformedSensitiveBounds
in interface GraphicsNode
getTransformedSensitiveBounds
in class AbstractGraphicsNode
txf
- the affine transform with which this node's
transform should be concatenated. Should not be null.public boolean contains(Point2D p)
contains
in interface GraphicsNode
contains
in class AbstractGraphicsNode
p
- the specified Point2D in the user spacepublic GraphicsNode nodeHitAt(Point2D p)
nodeHitAt
in interface GraphicsNode
nodeHitAt
in class AbstractGraphicsNode
p
- the specified Point2D in the user spacepublic Shape getOutline()
getOutline
in interface GraphicsNode
protected void setRoot(RootGraphicsNode newRoot)
setRoot
in class AbstractGraphicsNode
newRoot
- the new root node of this nodepublic int size()
size
in interface Collection
size
in interface List
public boolean isEmpty()
isEmpty
in interface Collection
isEmpty
in interface List
public boolean contains(Object node)
contains
in interface Collection
contains
in interface List
node
- the node to checkpublic Iterator iterator()
iterator
in interface Iterable
iterator
in interface Collection
iterator
in interface List
public Object[] toArray()
toArray
in interface Collection
toArray
in interface List
public Object[] toArray(Object[] a)
toArray
in interface Collection
toArray
in interface List
a
- the array to fit if possiblepublic Object get(int index)
get
in interface List
index
- the index of the graphics node to return
IndexOutOfBoundsException
- if the index is out of rangepublic Object set(int index, Object o)
set
in interface List
index
- the index of the graphics node to replaceo
- the graphics node to be stored at the specified position
IndexOutOfBoundsException
- if the index is out of range
IllegalArgumentException
- if the node is not an
instance of GraphicsNodepublic boolean add(Object o)
add
in interface Collection
add
in interface List
o
- the graphics node to add
IllegalArgumentException
- if the node is not an
instance of GraphicsNodepublic void add(int index, Object o)
add
in interface List
index
- the position at which the specified graphics node is to
be inserted.o
- the graphics node to be inserted.
IndexOutOfBoundsException
- if the index is out of range
IllegalArgumentException
- if the node is not an
instance of GraphicsNodepublic boolean addAll(Collection c)
addAll
in interface Collection
addAll
in interface List
public boolean addAll(int index, Collection c)
addAll
in interface List
public boolean remove(Object o)
remove
in interface Collection
remove
in interface List
o
- the node the remove
IllegalArgumentException
- if the node is not an
instance of GraphicsNode
IndexOutOfBoundsException
- when o is not in children listpublic Object remove(int index)
remove
in interface List
index
- the position of the graphics node to remove
IndexOutOfBoundsException
- if index out of range public boolean removeAll(Collection c)
removeAll
in interface Collection
removeAll
in interface List
public boolean retainAll(Collection c)
retainAll
in interface Collection
retainAll
in interface List
public void clear()
clear
in interface Collection
clear
in interface List
public boolean containsAll(Collection c)
containsAll
in interface Collection
containsAll
in interface List
c
- the collection to be checked for containmentpublic int indexOf(Object node)
indexOf
in interface List
node
- the graphics node to search forpublic int lastIndexOf(Object node)
lastIndexOf
in interface List
node
- the graphics node to search forpublic ListIterator listIterator()
listIterator
in interface List
public ListIterator listIterator(int index)
listIterator
in interface List
index
- the index of the first graphics node to return
from the children listpublic List subList(int fromIndex, int toIndex)
subList
in interface List
public void ensureCapacity(int minCapacity)
minCapacity
- the desired minimum capacity.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |