-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlueJPApplet.java
68 lines (59 loc) · 1.48 KB
/
BlueJPApplet.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import processing.core.*;
import processing.data.*;
import processing.event.*;
import processing.opengl.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
public abstract class BlueJPApplet extends PApplet
{
private boolean isRunning = false;
/**
*
* Use this method to call size().
*
* @see PApplet#fullScreen()
* @see PApplet#setup()
* @see PApplet#size(int,int)
* @see PApplet#smooth()
*/
public abstract void settings();
/**
* The <b>setup()</b> function is called once when the program starts. It's
* used to define initial
* enviroment properties such as screen size and background color and to
* load media such as images
* and fonts as the program starts. There can only be one <b>setup()</b>
* function for each program and
* it shouldn't be called again after its initial execution.
*/
public abstract void setup();
public void draw() {}
/**
* Pauses the sketch.
*/
public void pauseSketch() {
this.noLoop();
}
/**
* Resumes the sketch.
*/
public void resumeSketch() {
this.loop();
}
/**
* Forces a redraw, even if the sketch is paused.
*/
public void redrawSketch() {
this.redraw();
}
/**
* Starts the sketch.
*/
public void runSketch() {
if (!isRunning) {
super.runSketch();
isRunning = true;
}
}
}