diff --git a/java/examples/Topics/Advanced Data/DirectoryList/DirectoryList.pde b/java/examples/Topics/File IO/DirectoryList/DirectoryList.pde similarity index 100% rename from java/examples/Topics/Advanced Data/DirectoryList/DirectoryList.pde rename to java/examples/Topics/File IO/DirectoryList/DirectoryList.pde diff --git a/java/examples/Topics/Image Processing/LinearImage/LinearImage.pde b/java/examples/Topics/Image Processing/LinearImage/LinearImage.pde index 1029d2435..f5ec79d9a 100644 --- a/java/examples/Topics/Image Processing/LinearImage/LinearImage.pde +++ b/java/examples/Topics/Image Processing/LinearImage/LinearImage.pde @@ -6,7 +6,7 @@ */ // The next line is needed if running in JavaScript Mode with Processing.js -/* @pjs preload="sea.jpg"; */ +/* @pjs preload="sea.jpg"; */ PImage img; int direction = 1; @@ -23,18 +23,20 @@ void setup() { void draw() { if (signal > img.height-1 || signal < 0) { - direction = direction * -1; + direction = direction * -1; } - if (mousePressed) { + if (mousePressed == true) { signal = abs(mouseY % img.height); - } else { - signal += (0.3*direction); + } + else { + signal += (0.3*direction); } - if (keyPressed) { + if (keyPressed == true) { set(0, 0, img); line(0, signal, img.width, signal); - } else { + } + else { int signalOffset = int(signal)*img.width; for (int y = 0; y < img.height; y++) { arrayCopy(img.pixels, signalOffset, pixels, y*width, img.width); @@ -42,3 +44,4 @@ void draw() { updatePixels(); } } +