|
|||||||||
| Home >> All >> org >> apache >> batik >> [ gvt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.batik.gvt
Class AbstractGraphicsNode

java.lang.Objectorg.apache.batik.gvt.AbstractGraphicsNode
- All Implemented Interfaces:
- GraphicsNode
- Direct Known Subclasses:
- CompositeGraphicsNode, ProxyGraphicsNode, RasterImageNode, ShapeNode, TextNode
- public abstract class AbstractGraphicsNode
- extends java.lang.Object
- implements GraphicsNode
- extends java.lang.Object
A partial implementation of the GraphicsNode interface.
- Version:
- $Id: AbstractGraphicsNode.java,v 1.58 2005/03/27 08:58:34 cam Exp $
| Field Summary | |
private java.awt.geom.Rectangle2D |
bounds
Internal Cache: node bounds |
protected org.apache.batik.gvt.event.GraphicsNodeChangeEvent |
changeCompletedEvent
|
protected org.apache.batik.gvt.event.GraphicsNodeChangeEvent |
changeStartedEvent
|
protected org.apache.batik.ext.awt.image.renderable.ClipRable |
clip
The clipping filter for this graphics node. |
protected java.awt.Composite |
composite
The compositing operation to be used when a graphics node is painted on top of another one. |
protected java.lang.ref.WeakReference |
enableBackgroundGraphicsNodeRable
The GraphicsNodeRable for this node with all filtering applied |
(package private) static double |
EPSILON
|
protected org.apache.batik.ext.awt.image.renderable.Filter |
filter
The filter of this graphics node. |
protected java.lang.ref.WeakReference |
graphicsNodeRable
The GraphicsNodeRable for this node. |
protected java.awt.RenderingHints |
hints
The rendering hints that control the quality to use when rendering this graphics node. |
protected java.awt.geom.AffineTransform |
inverseTransform
The inverse transform for this node, i.e., from parent node to this node. |
protected boolean |
isVisible
This flag bit indicates whether or not this graphics node is visible. |
protected javax.swing.event.EventListenerList |
listeners
The listeners list. |
protected org.apache.batik.gvt.filter.Mask |
mask
The mask of this graphics node. |
protected CompositeGraphicsNode |
parent
The parent of this graphics node. |
protected int |
pointerEventType
Indicates how this graphics node reacts to events. |
protected RootGraphicsNode |
root
The root of the GVT tree. |
protected java.awt.geom.AffineTransform |
transform
The transform of this graphics node. |
protected java.lang.ref.WeakReference |
weakRef
A Weak Reference to this. |
| Fields inherited from interface org.apache.batik.gvt.GraphicsNode |
ALL, FILL, IDENTITY, NONE, PAINTED, STROKE, VISIBLE, VISIBLE_FILL, VISIBLE_PAINTED, VISIBLE_STROKE |
| Constructor Summary | |
protected |
AbstractGraphicsNode()
Constructs a new graphics node. |
| Method Summary | |
boolean |
contains(java.awt.geom.Point2D p)
Returns true if the specified Point2D is inside the boundary of this node, false otherwise. |
void |
fireGraphicsNodeChangeCompleted()
|
void |
fireGraphicsNodeChangeStarted()
|
void |
fireGraphicsNodeChangeStarted(GraphicsNode changeSrc)
|
void |
fireGraphicsNodeChangeStarted(org.apache.batik.gvt.event.GraphicsNodeChangeEvent changeStartedEvent)
|
java.awt.geom.Rectangle2D |
getBounds()
Returns the bounds of this node in user space. |
org.apache.batik.ext.awt.image.renderable.ClipRable |
getClip()
Returns the clipping filter of this node or null if any. |
java.awt.Composite |
getComposite()
Returns the composite of this node or null if any. |
org.apache.batik.ext.awt.image.renderable.Filter |
getEnableBackgroundGraphicsNodeRable(boolean createIfNeeded)
Returns the GraphicsNodeRable for this node. |
org.apache.batik.ext.awt.image.renderable.Filter |
getFilter()
Returns the filter of this node or null if any. |
java.awt.geom.AffineTransform |
getGlobalTransform()
Returns the concatenated transform of this node. |
org.apache.batik.ext.awt.image.renderable.Filter |
getGraphicsNodeRable(boolean createIfNeeded)
Returns the GraphicsNodeRable for this node. |
java.awt.geom.AffineTransform |
getInverseTransform()
Returns the inverse transform for this node. |
org.apache.batik.gvt.filter.Mask |
getMask()
Returns the mask of this node or null if any. |
CompositeGraphicsNode |
getParent()
Returns the parent of this node or null if any. |
int |
getPointerEventType()
Returns the type that describes how this graphics node reacts to events. |
java.awt.RenderingHints |
getRenderingHints()
Returns the rendering hints of this node or null if any. |
RootGraphicsNode |
getRoot()
Returns the root of the GVT tree or null if the node is not part of a GVT tree. |
java.awt.geom.AffineTransform |
getTransform()
Returns the transform of this node or null if any. |
java.awt.geom.Rectangle2D |
getTransformedBounds(java.awt.geom.AffineTransform txf)
Returns the bounds of this node after applying the input transform (if any), concatenated with this node's transform (if any). |
java.awt.geom.Rectangle2D |
getTransformedGeometryBounds(java.awt.geom.AffineTransform txf)
Returns the bounds of the area covered by this node, without taking any of its rendering attribute into accoun. |
java.awt.geom.Rectangle2D |
getTransformedPrimitiveBounds(java.awt.geom.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). |
java.awt.geom.Rectangle2D |
getTransformedSensitiveBounds(java.awt.geom.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. |
java.lang.ref.WeakReference |
getWeakReference()
Returns a canonical WeakReference to this GraphicsNode. |
boolean |
intersects(java.awt.geom.Rectangle2D r)
Returns true if the interior of this node intersects the interior of a specified Rectangle2D, false otherwise. |
protected void |
invalidateGeometryCache()
Invalidates the cached geometric bounds. |
protected boolean |
isAntialiasedClip(java.awt.geom.AffineTransform usr2dev,
java.awt.RenderingHints hints,
java.awt.Shape clip)
Returns true if there is a clip and it should be antialiased |
protected boolean |
isOffscreenBufferNeeded()
Returns true of an offscreen buffer is needed to render this node, false otherwise. |
boolean |
isVisible()
Returns true if this node is visible, false otherwise. |
GraphicsNode |
nodeHitAt(java.awt.geom.Point2D p)
Returns the GraphicsNode containing point p if this node or one of its children is sensitive to mouse events at p. |
protected java.awt.geom.Rectangle2D |
normalizeRectangle(java.awt.geom.Rectangle2D bounds)
This method makes sure that neither the width nor height of the rectangle is zero. |
void |
paint(java.awt.Graphics2D g2d)
Paints this node. |
void |
setClip(org.apache.batik.ext.awt.image.renderable.ClipRable newClipper)
Sets the clipping filter of this node. |
void |
setComposite(java.awt.Composite newComposite)
Sets the composite of this node. |
void |
setFilter(org.apache.batik.ext.awt.image.renderable.Filter newFilter)
Sets the filter of this node. |
void |
setMask(org.apache.batik.gvt.filter.Mask newMask)
Sets the mask of this node. |
protected void |
setParent(CompositeGraphicsNode newParent)
Sets the parent node of this graphics node. |
void |
setPointerEventType(int pointerEventType)
Sets the type that describes how this graphics node reacts to events. |
void |
setRenderingHint(java.awt.RenderingHints.Key key,
java.lang.Object value)
Maps the specified key to the specified value in the rendering hints of this node. |
void |
setRenderingHints(java.util.Map hints)
Copies all of the mappings from the specified Map to the rendering hints of this node. |
void |
setRenderingHints(java.awt.RenderingHints newHints)
Sets the rendering hints of this node. |
protected void |
setRoot(RootGraphicsNode newRoot)
Sets the root node of this graphics node. |
void |
setTransform(java.awt.geom.AffineTransform newTransform)
Sets the transform of this node. |
void |
setVisible(boolean isVisible)
Sets if this node is visible or not depending on the specified value. |
private void |
traceFilter(org.apache.batik.ext.awt.image.renderable.Filter filter,
java.lang.String prefix)
DEBUG: Trace filter chain |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.batik.gvt.GraphicsNode |
getGeometryBounds, getOutline, getPrimitiveBounds, getSensitiveBounds, primitivePaint |
| Field Detail |
listeners
protected javax.swing.event.EventListenerList listeners
- The listeners list.
transform
protected java.awt.geom.AffineTransform transform
- The transform of this graphics node.
inverseTransform
protected java.awt.geom.AffineTransform inverseTransform
- The inverse transform for this node, i.e., from parent node
to this node.
composite
protected java.awt.Composite composite
- The compositing operation to be used when a graphics node is
painted on top of another one.
isVisible
protected boolean isVisible
- This flag bit indicates whether or not this graphics node is visible.
clip
protected org.apache.batik.ext.awt.image.renderable.ClipRable clip
- The clipping filter for this graphics node.
hints
protected java.awt.RenderingHints hints
- The rendering hints that control the quality to use when rendering
this graphics node.
parent
protected CompositeGraphicsNode parent
- The parent of this graphics node.
root
protected RootGraphicsNode root
- The root of the GVT tree.
mask
protected org.apache.batik.gvt.filter.Mask mask
- The mask of this graphics node.
filter
protected org.apache.batik.ext.awt.image.renderable.Filter filter
- The filter of this graphics node.
pointerEventType
protected int pointerEventType
- Indicates how this graphics node reacts to events.
graphicsNodeRable
protected java.lang.ref.WeakReference graphicsNodeRable
- The GraphicsNodeRable for this node.
enableBackgroundGraphicsNodeRable
protected java.lang.ref.WeakReference enableBackgroundGraphicsNodeRable
- The GraphicsNodeRable for this node with all filtering applied
weakRef
protected java.lang.ref.WeakReference weakRef
- A Weak Reference to this.
bounds
private java.awt.geom.Rectangle2D bounds
- Internal Cache: node bounds
changeStartedEvent
protected org.apache.batik.gvt.event.GraphicsNodeChangeEvent changeStartedEvent
changeCompletedEvent
protected org.apache.batik.gvt.event.GraphicsNodeChangeEvent changeCompletedEvent
EPSILON
static double EPSILON
| Constructor Detail |
AbstractGraphicsNode
protected AbstractGraphicsNode()
- Constructs a new graphics node.
| Method Detail |
getWeakReference
public java.lang.ref.WeakReference getWeakReference()
- Returns a canonical WeakReference to this GraphicsNode.
This is suitable for use as a key value in a hash map
- Specified by:
getWeakReferencein interfaceGraphicsNode
getPointerEventType
public int getPointerEventType()
- Returns the type that describes how this graphics node reacts to events.
- Specified by:
getPointerEventTypein interfaceGraphicsNode
setPointerEventType
public void setPointerEventType(int pointerEventType)
- Sets the type that describes how this graphics node reacts to events.
- Specified by:
setPointerEventTypein interfaceGraphicsNode
setTransform
public void setTransform(java.awt.geom.AffineTransform newTransform)
- Sets the transform of this node.
- Specified by:
setTransformin interfaceGraphicsNode
getTransform
public java.awt.geom.AffineTransform getTransform()
- Returns the transform of this node or null if any.
- Specified by:
getTransformin interfaceGraphicsNode
getInverseTransform
public java.awt.geom.AffineTransform getInverseTransform()
- Returns the inverse transform for this node.
- Specified by:
getInverseTransformin interfaceGraphicsNode
getGlobalTransform
public java.awt.geom.AffineTransform getGlobalTransform()
- Returns the concatenated transform of this node. That is, this
node's transform preconcatenated with it's parent's transforms.
- Specified by:
getGlobalTransformin interfaceGraphicsNode
setComposite
public void setComposite(java.awt.Composite newComposite)
- Sets the composite of this node.
- Specified by:
setCompositein interfaceGraphicsNode
getComposite
public java.awt.Composite getComposite()
- Returns the composite of this node or null if any.
- Specified by:
getCompositein interfaceGraphicsNode
setVisible
public void setVisible(boolean isVisible)
- Sets if this node is visible or not depending on the specified value.
- Specified by:
setVisiblein interfaceGraphicsNode
isVisible
public boolean isVisible()
- Returns true if this node is visible, false otherwise.
- Specified by:
isVisiblein interfaceGraphicsNode
setClip
public void setClip(org.apache.batik.ext.awt.image.renderable.ClipRable newClipper)
- Description copied from interface:
GraphicsNode - Sets the clipping filter of this node.
- Specified by:
setClipin interfaceGraphicsNode
getClip
public org.apache.batik.ext.awt.image.renderable.ClipRable getClip()
- Returns the clipping filter of this node or null if any.
- Specified by:
getClipin interfaceGraphicsNode
setRenderingHint
public void setRenderingHint(java.awt.RenderingHints.Key key,
java.lang.Object value)
- Maps the specified key to the specified value in the rendering hints of
this node.
- Specified by:
setRenderingHintin interfaceGraphicsNode
setRenderingHints
public void setRenderingHints(java.util.Map hints)
- Copies all of the mappings from the specified Map to the
rendering hints of this node.
- Specified by:
setRenderingHintsin interfaceGraphicsNode
setRenderingHints
public void setRenderingHints(java.awt.RenderingHints newHints)
- Sets the rendering hints of this node.
- Specified by:
setRenderingHintsin interfaceGraphicsNode
getRenderingHints
public java.awt.RenderingHints getRenderingHints()
- Returns the rendering hints of this node or null if any.
- Specified by:
getRenderingHintsin interfaceGraphicsNode
setMask
public void setMask(org.apache.batik.gvt.filter.Mask newMask)
- Sets the mask of this node.
- Specified by:
setMaskin interfaceGraphicsNode
getMask
public org.apache.batik.gvt.filter.Mask getMask()
- Returns the mask of this node or null if any.
- Specified by:
getMaskin interfaceGraphicsNode
setFilter
public void setFilter(org.apache.batik.ext.awt.image.renderable.Filter newFilter)
- Sets the filter of this node.
- Specified by:
setFilterin interfaceGraphicsNode
getFilter
public org.apache.batik.ext.awt.image.renderable.Filter getFilter()
- Returns the filter of this node or null if any.
- Specified by:
getFilterin interfaceGraphicsNode
getGraphicsNodeRable
public org.apache.batik.ext.awt.image.renderable.Filter getGraphicsNodeRable(boolean createIfNeeded)
- Returns the GraphicsNodeRable for this node. This
GraphicsNodeRable is the Renderable (Filter) before any of the
filter operations have been applied.
- Specified by:
getGraphicsNodeRablein interfaceGraphicsNode
getEnableBackgroundGraphicsNodeRable
public org.apache.batik.ext.awt.image.renderable.Filter getEnableBackgroundGraphicsNodeRable(boolean createIfNeeded)
- Returns the GraphicsNodeRable for this node. This
GraphicsNodeRable is the Renderable (Filter) after all of the
filter operations have been applied.
- Specified by:
getEnableBackgroundGraphicsNodeRablein interfaceGraphicsNode
paint
public void paint(java.awt.Graphics2D g2d)
- Paints this node.
- Specified by:
paintin interfaceGraphicsNode
traceFilter
private void traceFilter(org.apache.batik.ext.awt.image.renderable.Filter filter, java.lang.String prefix)
- DEBUG: Trace filter chain
isOffscreenBufferNeeded
protected boolean isOffscreenBufferNeeded()
- Returns true of an offscreen buffer is needed to render this node, false
otherwise.
isAntialiasedClip
protected boolean isAntialiasedClip(java.awt.geom.AffineTransform usr2dev, java.awt.RenderingHints hints, java.awt.Shape clip)
- Returns true if there is a clip and it should be antialiased
fireGraphicsNodeChangeStarted
public void fireGraphicsNodeChangeStarted(GraphicsNode changeSrc)
fireGraphicsNodeChangeStarted
public void fireGraphicsNodeChangeStarted()
fireGraphicsNodeChangeStarted
public void fireGraphicsNodeChangeStarted(org.apache.batik.gvt.event.GraphicsNodeChangeEvent changeStartedEvent)
fireGraphicsNodeChangeCompleted
public void fireGraphicsNodeChangeCompleted()
getParent
public CompositeGraphicsNode getParent()
- Returns the parent of this node or null if any.
- Specified by:
getParentin interfaceGraphicsNode
getRoot
public RootGraphicsNode getRoot()
- Returns the root of the GVT tree or null if the node is not part of a GVT
tree.
- Specified by:
getRootin interfaceGraphicsNode
setRoot
protected void setRoot(RootGraphicsNode newRoot)
- Sets the root node of this graphics node.
setParent
protected void setParent(CompositeGraphicsNode newParent)
- Sets the parent node of this graphics node.
invalidateGeometryCache
protected void invalidateGeometryCache()
- Invalidates the cached geometric bounds. This method is called
each time an attribute that affects the bounds of this node
changed.
getBounds
public java.awt.geom.Rectangle2D getBounds()
- Returns the bounds of this node in user space. This includes primitive
paint, filtering, clipping and masking.
- Specified by:
getBoundsin interfaceGraphicsNode
getTransformedBounds
public java.awt.geom.Rectangle2D getTransformedBounds(java.awt.geom.AffineTransform txf)
- Returns the bounds of this node after applying the input transform
(if any), concatenated with this node's transform (if any).
- Specified by:
getTransformedBoundsin interfaceGraphicsNode
getTransformedPrimitiveBounds
public java.awt.geom.Rectangle2D getTransformedPrimitiveBounds(java.awt.geom.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).
- Specified by:
getTransformedPrimitiveBoundsin interfaceGraphicsNode
getTransformedGeometryBounds
public java.awt.geom.Rectangle2D getTransformedGeometryBounds(java.awt.geom.AffineTransform txf)
- Returns the bounds of the area covered by this node, without
taking any of its rendering attribute into accoun. That is,
exclusive of any clipping, masking, filtering or stroking, for
example. The returned value is transformed by the concatenation
of the input transform and this node's transform.
- Specified by:
getTransformedGeometryBoundsin interfaceGraphicsNode
getTransformedSensitiveBounds
public java.awt.geom.Rectangle2D getTransformedSensitiveBounds(java.awt.geom.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. The returned value is
transformed by the concatenation of the input transform and
this node's transform.
- Specified by:
getTransformedSensitiveBoundsin interfaceGraphicsNode
contains
public boolean contains(java.awt.geom.Point2D p)
- Returns true if the specified Point2D is inside the boundary of this
node, false otherwise.
- Specified by:
containsin interfaceGraphicsNode
intersects
public boolean intersects(java.awt.geom.Rectangle2D r)
- Returns true if the interior of this node intersects the interior of a
specified Rectangle2D, false otherwise.
- Specified by:
intersectsin interfaceGraphicsNode
nodeHitAt
public GraphicsNode nodeHitAt(java.awt.geom.Point2D p)
- Returns the GraphicsNode containing point p if this node or one of its
children is sensitive to mouse events at p.
- Specified by:
nodeHitAtin interfaceGraphicsNode
normalizeRectangle
protected java.awt.geom.Rectangle2D normalizeRectangle(java.awt.geom.Rectangle2D bounds)
- This method makes sure that neither the width nor height of the
rectangle is zero. But it tries to make them very small
relatively speaking.
|
|||||||||
| Home >> All >> org >> apache >> batik >> [ gvt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.batik.gvt.AbstractGraphicsNode