public class Button extends WidgetWithListener implements MouseListener
Notes:
Button.ButtonListener to send the button events,| Modifier and Type | Class and Description |
|---|---|
static interface |
Button.ButtonListener
Interface that handle button events.
|
static class |
Button.ButtonListenerToButtonEvents
Default implementation of
Button.ButtonListener. |
Widget.WidgetAttribute, Widget.WidgetDescriptionMouseListener.MouseButtonDEFAULT_LABEL| Constructor and Description |
|---|
Button() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Disposes the widget's associated resources (such as threads, images...).
|
int |
getID()
Gets the button identifier (equals to its label).
|
protected Button.ButtonListener |
getListener()
Gets the widget listener.
|
Image |
getPushedSkin()
Gets the skin which shows the button as pressed.
|
void |
mousePressed(int x,
int y,
MouseListener.MouseButton button)
Invoked when a mouse has been pressed on a widget.
|
void |
mouseReleased(int x,
int y,
MouseListener.MouseButton button)
Invoked when a mouse has been released on a widget.
|
protected Object |
newDefaultListener()
Lets subclass creates a default listener.
|
protected void |
press()
Default implementation of press action: update the skin and ask to the listener to manage the event.
|
protected void |
release()
Default implementation of release action: update the skin and ask to the listener to manage the event.
|
void |
setLabel(String label)
Sets the label (tag) of this widget.
|
void |
setListenerClass(String listenerClassName)
Defines the user class which has to implement
Button.ButtonListener. |
void |
setPushedSkin(Image pushedSkin)
Sets the image which shows the pressed button.
|
void |
start()
Starts the widget.
|
newListener, setListenerClassfinalizeConfiguration, getAbsoluteX, getAbsoluteY, getCurrentSkin, getFilter, getHeight, getLabel, getParent, getSkin, getWidth, getX, getY, isOver, repaint, repaint, setCurrentSkin, setFilter, setHeight, setOverlay, setSkin, setWidth, setX, setY, showYourselfclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmouseDragged, mouseEntered, mouseExited, mouseMoved, mouseWheelMovedpublic void dispose()
WidgetDefault behavior disposes the common images and subclasses should override this method to define their own behavior.
This method should only be called by front panel engine.
public int getID()
protected Button.ButtonListener getListener()
public Image getPushedSkin()
public void mousePressed(int x,
int y,
MouseListener.MouseButton button)
MouseListenermousePressed in interface MouseListenerx - the mouse x coordinate relative to widget position.y - the mouse y coordinate relative to widget position.button - the button that has been pressed.public void mouseReleased(int x,
int y,
MouseListener.MouseButton button)
MouseListenermouseReleased in interface MouseListenerx - the mouse x coordinate relative to widget position.y - the mouse y coordinate relative to widget position.button - the button that has been released.protected Object newDefaultListener()
WidgetWithListenernewDefaultListener in class WidgetWithListenerprotected void press()
protected void release()
public void setLabel(String label)
WidgetThis method should only be called by front panel parser.
setLabel in class Widgetlabel - the widget label.Device.getWidget(Class, String)public void setListenerClass(String listenerClassName)
Button.ButtonListener.
This method should only be called by front panel parser.
listenerClassName - user listener class name.public void setPushedSkin(Image pushedSkin)
This method should only be called by front panel parser.
pushedSkin - the button pressed image.public void start()
WidgetWidget.finalizeConfiguration()).
Main implementation does nothing.
This method should only be called by front panel engine.