diff --git a/build/shared/lib/preferences.txt b/build/shared/lib/preferences.txt index 32258eaec..ffd67dbf7 100644 --- a/build/shared/lib/preferences.txt +++ b/build/shared/lib/preferences.txt @@ -234,7 +234,7 @@ editor.laf.linux = com.sun.java.swing.plaf.gtk.GTKLookAndFeel editor.token.function1.style = #006699,plain editor.token.function2.style = #006699,plain editor.token.function3.style = #669933,plain -editor.token.function4.style = #669933,plain +editor.token.function4.style = #006699,bold editor.token.keyword1.style = #996633,plain editor.token.keyword2.style = #996633,plain @@ -249,8 +249,8 @@ editor.token.operator.style = #006699,plain editor.token.label.style = #7e7e7e,bold -editor.token.comment1.style = #7e7e7e,plain -editor.token.comment2.style = #7e7e7e,plain +editor.token.comment1.style = #7e7e7e,italic +editor.token.comment2.style = #7e7e7e,italic editor.token.invalid.style = #7e7e7e,bold diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 7defbcce3..99184e264 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -5277,7 +5277,7 @@ public class PApplet extends Applet // } /** - * @nowebref + * @param extension type of image to load, for example "png", "gif", "jpg" */ public PImage loadImage(String filename, String extension) { //, Object params) { if (extension == null) { @@ -14303,6 +14303,9 @@ public class PApplet extends Applet } + /** + * @webref color:setting + */ public void clear() { if (recorder != null) recorder.clear(); g.clear(); diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index 957bd80b0..3ffa7bb9e 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -6904,7 +6904,9 @@ public class PGraphics extends PImage implements PConstants { backgroundFromCalc(); } - + /** + * @webref color:setting + */ public void clear() { background(0, 0, 0, 0); } diff --git a/java/examples/Basics/Input/Clock/Clock.pde b/java/examples/Basics/Input/Clock/Clock.pde index 09c45740e..01e6105aa 100644 --- a/java/examples/Basics/Input/Clock/Clock.pde +++ b/java/examples/Basics/Input/Clock/Clock.pde @@ -4,8 +4,6 @@ * The current time can be read with the second(), minute(), * and hour() functions. In this example, sin() and cos() values * are used to set the position of the hands. - * - * Updated 27 February 2010 to handle size() changes. */ int cx, cy; diff --git a/java/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde b/java/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde index d30698f1f..77a81e663 100644 --- a/java/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde +++ b/java/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde @@ -3,9 +3,8 @@ * by Daniel Shiffman. * * This example demonstrates how to use a HashMap to store - * a collection of objects referenced by a key. - * This is much like an array, only instead of accessing elements - * with a numeric index, we use a String. + * a collection of objects referenced by a key. This is much like an array, + * only instead of accessing elements with a numeric index, we use a String. * If you are familiar with associative arrays from other languages, * this is the same idea. * @@ -23,6 +22,7 @@ int counter; void setup() { size(640, 360); + words = new HashMap(); // Load file and chop it up @@ -51,8 +51,7 @@ void draw() { } else { // Otherwise make a new word Word w = new Word(s); - // And add to the HashMap - // put() takes two arguments, "key" and "value" + // And add to the HashMap put() takes two arguments, "key" and "value" // The key for us is the String and the value is the Word object words.put(s, w); } @@ -74,7 +73,7 @@ void draw() { x += textWidth(w.word + " "); } - // If x gets to the end, move Y + // If x gets to the end, move y if (x > width) { x = 0; y -= 100; diff --git a/java/examples/Topics/Cellular Automata/Conway/Conway.pde b/java/examples/Topics/Cellular Automata/Conway/Conway.pde index 9347303cc..7720fbdf6 100644 --- a/java/examples/Topics/Cellular Automata/Conway/Conway.pde +++ b/java/examples/Topics/Cellular Automata/Conway/Conway.pde @@ -25,7 +25,9 @@ void setup() // Set random cells to 'on' for (int i = 0; i < sx * sy * density; i++) { - world[(int)random(sx)][(int)random(sy)][1] = 1; + int x = int(random(sx)); + int y = int(random(sy)); + world[x][y][1] = 1; } } diff --git a/java/examples/Topics/GUI/Button/Button.pde b/java/examples/Topics/GUI/Button/Button.pde index 252f0c56a..4b8a536cc 100644 --- a/java/examples/Topics/GUI/Button/Button.pde +++ b/java/examples/Topics/GUI/Button/Button.pde @@ -35,7 +35,7 @@ void draw() { update(mouseX, mouseY); background(currentColor); - if(rectOver) { + if (rectOver) { fill(rectHighlight); } else { fill(rectColor); @@ -43,7 +43,7 @@ void draw() { stroke(255); rect(rectX, rectY, rectSize, rectSize); - if(circleOver) { + if (circleOver) { fill(circleHighlight); } else { fill(circleColor); @@ -53,7 +53,7 @@ void draw() { } void update(int x, int y) { - if( overCircle(circleX, circleY, circleSize) ) { + if ( overCircle(circleX, circleY, circleSize) ) { circleOver = true; rectOver = false; } else if ( overRect(rectX, rectY, rectSize, rectSize) ) { @@ -65,10 +65,10 @@ void update(int x, int y) { } void mousePressed() { - if(circleOver) { + if (circleOver) { currentColor = circleColor; } - if(rectOver) { + if (rectOver) { currentColor = rectColor; } } @@ -85,7 +85,7 @@ boolean overRect(int x, int y, int width, int height) { boolean overCircle(int x, int y, int diameter) { float disX = x - mouseX; float disY = y - mouseY; - if(sqrt(sq(disX) + sq(disY)) < diameter/2 ) { + if (sqrt(sq(disX) + sq(disY)) < diameter/2 ) { return true; } else { return false; diff --git a/java/examples/Topics/GUI/Handles/Handles.pde b/java/examples/Topics/GUI/Handles/Handles.pde index 2a6d5f387..f2c9626f3 100644 --- a/java/examples/Topics/GUI/Handles/Handles.pde +++ b/java/examples/Topics/GUI/Handles/Handles.pde @@ -5,14 +5,13 @@ */ Handle[] handles; -int num; void setup() { size(640, 360); - num = height/15; + int num = height/15; handles = new Handle[num]; int hsize = 10; - for(int i=0; i 1) { + if (abs(newspos - spos) > 1) { spos = spos + (newspos-spos)/loose; } } @@ -98,7 +98,7 @@ class HScrollbar { } boolean overEvent() { - if(mouseX > xpos && mouseX < xpos+swidth && + if (mouseX > xpos && mouseX < xpos+swidth && mouseY > ypos && mouseY < ypos+sheight) { return true; } else { @@ -110,7 +110,7 @@ class HScrollbar { noStroke(); fill(204); rect(xpos, ypos, swidth, sheight); - if(over || locked) { + if (over || locked) { fill(0, 0, 0); } else { fill(102, 102, 102); diff --git a/java/keywords.txt b/java/keywords.txt index 8efe8e806..fb998d5f0 100644 --- a/java/keywords.txt +++ b/java/keywords.txt @@ -224,6 +224,7 @@ Thread KEYWORD5 boolean KEYWORD5 boolean byte KEYWORD5 byte char KEYWORD5 char +color KEYWORD5 color_datatype double KEYWORD5 double float KEYWORD5 float int KEYWORD5 int @@ -256,8 +257,6 @@ try FUNCTION3 try # These items are a part of Processing but, but pages don't generate -color KEYWORD1 color_datatype - boolean FUNCTION1 booleanconvert_ byte FUNCTION1 byteconvert_ cache FUNCTION2 diff --git a/java/libraries/video/examples/Capture/TimeDisplacement/TimeDisplacement.pde b/java/libraries/video/examples/Capture/TimeDisplacement/TimeDisplacement.pde index 91baf89df..cf2847845 100644 --- a/java/libraries/video/examples/Capture/TimeDisplacement/TimeDisplacement.pde +++ b/java/libraries/video/examples/Capture/TimeDisplacement/TimeDisplacement.pde @@ -31,7 +31,7 @@ void captureEvent(Capture camera) { frames.add(img); //once there are enough frames, remove the oldest one when adding a new one - if(frames.size() > height/4) { + if (frames.size() > height/4) { frames.remove(0); } } @@ -43,16 +43,16 @@ void draw() { loadPixels(); //begin a loop for displaying pixel rows of 4 pixels height - for(int y = 0; y < video.height; y+=4) { + for (int y = 0; y < video.height; y+=4) { //go through the frame buffer and pick an image, starting with the oldest one - if(currentImage < frames.size()) { + if (currentImage < frames.size()) { PImage img = (PImage)frames.get(currentImage); - if(img != null) { + if (img != null) { img.loadPixels(); //put 4 rows of pixels on the screen - for(int x = 0; x < video.width; x++) { + for (int x = 0; x < video.width; x++) { pixels[x + y * width] = img.pixels[x + y * video.width]; pixels[x + (y + 1) * width] = img.pixels[x + (y + 1) * video.width]; pixels[x + (y + 2) * width] = img.pixels[x + (y + 2) * video.width];