|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.microedition.m2g.ScalableGraphics
public final class ScalableGraphics
This is the fundamental class for 2D rendering. The ScalableGraphics context class provides and handles all the rendering capability within this package. In other words, the rendering can only be achieved through the render methods provided in this class. Note that the ScalableGraphics instance must be bound to the rendering target prior to calling the render method. The implementation must clip to the viewport boundaries.
| Field Summary | |
|---|---|
static int |
RENDERING_QUALITY_HIGH
Defines a high rendering quality level. |
static int |
RENDERING_QUALITY_LOW
Defines a low rendering quality level. |
| Method Summary | |
|---|---|
void |
bindTarget(Object target)
Bind the given Graphics as the rendering target of this ScalableGraphics context. |
static ScalableGraphics |
createInstance()
Retrieve a new instance of ScalableGraphics that can be associated to an application. |
void |
releaseTarget()
Flushes the rendered ScalableImage to the currently bound target and then releases the target. |
void |
render(int x,
int y,
ScalableImage image)
Renders the specified ScalableImage using the supplied anchor point. |
void |
setRenderingQuality(int mode)
Set the quality of rendering in the ScalableGraphics context. |
void |
setTransparency(float alpha)
Set the transparency in the ScalableGraphics context with the supplied alpha value. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int RENDERING_QUALITY_LOW
public static final int RENDERING_QUALITY_HIGH
| Method Detail |
|---|
public final void bindTarget(Object target)
target - the object Canvas to receive the
rendered image.
NullPointerException - if target is null.
IllegalArgumentException - if target is invalid.
IllegalStateException - if target is already bound.public final void releaseTarget()
IllegalStateException - if target is not bound.
public final void render(int x,
int y,
ScalableImage image)
releaseTarget.
IMPL NOTE 1: the target canvas clipping is taken into account.
IMPL NOTE 2: the target canvas translation is taken into account.
IMPL NOTE 3: the target canvas context is saved before drawing and restored before leaving.
TODO: check if the target canvas current matrix should be taken into account. For now, the matrix is reset to identity before drawing the image.
x - the X coordinate of the anchor point, in pixels, relative to
the target canvas origin (including the current translated
position).y - the Y coordinate of the anchor point, in pixels, relative to
the target canvas origin (including the current translated
position).image - the ScalableImage to be rendered.
NullPointerException - if image is null.
IllegalStateException - if target is not bound.releaseTarget()public final void setRenderingQuality(int mode)
mode - this value indicates the quality of rendering required.
IllegalArgumentException - if the mode is invalid.public final void setTransparency(float alpha)
alpha - the constant alpha value to be used for rendering.
IllegalArgumentException - if alpha is out of range.public static final ScalableGraphics createInstance()
ScalableGraphics instance.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||