Package org.apache.batik.gvt
Interface GraphicsNode
- All Known Implementing Classes:
AbstractGraphicsNode
,CanvasGraphicsNode
,CompositeGraphicsNode
,FlowExtTextNode
,FlowTextNode
,ImageNode
,MultiResGraphicsNode
,ProxyGraphicsNode
,RasterImageNode
,RootGraphicsNode
,ShapeNode
,SVGPatternElementBridge.PatternGraphicsNode
,TextNode
public interface GraphicsNode
The base class for all graphics nodes. A GraphicsNode encapsulates
graphical attributes and can perform atomic operations of a complex
rendering.
- Version:
- $Id: GraphicsNode.java 1733416 2016-03-03 07:07:13Z gadams $
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Indicates that this graphics node can be the target for events if any cases.static final int
Indicates that this graphics node can be the target for events when the mouse is over the filled area whatever or not it is the visible.static final AffineTransform
The identity affine transform matrix used to draw renderable images.static final int
Indicates that this graphics node can not be the target for events.static final int
Indicates that this graphics node can be the target for events when the mouse is over the painted area whatever or not it is the visible.static final int
Indicates that this graphics node can be the target for events when the mouse is over the stroked area whatever or not it is the visible.static final int
Indicates that this graphics node can be the target for events when it is visible and whatever is the filled and stroked area.static final int
Indicates that this graphics node can be the target for events when it is visible and when the mouse is over the filled area if any.static final int
Indicates that this graphics node can be the target for events when it is visible and when the mouse is over the "painted" area.static final int
Indicates that this graphics node can be the target for events when it is visible and when the mouse is over the stroked area if any. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if the specified Point2D is inside the boundary of this node, false otherwise.Returns the bounds of this node in user space.getClip()
Returns the clipping filter of this node or null if any.Returns the composite of this node or null if any.getEnableBackgroundGraphicsNodeRable
(boolean createIfNeeded) Returns the GraphicsNodeRable for this node.Returns the filter of this node or null if any.Returns the bounds of the area covered by this node, without taking any of its rendering attribute into account.Returns the concatenated transform of this node.getGraphicsNodeRable
(boolean createIfNeeded) Returns the GraphicsNodeRable for this node.Returns the inverse transform for this node.getMask()
Returns the mask of this node or null if any.Returns the outline of this node.Returns the parent of this node or null if any.int
Returns the type that describes how this graphics node reacts to events.Returns the bounds of the area covered by this node's primitive paint.Returns the rendering hints of this node or null if any.getRoot()
Returns the root of the GVT tree or null if the node is not part of a GVT tree.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.Returns the transform of this node or null if any.Returns the bounds of this node after applying the input transform (if any), concatenated with this node's transform (if any).Returns the bounds of the area covered by this node, without taking any of its rendering attribute into accoun.Returns the bounds of this node's primitivePaint after applying the input transform (if any), concatenated with this node's transform (if any).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.Returns a canonical WeakReference to this GraphicsNode.boolean
Returns true if the interior of this node intersects the interior of a specified Rectangle2D, false otherwise.boolean
Returns true if this node is visible, false otherwise.Returns the GraphicsNode containing point p if this node or one of its children is sensitive to mouse events at p.void
paint
(Graphics2D g2d) Paints this node.void
primitivePaint
(Graphics2D g2d) Paints this node without applying Filter, Mask, Composite, and clip.void
Sets the clipping filter of this node.void
setComposite
(Composite newComposite) Sets the composite of this node.void
Sets the filter of this node.void
Sets the mask of this node.void
setPointerEventType
(int pointerEventType) Sets the type that describes how this graphics node reacts to events.void
setRenderingHint
(RenderingHints.Key key, Object value) Maps the specified key to the specified value in the rendering hints of this node.void
setRenderingHints
(RenderingHints newHints) Sets the rendering hints of this node.void
setRenderingHints
(Map hints) Copies all of the mappings from the specified Map to the rendering hints of this node.void
setTransform
(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.
-
Field Details
-
VISIBLE_PAINTED
static final int VISIBLE_PAINTEDIndicates that this graphics node can be the target for events when it is visible and when the mouse is over the "painted" area.- See Also:
-
VISIBLE_FILL
static final int VISIBLE_FILLIndicates that this graphics node can be the target for events when it is visible and when the mouse is over the filled area if any.- See Also:
-
VISIBLE_STROKE
static final int VISIBLE_STROKEIndicates that this graphics node can be the target for events when it is visible and when the mouse is over the stroked area if any.- See Also:
-
VISIBLE
static final int VISIBLEIndicates that this graphics node can be the target for events when it is visible and whatever is the filled and stroked area.- See Also:
-
PAINTED
static final int PAINTEDIndicates that this graphics node can be the target for events when the mouse is over the painted area whatever or not it is the visible.- See Also:
-
FILL
static final int FILLIndicates that this graphics node can be the target for events when the mouse is over the filled area whatever or not it is the visible.- See Also:
-
STROKE
static final int STROKEIndicates that this graphics node can be the target for events when the mouse is over the stroked area whatever or not it is the visible.- See Also:
-
ALL
static final int ALLIndicates that this graphics node can be the target for events if any cases.- See Also:
-
NONE
static final int NONEIndicates that this graphics node can not be the target for events.- See Also:
-
IDENTITY
The identity affine transform matrix used to draw renderable images.
-
-
Method Details
-
getWeakReference
WeakReference getWeakReference()Returns a canonical WeakReference to this GraphicsNode. This is suitable for use as a key value in a hash map -
getPointerEventType
int getPointerEventType()Returns the type that describes how this graphics node reacts to events.- Returns:
- VISIBLE_PAINTED | VISIBLE_FILL | VISIBLE_STROKE | VISIBLE | PAINTED | FILL | STROKE | ALL | NONE
-
setPointerEventType
void setPointerEventType(int pointerEventType) Sets the type that describes how this graphics node reacts to events.- Parameters:
pointerEventType
- VISIBLE_PAINTED | VISIBLE_FILL | VISIBLE_STROKE | VISIBLE | PAINTED | FILL | STROKE | ALL | NONE
-
setTransform
Sets the transform of this node.- Parameters:
newTransform
- the new transform of this node
-
getTransform
AffineTransform getTransform()Returns the transform of this node or null if any. -
getInverseTransform
AffineTransform getInverseTransform()Returns the inverse transform for this node. -
getGlobalTransform
AffineTransform getGlobalTransform()Returns the concatenated transform of this node. That is, this node's transform preconcatenated with it's parent's transforms. -
setComposite
Sets the composite of this node.- Parameters:
newComposite
- the composite of this node
-
getComposite
Composite getComposite()Returns the composite of this node or null if any. -
setVisible
void setVisible(boolean isVisible) Sets if this node is visible or not depending on the specified value.- Parameters:
isVisible
- If true this node is visible
-
isVisible
boolean isVisible()Returns true if this node is visible, false otherwise. -
setClip
Sets the clipping filter of this node.- Parameters:
newClipper
- the new clipping filter of this node
-
getClip
ClipRable getClip()Returns the clipping filter of this node or null if any. -
setRenderingHint
Maps the specified key to the specified value in the rendering hints of this node.- Parameters:
key
- the key of the hint to be setvalue
- the value indicating preferences for the specified hint category.
-
setRenderingHints
Copies all of the mappings from the specified Map to the rendering hints of this node.- Parameters:
hints
- the rendering hints to be set
-
setRenderingHints
Sets the rendering hints of this node.- Parameters:
newHints
- the new rendering hints of this node
-
getRenderingHints
RenderingHints getRenderingHints()Returns the rendering hints of this node or null if any. -
setMask
Sets the mask of this node.- Parameters:
newMask
- the new mask of this node
-
getMask
Mask getMask()Returns the mask of this node or null if any. -
setFilter
Sets the filter of this node.- Parameters:
newFilter
- the new filter of this node
-
getFilter
Filter getFilter()Returns the filter of this node or null if any. -
getGraphicsNodeRable
Returns the GraphicsNodeRable for this node. This GraphicsNodeRable is the Renderable (Filter) before any of the filter operations have been applied. -
getEnableBackgroundGraphicsNodeRable
Returns the GraphicsNodeRable for this node. This GraphicsNodeRable is the Renderable (Filter) after all of the filter operations have been applied. -
paint
Paints this node.- Parameters:
g2d
- the Graphics2D to use
-
primitivePaint
Paints this node without applying Filter, Mask, Composite, and clip.- Parameters:
g2d
- the Graphics2D to use
-
getParent
CompositeGraphicsNode getParent()Returns the parent of this node or null if any. -
getRoot
RootGraphicsNode getRoot()Returns the root of the GVT tree or null if the node is not part of a GVT tree. -
getBounds
Rectangle2D getBounds()Returns the bounds of this node in user space. This includes primitive paint, filtering, clipping and masking. -
getTransformedBounds
Returns the bounds of this node after applying the input transform (if any), concatenated with this node's transform (if any).- Parameters:
txf
- the affine transform with which this node's transform should be concatenated. Should not be null.
-
getPrimitiveBounds
Rectangle2D getPrimitiveBounds()Returns the bounds of the area covered by this node's primitive paint. This is the painted region of fill and stroke but does not account for clipping, masking or filtering. -
getTransformedPrimitiveBounds
Returns the bounds of this node's primitivePaint after applying the input transform (if any), concatenated with this node's transform (if any).- Parameters:
txf
- the affine transform with which this node's transform should be concatenated. Should not be null.
-
getGeometryBounds
Rectangle2D getGeometryBounds()Returns the bounds of the area covered by this node, without taking any of its rendering attribute into account. That is, exclusive of any clipping, masking, filtering or stroking, for example. -
getTransformedGeometryBounds
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.- Parameters:
txf
- the affine transform with which this node's transform should be concatenated. Should not be null.
-
getSensitiveBounds
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. -
getTransformedSensitiveBounds
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.- Parameters:
txf
- the affine transform with which this node's transform should be concatenated. Should not be null.
-
contains
Returns true if the specified Point2D is inside the boundary of this node, false otherwise.- Parameters:
p
- the specified Point2D in the user space
-
intersects
Returns true if the interior of this node intersects the interior of a specified Rectangle2D, false otherwise.- Parameters:
r
- the specified Rectangle2D in the user node space
-
nodeHitAt
Returns the GraphicsNode containing point p if this node or one of its children is sensitive to mouse events at p.- Parameters:
p
- the specified Point2D in the user space
-
getOutline
Shape getOutline()Returns the outline of this node.
-