|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiscovery.gui.PrintManager
public class PrintManager
This class is responsible for printing out task structure, task flow and narrative diagrams. It implements the Printable interface, and provides a static method called 'printComponent' which takes the component to print. It then brings up the standard print dialog to allow the user to setup printing as they would like. Methods are also provided to disable and enable double buffering. Double buffering is disabled before printing to give a much higher quality print with quicker spooling times. This class is based on the PrintUtilities.java class by Marty Hall, which is freely available to use and can be found at: http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/Swing-Tutorial-Printing.html
Field Summary |
---|
Fields inherited from interface java.awt.print.Printable |
---|
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary | |
---|---|
PrintManager(java.awt.Component comp)
Constructor which creates a new PrintManager instance with the supplied component. |
Method Summary | |
---|---|
static void |
disableDoubleBuffering(java.awt.Component c)
This method disables double buffering when the specified component is repainted. |
static void |
enableDoubleBuffering(java.awt.Component c)
This method enables double buffering when the specified component is repainted. |
void |
print()
This method is called by the printComponent method. |
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat pageFormat,
int pageIndex)
This method is required by the Printable interface. |
static void |
printComponent(java.awt.Component c)
Static method which prints the supplied Swing component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrintManager(java.awt.Component comp)
comp
- the component associated with this PrintManager instanceMethod Detail |
---|
public static void printComponent(java.awt.Component c)
c
- the component to printpublic void print()
public int print(java.awt.Graphics g, java.awt.print.PageFormat pageFormat, int pageIndex)
print
in interface java.awt.print.Printable
public static void disableDoubleBuffering(java.awt.Component c)
c
- the component to disable double buffering ofpublic static void enableDoubleBuffering(java.awt.Component c)
c
- the component to enable double buffering of
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |