|
fop 1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.fop.render.intermediate.AbstractIFPainter
public abstract class AbstractIFPainter
Abstract base class for IFPainter implementations.
| Field Summary | |
|---|---|
protected static java.lang.String |
INSTREAM_OBJECT_URI
non-URI that can be used in feedback messages that an image is an instream-object |
protected IFState |
state
Holds the intermediate format state |
| Constructor Summary | |
|---|---|
AbstractIFPainter()
Default constructor. |
|
| Method Summary | |
|---|---|
protected java.util.Map |
createDefaultImageProcessingHints(org.apache.xmlgraphics.image.loader.ImageSessionContext sessionContext)
Creates the default map of processing hints for the image loading framework. |
protected abstract RenderingContext |
createRenderingContext()
Creates a new RenderingContext instance. |
void |
drawBorderRect(java.awt.Rectangle rect,
BorderProps top,
BorderProps bottom,
BorderProps left,
BorderProps right)
Draws a border rectangle. |
protected void |
drawImage(org.apache.xmlgraphics.image.loader.Image image,
java.awt.Rectangle rect,
RenderingContext context)
Draws an image using a suitable image handler. |
protected void |
drawImage(org.apache.xmlgraphics.image.loader.Image image,
java.awt.Rectangle rect,
RenderingContext context,
boolean convert,
java.util.Map additionalHints)
Draws an image using a suitable image handler. |
protected void |
drawImageUsingDocument(org.w3c.dom.Document doc,
java.awt.Rectangle rect)
Default drawing method for handling a foreign object in the form of a DOM document. |
protected void |
drawImageUsingImageHandler(org.apache.xmlgraphics.image.loader.ImageInfo info,
java.awt.Rectangle rect)
Loads a preloaded image and draws it using a suitable image handler. |
protected void |
drawImageUsingURI(java.lang.String uri,
java.awt.Rectangle rect)
Default drawing method for handling an image referenced by a URI. |
void |
drawLine(java.awt.Point start,
java.awt.Point end,
int width,
java.awt.Color color,
RuleStyle style)
Draws a line. |
protected abstract IFContext |
getContext()
Returns the intermediate format context object. |
protected FopFactory |
getFopFactory()
Returns the FOP factory. |
protected org.apache.xmlgraphics.image.loader.ImageInfo |
getImageInfo(java.lang.String uri)
Returns an ImageInfo instance for the given URI. |
protected java.awt.Rectangle |
getLineBoundingBox(java.awt.Point start,
java.awt.Point end,
int width)
Calculates the bounding box for a line. |
protected FOUserAgent |
getUserAgent()
Returns the user agent. |
protected boolean |
hasOnlySolidBorders(BorderProps top,
BorderProps bottom,
BorderProps left,
BorderProps right)
Indicates whether the given border segments (if present) have only solid borders, i.e. |
void |
setFont(java.lang.String family,
java.lang.String style,
java.lang.Integer weight,
java.lang.String variant,
java.lang.Integer size,
java.awt.Color color)
Updates the current font. |
void |
startGroup(java.awt.geom.AffineTransform[] transforms)
Starts a new group of graphical elements. |
void |
startViewport(java.awt.geom.AffineTransform[] transforms,
java.awt.Dimension size,
java.awt.Rectangle clipRect)
Starts a new viewport, establishing a new coordinate system. |
static java.awt.geom.AffineTransform |
toPoints(java.awt.geom.AffineTransform transform)
Converts a transformation matrix from millipoints to points. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.fop.render.intermediate.IFPainter |
|---|
clipRect, drawImage, drawImage, drawText, endGroup, endViewport, fillRect, startGroup, startViewport |
| Field Detail |
|---|
protected static final java.lang.String INSTREAM_OBJECT_URI
protected IFState state
| Constructor Detail |
|---|
public AbstractIFPainter()
| Method Detail |
|---|
protected abstract IFContext getContext()
protected FOUserAgent getUserAgent()
protected FopFactory getFopFactory()
public void startViewport(java.awt.geom.AffineTransform[] transforms,
java.awt.Dimension size,
java.awt.Rectangle clipRect)
throws IFException
startViewport in interface IFPaintertransforms - a series of transformation matrices establishing the new coordinate systemsize - the size of the viewportclipRect - the clipping rectangle (may be null)
IFException - if an error occurs while handling this element
public void startGroup(java.awt.geom.AffineTransform[] transforms)
throws IFException
startGroup in interface IFPaintertransforms - a series of transformation matrices establishing the new coordinate system
IFException - if an error occurs while handling this elementprotected abstract RenderingContext createRenderingContext()
protected void drawImageUsingImageHandler(org.apache.xmlgraphics.image.loader.ImageInfo info,
java.awt.Rectangle rect)
throws org.apache.xmlgraphics.image.loader.ImageException,
java.io.IOException
info - the information object of the preloaded imagerect - the rectangle in which to paint the image
org.apache.xmlgraphics.image.loader.ImageException - if there's an error while processing the image
java.io.IOException - if there's an I/O error while loading the imageprotected java.util.Map createDefaultImageProcessingHints(org.apache.xmlgraphics.image.loader.ImageSessionContext sessionContext)
sessionContext - the session context for access to resolution information
protected void drawImage(org.apache.xmlgraphics.image.loader.Image image,
java.awt.Rectangle rect,
RenderingContext context)
throws java.io.IOException,
org.apache.xmlgraphics.image.loader.ImageException
image - the image to be painted (it needs to of a supported image flavor)rect - the rectangle in which to paint the imagecontext - a suitable rendering context
java.io.IOException - in case of an I/O error while handling/writing the image
org.apache.xmlgraphics.image.loader.ImageException - if an error occurs while converting the image to a suitable format
protected void drawImage(org.apache.xmlgraphics.image.loader.Image image,
java.awt.Rectangle rect,
RenderingContext context,
boolean convert,
java.util.Map additionalHints)
throws java.io.IOException,
org.apache.xmlgraphics.image.loader.ImageException
image - the image to be painted (it needs to of a supported image flavor)rect - the rectangle in which to paint the imagecontext - a suitable rendering contextconvert - true to run the image through image conversion if that is necessaryadditionalHints - additional image processing hints
java.io.IOException - in case of an I/O error while handling/writing the image
org.apache.xmlgraphics.image.loader.ImageException - if an error occurs while converting the image to a suitable formatprotected org.apache.xmlgraphics.image.loader.ImageInfo getImageInfo(java.lang.String uri)
uri - the URI identifying the image
protected void drawImageUsingURI(java.lang.String uri,
java.awt.Rectangle rect)
uri - the image's URIrect - the rectangle in which to paint the image
protected void drawImageUsingDocument(org.w3c.dom.Document doc,
java.awt.Rectangle rect)
doc - the DOM document containing the foreign objectrect - the rectangle in which to paint the image
public void drawBorderRect(java.awt.Rectangle rect,
BorderProps top,
BorderProps bottom,
BorderProps left,
BorderProps right)
throws IFException
BorderProps
instances.
drawBorderRect in interface IFPainterrect - the rectangle's coordinates and extenttop - the border segment on the top edgebottom - the border segment on the bottom edgeleft - the border segment on the left edgeright - the border segment on the right edge
IFException - if an error occurs while handling this event
protected boolean hasOnlySolidBorders(BorderProps top,
BorderProps bottom,
BorderProps left,
BorderProps right)
top - the border segment on the top edgebottom - the border segment on the bottom edgeleft - the border segment on the left edgeright - the border segment on the right edge
public void drawLine(java.awt.Point start,
java.awt.Point end,
int width,
java.awt.Color color,
RuleStyle style)
throws IFException
drawLine in interface IFPainterstart - the start point of the lineend - the end point of the linewidth - the line widthcolor - the line colorstyle - the line style (using the Constants.EN_* constants for the rule-style property)
IFException - if an error occurs while handling this event
protected java.awt.Rectangle getLineBoundingBox(java.awt.Point start,
java.awt.Point end,
int width)
start - the starting point of the line (coordinates in mpt)end - the ending point of the line (coordinates in mpt)width - the line width (in mpt)
public void setFont(java.lang.String family,
java.lang.String style,
java.lang.Integer weight,
java.lang.String variant,
java.lang.Integer size,
java.awt.Color color)
throws IFException
setFont in interface IFPainterfamily - the font family (or null if there's no change)style - the font style (or null if there's no change)weight - the font weight (or null if there's no change)variant - the font variant (or null if there's no change)size - the font size (or null if there's no change)color - the text color (or null if there's no change)
IFException - if an error occurs while handling this eventpublic static java.awt.geom.AffineTransform toPoints(java.awt.geom.AffineTransform transform)
transform - the transformation matrix (in millipoints)
|
fop 1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||