GLLib: GLLib : MIDP wrapper

GLLib

GLLib : MIDP wrapper
[GLLib]

wrapper for some usual midp function, use this instead of the midp ones More...

Functions

static final void ClipRect (int x, int y, int width, int height)
 Intersects the current clip with the specified rectangle.
static final void CopyArea (int x_src, int y_src, int width, int height, int x_dest, int y_dest, int anchor)
 Copies the contents of a rectangular area (x_src, y_src, width, height) to a destination area, whose anchor point identified by anchor is located at (x_dest, y_dest).
static final void DrawArc (int x, int y, int width, int height, int startAngle, int arcAngle)
 Draws the outline of a circular or elliptical arc covering the specified rectangle, using the current color and stroke style.
static final void DrawChar (char character, int x, int y, int anchor)
 Draws the specified character using the current font and color.
static final void DrawChars (char[] data, int offset, int length, int x, int y, int anchor)
 Draws the specified characters using the current font and color.
static final void DrawImage (javax.microedition.lcdui.Image img, int x, int y, int anchor)
 Draws the specified image by using the anchor point.
static final void DrawLine (int x1, int y1, int x2, int y2)
 Draws a line between the coordinates (x1,y1) and (x2,y2) using the current color and stroke style.
static final void drawPartialRGB (Graphics g, int screenWidth, int screenHeight, int rgbData[], int scanlength, int srcX, int srcY, int x, int y, int width, int height, boolean processAlpha)
 Same as drawPartialRGB but it's useful when you draw in a back buffer that is bigger than the screen.
static final void drawPartialRGB (Graphics g, int rgbData[], int scanlength, int srcX, int srcY, int x, int y, int width, int height, boolean processAlpha)
 Same as drawRGB but it draws safely (without drawing outside the screen).
static final void DrawRect (int x, int y, int width, int height)
 Draws the outline of the specified rectangle using the current color and stroke style.
static final void DrawRegion (javax.microedition.lcdui.Image src, int x_src, int y_src, int width, int height, int transform, int x_dest, int y_dest, int anchor)
 Copies a region of the specified source image to a location within the destination, possibly transforming (rotating and reflecting) the image data using the chosen transform function.
static final void DrawRGB (int[] rgbData, int offset, int scanlength, int x, int y, int width, int height, boolean processAlpha)
 Renders a series of device-independent RGB+transparency values in a specified region.
static final void DrawRoundRect (int x, int y, int width, int height, int arcWidth, int arcHeight)
 Draws the outline of the specified rounded corner rectangle using the current color and stroke style.
static final void DrawString (String str, int x, int y, int anchor)
 Draws the specified String using the current font and color.
static final void DrawSubstring (String str, int offset, int len, int x, int y, int anchor)
 Draws the specified String using the current font and color.
static final void FillArc (int x, int y, int width, int height, int startAngle, int arcAngle)
 Fills a circular or elliptical arc covering the specified rectangle.
static final void FillRect (int x, int y, int width, int height)
 Fills the specified rectangle with the current color.
static final void FillRoundRect (int x, int y, int width, int height, int arcWidth, int arcHeight)
 Fills the specified rounded corner rectangle with the current color.
static final void FillTriangle (int x1, int y1, int x2, int y2, int x3, int y3)
 Fills the specified triangle will the current color.
static final void Gc ()
 call the garbage collector to free memory
static final int GetBlueComponent ()
 Gets the blue component of the current color.
static final int GetClipHeight ()
 Gets the height of the current clipping area.
static final int GetClipWidth ()
 Gets the width of the current clipping area.
static final int GetClipX ()
 Gets the X offset of the current clipping area, relative to the coordinate system origin of this graphics context.
static final int GetClipY ()
 Gets the Y offset of the current clipping area, relative to the coordinate system origin of this graphics context.
static final int GetColor ()
 Gets the current color.
static final int GetDisplayColor (int color)
 Gets the color that will be displayed if the specified color is requested.
static final javax.microedition.lcdui.Font GetFont ()
 Gets the current font.
static final long GetFrameTime ()
 get time for this frame (real time when this frame started)
static final int GetGrayScale ()
 Gets the current grayscale value of the color being used for rendering operations.
static final int GetGreenComponent ()
 Gets the green component of the current color.
static final long GetRealTime ()
 get real time at the moment the fucntion is called
