Skip to content

Commit 83d77fa

Browse files
committed
Simple reference updates
1 parent ffde2ae commit 83d77fa

File tree

11 files changed

+55
-53
lines changed

11 files changed

+55
-53
lines changed

build/shared/lib/preferences.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ editor.laf.linux = com.sun.java.swing.plaf.gtk.GTKLookAndFeel
234234
editor.token.function1.style = #006699,plain
235235
editor.token.function2.style = #006699,plain
236236
editor.token.function3.style = #669933,plain
237-
editor.token.function4.style = #669933,plain
237+
editor.token.function4.style = #006699,bold
238238

239239
editor.token.keyword1.style = #996633,plain
240240
editor.token.keyword2.style = #996633,plain
@@ -249,8 +249,8 @@ editor.token.operator.style = #006699,plain
249249

250250
editor.token.label.style = #7e7e7e,bold
251251

252-
editor.token.comment1.style = #7e7e7e,plain
253-
editor.token.comment2.style = #7e7e7e,plain
252+
editor.token.comment1.style = #7e7e7e,italic
253+
editor.token.comment2.style = #7e7e7e,italic
254254

255255
editor.token.invalid.style = #7e7e7e,bold
256256

core/src/processing/core/PApplet.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5277,7 +5277,7 @@ public PImage loadImage(String filename) {
52775277
// }
52785278

52795279
/**
5280-
* @nowebref
5280+
* @param extension type of image to load, for example "png", "gif", "jpg"
52815281
*/
52825282
public PImage loadImage(String filename, String extension) { //, Object params) {
52835283
if (extension == null) {
@@ -14303,6 +14303,9 @@ public void background(float v1, float v2, float v3, float alpha) {
1430314303
}
1430414304

1430514305

14306+
/**
14307+
* @webref color:setting
14308+
*/
1430614309
public void clear() {
1430714310
if (recorder != null) recorder.clear();
1430814311
g.clear();

core/src/processing/core/PGraphics.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6904,7 +6904,9 @@ public void background(float v1, float v2, float v3, float alpha) {
69046904
backgroundFromCalc();
69056905
}
69066906

6907-
6907+
/**
6908+
* @webref color:setting
6909+
*/
69086910
public void clear() {
69096911
background(0, 0, 0, 0);
69106912
}

java/examples/Basics/Input/Clock/Clock.pde

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* The current time can be read with the second(), minute(),
55
* and hour() functions. In this example, sin() and cos() values
66
* are used to set the position of the hands.
7-
*
8-
* Updated 27 February 2010 to handle size() changes.
97
*/
108

119
int cx, cy;

java/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
* by Daniel Shiffman.
44
*
55
* This example demonstrates how to use a HashMap to store
6-
* a collection of objects referenced by a key.
7-
* This is much like an array, only instead of accessing elements
8-
* with a numeric index, we use a String.
6+
* a collection of objects referenced by a key. This is much like an array,
7+
* only instead of accessing elements with a numeric index, we use a String.
98
* If you are familiar with associative arrays from other languages,
109
* this is the same idea.
1110
*
@@ -23,6 +22,7 @@ int counter;
2322

2423
void setup() {
2524
size(640, 360);
25+
2626
words = new HashMap();
2727

2828
// Load file and chop it up
@@ -51,8 +51,7 @@ void draw() {
5151
} else {
5252
// Otherwise make a new word
5353
Word w = new Word(s);
54-
// And add to the HashMap
55-
// put() takes two arguments, "key" and "value"
54+
// And add to the HashMap put() takes two arguments, "key" and "value"
5655
// The key for us is the String and the value is the Word object
5756
words.put(s, w);
5857
}
@@ -74,7 +73,7 @@ void draw() {
7473
x += textWidth(w.word + " ");
7574
}
7675

77-
// If x gets to the end, move Y
76+
// If x gets to the end, move y
7877
if (x > width) {
7978
x = 0;
8079
y -= 100;

java/examples/Topics/Cellular Automata/Conway/Conway.pde

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ void setup()
2525

2626
// Set random cells to 'on'
2727
for (int i = 0; i < sx * sy * density; i++) {
28-
world[(int)random(sx)][(int)random(sy)][1] = 1;
28+
int x = int(random(sx));
29+
int y = int(random(sy));
30+
world[x][y][1] = 1;
2931
}
3032
}
3133

java/examples/Topics/GUI/Button/Button.pde

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ void draw() {
3535
update(mouseX, mouseY);
3636
background(currentColor);
3737

38-
if(rectOver) {
38+
if (rectOver) {
3939
fill(rectHighlight);
4040
} else {
4141
fill(rectColor);
4242
}
4343
stroke(255);
4444
rect(rectX, rectY, rectSize, rectSize);
4545

46-
if(circleOver) {
46+
if (circleOver) {
4747
fill(circleHighlight);
4848
} else {
4949
fill(circleColor);
@@ -53,7 +53,7 @@ void draw() {
5353
}
5454

5555
void update(int x, int y) {
56-
if( overCircle(circleX, circleY, circleSize) ) {
56+
if ( overCircle(circleX, circleY, circleSize) ) {
5757
circleOver = true;
5858
rectOver = false;
5959
} else if ( overRect(rectX, rectY, rectSize, rectSize) ) {
@@ -65,10 +65,10 @@ void update(int x, int y) {
6565
}
6666

6767
void mousePressed() {
68-
if(circleOver) {
68+
if (circleOver) {
6969
currentColor = circleColor;
7070
}
71-
if(rectOver) {
71+
if (rectOver) {
7272
currentColor = rectColor;
7373
}
7474
}
@@ -85,7 +85,7 @@ boolean overRect(int x, int y, int width, int height) {
8585
boolean overCircle(int x, int y, int diameter) {
8686
float disX = x - mouseX;
8787
float disY = y - mouseY;
88-
if(sqrt(sq(disX) + sq(disY)) < diameter/2 ) {
88+
if (sqrt(sq(disX) + sq(disY)) < diameter/2 ) {
8989
return true;
9090
} else {
9191
return false;

java/examples/Topics/GUI/Handles/Handles.pde

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,21 @@
55
*/
66

77
Handle[] handles;
8-
int num;
98

109
void setup() {
1110
size(640, 360);
12-
num = height/15;
11+
int num = height/15;
1312
handles = new Handle[num];
1413
int hsize = 10;
15-
for(int i=0; i<num; i++) {
14+
for (int i = 0; i < handles.length; i++) {
1615
handles[i] = new Handle(width/2, 10+i*15, 50-hsize/2, 10, handles);
1716
}
1817
}
1918

2019
void draw() {
2120
background(153);
2221

23-
for(int i=0; i<num; i++) {
22+
for (int i = 0; i < handles.length; i++) {
2423
handles[i].update();
2524
handles[i].display();
2625
}
@@ -30,7 +29,7 @@ void draw() {
3029
}
3130

3231
void mouseReleased() {
33-
for(int i=0; i<num; i++) {
32+
for (int i = 0; i < handles.length; i++) {
3433
handles[i].releaseEvent();
3534
}
3635
}
@@ -39,7 +38,7 @@ class Handle {
3938

4039
int x, y;
4140
int boxx, boxy;
42-
int length;
41+
int stretch;
4342
int size;
4443
boolean over;
4544
boolean press;
@@ -50,46 +49,46 @@ class Handle {
5049
Handle(int ix, int iy, int il, int is, Handle[] o) {
5150
x = ix;
5251
y = iy;
53-
length = il;
52+
stretch = il;
5453
size = is;
55-
boxx = x+length - size/2;
54+
boxx = x+stretch - size/2;
5655
boxy = y - size/2;
5756
others = o;
5857
}
5958

6059
void update() {
61-
boxx = x+length;
60+
boxx = x+stretch;
6261
boxy = y - size/2;
6362

64-
for(int i=0; i<others.length; i++) {
65-
if(others[i].locked == true) {
63+
for (int i=0; i<others.length; i++) {
64+
if (others[i].locked == true) {
6665
otherslocked = true;
6766
break;
6867
} else {
6968
otherslocked = false;
7069
}
7170
}
7271

73-
if(otherslocked == false) {
72+
if (otherslocked == false) {
7473
overEvent();
7574
pressEvent();
7675
}
7776

78-
if(press) {
79-
length = lock(mouseX-width/2-size/2, 0, width/2-size-1);
77+
if (press) {
78+
stretch = lock(mouseX-width/2-size/2, 0, width/2-size-1);
8079
}
8180
}
8281

8382
void overEvent() {
84-
if(overRect(boxx, boxy, size, size)) {
83+
if (overRect(boxx, boxy, size, size)) {
8584
over = true;
8685
} else {
8786
over = false;
8887
}
8988
}
9089

9190
void pressEvent() {
92-
if(over && mousePressed || locked) {
91+
if (over && mousePressed || locked) {
9392
press = true;
9493
locked = true;
9594
} else {
@@ -102,11 +101,11 @@ class Handle {
102101
}
103102

104103
void display() {
105-
line(x, y, x+length, y);
104+
line(x, y, x+stretch, y);
106105
fill(255);
107106
stroke(0);
108107
rect(boxx, boxy, size, size);
109-
if(over || press) {
108+
if (over || press) {
110109
line(boxx, boxy, boxx+size, boxy+size);
111110
line(boxx, boxy+size, boxx+size, boxy);
112111
}

java/examples/Topics/GUI/Scrollbar/Scrollbar.pde

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
HScrollbar hs1, hs2; // Two scrollbars
13-
PImage img1, img2; // Two image to load
13+
PImage img1, img2; // Two images to load
1414

1515
void setup() {
1616
size(640, 360);
@@ -74,21 +74,21 @@ class HScrollbar {
7474
}
7575

7676
void update() {
77-
if(overEvent()) {
77+
if (overEvent()) {
7878
over = true;
7979
} else {
8080
over = false;
8181
}
82-
if(mousePressed && over) {
82+
if (mousePressed && over) {
8383
locked = true;
8484
}
85-
if(!mousePressed) {
85+
if (!mousePressed) {
8686
locked = false;
8787
}
88-
if(locked) {
88+
if (locked) {
8989
newspos = constrain(mouseX-sheight/2, sposMin, sposMax);
9090
}
91-
if(abs(newspos - spos) > 1) {
91+
if (abs(newspos - spos) > 1) {
9292
spos = spos + (newspos-spos)/loose;
9393
}
9494
}
@@ -98,7 +98,7 @@ class HScrollbar {
9898
}
9999

100100
boolean overEvent() {
101-
if(mouseX > xpos && mouseX < xpos+swidth &&
101+
if (mouseX > xpos && mouseX < xpos+swidth &&
102102
mouseY > ypos && mouseY < ypos+sheight) {
103103
return true;
104104
} else {
@@ -110,7 +110,7 @@ class HScrollbar {
110110
noStroke();
111111
fill(204);
112112
rect(xpos, ypos, swidth, sheight);
113-
if(over || locked) {
113+
if (over || locked) {
114114
fill(0, 0, 0);
115115
} else {
116116
fill(102, 102, 102);

java/keywords.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ Thread KEYWORD5
224224
boolean KEYWORD5 boolean
225225
byte KEYWORD5 byte
226226
char KEYWORD5 char
227+
color KEYWORD5 color_datatype
227228
double KEYWORD5 double
228229
float KEYWORD5 float
229230
int KEYWORD5 int
@@ -256,8 +257,6 @@ try FUNCTION3 try
256257

257258
# These items are a part of Processing but, but pages don't generate
258259

259-
color KEYWORD1 color_datatype
260-
261260
boolean FUNCTION1 booleanconvert_
262261
byte FUNCTION1 byteconvert_
263262
cache FUNCTION2

0 commit comments

Comments
 (0)