diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 47d93550a..ade76ca51 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -10262,6 +10262,7 @@ public class PApplet extends Applet * * @webref shape:3d_primitives * @param r the radius of the sphere + * @see PGraphics#sphereDetail(int) */ public void sphere(float r) { if (recorder != null) recorder.sphere(r); diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index db4b8d11f..af61fa1e7 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -2372,6 +2372,7 @@ public class PGraphics extends PImage implements PConstants { * * @webref shape:3d_primitives * @param r the radius of the sphere + * @see PGraphics#sphereDetail(int) */ public void sphere(float r) { if ((sphereDetailU < 3) || (sphereDetailV < 2)) { diff --git a/java/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde b/java/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde index 7eafbf2e2..f0c666d73 100644 --- a/java/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde +++ b/java/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde @@ -5,18 +5,20 @@ * Simple rendering of the Mandelbrot set. */ + // Establish a range of values on the complex plane // A different range will allow us to "zoom" in or out on the fractal // float xmin = -1.5; float ymin = -.1; float wh = 0.15; -float xmin = -2.5; -float ymin = -2; -float wh = 4; +float xmin = -3; +float ymin = -1.25; +float w = 5; +float h = 2.5; size(640, 360); noLoop(); background(255); -// Make sure we can write to the pixels[] array. +// Make sure we can write to the pixels[] array. // Only need to do this once since we don't do any other drawing. loadPixels(); @@ -24,9 +26,9 @@ loadPixels(); int maxiterations = 100; // x goes from xmin to xmax -float xmax = xmin + wh; +float xmax = xmin + w; // y goes from ymin to ymax -float ymax = ymin + wh; +float ymax = ymin + h; // Calculate amount we increment x,y for each pixel float dx = (xmax - xmin) / (width); @@ -59,8 +61,8 @@ for (int j = 0; j < height; j++) { // We color each pixel based on how long it takes to get to infinity // If we never got there, let's pick the color black if (n == maxiterations) { - pixels[i+j*width] = 0; - } + pixels[i+j*width] = color(0); + } else { // Gosh, we could make fancy colors here if we wanted pixels[i+j*width] = color(n*16 % 255); diff --git a/java/examples/Topics/Simulate/Spring/Spring.pde b/java/examples/Topics/Simulate/Spring/Spring.pde index 1310faae7..1e28a40b5 100644 --- a/java/examples/Topics/Simulate/Spring/Spring.pde +++ b/java/examples/Topics/Simulate/Spring/Spring.pde @@ -5,7 +5,7 @@ */ // Spring drawing constants for top bar -int springHeight = 16; // Height +int springHeight = 32; // Height int left; // Left position int right; // Right position int max = 200; // Maximum Y value diff --git a/java/libraries/net/src/processing/net/Client.java b/java/libraries/net/src/processing/net/Client.java index 983bc0b90..e4c356f9c 100644 --- a/java/libraries/net/src/processing/net/Client.java +++ b/java/libraries/net/src/processing/net/Client.java @@ -31,7 +31,13 @@ import java.lang.reflect.*; import java.net.*; /** - * @generate Client.xml + * ( begin auto-generated from Client.xml ) + * + * A client connects to a server and sends data back and forth. If anything + * goes wrong with the connection, for example the host is not there or is + * listening on a different port, an exception is thrown. + * + * ( end auto-generated ) * @webref net * @brief The client class is used to create client Objects which connect to a server to exchange data. * @instanceName client any variable of type Client @@ -57,7 +63,6 @@ public class Client implements Runnable { int bufferLast; /** - * * @param parent typically use "this" * @param host address of the server * @param port port to read/write from on the server @@ -122,7 +127,12 @@ public class Client implements Runnable { /** - * @generate Client_stop.xml + * ( begin auto-generated from Client_stop.xml ) + * + * Disconnects from the server. Use to shut the connection when you're + * finished with the Client. + * + * ( end auto-generated ) * @webref client:client * @brief Disconnects from the server * @usage application @@ -219,7 +229,11 @@ public class Client implements Runnable { /** - * @generate Client_ip.xml + * ( begin auto-generated from Client_ip.xml ) + * + * Returns the IP address of the computer to which the Client is attached. + * + * ( end auto-generated ) * @webref client:client * @usage application * @brief Returns the IP address of the machine as a String @@ -230,7 +244,12 @@ public class Client implements Runnable { /** - * @generate Client_available.xml + * ( begin auto-generated from Client_available.xml ) + * + * Returns the number of bytes available. When any client has bytes + * available from the server, it returns the number of bytes. + * + * ( end auto-generated ) * @webref client:client * @usage application * @brief Returns the number of bytes in the buffer waiting to be read @@ -241,7 +260,11 @@ public class Client implements Runnable { /** - * @generate Client_clear.xml + * ( begin auto-generated from Client_clear.xml ) + * + * Empty the buffer, removes all the data stored there. + * + * ( end auto-generated ) * @webref client:client * @usage application * @brief Clears the buffer @@ -253,7 +276,13 @@ public class Client implements Runnable { /** - * @generate Client_read.xml + * ( begin auto-generated from Client_read.xml ) + * + * Returns a number between 0 and 255 for the next byte that's waiting in + * the buffer. Returns -1 if there is no byte, although this should be + * avoided by first cheacking available() to see if any data is available. + * + * ( end auto-generated ) * @webref client:client * @usage application * @brief Returns a value from the buffer @@ -273,7 +302,12 @@ public class Client implements Runnable { /** - * @generate Client_readChar.xml + * ( begin auto-generated from Client_readChar.xml ) + * + * Returns the next byte in the buffer as a char. Returns -1 or 0xffff if + * nothing is there. + * + * ( end auto-generated ) * @webref client:client * @usage application * @brief Returns the next byte in the buffer as a char @@ -285,7 +319,17 @@ public class Client implements Runnable { /** - * @generate Client_readBytes.xml + * ( begin auto-generated from Client_readBytes.xml ) + * + * Reads a group of bytes from the buffer. The version with no parameters + * returns a byte array of all data in the buffer. This is not efficient, + * but is easy to use. The version with the byteBuffer parameter is + * more memory and time efficient. It grabs the data in the buffer and puts + * it into the byte array passed in and returns an int value for the number + * of bytes read. If more bytes are available than can fit into the + * byteBuffer, only those that fit are read. + * + * ( end auto-generated ) *

