public class Button extends WidgetWithListener implements ej.fp.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. |
| Constructor and Description |
|---|
Button() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
int |
getID()
Gets the button identifier (equals to its label).
|
protected Button.ButtonListener |
getListener()
Gets the widget listener.
|
ej.fp.Image |
getPushedSkin()
Gets the skin which shows the button as pressed.
|
void |
mousePressed(int x,
int y,
ej.fp.MouseListener.MouseButton button) |
void |
mouseReleased(int x,
int y,
ej.fp.MouseListener.MouseButton button) |
protected java.lang.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(java.lang.String label) |
void |
setListenerClass(java.lang.String listenerClassName)
Defines the user class which has to implement
Button.ButtonListener. |
void |
setPushedSkin(ej.fp.Image pushedSkin)
Sets the image which shows the pressed button.
|
void |
start() |
newListener, setListenerClassfinalizeConfiguration, getAbsoluteX, getAbsoluteY, getCurrentSkin, getFilter, getHeight, getLabel, getParent, getSkin, getWidth, getX, getY, isOver, repaint, repaint, setCurrentSkin, setFilter, setHeight, setOverlay, setSkin, setWidth, setX, setY, showYourselfpublic void setLabel(java.lang.String label)
setLabel in class ej.fp.Widgetpublic void setPushedSkin(ej.fp.Image pushedSkin)
This method should only be called by front panel parser.
pushedSkin - the button pressed image.public void setListenerClass(java.lang.String listenerClassName)
Button.ButtonListener.
This method should only be called by front panel parser.
listenerClassName - user listener class name.public void start()
start in class ej.fp.Widgetpublic void dispose()
dispose in class ej.fp.Widgetprotected java.lang.Object newDefaultListener()
WidgetWithListenernewDefaultListener in class WidgetWithListenerpublic void mousePressed(int x,
int y,
ej.fp.MouseListener.MouseButton button)
mousePressed in interface ej.fp.MouseListenerpublic void mouseReleased(int x,
int y,
ej.fp.MouseListener.MouseButton button)
mouseReleased in interface ej.fp.MouseListenerprotected void press()
protected void release()
protected Button.ButtonListener getListener()
public ej.fp.Image getPushedSkin()
public int getID()