org.bs.mdi
Interface Printer


public interface Printer

An interface for objects providing printing functionality.


Method Summary
 int getNumPages(PageFormat format)
          Returns the number of pages which would be printed using the specified page format.
 boolean print(Graphics g, PageFormat format, int pageindex)
          Draws the specified page on the printer's graphics context.
 

Method Detail

getNumPages

public int getNumPages(PageFormat format)
Returns the number of pages which would be printed using the specified page format.

Parameters:
format - the page format
Returns:
the number of printed pages

print

public boolean print(Graphics g,
                     PageFormat format,
                     int pageindex)
Draws the specified page on the printer's graphics context.

Parameters:
g - the printer's graphics context
format - the page format to be used
pageindex - the page number to be printed
Returns:
true if everything went well, false otherwise. If a non-existing page was requested, false is returned.