Class LogicalPageDrawable
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.layout.process.IterateStructuralProcessStep
-
- org.pentaho.reporting.engine.classic.core.modules.output.pageable.graphics.internal.LogicalPageDrawable
-
- All Implemented Interfaces:
PageDrawable
- Direct Known Subclasses:
PdfLogicalPageDrawable
public class LogicalPageDrawable extends IterateStructuralProcessStep implements PageDrawable
The page drawable is the content provider for the Graphics2DOutputTarget. This component is responsible for rendering the current page to a Graphics2D object.- Author:
- Thomas Morgner
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
LogicalPageDrawable.TextSpec
-
Field Summary
Fields Modifier and Type Field Description static BasicStroke
DEFAULT_STROKE
-
Constructor Summary
Constructors Constructor Description LogicalPageDrawable()
LogicalPageDrawable(LogicalPageBox rootBox, OutputProcessorMetaData metaData, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearClipping()
void
clip(StrictBounds bounds)
protected void
configureGraphics(StyleSheet layoutContext, Graphics2D g2)
protected void
configureStroke(StyleSheet layoutContext, Graphics2D g2)
protected Rectangle2D
createClipRect(StrictBounds bounds)
void
draw(Graphics2D graphics, Rectangle2D area)
Draws the object.protected void
drawAnchor(RenderNode content)
To be overriden in the PDF drawable.protected void
drawBookmark(RenderNode box, String bookmark)
protected void
drawComplexText(RenderableComplexText renderableComplexText, Graphics2D g2)
protected boolean
drawDrawable(RenderableReplacedContentBox content, Graphics2D g2, org.pentaho.reporting.libraries.resourceloader.factory.drawable.DrawableWrapper d)
protected void
drawHyperlink(RenderNode box, String target, String window, String title)
protected boolean
drawImage(RenderableReplacedContentBox content, Image image)
protected void
drawOutlineBox(Graphics2D g2, RenderBox box)
protected void
drawReplacedContent(RenderableReplacedContentBox content)
protected void
drawText(RenderableText renderableText)
protected void
drawText(RenderableText renderableText, long contentX2)
Renders the glyphs stored in the text node.protected void
finishInlineBox(InlineRenderBox box)
protected void
finishTableBox(TableRenderBox box)
protected void
finishTableSectionBox(TableSectionRenderBox box)
protected Rectangle2D.Double
getBoxArea()
protected org.pentaho.reporting.libraries.fonts.encoding.CodePointBuffer
getCodePointBuffer()
long
getContentAreaX1()
long
getContentAreaX2()
protected StrictBounds
getDrawArea()
Graphics2D
getGraphics()
double
getHeight()
LogicalPageBox
getLogicalPageBox()
OutputProcessorMetaData
getMetaData()
RenderNode[]
getNodesAt(double x, double y, double width, double height, String namespace, String name)
Returns all layouted render-nodes that occupy the given area and which have the attribute specified by name and namespace set.RenderNode[]
getNodesAt(double x, double y, String namespace, String name)
Retries the nodes under the given coordinate which have a given attribute set.PageFormat
getPageFormat()
Describes the physical output characteristics like page size, margins, and imaginable area.Dimension
getPreferredSize()
Returns the preferred size of the drawable.protected org.pentaho.reporting.libraries.resourceloader.ResourceManager
getResourceManager()
protected LogicalPageBox
getRootBox()
protected LogicalPageDrawable.TextSpec
getTextSpec()
double
getWidth()
void
init(LogicalPageBox rootBox, OutputProcessorMetaData metaData, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager)
boolean
isClipOnWordBoundary()
boolean
isDrawPageBackground()
protected boolean
isIgnoreBorderWhenDrawingOutline()
protected boolean
isNormalTextSpacing(RenderableText text)
boolean
isOutlineMode()
boolean
isPreserveAspectRatio()
Returns true, if this drawable will preserve an aspect ratio during the drawing.boolean
isTextLineOverflow()
protected void
processLinksAndAnchors(RenderNode box)
protected void
processOtherNode(RenderNode node)
protected void
processParagraphChilds(ParagraphRenderBox box)
protected void
processRenderableContent(RenderableReplacedContentBox box)
protected void
processRootBand(StrictBounds pageBounds)
protected void
processTextLine(RenderBox lineBox, long contentAreaX1, long contentAreaX2)
protected void
renderBoxBorderAndBackground(RenderBox box)
void
setContentAreaX1(long contentAreaX1)
void
setContentAreaX2(long contentAreaX2)
protected void
setDrawArea(StrictBounds drawArea)
void
setDrawPageBackground(boolean drawPageBackground)
void
setOutlineMode(boolean outlineMode)
void
setTextLineOverflow(boolean textLineOverflow)
protected void
setTextSpec(LogicalPageDrawable.TextSpec textSpec)
protected boolean
startAutoBox(RenderBox box)
protected boolean
startBlockBox(BlockRenderBox box)
protected boolean
startBox(RenderBox box)
boolean
startCanvasBox(CanvasRenderBox box)
protected boolean
startInlineBox(InlineRenderBox box)
protected boolean
startRowBox(RenderBox box)
protected boolean
startTableBox(TableRenderBox box)
protected boolean
startTableCellBox(TableCellRenderBox box)
protected boolean
startTableColumnGroupBox(TableColumnGroupNode box)
protected boolean
startTableRowBox(TableRowRenderBox box)
protected boolean
startTableSectionBox(TableSectionRenderBox box)
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.layout.process.IterateStructuralProcessStep
finishAutoBox, finishBlockBox, finishCanvasBox, finishOtherBox, finishRowBox, finishTableCellBox, finishTableColumnGroupBox, finishTableRowBox, processBoxChilds, processTableColumn, startOtherBox, startProcessing
-
-
-
-
Field Detail
-
DEFAULT_STROKE
public static final BasicStroke DEFAULT_STROKE
-
-
Constructor Detail
-
LogicalPageDrawable
public LogicalPageDrawable()
-
LogicalPageDrawable
@Deprecated public LogicalPageDrawable(LogicalPageBox rootBox, OutputProcessorMetaData metaData, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager)
Deprecated.
-
-
Method Detail
-
init
public void init(LogicalPageBox rootBox, OutputProcessorMetaData metaData, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager)
-
getLogicalPageBox
public LogicalPageBox getLogicalPageBox()
-
getResourceManager
protected org.pentaho.reporting.libraries.resourceloader.ResourceManager getResourceManager()
-
isClipOnWordBoundary
public boolean isClipOnWordBoundary()
-
isOutlineMode
public boolean isOutlineMode()
-
setOutlineMode
public void setOutlineMode(boolean outlineMode)
-
getDrawArea
protected StrictBounds getDrawArea()
-
getPageFormat
public PageFormat getPageFormat()
Description copied from interface:PageDrawable
Describes the physical output characteristics like page size, margins, and imaginable area.- Specified by:
getPageFormat
in interfacePageDrawable
- Returns:
- a pageformat describing the current page including size and margins.
-
getPreferredSize
public Dimension getPreferredSize()
Returns the preferred size of the drawable. If the drawable is aspect ratio aware, these bounds should be used to compute the preferred aspect ratio for this drawable.- Specified by:
getPreferredSize
in interfacePageDrawable
- Returns:
- the preferred size.
-
getHeight
public double getHeight()
-
getWidth
public double getWidth()
-
isPreserveAspectRatio
public boolean isPreserveAspectRatio()
Returns true, if this drawable will preserve an aspect ratio during the drawing.- Returns:
- true, if an aspect ratio is preserved, false otherwise.
-
isDrawPageBackground
public boolean isDrawPageBackground()
-
setDrawPageBackground
public void setDrawPageBackground(boolean drawPageBackground)
-
draw
public void draw(Graphics2D graphics, Rectangle2D area)
Draws the object.- Specified by:
draw
in interfacePageDrawable
- Parameters:
graphics
- the graphics device.area
- the area inside which the object should be drawn.
-
processRootBand
protected void processRootBand(StrictBounds pageBounds)
-
createClipRect
protected Rectangle2D createClipRect(StrictBounds bounds)
-
getRootBox
protected LogicalPageBox getRootBox()
-
setDrawArea
protected void setDrawArea(StrictBounds drawArea)
-
drawOutlineBox
protected void drawOutlineBox(Graphics2D g2, RenderBox box)
-
processLinksAndAnchors
protected void processLinksAndAnchors(RenderNode box)
-
drawBookmark
protected void drawBookmark(RenderNode box, String bookmark)
-
drawHyperlink
protected void drawHyperlink(RenderNode box, String target, String window, String title)
-
startCanvasBox
public boolean startCanvasBox(CanvasRenderBox box)
- Overrides:
startCanvasBox
in classIterateStructuralProcessStep
-
startBlockBox
protected boolean startBlockBox(BlockRenderBox box)
- Overrides:
startBlockBox
in classIterateStructuralProcessStep
-
startRowBox
protected boolean startRowBox(RenderBox box)
- Overrides:
startRowBox
in classIterateStructuralProcessStep
-
startTableCellBox
protected boolean startTableCellBox(TableCellRenderBox box)
- Overrides:
startTableCellBox
in classIterateStructuralProcessStep
-
startBox
protected boolean startBox(RenderBox box)
-
startTableRowBox
protected boolean startTableRowBox(TableRowRenderBox box)
- Overrides:
startTableRowBox
in classIterateStructuralProcessStep
-
startTableSectionBox
protected boolean startTableSectionBox(TableSectionRenderBox box)
- Overrides:
startTableSectionBox
in classIterateStructuralProcessStep
-
finishTableSectionBox
protected void finishTableSectionBox(TableSectionRenderBox box)
- Overrides:
finishTableSectionBox
in classIterateStructuralProcessStep
-
startTableBox
protected boolean startTableBox(TableRenderBox box)
- Overrides:
startTableBox
in classIterateStructuralProcessStep
-
finishTableBox
protected void finishTableBox(TableRenderBox box)
- Overrides:
finishTableBox
in classIterateStructuralProcessStep
-
startTableColumnGroupBox
protected boolean startTableColumnGroupBox(TableColumnGroupNode box)
- Overrides:
startTableColumnGroupBox
in classIterateStructuralProcessStep
-
startAutoBox
protected boolean startAutoBox(RenderBox box)
- Overrides:
startAutoBox
in classIterateStructuralProcessStep
-
startInlineBox
protected boolean startInlineBox(InlineRenderBox box)
- Overrides:
startInlineBox
in classIterateStructuralProcessStep
-
isIgnoreBorderWhenDrawingOutline
protected boolean isIgnoreBorderWhenDrawingOutline()
-
renderBoxBorderAndBackground
protected void renderBoxBorderAndBackground(RenderBox box)
-
getBoxArea
protected Rectangle2D.Double getBoxArea()
-
getTextSpec
protected LogicalPageDrawable.TextSpec getTextSpec()
-
setTextSpec
protected void setTextSpec(LogicalPageDrawable.TextSpec textSpec)
-
finishInlineBox
protected void finishInlineBox(InlineRenderBox box)
- Overrides:
finishInlineBox
in classIterateStructuralProcessStep
-
processParagraphChilds
protected void processParagraphChilds(ParagraphRenderBox box)
- Overrides:
processParagraphChilds
in classIterateStructuralProcessStep
-
processTextLine
protected void processTextLine(RenderBox lineBox, long contentAreaX1, long contentAreaX2)
-
getContentAreaX2
public long getContentAreaX2()
-
setContentAreaX2
public void setContentAreaX2(long contentAreaX2)
-
getContentAreaX1
public long getContentAreaX1()
-
setContentAreaX1
public void setContentAreaX1(long contentAreaX1)
-
isTextLineOverflow
public boolean isTextLineOverflow()
-
setTextLineOverflow
public void setTextLineOverflow(boolean textLineOverflow)
-
processOtherNode
protected void processOtherNode(RenderNode node)
- Overrides:
processOtherNode
in classIterateStructuralProcessStep
-
processRenderableContent
protected void processRenderableContent(RenderableReplacedContentBox box)
- Overrides:
processRenderableContent
in classIterateStructuralProcessStep
-
drawReplacedContent
protected void drawReplacedContent(RenderableReplacedContentBox content)
-
drawAnchor
protected void drawAnchor(RenderNode content)
To be overriden in the PDF drawable.- Parameters:
content
- the render-node that defines the anchor.
-
drawImage
protected boolean drawImage(RenderableReplacedContentBox content, Image image)
- Parameters:
content
-image
-
-
drawDrawable
protected boolean drawDrawable(RenderableReplacedContentBox content, Graphics2D g2, org.pentaho.reporting.libraries.resourceloader.factory.drawable.DrawableWrapper d)
-
drawText
protected void drawText(RenderableText renderableText)
-
drawText
protected void drawText(RenderableText renderableText, long contentX2)
Renders the glyphs stored in the text node.- Parameters:
renderableText
- the text node that should be rendered.contentX2
-
-
drawComplexText
protected void drawComplexText(RenderableComplexText renderableComplexText, Graphics2D g2)
-
getCodePointBuffer
protected final org.pentaho.reporting.libraries.fonts.encoding.CodePointBuffer getCodePointBuffer()
-
isNormalTextSpacing
protected boolean isNormalTextSpacing(RenderableText text)
-
configureStroke
protected void configureStroke(StyleSheet layoutContext, Graphics2D g2)
-
configureGraphics
protected void configureGraphics(StyleSheet layoutContext, Graphics2D g2)
-
getMetaData
public OutputProcessorMetaData getMetaData()
-
clip
public void clip(StrictBounds bounds)
-
clearClipping
public void clearClipping()
-
getGraphics
public Graphics2D getGraphics()
-
getNodesAt
public RenderNode[] getNodesAt(double x, double y, String namespace, String name)
Retries the nodes under the given coordinate which have a given attribute set. If name and namespace are null, all nodes are returned. The nodes returned are listed in their respective hierarchical order.- Specified by:
getNodesAt
in interfacePageDrawable
- Parameters:
x
- the x coordinatey
- the y coordinatenamespace
- the namespace on which to filter onname
- the name on which to filter on- Returns:
- the ordered list of nodes.
-
getNodesAt
public RenderNode[] getNodesAt(double x, double y, double width, double height, String namespace, String name)
Description copied from interface:PageDrawable
Returns all layouted render-nodes that occupy the given area and which have the attribute specified by name and namespace set. If name and namespace are null, all elements are returned. All units are given in the same coordinate system used for rendering via the "draw" method.- Specified by:
getNodesAt
in interfacePageDrawable
- Parameters:
x
- the x coordinate of the origin of the area.y
- the y coordinate of the origin of the area.width
- the height of the area.height
- the width of the area.namespace
- the attribute's namespace.name
- the attribute's name.- Returns:
- the nodes for the given point, or an empty array, but never null.
-
-