public class LongButton extends Button implements ThirdEventThread.ThirdEventWidget
Notes:
LongButton.LongButtonListener
to send the button events,Modifier and Type | Class and Description |
---|---|
static interface |
LongButton.LongButtonListener
Interface that handle long button press events.
|
static class |
LongButton.LongButtonListenerToButtonEvents
Default implementation of
LongButton.LongButtonListener . |
Button.ButtonListener, Button.ButtonListenerToButtonEvents
Widget.WidgetAttribute, Widget.WidgetDescription
MouseListener.MouseButton
DEFAULT_LABEL
Constructor and Description |
---|
LongButton()
Creates a long button widget.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes the widget's associated resources (such as threads, images...).
|
int |
getSleepPeriod()
Gets the sleep period the thread has to wait before asking to send third event.
|
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 |
sendThirdEvent()
Asks to send the third event.
|
void |
setListenerClass(String listenerClassName)
Defines the user class which has to implement
Button.ButtonListener . |
void |
setLongPeriod(int longPeriod)
Set the long event period.
|
void |
start()
Starts the widget.
|
getID, getListener, getPushedSkin, mousePressed, mouseReleased, setLabel, setPushedSkin
newListener, setListenerClass
finalizeConfiguration, getAbsoluteX, getAbsoluteY, getCurrentSkin, getFilter, getHeight, getLabel, getParent, getSkin, getWidth, getX, getY, isOver, repaint, repaint, setCurrentSkin, setFilter, setHeight, setOverlay, setSkin, setWidth, setX, setY, showYourself
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved
public LongButton()
The default long period is 500ms.
public void dispose()
Widget
Default 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 getSleepPeriod()
ThirdEventThread.ThirdEventWidget
getSleepPeriod
in interface ThirdEventThread.ThirdEventWidget
protected Object newDefaultListener()
WidgetWithListener
newDefaultListener
in class Button
protected void press()
Button
protected void release()
Button
public void sendThirdEvent()
ThirdEventThread.ThirdEventWidget
sendThirdEvent
in interface ThirdEventThread.ThirdEventWidget
public void setListenerClass(String listenerClassName)
Button
Button.ButtonListener
.
This method should only be called by front panel parser.
setListenerClass
in class Button
listenerClassName
- user listener class name.public void setLongPeriod(int longPeriod)
This method should only be called by front panel parser.
longPeriod
- a time in milliseconds.public void start()
Widget
Widget.finalizeConfiguration()
).
Main implementation does nothing.
This method should only be called by front panel engine.