public abstract class Device extends Object
Implements the interface for outputting text and graphic content to abstract device. Rendering is performed page by page.
| Modifier | Constructor and Description |
|---|---|
|
Device()
Creates a new instance.
|
protected |
Device(Device device)
Clone constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Device |
create()
Creates a copy of this device.
|
void |
dispose()
Disposes the device.
|
abstract void |
drawPath(Shape path)
Draws a path.
|
abstract void |
drawString(String str,
float originX,
float originY,
List<GlyphData> charInfos)
Draws a text string.
|
abstract void |
endDocument()
Finalizes the whole document.
|
abstract void |
endPage()
Finalizes a page.
|
abstract void |
fillPath(Shape path)
Fills a path.
|
abstract String |
getDestinationName()
Gets destination name: output file name or device description.
|
Color |
getFill()
Gets the current fill color.
|
abstract int |
getPageCount()
Gets the number of pages.
|
ColoredStroke |
getStroke()
Gets the current stroke.
|
abstract void |
init()
Initializes device.
|
abstract boolean |
isReady()
Shows if device is ready for output.
|
protected void |
restoreGraphicsState()
Rolls back to the graphics state previously saved.
|
protected void |
saveGraphicsState()
Saves the current graphics state.
|
abstract void |
setClip(Shape path)
Sets the current clip path.
|
void |
setFill(Color value)
Sets the current fill color.
|
void |
setStroke(ColoredStroke value)
Sets the current stroke.
|
abstract void |
setTransform(AffineTransform matrix)
Sets the current coordinate space transformation.
|
abstract void |
showImage(Point2D origin,
Dimension2D size,
byte[] imageData)
Shows a raster image.
|
abstract void |
startDocument()
Starts the whole document.
|
abstract void |
startPage(float width,
float height)
Starts a new page.
|
public Device()
Creates a new instance.
protected Device(Device device)
Clone constructor. Initializes this device with another device.
device - The device to clone.public abstract void init()
Initializes device.
public abstract int getPageCount()
Gets the number of pages.
public abstract boolean isReady()
Shows if device is ready for output.
True if device is ready to receive output. Otherwise, False.public abstract String getDestinationName()
Gets destination name: output file name or device description.
public Device create()
Creates a copy of this device.
public void dispose()
Disposes the device.
public abstract void startDocument()
Starts the whole document.
public abstract void endDocument()
Finalizes the whole document.
public abstract void startPage(float width,
float height)
Starts a new page.
width - The page width.height - The page height.public abstract void endPage()
Finalizes a page.
public abstract void setTransform(AffineTransform matrix)
Sets the current coordinate space transformation.
matrix - The transformation matrix.public abstract void setClip(Shape path)
Sets the current clip path.
path - The clip path.public ColoredStroke getStroke()
Gets the current stroke.
public void setStroke(ColoredStroke value)
Sets the current stroke.
value - The new current stroke.public Color getFill()
Gets the current fill color.
public void setFill(Color value)
Sets the current fill color.
value - The new current fill color.protected void saveGraphicsState()
Saves the current graphics state.
protected void restoreGraphicsState()
Rolls back to the graphics state previously saved.
public abstract void drawString(String str, float originX, float originY, List<GlyphData> charInfos)
Draws a text string.
str - The string.originX - The x coordinate of the origin.originY - The x coordinate of the origin.charInfos - Glyph data required for precise typesetting of a text string.public abstract void drawPath(Shape path)
Draws a path.
path - A path to draw.public abstract void fillPath(Shape path)
Fills a path.
path - A path to fill.public abstract void showImage(Point2D origin, Dimension2D size, byte[] imageData)
Shows a raster image.
origin - The bottom-left corner of the shown image.size - The size of the shown image.imageData - The image data.Copyright © 2021 Aspose. All Rights Reserved.