Packages This Package Prev Next Index
public  abstract  class  java.awt.Graphics
    extends  java.lang.Object  (I-§1.12)
{
        // Constructors
    protected Graphics();	§1.20.1
        // Methods
    public abstract void clearRect(int  x, int  y, 	§1.20.2
                                            int width, int  height);
    public abstract void clipRect(int  x, int  y, 	§1.20.3
                                           int width, int height);
    public abstract void	§1.20.4
        copyArea(int  x, int  y, int  width,
                    int  height, int  dx, int  dy);
    public abstract Graphics create();	§1.20.5
    public Graphics create(int  x, int  y,	§1.20.6
                        int  width, int  height);
    public abstract void dispose();	§1.20.7
    public void draw3DRect(int  x, int  y, int  width,	§1.20.8
                                      int  height, boolean  raised);
    public abstract voiddrawArc(int  x, int  y, int  width,	§1.20.9
                                              int  height, int  startAngle,
                            int  arcAngle);
    public void drawBytes(byte  data[], int  offset,	§1.20.10
                                int  length, int  x, int  y);
    public void drawChars(char  data[], int  offset,	§1.20.11
                                int  length, int  x, int  y);
    public abstract boolean	§1.20.12
        drawImage(Image  img, int  x, int  y,  Color  bgcolor,
                    ImageObserver  observer);
    public abstract boolean	§1.20.13
        drawImage(Image  img, int  x, int  y,
                    ImageObserver  observer);
    public abstract boolean	§1.20.14
        drawImage(Image  img, int  x, int  y,
                            int  width, int  height, Color  bgcolor,
                            ImageObserver  observer);
    public abstract boolean	§1.20.15
        drawImage(Image  img, int  x, int  y,
                  int  width, int  height,
                                    ImageObserver  observer);
    public abstract void drawLine(int  x1, int  y1,	§1.20.16
              int  x2,  int  y2);
    public abstract void drawOval(int  x, int  y,	§1.20.17
                                    int width, int  height);
    public abstract void	§1.20.18
        drawPolygon(int  xPoints[], int yPoints[], 
                                int  nPoints);
    public void drawPolygon(Polygon  p);	§1.20.19
    public void drawRect(int  x, int  y,	§1.20.20
                   int  width, int  height);
    public abstract void	§1.20.21
        drawRoundRect(int  x, int  y, int  width,
              int  height, int  arcWidth,
                  int  arcHeight);
    public abstract void	§1.20.22
        drawString(String  str, int  x, int  y);
    public void	§1.20.23
        fill3DRect(int  x, int  y, int  width,
                              int  height, boolean  raised);
    public abstract void	§1.20.24
        fillArc(int  x, int  y, int  width,
                        int  height, int  startAngle,
                        int  arcAngle);
    public abstract void	§1.20.25
        fillOval(int  x, int  y, int  width, int  height);
    public abstract void	§1.20.26
        fillPolygon(int  xPoints[], int  yPoints[], int  nPoints);
    public void fillPolygon(Polygon  p);	§1.20.27
    public abstract void	§1.20.28
        fillRect(int  x, int  y, int  width,  int  height);
    public abstract void	§1.20.29
        fillRoundRect(int  x, int  y, int  width, int height, 
                                    int  arcWidth,  int  arcHeight);
    public void finalize();	§1.20.30
    public abstract Rectangle getClipRect();	§1.20.31
    public abstract Color getColor();	§1.20.32
    public abstract Font getFont();	§1.20.33
    public FontMetrics getFontMetrics();	§1.20.34
    public abstract FontMetrics getFontMetrics(Font  f);	§1.20.35
    public abstract void setColor(Color  c);	§1.20.36
    public abstract void setFont(Font  font);	§1.20.37
    public abstract void setPaintMode();	§1.20.38
    public abstract void setXORMode(Color  c1);	§1.20.39
    public String toString();	§1.20.40
    public abstract void   translate(int  x, int  y);	§1.20.41
}
The Graphics class is the abstract base class for all graphics contexts which allow an application to draw onto components or onto off-screen images.
Unless otherwise stated, all graphics operations performed with a graphics context object only modify bits within the graphic context's clipping region (II-§1.20.3). All drawing or writing is done in the current color (II-§1.20.36) using the current paint mode (II-§1.20.38, §1.20.39) and in the current font (II-§1.20.37).
protected Graphics()
public abstract void
clearRect(int  x, int  y, int  width, int  height)
x
- the x coordinate
y
- the y coordinate
width
- the width of the rectangle
height
- the height of the rectangle
public abstract void
clipRect(int  x, int  y, int  width, int  height)
x
- the x coordinate
y
- the y coordinate
width
- the width of the rectangle
height
- the height of the rectangle
public abstract void
copyArea(int  x, int  y, int  width, int  height,
                  int  dx, int  dy)