static final int GetRedComponent ()
 Gets the red component of the current color.
static final int GetScreenHeight ()
 get screen height, (if screen orientation changes, it will return the new screen height automatically
static final int GetScreenWidth ()
 get screen width, (if screen orientation changes, it will return the new screen width automatically
static final int GetStrokeStyle ()
 Gets the stroke style used for drawing operations.
static final int GetTranslateX ()
 Gets the X coordinate of the translated origin of this graphics context.
static final int GetTranslateY ()
 Gets the Y coordinate of the translated origin of this graphics context.
static final boolean PlatformRequest (String url)
 Performs platformRequest.
static final void SetClip (int x, int y, int width, int height)
 Sets the current clip to the rectangle specified by the given coordinates.
static final void setColor (int red, int green, int blue)
 Sets the current color to the specified RGB values.
static final void SetColor (int RGB)
 Sets the current color to the specified RGB values.
static final void SetCurrentGraphics (javax.microedition.lcdui.Image img)
 set current graphics context -.
static final void SetCurrentGraphics (javax.microedition.lcdui.Graphics graphics)
 set current graphics context -.
static final void SetFont (javax.microedition.lcdui.Font font)
 Sets the font for all subsequent text rendering operations.
static final void SetGrayScale (int value)
 Sets the current grayscale to be used for all subsequent rendering operations.
static final void SetStrokeStyle (int style)
 Sets the stroke style used for drawing lines, arcs, rectangles, and rounded rectangles.
static final void Translate (int x, int y)
 Translates the origin of the graphics context to the point (x, y) in the current coordinate system.
static void Vibrate (int duration)
 Make the phone vibrate or flash the back light is the phone has this functionnality.

Variables

static final int BOTTOM = 32
 Constant for positioning the anchor point of text and images below the text or image Constant for positioning the anchor point of text and images below the text or image.
static final int DOTTED = 1
 Constant for the DOTTED stroke style.
static final int HCENTER = 1
 Constant for centering text and images horizontally around the anchor point.
static final int LEFT = 4
 Constant for positioning the anchor point of text and images to the left of the text or image.
static final int RIGHT = 8
 Constant for positioning the anchor point of text and images to the right of the text or image.
static final int SOLID = 0
 Constant for the SOLID stroke style.
static final int TOP = 16
 Constant for positioning the anchor point of text and images above the text or image.
static final int TRANS_MIRROR = 2
 causes the specified image region to be reflected about its vertical center.
static final int TRANS_MIRROR_ROT180 = 1
 causes the specified image region to be reflected about its vertical center and then rotated clockwise by 180 degrees.
static final int TRANS_MIRROR_ROT270 = 4
 causes the specified image region to be reflected about its vertical center and then rotated clockwise by 270 degrees.
static final int TRANS_MIRROR_ROT90 = 7
 causes the specified image region to be reflected about its vertical center and then rotated clockwise by 90 degrees.
static final int TRANS_NONE = 0
 No transform is applied.
static final int TRANS_ROT180 = 3
 causes the specified image region to be rotated clockwise by 180 degrees.
static final int TRANS_ROT270 = 6
 causes the specified image region to be rotated clockwise by 270 degrees.
static final int TRANS_ROT90 = 5
 causes the specified image region to be rotated clockwise by 90 degrees.
static final int VCENTER = 2
 Constant for centering text and images images vertically around the anchor point.

Detailed Description

wrapper for some usual midp function, use this instead of the midp ones


Function Documentation

static final void ClipRect ( int  x,
int  y,
int  width,
int  height 
) [static, package, inherited]

Intersects the current clip with the specified rectangle.

Parameters:
x - the x coordinate of the rectangle to intersect the clip with
y - the y coordinate of the rectangle to intersect the clip with
width - the width of the rectangle to intersect the clip with
height - the height of the rectangle to intersect the clip with
See also:
setClip

static final void CopyArea ( int  x_src,
int  y_src,
int  width,
int  height,
int  x_dest,
int  y_dest,
int  anchor 
) [static, package, inherited]

Copies the contents of a rectangular area (x_src, y_src, width, height) to a destination area, whose anchor point identified by anchor is located at (x_dest, y_dest).

The effect must be that the destination area contains an exact copy of the contents of the source area immediately prior to the invocation of this method. This result must occur even if the source and destination areas overlap.

The points (x_src, y_src) and (x_dest, y_dest) are both specified relative to the coordinate system of the Graphics object. It is illegal for the source region to extend beyond the bounds of the graphic object. This requires that:
x_src + tx >= 0
y_src + ty >= 0
x_src + tx + width <= width of Graphics object's destination
y_src + ty + height <= height of Graphics object's destination

where tx and ty represent the X and Y coordinates of the translated origin of this graphics object, as returned by getTranslateX() and getTranslateY(), respectively.

However, it is legal for the destination area to extend beyond the bounds of the Graphics object. Pixels outside of the bounds of the Graphics object will not be drawn.

The copyArea method is allowed on all Graphics objects except those whose destination is the actual display device. This restriction is necessary because allowing a copyArea method on the display would adversely impact certain techniques for implementing double-buffering.

Like other graphics operations, the copyArea method uses the Source Over Destination rule for combining pixels. However, since it is defined only for mutable images, which can contain only fully opaque pixels, this is effectively the same as pixel replacement.

Parameters:
x_src - the x coordinate of upper left corner of source area
y_src - the y coordinate of upper left corner of source area
width - the width of the source area
height - the height of the source area
x_dest - the x coordinate of the destination anchor point
y_dest - the y coordinate of the destination anchor point
anchor - the anchor point for positioning the region within the destination image

static final void DrawArc ( int  x,
int  y,
int  width,
int  height,
int  startAngle,
int  arcAngle 
) [static, package, inherited]

Draws the outline of a circular or elliptical arc covering the specified rectangle, using the current color and stroke style.

The resulting arc begins at startAngle and extends for arcAngle degrees, using the current color. Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive value indicates a counter-clockwise rotation while a negative value indicates a clockwise rotation.

The center of the arc is the center of the rectangle whose origin is (x, y) and whose size is specified by the width and height arguments.

The resulting arc covers an area width + 1 pixels wide by height + 1 pixels tall. If either width or height is less than zero, nothing is drawn.

The angles are specified relative to the non-square extents of the bounding rectangle such that 45 degrees always falls on the line from the center of the ellipse to the upper right corner of the bounding rectangle. As a result, if the bounding rectangle is noticeably longer in one axis than the other, the angles to the start and end of the arc segment will be skewed farther along the longer axis of the bounds.

Parameters:
x - the x coordinate of the upper-left corner of the arc to be drawn
y - the y coordinate of the upper-left corner of the arc to be drawn
width - the width of the arc to be drawn
height - the height of the arc to be drawn
startAngle - the beginning angle
arcAngle - the angular extent of the arc, relative to the start angle

static final void DrawChar ( char  character,
int  x,
int  y,
int  anchor 
) [static, package, inherited]

Draws the specified character using the current font and color.

Parameters:
character - the character to be drawn
x - the x coordinate of the anchor point
y - the y coordinate of the anchor point
anchor - the anchor point for positioning the text; see anchor points

static final void DrawChars ( char[]  data,
int  offset,
int  length,
int  x,
int  y,
int  anchor 
) [static, package, inherited]

Draws the specified characters using the current font and color.

The offset and length parameters must specify a valid range of characters within the character array data. The offset parameter must be within the range [0..(data.length)], inclusive. The length parameter must be a non-negative integer such that (offset + length) <= data.length.

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 of the anchor point
y - the y coordinate of the anchor point
anchor - the anchor point for positioning the text; see anchor points

static final void DrawImage ( javax.microedition.lcdui.Image  img,
int  x,
int  y,
int  anchor 
) [static, package, inherited]

Draws the specified image by using the anchor point.

The image can be drawn in different positions relative to the anchor point by passing the appropriate position constants. See anchor points.

If the source image contains transparent pixels, the corresponding pixels in the destination image must be left untouched. If the source image contains partially transparent pixels, a compositing operation must be performed with the destination pixels, leaving all pixels of the destination image fully opaque.

If img is the same as the destination of this Graphics object, the result is undefined. For copying areas within an Image, copyArea should be used instead.

Parameters:
img - the specified image to be drawn
x - the x coordinate of the anchor point
y - the y coordinate of the anchor point
anchor - the anchor point for positioning the image

static final void DrawLine ( int  x1,
int  y1,
int  x2,
int  y2 
) [static, package, inherited]

Draws a line between the coordinates (x1,y1) and (x2,y2) using the current color and stroke style.

Parameters:
x1 - the x coordinate of the start of the line
y1 - the y coordinate of the start of the line
x2 - the x coordinate of the end of the line
y2 - the y coordinate of the end of the line

static final void drawPartialRGB ( Graphics  g,
int  screenWidth,
int  screenHeight,
int  rgbData[],
int  scanlength,
int  srcX,
int  srcY,
int  x,
int  y,
int  width,
int  height,
boolean  processAlpha 
) [static, inherited]

Same as drawPartialRGB but it's useful when you draw in a back buffer that is bigger than the screen.

Parameters:
g - graphic context, all rendering operation will occurs on this context.
screenWidth - the width of the backbuffer
screenHeight - the height of the backbuffer
rgbData - an array of ARGB values in the format 0xAARRGGBB
scanlength - the relative array offset between the corresponding pixels in consecutive rows in the rgbData array
srcX - the horizontal location of the source to be rendered
srcY - the vertical location of the source to be rendered
x - the horizontal location of the destination
y - the vertical location of the destination
width - the width of the region to be rendered
height - the height of the region to be rendered
processAlpha - true if rgbData has an alpha channel, false if all pixels are fully opaque

static final void drawPartialRGB ( Graphics  g,
int  rgbData[],
int  scanlength,
int  srcX,
int  srcY,
int  x,
int  y,
int  width,
int  height,
boolean  processAlpha 
) [static, inherited]

Same as drawRGB but it draws safely (without drawing outside the screen).

Parameters:
g - graphic context, all rendering operation will occurs on this context.
rgbData - an array of ARGB values in the format 0xAARRGGBB
scanlength - the relative array offset between the corresponding pixels in consecutive rows in the rgbData array
srcX - the horizontal location of the source to be rendered
srcY - the vertical location of the source to be rendered
x - the horizontal location of the destination
y - the vertical location of the destination
width - the width of the region to be rendered
height - the height of the region to be rendered
processAlpha - true if rgbData has an alpha channel, false if all pixels are fully opaque

static final void DrawRect ( int  x,
int  y,
int  width,
int  height 
) [static, package, inherited]

Draws the outline of the specified rectangle using the current color and stroke style.

The resulting rectangle will cover an area (width + 1) pixels wide by (height + 1) pixels tall. If either width or height is less than zero, nothing is drawn.

Parameters:
x - the x coordinate of the rectangle to be drawn
y - the y coordinate of the rectangle to be drawn
width - the width of the rectangle to be drawn
height - the height of the rectangle to be drawn

static final void DrawRegion ( javax.microedition.lcdui.Image  src,
int  x_src,
int  y_src,
int  width,
int  height,
int  transform,
int  x_dest,
int  y_dest,
int  anchor 
) [static, package, inherited]

Copies a region of the specified source image to a location within the destination, possibly transforming (rotating and reflecting) the image data using the chosen transform function.

The destination, if it is an image, must not be the same image as the source image. If it is, an exception is thrown. This restriction is present in order to avoid ill-defined behaviors that might occur if overlapped, transformed copies were permitted.

The transform function used must be one of the following, as defined in the Sprite class:
Sprite.TRANS_NONE - causes the specified image region to be copied unchanged
Sprite.TRANS_ROT90 - causes the specified image region to be rotated clockwise by 90 degrees.
Sprite.TRANS_ROT180 - causes the specified image region to be rotated clockwise by 180 degrees.
Sprite.TRANS_ROT270 - causes the specified image region to be rotated clockwise by 270 degrees.
Sprite.TRANS_MIRROR - causes the specified image region to be reflected about its vertical center.
Sprite.TRANS_MIRROR_ROT90 - causes the specified image region to be reflected about its vertical center and then rotated clockwise by 90 degrees.
Sprite.TRANS_MIRROR_ROT180 - causes the specified image region to be reflected about its vertical center and then rotated clockwise by 180 degrees.
Sprite.TRANS_MIRROR_ROT270 - causes the specified image region to be reflected about its vertical center and then rotated clockwise by 270 degrees.

If the source region contains transparent pixels, the corresponding pixels in the destination region must be left untouched. If the source region contains partially transparent pixels, a compositing operation must be performed with the destination pixels, leaving all pixels of the destination region fully opaque.

The (x_src, y_src) coordinates are relative to the upper left corner of the source image. The x_src, y_src, width, and height parameters specify a rectangular region of the source image. It is illegal for this region to extend beyond the bounds of the source image. This requires that:
x_src >= 0
y_src >= 0
x_src + width <= source width
y_src + height <= source height

The (x_dest, y_dest) coordinates are relative to the coordinate system of this Graphics object. It is legal for the destination area to extend beyond the bounds of the Graphics object. Pixels outside of the bounds of the Graphics object will not be drawn.

The transform is applied to the image data from the region of the source image, and the result is rendered with its anchor point positioned at location (x_dest, y_dest) in the destination.

Parameters:
src - the source image to copy from
x_src - the x coordinate of the upper left corner of the region within the source image to copy
y_src - the y coordinate of the upper left corner of the region within the source image to copy
width - the width of the region to copy
height - the height of the region to copy
transform - the desired transformation for the selected region being copied
x_dest - the x coordinate of the anchor point in the destination drawing area
y_dest - the y coordinate of the anchor point in the destination drawing area
anchor - the anchor point for positioning the region within the destination image

static final void DrawRGB ( int[]  rgbData,
int  offset,
int  scanlength,
int  x,
int  y,
int  width,
int  height,
boolean  processAlpha 
) [static, package, inherited]

Renders a series of device-independent RGB+transparency values in a specified region.

The values are stored in rgbData in a format with 24 bits of RGB and an eight-bit alpha value (0xAARRGGBB), with the first value stored at the specified offset. The scanlength specifies the relative offset within the array between the corresponding pixels of consecutive rows. Any value for scanlength is acceptable (even negative values) provided that all resulting references are within the bounds of the rgbData array. The ARGB data is rasterized horizontally from left to right within each row. The ARGB values are rendered in the region specified by x, y, width and height, and the operation is subject to the current clip region and translation for this Graphics object.

Consider P(a,b) to be the value of the pixel located at column a and row b of the Image, where rows and columns are numbered downward from the top starting at zero, and columns are numbered rightward from the left starting at zero. This operation can then be defined as:
P(a, b) = rgbData[offset + (a - x) + (b - y) * scanlength]
for
x <= a < x + width
y <= b < y + height

This capability is provided in the Graphics class so that it can be used to render both to the screen and to offscreen Image objects. The ability to retrieve ARGB values is provided by the Image.getRGB(int[], int, int, int, int, int, int) method.

If processAlpha is true, the high-order byte of the ARGB format specifies opacity; that is, 0x00RRGGBB specifies a fully transparent pixel and 0xFFRRGGBB specifies a fully opaque pixel. Intermediate alpha values specify semitransparency. If the implementation does not support alpha blending for image rendering operations, it must remove any semitransparency from the source data prior to performing any rendering. (See Alpha Processing for further discussion.) If processAlpha is false, the alpha values are ignored and all pixels must be treated as completely opaque.

The mapping from ARGB values to the device-dependent pixels is platform-specific and may require significant computation.

Parameters:
rgbData - an array of ARGB values in the format 0xAARRGGBB
offset - the array index of the first ARGB value
scanlength - the relative array offset between the corresponding pixels in consecutive rows in the rgbData array
x - the horizontal location of the region to be rendered
y - the vertical location of the region to be rendered
width - the width of the region to be rendered
height - the height of the region to be rendered
processAlpha - true if rgbData has an alpha channel, false if all pixels are fully opaque

static final void DrawRoundRect ( int  x,
int  y,
int  width,
int  height,
int  arcWidth,
int  arcHeight 
) [static, package, inherited]

Draws the outline of the specified rounded corner rectangle using the current color and stroke style.

The resulting rectangle will cover an area (width + 1) pixels wide by (height + 1) pixels tall. If either width or height is less than zero, nothing is drawn.

Parameters:
x - the x coordinate of the rectangle to be drawn
y - the y coordinate of the rectangle to be drawn
width - the width of the rectangle to be drawn
height - the height of the rectangle to be drawn
arcWidth - the horizontal diameter of the arc at the four corners
arcHeight - the vertical diameter of the arc at the four corners

static final void DrawString ( String  str,
int  x,
int  y,
int  anchor 
) [static, package, inherited]

Draws the specified String using the current font and color.

The x,y position is the position of the anchor point

Parameters:
str - the String to be drawn
x - the x coordinate of the anchor point
y - the y coordinate of the anchor point
anchor - the anchor point for positioning the text

static final void DrawSubstring ( String  str,
int  offset,
int  len,
int  x,
int  y,
int  anchor 
) [static, package, inherited]

Draws the specified String using the current font and color.

The x,y position is the position of the anchor point. See anchor points.
The offset and len parameters must specify a valid range of characters within the string str. The offset parameter must be within the range [0..(str.length())], inclusive. The len parameter must be a non-negative integer such that (offset + len) <= str.length().

Parameters:
str - the String to be drawn
offset - zero-based index of first character in the substring
len - length of the substring
x - the x coordinate of the anchor point
y - the y coordinate of the anchor point
anchor - the anchor point for positioning the text

static final void FillArc ( int  x,
int  y,
int  width,
int  height,
int  startAngle,
int  arcAngle 
) [static, package, inherited]

Fills a circular or elliptical arc covering the specified rectangle.

The resulting arc begins at startAngle and extends for arcAngle degrees. Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive value indicates a counter-clockwise rotation while a negative value indicates a clockwise rotation.

The center of the arc is the center of the rectangle whose origin is (x, y) and whose size is specified by the width and height arguments.

If either width or height is zero or less, nothing is drawn.
The filled region consists of the "pie wedge" region bounded by the arc segment as if drawn by drawArc(), the radius extending from the center to this arc at startAngle degrees, and radius extending from the center to this arc at startAngle + arcAngle degrees.

The angles are specified relative to the non-square extents of the bounding rectangle such that 45 degrees always falls on the line from the center of the ellipse to the upper right corner of the bounding rectangle. As a result, if the bounding rectangle is noticeably longer in one axis than the other, the angles to the start and end of the arc segment will be skewed farther along the longer axis of the bounds.

Parameters:
x - the x coordinate of the upper-left corner of the arc to be filled.
y - the y coordinate of the upper-left corner of the arc to be filled.
width - the width of the arc to be filled
height - the height of the arc to be filled
startAngle - the beginning angle.
arcAngle - the angular extent of the arc, relative to the start angle.

static final void FillRect ( int  x,
int  y,
int  width,
int  height 
) [static, package, inherited]

Fills the specified rectangle with the current color.

If either width or height is zero or less, nothing is drawn.

Parameters:
x - the x coordinate of the rectangle to be filled
y - the y coordinate of the rectangle to be filled
width - the width of the rectangle to be filled
height - the height of the rectangle to be filled

static final void FillRoundRect ( int  x,
int  y,
int  width,
int  height,
int  arcWidth,
int  arcHeight 
) [static, package, inherited]

Fills the specified rounded corner rectangle with the current color.

If either width or height is zero or less, nothing is drawn.

Parameters:
x - the x coordinate of the rectangle to be filled
y - the y coordinate of the rectangle to be filled
width - the width of the rectangle to be filled
height - the height of the rectangle to be filled
arcWidth - the horizontal diameter of the arc at the four corners
arcHeight - the vertical diameter of the arc at the four corners

static final void FillTriangle ( int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3 
) [static, package, inherited]

Fills the specified triangle will the current color.

The lines connecting each pair of points are included in the filled triangle.

Parameters:
x1 - the x coordinate of the first vertex of the triangle
y1 - the y coordinate of the first vertex of the triangle
x2 - the x coordinate of the second vertex of the triangle
y2 - the y coordinate of the second vertex of the triangle
x3 - the x coordinate of the third vertex of the triangle
y3 - the y coordinate of the third vertex of the triangle

static final void Gc (  )  [static, package, inherited]

call the garbage collector to free memory

Note:
gc is not guaranteed to be called immediately in order to bufferise gc call

static final int GetBlueComponent (  )  [static, package, inherited]

Gets the blue component of the current color.

Returns:
integer value in range 0-255

static final int GetClipHeight (  )  [static, package, inherited]

Gets the height of the current clipping area.

Returns:
height of the current clipping area.

static final int GetClipWidth (  )  [static, package, inherited]

Gets the width of the current clipping area.

Returns:
width of the current clipping area.

static final int GetClipX (  )  [static, package, inherited]

Gets the X offset of the current clipping area, relative to the coordinate system origin of this graphics context.

Separating the getClip operation into two methods returning integers is more performance and memory efficient than one getClip() call returning an object.

Returns:
X offset of the current clipping area

static final int GetClipY (  )  [static, package, inherited]

Gets the Y offset of the current clipping area, relative to the coordinate system origin of this graphics context.

Separating the getClip operation into two methods returning integers is more performance and memory efficient than one getClip() call returning an object.

Returns:
Y offset of the current clipping area

static final int GetColor (  )  [static, package, inherited]

Gets the current color.

Returns:
an integer in form 0x00RRGGBB

static final int GetDisplayColor ( int  color  )  [static, package, inherited]

Gets the color that will be displayed if the specified color is requested.

This method enables the developer to check the manner in which RGB values are mapped to the set of distinct colors that the device can actually display. For example, with a monochrome device, this method will return either 0xFFFFFF (white) or 0x000000 (black) depending on the brightness of the specified color.

Parameters:
color - the desired color (in 0x00RRGGBB format, the high-order byte is ignored)
Returns:
the corresponding color that will be displayed on the device's screen (in 0x00RRGGBB format)

static final javax.microedition.lcdui.Font GetFont (  )  [static, package, inherited]

Gets the current font.

Returns:
current font

static final long GetFrameTime (  )  [static, package, inherited]

get time for this frame (real time when this frame started)

Returns:
time

static final int GetGrayScale (  )  [static, package, inherited]

Gets the current grayscale value of the color being used for rendering operations.

Gets the current grayscale value of the color being used for rendering operations. If the color was set by setGrayScale(), that value is simply returned. If the color was set by one of the methods that allows setting of the red, green, and blue components, the value returned is computed from the RGB color components (possibly in a device-specific fashion) that best approximates the brightness of that color.

Returns:
integer value in range 0-255

static final int GetGreenComponent (  )  [static, package, inherited]

Gets the green component of the current color.

Returns:
integer value in range 0-255

static final long GetRealTime (  )  [static, package, inherited]

get real time at the moment the fucntion is called

Returns:
real time

static final int GetRedComponent (  )  [static, package, inherited]

Gets the red component of the current color.

Returns:
integer value in range 0-255

static final int GetScreenHeight (  )  [static, package, inherited]

get screen height, (if screen orientation changes, it will return the new screen height automatically

Returns:
screen height

static final int GetScreenWidth (  )  [static, package, inherited]

get screen width, (if screen orientation changes, it will return the new screen width automatically

Returns:
screen width

static final int GetStrokeStyle (  )  [static, package, inherited]

Gets the stroke style used for drawing operations.

Returns:
stroke style, SOLID or DOTTED

static final int GetTranslateX (  )  [static, package, inherited]

Gets the X coordinate of the translated origin of this graphics context.

Returns:
X of current origin

static final int GetTranslateY (  )  [static, package, inherited]

Gets the Y coordinate of the translated origin of this graphics context.

Returns:
Y of current origin

static final boolean PlatformRequest ( String  url  )  [static, package, inherited]

Performs platformRequest.

This method wraps calls to platformRequest, incorporating some workarounds for usual platformRequest problems

Parameters:
url the url to send to the browser
Returns:
if the platformRequest was successful

static final void SetClip ( int  x,
int  y,
int  width,
int  height 
) [static, package, inherited]

Sets the current clip to the rectangle specified by the given coordinates.

Rendering operations have no effect outside of the clipping area.

Parameters:
x - the x coordinate of the new clip rectangle
y - the y coordinate of the new clip rectangle
width - the width of the new clip rectangle
height - the height of the new clip rectangle

static final void setColor ( int  red,
int  green,
int  blue 
) [static, package, inherited]

Sets the current color to the specified RGB values.

All subsequent rendering operations will use this specified color.

Parameters:
red - the red component of the color being set in range 0-255
green - the green component of the color being set in range 0-255
blue - the blue component of the color being set in range 0-255

static final void SetColor ( int  RGB  )  [static, package, inherited]

Sets the current color to the specified RGB values.

All subsequent rendering operations will use this specified color. The RGB value passed in is interpreted with the least significant eight bits giving the blue component, the next eight more significant bits giving the green component, and the next eight more significant bits giving the red component. That is to say, the color component is specified in the form of 0x00RRGGBB. The high order byte of this value is ignored.

Parameters:
RGB - the color being set

static final void SetCurrentGraphics ( javax.microedition.lcdui.Image  img  )  [static, package, inherited]

set current graphics context -.

all rendering operation will occurs on this context

Parameters:
img - get the current graphic context from this image, or null to reset
Note:
gaphic context is always reseted at beginning of each frame

static final void SetCurrentGraphics ( javax.microedition.lcdui.Graphics  graphics  )  [static, package, inherited]

set current graphics context -.

all rendering operation will occurs on this context

Parameters:
graphics - graphic context, all rendering operation will occurs on this context, or null to reset
Note:
gaphic context is always reseted at beginning of each frame

static final void SetFont ( javax.microedition.lcdui.Font  font  )  [static, package, inherited]

Sets the font for all subsequent text rendering operations.

If font is null, it is equivalent to setFont(Font.getDefaultFont()).

Parameters:
font - the specified font

static final void SetGrayScale ( int  value  )  [static, package, inherited]

Sets the current grayscale to be used for all subsequent rendering operations.

For monochrome displays, the behavior is clear. For color displays, this sets the color for all subsequent drawing operations to be a gray color equivalent to the value passed in. The value must be in the range 0-255.

Parameters:
value - the desired grayscale value

static final void SetStrokeStyle ( int  style  )  [static, package, inherited]

Sets the stroke style used for drawing lines, arcs, rectangles, and rounded rectangles.

This does not affect fill, text, and image operations.

Parameters:
style - can be SOLID or DOTTED

static final void Translate ( int  x,
int  y 
) [static, package, inherited]

Translates the origin of the graphics context to the point (x, y) in the current coordinate system.

Translates the origin of the graphics context to the point (x, y) in the current coordinate system. All coordinates used in subsequent rendering operations on this graphics context will be relative to this new origin.

The effect of calls to translate() are cumulative. For example, calling translate(1, 2) and then translate(3, 4) results in a translation of (4, 6).

The application can set an absolute origin (ax, ay) using the following technique:
g.translate(ax - g.getTranslateX(), ay - g.getTranslateY())

Parameters:
x - the x coordinate of the new translation origin
y - the y coordinate of the new translation origin

static void Vibrate ( int  duration  )  [static, inherited]

Make the phone vibrate or flash the back light is the phone has this functionnality.

Parameters:
duration - duration of the vibration (or backlight flash)


Variable Documentation

final int BOTTOM = 32 [static, package, inherited]

Constant for positioning the anchor point of text and images below the text or image Constant for positioning the anchor point of text and images below the text or image.

final int DOTTED = 1 [static, package, inherited]

Constant for the DOTTED stroke style.

final int HCENTER = 1 [static, package, inherited]

Constant for centering text and images horizontally around the anchor point.

final int LEFT = 4 [static, package, inherited]

Constant for positioning the anchor point of text and images to the left of the text or image.

final int RIGHT = 8 [static, package, inherited]

Constant for positioning the anchor point of text and images to the right of the text or image.

final int SOLID = 0 [static, package, inherited]

Constant for the SOLID stroke style.

final int TOP = 16 [static, package, inherited]

Constant for positioning the anchor point of text and images above the text or image.

final int TRANS_MIRROR = 2 [static, package, inherited]

causes the specified image region to be reflected about its vertical center.

final int TRANS_MIRROR_ROT180 = 1 [static, package, inherited]

causes the specified image region to be reflected about its vertical center and then rotated clockwise by 180 degrees.

final int TRANS_MIRROR_ROT270 = 4 [static, package, inherited]

causes the specified image region to be reflected about its vertical center and then rotated clockwise by 270 degrees.

final int TRANS_MIRROR_ROT90 = 7 [static, package, inherited]

causes the specified image region to be reflected about its vertical center and then rotated clockwise by 90 degrees.

final int TRANS_NONE = 0 [static, package, inherited]

No transform is applied.

final int TRANS_ROT180 = 3 [static, package, inherited]

causes the specified image region to be rotated clockwise by 180 degrees.

final int TRANS_ROT270 = 6 [static, package, inherited]

causes the specified image region to be rotated clockwise by 270 degrees.

final int TRANS_ROT90 = 5 [static, package, inherited]

causes the specified image region to be rotated clockwise by 90 degrees.

final int VCENTER = 2 [static, package, inherited]

Constant for centering text and images images vertically around the anchor point.


Generated on Tue Sep 23 23:05:31 2008 for GLLib by  doxygen 1.5.2