Advanced

* Return a byte array of anything that's in the serial buffer. * Not particularly memory/speed efficient, because it creates @@ -342,7 +386,20 @@ public class Client implements Runnable { /** - * @generate Client_readBytesUntil.xml + * ( begin auto-generated from Client_readBytesUntil.xml ) + * + * Reads from the port into a buffer of bytes up to and including a + * particular character. If the character isn't in the buffer, 'null' is + * returned. The version with no byteBuffer parameter returns a byte + * array of all data up to and including the interesting byte. This + * is not efficient, but is easy to use. The version with the + * byteBuffer parameter is more memory and time efficient. It grabs + * the data in the buffer and puts it into the byte array passed in and + * returns an int value for the number of bytes read. If the byte buffer is + * not large enough, -1 is returned and an error is printed to the message + * area. If nothing is in the buffer, 0 is returned. + * + * ( end auto-generated ) * @webref client:client * @usage application * @brief Reads from the buffer of bytes up to and including a particular character @@ -424,7 +481,15 @@ public class Client implements Runnable { /** - * @generate Client_readString.xml + * ( begin auto-generated from Client_readString.xml ) + * + * Returns the all the data from the buffer as a String. This method + * assumes the incoming characters are ASCII. If you want to transfer + * Unicode data, first convert the String to a byte stream in the + * representation of your choice (i.e. UTF8 or two-byte Unicode data), and + * send it as a byte array. + * + * ( end auto-generated ) * @webref client:client * @usage application * @brief Returns the buffer as a String @@ -436,7 +501,12 @@ public class Client implements Runnable { /** - * @generate Client_readStringUntil.xml + * ( begin auto-generated from Client_readStringUntil.xml ) + * + * Combination of readBytesUntil() and readString(). Returns + * null if it doesn't find what you're looking for. + * + * ( end auto-generated ) *

Advanced

*

* If you want to move Unicode data, you can first convert the @@ -456,7 +526,11 @@ public class Client implements Runnable { /** - * @generate Client_write.xml + * ( begin auto-generated from Client_write.xml ) + * + * Writes data to a server specified when constructing the client. + * + * ( end auto-generated ) * @webref client:client * @usage application * @brief Writes bytes, chars, ints, bytes[], Strings diff --git a/java/libraries/net/src/processing/net/Server.java b/java/libraries/net/src/processing/net/Server.java index 4d885d458..59602b628 100644 --- a/java/libraries/net/src/processing/net/Server.java +++ b/java/libraries/net/src/processing/net/Server.java @@ -31,7 +31,16 @@ import java.lang.reflect.*; import java.net.*; /** - * @generate Server.xml + * ( 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). @@ -52,7 +61,6 @@ public class Server implements Runnable { public Client[] clients; /** - * * @param parent typically use "this" * @param port port used to transfer data */ @@ -91,7 +99,13 @@ public class Server implements Runnable { /** - * @generate Server_disconnect.xml + * ( begin auto-generated from Server_disconnect.xml ) + * + * Disconnect a particular client. + * + * ( end auto-generated ) + * + * ( end auto-generated ) * @webref server:server * @param client the client to disconnect */ @@ -140,7 +154,13 @@ public class Server implements Runnable { int lastAvailable = -1; /** - * @generate Server_available.xml + * ( begin auto-generated from Server_available.xml ) + * + * Returns the next client in line with a new message. + * + * ( end auto-generated ) + * + * ( end auto-generated ) * @webref server * @usage application */ @@ -163,7 +183,12 @@ public class Server implements Runnable { /** - * @generate Server_stop.xml + * ( begin auto-generated from Server_stop.xml ) + * + * 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 @@ -234,7 +259,13 @@ public class Server implements Runnable { /** - * @generate Server_write.xml + * ( begin auto-generated from Server_write.xml ) + * + * Writes a value to all the connected clients. It sends bytes out from the + * Server object. + * + * ( end auto-generated ) + * * @webref server * @brief Writes data to all connected clients * @param data data to write