Skip to content

Commit e1711dd

Browse files
committed
Removing old files for 3D and Library examples
1 parent d4833c2 commit e1711dd

6 files changed

Lines changed: 137 additions & 28 deletions

File tree

core/src/processing/core/PApplet.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10262,6 +10262,7 @@ public void sphereDetail(int ures, int vres) {
1026210262
*
1026310263
* @webref shape:3d_primitives
1026410264
* @param r the radius of the sphere
10265+
* @see PGraphics#sphereDetail(int)
1026510266
*/
1026610267
public void sphere(float r) {
1026710268
if (recorder != null) recorder.sphere(r);

core/src/processing/core/PGraphics.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2372,6 +2372,7 @@ public void sphereDetail(int ures, int vres) {
23722372
*
23732373
* @webref shape:3d_primitives
23742374
* @param r the radius of the sphere
2375+
* @see PGraphics#sphereDetail(int)
23752376
*/
23762377
public void sphere(float r) {
23772378
if ((sphereDetailU < 3) || (sphereDetailV < 2)) {

java/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,30 @@
55
* Simple rendering of the Mandelbrot set.
66
*/
77

8+
89
// Establish a range of values on the complex plane
910
// A different range will allow us to "zoom" in or out on the fractal
1011
// float xmin = -1.5; float ymin = -.1; float wh = 0.15;
11-
float xmin = -2.5;
12-
float ymin = -2;
13-
float wh = 4;
12+
float xmin = -3;
13+
float ymin = -1.25;
14+
float w = 5;
15+
float h = 2.5;
1416

1517
size(640, 360);
1618
noLoop();
1719
background(255);
1820

19-
// Make sure we can write to the pixels[] array.
21+
// Make sure we can write to the pixels[] array.
2022
// Only need to do this once since we don't do any other drawing.
2123
loadPixels();
2224

2325
// Maximum number of iterations for each point on the complex plane
2426
int maxiterations = 100;
2527

2628
// x goes from xmin to xmax
27-
float xmax = xmin + wh;
29+
float xmax = xmin + w;
2830
// y goes from ymin to ymax
29-
float ymax = ymin + wh;
31+
float ymax = ymin + h;
3032

3133
// Calculate amount we increment x,y for each pixel
3234
float dx = (xmax - xmin) / (width);
@@ -59,8 +61,8 @@ for (int j = 0; j < height; j++) {
5961
// We color each pixel based on how long it takes to get to infinity
6062
// If we never got there, let's pick the color black
6163
if (n == maxiterations) {
62-
pixels[i+j*width] = 0;
63-
}
64+
pixels[i+j*width] = color(0);
65+
}
6466
else {
6567
// Gosh, we could make fancy colors here if we wanted
6668
pixels[i+j*width] = color(n*16 % 255);

java/examples/Topics/Simulate/Spring/Spring.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
// Spring drawing constants for top bar
8-
int springHeight = 16; // Height
8+
int springHeight = 32; // Height
99
int left; // Left position
1010
int right; // Right position
1111
int max = 200; // Maximum Y value

java/libraries/net/src/processing/net/Client.java

Lines changed: 87 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@
3131
import java.net.*;
3232

3333
/**
34-
* @generate Client.xml
34+
* ( begin auto-generated from Client.xml )
35+
*
36+
* A client connects to a server and sends data back and forth. If anything
37+
* goes wrong with the connection, for example the host is not there or is
38+
* listening on a different port, an exception is thrown.
39+
*
40+
* ( end auto-generated )
3541
* @webref net
3642
* @brief The client class is used to create client Objects which connect to a server to exchange data.
3743
* @instanceName client any variable of type Client
@@ -57,7 +63,6 @@ public class Client implements Runnable {
5763
int bufferLast;
5864

5965
/**
60-
*
6166
* @param parent typically use "this"
6267
* @param host address of the server
6368
* @param port port to read/write from on the server
@@ -122,7 +127,12 @@ public Client(PApplet parent, Socket socket) throws IOException {
122127

123128

124129
/**
125-
* @generate Client_stop.xml
130+
* ( begin auto-generated from Client_stop.xml )
131+
*
132+
* Disconnects from the server. Use to shut the connection when you're
133+
* finished with the Client.
134+
*
135+
* ( end auto-generated )
126136
* @webref client:client
127137
* @brief Disconnects from the server
128138
* @usage application
@@ -219,7 +229,11 @@ public boolean active() {
219229

220230

221231
/**
222-
* @generate Client_ip.xml
232+
* ( begin auto-generated from Client_ip.xml )
233+
*
234+
* Returns the IP address of the computer to which the Client is attached.
235+
*
236+
* ( end auto-generated )
223237
* @webref client:client
224238
* @usage application
225239
* @brief Returns the IP address of the machine as a String
@@ -230,7 +244,12 @@ public String ip() {
230244

231245

232246
/**
233-
* @generate Client_available.xml
247+
* ( begin auto-generated from Client_available.xml )
248+
*
249+
* Returns the number of bytes available. When any client has bytes
250+
* available from the server, it returns the number of bytes.
251+
*
252+
* ( end auto-generated )
234253
* @webref client:client
235254
* @usage application
236255
* @brief Returns the number of bytes in the buffer waiting to be read
@@ -241,7 +260,11 @@ public int available() {
241260

242261

243262
/**
244-
* @generate Client_clear.xml
263+
* ( begin auto-generated from Client_clear.xml )
264+
*
265+
* Empty the buffer, removes all the data stored there.
266+
*
267+
* ( end auto-generated )
245268
* @webref client:client
246269
* @usage application
247270
* @brief Clears the buffer
@@ -253,7 +276,13 @@ public void clear() {
253276

254277

255278
/**
256-
* @generate Client_read.xml
279+
* ( begin auto-generated from Client_read.xml )
280+
*
281+
* Returns a number between 0 and 255 for the next byte that's waiting in
282+
* the buffer. Returns -1 if there is no byte, although this should be
283+
* avoided by first cheacking <b>available()</b> to see if any data is available.
284+
*
285+
* ( end auto-generated )
257286
* @webref client:client
258287
* @usage application
259288
* @brief Returns a value from the buffer
@@ -273,7 +302,12 @@ public int read() {
273302

274303

275304
/**
276-
* @generate Client_readChar.xml
305+
* ( begin auto-generated from Client_readChar.xml )
306+
*
307+
* Returns the next byte in the buffer as a char. Returns -1 or 0xffff if
308+
* nothing is there.
309+
*
310+
* ( end auto-generated )
277311
* @webref client:client
278312
* @usage application
279313
* @brief Returns the next byte in the buffer as a char
@@ -285,7 +319,17 @@ public char readChar() {
285319

286320

287321
/**
288-
* @generate Client_readBytes.xml
322+
* ( begin auto-generated from Client_readBytes.xml )
323+
*
324+
* Reads a group of bytes from the buffer. The version with no parameters
325+
* returns a byte array of all data in the buffer. This is not efficient,
326+
* but is easy to use. The version with the <b>byteBuffer</b> parameter is
327+
* more memory and time efficient. It grabs the data in the buffer and puts
328+
* it into the byte array passed in and returns an int value for the number
329+
* of bytes read. If more bytes are available than can fit into the
330+
* <b>byteBuffer</b>, only those that fit are read.
331+
*
332+
* ( end auto-generated )
289333
* <h3>Advanced</h3>
290334
* Return a byte array of anything that's in the serial buffer.
291335
* Not particularly memory/speed efficient, because it creates
@@ -342,7 +386,20 @@ public int readBytes(byte bytebuffer[]) {
342386

343387

344388
/**
345-
* @generate Client_readBytesUntil.xml
389+
* ( begin auto-generated from Client_readBytesUntil.xml )
390+
*
391+
* Reads from the port into a buffer of bytes up to and including a
392+
* particular character. If the character isn't in the buffer, 'null' is
393+
* returned. The version with no <b>byteBuffer</b> parameter returns a byte
394+
* array of all data up to and including the <b>interesting</b> byte. This
395+
* is not efficient, but is easy to use. The version with the
396+
* <b>byteBuffer</b> parameter is more memory and time efficient. It grabs
397+
* the data in the buffer and puts it into the byte array passed in and
398+
* returns an int value for the number of bytes read. If the byte buffer is
399+
* not large enough, -1 is returned and an error is printed to the message
400+
* area. If nothing is in the buffer, 0 is returned.
401+
*
402+
* ( end auto-generated )
346403
* @webref client:client
347404
* @usage application
348405
* @brief Reads from the buffer of bytes up to and including a particular character
@@ -424,7 +481,15 @@ public int readBytesUntil(int interesting, byte byteBuffer[]) {
424481

425482

426483
/**
427-
* @generate Client_readString.xml
484+
* ( begin auto-generated from Client_readString.xml )
485+
*
486+
* Returns the all the data from the buffer as a String. This method
487+
* assumes the incoming characters are ASCII. If you want to transfer
488+
* Unicode data, first convert the String to a byte stream in the
489+
* representation of your choice (i.e. UTF8 or two-byte Unicode data), and
490+
* send it as a byte array.
491+
*
492+
* ( end auto-generated )
428493
* @webref client:client
429494
* @usage application
430495
* @brief Returns the buffer as a String
@@ -436,7 +501,12 @@ public String readString() {
436501

437502

438503
/**
439-
* @generate Client_readStringUntil.xml
504+
* ( begin auto-generated from Client_readStringUntil.xml )
505+
*
506+
* Combination of <b>readBytesUntil()</b> and <b>readString()</b>. Returns
507+
* <b>null</b> if it doesn't find what you're looking for.
508+
*
509+
* ( end auto-generated )
440510
* <h3>Advanced</h3>
441511
* <p/>
442512
* If you want to move Unicode data, you can first convert the
@@ -456,7 +526,11 @@ public String readStringUntil(int interesting) {
456526

457527

458528
/**
459-
* @generate Client_write.xml
529+
* ( begin auto-generated from Client_write.xml )
530+
*
531+
* Writes data to a server specified when constructing the client.
532+
*
533+
* ( end auto-generated )
460534
* @webref client:client
461535
* @usage application
462536
* @brief Writes bytes, chars, ints, bytes[], Strings

java/libraries/net/src/processing/net/Server.java

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,16 @@
3131
import java.net.*;
3232

3333
/**
34-
* @generate Server.xml
34+
* ( begin auto-generated from Server.xml )
35+
*
36+
* A server sends and receives data to and from its associated clients
37+
* (other programs connected to it). When a server is started, it begins
38+
* listening for connections on the port specified by the <b>port</b>
39+
* parameter. Computers have many ports for transferring data and some are
40+
* commonly used so be sure to not select one of these. For example, web
41+
* servers usually use port 80 and POP mail uses port 110.
42+
*
43+
* ( end auto-generated )
3544
* @webref net
3645
* @usage application
3746
* @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 {
5261
public Client[] clients;
5362

5463
/**
55-
*
5664
* @param parent typically use "this"
5765
* @param port port used to transfer data
5866
*/
@@ -91,7 +99,13 @@ public Server(PApplet parent, int port) {
9199

92100

93101
/**
94-
* @generate Server_disconnect.xml
102+
* ( begin auto-generated from Server_disconnect.xml )
103+
*
104+
* Disconnect a particular client.
105+
*
106+
* ( end auto-generated )
107+
*
108+
* ( end auto-generated )
95109
* @webref server:server
96110
* @param client the client to disconnect
97111
*/
@@ -140,7 +154,13 @@ protected int clientIndex(Client client) {
140154
int lastAvailable = -1;
141155

142156
/**
143-
* @generate Server_available.xml
157+
* ( begin auto-generated from Server_available.xml )
158+
*
159+
* Returns the next client in line with a new message.
160+
*
161+
* ( end auto-generated )
162+
*
163+
* ( end auto-generated )
144164
* @webref server
145165
* @usage application
146166
*/
@@ -163,7 +183,12 @@ public Client available() {
163183

164184

165185
/**
166-
* @generate Server_stop.xml
186+
* ( begin auto-generated from Server_stop.xml )
187+
*
188+
* Disconnects all clients and stops the server.
189+
*
190+
* ( end auto-generated )
191+
*
167192
* <h3>Advanced</h3>
168193
* <p/>
169194
* Use this to shut down the server if you finish using it while your applet
@@ -234,7 +259,13 @@ public void run() {
234259

235260

236261
/**
237-
* @generate Server_write.xml
262+
* ( begin auto-generated from Server_write.xml )
263+
*
264+
* Writes a value to all the connected clients. It sends bytes out from the
265+
* Server object.
266+
*
267+
* ( end auto-generated )
268+
*
238269
* @webref server
239270
* @brief Writes data to all connected clients
240271
* @param data data to write

0 commit comments

Comments
 (0)