Top Description Fields Constructors Methods
com.openhtmltopdf.render

public Class RenderingContext

extends Object
implements CssContext, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, com.openhtmltopdf.css.style.CssContext
Imports
java.awt.Rectangle, com.openhtmltopdf.bidi.BidiReorderer, .SimpleBidiReorderer, com.openhtmltopdf.context.StyleReference, com.openhtmltopdf.css.style.CalculatedStyle, .CssContext, com.openhtmltopdf.css.value.FontSpecification, com.openhtmltopdf.extend.*, com.openhtmltopdf.layout.Layer, .SharedContext

Supplies information about the context in which rendering will take place
Author
jmarinacci November 16, 2004

Field Summary

Modifier and TypeField and Description
private BidiReorderer
private boolean
private FontContext
private int
private boolean
private boolean
private OutputDevice
private PageBox
private int
private int
private Layer
private int
protected final SharedContext

Constructor Summary

AccessConstructor and Description
public
RenderingContext(SharedContext sharedContext)

needs a new instance every run

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public boolean
public boolean
public boolean
public boolean
public String
public BidiReorderer
public Box
public FSCanvas
public StyleReference
public int
public float
public Rectangle
getFixedRectangle(boolean excludeFloatBottomArea)

Get the document (for non-paged docs) or page rect where fixed position boxes should be layed out.

public FSFont
public FontContext
public FontResolver
public float
public FSFontMetrics
public int
public float
public OutputDevice
public PageBox
public int
public int
public Layer
public int

Returns:

overflow page number or -1 if this is not an overflow page.
getShadowPageNumber
()

public TextRenderer
public UserAgentCallback
public Rectangle
getViewportRectangle()

Get the viewport rect, for painting the body or html tag background.

public float
public boolean
public boolean
isInFloatBottom()

Implements com.openhtmltopdf.css.style.CssContext.isInFloatBottom.

Returns true if we are laying out the footnote area rather than general content.

public boolean
public boolean
public boolean

Returns:

The paged value
isPaged
()

Returns true if the currently set media type is paged.

public boolean
public void
public void
public void
setFastRenderer(boolean isFast)

public void
public void
setInitialPageNo(int initialPageNo)

public void
setInPageMargins(boolean inMargin)

public void
setIsInFloatBottom(boolean inFloatBottom)

See isInFloatBottom()

public void
public void
setPage(int pageNo, PageBox page)

public void
setPageCount(int pageCount)

public void
setRootLayer(Layer rootLayer)

public void
setShadowPageNumber(int shadow)

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_bidiback to summary
private BidiReorderer _bidi
_isInFloatBottomback to summary
private boolean _isInFloatBottom
fontContextback to summary
private FontContext fontContext
initialPageNoback to summary
private int initialPageNo
inPageMarginsback to summary
private boolean inPageMargins
isFastRendererback to summary
private boolean isFastRenderer
outputDeviceback to summary
private OutputDevice outputDevice
pageback to summary
private PageBox page
pageCountback to summary
private int pageCount
pageNoback to summary
private int pageNo
rootLayerback to summary
private Layer rootLayer
shadowPageNumberback to summary
private int shadowPageNumber
sharedContextback to summary
protected final SharedContext sharedContext

Constructor Detail

RenderingContextback to summary
public RenderingContext(SharedContext sharedContext)

needs a new instance every run

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:Object

a clone of this instance.

Annotations
@Override
debugDrawBoxesback to summary
public boolean debugDrawBoxes()
debugDrawFontMetricsback to summary
public boolean debugDrawFontMetrics()
debugDrawInlineBoxesback to summary
public boolean debugDrawInlineBoxes()
debugDrawLineBoxesback to summary
public boolean debugDrawLineBoxes()
getBaseURLback to summary
public String getBaseURL()
getBidiReordererback to summary
public BidiReorderer getBidiReorderer()
getBoxByIdback to summary
public Box getBoxById(String id)
getCanvasback to summary
public FSCanvas getCanvas()
getCssback to summary
public StyleReference getCss()

