DCT Lightfoot v3 API specification

javax.microedition.lcdui
Class Graphics

java.lang.Object
  |
  +--javax.microedition.lcdui.Graphics

public class Graphics
extends Object

This class does all the drawing


Field Summary
static int BASELINE
          put the anchor point on the baseline
static int BOTTOM
          put the anchor point on the left
static int DOTTED
          Draw dotted lines
static int HCENTER
          put the anchor point in the horizontal center
static int LEFT
          put the anchor point to the left
static int RIGHT
          Put the anchor point to the right
static int SOLID
          Draw solid lines
static int TOP
          Put the anchor point at the top
static int VCENTER
          Put the anchor point vertically central
 
Method Summary
 void clipRect(int x, int y, int width, int height)
          Intersect the current clipping rectangle with the specified one
 void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          Draw an arc
 void drawChar(char ch, int x, int y, int anchor)
          Draw a character
 void drawChars(char[] data, int offset, int length, int x, int y, int anchor)
          Draw a number of characters
 void drawImage(Image img, int x, int y, int anchor)
          Draw an image
 void drawLine(int x1, int y1, int x2, int y2)
          Draw a line
 void drawRect(int x, int y, int width, int height)
          Draw a rectangle
 void drawRoundRect(int x, int y, int width, int heghit, int arcWidth, int arcHeight)
          Draw a round rectangle
 void drawString(java.lang.String str, int x, int y, int anchor)
          Draw a string
 void drawSubstring(java.lang.String str, int offset, int length, int x, int y, int anchor)
          Draw a substring
 void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          Fill an arc
 void fillRect(int x, int y, int width, int height)
          Fill a rectangle
 void fillRoundRect(int x, int y, int width, int heghit, int arcWidth, int arcHeight)
          Fill a round rectangle
 int getBlueComponent()
          Get the blue component
 int getClipHeight()
          Get the clip height
 int getClipWidth()
          Get the clip width
 int getClipX()
          Get the clip x
 int getClipY()
          Get the clip y
 int getColor()
          Get the colour
 Font getFont()
          Get the font
 int getGrayScale()
          Get the gray scale
 int getGreenComponent()
          Get the green component
 int getRedComponent()
          Get the red component
 int getStrokeStyle()
          Get the stroke style
 int getTranslateX()
          Get the x translation
 int getTranslateY()
          Get the y translation
 void setClip(int x, int y, int width, int height)
          Set the clipping rectange
 void setColor(int colour)
          Set the colour
 void setColor(int red, int green, int blue)
          Set the colour from individual red, green and blue
 void setFont(Font font)
          Set the font
 void setGrayScale(int value)
          Set the gray scale value
 void setStrokeStyle(int stroke)
          Set the stroke style
 void translate(int x, int y)
          Set the translation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASELINE

public static final int BASELINE
put the anchor point on the baseline

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
put the anchor point on the left

See Also:
Constant Field Values

DOTTED

public static final int DOTTED
Draw dotted lines

See Also:
Constant Field Values

HCENTER

public static final int HCENTER
put the anchor point in the horizontal center

See Also:
Constant Field Values

LEFT

public static final int LEFT
put the anchor point to the left

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Put the anchor point to the right

See Also:
Constant Field Values

SOLID

public static final int SOLID
Draw solid lines

See Also:
Constant Field Values

TOP

public static final int TOP
Put the anchor point at the top

See Also:
Constant Field Values

VCENTER

public static final int VCENTER
Put the anchor point vertically central

See Also:
Constant Field Values
Method Detail

clipRect

public void clipRect(int x,
                     int y,
                     int width,
                     int height)
Intersect the current clipping rectangle with the specified one

Parameters:
x - The x position
y - The y position
width - The width
height - The height

drawArc

public void drawArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Draw an arc

Parameters:
x - The x position
y - The y position
width - The width
height - The height
startAngle - The start
arcAngle - The angle of the arc to do

drawChar

public void drawChar(char ch,
                     int x,
                     int y,
                     int anchor)
Draw a character

Parameters:
ch - The character
x - The x position
y - The y position
anchor - The anchor
Throws:
IllegalArgumentException - if the anchor is invalid

drawChars

public void drawChars(char[] data,
                      int offset,
                      int length,
                      int x,
                      int y,
                      int anchor)
Draw a number of characters

