From dd8b7ae2c04cd1162d329ee2234f99d36c782403 Mon Sep 17 00:00:00 2001 From: benfry Date: Mon, 17 Dec 2012 01:51:06 +0000 Subject: [PATCH] go through vida examples to make sure everything still runs --- core/todo.txt | 10 +++-- .../step_08b_web/step_08b_web.pde | 2 + .../round_09c_focus_handling.pde | 4 +- .../file_tree_queue_08b.pde | 4 +- .../filetreemap_06b/RankedLongArray.pde | 2 + .../filetreemap_06b/filetreemap_06b.pde | 40 +++++++------------ todo.txt | 22 +++++----- 7 files changed, 37 insertions(+), 47 deletions(-) diff --git a/core/todo.txt b/core/todo.txt index 2d0fd3350..7b0e7dffb 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -95,10 +95,12 @@ _ add parseXML() and parseJSONObject(x) X api note: size() used in data classes X length() too confusing w/ array.length being built-in (when to use ()?) X size() a bit confusing with the p5 size command, but less problematic -X also shorter than getCount() or getLength() -_ why not HashMap and ArrayList for JSON? -_ could enable loadHash() and loadArray() functions -_ or loadDict() and loadList() as the case might be +o also shorter than getCount() or getLength() +o why not HashMap and ArrayList for JSON? +o could enable loadHash() and loadArray() functions +X because the types coming back out would always have to be cast +_ add loadDict() and loadList() for JSON? +_ Dict and List could be interfaces? _ JSONObject.has(key) vs XML.hasAttribute(attr) vs HashMap.containsKey() _ and how it should be handled with hash/dict _ right now using hasKey().. in JSONObject diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/step_08b_web.pde b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/step_08b_web.pde index 079f1b0d8..9ded6d556 100644 --- a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/step_08b_web.pde +++ b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/step_08b_web.pde @@ -16,7 +16,9 @@ Edition by Ben Fry. Copyright 2008 Ben Fry, 9780596514556.” If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at permissions@oreilly.com. */ +import java.util.Date; import java.util.regex.*; +import java.text.*; int teamCount = 30; String[] teamNames; diff --git a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/round_09c_focus_handling.pde b/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/round_09c_focus_handling.pde index 648f123d8..b8ac21cae 100644 --- a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/round_09c_focus_handling.pde +++ b/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/round_09c_focus_handling.pde @@ -79,7 +79,7 @@ float boundsX2, boundsY2; public void setup() { - size(720, 453, P3D); + size(720, 453); mapX1 = 30; mapX2 = width - mapX1; @@ -88,7 +88,6 @@ public void setup() { font = loadFont("ScalaSans-Regular-14.vlw"); textFont(font); - textMode(SCREEN); messageX = 40; messageY = height - 40; @@ -129,7 +128,6 @@ public void setup() { void readData() { new Slurper(); - noLoop(); // done loading, can stop updating } diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/file_tree_queue_08b.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/file_tree_queue_08b.pde index 67338bcd8..73eea9e81 100644 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/file_tree_queue_08b.pde +++ b/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/file_tree_queue_08b.pde @@ -11,7 +11,9 @@ Node rootNode; void setup() { size(400, 130); // Replace this location with a folder on your machine - File rootFile = new File("/Applications/Processing 0135"); + //File rootFile = new File("/Applications/Processing.app"); + //File rootFile = new File("c:\\processing-2.0"); + File rootFile = new File(System.getProperty("user.home")); rootNode = new Node(rootFile); PFont font = createFont("SansSerif", 11); textFont(font); diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/RankedLongArray.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/RankedLongArray.pde index a67216dcb..efc68f46b 100644 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/RankedLongArray.pde +++ b/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/RankedLongArray.pde @@ -1,5 +1,7 @@ // Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. +import java.util.Arrays; + class RankedLongArray { long[] values = new long[100]; diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/filetreemap_06b.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/filetreemap_06b.pde index 3a7629b58..1b1d43504 100644 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/filetreemap_06b.pde +++ b/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/filetreemap_06b.pde @@ -16,7 +16,7 @@ Edition by Ben Fry. Copyright 2008 Ben Fry, 9780596514556.” If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at permissions@oreilly.com. */ -import treemap.*; +//import treemap.*; import javax.swing.*; @@ -43,35 +43,23 @@ void setup() { font = createFont("SansSerif", 13); - selectRoot(); + selectFolder("Choose a folder to browse...", "setRoot"); } - -void selectRoot() { - SwingUtilities.invokeLater(new Runnable() { - public void run() { - JFileChooser fc = new JFileChooser(); - fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - fc.setDialogTitle("Choose a folder to browse..."); - - int returned = fc.showOpenDialog(frame); - if (returned == JFileChooser.APPROVE_OPTION) { - File file = fc.getSelectedFile(); - setRoot(file); - } - } - }); -} - - + void setRoot(File folder) { - FolderItem tm = new FolderItem(null, folder, 0, 0); - tm.setBounds(0, 0, width, height); - tm.contentsVisible = true; + if (folder == null) { + println("No folder selected."); - rootItem = tm; - rootItem.zoomIn(); - rootItem.updateColors(); + } else { + FolderItem tm = new FolderItem(null, folder, 0, 0); + tm.setBounds(0, 0, width, height); + tm.contentsVisible = true; + + rootItem = tm; + rootItem.zoomIn(); + rootItem.updateColors(); + } } diff --git a/todo.txt b/todo.txt index 24a84058b..f7cb3aa61 100644 --- a/todo.txt +++ b/todo.txt @@ -35,6 +35,7 @@ X "Find in Reference" largely broken in 2.0b7 C http://code.google.com/p/processing/issues/detail?id=1456 X discern variable vs function with Find in Reference X if no selection, attempt to expand the selection for Find in Reference +X add cmd-shift-O to "Open Examples" on OS X with no window open earlier X include debug mode as 'experimental'? @@ -49,27 +50,21 @@ X removed in 2.0b7, because it has bugs and is no longer compatible apple.awt.graphics.UseQuartz true - -_ show warning when registering mouse/key events with OpenGL +o also can have case of opening two of same sketch at once +o if sketch was open, then restart by dragging the .pde to p5.app https://processing-js.lighthouseapp.com/ +_ go through vida examples to make sure extra imports are not being used +o do command line to run through all examples? + _ remove sketch.properties when moving back to the default? _ or can we not do this, because the next mode needs this? -_ go through examples to make sure extra imports are not being used -_ vida examples use them sometimes -_ do command line to run through all examples? - _ change error message for serial re: 64-bit _ "To use this library, switch to 32-bit mode in Preferences." (OS X) _ "To use this library, you must use the 32-bit version of Processing." -_ temporary files (for sketches and logs) are not deleted -_ http://code.google.com/p/processing/issues/detail?id=562 - -_ renaming RGB (.pde) to Rgb.java says "a file named RGB.pde already exists" - 2.0 FINAL / library/tool/mode manager cleanup _ make already installed libraries distinguishable in the list @@ -105,8 +100,6 @@ _ setModified() getting called on Windows (probably Linux) for key cmds _ blank sketch opened even if another opened by double-click _ http://code.google.com/p/processing/issues/detail?id=179 _ add a 150 ms or more lag before opening the untitled window (on os x) -_ also can have case of opening two of same sketch at once -_ if sketch was open, then restart by dragging the .pde to p5.app _ osx not opening a sketch at all on pde double-click? (though opening the app) _ active editor not being set null _ in Base.nextEditorLocation(), changed to "editors.size() == 0" @@ -226,6 +219,8 @@ _ 'recent' menu doesn't respect examples folder of other p5 versions _ 'recent' menu paths can get enormous _ add reference for contributed libraries to the Help menu _ http://code.google.com/p/processing/issues/detail?id=905 +_ temporary files (for sketches and logs) are not deleted +_ http://code.google.com/p/processing/issues/detail?id=562 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @@ -544,6 +539,7 @@ _ http://code.google.com/p/processing/issues/detail?id=8 PDE / Editor +_ renaming RGB (.pde) to Rgb.java says "a file named RGB.pde already exists" _ undo seems to not be going to the right location (now with example) _ http://code.google.com/p/processing/issues/detail?id=668 _ improve update check message "a new release (1.0.1) is available"