jto.processing.sketch.mapper
Class AbstractSketch

java.lang.Object
  extended by jto.processing.sketch.mapper.AbstractSketch
All Implemented Interfaces:
Sketch

public abstract class AbstractSketch
extends Object
implements Sketch

This is an abstract implementation of Sketch. This contains protected fields for the graphics and parent PApplet as well some basic implementations of other methods.


Field Summary
protected  processing.core.PGraphics graphics
          the PGraphics instance that this sketch will use to draw objects.
protected  processing.core.PApplet parent
          The parent processing sketch of this sketch.
 
Constructor Summary
AbstractSketch(processing.core.PApplet parent, int width, int height)
          Constructor this creates a PGraphics object with the size provided in the parameters and the renderer specified by PConstants.OPENGL.
 
Method Summary
 boolean equals(Object o)
           
 String getName()
          Returns the name of the sketch.
 processing.core.PGraphics getPGraphics()
          Return the PGraphics associated with this sketch.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jto.processing.sketch.mapper.Sketch
draw, keyEvent, mouseEvent, setup
 

Field Detail

graphics

protected final processing.core.PGraphics graphics
the PGraphics instance that this sketch will use to draw objects.


parent

protected final processing.core.PApplet parent
The parent processing sketch of this sketch. Can be used for PApplet methods.

Constructor Detail

AbstractSketch

public AbstractSketch(processing.core.PApplet parent,
                      int width,
                      int height)
Constructor this creates a PGraphics object with the size provided in the parameters and the renderer specified by PConstants.OPENGL.

Parameters:
parent - the parent PApplet.
width - the width of the sketch in pixels.
height - the height of the sketch in pixels.
Method Detail

equals

public boolean equals(Object o)
Overrides:
equals in class Object

getName

public String getName()
Description copied from interface: Sketch
Returns the name of the sketch. This is what will show up in the UI dropdown. Implement this to return custom labels if desired.

Specified by:
getName in interface Sketch
Returns:
the name of the class of the sketch

getPGraphics

public processing.core.PGraphics getPGraphics()
Description copied from interface: Sketch
Return the PGraphics associated with this sketch.

Specified by:
getPGraphics in interface Sketch
Returns:
the graphics object associated with this sketch.

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2015. All rights reserved.