Java Platform 1.2
Beta 4

Class java.awt.print.PageFormat

java.lang.Object
  |
  +--java.awt.print.PageFormat

public class PageFormat
extends Object
implements Cloneable
A PageFormat instance describes the size and orientation of a page to be printed.


Field Summary
static int LANDSCAPE
          The origin is at the bottom left of the paper with x running bottom to top and y running left to right.
static int PORTRAIT
          The origin is at the top left of the paper with x running to the right and y running down the paper.
static int REVERSE_LANDSCAPE
          The origin is at the top right of the paper with x running top to bottom and y running right to left.
 
Constructor Summary
PageFormat()
          Create a default, portrait oriented page format.
 
Method Summary
 Object clone()
          Make a copy of this PageFormat.
 double getHeight()
          Return the height, in 1/72nds of an inch, of the page.
 double getImageableHeight()
          Return the height, in 1/72nds of an inch, of the imageable area of the page.
 double getImageableWidth()
          Return the width, in 1/72nds of an inch, of the imageable area of the page.
 double getImageableX()
          Return the x coordinate of the upper left point of the page's imageable area.
 double getImageableY()
          Return the y coordinate of the upper left point of the page's imageable area.
 double[] getMatrix()
          Return a transformation matrix that will translate user space drawing to the requested orientation of the page.
 int getOrientation()
          Return the orientation of this PageFormat.
 Paper getPaper()
          Return a copy of the paper object associated with this PageFormat.
 double getWidth()
          Return the width, in 1/72nds of an inch, of the page.
 void setOrientation(int orientation)
          Set the page orientation.
 void setPaper(Paper paper)
          Set the paper object for this PageFormat.
 
Methods inherited from class java.lang.Object
equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
 

Field Detail

LANDSCAPE

public static final int LANDSCAPE
The origin is at the bottom left of the paper with x running bottom to top and y running left to right. Note that this it not the Macintosh landscape but is the Window's and PostScript landscape.

PORTRAIT

public static final int PORTRAIT
The origin is at the top left of the paper with x running to the right and y running down the paper.

REVERSE_LANDSCAPE

public static final int REVERSE_LANDSCAPE
The origin is at the top right of the paper with x running top to bottom and y running right to left. Note that this is the Macintosh landscape.
Constructor Detail

PageFormat

public PageFormat()
Create a default, portrait oriented page format.
Method Detail

clone

public Object clone()
Make a copy of this PageFormat.
Overrides:
clone in class Object

getWidth

public double getWidth()
Return the width, in 1/72nds of an inch, of the page. This method takes into account the orientation of the page when determining the width.

getHeight

public double getHeight()
Return the height, in 1/72nds of an inch, of the page. This method takes into account the orientation of the page when determining the height.

getImageableX

public double getImageableX()
Return the x coordinate of the upper left point of the page's imageable area. This method takes into account the orientation of the page.

getImageableY

public double getImageableY()
Return the y coordinate of the upper left point of the page's imageable area. This method takes into account the orientation of the page.

getImageableWidth

public double getImageableWidth()
Return the width, in 1/72nds of an inch, of the imageable area of the page. This method takes into account the orientation of the page.

getImageableHeight

public double getImageableHeight()
Return the height, in 1/72nds of an inch, of the imageable area of the page. This method takes into account the orientation of the page.

getPaper

public Paper getPaper()
Return a copy of the paper object associated with this PageFormat.

setPaper

public void setPaper(Paper paper)
Set the paper object for this PageFormat.

setOrientation

public void setOrientation(int orientation)
                    throws IllegalArgumentException
Set the page orientation. 'orientation' must be one of the constants: PORTRAIT, LANDSCAPE, or REVERSE_LANDSCAPE.
Parameters:
orientation - the new orientation for the page
Throws:
IllegalArgumentException - an unknown orientation was requested

getOrientation

public int getOrientation()
Return the orientation of this PageFormat.

getMatrix

public double[] getMatrix()
Return a transformation matrix that will translate user space drawing to the requested orientation of the page. The values are placed into the array as { m00 m10 m01 m11 m02 m12} in the form required by the java.awt.geom.AffineTransform constructor.
See Also:
AffineTransform

Java Platform 1.2
Beta 4

Submit a bug or feature
Submit comments/suggestions about new javadoc look
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.
This documentation was generated with a post-Beta4 version of Javadoc.