gui
Class ComponentGraphics

java.lang.Object
  extended by gui.ComponentGraphics

public class ComponentGraphics
extends java.lang.Object

The ComponentGraphics class provides services for printing or exporting an image from a Swing JComponent. Usually the best way to use this class is to invoke the static methods getPrintAction and getExportAction().


Constructor Summary
ComponentGraphics(javax.swing.JComponent c)
          new ComponentGraphics(c) returns a new ComponentGraphics for exporting c.
 
Method Summary
 javax.swing.Action getExportAction()
          cg.getExportAction() returns an exportAction that initiates export of cg as an image.
static javax.swing.Action getExportAction(javax.swing.JComponent c)
          ComponentGraphics.getExportAction(JComponent c) creates a ComponentGraphics for c and returns its export action.
 javax.swing.Action getPrintAction()
          cp.getPrintAction() returns an printAction that initiates printing of cp.
static javax.swing.Action getPrintAction(javax.swing.JComponent c)
          ComponentPostScript.getPrintAction(JComponent c) creates a ComponentPostScript for c and returns its printAction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentGraphics

public ComponentGraphics(javax.swing.JComponent c)
new ComponentGraphics(c) returns a new ComponentGraphics for exporting c.

Parameters:
c - the component to be made imageable
Method Detail

getPrintAction

public javax.swing.Action getPrintAction()
cp.getPrintAction() returns an printAction that initiates printing of cp.

Returns:
the print printAction for initiating printing

getExportAction

public javax.swing.Action getExportAction()
cg.getExportAction() returns an exportAction that initiates export of cg as an image.

Returns:
the export exportAction for initiating exporting

getPrintAction

public static javax.swing.Action getPrintAction(javax.swing.JComponent c)
ComponentPostScript.getPrintAction(JComponent c) creates a ComponentPostScript for c and returns its printAction.

Parameters:
c - the component to be made printable
Returns:
the print printAction for c

getExportAction

public static javax.swing.Action getExportAction(javax.swing.JComponent c)
ComponentGraphics.getExportAction(JComponent c) creates a ComponentGraphics for c and returns its export action.

Parameters:
c - the component to be made imageable
Returns:
the export action for c