|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jappit.imagefx.ImageFx
public abstract class ImageFx
ImageFx is the base class for effects applicable to AnimatedImage instances. Extending subclasses must implement paintFx() method, that have to implement the FX rendering logic. Common properties to all ImageFx subclasses include:
Field Summary | |
---|---|
static int |
ORIENTATION_HORIZONTAL
Constant for FXs with horizontal orientation |
static int |
ORIENTATION_NONE
Constant for FXs with no orientation |
static int |
ORIENTATION_VERTICAL
Constant for FXs with vertical orientation |
static int |
TYPE_IN
Constant for inner-going FXs |
static int |
TYPE_NONE
Constant for FXs with no defined type |
static int |
TYPE_OUT
Constant for outer-going FXs |
Constructor Summary | |
---|---|
ImageFx()
|
Method Summary | |
---|---|
protected void |
assertFxType(int value)
Asserts that FX type is equal to specified value |
protected void |
assertNotFxType(int value)
Asserts that FX type is not equal to specified value |
protected void |
assertNotOrientation(int value)
Asserts that FX orientation is not equal to specified value |
protected void |
assertOrientation(int value)
Asserts that FX orientation is equal to specified value |
int |
getDirection()
Returns the FX direction |
int |
getFxType()
Returns the FX type |
int |
getOrientation()
Returns the FX orientation |
protected int |
getPercentage(long timeDiff)
Returns the percentage of time passed from FX start |
boolean |
isEnded()
Checks if FX is ended |
boolean |
isLooping()
Checks if FX is looping |
boolean |
isRunning()
Checks if FX is running |
void |
paint(javax.microedition.lcdui.Graphics g,
javax.microedition.lcdui.Image image)
Draws the given Image, applying the FX |
protected abstract void |
paintFx(javax.microedition.lcdui.Graphics g,
javax.microedition.lcdui.Image image,
long timeDiff)
Renders the given Image applying the FX |
void |
setDirection(int direction)
Sets the FX direction |
void |
setFxType(int fxType)
Sets the FX type |
void |
setLooping(boolean looping)
Define if FX must loop (false by default) |
void |
setOrientation(int orientation)
Sets the FX orientation |
void |
start(long millisecs)
Starts the FX animation |
void |
stop()
Stops the FX animation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TYPE_NONE
public static final int TYPE_IN
public static final int TYPE_OUT
public static final int ORIENTATION_NONE
public static final int ORIENTATION_VERTICAL
public static final int ORIENTATION_HORIZONTAL
Constructor Detail |
---|
public ImageFx()
Method Detail |
---|
public void start(long millisecs)
millisecs
- the FX duration, in millisecondspublic void setOrientation(int orientation)
orientation
- the FX orientationpublic void setFxType(int fxType)
fxType
- the FX typepublic void setDirection(int direction)
direction
- the FX directionprotected void assertNotFxType(int value)
value
- the value to be checkedprotected void assertFxType(int value)
value
- the value to be checkedprotected void assertNotOrientation(int value)
value
- the value to be checkedprotected void assertOrientation(int value)
value
- the value to be checkedpublic int getOrientation()
public int getDirection()
public int getFxType()
public void stop()
public void paint(javax.microedition.lcdui.Graphics g, javax.microedition.lcdui.Image image)
g
- the Graphics object to be used for rendering the FXimage
- an Image to be drawnprotected int getPercentage(long timeDiff)
timeDiff
- the time passed from FX start
public boolean isRunning()
public boolean isLooping()
public void setLooping(boolean looping)
looping
- true if FX must loop, false otherwisepublic boolean isEnded()
protected abstract void paintFx(javax.microedition.lcdui.Graphics g, javax.microedition.lcdui.Image image, long timeDiff)
g
- the Graphics object to be used for rendering the FXimage
- the Image object to be drawntimeDiff
- the current time difference from FX start
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |