|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjcontrol.ui.wombat.Component
jcontrol.ui.wombat.AbstractFocusComponent
jcontrol.ui.wombat.Button
public class Button
Instances of this class represent a keyboard/touchpad selectable user interface object that issues notification when pressed and released.
(c) Copyright 2005 DOMOLOGIC GmbH
| Field Summary |
|---|
| Fields inherited from interface jcontrol.ui.wombat.IFocusable |
|---|
TRANSFER_FOCUS_BACKWARD, TRANSFER_FOCUS_FORWARD |
| Fields inherited from interface jcontrol.ui.wombat.event.TouchListener |
|---|
RESULT_ACCEPTED, RESULT_EXECUTED, RESULT_NONE |
| Constructor Summary | |
|---|---|
Button(java.lang.String text,
int x,
int y)
Constructs a new button. |
|
Button(java.lang.String text,
int x,
int y,
int width,
int height)
Constructs a new button with fixed size. |
|
| Method Summary | |
|---|---|
KeyEvent |
onKeyEvent(KeyEvent e)
If a KeyEvent accurs, this method is called. |
int |
onTouchEvent(TouchEvent e)
If a TouchEvent accurs, this method is called. |
void |
paint(jcontrol.graphics.XGraphics g)
Paint the button. |
void |
press(boolean onoff)
This method can be used to change the pressed state of the button from outside. |
void |
setImage(jcontrol.io.Resource image)
Change the button's image. |
void |
setText(java.lang.String label)
Change the button's text. |
| Methods inherited from class jcontrol.ui.wombat.AbstractFocusComponent |
|---|
getActionListener, requestFocus, setActionListener, setEnabled, setVisible |
| Methods inherited from class jcontrol.ui.wombat.Component |
|---|
getFrame, isEnabled, isVisible, repaint, repaintAll, safeExec, setBackgroundColor, setBounds, setDirty, setFont, setForegroundColor, setRedraw, setTransparentColor, unsafeExec, update |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, notifyAll, toString, wait |
| Constructor Detail |
|---|
public Button(java.lang.String text,
int x,
int y)
text - the text to display on the button.x - the x-coordinate of the button's top-left cornery - the y-coordinate of the button's top-left corner
public Button(java.lang.String text,
int x,
int y,
int width,
int height)
text - the label to display on the button.x - the x-coordinate of the button's top-left cornery - the y-coordinate of the button's top-left cornerwidth - the width of the buttonheight - the height of the button| Method Detail |
|---|
public KeyEvent onKeyEvent(KeyEvent e)
onKeyEvent in interface KeyListeneronKeyEvent in class AbstractFocusComponente - the KeyEvent.
null if the KeyEvent has been consumed by the KeyListener,public int onTouchEvent(TouchEvent e)
onTouchEvent in interface TouchListeneronTouchEvent in class AbstractFocusComponente - the TouchEvent.
RESULT_ACCEPTED if the TouchEvent has been consumed by the TouchListener,RESULT_EXECUTED if the TouchEvent has been consumed by the TouchListener and some important action has been performed, e.g. an action event has been invoked,RESULT_NONE if the TouchEvent should be passed on to the next TouchListener.public void paint(jcontrol.graphics.XGraphics g)
paint in class Componentg - the global graphics objectpublic void press(boolean onoff)
onoff - press or release.public void setImage(jcontrol.io.Resource image)
setBounds()-method or
in the constructor.
image - the new image to set.public void setText(java.lang.String label)
setBounds()-method or
in the constructor.
text - the new text to set.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||