static class StyledText.Printing
extends java.lang.Object
implements java.lang.Runnable
Printing
is returned in the
StyledText#print(Printer) API. The run() method may be
invoked from any thread.Modifier and Type | Field and Description |
---|---|
(package private) static int |
CENTER |
(package private) Rectangle |
clientArea |
(package private) int |
endLine |
(package private) int |
endPage |
(package private) FontData |
fontData |
(package private) GC |
gc |
(package private) static int |
LEFT |
(package private) int |
lineSpacing |
(package private) boolean |
mirrored |
(package private) int |
pageWidth |
(package private) Printer |
printer |
(package private) Font |
printerFont |
(package private) StyledTextRenderer |
printerRenderer |
(package private) int |
printMargin |
(package private) StyledTextPrintOptions |
printOptions |
(package private) java.util.Hashtable |
resources |
(package private) static int |
RIGHT |
(package private) int |
scope |
(package private) Point |
selection |
(package private) boolean |
singleLine |
(package private) int |
startLine |
(package private) int |
startPage |
(package private) int |
tabLength |
Constructor and Description |
---|
StyledText.Printing(StyledText styledText,
Printer printer,
StyledTextPrintOptions printOptions)
Creates an instance of
Printing . |
Modifier and Type | Method and Description |
---|---|
(package private) void |
cacheLineData(StyledText styledText)
Caches all line data that needs to be requested from a listener.
|
(package private) StyledTextContent |
copyContent(StyledTextContent original)
Copies the text of the specified
StyledTextContent . |
(package private) void |
dispose()
Disposes of the resources and the
PrintRenderer . |
(package private) void |
init() |
(package private) void |
print()
Prints the lines in the specified page range.
|
(package private) void |
printDecoration(int page,
boolean header,
TextLayout layout)
Print header or footer decorations.
|
(package private) void |
printDecorationSegment(java.lang.String segment,
int alignment,
int page,
boolean header,
TextLayout layout)
Print one segment of a header or footer decoration.
|
(package private) void |
printLine(int x,
int y,
GC gc,
Color foreground,
Color background,
TextLayout layout,
TextLayout printLayout,
int index) |
void |
run()
Starts a print job and prints the pages specified in the constructor.
|
static final int LEFT
static final int CENTER
static final int RIGHT
Printer printer
StyledTextRenderer printerRenderer
StyledTextPrintOptions printOptions
Rectangle clientArea
FontData fontData
Font printerFont
java.util.Hashtable resources
int tabLength
GC gc
int pageWidth
int startPage
int endPage
int scope
int startLine
int endLine
boolean singleLine
Point selection
boolean mirrored
int lineSpacing
int printMargin
StyledText.Printing(StyledText styledText, Printer printer, StyledTextPrintOptions printOptions)
Printing
.
Copies the widget content and rendering data that needs
to be requested from listeners.
parent
- StyledText widget to print.printer
- printer device to print on.printOptions
- print optionsvoid cacheLineData(StyledText styledText)
printerContent
- StyledTextContent
to request
line data for.StyledTextContent copyContent(StyledTextContent original)
StyledTextContent
.
original
- the StyledTextContent
to copy.void dispose()
PrintRenderer
.void init()
void print()
void printDecoration(int page, boolean header, TextLayout layout)
page
- page number to print, if specified in the StyledTextPrintOptions header or footer.header
- true = print the header, false = print the footervoid printDecorationSegment(java.lang.String segment, int alignment, int page, boolean header, TextLayout layout)
segment
- decoration segment to printalignment
- alignment of the segment. 0=left, 1=center, 2=rightpage
- page number to print, if specified in the decoration segment.header
- true = print the header, false = print the footervoid printLine(int x, int y, GC gc, Color foreground, Color background, TextLayout layout, TextLayout printLayout, int index)
public void run()
run
in interface java.lang.Runnable