Class SketchMapper


  • public class SketchMapper
    extends Object
    • 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 overrides PApplet.draw().
      • getMostRecentSurface

        public int getMostRecentSurface()
      • getSketchList

        public List<Sketch> getSketchList()
      • 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.
      • setSketchList

        public void setSketchList​(List<Sketch> sketchList)