jaron.pde
Class Joystick

java.lang.Object
  extended by jaron.gui.Rect
      extended by jaron.gui.ActuatorXY
          extended by jaron.pde.Joystick
All Implemented Interfaces:
SignalListener, java.util.EventListener

public class Joystick
extends ActuatorXY

The Joystick class provides a virtual joystick for the Processing Development Environment (PDE).
Have a look at the example of the UAVsim for the usage of the Joystick.

Since:
1.0
Version:
1.2
Author:
jarontec gmail com

Field Summary
 
Fields inherited from class jaron.gui.ActuatorXY
control
 
Constructor Summary
Joystick(processing.core.PApplet applet, int left, int top)
          Creates a new Joystick object for the Processing Development Environment (PDE).
Joystick(processing.core.PApplet applet, int left, int top, int width, int height)
          Creates a new Joystick object for the Processing Development Environment (PDE).
Joystick(processing.core.PApplet applet, java.lang.String labelX, java.lang.String labelY, int left, int top)
          Creates a new Joystick object for the Processing Development Environment (PDE).
Joystick(processing.core.PApplet applet, java.lang.String labelX, java.lang.String labelY, int left, int top, int width, int height)
          Creates a new Joystick object for the Processing Development Environment (PDE).
 
Method Summary
 void draw()
          Draws the joystick to the screen.
 void setLabelX(java.lang.String label)
          Sets the joystick's label for the x axis.
 void setLabelY(java.lang.String label)
          Sets the joystick's label for the y axis.
 
Methods inherited from class jaron.gui.ActuatorXY
addListenerX, addListenerY, getPowerSignal, getSignalX, getSignalY, getValueX, getValueY, isMouseOver, isMousePressed, mouseDragged, mouseMoved, mousePressed, mouseReleased, setBandwidthX, setBandwidthY, setControlSize, setLocation, setLockedX, setLockedY, setSize, setSpringX, setSpringY, setValue, setValueX, setValueY, signalChanged
 
Methods inherited from class jaron.gui.Rect
contains, createIntersection, getHeight, getLeft, getTop, getWidth, setHeight, setLeft, setTop, setWidth
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Joystick

public Joystick(processing.core.PApplet applet,
                java.lang.String labelX,
                java.lang.String labelY,
                int left,
                int top,
                int width,
                int height)
Creates a new Joystick object for the Processing Development Environment (PDE).

Parameters:
applet - a reference to the PDE applet that provides the drawing environment
labelX - the label that is displayed at the bottom
labelY - the label that is displayed at the right
left - the component's position from the left
top - the component's position from top
height - the component's height
width - the component's width

Joystick

public Joystick(processing.core.PApplet applet,
                int left,
                int top,
                int width,
                int height)
Creates a new Joystick object for the Processing Development Environment (PDE).

Parameters:
applet - a reference to the PDE applet that provides the drawing environment
left - the component's position from the left
top - the component's position from top
height - the component's height
width - the component's width

Joystick

public Joystick(processing.core.PApplet applet,
                java.lang.String labelX,
                java.lang.String labelY,
                int left,
                int top)
Creates a new Joystick object for the Processing Development Environment (PDE).

Parameters:
applet - a reference to the PDE applet that provides the drawing environment
labelX - the label that is displayed at the bottom
labelY - the label that is displayed at the right
left - the component's position from the left
top - the component's position from top

Joystick

public Joystick(processing.core.PApplet applet,
                int left,
                int top)
Creates a new Joystick object for the Processing Development Environment (PDE).

Parameters:
applet - a reference to the PDE applet that provides the drawing environment
left - the component's position from the left
top - the component's position from top
Method Detail

draw

public void draw()
Draws the joystick to the screen. This method should usually be called from the draw method of the Processing Development Environment. This ensures that the joystick is updated periodically.


setLabelX

public void setLabelX(java.lang.String label)
Sets the joystick's label for the x axis. The label is a short description of the x axis' function.

Parameters:
label - a short description of the x axis' functionality

setLabelY

public void setLabelY(java.lang.String label)
Sets the joystick's label for the y axis. The label is a short description of the y axis' function.

Parameters:
label - a short description of the y axis' functionality