jimm.datavision
Class PaperFormat

java.lang.Object
  extended by java.awt.print.Paper
      extended by jimm.datavision.PaperFormat
All Implemented Interfaces:
java.lang.Cloneable, Nameable, Writeable

public class PaperFormat
extends java.awt.print.Paper
implements Nameable, Writeable

The class manages lists of paper sizes and instances represents specific paper sizes and orientations. Instances are immutable.

Author:
Jim Menard, jimm@io.com

Field Summary
protected static PaperFormat defaultPaper
           
static int LANDSCAPE
           
protected  java.lang.String latexPaperSizeString
           
protected  java.lang.String name
           
protected static java.util.TreeSet names
           
protected  int orientation
           
protected static java.util.HashMap[] orientations
           
protected  java.awt.print.PageFormat pageFormat
           
static int PORTRAIT
           
protected static java.lang.String RESOURCE_FILE_PREFIX
           
 
Constructor Summary
PaperFormat(int orientation, java.lang.String name, double w, double h, double hMargin, double vMargin, java.lang.String latexPaperSizeString)
           
 
Method Summary
static PaperFormat get(int orientation, java.lang.String name)
           
static PaperFormat getDefault()
           
 java.lang.String getLaTeXPaperSizeString()
           
 java.lang.String getName()
          Returns the name.
 int getOrientation()
           
 java.awt.print.PageFormat getPageFormat()
          Returns a java.awt.print.PageFormat that describes our orientation, size, and margins.
static java.util.Iterator names()
           
 void setName(java.lang.String name)
          A paper format's name is immutable.
 void writeXML(XMLWriter out)
          Writes this object as an XML tag.
 
Methods inherited from class java.awt.print.Paper
clone, getHeight, getImageableHeight, getImageableWidth, getImageableX, getImageableY, getWidth, setImageableArea, setSize
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORTRAIT

public static final int PORTRAIT
See Also:
Constant Field Values

LANDSCAPE

public static final int LANDSCAPE
See Also:
Constant Field Values

RESOURCE_FILE_PREFIX

protected static final java.lang.String RESOURCE_FILE_PREFIX
See Also:
Constant Field Values

orientations

protected static java.util.HashMap[] orientations

names

protected static java.util.TreeSet names

defaultPaper

protected static PaperFormat defaultPaper

name

protected java.lang.String name

orientation

protected int orientation

pageFormat

protected java.awt.print.PageFormat pageFormat

latexPaperSizeString

protected java.lang.String latexPaperSizeString
Constructor Detail

PaperFormat

PaperFormat(int orientation,
            java.lang.String name,
            double w,
            double h,
            double hMargin,
            double vMargin,
            java.lang.String latexPaperSizeString)
Method Detail

get

public static PaperFormat get(int orientation,
                              java.lang.String name)

getDefault

public static PaperFormat getDefault()

names

public static java.util.Iterator names()

getOrientation

public int getOrientation()

getName

public java.lang.String getName()
Description copied from interface: Nameable
Returns the name.

Specified by:
getName in interface Nameable

setName

public void setName(java.lang.String name)
A paper format's name is immutable.

Specified by:
setName in interface Nameable
Parameters:
name - the new name

getLaTeXPaperSizeString

public java.lang.String getLaTeXPaperSizeString()

getPageFormat

public java.awt.print.PageFormat getPageFormat()
Returns a java.awt.print.PageFormat that describes our orientation, size, and margins. Used by print jobs.

Returns:
a page format
See Also:
SwingLE.printReport()

writeXML

public void writeXML(XMLWriter out)
Description copied from interface: Writeable
Writes this object as an XML tag.

Specified by:
writeXML in interface Writeable
Parameters:
out - a writer that knows how to write XML