|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjaron.components.Signal
jaron.pde.RadioButton
public class RadioButton
The RadioButton
class provides a virtual on-off switch for
the Processing Development Environment (PDE).
By extending the Signal
class it can hook into the
EventListener
mechanism and thus receive and send numerical
values.
Have a look at the example of the UAVsim
for the usage of the
RadioButton
.
Constructor Summary | |
---|---|
RadioButton(processing.core.PApplet applet,
int left,
int top)
Creates a new RadioButton object for the Processing Development
Environment (PDE). |
|
RadioButton(processing.core.PApplet applet,
int left,
int top,
int width,
int height)
Creates a new RadioButton object for the Processing Development
Environment (PDE). |
|
RadioButton(processing.core.PApplet applet,
java.lang.String label,
int left,
int top)
Creates a new RadioButton object for the Processing Development
Environment (PDE). |
|
RadioButton(processing.core.PApplet applet,
java.lang.String label,
int left,
int top,
int width,
int height)
Creates a new RadioButton object for the Processing Development
Environment (PDE). |
Method Summary | |
---|---|
void |
draw()
Draws the button to the screen. |
java.lang.Boolean |
isMouseOver()
Returns true if the mouse is hovering over the butten. |
boolean |
isOn()
Retuns true if the radio button is switched on and false if it is turned off. |
void |
mouseMoved(int x,
int y)
Handles a mouseMoved event that occurred in the GUI. |
void |
mousePressed(int x,
int y)
Acts on a mousePressed event that occurred in the Processing Development
Environment. |
void |
mouseReleased(int x,
int y)
Acts on a mouseReleased event that occurred in the Processing Development
Environment. |
void |
setLabel(java.lang.String label)
Sets the button's label that is displayed underneath the button. |
void |
switchOff()
Switches this button off. |
void |
switchOn()
Switches this button on. |
Methods inherited from class jaron.components.Signal |
---|
addSignalListener, getBandwidth, getHigh, getLow, getValue, removeSignalListener, setBandwidth, setHigh, setLow, setValue, signalChanged |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RadioButton(processing.core.PApplet applet, java.lang.String label, int left, int top, int width, int height)
RadioButton
object for the Processing Development
Environment (PDE).
applet
- a reference to the PDE applet that provides the drawing environmentlabel
- the label that is displayed at the bottomleft
- the component's position from the lefttop
- the component's position from topwidth
- the component's widthheight
- the component's heightpublic RadioButton(processing.core.PApplet applet, int left, int top, int width, int height)
RadioButton
object for the Processing Development
Environment (PDE).
applet
- a reference to the PDE applet that provides the drawing environmentleft
- the component's position from the lefttop
- the component's position from topwidth
- the component's widthheight
- the component's heightpublic RadioButton(processing.core.PApplet applet, java.lang.String label, int left, int top)
RadioButton
object for the Processing Development
Environment (PDE).
applet
- a reference to the PDE applet that provides the drawing environmentlabel
- the label that is displayed at the bottomleft
- the component's position from the lefttop
- the component's position from toppublic RadioButton(processing.core.PApplet applet, int left, int top)
RadioButton
object for the Processing Development
Environment (PDE).
applet
- a reference to the PDE applet that provides the drawing environmentleft
- the component's position from the lefttop
- the component's position from topMethod Detail |
---|
public void draw()
draw
method of the Processing Development Environment. This
ensures that the button is updated periodically.
public java.lang.Boolean isMouseOver()
public void mouseMoved(int x, int y)
mouseMoved
event that occurred in the GUI.mouseMoved
method of
the GUI (e.g. in the Processing Development Environment). This ensures that the user
interaction is received and processed by the control.
x
- the current x value of the mousey
- the current y value of the mousepublic void mousePressed(int x, int y)
mousePressed
event that occurred in the Processing Development
Environment. This method should usually be called from the mousePressed
method of the PDE. This ensures that the user interaction is received and processed
by the control.
x
- the current x value of the mousey
- the current y value of the mousepublic void mouseReleased(int x, int y)
mouseReleased
event that occurred in the Processing Development
Environment. This method should usually be called from the mouseReleased
method of the PDE. This ensures that the user interaction is received and processed
by the control.
x
- the current x value of the mousey
- the current y value of the mousepublic void setLabel(java.lang.String label)
label
- a String
describing the button's functionality in shortpublic void switchOn()
public void switchOff()
public boolean isOn()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |