Package jto.processing.sketch.mapper
Class AbstractSketch
- java.lang.Object
-
- jto.processing.sketch.mapper.AbstractSketch
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
autoGenerated
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
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 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()
boolean
isAutoGenerated()
void
setAutoGenerated(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: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.
-
getPGraphics
public processing.core.PGraphics getPGraphics()
Description copied from interface:Sketch
Return the PGraphics associated with this sketch.- Specified by:
getPGraphics
in interfaceSketch
- Returns:
- the graphics object associated with this sketch.
-
isAutoGenerated
public boolean isAutoGenerated()
- Specified by:
isAutoGenerated
in interfaceSketch
- Returns:
- true if this sketch was auto-generated by SketchMapper.
-
setAutoGenerated
public void setAutoGenerated(boolean autoGenerated)
Description copied from interface:Sketch
Set the autoGenerated property.- Specified by:
setAutoGenerated
in interfaceSketch
- Parameters:
autoGenerated
- the autogenerated property
-
-