controlP5
Class ControlCanvas

java.lang.Object
  extended by controlP5.ControlCanvas

public abstract class ControlCanvas
extends java.lang.Object

use a controlWindowCanvas to draw your own content into a control window.

+Example
/**
 * ControlP5 GroupCanvas
 * by andreas schlegel, 2009
 */
import controlP5.*;

/**
  * WARNING
  * ControlCanvas and ControlWindowCanvas are yet EXPERIMENTAL
  * and therefore will undergo changes in the future before being
  * fully functional!
  */
  
ControlP5 controlP5;
  
void setup() {
  size(400,400);
  frameRate(30);

  controlP5 = new ControlP5(this);
  ControlGroup l = controlP5.addGroup("myGroup",100,40);
  l.addCanvas(new TestCanvas());
}

void draw() {
  background(0);
}


void controlEvent(ControlEvent theEvent) {
  println("got an event from "+theEvent.controller().name());
}


class TestCanvas extends ControlCanvas {
  TestCanvas() {
  }
  
  public void draw(PApplet theApplet) {
    theApplet.fill(int(random(244)));
    theApplet.rect(0,0,100,100);
  }
}

Field Summary
static int POST
           
static int PRE
           
 
Constructor Summary
ControlCanvas()
           
 
Method Summary
abstract  void draw(processing.core.PApplet theApplet)
          controlCanvas is an abstract class and therefore needs to be extended by your class.
 int mode()
          get the drawing mode of a ControlWindowCanvas.
 void post()
          set the drawing mode to POST.
 void pre()
          set the drawing mode to PRE.
 void setMode(int theMode)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRE

public static final int PRE
See Also:
Constant Field Values

POST

public static final int POST
See Also:
Constant Field Values
Constructor Detail

ControlCanvas

public ControlCanvas()
Method Detail

draw

public abstract void draw(processing.core.PApplet theApplet)
controlCanvas is an abstract class and therefore needs to be extended by your class. draw(PApplet theApplet) is the only method that needs to be overwritten.


mode

public final int mode()
get the drawing mode of a ControlWindowCanvas. this can be PRE or POST.

Returns:

pre

public final void pre()
set the drawing mode to PRE. PRE is the default.


post

public final void post()
set the drawing mode to POST.


setMode

public final void setMode(int theMode)
Parameters:
theMode -


processing library controlP5 by Andreas Schlegel. (c) 2010