, and size 
specified by the width and height arguments. The destination is the rectangle 
with origin 
 and the same width and height.
x
- the x-coordinate of the source
y
- the y-coordinate of the source
width
- the width
height
- the height
dx
- the horizontal distance
dy
- the vertical distance
public abstract Graphics create()
public Graphics
create(int  x, int  y, int  width, int  height)
x
- the x coordinate
y
- the y coordinate
width
- the width of the clipping rectangle
height
- the height of the clipping rectangle
public abstract void dispose()
public void draw3DRect(int  x, int  y, int  width,
                                              int  height, boolean  raised)
x
- the x coordinate
y
- the y coordinate
width
- the width of the rectangle
height
- the height of the rectangle
raised
- if true, the rectangle appears raised; if false, it appears lowered
public abstract void
drawArc(int  x, int  y, int  width, int  height,
                int  startAngle, int  arcAngle)
 
and whose size is specified by the width and height arguments.
x
- the x coordinate
y
- the y coordinate
width
- the width of the rectangle
height
- the height of the rectangle
startAngle
- the beginning angle
arcAngle
- the angle of the arc (relative to startAngle).
public void drawBytes(byte  data[], int  offset,
                                            int  length, int  x, int  y)
 in this graphics context's coordinate system.
data
- the data to be drawn
offset
- the start offset in the data
length
- the number of bytes that are drawn
x
- the x coordinate
y
- the y coordinate
public void drawChars(char  data[], int  offset,
                                            int  length, int  x, int  y)
 in the graphics context's coordinate system.
data
- the array of characters to be drawn
offset
- the start offset in the data
length
- the number of characters to be drawn
x
- the x coordinate
y
- the y coordinate
public abstract boolean
drawImage(Image  img, int  x, int  y, Color  bgcolor,
                    ImageObserver  observer)
 in this graphics 
context's coordinate space. Transparent pixels in the image are drawn in 
the specified background color.
img
- the specified image to be drawn
x
- the x coordinate
y
- the y coordinate
bgcolor
- the background color
observer
- object to notify when the image is loaded.
public abstract boolean
drawImage(Image  img, int  x, int  y, ImageObserver  observer)
 in this graphics 
context's coordinate space. Transparent pixels in the image do not affect 
whatever pixels are already there.
img
- the specified image to be drawn
x
- the x coordinate
y
- the y coordinate
observer
- object to notify when the image is loaded
public abstract boolean
drawImage(Image  img, int  x, int  y, int  width,
                    int  height, Color  bgcolor, ImageObserver  observer)
img
- the specified image to be drawn
x
- the x coordinate
y
- the y coordinate
width
- the width of the rectangle
height
- the height of the rectangle
bgcolor
- background color for the image
observer
- object to notify when the image is loaded
public abstract boolean
drawImage(Image  img, int  x, int  y, int  width,
                    int  height, ImageObserver  observer)
img
- the specified image to be drawn
x
- the x coordinate
y
- the y coordinate
width
- the width of the rectangle
bgcolor
- background color for the image
observer
- object to notify when the image is loaded
public abstract void
drawLine(int  x1, int  y1, int  x2, int  y2)
 to 
 in this graphics context's coordinate system.
x1
- the first point's x coordinate
y1
- the first point's y coordinate
x2
- the second point's x coordinate
y2
- the second point's y coordinate
public abstract void
drawOval(int  x, int  y, int  width, int  height)
 
