Modifier and Type | Field and Description |
---|---|
static int |
BASELINE
Position the anchor point at the baseline of text.
|
static int |
BLACK |
static int |
BOTTOM
Position the anchor point of text and images
below the text or image.
|
static int |
DOTTED
Constant for the
DOTTED stroke style. |
static int |
HCENTER
Centering text and images horizontally
around the anchor point
|
static int |
LEFT
Position the anchor point of text and images
to the left of the text or image.
|
static int |
RIGHT
Position the anchor point of text and images
to the right of the text or image.
|
static int |
SOLID
Constant for the
SOLID stroke style. |
static int |
TOP
Position the anchor point of text and images
above the text or image.
|
static int |
TRANS_MIRROR |
static int |
TRANS_MIRROR_ROT180 |
static int |
TRANS_MIRROR_ROT270 |
static int |
TRANS_MIRROR_ROT90 |
static int |
TRANS_NONE |
static int |
TRANS_ROT180 |
static int |
TRANS_ROT270 |
static int |
TRANS_ROT90 |
static int |
VCENTER
Centering images vertically
around the anchor point.
|
static int |
WHITE |
ROP_AND, ROP_ANDINVERTED, ROP_ANDREVERSE, ROP_CLEAR, ROP_COPY, ROP_COPYINVERTED, ROP_EQUIV, ROP_INVERT, ROP_NAND, ROP_NOOP, ROP_NOR, ROP_OR, ROP_ORINVERTED, ROP_ORREVERSE, ROP_SET, ROP_XOR
Modifier and Type | Method and Description |
---|---|
void |
copyArea(int sx,
int sy,
int w,
int h,
int x,
int y,
int anchor)
Copy one rectangular area of the drawing surface to another.
|
void |
drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
Draw an arc, using the current color and style.
|
void |
drawChar(char character,
int x,
int y,
int anchor)
Draw a single character to the graphics surface using the current color.
|
void |
drawChars(char[] data,
int offset,
int length,
int x,
int y,
int anchor)
Draw a series of characters to the graphics surface using the current color.
|
void |
drawImage(java.awt.Image src,
int x,
int y,
int anchor)
Draw the specified image to the graphics surface, using the supplied rop.
|
void |
drawLine(int x0,
int y0,
int x1,
int y1)
Draw a line between the specified points, using the current color and style.
|
void |
drawRect(int x,
int y,
int width,
int height)
Draw a rectangle using the current color and style.
|
void |
drawRegion(java.awt.Image src,
int sx,
int sy,
int w,
int h,
int transform,
int x,
int y,
int anchor)
Draw the specified region of the supplied image to the graphics surface.
|
void |
drawRegionRop(java.awt.Image src,
int sx,
int sy,
int w,
int h,
int x,
int y,
int anchor,
int rop)
Draw the specified image to the graphics surface, using the supplied rop.
|
void |
drawRegionRop(java.awt.Image src,
int sx,
int sy,
int w,
int h,
int transform,
int x,
int y,
int anchor,
int rop)
Draw the specified region of the source image to the graphics surface
after applying the requested transformation, use the supplied rop.
|
void |
drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
Draw a rounded rectangle.
|
void |
drawString(java.lang.String str,
int x,
int y,
int anchor)
Draws the specified String using the current font and color.
|
void |
drawString(java.lang.String str,
int x,
int y,
int anchor,
boolean inverted)
Draws the specified String using the current font and color.
|
void |
drawSubstring(java.lang.String str,
int offset,
int len,
int x,
int y,
int anchor)
Draw a substring to the graphics surface using the current color.
|
void |
fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
Draw a filled arc, using the current color.
|
void |
fillRect(int x,
int y,
int w,
int h)
Draw a filled rectangle using the current color.
|
java.awt.Font |
getFont()
Return the currently selected font object.
|
int |
getPixel(int x,
int y)
Method to get a pixel from the screen.
|
int |
getStrokeStyle()
Return the current stroke style.
|
int |
getTranslateX()
Gets the X coordinate of the translated origin of this graphics context.
|
int |
getTranslateY()
Gets the Y coordinate of the translated origin of this graphics context.
|
void |
setColor(int rgb)
Set the current drawing color.
|
void |
setColor(int red,
int green,
int blue)
Sets the current color to the specified RGB values.
|
void |
setFont(java.awt.Font f)
Set the current font
|
void |
setPixel(int x,
int y,
int color)
Method to set a pixel on the screen.
|
void |
setStrokeStyle(int style)
Set the stroke style to be used for drawing operations.
|
void |
translate(int x,
int y)
Translates the origin of the graphics context to the point
(x, y) in the current coordinate system.
|
bitBlt, bitBlt, clear, getDisplay, getHeight, getHWDisplay, getWidth, refresh, setAutoRefresh, setAutoRefreshPeriod, setContrast
static final int TRANS_MIRROR
static final int TRANS_MIRROR_ROT180
static final int TRANS_MIRROR_ROT270
static final int TRANS_MIRROR_ROT90
static final int TRANS_NONE
static final int TRANS_ROT180
static final int TRANS_ROT270
static final int TRANS_ROT90
static final int HCENTER
Value 1
is assigned to HCENTER
.
static final int VCENTER
Value 2
is assigned to VCENTER
.
static final int LEFT
Value 4
is assigned to LEFT
.
static final int RIGHT
Value 8
is assigned to RIGHT
.
static final int TOP
Value 16
is assigned to TOP
.
static final int BOTTOM
Value 32
is assigned to BOTTOM
.
static final int BASELINE
Value 64
is assigned to BASELINE
.
static final int SOLID
SOLID
stroke style.
Value 0
is assigned to SOLID
.
static final int DOTTED
DOTTED
stroke style.
Value 1
is assigned to DOTTED
.
static final int BLACK
static final int WHITE
void setPixel(int x, int y, int color)
x
- the x coordinatey
- the y coordinatecolor
- the pixel color (0 = white, 1 = black)int getPixel(int x, int y)
x
- the x coordinatey
- the y coordinatevoid drawString(java.lang.String str, int x, int y, int anchor, boolean inverted)
str
- the String to be drawnx
- the x coordinate of the anchor pointy
- the y coordinate of the anchor pointanchor
- the anchor point for positioning the textinverted
- true to invert the text display.void drawString(java.lang.String str, int x, int y, int anchor)
str
- the String to be drawnx
- the x coordinate of the anchor pointy
- the y coordinate of the anchor pointanchor
- the anchor point for positioning the textvoid drawSubstring(java.lang.String str, int offset, int len, int x, int y, int anchor)
str
- the base stringoffset
- the start of the sub stringlen
- the length of the sub stringx
- the x coordinate of the anchor pointy
- the x coordinate of the anchor pointanchor
- the anchor point used to position the text.void drawChar(char character, int x, int y, int anchor)
character
- the character to drawx
- the x coordinate of the anchor pointy
- the x coordinate of the anchor pointanchor
- the anchor point used to position the text.void drawChars(char[] data, int offset, int length, int x, int y, int anchor)
data
- the charactersoffset
- the start of the characters to be drawnlength
- the length of the character string to drawx
- the x coordinate of the anchor pointy
- the x coordinate of the anchor pointanchor
- the anchor point used to position the text.int getStrokeStyle()
void setStrokeStyle(int style)
style
- new style.void drawRegionRop(java.awt.Image src, int sx, int sy, int w, int h, int x, int y, int anchor, int rop)
src
- image to draw (may be null for ops that do not require input.sx
- x offset in the sourcesy
- y offset in the sourcew
- width of area to drawh
- height of area to draw.x
- destinationy
- destinationanchor
- location of the anchor pointrop
- drawing operation.Image
void drawRegionRop(java.awt.Image src, int sx, int sy, int w, int h, int transform, int x, int y, int anchor, int rop)
src
- The source imagesx
- x coordinate of the regionsy
- y coordinate of the regionw
- width of the regionh
- height of the regiontransform
- the required transformx
- x coordinate of the anchor pointy
- y coordinate of the anchor pointanchor
- type of anchorrop
- raster operation used to draw the output.void drawRegion(java.awt.Image src, int sx, int sy, int w, int h, int transform, int x, int y, int anchor)
src
- image to draw (may be null for ops that do not require input.sx
- x offset to the regionsy
- y offset to the regionw
- width of the regionh
- height of the regiontransform
- x
- destinationy
- destinationanchor
- location of the anchor pointImage
void drawImage(java.awt.Image src, int x, int y, int anchor)
src
- image to draw (may be null for ops that do not require input.x
- destinationy
- destinationanchor
- location of the anchor pointImage
void drawLine(int x0, int y0, int x1, int y1)
x0
- x start pointy0
- y start pointx1
- x end pointy1
- y end pointvoid drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
x
- y
- width
- height
- startAngle
- arcAngle
- void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
x
- y
- width
- height
- startAngle
- arcAngle
- void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
x
- y
- width
- height
- arcWidth
- arcHeight
- void drawRect(int x, int y, int width, int height)
x
- y
- width
- height
- void fillRect(int x, int y, int w, int h)
x
- y
- w
- h
- void copyArea(int sx, int sy, int w, int h, int x, int y, int anchor)
sx
- Source xsy
- Source yw
- Source widthh
- Source heightx
- Destination xy
- Destination yanchor
- location of the anchor point of the destination.java.awt.Font getFont()
void setFont(java.awt.Font f)
f
- the fontvoid translate(int x, int y)
x
- the new translation origin x valuey
- new translation origin y valuegetTranslateX()
,
getTranslateY()
int getTranslateX()
int getTranslateY()
void setColor(int rgb)
rgb
- new color.void setColor(int red, int green, int blue)
red
- the red componentgreen
- the green componentblue
- the bluejava.lang.IllegalArgumentException
- if any of the color components
are outside of range 0-255