Parameters:
data - The characters
offset - The offset into the data
length - The length
x - The x position
y - The y position
anchor - The anchor information
Throws:
NullPointerException - if the data is null
IllegalArgumentException - if the anchor is invalid

drawImage

public void drawImage(Image img,
                      int x,
                      int y,
                      int anchor)
Draw an image

Parameters:
img - The image
x - The x position
y - The y position
anchor - The anchor
Throws:
NullPointerException - if the image is null

drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
Draw a line

Parameters:
x1 - The start x
y1 - The start y
x2 - The end x
y2 - The end y

drawRect

public void drawRect(int x,
                     int y,
                     int width,
                     int height)
Draw a rectangle

Parameters:
x - The x position
y - The y position
width - The width
height - The height

drawRoundRect

public void drawRoundRect(int x,
                          int y,
                          int width,
                          int heghit,
                          int arcWidth,
                          int arcHeight)
Draw a round rectangle

Parameters:
x - The x position
y - The y position
width - The width
arcWidth - The width of the arc
arcHeight - The height of the arc

drawString

public void drawString(java.lang.String str,
                       int x,
                       int y,
                       int anchor)
Draw a string

Parameters:
str - The string
x - The x position
y - The y position
anchor - The anchor
Throws:
IllegalArgumentException - if the anchor is invalid
NullPointerException - if the string is null

drawSubstring

public void drawSubstring(java.lang.String str,
                          int offset,
                          int length,
                          int x,
                          int y,
                          int anchor)
Draw a substring

Parameters:
str - The string
offset - The offset
x - The x position
y - The y position
anchor - The anchor
Throws:
StringIndexOutOfBoundsException - if the offset and length are not valie
IllegalArgumentException - if the anchor is invalid
NullPointerException - if the string is null

fillArc

public void fillArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Fill an arc

Parameters:
x - The x position
y - The y position
width - The width
height - The height
startAngle - The start
arcAngle - The angle of the arc to do

fillRect

public void fillRect(int x,
                     int y,
                     int width,
                     int height)
Fill a rectangle

Parameters:
x - The x position
y - The y position
width - The width
height - The height

fillRoundRect

public void fillRoundRect(int x,
                          int y,
                          int width,
                          int heghit,
                          int arcWidth,
                          int arcHeight)
Fill a round rectangle

Parameters:
x - The x position
y - The y position
width - The width
arcWidth - The width of the arc
arcHeight - The height of the arc

getBlueComponent

public int getBlueComponent()
Get the blue component

Returns:
the blue component

getClipHeight

public int getClipHeight()
Get the clip height

Returns:
the clip height

getClipWidth

public int getClipWidth()
Get the clip width

Returns:
the clip width

getClipX

public int getClipX()
Get the clip x

Returns:
the clip x

getClipY

public int getClipY()
Get the clip y

Returns:
the clip y

getColor

public int getColor()
Get the colour

Returns:
the colour

getFont

public Font getFont()
Get the font

Returns:
the font

getGrayScale

public int getGrayScale()
Get the gray scale

Returns:
the gray scale

getGreenComponent

public int getGreenComponent()
Get the green component

Returns:
the green component

getRedComponent

public int getRedComponent()
Get the red component

Returns:
the red component

getStrokeStyle

public int getStrokeStyle()
Get the stroke style

Returns:
the stroke style

getTranslateX

public int getTranslateX()
Get the x translation

Returns:
the x translation

getTranslateY

public int getTranslateY()
Get the y translation

Returns:
the y translation

setClip

public void setClip(int x,
                    int y,
                    int width,
                    int height)
Set the clipping rectange

Parameters:
x - The x position
y - The y position
width - The width
height - The height

setColor

public void setColor(int colour)
Set the colour

Parameters:
colour - The new colour

setColor

public void setColor(int red,
                     int green,
                     int blue)
Set the colour from individual red, green and blue

Parameters:
red - The red component
green - The green component
blue - The blue component

setFont

public void setFont(Font font)
Set the font

Parameters:
font - The font to set

setGrayScale

public void setGrayScale(int value)
Set the gray scale value


setStrokeStyle

public void setStrokeStyle(int stroke)
Set the stroke style


translate

public void translate(int x,
                      int y)
Set the translation

Parameters:
x - The x translation
y - The y translation

DCT Lightfoot v3 API specification

DCT Lightfoot v3 API specification