edu.rice.cs.drjava.model.print
Class DrJavaBook

java.lang.Object
  extended by edu.rice.cs.drjava.model.print.DrJavaBook
All Implemented Interfaces:
Pageable

public class DrJavaBook
extends Object
implements Pageable

The DrJavaBook class is DrJava's implementation of a Pageable object. It serves as the control class for printing, and is responsible for preparing the print job of previewing or printing given the String representation of the document.

Version:
$Id: DrJavaBook.java 4447 2008-04-18 16:06:34Z rcartwright $

Field Summary
static Font FOOTER_FONT
           
static Font LINE_FONT
           
 float LINE_NUM_WIDTH
           
static Font PRINT_FONT
           
 
Fields inherited from interface java.awt.print.Pageable
UNKNOWN_NUMBER_OF_PAGES
 
Constructor Summary
DrJavaBook(String text, String fileName, PageFormat format)
          Constructs a DrJavaBook which a given content text, filename, and pageformat.
 
Method Summary
 int getNumberOfPages()
           
 PageFormat getPageFormat(int pageIndex)
          Returns the PageFormat for this print job.
 Printable getPrintable(int pageIndex)
          Returns the Printable object for a given page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRINT_FONT

public static final Font PRINT_FONT

FOOTER_FONT

public static final Font FOOTER_FONT

LINE_FONT

public static final Font LINE_FONT

LINE_NUM_WIDTH

public float LINE_NUM_WIDTH
Constructor Detail

DrJavaBook

public DrJavaBook(String text,
                  String fileName,
                  PageFormat format)
Constructs a DrJavaBook which a given content text, filename, and pageformat.

Method Detail

getNumberOfPages

public int getNumberOfPages()
Specified by:
getNumberOfPages in interface Pageable
Returns:
The number of pages in this print job.

getPageFormat

public PageFormat getPageFormat(int pageIndex)
Returns the PageFormat for this print job.

Specified by:
getPageFormat in interface Pageable
Parameters:
pageIndex - The page number
Returns:
the PageFormat of this print job.

getPrintable

public Printable getPrintable(int pageIndex)
Returns the Printable object for a given page.

Specified by:
getPrintable in interface Pageable
Parameters:
pageIndex - The page number.
Returns:
The Printable object for the given page.