org.pentaho.reporting.engine.classic.core.modules.output.pageable.graphics.internal
Class LogicalPageDrawable

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.layout.process.IterateStructuralProcessStep
      extended by 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

Field Summary
static BasicStroke DEFAULT_STROKE
           
 
Constructor Summary
LogicalPageDrawable(LogicalPageBox rootBox, OutputProcessorMetaData metaData, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager)
           
 
Method Summary
 void draw(Graphics2D g2, Rectangle2D area)
          Draws the object.
 long getContentAreaX1()
           
 long getContentAreaX2()
           
 Graphics2D getGraphics()
           
 double getHeight()
           
 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.
 double getWidth()
           
 boolean isClipOnWordBoundary()
           
 boolean isDrawPageBackground()
           
 boolean isOutlineMode()
           
 boolean isPreserveAspectRatio()
          Returns true, if this drawable will preserve an aspect ratio during the drawing.
 boolean isTextLineOverflow()
           
 void setContentAreaX1(long contentAreaX1)
           
 void setContentAreaX2(long contentAreaX2)
           
 void setDrawPageBackground(boolean drawPageBackground)
           
 void setOutlineMode(boolean outlineMode)
           
 void setTextLineOverflow(boolean textLineOverflow)
           
 boolean startCanvasBox(CanvasRenderBox box)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_STROKE

public static final BasicStroke DEFAULT_STROKE
Constructor Detail

LogicalPageDrawable

public LogicalPageDrawable(LogicalPageBox rootBox,
                           OutputProcessorMetaData metaData,
                           org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager)
Method Detail

isClipOnWordBoundary

public boolean isClipOnWordBoundary()

isOutlineMode

public boolean isOutlineMode()

setOutlineMode

public void setOutlineMode(boolean outlineMode)

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 interface PageDrawable
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 interface PageDrawable
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 g2,
                 Rectangle2D area)
Draws the object.

Specified by:
draw in interface PageDrawable
Parameters:
g2 - the graphics device.
area - the area inside which the object should be drawn.

startCanvasBox

public boolean startCanvasBox(CanvasRenderBox box)

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)

getMetaData

public OutputProcessorMetaData getMetaData()

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 interface PageDrawable
Parameters:
x - the x coordinate
y - the y coordinate
namespace - the namespace on which to filter on
name - 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 interface PageDrawable
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.