org.PingOO.DLAI.lib.directorytree
Class DirectoryComponentPrintable

java.lang.Object
  |
  +--org.PingOO.DLAI.lib.directorytree.DirectoryComponentPrintable

public class DirectoryComponentPrintable
extends java.lang.Object
implements java.awt.print.Printable

Driver for printing directory component.
Note: currently this class provides text printing services only, no images, icons or any other binary datas will not be printed.

Since:
PingOO 2.0
Version:
2.0
Author:
Fabrice Bouyé (bouye@cur-archamps.fr)
See Also:
Printable

Field Summary
protected  java.util.Vector componentVector
          The components to be printed.
protected static java.lang.String EQUAL_TAG
           
protected  boolean printAllFields
          Print all the content of the component, even empty fields.
protected static java.lang.String SEPARATOR_TAG
           
protected  TextPrintable textPrintable
          The Printable object to which delegate printing job.
 
Constructor Summary
DirectoryComponentPrintable(DirectoryComponent component)
          Creates a new Printable object in order to print informations contained inside DirectoryComponent.
DirectoryComponentPrintable(DirectoryComponent[] componentArray)
          Creates a new Printable object in order to print informations contained inside DirectoryComponent.
DirectoryComponentPrintable(DirectoryComponent[] componentArray, boolean printAllFields)
          Creates a new Printable object in order to print informations contained inside DirectoryComponent.
DirectoryComponentPrintable(DirectoryComponent component, boolean printAllFields)
          Creates a new Printable object in order to print informations contained inside DirectoryComponent.
 
Method Summary
private  java.lang.String prepareComponent(DirectoryComponent component)
          Prepare a string description of the current directory component.
private  java.lang.String prepareComponents()
          Prepare a string description for all directory components.
protected  java.lang.String prepareString(DirectoryComponent component, java.lang.String key)
          Creates a String description for a given key.
 int print(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int pageIndex)
          Prints the page at the specified index into the specified Graphics context in the specified format.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

SEPARATOR_TAG

protected static final java.lang.String SEPARATOR_TAG

EQUAL_TAG

protected static final java.lang.String EQUAL_TAG

textPrintable

protected TextPrintable textPrintable
The Printable object to which delegate printing job.

componentVector

protected java.util.Vector componentVector
The components to be printed.

printAllFields

protected boolean printAllFields
Print all the content of the component, even empty fields.
Constructor Detail

DirectoryComponentPrintable

public DirectoryComponentPrintable(DirectoryComponent component)
Creates a new Printable object in order to print informations contained inside DirectoryComponent.
Parameters:
component - The component to be printed.

DirectoryComponentPrintable

public DirectoryComponentPrintable(DirectoryComponent component,
                                   boolean printAllFields)
Creates a new Printable object in order to print informations contained inside DirectoryComponent.
Parameters:
component - The component to be printed.
printAllFields - If true print all the content of the component, even empty fields.

DirectoryComponentPrintable

public DirectoryComponentPrintable(DirectoryComponent[] componentArray)
Creates a new Printable object in order to print informations contained inside DirectoryComponent.
Parameters:
componentArray - An array of directory component to be printed.

DirectoryComponentPrintable

public DirectoryComponentPrintable(DirectoryComponent[] componentArray,
                                   boolean printAllFields)
Creates a new Printable object in order to print informations contained inside DirectoryComponent.
Parameters:
componentArray - An array of directory component to be printed.
printAllFields - If true print all the content of the component, even empty fields.
Method Detail

prepareComponents

private java.lang.String prepareComponents()
Prepare a string description for all directory components.
Returns:
A string description for all directory components.

prepareComponent

private java.lang.String prepareComponent(DirectoryComponent component)
Prepare a string description of the current directory component.
Returns:
A string description of the current directory component.

prepareString

protected java.lang.String prepareString(DirectoryComponent component,
                                         java.lang.String key)
Creates a String description for a given key.
Parameters:
key - The key used to make the string description.
Returns:
A String corresponding to the values of the key, or null if the value associated with the key is of binary type.

print

public int print(java.awt.Graphics graphics,
                 java.awt.print.PageFormat pageFormat,
                 int pageIndex)
          throws java.awt.print.PrinterException
Prints the page at the specified index into the specified Graphics context in the specified format.
Specified by:
print in interface java.awt.print.Printable
Parameters:
graphics - The context into which the page is drawn.
pageFormat - The size and orientation of the page being drawn.
pageIndex - The zero based index of the page to be drawn
Returns:
Printable.PAGE_EXISTS if the page is rendered successfully or Printable.NO_SUCH_PAGE if pageIndex specifies a non-existent page.
Throws:
java.awt.print.PrinterException - Thrown when the print job is terminated.