com.steema.teechart.printer
Class Printer

java.lang.Object
  extended by com.steema.teechart.TeeBase
      extended by com.steema.teechart.printer.Printer
All Implemented Interfaces:
java.awt.print.Printable, java.io.Serializable

public final class Printer
extends TeeBase
implements java.awt.print.Printable

Title: Printer class

Description: Chart printing characteristics

Copyright (c) 2005-2013 by Steema Software SL. All Rights Reserved.

Company: Steema Software SL

See Also:
Serialized Form

Field Summary
 boolean isPartial
           
 boolean isPrinting
           
 
Fields inherited from class com.steema.teechart.TeeBase
chart, InternalUse
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
Printer(IBaseChart c)
           
 
Method Summary
 void beginPrint()
          Start multiple Chart print job.
protected  Rectangle calcImagePrintMargins(Chart aPanel, java.awt.print.Paper paper, java.awt.print.PageFormat pageFormat)
           
protected  Rectangle calcImagePrintMargins(Chart aPanel, Rectangle paperRect)
           
 Rectangle calcProportionalMargins(Chart aPanel, Rectangle bounds)
           
 Graphics3D checkGraphics(java.awt.Graphics g)
           
 void endPrint()
          End multiple Chart print job.
 java.util.ArrayList getChartList()
           
protected  java.awt.print.PrinterJob getDocument()
           
 boolean getGrayscale()
          Prints a Grayscale Chart when true.
 boolean getLandscape()
          Sets the current Printer orientation to Landscape.
 PrintMargins getMargins()
          The four margins as a percentage of paper dimensions.
 PrintMarginUnit getMarginUnits()
          Printer Margin Units as a percentage or hundredths of an inch.
 void getOptions()
           
 void getOptions(java.awt.print.PageFormat pageFormat)
           
 int getOrientation()
           
 Rectangle getPaperRect()
          Returns
 java.awt.print.PrinterJob getPrinterJob()
          Selects the Chart print job to be sent to the currently selected Printer.
 boolean getPrintPanelBackground()
          Prints transparent Chart Panel when false.
 boolean getProportional()
          Print dimensions of Chart proportional to those onscreen.
 int getResolution()
          Sets the Chart to detail resolution for printing.
 boolean getUseAntiAlias()
          Applies anti-alias to plotting Pen when true.
 void preview()
          shows the Preview screen of the Chart print.
 void print()
          Sends the Chart to the currently selected Printer.
 void print(boolean landscape)
          Sends the Chart to the currently selected Printer.
 int print(java.awt.Graphics g, java.awt.print.PageFormat pageFormat, int pageIndex)
           
 void print(IBaseChart c, Rectangle r)
          Prints Chart c at Rectangle (Left, Top, Width,Height).
 void print(Rectangle r)
          Prints at Rectangle (Left, Top, Width,Height).
 void setArrayList(java.util.ArrayList value)
           
 void setGrayscale(boolean value)
          Prints a Grayscale Chart when true.
 void setLandscape(boolean value)
          Sets the current Printer orientation to Landscape when true.
 void setMargins(int left, int top, int right, int bottom)
          Sets the four margins of paper dimensions.
 void setMargins(PrintMargins value)
          Sets the four margins as a percentage or fixed 1/72nd dimension.
 void setMarginUnits(PrintMarginUnit value)
          Sets Printer Margin Units.
 void setOrientation(int orientation)
           
 void setPrinterJob(java.awt.print.PrinterJob value)
          Selects the Chart print job to be sent to the currently selected Printer.
 void setPrintPanelBackground(boolean value)
          Prints transparent Chart Panel when false.
 void setProportional(boolean value)
          Sets print dimensions of Chart proportional to those onscreen.
 void setResolution(int value)
          Sets the Chart to detail resolution for printing.
 void setUseAntiAlias(boolean value)
          Applies anti-alias to plotting Pen when true.
 
Methods inherited from class com.steema.teechart.TeeBase
getChart, invalidate, setBooleanProperty, setChart, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isPrinting

public transient boolean isPrinting

isPartial

public boolean isPartial
Constructor Detail

Printer

public Printer(IBaseChart c)
Method Detail

getDocument

protected java.awt.print.PrinterJob getDocument()

getOptions

public void getOptions()

getOptions

public void getOptions(java.awt.print.PageFormat pageFormat)

preview

public void preview()
shows the Preview screen of the Chart print.


getProportional

public boolean getProportional()
Print dimensions of Chart proportional to those onscreen.
Default value: true

Returns:
boolean

setProportional

public void setProportional(boolean value)
Sets print dimensions of Chart proportional to those onscreen.
Default value: true

