From c89c3311f6890018327c42ee65ecc5b1049677d6 Mon Sep 17 00:00:00 2001 From: Casey Reas Date: Thu, 25 Apr 2013 18:07:10 -0700 Subject: [PATCH] Remove Puff example --- .../Image/BackgroundImage/BackgroundImage.pde | 2 +- .../ScribblePlotter/ScribblePlotter.pde | 90 ------------------ java/examples/Topics/Motion/Puff/Puff.pde | 92 ------------------- .../net/src/processing/net/Server.java | 30 +++--- 4 files changed, 14 insertions(+), 200 deletions(-) delete mode 100644 java/examples/Topics/Drawing/ScribblePlotter/ScribblePlotter.pde delete mode 100644 java/examples/Topics/Motion/Puff/Puff.pde diff --git a/java/examples/Basics/Image/BackgroundImage/BackgroundImage.pde b/java/examples/Basics/Image/BackgroundImage/BackgroundImage.pde index 7d2f6a6d6..9f872777d 100644 --- a/java/examples/Basics/Image/BackgroundImage/BackgroundImage.pde +++ b/java/examples/Basics/Image/BackgroundImage/BackgroundImage.pde @@ -16,7 +16,7 @@ void setup() { size(640, 360); // The background image must be the same size as the parameters // into the size() method. In this program, the size of the image - // is 650 x 360 pixels. + // is 640 x 360 pixels. bg = loadImage("moonwalk.jpg"); } diff --git a/java/examples/Topics/Drawing/ScribblePlotter/ScribblePlotter.pde b/java/examples/Topics/Drawing/ScribblePlotter/ScribblePlotter.pde deleted file mode 100644 index a18c0b11b..000000000 --- a/java/examples/Topics/Drawing/ScribblePlotter/ScribblePlotter.pde +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Scribble Plotter - * by Ira Greenberg. - * - * Using 2-dimensional arrays, record end points - * and replot scribbles between points. - */ - -int SCRIBBLE = 0; -int HATCHING = 1; - -void setup(){ - size(640, 360); - background(0); - - // Create arrays to hold x, y coords - float[]x = new float[4]; - float[]y = new float[4]; - // create a convenient 2-dimensional - // array to hold x, y arrays - float[][]xy = {x, y}; - - // Record points - // X positions - xy[0][0] = 125; - xy[0][1] = 475; - xy[0][2] = 475; - xy[0][3] = 125; - - // Y positions - xy[1][0] = 100; - xy[1][1] = 100; - xy[1][2] = 260; - xy[1][3] = 260; - - // Call plotting function - makeRect(xy); -} - -void makeRect(float[][]pts){ - stroke(255); - - // Scribble variables, that get passed as arguments to the scribble function - int steps = 100; - float scribVal = 3.0; - for (int i = 0; i < pts[0].length; i++){ - // Plots vertices - strokeWeight(5); - point(pts[0][i], pts[1][i]); - - // Call scribble function - strokeWeight(.5); - if (i > 0){ - scribble(pts[0][i], pts[1][i], pts[0][i-1], pts[1][i-1], steps, scribVal, SCRIBBLE); - } - if (i == pts[0].length-1){ - // Show some hatching between last 2 points - scribble(pts[0][i], pts[1][i], pts[0][0], pts[1][0], steps, scribVal*2, HATCHING); - } - } -} - -/* - Scribble function plots lines between end points, - determined by steps and scribVal arguments. - two styles are available: SCRIBBLE and HATCHING, which - are interestingly only dependent on parentheses - placement in the line() function calls. -*/ - -void scribble(float x1, float y1, float x2, float y2, int steps, float scribVal, int style){ - - float xStep = (x2-x1)/steps; - float yStep = (y2-y1)/steps; - for (int i = 0; i < steps; i++){ - if(style == SCRIBBLE){ - if (i < steps-1){ - line(x1, y1, x1+=xStep+random(-scribVal, scribVal), y1+=yStep+random(-scribVal, scribVal)); - } - else { - // extra line needed to attach line back to point- not necessary in HATCHING style - line(x1, y1, x2, y2); - } - } - else if (style == HATCHING){ - line(x1, y1, (x1+=xStep)+random(-scribVal, scribVal), (y1+=yStep)+random(-scribVal, scribVal)); - } - } -} - diff --git a/java/examples/Topics/Motion/Puff/Puff.pde b/java/examples/Topics/Motion/Puff/Puff.pde deleted file mode 100644 index 034ee6d21..000000000 --- a/java/examples/Topics/Motion/Puff/Puff.pde +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Puff - * by Ira Greenberg. - * - * Series of ellipses simulating a multi-segmented - * organism, utilizing a follow the leader algorithm. - * Collision detection occurs on the organism's head, - * controlling overall direction, and on the individual - * body segments, controlling body shape and jitter. - */ - - -// For puff head -float headX; -float headY; -float speedX = .7; -float speedY = .9; - -// For puff body -int cells = 1000; -float[] px= new float[cells]; -float[] py= new float[cells]; -float[] radiiX = new float[cells]; -float[] radiiY = new float[cells]; -float[] angle = new float[cells]; -float[] frequency = new float[cells]; -float[] cellRadius = new float[cells]; - -void setup(){ - - size(640, 360); - - // Begin in the center - headX = width/2; - headY = height/2; - - // Fill body arrays - for (int i = 0; i < cells; i++){ - radiiX[i] = random(-7, 7); - radiiY[i] = random(-4, 4); - frequency[i]= random(-9, 9); - cellRadius[i] = random(16, 30); - } - frameRate(30); -} - -void draw(){ - background(0); - noStroke(); - fill(255, 255, 255, 5); - - // Follow the leader - for (int i = 0; i < cells; i++){ - if (i == 0){ - px[i] = headX + sin(radians(angle[i]))*radiiX[i]; - py[i] = headY + cos(radians(angle[i]))*radiiY[i]; - } - else{ - px[i] = px[i-1] + cos(radians(angle[i]))*radiiX[i]; - py[i] = py[i-1] + sin(radians(angle[i]))*radiiY[i]; - - // Check collision of body - if ((px[i] >= width-cellRadius[i]/2) || (px[i] <= cellRadius[i]/2)){ - radiiX[i]*=-1; - cellRadius[i] = random(1, 40); - frequency[i]= random(-13, 13); - } - if ((py[i] >= height-cellRadius[i]/2) || (py[i] <= cellRadius[i]/2)){ - radiiY[i]*=-1; - cellRadius[i] = random(1, 40); - frequency[i]= random(-9, 9); - } - } - // Draw puff - ellipse(px[i], py[i], cellRadius[i], cellRadius[i]); - // Set speed of body - angle[i] += frequency[i]; - } - - // Set velocity of head - headX += speedX; - headY += speedY; - - // Check boundary collision of head - if ((headX >= width-cellRadius[0]/2) || (headX <=cellRadius[0]/2)){ - speedX*=-1; - } - if ((headY >= height-cellRadius[0]/2) || (headY <= cellRadius[0]/2)){ - speedY*=-1; - } -} - diff --git a/java/libraries/net/src/processing/net/Server.java b/java/libraries/net/src/processing/net/Server.java index 60fb5f160..12b73a71b 100644 --- a/java/libraries/net/src/processing/net/Server.java +++ b/java/libraries/net/src/processing/net/Server.java @@ -31,16 +31,16 @@ import java.lang.reflect.*; import java.net.*; /** - * ( begin auto-generated from Server.xml ) - * - * A server sends and receives data to and from its associated clients - * (other programs connected to it). When a server is started, it begins - * listening for connections on the port specified by the port - * parameter. Computers have many ports for transferring data and some are - * commonly used so be sure to not select one of these. For example, web - * servers usually use port 80 and POP mail uses port 110. - * - * ( end auto-generated ) + * ( begin auto-generated from Server.xml ) + * + * A server sends and receives data to and from its associated clients + * (other programs connected to it). When a server is started, it begins + * listening for connections on the port specified by the port + * parameter. Computers have many ports for transferring data and some are + * commonly used so be sure to not select one of these. For example, web + * servers usually use port 80 and POP mail uses port 110. + * + * ( end auto-generated ) * @webref net * @usage application * @brief The server class is used to create server objects which send and receives data to and from its associated clients (other programs connected to it). @@ -104,8 +104,7 @@ public class Server implements Runnable { * Disconnect a particular client. * * ( end auto-generated ) - * - * ( end auto-generated ) + * @brief Disconnect a particular client. * @webref server:server * @param client the client to disconnect */ @@ -169,8 +168,7 @@ public class Server implements Runnable { * Returns the next client in line with a new message. * * ( end auto-generated ) - * - * ( end auto-generated ) + * @brief Returns the next client in line with a new message. * @webref server * @usage application */ @@ -198,12 +196,11 @@ public class Server implements Runnable { * Disconnects all clients and stops the server. * * ( end auto-generated ) - * *

Advanced

- *

* Use this to shut down the server if you finish using it while your applet * is still running. Otherwise, it will be automatically be shut down by the * host PApplet using dispose(), which is identical. + * @brief Disconnects all clients and stops the server. * @webref server * @usage application */ @@ -273,7 +270,6 @@ public class Server implements Runnable { * Server object. * * ( end auto-generated ) - * * @webref server * @brief Writes data to all connected clients * @param data data to write