Package org.xhtmlrenderer.render
Class AbstractOutputDevice
java.lang.Object
org.xhtmlrenderer.render.AbstractOutputDevice
- All Implemented Interfaces:
OutputDevice
- Direct Known Subclasses:
ITextOutputDevice
,Java2DOutputDevice
,SWTOutputDevice
An abstract implementation of an
OutputDevice
. It provides complete
implementations for many OutputDevice
methods.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate int
adjustTo
(int target, int current, int imageDim) private int
calcBackgroundSizeLength
(CssContext c, CalculatedStyle style, PropertyValue value, float boundsDim) private int
calcOffset
(CssContext c, CalculatedStyle style, PropertyValue value, float boundsDim, float imageDim) 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 @Nullable FSImage
Gets the FontSpecification for this AbstractOutputDevice.void
paintBackground
(RenderingContext c, CalculatedStyle style, Rectangle bounds, Rectangle bgImageContainer, BorderPropertySet border) void
paintBackground
(RenderingContext c, Box box) private void
paintBackground0
(RenderingContext c, CalculatedStyle style, Rectangle backgroundBounds, Rectangle bgImageContainer, BorderPropertySet border) void
paintBorder
(RenderingContext c, CalculatedStyle style, Rectangle edge, int sides) void
paintBorder
(RenderingContext c, Box box) void
paintCollapsedBorder
(RenderingContext c, BorderPropertySet border, Rectangle bounds, int side) private void
paintHorizontalBand
(FSImage image, int left, int top, int right) private void
paintTiles
(FSImage image, int left, int top, int right, int bottom) private void
paintVerticalBand
(FSImage image, int left, int top, int bottom) private FSImage
scaleBackgroundImage
(CssContext c, CalculatedStyle style, Rectangle backgroundContainer, FSImage image) void
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 org.xhtmlrenderer.extend.OutputDevice
clip, draw, drawBorderLine, drawImage, drawOval, drawRect, drawSelection, fill, fillOval, fillRect, getClip, getRenderingHint, getStroke, isSupportsCMYKColors, isSupportsSelection, paintReplacedElement, setClip, setColor, setFont, setRenderingHint, setStroke, translate
-
Field Details
-
_fontSpec
-
-
Constructor Details
-
AbstractOutputDevice
public AbstractOutputDevice()
-
-
Method Details
-
drawLine
protected abstract void drawLine(int x1, int y1, int x2, int y2) -
drawText
- Specified by:
drawText
in interfaceOutputDevice
-
drawFontMetrics
-
drawTextDecoration
- Specified by:
drawTextDecoration
in interfaceOutputDevice
-
drawTextDecoration
- Specified by:
drawTextDecoration
in interfaceOutputDevice
-
drawDebugOutline
- Specified by:
drawDebugOutline
in interfaceOutputDevice
-
paintCollapsedBorder
public void paintCollapsedBorder(RenderingContext c, BorderPropertySet border, Rectangle bounds, int side) - Specified by:
paintCollapsedBorder
in interfaceOutputDevice
-
paintBorder
- Specified by:
paintBorder
in interfaceOutputDevice
-
paintBorder
- Specified by:
paintBorder
in interfaceOutputDevice
-
getBackgroundImage
-
paintBackground
public void paintBackground(RenderingContext c, CalculatedStyle style, Rectangle bounds, Rectangle bgImageContainer, BorderPropertySet border) - Specified by:
paintBackground
in interfaceOutputDevice
-
paintBackground
- Specified by:
paintBackground
in interfaceOutputDevice
-
paintBackground0
private void paintBackground0(RenderingContext c, CalculatedStyle style, Rectangle backgroundBounds, Rectangle bgImageContainer, BorderPropertySet border) -
adjustTo
private int adjustTo(int target, int current, int imageDim) -
paintTiles
-
paintVerticalBand
-
paintHorizontalBand
-
calcOffset
private int calcOffset(CssContext c, CalculatedStyle style, PropertyValue value, float boundsDim, float imageDim) -
scaleBackgroundImage
@CheckReturnValue private FSImage scaleBackgroundImage(CssContext c, CalculatedStyle style, Rectangle backgroundContainer, FSImage image) -
calcBackgroundSizeLength
private int calcBackgroundSizeLength(CssContext c, CalculatedStyle style, PropertyValue value, float boundsDim) -
getFontSpecification
Gets the FontSpecification for this AbstractOutputDevice.- Returns:
- current FontSpecification.
-
setFontSpecification
Sets the FontSpecification for this AbstractOutputDevice.- Parameters:
fs
- current FontSpecification.
-