All Packages Class Hierarchy This Package Previous Next Index
Class dtai.gwt.GadgetGraphics
java.lang.Object
|
+----dtai.gwt.GadgetGraphics
- public class GadgetGraphics
- extends Object
GadgetGraphics is the abstract base class for all graphic
contexts for various devices.
It was derived from java.awt.Graphics
-
ancestorFont
-
-
ancestorNormalBackground
-
-
ancestorNormalForeground
-
-
ancestorSelectedBackground
-
-
ancestorSelectedForeground
-
-
CENTER
-
-
LEFT
-
-
RIGHT
-
-
GadgetGraphics(Graphics)
- Constructs a new GadgetGraphics Object.
-
GadgetGraphics(Graphics, int, int)
- Constructs a new GadgetGraphics Object.
-
GadgetGraphics(Graphics, int, int, int, int, Gadget)
- Constructs a new GadgetGraphics Object.
-
GadgetGraphics(Graphics, int, int, int, int, Gadget, boolean)
- Constructs a new GadgetGraphics Object.
-
brighter(Color)
- Returns a brighter version of this color.
-
brighter(Color, double)
- Returns a brighter version of this color, given the factor.
-
clearRect(int, int, int, int)
- Clears the specified rectangle by filling it with the current background color
of the current drawing surface.
-
clipRect(int, int, int, int)
- Clips to a rectangle.
-
copyArea(int, int, int, int, int, int)
- Copies an area of the screen.
-
create()
- Creates a new GadgetGraphics Object that is a copy of the original GadgetGraphics Object.
-
create(int, int, int, int)
- Creates a new Graphics Object with the specified parameters, based on the original
Graphics Object.
-
darker(Color)
- Returns a darker version of this color.
-
darker(Color, double)
- Returns a darker version of this color, given the factor.
-
dispose()
- Disposes of this graphics context.
-
draw3DRect(int, int, int, int, boolean)
- Draws a highlighted 3-D rectangle.
-
draw3DRect(int, int, int, int, boolean, boolean, int)
- Draws a highlighted 3-D rectangle.
-
draw3DRect(int, int, int, int, boolean, boolean, int, boolean)
- Draws a highlighted 3-D rectangle.
-
drawArc(int, int, int, int, int, int)
- Draws an arc bounded by the specified rectangle starting at
startAngle, where 0 degrees is at the 3-o'clock position, and
extending for arcAngle degrees.
-
drawArc(int, int, int, int, int, int, int)
- Draws an arc bounded by the specified rectangle starting at
startAngle, where 0 degrees is at the 3-o'clock position, and
extending for arcAngle degrees.
-
drawBytes(byte[], int, int, int, int)
- Draws the specified bytes using the current font and color.
-
drawChars(char[], int, int, int, int)
- Draws the specified characters using the current font and color.
-
drawImage(Image, int, int, Color, ImageObserver)
- Draws the specified image at the specified coordinate (x, y),
with the given solid background Color.
-
drawImage(Image, int, int, ImageObserver)
- Draws the specified image at the specified coordinate (x, y).
-
drawImage(Image, int, int, int, int, Color, ImageObserver)
- Draws the specified image inside the specified rectangle,
with the given solid background Color.
-
drawImage(Image, int, int, int, int, ImageObserver)
- Draws the specified image inside the specified rectangle.
-
drawImage(Image, int, int, int, int, int, int, int, int, Color, ImageObserver)
- drawImage
-
drawImage(Image, int, int, int, int, int, int, int, int, ImageObserver)
- drawImage
-
drawLine(int, int, int, int)
- Draws a line between the coordinates (x1,y1) and (x2,y2).
-
drawLine(int, int, int, int, int)
- Draws a line with thickness between the coordinates
(x1,y1) and (x2,y2).
-
drawLine(int, int, int, int, int, int, int)
- Draws a line with thickness and possible dash between the coordinates
(x1,y1) and (x2,y2).
-
drawLine(int, int, int, int, int, int, int, int, int)
- Draws a line with thickness and possible dash between the coordinates
(x1,y1) and (x2,y2).
-
drawOval(int, int, int, int)
- Draws an oval inside the specified rectangle using the current color.
-
drawOval(int, int, int, int, int)
- Draws an oval inside the specified rectangle using the current color.
-
drawPoly(int[], int[], int, boolean)
- drawPoly
Draws a polyline defined by an array of x points and y points.
-
drawPoly(int[], int[], int, int, boolean)
- drawPoly
Draws a polyline defined by an array of x points and y points.
-
drawPoly(int[], int[], int, int, int, int, boolean)
- drawPoly
Draws a polyline defined by an array of x points and y points.
-
drawPoly(int[], int[], int, int, int, int, int, boolean)
- drawPoly
Draws a polyline defined by an array of x points and y points.
-
drawPoly(Polygon, boolean)
- drawPoly
Draws a polyline defined by an array of x points and y points.
-
drawPoly(Polygon, int, boolean)
- drawPoly
Draws a polyline defined by an array of x points and y points.
-
drawPoly(Polygon, int, int, int, boolean)
- drawPoly
Draws a polyline defined by an array of x points and y points.
-
drawPoly(Polygon, int, int, int, int, boolean)
- drawPoly
Draws a polyline defined by an array of x points and y points.
-
drawPolygon(int[], int[], int)
- Draws a polygon defined by an array of x points and y points.
-
drawPolygon(int[], int[], int, int)
- Draws a polygon defined by an array of x points and y points.
-
drawPolygon(int[], int[], int, int, int, int)
- Draws a polygon defined by an array of x points and y points.
-
drawPolygon(int[], int[], int, int, int, int, int)
- Draws a polygon defined by an array of x points and y points.
-
drawPolygon(Polygon)
- Draws a polygon defined by the specified point.
-
drawPolygon(Polygon, int)
- Draws a polygon defined by the specified point.
-
drawPolygon(Polygon, int, int, int)
- Draws a polygon defined by the specified point.
-
drawPolygon(Polygon, int, int, int, int)
- Draws a polygon defined by the specified point.
-
drawPolyline(int[], int[], int)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
-
drawPolyline(int[], int[], int, int)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
-
drawPolyline(int[], int[], int, int, int, int)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
-
drawPolyline(int[], int[], int, int, int, int, int)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
-
drawPolyline(Polygon)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
-
drawPolyline(Polygon, int)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
-
drawPolyline(Polygon, int, int, int)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
-
drawPolyline(Polygon, int, int, int, int)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
-
drawRect(int, int, int, int)
- Draws the outline of the specified rectangle using the current color.
-
drawRect(int, int, int, int, int)
- Draws the outline of the specified rectangle using the current color.
-
drawRect(int, int, int, int, int, int, int)
- Draws the outline of the specified rectangle using the current color.
-
drawRect(int, int, int, int, int, int, int, int)
- Draws the outline of the specified rectangle using the current color.
-
drawRoundRect(int, int, int, int, int, int)
- Draws an outlined rounded corner rectangle using the current color.
-
drawRoundRect(int, int, int, int, int, int, int)
- Draws an outlined rounded corner rectangle using the current color.
-
drawString(String, int, int)
- Draws the specified String using the current font and color.
-
fill3DRect(int, int, int, int, boolean)
- Paints a highlighted 3-D rectangle using the current color.
-
fillArc(int, int, int, int, int, int)
- Fills an arc using the current color.
-
fillOval(int, int, int, int)
- Fills an oval inside the specified rectangle using the current color.
-
fillPolygon(int[], int[], int)
- Fills a polygon with the current color using an
even-odd fill rule (otherwise known as an alternating rule).
-
fillPolygon(Polygon)
- Fills the specified polygon with the current color using an
even-odd fill rule (otherwise known as an alternating rule).
-
fillRect(int, int, int, int)
- Fills the specified rectangle with the current color.
-
fillRoundRect(int, int, int, int, int, int)
- Draws a rounded rectangle filled in with the current color.
-
finalize()
- Disposes of this graphics context once it is no longer referenced.
-
getClipBounds()
- getClipBounds
-
getClipRect()
- Returns the bounding rectangle of the current clipping area.
-
getColor()
- Gets the current color.
-
getFont()
- Gets the current font.
-
getFontMetrics()
- Gets the current font metrics.
-
getFontMetrics(Font)
- Gets the current font metrics for the specified font.
-
getGadget()
-
-
getOffset()
- Gets the offset as translated from the original point.
-
getOrigGraphics()
- Gets the original AWT graphics from which this GadgetGraphics object was built.
-
isDisposed()
- If true, the Graphics resources have been disposed of and the GadgetGraphics should
not be used.
-
isPaintingAll()
- If false, only paints things that were marked as needing to be painted.
-
setClip(int, int, int, int)
- setClip
-
setColor(Color)
- Sets the current color to the specified color.
-
setFont(Font)
- Sets the font for all subsequent text-drawing operations.
-
setGadget(Gadget)
-
-
setPaintingAll(boolean)
- If false, only paints things that were marked as needing to be painted.
-
setPaintMode()
- Sets the paint mode to overwrite the destination with the
current color.
-
setXORMode(Color)
- Sets the paint mode to alternate between the current color
and the new specified color.
-
toString()
- Returns a String object representing this Graphic's value.
-
translate(int, int)
- Translates the specified parameters into the origin of the graphics context.
LEFT
public static final int LEFT
CENTER
public static final int CENTER
RIGHT
public static final int RIGHT
ancestorNormalBackground
public Color ancestorNormalBackground
ancestorSelectedBackground
public Color ancestorSelectedBackground
ancestorNormalForeground
public Color ancestorNormalForeground
ancestorSelectedForeground
public Color ancestorSelectedForeground
ancestorFont
public Font ancestorFont
GadgetGraphics
protected GadgetGraphics(Graphics awtGraphics)
- Constructs a new GadgetGraphics Object. Graphic contexts cannot be
created directly. They must be obtained from another graphics
context or created by a Gadget.
- Parameters:
- awtGraphics - the Graphics from which this was created
- See Also:
- getGadgetGraphics, getGadgetGraphics, create
GadgetGraphics
public GadgetGraphics(Graphics awtGraphics,
int origWidth,
int origHeight)
- Constructs a new GadgetGraphics Object. Graphic contexts cannot be
created directly. They must be obtained from another graphics
context or created by a Gadget.
- Parameters:
- Graphics - the Graphics from which this was created
- origWidth - the original width
- origHeight - the original height
- See Also:
- getGadgetGraphics, create
GadgetGraphics
public GadgetGraphics(Graphics awtGraphics,
int xOffset,
int yOffset,
int origWidth,
int origHeight,
Gadget gadget)
- Constructs a new GadgetGraphics Object. Graphic contexts cannot be
created directly. They must be obtained from another graphics
context or created by a Gadget.
- Parameters:
- Graphics - the Graphics from which this was created
- xOffset - the x offset
- yOffset - the y offset
- origWidth - the original width
- origHeight - the original height
- Gadget - the Gadget from which this was created
- See Also:
- getGadgetGraphics, create
GadgetGraphics
protected GadgetGraphics(Graphics awtGraphics,
int xOffset,
int yOffset,
int origWidth,
int origHeight,
Gadget gadget,
boolean paintingAll)
- Constructs a new GadgetGraphics Object. Graphic contexts cannot be
created directly. They must be obtained from another graphics
context or created by a Gadget.
- Parameters:
- Graphics - the Graphics from which this was created
- xOffset - the x offset
- yOffset - the y offset
- origWidth - the original width
- origHeight - the original height
- Gadget - the Gadget from which this was created
- paintingAll - if false, only paint's things that were marked as needing to be painted
- See Also:
- getGadgetGraphics, create
create
public GadgetGraphics create()
- Creates a new GadgetGraphics Object that is a copy of the original GadgetGraphics Object.
- Returns:
- GadgetGraphics
create
public GadgetGraphics create(int x,
int y,
int width,
int height)
- Creates a new Graphics Object with the specified parameters, based on the original
Graphics Object.
This method translates the specified parameters, x and y, to
the proper origin coordinates and then clips the Graphics Object to the
area.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the area
- height - the height of the area
- Returns:
- GadgetGraphics
- See Also:
- translate
setPaintingAll
public void setPaintingAll(boolean paintingAll)
- If false, only paints things that were marked as needing to be painted.
- Parameters:
- paintingAll - the flag
isPaintingAll
public boolean isPaintingAll()
- If false, only paints things that were marked as needing to be painted.
- Returns:
- the flag
isDisposed
public boolean isDisposed()
- If true, the Graphics resources have been disposed of and the GadgetGraphics should
not be used.
- Returns:
- the flag
translate
public void translate(int x,
int y)
- Translates the specified parameters into the origin of the graphics context. All subsequent
operations on this graphics context will be relative to this origin.
- Parameters:
- x - the x coordinate
- y - the y coordinate
getOffset
public Point getOffset()
- Gets the offset as translated from the original point.
- Returns:
- Point
getOrigGraphics
public Graphics getOrigGraphics()
- Gets the original AWT graphics from which this GadgetGraphics object was built.
- Returns:
- Graphics
getColor
public Color getColor()
- Gets the current color.
- Returns:
- Color
- See Also:
- setColor
setColor
public void setColor(Color c)
- Sets the current color to the specified color. All subsequent graphics operations
will use this specified color.
- Parameters:
- c - the color to be set
- See Also:
- Color, getColor
setPaintMode
public void setPaintMode()
- Sets the paint mode to overwrite the destination with the
current color.
setXORMode
public void setXORMode(Color c1)
- Sets the paint mode to alternate between the current color
and the new specified color. When drawing operations are
performed, pixels which are the current color will be changed
to the specified color and vice versa. Pixels of colors other
than those two colors will be changed in an unpredictable, but
reversible manner - if you draw the same figure twice then all
pixels will be restored to their original values.
- Parameters:
- c1 - the second color
getFont
public Font getFont()
- Gets the current font.
- Returns:
- Font
- See Also:
- setFont
setFont
public void setFont(Font font)
- Sets the font for all subsequent text-drawing operations.
- Parameters:
- font - the specified font
- See Also:
- Font, getFont, drawString, drawBytes, drawChars
getFontMetrics
public FontMetrics getFontMetrics()
- Gets the current font metrics.
- Returns:
- FontMetrics
- See Also:
- getFont
getFontMetrics
public FontMetrics getFontMetrics(Font f)
- Gets the current font metrics for the specified font.
- Parameters:
- f - the specified font
- Returns:
- FontMetrics
- See Also:
- getFont, getFontMetrics
getClipRect
public Rectangle getClipRect()
- Returns the bounding rectangle of the current clipping area.
- Returns:
- Rectangle
- See Also:
- clipRect
clipRect
public void clipRect(int x,
int y,
int width,
int height)
- Clips to a rectangle. The resulting clipping area is the
intersection of the current clipping area and the specified
rectangle. Graphic operations have no effect outside of the
clipping area.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the rectangle
- height - the height of the rectangle
- See Also:
- getClipRect
copyArea
public void copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
- Copies an area of the screen.
- Parameters:
- 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
drawLine
public void drawLine(int x1,
int y1,
int x2,
int y2)
- Draws a line between the coordinates (x1,y1) and (x2,y2). The line is drawn
below and to the left of the logical coordinates.
- Parameters:
- 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
drawLine
public void drawLine(int x1,
int y1,
int x2,
int y2,
int thickness)
- Draws a line with thickness between the coordinates
(x1,y1) and (x2,y2). The line is drawn
below and to the left of the logical coordinates.
- Parameters:
- 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
- thickness - the line thickness, to be distributed around both sides of the line
drawLine
public void drawLine(int x1,
int y1,
int x2,
int y2,
int thickness,
int dashOnLen,
int dashOffLen)
- Draws a line with thickness and possible dash between the coordinates
(x1,y1) and (x2,y2). The line is drawn
below and to the left of the logical coordinates.
- Parameters:
- 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
- thickness - the line thickness, to be distributed around both sides of the line
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
drawLine
public int drawLine(int x1,
int y1,
int x2,
int y2,
int thickness,
int dashOnLen,
int dashOffLen,
int align,
int dashStart)
- Draws a line with thickness and possible dash between the coordinates
(x1,y1) and (x2,y2). The line is drawn
below and to the left of the logical coordinates.
- Parameters:
- 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
- thickness - the line thickness, to be distributed around both sides of the line
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
- dashStart - pixel length to skip from beginning of first dash
- align - CENTER thick lines over the line from point to point, or put it
to the RIGHT or to the LEFT. IMPORTANT: RIGHT does NOT always mean right. If the line
goes up (y2 < y1), then RIGHT is right. If the line goes down, RIGHT is left. If the line
goes from left to right, RIGHT is down, etc. It is really based on the direction of motion
from the first point to the next.
- Returns:
- dashEnd pixel length from beginning of last dash to beginning of what would be
the next dash, if the line were longer. Pass this as dashStart for next line if it
connects to this line's end
fillRect
public void fillRect(int x,
int y,
int width,
int height)
- Fills the specified rectangle with the current color.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the rectangle
- height - the height of the rectangle
- See Also:
- drawRect, clearRect
setGadget
public void setGadget(Gadget gadget)
getGadget
public Gadget getGadget()
drawRect
public void drawRect(int x,
int y,
int width,
int height)
- Draws the outline of the specified rectangle using the current color.
Use drawRect(x, y, width-1, height-1) to draw the outline inside the specified
rectangle.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the rectangle
- height - the height of the rectangle
- See Also:
- fillRect, clearRect
drawRect
public void drawRect(int x,
int y,
int width,
int height,
int thickness)
- Draws the outline of the specified rectangle using the current color.
Use drawRect(x, y, width-1, height-1) to draw the outline inside the specified
rectangle.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the rectangle
- height - the height of the rectangle
- thickness - the line thickness, drawn inside
- See Also:
- fillRect, clearRect
drawRect
public void drawRect(int x,
int y,
int width,
int height,
int thickness,
int dashOnLen,
int dashOffLen)
- Draws the outline of the specified rectangle using the current color.
Use drawRect(x, y, width-1, height-1) to draw the outline inside the specified
rectangle.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the rectangle
- height - the height of the rectangle
- thickness - the line thickness, drawn inside
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
- See Also:
- fillRect, clearRect
drawRect
public void drawRect(int x,
int y,
int width,
int height,
int thickness,
int dashOnLen,
int dashOffLen,
int align)
- Draws the outline of the specified rectangle using the current color.
Use drawRect(x, y, width-1, height-1) to draw the outline inside the specified
rectangle.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the rectangle
- height - the height of the rectangle
- thickness - the line thickness, drawn inside
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
- align - CENTER thick lines over the line from point to point, or put it
to the RIGHT or to the LEFT. IMPORTANT: RIGHT does NOT always mean right. If the line
goes up (y2 < y1), then RIGHT is right. If the line goes down, RIGHT is left. If the line
goes from left to right, RIGHT is down, etc. It is really based on the direction of motion
from the first point to the next. The rectangle is drawn in a clockwise direction, so RIGHT
means the lines are drawn inside, LEFT outside.
- See Also:
- fillRect, clearRect
clearRect
public void clearRect(int x,
int y,
int width,
int height)
- Clears the specified rectangle by filling it with the current background color
of the current drawing surface.
Which drawing surface it selects depends on how the graphics context
was created.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the rectangle
- height - the height of the rectangle
- See Also:
- fillRect, drawRect
drawRoundRect
public void drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
- Draws an outlined rounded corner rectangle using the current color.
- Parameters:
- 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 horizontal diameter of the arc at the four corners
- See Also:
- fillRoundRect
drawRoundRect
public void drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight,
int thickness)
- Draws an outlined rounded corner rectangle using the current color.
- Parameters:
- 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 horizontal diameter of the arc at the four corners
- thickness - the line thickness, drawn inside
- See Also:
- fillRoundRect
fillRoundRect
public void fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
- Draws a rounded rectangle filled in with the current color.
- Parameters:
- 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 horizontal diameter of the arc at the four corners
- See Also:
- drawRoundRect
draw3DRect
public void draw3DRect(int x,
int y,
int width,
int height,
boolean raised)
- Draws a highlighted 3-D rectangle.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the rectangle
- height - the height of the rectangle
- raised - a boolean that states whether the rectangle is raised or not
fill3DRect
public void fill3DRect(int x,
int y,
int width,
int height,
boolean raised)
- Paints a highlighted 3-D rectangle using the current color.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the rectangle
- height - the height of the rectangle
- raised - a boolean that states whether the rectangle is raised or not
draw3DRect
public void draw3DRect(int x,
int y,
int width,
int height,
boolean raised,
boolean etched,
int thickness)
- Draws a highlighted 3-D rectangle.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the rectangle
- height - the height of the rectangle
- raised - a boolean that states whether the rectangle is raised or not
- etched - a boolean that states whether the rectangle is to be drawn
as etched or not. In fact, if "raised" is true, this has an embossed effect.
This requires the thickness to be greater than 1 for the effect to work.
- thickness - the line thickness, drawn inside
draw3DRect
public void draw3DRect(int x,
int y,
int width,
int height,
boolean raised,
boolean etched,
int thickness,
boolean closeShaved)
- Draws a highlighted 3-D rectangle.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the rectangle
- height - the height of the rectangle
- raised - a boolean that states whether the rectangle is raised or not
- etched - a boolean that states whether the rectangle is to be drawn
as etched or not. In fact, if "raised" is true, this has an embossed effect.
This requires the thickness to be greater than 1 for the effect to work.
- thickness - the line thickness, drawn inside
- closeShaved - draws the button with thin topshadow
drawOval
public void drawOval(int x,
int y,
int width,
int height)
- Draws an oval inside the specified rectangle using the current color.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the rectangle
- height - the height of the rectangle
- See Also:
- fillOval
drawOval
public void drawOval(int x,
int y,
int width,
int height,
int thickness)
- Draws an oval inside the specified rectangle using the current color.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the rectangle
- height - the height of the rectangle
- thickness - the line thickness, drawn inside
- See Also:
- fillOval
fillOval
public void fillOval(int x,
int y,
int width,
int height)
- Fills an oval inside the specified rectangle using the current color.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the rectangle
- height - the height of the rectangle
- See Also:
- drawOval
drawArc
public void drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
- Draws an arc bounded by the specified rectangle starting at
startAngle, where 0 degrees is at the 3-o'clock position, and
extending for arcAngle degrees. Positive values for arcAngle
indicate counter-clockwise rotations, negative values indicate
clockwise rotations.
- Parameters:
- 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).
- See Also:
- fillArc
drawArc
public void drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle,
int thickness)
- Draws an arc bounded by the specified rectangle starting at
startAngle, where 0 degrees is at the 3-o'clock position, and
extending for arcAngle degrees. Positive values for arcAngle
indicate counter-clockwise rotations, negative values indicate
clockwise rotations.
- Parameters:
- 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).
- thickness - the line thickness, drawn inside
- See Also:
- fillArc
fillArc
public void fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
- Fills an arc using the current color. This generates a pie shape.
The extent of the arc is the same as is described for the drawArc
method.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the arc
- height - the height of the arc
- startAngle - the beginning angle
- arcAngle - the angle of the arc (relative to startAngle).
- See Also:
- drawArc
drawPolygon
public void drawPolygon(int xPoints[],
int yPoints[],
int nPoints)
- Draws a polygon defined by an array of x points and y points.
- Parameters:
- xPoints - an array of x points
- yPoints - an array of y points
- nPoints - the total number of points
- See Also:
- fillPolygon
drawPolygon
public void drawPolygon(int xPoints[],
int yPoints[],
int nPoints,
int thickness)
- Draws a polygon defined by an array of x points and y points.
- Parameters:
- xPoints - an array of x points
- yPoints - an array of y points
- nPoints - the total number of points
- thickness - the line thickness, drawn on either side of the line
- See Also:
- fillPolygon
drawPolygon
public void drawPolygon(int xPoints[],
int yPoints[],
int nPoints,
int thickness,
int dashOnLen,
int dashOffLen)
- Draws a polygon defined by an array of x points and y points.
- Parameters:
- xPoints - an array of x points
- yPoints - an array of y points
- nPoints - the total number of points
- thickness - the line thickness, drawn on either side of the line
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
- See Also:
- fillPolygon
drawPolygon
public void drawPolygon(int xPoints[],
int yPoints[],
int nPoints,
int thickness,
int dashOnLen,
int dashOffLen,
int align)
- Draws a polygon defined by an array of x points and y points.
- Parameters:
- xPoints - an array of x points
- yPoints - an array of y points
- nPoints - the total number of points
- thickness - the line thickness, drawn on either side of the line
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
- align - CENTER thick lines over the line from point to point, or put it
to the RIGHT or to the LEFT. IMPORTANT: RIGHT does NOT always mean right. If the line
goes up (y2 < y1), then RIGHT is right. If the line goes down, RIGHT is left. If the line
goes from left to right, RIGHT is down, etc. It is really based on the direction of motion
from the first point to the next.
- See Also:
- fillPolygon
drawPolygon
public void drawPolygon(Polygon p)
- Draws a polygon defined by the specified point.
- Parameters:
- p - the specified polygon
- See Also:
- fillPolygon
drawPolygon
public void drawPolygon(Polygon p,
int thickness)
- Draws a polygon defined by the specified point.
- Parameters:
- p - the specified polygon
- thickness - the line thickness, drawn on either side of the line
- See Also:
- fillPolygon
drawPolygon
public void drawPolygon(Polygon p,
int thickness,
int dashOnLen,
int dashOffLen)
- Draws a polygon defined by the specified point.
- Parameters:
- p - the specified polygon
- thickness - the line thickness, drawn on either side of the line
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
- See Also:
- fillPolygon
drawPolygon
public void drawPolygon(Polygon p,
int thickness,
int dashOnLen,
int dashOffLen,
int align)
- Draws a polygon defined by the specified point.
- Parameters:
- p - the specified polygon
- thickness - the line thickness, drawn on either side of the line
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
- See Also:
- fillPolygon
fillPolygon
public void fillPolygon(int xPoints[],
int yPoints[],
int nPoints)
- Fills a polygon with the current color using an
even-odd fill rule (otherwise known as an alternating rule).
- Parameters:
- xPoints - an array of x points
- yPoints - an array of y points
- nPoints - the total number of points
- See Also:
- drawPolygon
fillPolygon
public void fillPolygon(Polygon p)
- Fills the specified polygon with the current color using an
even-odd fill rule (otherwise known as an alternating rule).
- Parameters:
- p - the polygon
- See Also:
- drawPolygon
drawString
public void drawString(String str,
int x,
int y)
- Draws the specified String using the current font and color.
The x,y position is the starting point of the baseline of the String.
- Parameters:
- str - the String to be drawn
- x - the x coordinate
- y - the y coordinate
- See Also:
- drawChars, drawBytes
drawChars
public void drawChars(char data[],
int offset,
int length,
int x,
int y)
- Draws the specified characters using the current font and color.
- Parameters:
- 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
- See Also:
- drawString, drawBytes
drawBytes
public void drawBytes(byte data[],
int offset,
int length,
int x,
int y)
- Draws the specified bytes using the current font and color.
- Parameters:
- 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
- See Also:
- drawString, drawChars
drawImage
public boolean drawImage(Image img,
int x,
int y,
ImageObserver observer)
- Draws the specified image at the specified coordinate (x, y). If the image is
incomplete the image observer will be notified later.
- Parameters:
- img - the specified image to be drawn
- x - the x coordinate
- y - the y coordinate
- observer - notifies if the image is complete or not
- Returns:
- boolean
- See Also:
- Image, ImageObserver
drawImage
public boolean drawImage(Image img,
int x,
int y,
int width,
int height,
ImageObserver observer)
- Draws the specified image inside the specified rectangle. The image is
scaled if necessary. If the image is incomplete the image observer will be
notified later.
- Parameters:
- 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
- observer - notifies if the image is complete or not
- Returns:
- boolean
- See Also:
- Image, ImageObserver
drawImage
public boolean drawImage(Image img,
int x,
int y,
Color bgcolor,
ImageObserver observer)
- Draws the specified image at the specified coordinate (x, y),
with the given solid background Color. If the image is
incomplete the image observer will be notified later.
- Parameters:
- img - the specified image to be drawn
- x - the x coordinate
- y - the y coordinate
- observer - notifies if the image is complete or not
- Returns:
- booleam
- See Also:
- Image, ImageObserver
drawImage
public boolean drawImage(Image img,
int x,
int y,
int width,
int height,
Color bgcolor,
ImageObserver observer)
- Draws the specified image inside the specified rectangle,
with the given solid background Color. The image is
scaled if necessary. If the image is incomplete the image
observer will be notified later.
- Parameters:
- 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
- observer - notifies if the image is complete or not
- Returns:
- boolean
- See Also:
- Image, ImageObserver
drawPolyline
public void drawPolyline(int xpoints[],
int ypoints[],
int npoints)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
- Parameters:
- xpointsp[] - the array of x coordinates
- ypoints[] - the array of y coordinates
- npoints - the number of points in the polyline
drawPolyline
public void drawPolyline(int xpoints[],
int ypoints[],
int npoints,
int thickness)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
- Parameters:
- xpointsp[] - the array of x coordinates
- ypoints[] - the array of y coordinates
- npoints - the number of points in the polyline
- thickness - the line thickness, drawn on either side of the line
drawPolyline
public void drawPolyline(int xpoints[],
int ypoints[],
int npoints,
int thickness,
int dashOnLen,
int dashOffLen)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
- Parameters:
- xpointsp[] - the array of x coordinates
- ypoints[] - the array of y coordinates
- npoints - the number of points in the polyline
- thickness - the line thickness, drawn on either side of the line
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
drawPolyline
public void drawPolyline(int xpoints[],
int ypoints[],
int npoints,
int thickness,
int dashOnLen,
int dashOffLen,
int align)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
- Parameters:
- xpointsp[] - the array of x coordinates
- ypoints[] - the array of y coordinates
- npoints - the number of points in the polyline
- thickness - the line thickness, drawn on either side of the line
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
- align - CENTER thick lines over the line from point to point, or put it
to the RIGHT or to the LEFT. IMPORTANT: RIGHT does NOT always mean right. If the line
goes up (y2 < y1), then RIGHT is right. If the line goes down, RIGHT is left. If the line
goes from left to right, RIGHT is down, etc. It is really based on the direction of motion
from the first point to the next.
drawPolyline
public void drawPolyline(Polygon p)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
- Parameters:
- p - the polygon of points to draw.
drawPolyline
public void drawPolyline(Polygon p,
int thickness)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
- Parameters:
- p - the polygon of points to draw.
- thickness - the line thickness, drawn on either side of the line
drawPolyline
public void drawPolyline(Polygon p,
int thickness,
int dashOnLen,
int dashOffLen)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
- Parameters:
- p - the polygon of points to draw.
- thickness - the line thickness, drawn on either side of the line
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
drawPolyline
public void drawPolyline(Polygon p,
int thickness,
int dashOnLen,
int dashOffLen,
int align)
- drawPolyline
Draws a polyline defined by an array of x points and y points.
- Parameters:
- p - the polygon of points to draw.
- thickness - the line thickness, drawn on either side of the line
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
- align - CENTER thick lines over the line from point to point, or put it
to the RIGHT or to the LEFT. IMPORTANT: RIGHT does NOT always mean right. If the line
goes up (y2 < y1), then RIGHT is right. If the line goes down, RIGHT is left. If the line
goes from left to right, RIGHT is down, etc. It is really based on the direction of motion
from the first point to the next.
drawPoly
public void drawPoly(int xpoints[],
int ypoints[],
int npoints,
boolean CLOSED)
- drawPoly
Draws a polyline defined by an array of x points and y points.
- Parameters:
- xpointsp[] - the array of x coordinates
- ypoints[] - the array of y coordinates
- npoints - the number of points in the polyline
- CLOSED - if true, the polyline closes itself, with the end
point being the starting point. If false, the polygon is not closed.
drawPoly
public void drawPoly(int xpoints[],
int ypoints[],
int npoints,
int thickness,
boolean CLOSED)
- drawPoly
Draws a polyline defined by an array of x points and y points.
- Parameters:
- xpointsp[] - the array of x coordinates
- ypoints[] - the array of y coordinates
- npoints - the number of points in the polyline
- thickness - the line thickness, drawn on either side of the line
- CLOSED - if true, the polyline closes itself, with the end
point being the starting point. If false, the polygon is not closed.
drawPoly
public void drawPoly(int xpoints[],
int ypoints[],
int npoints,
int thickness,
int dashOnLen,
int dashOffLen,
boolean CLOSED)
- drawPoly
Draws a polyline defined by an array of x points and y points.
- Parameters:
- xpointsp[] - the array of x coordinates
- ypoints[] - the array of y coordinates
- npoints - the number of points in the polyline
- thickness - the line thickness, drawn on either side of the line
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
- CLOSED - if true, the polyline closes itself, with the end
point being the starting point. If false, the polygon is not closed.
drawPoly
public void drawPoly(int xpoints[],
int ypoints[],
int npoints,
int thickness,
int dashOnLen,
int dashOffLen,
int align,
boolean CLOSED)
- drawPoly
Draws a polyline defined by an array of x points and y points.
- Parameters:
- xpointsp[] - the array of x coordinates
- ypoints[] - the array of y coordinates
- npoints - the number of points in the polyline
- thickness - the line thickness, drawn on either side of the line
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
- align - CENTER thick lines over the line from point to point, or put it
to the RIGHT or to the LEFT. IMPORTANT: RIGHT does NOT always mean right. If the line
goes up (y2 < y1), then RIGHT is right. If the line goes down, RIGHT is left. If the line
goes from left to right, RIGHT is down, etc. It is really based on the direction of motion
from the first point to the next.
- CLOSED - if true, the polyline closes itself, with the end
point being the starting point. If false, the polygon is not closed.
drawPoly
public void drawPoly(Polygon p,
boolean CLOSED)
- drawPoly
Draws a polyline defined by an array of x points and y points.
- Parameters:
- p - the polygon of points to draw.
- CLOSED - if true, the polyline closes itself, with the end
point being the starting point.
drawPoly
public void drawPoly(Polygon p,
int thickness,
boolean CLOSED)
- drawPoly
Draws a polyline defined by an array of x points and y points.
- Parameters:
- p - the polygon of points to draw.
- thickness - the line thickness, drawn on either side of the line
- CLOSED - if true, the polyline closes itself, with the end
point being the starting point. If false, the polygon is not closed.
drawPoly
public void drawPoly(Polygon p,
int thickness,
int dashOnLen,
int dashOffLen,
boolean CLOSED)
- drawPoly
Draws a polyline defined by an array of x points and y points.
- Parameters:
- p - the polygon of points to draw.
- thickness - the line thickness, drawn on either side of the line
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
- CLOSED - if true, the polyline closes itself, with the end
point being the starting point. If false, the polygon is not closed.
drawPoly
public void drawPoly(Polygon p,
int thickness,
int dashOnLen,
int dashOffLen,
int align,
boolean CLOSED)
- drawPoly
Draws a polyline defined by an array of x points and y points.
- Parameters:
- p - the polygon of points to draw.
- thickness - the line thickness, drawn on either side of the line
- dashOnLen - the pixel length of the dash (must be greater than zero)
- dashOffLen - the pixel length of the space between dashes (set to zero if no dashes)
- align - CENTER thick lines over the line from point to point, or put it
to the RIGHT or to the LEFT. IMPORTANT: RIGHT does NOT always mean right. If the line
goes up (y2 < y1), then RIGHT is right. If the line goes down, RIGHT is left. If the line
goes from left to right, RIGHT is down, etc. It is really based on the direction of motion
from the first point to the next.
- CLOSED - if true, the polyline closes itself, with the end
point being the starting point. If false, the polygon is not closed.
drawImage
public boolean drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer)
- drawImage
- Parameters:
- img - Not implemented until fully JDK 1.1
- dx1 - Not implemented until fully JDK 1.1
- dy1 - Not implemented until fully JDK 1.1
- dx2 - Not implemented until fully JDK 1.1
- dy2 - Not implemented until fully JDK 1.1
- sx1 - Not implemented until fully JDK 1.1
- sy1 - Not implemented until fully JDK 1.1
- sx2 - Not implemented until fully JDK 1.1
- sy2 - Not implemented until fully JDK 1.1
- observer - Not implemented until fully JDK 1.1
- Returns:
- boolean
drawImage
public boolean drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
Color bgcolor,
ImageObserver observer)
- drawImage
- Parameters:
- img - Not implemented until fully JDK 1.1
- dx1 - Not implemented until fully JDK 1.1
- dy1 - Not implemented until fully JDK 1.1
- dx2 - Not implemented until fully JDK 1.1
- dy2 - Not implemented until fully JDK 1.1
- sx1 - Not implemented until fully JDK 1.1
- sy1 - Not implemented until fully JDK 1.1
- sx2 - Not implemented until fully JDK 1.1
- sy2 - Not implemented until fully JDK 1.1
- bgcolor - Not implemented until fully JDK 1.1
- observer - Not implemented until fully JDK 1.1
- Returns:
- boolean
setClip
public void setClip(int x,
int y,
int width,
int height)
- setClip
- Parameters:
- x - x coordinate of upper left corner
- y - y coordinate of upper left corner
- width - width of clipping rectangle
- height - height of clipping rectangle
getClipBounds
public Rectangle getClipBounds()
- getClipBounds
- Returns:
- Rectangle
dispose
public void dispose()
- Disposes of this graphics context. The GadgetGraphics context cannot be used after
being disposed of.
- See Also:
- finalize
finalize
public void finalize()
- Disposes of this graphics context once it is no longer referenced.
- Overrides:
- finalize in class Object
- See Also:
- dispose
toString
public String toString()
- Returns a String object representing this Graphic's value.
- Returns:
- String
- Overrides:
- toString in class Object
brighter
public static final Color brighter(Color color)
- Returns a brighter version of this color.
- Returns:
- Color
brighter
public static Color brighter(Color color,
double factor)
- Returns a brighter version of this color, given the factor.
- Parameters:
- color - the color to brighten
- factor - the factor to increase brightness
- Returns:
- Color
darker
public static final Color darker(Color color)
- Returns a darker version of this color.
- Parameters:
- color - the color to darken
- Returns:
- Color
darker
public static Color darker(Color color,
double factor)
- Returns a darker version of this color, given the factor.
- Parameters:
- color - the color to darken
- factor - the factor to decrease brightness
- Returns:
- Color
All Packages Class Hierarchy This Package Previous Next Index