Package com.openhtmltopdf.java2d
Class Java2DOutputDevice
java.lang.Object
com.openhtmltopdf.render.AbstractOutputDevice
com.openhtmltopdf.java2d.Java2DOutputDevice
- All Implemented Interfaces:
OutputDevice
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Java2DFont
private Graphics2D
private final Deque
<AffineTransform> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated.void
void
drawBorderLine
(Shape bounds, int side, int lineWidth, boolean solid) void
protected void
drawLine
(int x1, int y1, int x2, int y2) void
drawLinearGradient
(FSLinearGradient lg, Shape bounds) void
drawOval
(int x, int y, int width, int height) void
drawRect
(int x, int y, int width, int height) void
drawSelection
(RenderingContext c, InlineText inlineText) Deprecated.void
drawWithGraphics
(float x, float y, float width, float height, OutputDeviceGraphicsDrawer renderer) Draw something using a Graphics2D at the given rectangle.void
endStructure
(Object token) void
void
fillOval
(int x, int y, int width, int height) void
fillRect
(int x, int y, int width, int height) void
finish
(RenderingContext c, BlockBox _root) float
Deprecated.float
Deprecated.getClip()
Deprecated.getFont()
void
initializePage
(Graphics2D pageGraphics) boolean
The new (2018) fast renderer is in use.boolean
boolean
Deprecated.void
void
popClip()
Reverts the last clip on the stack.void
Reverts the transform on the stack.void
popTransforms
(List<AffineTransform> inverse) Deprecated.void
Applies a clip on the output device.void
pushTransformLayer
(AffineTransform transform) Applies a transform on the output device.pushTransforms
(List<AffineTransform> transforms) Deprecated.void
setBidiReorderer
(BidiReorderer _reorderer) void
Deprecated.void
void
void
void
setRenderingContext
(RenderingContext result) void
setRenderingHint
(RenderingHints.Key key, Object value) void
void
startStructure
(StructureType type, Box box) Propagate the structure heirachy to allow for PDF/UA compliance.void
translate
(double tx, double ty) Methods inherited from class com.openhtmltopdf.render.AbstractOutputDevice
drawDebugOutline, drawText, drawTextDecoration, drawTextDecoration, getFontSpecification, isPDF, paintBackground, paintBackground, paintBorder, paintBorder, paintCollapsedBorder, setFontSpecification
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
drawDebugOutline, drawText, drawTextDecoration, drawTextDecoration, isPDF, paintBackground, paintBackground, paintBorder, paintBorder, paintCollapsedBorder
-
Field Details
-
_clipStack
-
_transformStack
-
_graphics
-
_font
-
-
Constructor Details
-
Java2DOutputDevice
-
-
Method Details
-
drawSelection
Deprecated.- Specified by:
drawSelection
in interfaceOutputDevice
-
drawBorderLine
- Specified by:
drawBorderLine
in interfaceOutputDevice
-
paintReplacedElement
- Specified by:
paintReplacedElement
in interfaceOutputDevice
-
setColor
- Specified by:
setColor
in interfaceOutputDevice
-
drawLine
protected void drawLine(int x1, int y1, int x2, int y2) - Specified by:
drawLine
in classAbstractOutputDevice
-
drawRect
public void drawRect(int x, int y, int width, int height) - Specified by:
drawRect
in interfaceOutputDevice
-
fillRect
public void fillRect(int x, int y, int width, int height) - Specified by:
fillRect
in interfaceOutputDevice
-
setClip
Deprecated.- Specified by:
setClip
in interfaceOutputDevice
-
getClip
Deprecated.- Specified by:
getClip
in interfaceOutputDevice
-
clip
Deprecated.- Specified by:
clip
in interfaceOutputDevice
-
translate
public void translate(double tx, double ty) - Specified by:
translate
in interfaceOutputDevice
-
getGraphics
-
drawOval
public void drawOval(int x, int y, int width, int height) - Specified by:
drawOval
in interfaceOutputDevice
-
fillOval
public void fillOval(int x, int y, int width, int height) - Specified by:
fillOval
in interfaceOutputDevice
-
getRenderingHint
- Specified by:
getRenderingHint
in interfaceOutputDevice
-
setRenderingHint
- Specified by:
setRenderingHint
in interfaceOutputDevice
-
setFont
- Specified by:
setFont
in interfaceOutputDevice
-
getFont
-
setStroke
- Specified by:
setStroke
in interfaceOutputDevice
-
getStroke
- Specified by:
getStroke
in interfaceOutputDevice
-
fill
- Specified by:
fill
in interfaceOutputDevice
-
draw
- Specified by:
draw
in interfaceOutputDevice
-
drawImage
- Specified by:
drawImage
in interfaceOutputDevice
-
isSupportsSelection
Deprecated.- Specified by:
isSupportsSelection
in interfaceOutputDevice
-
isSupportsCMYKColors
public boolean isSupportsCMYKColors()- Specified by:
isSupportsCMYKColors
in interfaceOutputDevice
-
drawWithGraphics
public void drawWithGraphics(float x, float y, float width, float height, OutputDeviceGraphicsDrawer renderer) Description copied from interface:OutputDevice
Draw something using a Graphics2D at the given rectangle.- Specified by:
drawWithGraphics
in interfaceOutputDevice
-
setPaint
- Specified by:
setPaint
in interfaceOutputDevice
-
pushTransforms
Deprecated.Description copied from interface:OutputDevice
Apply the given transform on top of the current one in the PDF graphics stream. This is a cumulative operation. You should popTransform after the box and children are painted.- Specified by:
pushTransforms
in interfaceOutputDevice
- Returns:
- the list of inverse transforms to undo the effect of this transform
-
popTransforms
Deprecated.- Specified by:
popTransforms
in interfaceOutputDevice
-
getAbsoluteTransformOriginX
Deprecated.- Specified by:
getAbsoluteTransformOriginX
in interfaceOutputDevice
-
getAbsoluteTransformOriginY
Deprecated.- Specified by:
getAbsoluteTransformOriginY
in interfaceOutputDevice
-
setBidiReorderer
-
setRenderingContext
-
setRoot
-
initializePage
-
finish
-
pushTransformLayer
Description copied from interface:OutputDevice
Applies a transform on the output device. This is a cumulativew operation. NOTE: The current implementation shares a stack between transforms and clips, so calls toOutputDevice.pushTransformLayer(AffineTransform)
,OutputDevice.popTransformLayer()
,OutputDevice.pushClip(Shape)
andOutputDevice.popClip()
MUST be nested correctly.- Specified by:
pushTransformLayer
in interfaceOutputDevice
-
popTransformLayer
public void popTransformLayer()Description copied from interface:OutputDevice
Reverts the transform on the stack. NOTE: The current implementation shares a stack between transforms and clips, so calls toOutputDevice.pushTransformLayer(AffineTransform)
,OutputDevice.popTransformLayer()
,OutputDevice.pushClip(Shape)
andOutputDevice.popClip()
MUST be nested correctly.- Specified by:
popTransformLayer
in interfaceOutputDevice
-
popClip
public void popClip()Description copied from interface:OutputDevice
Reverts the last clip on the stack. The fast renderer MUST usepushClip
andpopClip
in preference toclip
andsetClip
. NOTE: The current implementation shares a stack between transforms and clips, so calls toOutputDevice.pushTransformLayer(AffineTransform)
,OutputDevice.popTransformLayer()
,OutputDevice.pushClip(Shape)
andOutputDevice.popClip()
MUST be nested correctly.- Specified by:
popClip
in interfaceOutputDevice
-
pushClip
Description copied from interface:OutputDevice
Applies a clip on the output device. This is a cumulative operation. The fast renderer MUST usepushClip
andpopClip
in preference toclip
andsetClip
. NOTE: The current implementation shares a stack between transforms and clips, so calls toOutputDevice.pushTransformLayer(AffineTransform)
,OutputDevice.popTransformLayer()
,OutputDevice.pushClip(Shape)
andOutputDevice.popClip()
MUST be nested correctly.- Specified by:
pushClip
in interfaceOutputDevice
-
isFastRenderer
public boolean isFastRenderer()Description copied from interface:OutputDevice
The new (2018) fast renderer is in use.- Specified by:
isFastRenderer
in interfaceOutputDevice
-
startStructure
Description copied from interface:OutputDevice
Propagate the structure heirachy to allow for PDF/UA compliance.- Specified by:
startStructure
in interfaceOutputDevice
-
endStructure
- Specified by:
endStructure
in interfaceOutputDevice
-
drawLinearGradient
- Specified by:
drawLinearGradient
in interfaceOutputDevice
-