Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

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
These orientation constants can be passed to setOrientation().
static int  PORTRAIT
 
static int  REVERSE_LANDSCAPE
 
 

Constructor Summary
 PageFormat()
Create a default, letter sized, portrait oriented page format.
 

Method Summary
Object  clone()
Make a copy of this PageFormat.
Rectangle2D  getImageableArea()
Return a rectangle describing the position and size of the imageable area of the page.
int  getOrientation()
Return the orientation of this PageFormat.
Paper  getPaper()
Return a copy of the paper object associated with this PageFormat.
Rectangle2D  getPaperArea()
Return a rectangle describing the size of the paper to be drawn on.
AffineTransform  getTransform()
Return a transform that will translate user space drawing to the requested orientation orientation of the page, taking into account portait-landscape and horizontal-vertical flipping.
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
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LANDSCAPE

public static final int LANDSCAPE
These orientation constants can be passed to setOrientation(). The following descriptions describe the orientations as they apply to a coordinate system useful for reading text, that is where x runs in the direction of Roman text and y runs in the direction from the first line to the second. 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 The origin is at the top left of the paper with x running to the right and y running down the paper. REVERSE_LANDSCAPE The origin is in 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.

PORTRAIT

public static final int PORTRAIT

REVERSE_LANDSCAPE

public static final int REVERSE_LANDSCAPE
Constructor Detail

PageFormat

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

clone

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

getPaperArea

public Rectangle2D getPaperArea()
Return a rectangle describing the size of the paper to be drawn on. The rectangle returned is in the oriented user space, that is the rectangle has been adjusted to take into account the page orientation. If the paper size is letter but the orientation is landscape, then this method returns a rectangle that is wider than it is tall. The origin of the returned rectangle is always (0, 0)

getImageableArea

public Rectangle2D getImageableArea()
Return a rectangle describing the position and size of the imageable area of the page. This rectangle has been adjusted to take into account the page orientation. The top left of this rectangle is relative to the paper area.

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)
Set the page orientation. 'orientation' must be one of the constants: PORTRAIT, LANDSCAPE, or REVERSE_LANDSCAPE. 11/07/97 Notes: Need to decide on the methods behavior when given an invalid 'orientation'.

getOrientation

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

getTransform

public AffineTransform getTransform()
Return a transform that will translate user space drawing to the requested orientation orientation of the page, taking into account portait-landscape and horizontal-vertical flipping. 01/09/98: Should not return AffineTransform but instead an array.

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

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.