org.apache.batik.gvt
Class GraphicsNodeRenderContext

java.lang.Object
  |
  +--java.awt.image.renderable.RenderContext
        |
        +--org.apache.batik.gvt.GraphicsNodeRenderContext
All Implemented Interfaces:
java.lang.Cloneable

public class GraphicsNodeRenderContext
extends java.awt.image.renderable.RenderContext

This class captures the rendering context. It is typically created by a GVT Renderer


Field Summary
static java.awt.RenderingHints.Key KEY_FONT_RENDER_CONTEXT
          Key for the FontRenderContext hint
static java.awt.RenderingHints.Key KEY_GRAPHICS_NODE_RABLE_FACTORY
          Key for the GraphicsNodeRableFactory hint
static java.awt.RenderingHints.Key KEY_TEXT_PAINTER
          Key for the TextPainter hint
 
Constructor Summary
GraphicsNodeRenderContext(java.awt.geom.AffineTransform transform, java.awt.Shape aoi, java.awt.RenderingHints hints, java.awt.font.FontRenderContext frc, TextPainter textPainter, GraphicsNodeRableFactory gnrFactory)
           
GraphicsNodeRenderContext(java.awt.image.renderable.RenderContext ctx)
           
 
Method Summary
 java.awt.font.FontRenderContext getFontRenderContext()
          Returns the context needed to correctly measure text.
 GraphicsNodeRableFactory getGraphicsNodeRableFactory()
          Returns the factory that can be used to build GraphicsNodeRable instances.
static GraphicsNodeRenderContext getGraphicsNodeRenderContext(java.awt.Graphics2D g2d)
          Given a Graphics2D, this convenience method will build a GraphicsNodeRenderContext
static GraphicsNodeRenderContext getGraphicsNodeRenderContext(java.awt.image.renderable.RenderContext ctx)
          Given a RenderContext, this convenience method will build a GraphicsNodeRenderContext
 TextPainter getTextPainter()
          Returns a text painter object that can be used to render TextNode.
 void setFontRenderContext(java.awt.font.FontRenderContext frc)
          Sets the context needed to correctly measure text metrics
 void setGraphicsNodeRableFactory(GraphicsNodeRableFactory factory)
          Sets the factory to use to build GraphicsNodeRable instances
 void setTextPainter(TextPainter textPainter)
          Sets the text painter object which can be used by GraphicsNode to render text, for example in a TextNode
 
Methods inherited from class java.awt.image.renderable.RenderContext
clone, concatenateTransform, concetenateTransform, getAreaOfInterest, getRenderingHints, getTransform, preConcatenateTransform, preConcetenateTransform, setAreaOfInterest, setRenderingHints, setTransform
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_FONT_RENDER_CONTEXT

public static java.awt.RenderingHints.Key KEY_FONT_RENDER_CONTEXT
Key for the FontRenderContext hint

KEY_TEXT_PAINTER

public static java.awt.RenderingHints.Key KEY_TEXT_PAINTER
Key for the TextPainter hint

KEY_GRAPHICS_NODE_RABLE_FACTORY

public static java.awt.RenderingHints.Key KEY_GRAPHICS_NODE_RABLE_FACTORY
Key for the GraphicsNodeRableFactory hint
Constructor Detail

GraphicsNodeRenderContext

public GraphicsNodeRenderContext(java.awt.image.renderable.RenderContext ctx)
Parameters:
ctx - the RenderContext to use as a base for constructing this instance.

GraphicsNodeRenderContext

public GraphicsNodeRenderContext(java.awt.geom.AffineTransform transform,
                                 java.awt.Shape aoi,
                                 java.awt.RenderingHints hints,
                                 java.awt.font.FontRenderContext frc,
                                 TextPainter textPainter,
                                 GraphicsNodeRableFactory gnrFactory)
Parameters:
transform - user space to device space transform
aoi - area of interest
hints - hints
Method Detail

getFontRenderContext

public java.awt.font.FontRenderContext getFontRenderContext()
Returns the context needed to correctly measure text.

setFontRenderContext

public void setFontRenderContext(java.awt.font.FontRenderContext frc)
Sets the context needed to correctly measure text metrics

getTextPainter

public TextPainter getTextPainter()
Returns a text painter object that can be used to render TextNode.

setTextPainter

public void setTextPainter(TextPainter textPainter)
Sets the text painter object which can be used by GraphicsNode to render text, for example in a TextNode

getGraphicsNodeRableFactory

public GraphicsNodeRableFactory getGraphicsNodeRableFactory()
Returns the factory that can be used to build GraphicsNodeRable instances.

setGraphicsNodeRableFactory

public void setGraphicsNodeRableFactory(GraphicsNodeRableFactory factory)
Sets the factory to use to build GraphicsNodeRable instances

getGraphicsNodeRenderContext

public static GraphicsNodeRenderContext getGraphicsNodeRenderContext(java.awt.image.renderable.RenderContext ctx)
Given a RenderContext, this convenience method will build a GraphicsNodeRenderContext

getGraphicsNodeRenderContext

public static GraphicsNodeRenderContext getGraphicsNodeRenderContext(java.awt.Graphics2D g2d)
Given a Graphics2D, this convenience method will build a GraphicsNodeRenderContext


Copyright © 2000 Apache Software Foundation. All Rights Reserved.