view
Class PrintComponent

java.lang.Object
  extended by view.PrintComponent

public class PrintComponent
extends Object

A small class that allows printing of Components. If the component handed over implements the Printable interface, it is directly printed, otherwise the components print method is called with a graphics object provided by the printer job. If the components preferred size is bigger than the printable area, a scaling on the graphics object is performed that keeps the aspect ratio but renders the component small enough to fit on the page. If the component is the special JTabbedPane component, then all tabs are printed on consecuetive pages.

See Also:
SaveComponent

Nested Class Summary
private static class PrintComponent.PrintableComponent
          Renders an array of compontents to a printable page.
 
Field Summary
private static Properties export
          Keep export properties.
private static PrinterJob job
          Keep print job reference to keep user settings.
 
Constructor Summary
PrintComponent()
           
 
Method Summary
static boolean eps(Component show)
          Prints an arbitrary component.
static boolean export(Component show)
           
static boolean pdf(Component show)
          Prints an arbitrary component.
static boolean print(Component show)
           
static boolean ps(Component show)
          Prints an arbitrary component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

job

private static PrinterJob job
Keep print job reference to keep user settings.


export

private static Properties export
Keep export properties.

Constructor Detail

PrintComponent

public PrintComponent()
Method Detail

print

public static boolean print(Component show)
                     throws PrinterException
Throws:
PrinterException

export

public static boolean export(Component show)

ps

public static boolean ps(Component show)
                  throws PrinterException
Prints an arbitrary component. Double-buffering should not be an issue, as jcomponets print methods turn this off by default.

Throws:
PrinterException

eps

public static boolean eps(Component show)
                   throws PrinterException
Prints an arbitrary component. Double-buffering should not be an issue, as jcomponets print methods turn this off by default.

Throws:
PrinterException

pdf

public static boolean pdf(Component show)
                   throws PrinterException
Prints an arbitrary component. Double-buffering should not be an issue, as jcomponets print methods turn this off by default.

Throws:
PrinterException