Package jto.processing.sketch.mapper
Class AbstractSketch
- java.lang.Object
-
- jto.processing.sketch.mapper.AbstractSketch
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanautoGeneratedprotected processing.core.PGraphicsgraphicsthe PGraphics instance that this sketch will use to draw objects.protected processing.core.PAppletparentThe parent processing sketch of this sketch.
-
Constructor Summary
Constructors Constructor Description 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 byPConstants.OPENGL.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetName()Returns the name of the sketch.processing.core.PGraphicsgetPGraphics()Return the PGraphics associated with this sketch.inthashCode()booleanisAutoGenerated()voidsetAutoGenerated(boolean autoGenerated)Set the autoGenerated property.-
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.
-
autoGenerated
protected boolean autoGenerated
-
-
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 byPConstants.OPENGL.- Parameters:
parent- the parentPApplet.width- the width of the sketch in pixels.height- the height of the sketch in pixels.
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:SketchReturns the name of the sketch. This is what will show up in the UI dropdown. Implement this to return custom labels if desired.
-
getPGraphics
public processing.core.PGraphics getPGraphics()
Description copied from interface:SketchReturn the PGraphics associated with this sketch.- Specified by:
getPGraphicsin interfaceSketch- Returns:
- the graphics object associated with this sketch.
-
isAutoGenerated
public boolean isAutoGenerated()
- Specified by:
isAutoGeneratedin interfaceSketch- Returns:
- true if this sketch was auto-generated by SketchMapper.
-
setAutoGenerated
public void setAutoGenerated(boolean autoGenerated)
Description copied from interface:SketchSet the autoGenerated property.- Specified by:
setAutoGeneratedin interfaceSketch- Parameters:
autoGenerated- the autogenerated property
-
-