is this graphics context's coordinate system and whose size is specified by 
the width and height arguments.
x
- the x coordinate
y
- the y coordinate
width
- the width of the rectangle
height
- the height of the rectangle
public abstract void
drawPolygon(int  xPoints[], int  yPoints[], int  nPoints)
 to 
, 
for 
. The last line segment starts at the final point and 
ends at the first point.
xPoints
- an array of x points
yPoints
- an array of y points
nPoints
- the total number of points
public void drawPolygon(Polygon  p)
p
- a polygon
public void drawRect(int  x, int  y, int  width, int  height)
 and 
 respectively. 
The top and bottom edges of the rectangle are at 
 and 
. 
respectively.
x
- the x coordinate
y
- the y coordinate
width
- the width of the rectangle
height
- the height of the rectangle
public abstract void
drawRoundRect(int  x, int  y, int  width, int  height,
                            int  arcWidth, int  arcHeight)
 and 
 respectively. The top and bottom edges of the rectangle are at 
 
and 
. 
x
- the x coordinate
y
- the y coordinate
width
- the width of the rectangle
height
- the height of the rectangle
arcWidth
- the horizontal diameter of the arc at the four corners
arcHeight
- the vertical diameter of the arc at the four corners
public abstract void drawString(String  str, int  x, int  y)
 in the graphics context's 
coordinate system.
str
- the string to be drawn
x
- the x coordinate
y
- the y coordinate
public void fill3DRect(int  x, int  y, int  width,
                                              int  height, boolean  raised)
x
- the x coordinate
y
- the y coordinate
width
- the width of the rectangle
height
- the height of the rectangle
raised
- if true, the rectangle is raised; if false, it is lowered
public abstract void
fillArc(int  x, int  y, int  width, int  height,
                int  startAngle, int  arcAngle)
 
and whose size is specified by the width and height arguments.
x
- the x coordinate
y
- the y coordinate
width
- the width of the rectangle
height
- the height of the rectangle
startAngle
- the beginning angle
arcAngle
- the angle of the arc (relative to startAngle).
public abstract void
fillOval(int  x, int  y, int  width, int  height)
 
is the graphics context's coordinate system and whose size is specified by 
the width and height arguments.
x
- the x coordinate
y
- the y coordinate
width
- the width of the rectangle
height
- the height of the rectangle
public abstract void
fillPolygon(int  xPoints[], int  yPoints[], int  nPoints)
 to 
, for 
. The last line segment starts at the final point and ends at 
the first point.
xPoints
- an array of x points
yPoints
- an array of y points
nPoints
- the total number of points
public void fillPolygon(Polygon  p)
p
- the polygon
public abstract void
fillRect(int  x, int  y, int  width, int  height)
 and 
 respectively. The top and 
bottom edges are at 
 and 
 respectively.
x
- the x coordinate
y
- the y coordinate
width
- the width of the rectangle
height
- the height of the rectangle
public abstract void
fillRoundRect(int  x, int  y, int  width, int  height,
                            int  arcWidth, int  arcHeight)
 and 
 respectively. 
The top and bottom edges are at 
 and 
 respectively.
x
- the x coordinate
y
- the y coordinate
width
- the width of the rectangle
height
- the height of the rectangle
arcWidth
- the horizontal diameter of the arc at the four corners
arcHeight
- the vertical diameter of the arc at the four corners
public void finalize()
public abstract Rectangle getClipRect()
public abstract Color getColor()
public abstract Font getFont()
public FontMetrics getFontMetrics()
public abstract FontMetrics getFontMetrics(Font  f)
f
- the specified font
public abstract void setColor(Color  c)
c
- the color
public abstract void setFont(Font  font)
font
- the font
public abstract void setPaintMode()
public abstract void setXORMode(Color  c1)
c1
- the second color
public String toString()
public abstract void translate(int  x, int  y)
 in this graphics context's original coordinate system.
x
- the x coordinate
y
- the y coordinate
Packages This Package Prev Next IndexJava API Document (HTML generated by dkramer on April 22, 1996)