mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
go through vida examples to make sure everything still runs
This commit is contained in:
@@ -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;
|
||||
|
||||
+1
-3
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-1
@@ -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);
|
||||
|
||||
+2
@@ -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];
|
||||
|
||||
+14
-26
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user