|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbluegammon.gui.SoftButtonControl
A custom item for softbuttons. Has functionality for
setting one Command
per softbutton. This
also binds the backbutton if any of the command's type
is Command.BACK
.
Constructor Summary | |
SoftButtonControl()
|
Method Summary | |
void |
enable(javax.microedition.lcdui.Command c,
boolean enable)
Enables/disables a command. |
javax.microedition.lcdui.CommandListener |
getCommandListener()
Returns the command listener. |
javax.microedition.lcdui.Command |
getLeftCommand()
Returns the command assigned to left softbutton. |
javax.microedition.lcdui.Command |
getRightCommand()
Returns the command assigned to right softbutton. |
void |
init(javax.microedition.lcdui.Displayable d,
javax.microedition.lcdui.Font font,
javax.microedition.lcdui.Command leftCommand,
javax.microedition.lcdui.Command rightCommand)
Initializes this softbutton control. |
void |
keyPressed(int keyCode)
Call this from the displayable when a key is pressed to activate this control. |
void |
paint(javax.microedition.lcdui.Graphics g)
Call this from the displayable a repaint is necessary to draw this control |
void |
setCommandListener(javax.microedition.lcdui.CommandListener listener)
Sets the commandlistener that will be reported upon softkey presses. |
void |
setLeftCommand(javax.microedition.lcdui.Command c)
Sets the left softbutton command. |
void |
setRightCommand(javax.microedition.lcdui.Command c)
Sets the right softbutton command. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SoftButtonControl()
Method Detail |
public void init(javax.microedition.lcdui.Displayable d, javax.microedition.lcdui.Font font, javax.microedition.lcdui.Command leftCommand, javax.microedition.lcdui.Command rightCommand)
d
- The displayable that this control draw on.font
- The font used for rendering softbuttons.leftCommand
- The left softbutton command or null.rightCommand
- The right softbutton command or null.public javax.microedition.lcdui.CommandListener getCommandListener()
public void setCommandListener(javax.microedition.lcdui.CommandListener listener)
listener
- The listener.public javax.microedition.lcdui.Command getLeftCommand()
public void setLeftCommand(javax.microedition.lcdui.Command c)
c
- The command.public javax.microedition.lcdui.Command getRightCommand()
public void setRightCommand(javax.microedition.lcdui.Command c)
c
- The command.public void enable(javax.microedition.lcdui.Command c, boolean enable)
c
- The command.enable
- True for enable, false for disable.public void keyPressed(int keyCode)
keyCode
- The keycode reported in Displayable
's
keyPressed
method.public void paint(javax.microedition.lcdui.Graphics g)
g
- The graphics context reported in Displayable
's
paint
method.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |