Skip to content

Commit 5afff24

Browse files
committed
inspecting possibility of ui package, other scrubbing
1 parent 87f8a3d commit 5afff24

File tree

4 files changed

+31
-44
lines changed

4 files changed

+31
-44
lines changed

app/src/processing/app/Base.java

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ public class Base {
107107
// A single instance of the library manager window
108108
ContributionManagerDialog contributionManagerFrame;
109109

110-
111110
// Location for untitled items
112111
static File untitledFolder;
113112

@@ -353,23 +352,9 @@ void rebuildContribExamples() {
353352

354353

355354
public Base(String[] args) throws Exception {
356-
// // Get the sketchbook path, and make sure it's set properly
357-
// determineSketchbookFolder();
358-
359-
// Delete all modes and tools that have been flagged for deletion before
360-
// they are initialized by an editor.
361-
// ArrayList<InstalledContribution> contribs = new ArrayList<InstalledContribution>();
362-
// contribs.addAll(ModeContribution.list(getSketchbookModesFolder()));
363-
// contribs.addAll(ToolContribution.list(getSketchbookToolsFolder(), false));
364-
// for (InstalledContribution contrib : contribs) {
365-
// if (ContributionManager.isDeletionFlagSet(contrib)) {
366-
// removeDir(contrib.getFolder());
367-
// }
368-
// }
369355
ContributionManager.cleanup(this);
370356
buildCoreModes();
371357
rebuildContribModes();
372-
373358
rebuildContribExamples();
374359

375360
// Needs to happen after the sketchbook folder has been located.
@@ -394,8 +379,7 @@ public Base(String[] args) throws Exception {
394379
}
395380
}
396381

397-
contributionManagerFrame =
398-
new ContributionManagerDialog();
382+
contributionManagerFrame = new ContributionManagerDialog();
399383

400384
// Make sure ThinkDifferent has library examples too
401385
nextMode.rebuildLibraryList();

app/src/processing/app/WebServer.java

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,20 @@
55
import java.util.*;
66
import java.util.zip.*;
77

8-
//import javax.swing.SwingUtilities;
98

109
/**
1110
* This code is placed here in anticipation of running the reference from an
1211
* internal web server that reads the docs from a zip file, instead of using
1312
* thousands of .html files on the disk, which is really inefficient.
1413
* <p/>
15-
* This is a very simple, multi-threaded HTTP server, originally based on
14+
* This is a very simple, multi-threaded HTTP server, originally based on
1615
* <a href="http://j.mp/6BQwpI">this</a> article on java.sun.com.
1716
*/
1817
public class WebServer implements HttpConstants {
1918

2019
/* Where worker threads stand idle */
2120
static Vector threads = new Vector();
22-
21+
2322
/* the web server's virtual root */
2423
//static File root;
2524

@@ -29,7 +28,7 @@ public class WebServer implements HttpConstants {
2928
/* max # worker threads */
3029
static int workers = 5;
3130

32-
// static PrintStream log = System.out;
31+
// static PrintStream log = System.out;
3332

3433

3534
/*
@@ -88,7 +87,7 @@ static void printProps() {
8887
}
8988
*/
9089

91-
90+
9291
/* print to stdout */
9392
// protected static void p(String s) {
9493
// System.out.println(s);
@@ -105,7 +104,7 @@ protected static void log(String s) {
105104
// }
106105
}
107106

108-
107+
109108
//public static void main(String[] a) throws Exception {
110109
static public int launch(String zipPath) throws IOException {
111110
final ZipFile zip = new ZipFile(zipPath);
@@ -226,7 +225,7 @@ public synchronized void run() {
226225
}
227226
}
228227

229-
228+
230229
void handleClient() throws IOException {
231230
InputStream is = new BufferedInputStream(s.getInputStream());
232231
PrintStream ps = new PrintStream(s.getOutputStream());
@@ -240,7 +239,7 @@ void handleClient() throws IOException {
240239
buf[i] = 0;
241240
}
242241
try {
243-
// We only support HTTP GET/HEAD, and don't support any fancy HTTP
242+
// We only support HTTP GET/HEAD, and don't support any fancy HTTP
244243
// options, so we're only interested really in the first line.
245244
int nread = 0, r = 0;
246245

@@ -254,7 +253,7 @@ void handleClient() throws IOException {
254253
nread += r;
255254
for (; i < nread; i++) {
256255
if (buf[i] == (byte)'\n' || buf[i] == (byte)'\r') {
257-
break outerloop; // read one line
256+
break outerloop; // read one line
258257
}
259258
}
260259
}
@@ -312,7 +311,7 @@ void handleClient() throws IOException {
312311
send404(ps);
313312
}
314313
/*
315-
String fname =
314+
String fname =
316315
(new String(buf, 0, index, i-index)).replace('/', File.separatorChar);
317316
if (fname.startsWith(File.separator)) {
318317
fname = fname.substring(1);
@@ -338,7 +337,7 @@ void handleClient() throws IOException {
338337
}
339338
}
340339

341-
340+
342341
boolean printHeaders(ZipEntry targ, PrintStream ps) throws IOException {
343342
boolean ret = false;
344343
int rCode = 0;
@@ -386,8 +385,8 @@ boolean printHeaders(ZipEntry targ, PrintStream ps) throws IOException {
386385
ps.write(EOL); // adding another newline here [fry]
387386
return ret;
388387
}
389-
390-
388+
389+
391390
boolean printHeaders(File targ, PrintStream ps) throws IOException {
392391
boolean ret = false;
393392
int rCode = 0;
@@ -432,7 +431,7 @@ boolean printHeaders(File targ, PrintStream ps) throws IOException {
432431
return ret;
433432
}
434433

435-
434+
436435
void send404(PrintStream ps) throws IOException {
437436
ps.write(EOL);
438437
ps.write(EOL);
@@ -442,7 +441,7 @@ void send404(PrintStream ps) throws IOException {
442441
ps.write(EOL);
443442
}
444443

445-
444+
446445
void sendFile(File targ, PrintStream ps) throws IOException {
447446
InputStream is = null;
448447
ps.write(EOL);
@@ -454,8 +453,8 @@ void sendFile(File targ, PrintStream ps) throws IOException {
454453
}
455454
sendFile(is, ps);
456455
}
457-
458-
456+
457+
459458
void sendFile(InputStream is, PrintStream ps) throws IOException {
460459
try {
461460
int n;
@@ -489,19 +488,19 @@ static void fillMap() {
489488
setSuffix(".snd", "audio/basic");
490489
setSuffix(".au", "audio/basic");
491490
setSuffix(".wav", "audio/x-wav");
492-
491+
493492
setSuffix(".gif", "image/gif");
494493
setSuffix(".jpg", "image/jpeg");
495494
setSuffix(".jpeg", "image/jpeg");
496-
495+
497496
setSuffix(".htm", "text/html");
498497
setSuffix(".html", "text/html");
499-
setSuffix(".css", "text/css");
498+
setSuffix(".css", "text/css");
500499
setSuffix(".java", "text/javascript");
501-
500+
502501
setSuffix(".txt", "text/plain");
503502
setSuffix(".java", "text/plain");
504-
503+
505504
setSuffix(".c", "text/plain");
506505
setSuffix(".cc", "text/plain");
507506
setSuffix(".c++", "text/plain");

java/src/processing/mode/java/Commander.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@
2727
import java.io.PrintStream;
2828
import java.io.UnsupportedEncodingException;
2929

30-
import processing.app.*;
30+
import processing.app.Base;
31+
import processing.app.Preferences;
32+
import processing.app.RunnerListener;
33+
import processing.app.Sketch;
34+
import processing.app.SketchException;
3135
import processing.app.contrib.ModeContribution;
3236
import processing.core.PApplet;
33-
import processing.mode.java.runner.*;
37+
import processing.mode.java.runner.Runner;
3438

3539

3640
/**

todo.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ X Add more code for handling low-level errors on startup
1212
X update the "Supported Platforms" wiki page with current status
1313
X displayDensity() not functioning properly
1414
X https://github.com/processing/processing/issues/3436
15+
X error message caused by curly bracket in a println string
16+
X ((?<![\\])['"])((?:.(?!(?<![\\])\1))*.?)\1 to match quoted strings
17+
X https://github.com/processing/processing/issues/3394
1518

1619
manager
1720
X changed compatibleModesList to modes in examples.properties
@@ -119,9 +122,6 @@ _ recent menu gets huge with other p5 versions on osx
119122

120123

121124
pde/build
122-
_ error message caused by curly bracket in a println string
123-
_ ((?<![\\])['"])((?:.(?!(?<![\\])\1))*.?)\1 to match quoted strings
124-
_ https://github.com/processing/processing/issues/3394
125125
_ dim out the Run button if there are compile errors detected
126126
_ the AST checker has better error message handling for those cases
127127
_ and hitting Run replaces the useful error with something weird

0 commit comments

Comments
 (0)