Implements com.openhtmltopdf.css.style.CssContext.getCss.

getDotsPerPixelback to summary
public int getDotsPerPixel()

Implements com.openhtmltopdf.css.style.CssContext.getDotsPerPixel.

getDPIback to summary
public float getDPI()
getFixedRectangleback to summary
public Rectangle getFixedRectangle(boolean excludeFloatBottomArea)

Get the document (for non-paged docs) or page rect where fixed position boxes should be layed out. Generally we want to set excludeFloatBottomArea true so fixed content doesn't sit above footnotes.

getFontback to summary
public FSFont getFont(FontSpecification font)

Implements com.openhtmltopdf.css.style.CssContext.getFont.

getFontContextback to summary
public FontContext getFontContext()

Implements com.openhtmltopdf.css.style.CssContext.getFontContext.

Annotations
@Override
getFontResolverback to summary
public FontResolver getFontResolver()
getFontSize2Dback to summary
public float getFontSize2D(FontSpecification font)

Implements com.openhtmltopdf.css.style.CssContext.getFontSize2D.

getFSFontMetricsback to summary
public FSFontMetrics getFSFontMetrics(FSFont font)

Implements com.openhtmltopdf.css.style.CssContext.getFSFontMetrics.

getInitialPageNoback to summary
public int getInitialPageNo()
getMmPerDotback to summary
public float getMmPerDot()

Implements com.openhtmltopdf.css.style.CssContext.getMmPerDot.

getOutputDeviceback to summary
public OutputDevice getOutputDevice()
getPageback to summary
public PageBox getPage()
getPageCountback to summary
public int getPageCount()
getPageNoback to summary
public int getPageNo()
getRootLayerback to summary
public Layer getRootLayer()
getShadowPageNumberback to summary
public int getShadowPageNumber()
Returns:int

overflow page number or -1 if this is not an overflow page.

getTextRendererback to summary
public TextRenderer getTextRenderer()

Implements com.openhtmltopdf.css.style.CssContext.getTextRenderer.

Annotations
@Override
getUacback to summary
public UserAgentCallback getUac()
getViewportRectangleback to summary
public Rectangle getViewportRectangle()

Get the viewport rect, for painting the body or html tag background.

getXHeightback to summary
public float getXHeight(FontSpecification parentFont)

Implements com.openhtmltopdf.css.style.CssContext.getXHeight.

isFastRendererback to summary
public boolean isFastRenderer()
isInFloatBottomback to summary
public boolean isInFloatBottom()

Implements com.openhtmltopdf.css.style.CssContext.isInFloatBottom.

Doc from com.openhtmltopdf.css.style.CssContext.isInFloatBottom.

Returns true if we are laying out the footnote area rather than general content.

isInPageMarginsback to summary
public boolean isInPageMargins()
isInteractiveback to summary
public boolean isInteractive()
isPagedback to summary
public boolean isPaged()

Returns true if the currently set media type is paged. Currently returns true only for print , projection , and embossed , handheld , and tv . See the media section of the CSS 2.1 spec for more information on media types.

Returns:boolean

The paged value

isPrintback to summary
public boolean isPrint()
setBaseURLback to summary
public void setBaseURL(String url)
setBidiReordererback to summary
public void setBidiReorderer(BidiReorderer bidi)
setFastRendererback to summary
public void setFastRenderer(boolean isFast)
setFontContextback to summary
public void setFontContext(FontContext fontContext)
setInitialPageNoback to summary
public void setInitialPageNo(int initialPageNo)
setInPageMarginsback to summary
public void setInPageMargins(boolean inMargin)
setIsInFloatBottomback to summary
public void setIsInFloatBottom(boolean inFloatBottom)

See isInFloatBottom()

setOutputDeviceback to summary
public void setOutputDevice(OutputDevice outputDevice)
setPageback to summary
public void setPage(int pageNo, PageBox page)
setPageCountback to summary
public void setPageCount(int pageCount)
setRootLayerback to summary
public void setRootLayer(Layer rootLayer)
setShadowPageNumberback to summary
public void setShadowPageNumber(int shadow)