Class | Tree | Deprecated | Index | Help
PREV | NEXT SHOW LISTS | HIDE LISTS

Class java.awt.print.PageFormat

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

public class PageFormat
extends java.lang.Object
implements java.lang.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
java.lang.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, 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 java.lang.Object clone()
Make a copy of this PageFormat.
Overrides:
clone in class java.lang.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 java.lang.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:
java.lang.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:
java.awt.geom.AffineTransform

Class | Tree | Deprecated | Index | Help
PREV | NEXT SHOW LISTS | HIDE LISTS