Base class for graphics state objects (State pattern, GOF book)
that represents the current pipeline configuration. The Graphics2D
object forwards most of the requests to the state object. The
Graphics2D object itself only administers properties that are not
specific for a certain state.
clearRect
public abstract void clearRect(int x,
int y,
int width,
int height)
clone
public Object clone()
This method may be called to create a new copy of the
Object. The typical behavior is as follows:
o == o.clone()
is falseo.getClass() == o.clone().getClass()
is trueo.equals(o)
is true
However, these are not strict requirements, and may
be violated if necessary. Of the three requirements, the
last is the most commonly violated, particularly if the
subclass does not override
Object.equals(Object)
.
If the Object you call clone() on does not implement
Cloneable
(which is a placeholder interface), then
a CloneNotSupportedException is thrown. Notice that
Object does not implement Cloneable; this method exists
as a convenience for subclasses that do.
Object's implementation of clone allocates space for the
new Object using the correct class, without calling any
constructors, and then fills in all of the new field values
with the old field values. Thus, it is a shallow copy.
However, subclasses are permitted to make a deep copy.
All array types implement Cloneable, and override
this method as follows (it should never fail):
public Object clone()
{
try
{
super.clone();
}
catch (CloneNotSupportedException e)
{
throw new InternalError(e.getMessage());
}
}
- clone in interface Object
copyArea
public abstract void copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
drawArc
public abstract void drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
drawLine
public abstract void drawLine(int x1,
int y1,
int x2,
int y2)
drawOval
public abstract void drawOval(int x,
int y,
int width,
int height)
drawPolygon
public abstract void drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
drawPolyline
public abstract void drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints)
drawRoundRect
public abstract void drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
fillArc
public abstract void fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
fillOval
public abstract void fillOval(int x,
int y,
int width,
int height)
fillPolygon
public abstract void fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
fillRect
public abstract void fillRect(int x,
int y,
int width,
int height)
fillRoundRect
public abstract void fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
rotate
public abstract void rotate(double theta)
rotate
public abstract void rotate(double theta,
double x,
double y)
scale
public abstract void scale(double scaleX,
double scaleY)
shear
public abstract void shear(double shearX,
double shearY)
translate
public abstract void translate(double tx,
double ty)
translate
public abstract void translate(int x,
int y)
Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details.