|
SpringGUI
introduction download reference examples faq
Reference - table of events
Description
|
This is a table of all events fired by SpringGUI elements. All events are passed to the handleEvent(String[] parameters) method you must implement in your Processing application. The parameters array contains all necessary information about the event that happened.
The first three parameters will always describe the type of element that fired the event, the name of the element and the name of the event (as listed here) that happened. The array may or may not contain additional parameters with more information about what happened, as described in the table below.
|
Related
|
handleEvent()
|
Event name:
|
mouseEntered, mouseExited
|
Description:
|
Fire when the mouse cursor enters or leaves a GUI element, respectively.
|
Applies to:
|
all elements.
|
Additional parameters:
|
none.
|
Event name:
|
mousePressed, mouseReleased
|
Description:
|
Fire when the user presses down the left mouse button over an element or releases the mouse button over an element, respectively.
|
Applies to:
|
all elements.
|
Additional parameters:
|
none.
|
Comments:
|
mousePressed should not be used to determine whether an element such as a button has been clicked, as it instantly fires when the mouse button is pressed. Normally, GUIs wait until the button is released over the same element as it has been pressed on to determine that a button has been pushed. mouseClicked is thus better suited to work with buttons.
|
Event name:
|
mouseClicked
|
Description:
|
Fires when the user presses and releases the (left) mouse button over an element.
|
Applies to:
|
all elements.
|
Additional parameters:
|
none.
|
Event name:
|
keyPressed, keyReleased, keyTyped
|
Description:
|
keyPressed and keyReleased fire when the user presses down or releases a key on the keyboard, while an element is in focus. keyTyped fires when a key has been pressed and released while the element remained in focus. keyPressed, keyReleased and keyTyped are thus analog to mousePressed, mouseReleased and mouseClicked.
|
Applies to:
|
TextField
TextArea
Choice
List
|
Additional parameters:
|
parameters[3] contains a String representation of the key in question.
|
Event name:
|
textChanged
|
Description:
|
Fires when the user changes the text in a TextField or TextArea. Note that this is different from keyPressed or keyTyped as there are several keys on the keyboard (think of the cursor keys for example, or even the key-combinations for clipboard operations) that do not change the text per se.
|
Applies to:
|
TextField
TextArea
|
Additional parameters:
|
parameters[3] contains the new text in the element.
|
Event name:
|
selected
|
Description:
|
Fires when the user selects a Radiobutton from a group, an item in a List or Choice, or when the user puts a check in a Checkbox.
|
Applies to:
|
Checkbox
Radiobutton
Choice
List
|
Additional parameters:
|
parameters[3] contains the index of the selected item, if the element is a List, otherwise, it will contain the (text) value of the selected item or element.
|
Comments:
|
The inconsistency in the additional parameter may be subject to change in the future. Also note that the event selected is not fired if you uncheck a Checkbox (in which case a deselected event fires).
|
Event name:
|
deselected
|
Description:
|
Fires when the user unchecks a Checkbox or deselects an item in a List.
|
Applies to:
|
Checkbox
List
|
Additional parameters:
|
parameters[3] contains the index of the deselected item, if the element is a List, otherwise it will contain the (text) value of the deselected item or element.
|
Comments:
|
The inconsistency in the additional parameter may be subject to change in the future. Also note that the event does not apply to Radiobuttons, that is, if a Radiobutton in a group is selected, the formerly selected Radiobutton will not fire a deselected event.
|
Event name:
|
returnPressed
|
Description:
|
This is an event included for convenience's sake that fires when the user presses the return key while in a TextField.
|
Applies to:
|
TextField
|
Additional parameters:
|
parameters[3] contains the text in the TextField.
|
back to the top of the page
|
| |
| | |