Package com.openhtmltopdf.render
Class AbstractOutputDevice
- java.lang.Object
-
- com.openhtmltopdf.render.AbstractOutputDevice
-
- All Implemented Interfaces:
OutputDevice
- Direct Known Subclasses:
Java2DOutputDevice
,PdfBoxFastOutputDevice
,PdfBoxSlowOutputDevice
public abstract class AbstractOutputDevice extends java.lang.Object implements OutputDevice
An abstract implementation of anOutputDevice
. It provides complete implementations for manyOutputDevice
methods.
-
-
Field Summary
Fields Modifier and Type Field Description private FontSpecification
_fontSpec
-
Constructor Summary
Constructors Constructor Description AbstractOutputDevice()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private int
adjustTo(int target, int current, int imageDim)
private int
calcBackgroundSizeLength(CssContext c, CalculatedStyle style, PropertyValue value, float boundsDim)
private java.awt.Dimension
calcInitialXYOff(CalculatedStyle.BackgroundContainer bgImage, java.awt.Rectangle bgImageContainer, BorderPropertySet border, CalculatedStyle style, RenderingContext c)
private int
calcOffset(CssContext c, CalculatedStyle style, PropertyValue value, float boundsDim, float imageDim)
private void
drawBgImage(RenderingContext c, CalculatedStyle style, java.awt.Rectangle backgroundBounds, java.awt.Rectangle bgImageContainer, BorderPropertySet border, FSImage backgroundImage, CalculatedStyle.BackgroundContainer bgImage)
void
drawDebugOutline(RenderingContext c, Box box, FSColor color)
private void
drawFontMetrics(RenderingContext c, InlineText inlineText)
protected abstract void
drawLine(int x1, int y1, int x2, int y2)
void
drawText(RenderingContext c, InlineText inlineText)
void
drawTextDecoration(RenderingContext c, InlineLayoutBox iB, TextDecoration decoration)
void
drawTextDecoration(RenderingContext c, LineBox lineBox)
private FSImage
getBackgroundImage(PropertyValue bgImage, RenderingContext c)
FontSpecification
getFontSpecification()
Gets the FontSpecification for this AbstractOutputDevice.boolean
isPDF()
void
paintBackground(RenderingContext c, CalculatedStyle style, java.awt.Rectangle bounds, java.awt.Rectangle bgImageContainer, BorderPropertySet border)
void
paintBackground(RenderingContext c, Box box)
private void
paintBackground0(RenderingContext c, CalculatedStyle style, java.awt.Rectangle backgroundBounds, java.awt.Rectangle bgImageContainer, BorderPropertySet border)
void
paintBorder(RenderingContext c, CalculatedStyle style, java.awt.Rectangle edge, int sides)
void
paintBorder(RenderingContext c, Box box)
void
paintCollapsedBorder(RenderingContext c, BorderPropertySet border, java.awt.Rectangle bounds, int side)
private void
paintHorizontalBand(FSImage image, int left, int top, int right, boolean interpolate)
private void
paintTiles(FSImage image, int left, int top, int right, int bottom, boolean interpolate)
private void
paintVerticalBand(FSImage image, int left, int top, int bottom, boolean interpolate)
private void
scaleBackgroundImage(CssContext c, CalculatedStyle style, java.awt.Rectangle backgroundContainer, FSImage image, CalculatedStyle.BackgroundContainer bgImage)
void
setFontSpecification(FontSpecification fs)
Sets the FontSpecification for this AbstractOutputDevice.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.openhtmltopdf.extend.OutputDevice
clip, draw, drawBorderLine, drawImage, drawLinearGradient, drawOval, drawRect, drawSelection, drawWithGraphics, endStructure, fill, fillOval, fillRect, getAbsoluteTransformOriginX, getAbsoluteTransformOriginY, getClip, getRenderingHint, getStroke, isFastRenderer, isSupportsCMYKColors, isSupportsSelection, paintReplacedElement, popClip, popTransformLayer, popTransforms, pushClip, pushTransformLayer, pushTransforms, setClip, setColor, setFont, setPaint, setRenderingHint, setStroke, startStructure, translate
-
-
-
-
Field Detail
-
_fontSpec
private FontSpecification _fontSpec
-
-
Method Detail
-
drawLine
protected abstract void drawLine(int x1, int y1, int x2, int y2)
-
drawText
public void drawText(RenderingContext c, InlineText inlineText)
- Specified by:
drawText
in interfaceOutputDevice
-
drawFontMetrics
private void drawFontMetrics(RenderingContext c, InlineText inlineText)
-
drawTextDecoration
public void drawTextDecoration(RenderingContext c, InlineLayoutBox iB, TextDecoration decoration)
- Specified by:
drawTextDecoration
in interfaceOutputDevice
-
drawTextDecoration
public void drawTextDecoration(RenderingContext c, LineBox lineBox)
- Specified by:
drawTextDecoration
in interfaceOutputDevice
-
drawDebugOutline
public void drawDebugOutline(RenderingContext c, Box box, FSColor color)
- Specified by:
drawDebugOutline
in interfaceOutputDevice
-
paintCollapsedBorder
public void paintCollapsedBorder(RenderingContext c, BorderPropertySet border, java.awt.Rectangle bounds, int side)
- Specified by:
paintCollapsedBorder
in interfaceOutputDevice
-
paintBorder
public void paintBorder(RenderingContext c, Box box)
- Specified by:
paintBorder
in interfaceOutputDevice
-
paintBorder
public void paintBorder(RenderingContext c, CalculatedStyle style, java.awt.Rectangle edge, int sides)
- Specified by:
paintBorder
in interfaceOutputDevice
-
getBackgroundImage
private FSImage getBackgroundImage(PropertyValue bgImage, RenderingContext c)
-
paintBackground
public void paintBackground(RenderingContext c, CalculatedStyle style, java.awt.Rectangle bounds, java.awt.Rectangle bgImageContainer, BorderPropertySet border)
- Specified by:
paintBackground
in interfaceOutputDevice
-
paintBackground
public void paintBackground(RenderingContext c, Box box)
- Specified by:
paintBackground
in interfaceOutputDevice
-
paintBackground0
private void paintBackground0(RenderingContext c, CalculatedStyle style, java.awt.Rectangle backgroundBounds, java.awt.Rectangle bgImageContainer, BorderPropertySet border)
-
calcInitialXYOff
private java.awt.Dimension calcInitialXYOff(CalculatedStyle.BackgroundContainer bgImage, java.awt.Rectangle bgImageContainer, BorderPropertySet border, CalculatedStyle style, RenderingContext c)
-
drawBgImage
private void drawBgImage(RenderingContext c, CalculatedStyle style, java.awt.Rectangle backgroundBounds, java.awt.Rectangle bgImageContainer, BorderPropertySet border, FSImage backgroundImage, CalculatedStyle.BackgroundContainer bgImage)
-
adjustTo
private int adjustTo(int target, int current, int imageDim)
-
paintTiles
private void paintTiles(FSImage image, int left, int top, int right, int bottom, boolean interpolate)
-
paintVerticalBand
private void paintVerticalBand(FSImage image, int left, int top, int bottom, boolean interpolate)
-
paintHorizontalBand
private void paintHorizontalBand(FSImage image, int left, int top, int right, boolean interpolate)
-
calcOffset
private int calcOffset(CssContext c, CalculatedStyle style, PropertyValue value, float boundsDim, float imageDim)
-
scaleBackgroundImage
private void scaleBackgroundImage(CssContext c, CalculatedStyle style, java.awt.Rectangle backgroundContainer, FSImage image, CalculatedStyle.BackgroundContainer bgImage)
-
calcBackgroundSizeLength
private int calcBackgroundSizeLength(CssContext c, CalculatedStyle style, PropertyValue value, float boundsDim)
-
getFontSpecification
public FontSpecification getFontSpecification()
Gets the FontSpecification for this AbstractOutputDevice.- Returns:
- current FontSpecification.
-
setFontSpecification
public void setFontSpecification(FontSpecification fs)
Sets the FontSpecification for this AbstractOutputDevice.- Parameters:
fs
- current FontSpecification.
-
isPDF
public boolean isPDF()
- Specified by:
isPDF
in interfaceOutputDevice
-
-