Parameters:
value - boolean

getPrintPanelBackground

public boolean getPrintPanelBackground()
Prints transparent Chart Panel when false.
Default value: false

Returns:
boolean

setPrintPanelBackground

public void setPrintPanelBackground(boolean value)
Prints transparent Chart Panel when false.
Default value: false

Parameters:
value - boolean

getResolution

public int getResolution()
Sets the Chart to detail resolution for printing.
Valid values from from 1 to 100.
Default value: 1

Returns:
int

setResolution

public void setResolution(int value)
Sets the Chart to detail resolution for printing.
Valid values from from 1 to 100.
Default value: 1

Parameters:
value - int

getMarginUnits

public PrintMarginUnit getMarginUnits()
Printer Margin Units as a percentage or hundredths of an inch.
Default value: HundredthsInch

Returns:
PrintMarginUnit

setMarginUnits

public void setMarginUnits(PrintMarginUnit value)
Sets Printer Margin Units.
Default value: HundredthsInch

Parameters:
value - PrintMarginUnit

getUseAntiAlias

public boolean getUseAntiAlias()
Applies anti-alias to plotting Pen when true.
Default value: false

Returns:
boolean

setUseAntiAlias

public void setUseAntiAlias(boolean value)
Applies anti-alias to plotting Pen when true.
Default value: false

Parameters:
value - boolean

getGrayscale

public boolean getGrayscale()
Prints a Grayscale Chart when true.
Default value: false

Returns:
boolean

setGrayscale

public void setGrayscale(boolean value)
Prints a Grayscale Chart when true.
Default value: false

Parameters:
value - boolean

getLandscape

public boolean getLandscape()
Sets the current Printer orientation to Landscape.
Default value: false

Returns:
boolean

setLandscape

public void setLandscape(boolean value)
Sets the current Printer orientation to Landscape when true.
Default value: false

Parameters:
value - boolean

getChartList

public java.util.ArrayList getChartList()

setArrayList

public void setArrayList(java.util.ArrayList value)

getMargins

public PrintMargins getMargins()
The four margins as a percentage of paper dimensions.

Returns:
PrintMargins

setMargins

public void setMargins(PrintMargins value)
Sets the four margins as a percentage or fixed 1/72nd dimension.

Parameters:
value - PrintMargins

setMargins

public void setMargins(int left,
                       int top,
                       int right,
                       int bottom)
Sets the four margins of paper dimensions.
Please see PrintMarginUnit

Parameters:
left - int
top - int
right - int
bottom - int

getPrinterJob

public java.awt.print.PrinterJob getPrinterJob()
Selects the Chart print job to be sent to the currently selected Printer.

Returns:
PrinterJob

getPaperRect

public Rectangle getPaperRect()
Returns


setPrinterJob

public void setPrinterJob(java.awt.print.PrinterJob value)
Selects the Chart print job to be sent to the currently selected Printer.

Parameters:
value - PrinterJob

calcProportionalMargins

public Rectangle calcProportionalMargins(Chart aPanel,
                                         Rectangle bounds)

calcImagePrintMargins

protected Rectangle calcImagePrintMargins(Chart aPanel,
                                          java.awt.print.Paper paper,
                                          java.awt.print.PageFormat pageFormat)

calcImagePrintMargins

protected Rectangle calcImagePrintMargins(Chart aPanel,
                                          Rectangle paperRect)

checkGraphics

public Graphics3D checkGraphics(java.awt.Graphics g)

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pageFormat,
                 int pageIndex)
Specified by:
print in interface java.awt.print.Printable

print

public void print()
           throws java.awt.print.PrinterException
Sends the Chart to the currently selected Printer.

Throws:
java.awt.print.PrinterException

print

public void print(boolean landscape)
           throws java.awt.print.PrinterException
Sends the Chart to the currently selected Printer.
The current Printer orientation (Portrait or Landscape) can be changed prior to printing. Param "landscape", when true, prints page as landscape.

Parameters:
landscape - boolean
Throws:
java.awt.print.PrinterException

getOrientation

public int getOrientation()

setOrientation

public void setOrientation(int orientation)

print

public void print(IBaseChart c,
                  Rectangle r)
Prints Chart c at Rectangle (Left, Top, Width,Height).

Parameters:
c - IBaseChart
r - Rectangle

print

public void print(Rectangle r)
Prints at Rectangle (Left, Top, Width,Height).

Parameters:
r - Rectangle

beginPrint

public void beginPrint()
Start multiple Chart print job.


endPrint

public void endPrint()
              throws java.awt.print.PrinterException
End multiple Chart print job.

Throws:
java.awt.print.PrinterException