SGQuickVar
Class SGVariable

java.lang.Object
  extended by SGQuickVar.SGVariable

public class SGVariable
extends java.lang.Object


Field Summary
 char downKey
          Pressing this key will decrement the variable by its step
 float interval
          Interval for increments/decrements
 float max
          Maximum variable
 float min
          Minimum value
 char upKey
          Pressing this key will increment the variable by its step
 float val
          Current value of this variable
 
Constructor Summary
SGVariable(processing.core.PApplet parent, processing.core.PFont font, java.lang.String title, char up, char down, float val, float interval, float min, float max)
           
 
Method Summary
 void draw()
          Renders to screen.
 void keyEvent(java.awt.event.KeyEvent e)
          Handles key presses.
 void setTextColor(int color)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

val

public float val
Current value of this variable


min

public float min
Minimum value


max

public float max
Maximum variable


upKey

public char upKey
Pressing this key will increment the variable by its step


downKey

public char downKey
Pressing this key will decrement the variable by its step


interval

public float interval
Interval for increments/decrements

Constructor Detail

SGVariable

public SGVariable(processing.core.PApplet parent,
                  processing.core.PFont font,
                  java.lang.String title,
                  char up,
                  char down,
                  float val,
                  float interval,
                  float min,
                  float max)
Parameters:
parent -
font - PFont used to render to the screen
title - Name of the variable. Will be displayed on the screen next to the value
up - char to press to increment the variable
down - char to press to decrement the variable
val - Initial value of the variable
interval - Amount to increment or decrement per keypress
min -
max -
Method Detail

setTextColor

public void setTextColor(int color)

draw

public void draw()
Renders to screen. Should not be called by user.


keyEvent

public void keyEvent(java.awt.event.KeyEvent e)
Handles key presses. Called automatically by the owning applet

Parameters:
e -