org.allcolor.yahp.cl.converter.swing
Class CTextPanePrinter

java.lang.Object
  extended by org.allcolor.yahp.cl.converter.swing.CTextPanePrinter

public class CTextPanePrinter
extends java.lang.Object

This class permits to paint a JTextPane in a Graphics2D object.

Version:
v0.98
Author:
Quentin Anciaux

Field Summary
private  java.util.List alreadyPainted
          DOCUMENT ME!
(package private)  boolean hasPaint
           
private  double offsetY
          current page Y offset
private  javax.swing.JTextPane panel
          The panel to print
 
Constructor Summary
CTextPanePrinter(javax.swing.JTextPane pane)
          Creates a new CTextPanePrinter object.
 
Method Summary
 int countPages(IHtmlToPdfTransformer.PageSize pageFormat)
          DOCUMENT ME!
private  void fakePaintView(java.awt.Graphics2D graphics2D, java.awt.Shape allocation, javax.swing.text.View view, java.awt.Rectangle clipRectangle, double scale, double miny)
           
private  void paint(javax.swing.text.View view, java.awt.Graphics2D graphics2D, java.awt.Shape allocation)
          Call the paint or realPaint depending on the element type
private  void paintView(java.awt.Graphics2D graphics2D, java.awt.Shape allocation, javax.swing.text.View view, java.awt.Rectangle clipRectangle, double scale, double miny)
          Paint the views recursively
 void print(java.awt.Graphics2D graphics2D, IHtmlToPdfTransformer.PageSize pageFormat, int pageIndex)
          Print the content of the JTextPane in a page
 void printAll(java.awt.Graphics2D graphics2D, IHtmlToPdfTransformer.PageSize pageFormat)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

panel

private javax.swing.JTextPane panel
The panel to print


alreadyPainted

private final java.util.List alreadyPainted
DOCUMENT ME!


offsetY

private double offsetY
current page Y offset


hasPaint

boolean hasPaint
Constructor Detail

CTextPanePrinter

public CTextPanePrinter(javax.swing.JTextPane pane)
Creates a new CTextPanePrinter object.

Parameters:
pane - The JTextPane to print
Method Detail

countPages

public int countPages(IHtmlToPdfTransformer.PageSize pageFormat)
DOCUMENT ME!

Parameters:
pageFormat - DOCUMENT ME!
Returns:
DOCUMENT ME!

print

public void print(java.awt.Graphics2D graphics2D,
                  IHtmlToPdfTransformer.PageSize pageFormat,
                  int pageIndex)
Print the content of the JTextPane in a page

Parameters:
graphics2D - The Graphics2D object
pageFormat - The page size
pageIndex - The page to print.

printAll

public void printAll(java.awt.Graphics2D graphics2D,
                     IHtmlToPdfTransformer.PageSize pageFormat)

paint

private void paint(javax.swing.text.View view,
                   java.awt.Graphics2D graphics2D,
                   java.awt.Shape allocation)
Call the paint or realPaint depending on the element type

Parameters:
view - the view object to paint
graphics2D - the graphics2D object
allocation - the shape to paint in

fakePaintView

private void fakePaintView(java.awt.Graphics2D graphics2D,
                           java.awt.Shape allocation,
                           javax.swing.text.View view,
                           java.awt.Rectangle clipRectangle,
                           double scale,
                           double miny)

paintView

private void paintView(java.awt.Graphics2D graphics2D,
                       java.awt.Shape allocation,
                       javax.swing.text.View view,
                       java.awt.Rectangle clipRectangle,
                       double scale,
                       double miny)
Paint the views recursively

Parameters:
graphics2D - The graphics2D object
allocation - shape to paint in
view - view to paint
clipRectangle - DOCUMENT ME!
scale - DOCUMENT ME!
miny - DOCUMENT ME!