public class Graphics extends Object implements GraphicsConstants, AlignmentConstants
Modifier and Type | Field and Description |
---|---|
protected int |
antiAliasOptions |
static boolean |
canAlphaBlend |
static boolean |
canCopy |
static boolean |
canMove |
static int |
CAPABILITY_CAN_DRAW_IMAGE_DISABLED |
static int |
CAPABILITY_CAN_TRANSFORM |
static int |
defaultAntiAliasOptions
Default anti-aliasing options.
|
static int |
DRAW_AND
The constant for a draw operation that AND's the source with the
destination.
|
static int |
DRAW_OR
The constant for a draw operation that OR's the source with the
destination.
|
static int |
DRAW_OVER
The constant for a draw operation that draws the source over
the destination.
|
static int |
DRAW_XOR
The constant for a draw operation that XOR's the source with the
destination.
|
static Color |
LighterGray |
static int |
OPTION_ANTI_ALIAS_DRAWING
An option that specifies if anti-aliasing is done when drawing non-text elements.
|
static int |
OPTION_ANTI_ALIAS_TEXT
An option that specifies if anti-aliasing is done when drawing text elements.
|
static int |
OPTION_TYPE_ANTI_ALIAS
Anti-aliasing options.
|
static int |
SPECIAL_TICK |
static int |
SPECIAL_X |
All, BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, Down, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN, Left, Right, Up
BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, LEFT, NORTH, NORTHEAST, NORTHWEST, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, STRETCH, TAG_BACKGROUND_IMAGE, TAG_BORDER, TAG_FIXEDSIZE, TAG_INSETS, TAG_MAXIMUMSIZE, TAG_MINIMUMSIZE, TAG_PREFERREDSIZE, TAG_RECT, TAG_SPAN, TAG_TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
Constructor and Description |
---|
Graphics(Image surface) |
Graphics(Image surface,
boolean forCopying) |
Graphics(int options,
Object nativeSurface)
Do not use this constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canCopyFrom()
This returns true if you copy data from this Graphics object.
|
boolean |
canTransform()
Returns if this Graphics can do Affine Transforms.
|
void |
changeBrush(Color c,
int style) |
void |
changePen(Color c,
int style,
int thickness) |
void |
changePen(Color c,
int style,
int thickness,
float miterLimit) |
void |
clearClip() |
void |
copyRect(Graphics source,
int x,
int y,
int width,
int height,
int destX,
int destY) |
void |
copyRect(ISurface surface,
int x,
int y,
int width,
int height,
int destX,
int destY) |
void |
draw(ImageData im,
int x,
int y)
Draw an ImageData as efficiently as possible without scaling.
|
void |
draw3DDiamond(Rect rect,
boolean pressed,
Color back) |
void |
draw3DDiamond(Rect rect,
boolean pressed,
Color back,
boolean amFlat) |
void |
draw3DRect(Rect r,
int style,
boolean flat,
Color fill,
Color outlineColor) |
void |
draw3DRect(Rect r,
int style,
boolean flat,
Color fill,
Color outlineColor,
int labelWidth) |
void |
drawArc(int x,
int y,
int width,
int height,
float startAngle,
float angle)
Draw an arc of an ellipse on the Graphics context using the current pen.
|
void |
drawChar(char which,
int x,
int y,
int options) |
void |
drawDiamond(Rect r,
int which) |
void |
drawDots(int x1,
int y1,
int x2,
int y2)
Draws a dotted line at the given coordinates.
|
void |
drawEdge(Rect r,
int edge,
int flags,
int labelWidth) |
void |
drawEllipse(int x,
int y,
int width,
int height)
Draw an ellipse in the current Pen, but do not fill the inside.
|
void |
drawFormattedText(char[] s,
int start,
int length,
int x,
int y,
FormattedTextSpecs fts) |
void |
drawFormattedText(String s,
int x,
int y,
FormattedTextSpecs fts) |
void |
drawFormattedText(String s,
int start,
int length,
int x,
int y,
FormattedTextSpecs fts) |
void |
drawHorizontalTriangle(Rect bounds,
boolean left) |
void |
drawImage(Image image,
int x,
int y) |
void |
drawImage(Image image,
int x,
int y,
int iimageDrawOptions) |
void |
drawImageData(ImageData source,
int drawX,
int drawY,
int drawWidth,
int drawHeight,
Rect visibleArea,
int scaleOptions)
Scale and draw an ImageData to the Graphics, specifying the destination area
that is to be drawn on the Graphics - all other sections of the image will
be clipped.
|
void |
drawImageData(ImageData im,
Rect sourceImageArea,
Rect destArea,
int scaleOptions) |
void |
drawLine(int x1,
int y1,
int x2,
int y2)
Draw a line between two points in the current pen.
|
void |
drawLines(int[] x,
int[] y,
int count)
Draw a set of lines as a single unbroken path.
|
void |
drawLines(int[] x,
int[] y,
int xoffset,
int yoffset,
int numberOfPoints,
boolean separateLines)
Draw a set of lines either by joining one to the next forming a single unbroken path,
or by drawing sets of separate lines.
|
void |
drawPicture(Picture picture,
int x,
int y) |
void |
drawPicture(Picture picture,
int x,
int y,
int iimageDrawOptions) |
void |
drawPolygon(int[] x,
int[] y,
int count)
Draw a polygon in the current Pen, but do not fill the inside.
|
void |
drawRect(int x,
int y,
int width,
int height)
Draw a rectangle in the current Pen, but do not fill the inside.
|
void |
drawRGB(int[] rgbData,
int offset,
int x,
int y,
int width,
int height,
int rowStride,
boolean useAlpha) |
void |
drawRoundRect(int x,
int y,
int width,
int height,
int radius)
Draw a rounded rectangle in the current Pen, but do not fill the inside.
|
void |
drawSpecial(int what,
Rect where,
Pen p,
Brush b) |
void |
drawText(char[] chars,
int start,
int count,
int x,
int y) |
void |
drawText(String s,
int x,
int y) |
void |
drawVerticalTriangle(Rect bounds,
boolean up) |
void |
fillEllipse(int x,
int y,
int width,
int height)
Fill an ellipse in the current Brush but do not draw around it using the pen.
|
void |
fillPolygon(int[] x,
int[] y,
int count)
Fill a polygon in the current Brush, but do not draw the outside.
|
void |
fillRect(int x,
int y,
int width,
int height)
Fill a rectangle in the current Brush but do not draw around it using the pen.
|
void |
fillRoundRect(int x,
int y,
int width,
int height,
int radius)
Fill a rounded rectangle in the current Brush but do not draw around it using the pen.
|
void |
flush() |
void |
free()
Free resources used by this Graphics.
|
Color |
getBackground()
Deprecated.
- this creates a new Object.
|
Color |
getBackground(Color dest) |
Brush |
getBrush()
Deprecated.
- this creates a new Object.
|
Brush |
getBrush(Brush dest) |
Rect |
getClip(Rect destination)
Get the current clip rect - the destination should not be null.
|
Color |
getColor()
Deprecated.
- this creates a new Object.
|
Color |
getColor(Color dest) |
static String |
getDisplayable(String s) |
Font |
getFont()
Get the current Font for the Graphics.
|
FontMetrics |
getFontMetrics(Font f) |
static double |
getGamma() |
Pen |
getPen()
Deprecated.
- this creates a new Object.
|
Pen |
getPen(Pen dest) |
boolean |
getRGB(int[] destRgbData,
int offset,
int x,
int y,
int width,
int height,
int rowStride) |
ISurface |
getSurface() |
int |
getSurfaceType()
Get the surface type of the Graphics.
|
Point |
getTranslation() |
static int |
getUnderlined(String s) |
int |
hasCapabilities(int capabilities) |
boolean |
isCapable(int cap) |
boolean |
isValid() |
static int |
mapColor(int oldColor) |
long |
modifyOptions(int optionType,
int optionsToSet,
int optionsToClear)
Modify Graphics options.
|
void |
moveRect(int sx,
int sy,
int swidth,
int sheight,
int destX,
int destY) |
protected void |
optionsChanged(int optionType,
int newOptionBits,
int oldOptionBits)
This is called when option bits have changed.
|
void |
paintClosedArc(int x,
int y,
int width,
int height,
float startAngle,
float angle,
boolean useBrush,
boolean usePen)
Draw and/or fill a closed arc of an ellipse on the Graphics context.
|
void |
paintEllipse(int x,
int y,
int width,
int height)
Draw an ellipse in the current Pen and fill with the current Brush.
|
void |
paintEllipse(int x,
int y,
int width,
int height,
boolean useBrush,
boolean usePen) |
void |
paintPie(int x,
int y,
int width,
int height,
float startAngle,
float angle,
boolean useBrush,
boolean usePen)
Draw and/or fill a pie section of an ellipse on the Graphics context.
|
void |
paintPolygon(int[] x,
int[] y,
int count)
Fill a polygon in the current Brush, and draw the outside in the current Pen.
|
void |
paintPolygon(int[] x,
int[] y,
int xoffset,
int yoffset,
int count,
boolean useBrush,
boolean usePen) |
void |
paintRect(int x,
int y,
int width,
int height)
Draw a rectangle in the current Pen and fill with the current Brush.
|
void |
paintRect(int x,
int y,
int width,
int height,
boolean useBrush,
boolean usePen) |
void |
paintRoundRect(int x,
int y,
int width,
int height,
int radius,
boolean useBrush,
boolean usePen)
Draw a rectangle with rounded corners.
|
Rect |
reduceClip(int x,
int y,
int width,
int height,
Rect oldClip)
This alters the clipping region of the current graphics to be the intersection
of the original clipping region and the newly specified region.
|
Rect |
reduceClip(Rect newRect)
This alters the clipping region of the current graphics to be the intersection
of the original clipping region and the newly specified region.
|
void |
reset() |
void |
restoreClip(Rect r)
Use this with a Rect value returned from reduceClip()
|
void |
restoreOptions(int optionType,
long fromModifyOptions)
Restore Graphics options from a call to modifyOptions.
|
void |
restoreTransform(Object savedState)
Restore the Graphics Transform/translation state as it was before the
setTransform() or transform() method was used.
|
void |
set(Brush b)
Set the brush without creating or returning a new Brush object.
|
void |
set(Pen p)
Set the pen without creating or returning a new Pen object.
|
void |
setBackground(Color c) |
Color |
setBackground(Color bk,
Color oldBk) |
void |
setBackground(int r,
int g,
int b) |
Brush |
setBrush(Brush b)
Deprecated.
use setBrush(Brush p, Brush old) instead - this version will
create a new Brush object.
|
Brush |
setBrush(Brush b,
Brush oldBrush) |
void |
setClip(int x,
int y,
int width,
int height) |
void |
setColor(Color c) |
Color |
setColor(Color c,
Color oldColor) |
void |
setColor(int r,
int g,
int b) |
void |
setDrawOp(int drawOp)
Set the drawing mode of the Graphics.
|
void |
setFont(Font f)
Set the current Font of the Graphics.
|
void |
setForeground(Color c)
The Foreground color is not the current drawing color, but
merely an indication on what the preferred foreground color currently
is for this Graphics.
|
void |
setForeground(int r,
int g,
int b)
The Foreground color is not the current drawing color, but
merely an indication on what the preferred foreground color currently
is for this Graphics.
|
static void |
setGamma(double gamma) |
Pen |
setPen(Pen p)
Deprecated.
use setPen(Pen p, Pen old) instead - this version will create
a new Pen object.
|
Pen |
setPen(Pen p,
Pen oldPen) |
Object |
setTransform(double em11,
double em12,
double em21,
double em22,
double edx,
double edy)
Explicitly set the Transform matrix for the Graphics, regardless of the
current Transform (if possible).
|
Object |
transform(double em11,
double em12,
double em21,
double em22,
double edx,
double edy)
Apply (concatenate) a Transform to the existing Transform/translation of the
Graphics (if possible).
|
void |
translate(int dx,
int dy) |
void |
underline(Object fontOrFontMetrics,
char[] text,
int start,
int length,
int underlineStartIndex,
int x,
int y)
Call this after you have called drawText().
|
protected int antiAliasOptions
public static final int OPTION_ANTI_ALIAS_TEXT
public static final int OPTION_ANTI_ALIAS_DRAWING
public static final int OPTION_TYPE_ANTI_ALIAS
public static int defaultAntiAliasOptions
public static final int CAPABILITY_CAN_TRANSFORM
public static final int CAPABILITY_CAN_DRAW_IMAGE_DISABLED
public static boolean canAlphaBlend
public static boolean canCopy
public static boolean canMove
public static final int DRAW_OVER
public static final int DRAW_AND
public static final int DRAW_OR
public static final int DRAW_XOR
public static Color LighterGray
public static final int SPECIAL_TICK
public static final int SPECIAL_X
public Graphics(int options, Object nativeSurface)
public Graphics(Image surface)
public Graphics(Image surface, boolean forCopying)
protected void optionsChanged(int optionType, int newOptionBits, int oldOptionBits)
optionType
- one of the OPTION_TYPE_XXX values.newOptionBits
- the new option bits.oldOptionBits
- the old option bits.public static void setGamma(double gamma)
public static double getGamma()
public long modifyOptions(int optionType, int optionsToSet, int optionsToClear)
optionType
- one of the OPTION_TYPE_XXX values.optionsToSet
- option bits to set.optionsToClear
- option bits to clear.public void restoreOptions(int optionType, long fromModifyOptions)
optionType
- one of the OPTION_TYPE_XXX values.fromModifyOptions
- the value returned by modifyOptions().public final boolean isCapable(int cap)
public int hasCapabilities(int capabilities)
public void drawImage(Image image, int x, int y, int iimageDrawOptions)
public void drawPicture(Picture picture, int x, int y, int iimageDrawOptions)
public boolean canTransform()
public Object setTransform(double em11, double em12, double em21, double em22, double edx, double edy)
em11
- em12
- em21
- em22
- edx
- edy
- public Object transform(double em11, double em12, double em21, double em22, double edx, double edy)
em11
- em12
- em21
- em22
- edx
- edy
- public void restoreTransform(Object savedState)
savedState
- an Object returned from transform() or setTransform().public void flush()
public void draw(ImageData im, int x, int y)
im
- the ImageData to draw.x
- the x location for the draw.y
- the y location for the draw.public boolean isValid()
public static int mapColor(int oldColor)
public void drawText(char[] chars, int start, int count, int x, int y)
public Point getTranslation()
public void translate(int dx, int dy)
public void setClip(int x, int y, int width, int height)
public void clearClip()
public Rect getClip(Rect destination)
public void paintRect(int x, int y, int width, int height, boolean useBrush, boolean usePen)
public void paintPolygon(int[] x, int[] y, int xoffset, int yoffset, int count, boolean useBrush, boolean usePen)
public void paintEllipse(int x, int y, int width, int height, boolean useBrush, boolean usePen)
public void copyRect(Graphics source, int x, int y, int width, int height, int destX, int destY)
public void drawLine(int x1, int y1, int x2, int y2)
x1
- The starting x-coordinate.y1
- The starting y-coordinate.x2
- The ending x-coordinate.y2
- The ending y-coordinate.public void drawImage(Image image, int x, int y)
public void drawPicture(Picture picture, int x, int y)
public void drawImageData(ImageData im, Rect sourceImageArea, Rect destArea, int scaleOptions)
public void drawImageData(ImageData source, int drawX, int drawY, int drawWidth, int drawHeight, Rect visibleArea, int scaleOptions)
src
- the source ImageDatadrawX
- the x location where the top left location of the ImageData would be
if the entire image was drawn.drawY
- the y location where the top left location of the ImageData would be
if the entire image was drawn.drawWidth
- the full width of the scaled image.drawHeight
- the full heigh of the scaled image.visibleArea
- the destination area being updated on the Graphics.scaleOptions
- scale options.public void drawRGB(int[] rgbData, int offset, int x, int y, int width, int height, int rowStride, boolean useAlpha)
public boolean getRGB(int[] destRgbData, int offset, int x, int y, int width, int height, int rowStride)
public void moveRect(int sx, int sy, int swidth, int sheight, int destX, int destY)
public int getSurfaceType()
public ISurface getSurface()
public boolean canCopyFrom()
public void setDrawOp(int drawOp)
drawOp
- one of the DRAW_XXX values - DRAW_OVER is the default.public Pen getPen()
public Brush getBrush()
public Pen setPen(Pen p)
p
- the new Pen.public Brush setBrush(Brush b)
public void set(Pen p)
p
- the new value of the pen. This can be null.public void set(Brush b)
b
- the new value of the brush. This can be null.public void setColor(int r, int g, int b)
public void setColor(Color c)
public void setForeground(Color c)
public void setForeground(int r, int g, int b)
public void setBackground(Color c)
public void setBackground(int r, int g, int b)
public Color getColor()
public Color getBackground()
public void free()
public void setFont(Font f)
f
- the Font to set.public Font getFont()
public void drawDots(int x1, int y1, int x2, int y2)
public void drawRect(int x, int y, int width, int height)
x
- The x position of the rectangle.y
- The y position of the rectangle.width
- The width of the rectangle.height
- The height of the rectangle.public void fillRect(int x, int y, int width, int height)
x
- The x position of the rectangle.y
- The y position of the rectangle.width
- The width of the rectangle.height
- The height of the rectangle.public void paintRect(int x, int y, int width, int height)
x
- The x position of the rectangle.y
- The y position of the rectangle.width
- The width of the rectangle.height
- The height of the rectangle.public void drawPolygon(int[] x, int[] y, int count)
x
- The x positions of the polygon. Do not repeat the first point.y
- The y positions of the polygon. Do not repeat the first point.count
- The number of points in the polygon.public void fillPolygon(int[] x, int[] y, int count)
x
- The x positions of the polygon. Do not repeat the first point.y
- The y positions of the polygon. Do not repeat the first point.count
- The number of points in the polygon.public void paintPolygon(int[] x, int[] y, int count)
x
- The x positions of the polygon. Do not repeat the first point.y
- The y positions of the polygon. Do not repeat the first point.count
- The number of points in the polygon.public void drawEllipse(int x, int y, int width, int height)
x
- The x position of the rectangle.y
- The y position of the rectangle.width
- The width of the rectangle.height
- The height of the rectangle.public void fillEllipse(int x, int y, int width, int height)
x
- The x position of the rectangle.y
- The y position of the rectangle.width
- The width of the rectangle.height
- The height of the rectangle.public void paintEllipse(int x, int y, int width, int height)
x
- The x position of the rectangle.y
- The y position of the rectangle.width
- The width of the rectangle.height
- The height of the rectangle.public void drawText(String s, int x, int y)
public void drawEdge(Rect r, int edge, int flags, int labelWidth)
public void changePen(Color c, int style, int thickness)
public void changePen(Color c, int style, int thickness, float miterLimit)
public void changeBrush(Color c, int style)
public Rect reduceClip(int x, int y, int width, int height, Rect oldClip)
x
- The x coordinate of the new clipping region.y
- The y coordinate of the new clipping region.width
- The width of the new clipping region.height
- The height of the new clipping region.oldClip
- An optional Rect to hold the old clip region.public Rect reduceClip(Rect newRect)
public void restoreClip(Rect r)
public void draw3DRect(Rect r, int style, boolean flat, Color fill, Color outlineColor, int labelWidth)
public void drawLines(int[] x, int[] y, int xoffset, int yoffset, int numberOfPoints, boolean separateLines)
x
- the array holding the X co-ordinate points. If y is null then this
also holds the Y co-ordinate points,
either in a separate area or interleaved with the x values.y
- the Y co-ordinate points or null if the Y co-ordinates are in the
x array.xoffset
- the offset into the x array containing the first X point.yoffset
- the offset into the y array containing the first Y point.
If the y array is null then the y points are in the x array. If the yoffset
is equal to xoffset or to xoffset+1, it is assumed that the x and y
co-ordinates are interleaved (first x, then y, then x, then y),
otherwise it is assumed that the x and y co-ordinates
are in non-overlapping contiguous sections within the array.numberOfPoints
- the number of points in the array.separateLines
- true to draw as separate lines (i.e from x0,y0 to x1,y1 and then x2,y2 to x3,y3)
false to draw as a single path (i.e. from x0,y0 to x1,y1 to x2,y2 to x3,y3).public void drawLines(int[] x, int[] y, int count)
x
- the array of X co-ordinates.y
- the array of Y co-ordinates.count
- the number of co-ordinates defined.public void drawArc(int x, int y, int width, int height, float startAngle, float angle)
x
- the x co-ordinate of the ellipse bounding box.y
- the y co-ordinate of the ellipse bounding box.width
- the width of the ellipse bounding box.height
- the height of the ellipse bounding box.start
- the start angle in degrees, where 0 is at the 3 O' clock
position (due East), 90 is at the 12 O' clock position (due North), etc..angle
- the number of degrees of the arc anti-clockwise.public void paintClosedArc(int x, int y, int width, int height, float startAngle, float angle, boolean useBrush, boolean usePen)
A start angle of 0 and an arc angle of 360 will give a full ellipse.
x
- the x co-ordinate of the ellipse bounding box.y
- the y co-ordinate of the ellipse bounding box.width
- the width of the ellipse bounding box.height
- the height of the ellipse bounding box.start
- the start angle in degrees, where 0 is at the 3 O' clock
position (due East), 90 is at the 12 O' clock position (due North), etc..angle
- the number of degrees of the arc anti-clockwise.useBrush
- true to fill the closed arc with the current brush.usePen
- true to outline the closed arc with the current pen.public void paintPie(int x, int y, int width, int height, float startAngle, float angle, boolean useBrush, boolean usePen)
x
- the x co-ordinate of the ellipse bounding box.y
- the y co-ordinate of the ellipse bounding box.width
- the width of the ellipse bounding box.height
- the height of the ellipse bounding box.start
- the start angle in degrees, where 0 is at the 3 O' clock
position (due East), 90 is at the 12 O' clock position (due North), etc..angle
- the number of degrees of the arc anti-clockwise.useBrush
- true to fill the pie section with the current brush.usePen
- true to outline the pie section with the current pen.public FontMetrics getFontMetrics(Font f)
public static int getUnderlined(String s)
public void underline(Object fontOrFontMetrics, char[] text, int start, int length, int underlineStartIndex, int x, int y)
public void drawVerticalTriangle(Rect bounds, boolean up)
public void drawHorizontalTriangle(Rect bounds, boolean left)
public void drawDiamond(Rect r, int which)
public void drawFormattedText(String s, int x, int y, FormattedTextSpecs fts)
public void drawFormattedText(String s, int start, int length, int x, int y, FormattedTextSpecs fts)
public void drawFormattedText(char[] s, int start, int length, int x, int y, FormattedTextSpecs fts)
public void drawChar(char which, int x, int y, int options)
public void reset()
public void copyRect(ISurface surface, int x, int y, int width, int height, int destX, int destY)
public void paintRoundRect(int x, int y, int width, int height, int radius, boolean useBrush, boolean usePen)
x
- The x position of the rectangle.y
- The y position of the rectangle.width
- The width of the rectangle.height
- The height of the rectangle.radius
- the radius of the arcs that are at the corners.public void drawRoundRect(int x, int y, int width, int height, int radius)
x
- The x position of the rectangle.y
- The y position of the rectangle.width
- The width of the rectangle.height
- The height of the rectangle.radius
- the radius of the arcs that are at the corners.public void fillRoundRect(int x, int y, int width, int height, int radius)
x
- The x position of the rectangle.y
- The y position of the rectangle.width
- The width of the rectangle.height
- The height of the rectangle.radius
- the radius of the arcs that are at the corners.