public abstract class AbstractGraphicsNode extends Object implements GraphicsNode
GraphicsNode
interface.Modifier and Type | Field and Description |
---|---|
protected GraphicsNodeChangeEvent |
changeCompletedEvent |
protected GraphicsNodeChangeEvent |
changeStartedEvent |
protected ClipRable |
clip
The clipping filter for this graphics node.
|
protected Composite |
composite
The compositing operation to be used when a graphics node is
painted on top of another one.
|
protected WeakReference |
enableBackgroundGraphicsNodeRable
The GraphicsNodeRable for this node with all filtering applied
|
protected Filter |
filter
The filter of this graphics node.
|
protected WeakReference |
graphicsNodeRable
The GraphicsNodeRable for this node.
|
protected RenderingHints |
hints
The rendering hints that control the quality to use when rendering
this graphics node.
|
protected 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 EventListenerList |
listeners
The listeners list.
|
protected 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 AffineTransform |
transform
The transform of this graphics node.
|
protected WeakReference |
weakRef
A Weak Reference to this.
|
ALL, FILL, IDENTITY, NONE, PAINTED, STROKE, VISIBLE, VISIBLE_FILL, VISIBLE_PAINTED, VISIBLE_STROKE
Modifier | Constructor and Description |
---|---|
protected |
AbstractGraphicsNode()
Constructs a new graphics node.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(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(GraphicsNodeChangeEvent changeStartedEvent) |
Rectangle2D |
getBounds()
Returns the bounds of this node in user space.
|
ClipRable |
getClip()
Returns the clipping filter of this node or null if any.
|
Composite |
getComposite()
Returns the composite of this node or null if any.
|
Filter |
getEnableBackgroundGraphicsNodeRable(boolean createIfNeeded)
Returns the GraphicsNodeRable for this node.
|
Filter |
getFilter()
Returns the filter of this node or null if any.
|
AffineTransform |
getGlobalTransform()
Returns the concatenated transform of this node.
|
Filter |
getGraphicsNodeRable(boolean createIfNeeded)
Returns the GraphicsNodeRable for this node.
|
AffineTransform |
getInverseTransform()
Returns the inverse transform for this node.
|
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.
|
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.
|
AffineTransform |
getTransform()
Returns the transform of this node or null if any.
|
Rectangle2D |
getTransformedBounds(AffineTransform txf)
Returns the bounds of this node after applying the input transform
(if any), concatenated with this node's transform (if any).
|
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.
|
WeakReference |
getWeakReference()
Returns a canonical WeakReference to this GraphicsNode.
|
boolean |
intersects(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(AffineTransform usr2dev,
RenderingHints hints,
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(Point2D p)
Returns the GraphicsNode containing point p if this node or one of its
children is sensitive to mouse events at p.
|
protected Rectangle2D |
normalizeRectangle(Rectangle2D bounds)
This method makes sure that neither the width nor height of the
rectangle is zero.
|
void |
paint(Graphics2D g2d)
Paints this node.
|
void |
setClip(ClipRable newClipper)
Sets the clipping filter of this node.
|
void |
setComposite(Composite newComposite)
Sets the composite of this node.
|
void |
setFilter(Filter newFilter)
Sets the filter of this node.
|
void |
setMask(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(RenderingHints.Key key,
Object value)
Maps the specified key to the specified value in 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 |
setRenderingHints(RenderingHints newHints)
Sets the rendering hints of this node.
|
protected void |
setRoot(RootGraphicsNode newRoot)
Sets the root node of this graphics 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getGeometryBounds, getOutline, getPrimitiveBounds, getSensitiveBounds, primitivePaint
protected EventListenerList listeners
protected AffineTransform transform
protected AffineTransform inverseTransform
protected Composite composite
protected boolean isVisible
protected ClipRable clip
protected RenderingHints hints
protected CompositeGraphicsNode parent
protected RootGraphicsNode root
protected Mask mask
protected Filter filter
protected int pointerEventType
protected WeakReference graphicsNodeRable
protected WeakReference enableBackgroundGraphicsNodeRable
protected WeakReference weakRef
protected GraphicsNodeChangeEvent changeStartedEvent
protected GraphicsNodeChangeEvent changeCompletedEvent
protected AbstractGraphicsNode()
public WeakReference getWeakReference()
getWeakReference
in interface GraphicsNode
public int getPointerEventType()
getPointerEventType
in interface GraphicsNode
public void setPointerEventType(int pointerEventType)
setPointerEventType
in interface GraphicsNode
pointerEventType
- VISIBLE_PAINTED | VISIBLE_FILL | VISIBLE_STROKE |
VISIBLE | PAINTED | FILL | STROKE | ALL | NONEpublic void setTransform(AffineTransform newTransform)
setTransform
in interface GraphicsNode
newTransform
- the new transform of this nodepublic AffineTransform getTransform()
getTransform
in interface GraphicsNode
public AffineTransform getInverseTransform()
getInverseTransform
in interface GraphicsNode
public AffineTransform getGlobalTransform()
getGlobalTransform
in interface GraphicsNode
public void setComposite(Composite newComposite)
setComposite
in interface GraphicsNode
newComposite
- the composite of this nodepublic Composite getComposite()
getComposite
in interface GraphicsNode
public void setVisible(boolean isVisible)
setVisible
in interface GraphicsNode
isVisible
- If true this node is visiblepublic boolean isVisible()
isVisible
in interface GraphicsNode
public void setClip(ClipRable newClipper)
GraphicsNode
setClip
in interface GraphicsNode
newClipper
- the new clipping filter of this nodepublic ClipRable getClip()
getClip
in interface GraphicsNode
public void setRenderingHint(RenderingHints.Key key, Object value)
setRenderingHint
in interface GraphicsNode
key
- the key of the hint to be setvalue
- the value indicating preferences for the specified
hint category.public void setRenderingHints(Map hints)
setRenderingHints
in interface GraphicsNode
hints
- the rendering hints to be setpublic void setRenderingHints(RenderingHints newHints)
setRenderingHints
in interface GraphicsNode
newHints
- the new rendering hints of this nodepublic RenderingHints getRenderingHints()
getRenderingHints
in interface GraphicsNode
public void setMask(Mask newMask)
setMask
in interface GraphicsNode
newMask
- the new mask of this nodepublic Mask getMask()
getMask
in interface GraphicsNode
public void setFilter(Filter newFilter)
setFilter
in interface GraphicsNode
newFilter
- the new filter of this nodepublic Filter getFilter()
getFilter
in interface GraphicsNode
public Filter getGraphicsNodeRable(boolean createIfNeeded)
getGraphicsNodeRable
in interface GraphicsNode
public Filter getEnableBackgroundGraphicsNodeRable(boolean createIfNeeded)
getEnableBackgroundGraphicsNodeRable
in interface GraphicsNode
public void paint(Graphics2D g2d)
paint
in interface GraphicsNode
g2d
- the Graphics2D to useprotected boolean isOffscreenBufferNeeded()
protected boolean isAntialiasedClip(AffineTransform usr2dev, RenderingHints hints, Shape clip)
public void fireGraphicsNodeChangeStarted(GraphicsNode changeSrc)
public void fireGraphicsNodeChangeStarted()
public void fireGraphicsNodeChangeStarted(GraphicsNodeChangeEvent changeStartedEvent)
public void fireGraphicsNodeChangeCompleted()
public CompositeGraphicsNode getParent()
getParent
in interface GraphicsNode
public RootGraphicsNode getRoot()
getRoot
in interface GraphicsNode
protected void setRoot(RootGraphicsNode newRoot)
newRoot
- the new root node of this nodeprotected void setParent(CompositeGraphicsNode newParent)
newParent
- the new parent node of this nodeprotected void invalidateGeometryCache()
public Rectangle2D getBounds()
getBounds
in interface GraphicsNode
public Rectangle2D getTransformedBounds(AffineTransform txf)
getTransformedBounds
in interface GraphicsNode
txf
- the affine transform with which this node's transform should
be concatenated. Should not be null.public Rectangle2D getTransformedPrimitiveBounds(AffineTransform txf)
getTransformedPrimitiveBounds
in interface GraphicsNode
txf
- the affine transform with which this node's transform should
be concatenated. Should not be null.public Rectangle2D getTransformedGeometryBounds(AffineTransform txf)
getTransformedGeometryBounds
in interface GraphicsNode
txf
- the affine transform with which this node's transform should
be concatenated. Should not be null.public Rectangle2D getTransformedSensitiveBounds(AffineTransform txf)
getTransformedSensitiveBounds
in interface GraphicsNode
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
p
- the specified Point2D in the user spacepublic boolean intersects(Rectangle2D r)
intersects
in interface GraphicsNode
r
- the specified Rectangle2D in the user node spacepublic GraphicsNode nodeHitAt(Point2D p)
nodeHitAt
in interface GraphicsNode
p
- the specified Point2D in the user spaceprotected Rectangle2D normalizeRectangle(Rectangle2D bounds)
Copyright © 2000–2023 Apache Software Foundation. All rights reserved.