|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectexample.audiodemo.SmallBall
class SmallBall
A SmallBall is a lightweight animated ball that runs in its own thread. It moves within a rectangular region, bouncing off the walls.
Field Summary | |
---|---|
(package private) int |
ballSize
|
(package private) javax.microedition.lcdui.Canvas |
canvas
|
(package private) int |
clr
|
(package private) static int |
delay
|
(package private) int |
deltaX
|
(package private) int |
deltaY
|
boolean |
doRepaint
|
(package private) javax.microedition.lcdui.Graphics |
g
|
(package private) int |
height
|
(package private) int |
left
|
(package private) static int[][] |
matrix
|
(package private) int |
note
|
static boolean |
paused
|
(package private) int |
posX
|
(package private) int |
posY
|
(package private) int |
radius
|
(package private) static java.util.Random |
random
|
boolean |
stop
|
(package private) int |
top
|
(package private) int |
width
|
Constructor Summary | |
---|---|
SmallBall(javax.microedition.lcdui.Canvas c,
int left,
int top,
int width,
int height)
Constructor defines the region in which the ball moves as well as its starting position. |
Method Summary | |
---|---|
(package private) static void |
faster()
|
(package private) static int |
getSpeedPercent()
Returns the speed in percent of the DEFAULT_DELAY |
(package private) void |
paint(javax.microedition.lcdui.Graphics g)
Paint the ball. |
void |
run()
Starts the ball running. |
void |
setColor(int clr)
|
void |
setNote(int note)
|
(package private) static void |
slower()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
static java.util.Random random
public static boolean paused
static int delay
static int[][] matrix
int top
int left
int width
int height
int posX
int posY
int radius
int ballSize
int deltaX
int deltaY
javax.microedition.lcdui.Graphics g
javax.microedition.lcdui.Canvas canvas
int note
int clr
public boolean stop
public boolean doRepaint
Constructor Detail |
---|
SmallBall(javax.microedition.lcdui.Canvas c, int left, int top, int width, int height)
Method Detail |
---|
static void slower()
static void faster()
static int getSpeedPercent()
public void setNote(int note)
public void run()
run
in interface java.lang.Runnable
void paint(javax.microedition.lcdui.Graphics g)
public void setColor(int clr)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |