jas.plot
Class PrintHelper

java.lang.Object
  |
  +--jas.plot.PrintHelper
Direct Known Subclasses:
PrintHelper11, PrintHelper12

public abstract class PrintHelper
extends java.lang.Object


Field Summary
protected static boolean debugPrinting
           
static int ORIENTATION_BEST_FIT
           
static int ORIENTATION_LANDSCAPE
           
static int ORIENTATION_PORTRAITE
           
 
Constructor Summary
PrintHelper()
           
 
Method Summary
static PrintHelper instance()
          Create an instance of a PrintHelper
static boolean isPrinting()
          Method to allow component being painted to find out if it is being printed.
abstract  void printTarget(java.awt.Component target)
          Print the specified component
abstract  void setOrientation(int orientation)
          Set the print orientation
protected  void setPrintingThread(java.lang.Thread thread)
           
abstract  void setScaleUp(boolean scaleUp)
          Controls whether the PrintHelper will scale an image up to make it fill the page (PrintHelper will always try to shrink to fit)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORIENTATION_BEST_FIT

public static final int ORIENTATION_BEST_FIT

ORIENTATION_PORTRAITE

public static final int ORIENTATION_PORTRAITE

ORIENTATION_LANDSCAPE

public static final int ORIENTATION_LANDSCAPE

debugPrinting

protected static final boolean debugPrinting
Constructor Detail

PrintHelper

public PrintHelper()
Method Detail

printTarget

public abstract void printTarget(java.awt.Component target)
                          throws java.lang.Exception
Print the specified component

instance

public static PrintHelper instance()
Create an instance of a PrintHelper

setOrientation

public abstract void setOrientation(int orientation)
Set the print orientation
Parameters:
orientation - One of ORIENTATION_BEST_FIT,ORIENTATION_PORTRAITE,ORIENTATION_LANDSCAPE

setScaleUp

public abstract void setScaleUp(boolean scaleUp)
Controls whether the PrintHelper will scale an image up to make it fill the page (PrintHelper will always try to shrink to fit)

isPrinting

public static boolean isPrinting()
Method to allow component being painted to find out if it is being printed. This is a crude workaround for limitations which make it impossible for a SwingComponent to tell whether its paint method is being called to print it or to display it on the screen. Obviously this static method only works if PrintHelper is being used to do the printing.

setPrintingThread

protected void setPrintingThread(java.lang.Thread thread)