|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.aplu.jgamegrid.Actor ch.aplu.jgamegrid.GGButtonBase
public abstract class GGButtonBase
Abstract superclass of all button types. Buttons of all types
are GameGrid actors with special behaviour. They implement a
GGMouseListener that reports press, release and click events
when the mouse curser is over the button image. The button
images for the non-pressed, the pressed or the rollover state
should have the same size. hide() may be called before the button
is added to the game grid to make the button invisible (and inactive)
when added. The parameterless show() will make it visible (in non-pressed
state). Like any other actor, the buttons will be painted over or under
other actors depending on the paint order.
The button events will be reported by callback methods declared in
the GGButtonListener interface.
Field Summary |
---|
Fields inherited from class ch.aplu.jgamegrid.Actor |
---|
gameGrid, nbCycles |
Method Summary | |
---|---|
boolean |
isEnabled()
Returns true if button is enabled. |
void |
setEnabled(boolean enable)
Enable/Disable button actions. |
void |
setHotspotArea(java.awt.Point center,
int width,
int height)
Selects the rectangle (in pixel units) relative to the button image as active mouse area. |
void |
setRefreshEnabled(boolean enable)
Enables/disables automatic refresh of game grid on button actions. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void setEnabled(boolean enable)
enable
- if true, the button actions are enabled; otherwise disabledpublic boolean isEnabled()
public void setRefreshEnabled(boolean enable)
enable
- if true, the automatic refresh on button action is enable;
otherwise disabledpublic void setHotspotArea(java.awt.Point center, int width, int height)
center
- the rectangle center (zero at image center)width
- the width in pixel units of the rectangle (in x-direction)height
- the height in pixel units of the rectangle (in y-direction)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |