Package jto.processing.sketch.mapper
Class SketchMapper
- java.lang.Object
-
- jto.processing.sketch.mapper.SketchMapper
-
public class SketchMapper extends Object
-
-
Constructor Summary
Constructors Constructor Description SketchMapper(processing.core.PApplet parent)
Constructor for SketchMapper objects.SketchMapper(processing.core.PApplet parent, String filename)
Constructor for SketchMapper objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSketch(Sketch sketch)
Adds the sketch to the list of sketches.void
draw()
The draw method.int
getMostRecentSurface()
List<Sketch>
getSketchList()
boolean
isMouseWithinAnySurface()
void
keyEvent(processing.event.KeyEvent event)
Invoked whenever a KeyEvent happens.void
mouseEvent(processing.event.MouseEvent event)
Invoked whenever a mouseEvent happens.void
removeSketch(Sketch sketch)
Removes the given sketch from the list of sketches.void
resetMostRecentSurface()
void
setBackgroundImage(processing.core.PImage backgroundImage)
This allows you set a background image.void
setSketchList(List<Sketch> sketchList)
-
-
-
Constructor Detail
-
SketchMapper
public SketchMapper(processing.core.PApplet parent)
Constructor for SketchMapper objects.- Parameters:
parent
- the parent sketch.
-
SketchMapper
public SketchMapper(processing.core.PApplet parent, String filename)
Constructor for SketchMapper objects.- Parameters:
parent
- the parent sketch.filename
- the filename of the layout to load.
-
-
Method Detail
-
addSketch
public void addSketch(Sketch sketch)
Adds the sketch to the list of sketches.- Parameters:
sketch
- the sketch to add.
-
draw
public void draw()
The draw method. Invoke this in the parent sketch's draw method which overridesPApplet.draw()
.
-
getMostRecentSurface
public int getMostRecentSurface()
-
isMouseWithinAnySurface
public boolean isMouseWithinAnySurface()
-
keyEvent
public void keyEvent(processing.event.KeyEvent event)
Invoked whenever a KeyEvent happens.- Parameters:
event
- the KeyEvent.
-
mouseEvent
public void mouseEvent(processing.event.MouseEvent event)
Invoked whenever a mouseEvent happens.- Parameters:
event
- the mouse event.
-
removeSketch
public void removeSketch(Sketch sketch)
Removes the given sketch from the list of sketches.- Parameters:
sketch
- the sketch to be removed.
-
resetMostRecentSurface
public void resetMostRecentSurface()
-
setBackgroundImage
public void setBackgroundImage(processing.core.PImage backgroundImage)
This allows you set a background image. It will be displayed behind any rendered surfaces.- Parameters:
backgroundImage
- the background image.
-
-