mavis.util
Class ComponentPrinter

java.lang.Object
  extended by mavis.util.ComponentPrinter
All Implemented Interfaces:
java.awt.print.Printable

public class ComponentPrinter
extends java.lang.Object
implements java.awt.print.Printable

Offers methods to print Components (only for Graph/DataPrintPanel actually)


Field Summary
private  java.awt.Component componentToBePrinted
          Component to be printed
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
ComponentPrinter(java.awt.Component componentToBePrinted)
          Creates new printable "component"
 
Method Summary
static void disableDoubleBuffering(java.awt.Component c)
           
static void enableDoubleBuffering(java.awt.Component c)
           
 int print(java.awt.Graphics g, java.awt.print.PageFormat pageFormat, int pageIndex)
          Absolutely chaotic printing mechanism.
 void print(java.lang.String jobName)
          Opens printer dialog and start printing job if we get printer
static void printComponent(java.awt.Component c)
          Static printing command
static void printComponent(java.awt.Component c, java.lang.String jobName)
          Static printing command
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

componentToBePrinted

private java.awt.Component componentToBePrinted
Component to be printed

Constructor Detail

ComponentPrinter

public ComponentPrinter(java.awt.Component componentToBePrinted)
Creates new printable "component"

Parameters:
componentToBePrinted - Component
Method Detail

printComponent

public static void printComponent(java.awt.Component c)
Static printing command

Parameters:
c - Component to be printed (use Only DataPrintPanel/GraphPrintPanel)

printComponent

public static void printComponent(java.awt.Component c,
                                  java.lang.String jobName)
Static printing command

Parameters:
c - Component to be printed (use Only Graph/DataPrintPanel)
jobName - name for the printing job

print

public void print(java.lang.String jobName)
Opens printer dialog and start printing job if we get printer


print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pageFormat,
                 int pageIndex)
Absolutely chaotic printing mechanism.

Specified by:
print in interface java.awt.print.Printable
Parameters:
g - Graphics
pageFormat - PageFormat
pageIndex - int
Returns:
int

disableDoubleBuffering

public static void disableDoubleBuffering(java.awt.Component c)

enableDoubleBuffering

public static void enableDoubleBuffering(java.awt.Component c)