Class awt.PSGraphics
All Packages This Package Previous Next
Class awt.PSGraphics
java.lang.Object
|
+----awt.GenericGraphics
|
+----awt.Graphics
|
+----awt.PSGraphics
-
public class
PSGraphics
-
extends Graphics
PSGraphics is an object that encapsulates a graphics context for a
particular PostScript file.
-
Version:
-
1.15 10 Apr 1995
-
Author:
-
Jim Graham
-
A4
-
-
Executive
-
-
Legal
-
-
Letter
-
-
layoutDim
-
-
marginBottom
-
-
marginLeft
-
-
marginRight
-
-
marginTop
-
-
outputDim
-
-
pageNumber
-
-
paperDim
-
-
title
-
-
PSGraphics(Window, OutputStream, String, Dimension, Dimension)
-
Create a graphics context.
-
PSGraphics(PSGraphics)
-
-
clearClip()
-
Clears the clipping region.
-
clearRect(int, int, int, int)
-
Clears the rectangle indicated by x,y,w,h.
-
clipRect(int, int, int, int)
-
Sets the clipping rectangle for this Graphics context.
-
close()
-
-
copyArea(int, int, int, int, int, int)
-
Copies an area of the window that this graphics context paints to.
-
createChild(int, int, float, float)
-
Create a new Graphics Object based on this one.
-
dispose()
-
Disposes of this Graphics context.
-
drawBytes(byte[], int, int, int, int)
-
Draws the given byte array.
-
drawBytesWidth(byte[], int, int, int, int)
-
Draws the given byte array and return the width in
pixels.
-
drawChars(char[], int, int, int, int)
-
Draws the given character array.
-
drawCharsWidth(char[], int, int, int, int)
-
Draws the given character array and return the width in
pixels.
-
drawImage(Image, int, int)
-
Draws an image at x,y.
-
drawLine(int, int, int, int)
-
Draws the given line.
-
drawRect(int, int, int, int)
-
Draws the given rectangle.
-
drawString(String, int, int)
-
Draws the given string.
-
drawStringWidth(String, int, int)
-
Draws the given string and returns the length of the drawn
string in pixels.
-
endPage()
-
-
fillRect(int, int, int, int)
-
Fills the given rectangle with the foreground color.
-
grestore()
-
-
gsave()
-
-
setBackground(Color)
-
Sets the background color.
-
setFont(Font)
-
Sets the font for all subsequent text-drawing operations.
-
setForeground(Color)
-
Sets the foreground color.
-
setOrigin(int, int)
-
Sets the origin of this Graphics context.
-
setPaper(Dimension)
-
-
setScaling(float, float)
-
Sets the scaling factor for this Graphics context.
-
startPage()
-
Letter
public static Dimension Letter
Legal
public static Dimension Legal
Executive
public static Dimension Executive
A4
public static Dimension A4
title
public String title
paperDim
public Dimension paperDim
layoutDim
public Dimension layoutDim
outputDim
public Dimension outputDim
marginTop
public int marginTop
marginBottom
public int marginBottom
marginLeft
public int marginLeft
marginRight
public int marginRight
pageNumber
public int pageNumber
PSGraphics
public PSGraphics(Window w,
OutputStream os,
String docTitle,
Dimension layout,
Dimension paper)
-
Create a graphics context.
PSGraphics
public PSGraphics(PSGraphics psg)
createChild
public Graphics createChild(int oX,
int oY,
float sX,
float sY)
-
Create a new Graphics Object based on this one.
-
Overrides:
-
createChild in class Graphics
dispose
public void dispose()
-
Disposes of this Graphics context.
-
Overrides:
-
dispose in class Graphics
setPaper
public void setPaper(Dimension paper)
gsave
public synchronized void gsave()
grestore
public synchronized void grestore()
setFont
public void setFont(Font f)
-
Sets the font for all subsequent text-drawing operations.
-
Overrides:
-
setFont in class Graphics
setForeground
public void setForeground(Color c)
-
Sets the foreground color.
-
Overrides:
-
setForeground in class Graphics
setBackground
public void setBackground(Color c)
-
Sets the background color.
-
Overrides:
-
setBackground in class Graphics
clipRect
public synchronized void clipRect(int X,
int Y,
int W,
int H)
-
Sets the clipping rectangle for this Graphics context.
-
Overrides:
-
clipRect in class Graphics
clearClip
public synchronized void clearClip()
-
Clears the clipping region.
-
Overrides:
-
clearClip in class Graphics
clearRect
public void clearRect(int X,
int Y,
int W,
int H)
-
Clears the rectangle indicated by x,y,w,h.
-
Overrides:
-
clearRect in class Graphics
fillRect
public void fillRect(int X,
int Y,
int W,
int H)
-
Fills the given rectangle with the foreground color.
-
Overrides:
-
fillRect in class Graphics
drawRect
public synchronized void drawRect(int X,
int Y,
int W,
int H)
-
Draws the given rectangle.
-
Overrides:
-
drawRect in class Graphics
drawString
public synchronized void drawString(String str,
int x,
int y)
-
Draws the given string.
-
Overrides:
-
drawString in class Graphics
drawChars
public void drawChars(char chars[],
int offset,
int length,
int x,
int y)
-
Draws the given character array.
-
Overrides:
-
drawChars in class Graphics
drawBytes
public void drawBytes(byte bytes[],
int offset,
int length,
int x,
int y)
-
Draws the given byte array.
-
Overrides:
-
drawBytes in class Graphics
drawStringWidth
public int drawStringWidth(String str,
int x,
int y)
-
Draws the given string and returns the length of the drawn
string in pixels. If font isn't set then returns -1.
-
Overrides:
-
drawStringWidth in class Graphics
drawCharsWidth
public int drawCharsWidth(char chars[],
int offset,
int length,
int x,
int y)
-
Draws the given character array and return the width in
pixels. If font isn't set then returns -1.
-
Overrides:
-
drawCharsWidth in class Graphics
drawBytesWidth
public int drawBytesWidth(byte bytes[],
int offset,
int length,
int x,
int y)
-
Draws the given byte array and return the width in
pixels. If font isn't set then returns -1.
-
Overrides:
-
drawBytesWidth in class Graphics
drawLine
public synchronized void drawLine(int x1,
int y1,
int x2,
int y2)
-
Draws the given line.
-
Overrides:
-
drawLine in class Graphics
drawImage
public synchronized void drawImage(Image I,
int X,
int Y)
-
Draws an image at x,y.
-
Overrides:
-
drawImage in class Graphics
copyArea
public void copyArea(int X,
int Y,
int W,
int H,
int dx,
int dy)
-
Copies an area of the window that this graphics context paints to.
Note that this cannot be done in PostScript so we should throw an error.
-
Parameters:
-
X
-
the x-coordinate of the source.
-
Y
-
the y-coordinate of the source.
-
W
-
the width.
-
H
-
the height.
-
dx
-
the x-coordinate of the destination.
-
dy
-
the y-coordinate of the destination.
-
Overrides:
-
copyArea in class Graphics
setOrigin
public void setOrigin(int x,
int y)
-
Sets the origin of this Graphics context. All subsequent
operations are relative to this origin.
-
Overrides:
-
setOrigin in class Graphics
setScaling
public synchronized void setScaling(float sx,
float sy)
-
Sets the scaling factor for this Graphics context. Currently
only used for line and rectangle drawing operations.
-
Overrides:
-
setScaling in class Graphics
startPage
public synchronized void startPage()
endPage
public synchronized void endPage()
close
public synchronized void close()
All Packages This Package Previous Next