|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
mars.venus.HardcopyWriter
public class HardcopyWriter
Nested Class Summary | |
---|---|
static class |
HardcopyWriter.PrintCanceledException
This is the exception class that the HardcopyWriter constructor throws when the user clicks "Cancel" in the print dialog box. |
Field Summary | |
---|---|
protected int |
charnum
|
protected int |
chars_per_line
|
protected int |
chars_per_tab
|
protected int |
charwidth
|
protected Font |
font
|
protected int |
fontsize
|
protected Font |
headerfont
|
protected FontMetrics |
headermetrics
|
protected int |
headery
|
protected int |
height
|
protected PrintJob |
job
|
protected String |
jobname
|
protected int |
lineascent
|
protected int |
lineheight
|
protected int |
linenum
|
protected int |
lines_per_page
|
protected FontMetrics |
metrics
|
protected Graphics |
page
|
protected int |
pagedpi
|
protected int |
pagenum
|
protected Dimension |
pagesize
|
protected static Properties |
printprops
|
protected String |
time
|
protected int |
width
|
protected int |
x0
|
protected int |
y0
|
Fields inherited from class java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
HardcopyWriter(Frame frame,
String jobname,
int fontsize,
double leftmargin,
double rightmargin,
double topmargin,
double bottommargin)
The constructor for this class has a bunch of arguments: The frame argument is required for all printing in Java. |
Method Summary | |
---|---|
void |
close()
This is the close( ) method that all Writer subclasses must implement. |
void |
flush()
This is the flush( ) method that all Writer subclasses must implement. |
int |
getCharactersPerLine()
Return the number of columns of characters that fit on the page |
int |
getLinesPerPage()
Return the number of lines that fit on a page |
static void |
main(String[] args)
A program that prints the specified file using HardcopyWriter |
protected void |
newline()
This internal method begins a new line |
protected void |
newpage()
This internal method begins a new page and prints the header. |
void |
pageBreak()
End the current page. |
void |
setFontStyle(int style)
Set the font style. |
void |
write(char[] buffer,
int index,
int len)
This is the write( ) method of the stream. |
Methods inherited from class java.io.Writer |
---|
append, append, append, write, write, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PrintJob job
protected Graphics page
protected String jobname
protected int fontsize
protected String time
protected Dimension pagesize
protected int pagedpi
protected Font font
protected Font headerfont
protected FontMetrics metrics
protected FontMetrics headermetrics
protected int x0
protected int y0
protected int width
protected int height
protected int headery
protected int charwidth
protected int lineheight
protected int lineascent
protected int chars_per_line
protected int lines_per_page
protected int chars_per_tab
protected int charnum
protected int linenum
protected int pagenum
protected static Properties printprops
Constructor Detail |
---|
public HardcopyWriter(Frame frame, String jobname, int fontsize, double leftmargin, double rightmargin, double topmargin, double bottommargin) throws HardcopyWriter.PrintCanceledException
HardcopyWriter.PrintCanceledException
Method Detail |
---|
public void write(char[] buffer, int index, int len)
write
in class Writer
public void flush()
flush
in interface Flushable
flush
in class Writer
public void close()
close
in interface Closeable
close
in class Writer
public void setFontStyle(int style)
public void pageBreak()
public int getCharactersPerLine()
public int getLinesPerPage()
protected void newline()
protected void newpage()
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |