Syncing with Processing 1.0.7 (5692); needs testing.

Also, the Sketchbook and Examples menus are currently disabled on the Mac to work-around a bug in Apple's implementation of Java.  I think this bug may have been solved, so I should try re-enabling the menus and see what happens (on 10.4 and 10.5 and 10.6).  Also, I may still need to update the jre / jdk on Linux.
This commit is contained in:
David A. Mellis 2009-09-24 03:16:00 +00:00
parent 240607a4a6
commit 3dc7fc0781
29 changed files with 1413 additions and 959 deletions

View File

@ -3,13 +3,12 @@
/*
Part of the Processing project - http://processing.org
Copyright (c) 2004-08 Ben Fry and Casey Reas
Copyright (c) 2004-09 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -44,14 +43,14 @@ public class Base {
static final int REVISION = 18;
static String VERSION_NAME = "0018";
static HashMap<Integer, String> platformNames = new HashMap();
static HashMap<Integer, String> platformNames = new HashMap<Integer, String>();
static {
platformNames.put(PConstants.WINDOWS, "windows");
platformNames.put(PConstants.MACOSX, "macosx");
platformNames.put(PConstants.LINUX, "linux");
}
static HashMap<String, Integer> platformIndices = new HashMap();
static HashMap<String, Integer> platformIndices = new HashMap<String, Integer>();
static {
platformIndices.put("windows", PConstants.WINDOWS);
platformIndices.put("macosx", PConstants.MACOSX);
@ -75,7 +74,7 @@ public class Base {
static private File librariesFolder;
static private File toolsFolder;
static private File hardwareFolder;
static HashSet<File> libraries;
// maps imported packages to their library folder
@ -90,7 +89,7 @@ public class Base {
static File untitledFolder;
// p5 icon for the window
static Image icon;
// static Image icon;
// int editorCount;
// Editor[] editors;
@ -102,8 +101,24 @@ public class Base {
// int nextEditorX;
// int nextEditorY;
// import com.sun.jna.Library;
// import com.sun.jna.Native;
// public interface CLibrary extends Library {
// CLibrary INSTANCE = (CLibrary)Native.loadLibrary("c", CLibrary.class);
// int setenv(String name, String value, int overwrite);
// String getenv(String name);
// int unsetenv(String name);
// int putenv(String string);
// }
static public void main(String args[]) {
// /Users/fry/coconut/sketchbook/libraries/gsvideo/library
// CLibrary clib = CLibrary.INSTANCE;
// clib.setenv("DYLD_LIBRARY_PATH", "/Users/fry/coconut/sketchbook/libraries/gsvideo/library", 1);
// System.out.println("env is now " + clib.getenv("DYLD_LIBRARY_PATH"));
try {
File versionFile = getContentFile("lib/version.txt");
if (versionFile.exists()) {
@ -188,12 +203,14 @@ public class Base {
"b { font: 13pt \"Lucida Grande\" }"+
"p { font: 11pt \"Lucida Grande\"; margin-top: 8px }"+
"</style> </head> <body>" +
"<b>The standard menu bar has been disabled.</b>" +
"<p>Due to an Apple bug, the Arduino menu bar " +
"is unusable on Mac OS X 10.5. <br>" +
"As a workaround, the menu bar will be placed inside " +
"the editor window. This <br>setting can be changed in the " +
"Preferences window. If this bug makes you sad, <br>" +
"<b>Some menus have been disabled.</b>" +
"<p>Due to an Apple bug, the Sketchbook and Example menus " +
"are unusable. <br>" +
"As a workaround, these items will be disabled from the " +
"standard menu bar, <br>" +
"but you can use the Open button on " +
"the toolbar to access the same items. <br>" +
"If this bug makes you sad, " +
"please contact Apple via bugreporter.apple.com.</p>" +
"</body> </html>";
Object[] options = { "OK", "More Info" };
@ -210,13 +227,18 @@ public class Base {
// But don't bother setting the preference in the file
} else {
// Shut off in the preferences for next time
Preferences.set(properMenuBar, "false");
//Preferences.set(properMenuBar, "false");
// For 1.0.4, we'll stick with the Apple menu bar,
// and just disable the sketchbook and examples sub-menus.
Preferences.set(properMenuBar, "true");
if (result == 1) { // More Info
Base.openURL("http://dev.processing.org/bugs/show_bug.cgi?id=786");
}
}
// Whether or not canceled, set to false (right now) if we're on 10.5
System.setProperty(properMenuBar, "false");
//System.setProperty(properMenuBar, "false");
// Changing this behavior for 1.0.4
System.setProperty(properMenuBar, "true");
}
}
}
@ -711,13 +733,17 @@ public class Base {
protected Editor handleOpen(String path, int[] location) {
// System.err.println("entering handleOpen " + path);
File file = new File(path);
if (!file.exists()) return null;
// System.err.println(" editors: " + editors);
// Cycle through open windows to make sure that it's not already open.
for (Editor editor : editors) {
if (editor.getSketch().getMainFilePath().equals(path)) {
editor.toFront();
// System.err.println(" handleOpen: already opened");
return editor;
}
}
@ -736,10 +762,23 @@ public class Base {
// }
// }
// System.err.println(" creating new editor");
Editor editor = new Editor(this, path, location);
// Editor editor = null;
// try {
// editor = new Editor(this, path, location);
// } catch (Exception e) {
// e.printStackTrace();
// System.err.flush();
// System.out.flush();
// System.exit(1);
// }
// System.err.println(" done creating new editor");
// EditorConsole.systemErr.println(" done creating new editor");
// Make sure that the sketch actually loaded
if (editor.getSketch() == null) {
// System.err.println("sketch was null, getting out of handleOpen");
return null; // Just walk away quietly
}
@ -763,6 +802,8 @@ public class Base {
// (don't do earlier, cuz we might move it based on a window being closed)
editor.setVisible(true);
// System.err.println("exiting handleOpen");
return editor;
}
@ -952,9 +993,16 @@ public class Base {
protected void rebuildSketchbookMenu(JMenu menu) {
//System.out.println("rebuilding sketchbook menu");
//new Exception().printStackTrace();
boolean nativeButBroken = Base.isMacOS() ?
Preferences.getBoolean("apple.laf.useScreenMenuBar") : false;
try {
menu.removeAll();
addSketches(menu, getSketchbookFolder(), false);
if (nativeButBroken) { // osx workaround
menu.setEnabled(false);
} else {
menu.removeAll();
addSketches(menu, getSketchbookFolder(), false);
}
} catch (IOException e) {
e.printStackTrace();
}
@ -964,40 +1012,52 @@ public class Base {
public void rebuildImportMenu(JMenu importMenu) {
//System.out.println("rebuilding import menu");
importMenu.removeAll();
// reset the set of libraries
libraries = new HashSet<File>();
// reset the table mapping imports to libraries
importToLibraryTable = new HashMap<String, File>();
// Add libraries found in the sketchbook folder
try {
File sketchbookLibraries = getSketchbookLibrariesFolder();
boolean found = addLibraries(importMenu, sketchbookLibraries);
if (found) importMenu.addSeparator();
} catch (IOException e) {
e.printStackTrace();
}
// Add from the "libraries" subfolder in the Processing directory
try {
addLibraries(importMenu, librariesFolder);
} catch (IOException e) {
e.printStackTrace();
}
// Add libraries found in the sketchbook folder
int separatorIndex = importMenu.getItemCount();
try {
File sketchbookLibraries = getSketchbookLibrariesFolder();
boolean found = addLibraries(importMenu, sketchbookLibraries);
if (found) {
JMenuItem contrib = new JMenuItem("Contributed");
contrib.setEnabled(false);
importMenu.insert(contrib, separatorIndex);
importMenu.insertSeparator(separatorIndex);
}
} catch (IOException e) {
e.printStackTrace();
}
}
public void rebuildExamplesMenu(JMenu menu) {
//System.out.println("rebuilding examples menu");
boolean nativeButBroken = Base.isMacOS() ?
Preferences.getBoolean("apple.laf.useScreenMenuBar") : false;
try {
menu.removeAll();
boolean found = addSketches(menu, examplesFolder, false);
if (found) menu.addSeparator();
found = addSketches(menu, getSketchbookLibrariesFolder(), false);
if (found) menu.addSeparator();
addSketches(menu, librariesFolder, false);
if (nativeButBroken) { // osx workaround
menu.setEnabled(false);
} else {
menu.removeAll();
boolean found = addSketches(menu, examplesFolder, false);
if (found) menu.addSeparator();
found = addSketches(menu, getSketchbookLibrariesFolder(), false);
if (found) menu.addSeparator();
addSketches(menu, librariesFolder, false);
}
} catch (IOException e) {
e.printStackTrace();
}
@ -1084,18 +1144,18 @@ public class Base {
boolean found = addSketches(menu, subfolder, openReplaces); //, false);
if (found) ifound = true;
} else {
// not a sketch folder, but maybe a subfolder containing sketches
JMenu submenu = new JMenu(list[i]);
// needs to be separate var
// otherwise would set ifound to false
boolean found = addSketches(submenu, subfolder, openReplaces); //, false);
if (found) {
menu.add(submenu);
ifound = true;
}
// not a sketch folder, but maybe a subfolder containing sketches
JMenu submenu = new JMenu(list[i]);
// needs to be separate var
// otherwise would set ifound to false
boolean found = addSketches(submenu, subfolder, openReplaces); //, false);
if (found) {
menu.add(submenu);
ifound = true;
}
}
}
}
return ifound; // actually ignored, but..
}
@ -1126,23 +1186,24 @@ public class Base {
boolean ifound = false;
for (String libraryName : list) {
File subfolder = new File(folder, libraryName);
for (String potentialName : list) {
File subfolder = new File(folder, potentialName);
// File libraryFolder = new File(subfolder, "library");
// File libraryJar = new File(libraryFolder, libraryName + ".jar");
// File libraryJar = new File(libraryFolder, potentialName + ".jar");
// // If a .jar file of the same prefix as the folder exists
// // inside the 'library' subfolder of the sketch
// if (libraryJar.exists()) {
String sanityCheck = Sketch.sanitizeName(libraryName);
if (!sanityCheck.equals(libraryName)) {
String sanityCheck = Sketch.sanitizeName(potentialName);
if (!sanityCheck.equals(potentialName)) {
String mess =
"The library \"" + libraryName + "\" cannot be used.\n" +
"The library \"" + potentialName + "\" cannot be used.\n" +
"Library names must contain only basic letters and numbers.\n" +
"(ascii only and no spaces, and it cannot start with a number)";
"(ASCII only and no spaces, and it cannot start with a number)";
Base.showMessage("Ignoring bad library name", mess);
continue;
}
String libraryName = potentialName;
// // get the path for all .jar files in this code folder
// String libraryClassPath =
// Compiler.contentsToClassPath(libraryFolder);
@ -1399,8 +1460,8 @@ public class Base {
}
return null;
}
static public Set<File> getLibraries() {
return libraries;
}
@ -1424,8 +1485,8 @@ public class Base {
static public String getToolsPath() {
return toolsFolder.getAbsolutePath();
}
static public File getHardwareFolder() {
// calculate on the fly because it's needed by Preferences.init() to find
// the boards.txt and programmers.txt preferences files (which happens
@ -1457,8 +1518,8 @@ public class Base {
static public File getSketchbookLibrariesFolder() {
return new File(getSketchbookFolder(), "libraries");
}
static public String getSketchbookLibrariesPath() {
return getSketchbookLibrariesFolder().getAbsolutePath();
}
@ -1658,7 +1719,7 @@ public class Base {
File referenceFile = new File(referenceFolder, filename);
openURL(referenceFile.getAbsolutePath());
}
static public void showGettingStarted() {
if (Base.isMacOS()) {
Base.showReference("Guide_MacOSX.html");
@ -1687,8 +1748,8 @@ public class Base {
static public void showTroubleshooting() {
showReference("Guide_Troubleshooting.html");
}
static public void showFAQ() {
showReference("faq.html");
}

View File

@ -3,13 +3,12 @@
/*
Part of the Processing project - http://processing.org
Copyright (c) 2004-08 Ben Fry and Casey Reas
Copyright (c) 2004-09 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -81,7 +80,7 @@ public class Editor extends JFrame implements RunnerListener {
JMenu fileMenu;
JMenu sketchMenu;
JMenu toolsMenu;
int numTools = 0;
EditorToolbar toolbar;
@ -91,7 +90,7 @@ public class Editor extends JFrame implements RunnerListener {
static JMenu sketchbookMenu;
static JMenu examplesMenu;
static JMenu importMenu;
// these menus are shared so that the board and serial port selections
// are the same for all windows (since the board and serial port that are
// actually used are determined by the preferences, which are shared)
@ -161,8 +160,8 @@ public class Editor extends JFrame implements RunnerListener {
// When bringing a window to front, let the Base know
addWindowListener(new WindowAdapter() {
public void windowActivated(WindowEvent e) {
// System.err.println("activate"); // not coming through
base.handleActivated(Editor.this);
// re-add the sub-menus that are shared by all windows
fileMenu.insert(sketchbookMenu, 2);
fileMenu.insert(examplesMenu, 3);
@ -170,11 +169,22 @@ public class Editor extends JFrame implements RunnerListener {
toolsMenu.insert(boardsMenu, numTools);
toolsMenu.insert(serialMenu, numTools + 1);
}
// added for 1.0.5
// http://dev.processing.org/bugs/show_bug.cgi?id=1260
public void windowDeactivated(WindowEvent e) {
// System.err.println("deactivate"); // not coming through
fileMenu.remove(sketchbookMenu);
fileMenu.remove(examplesMenu);
sketchMenu.remove(importMenu);
toolsMenu.remove(boardsMenu);
toolsMenu.remove(serialMenu);
}
});
//PdeKeywords keywords = new PdeKeywords();
//sketchbook = new Sketchbook(this);
if (serialMonitor == null)
serialMonitor = new SerialMonitor(Preferences.get("serial.port"));
@ -717,7 +727,7 @@ public class Editor extends JFrame implements RunnerListener {
URL[] urlList = new URL[archives.length];
for (int j = 0; j < urlList.length; j++) {
urlList[j] = archives[j].toURL();
urlList[j] = archives[j].toURI().toURL();
}
URLClassLoader loader = new URLClassLoader(urlList);
@ -819,7 +829,7 @@ public class Editor extends JFrame implements RunnerListener {
final Tool tool = (Tool) toolClass.newInstance();
JMenuItem item = new JMenuItem(tool.getMenuTitle());
tool.init(Editor.this);
item.addActionListener(new ActionListener() {
@ -828,14 +838,14 @@ public class Editor extends JFrame implements RunnerListener {
}
});
return item;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
protected JMenu addInternalTools(JMenu menu) {
JMenuItem item;
@ -963,7 +973,9 @@ public class Editor extends JFrame implements RunnerListener {
protected JMenu buildHelpMenu() {
JMenu menu = new JMenu("Help");
// To deal with a Mac OS X 10.5 bug, add an extra space after the name
// so that the OS doesn't try to insert its slow help menu.
JMenu menu = new JMenu("Help ");
JMenuItem item;
/*
@ -1764,7 +1776,7 @@ public class Editor extends JFrame implements RunnerListener {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
try {
try {
sketch.compile(new Target(
Base.getHardwarePath() + File.separator + "cores",
Preferences.get("boards." + Preferences.get("board") + ".build.core")),
@ -1776,10 +1788,10 @@ public class Editor extends JFrame implements RunnerListener {
} catch (Exception e) {
e.printStackTrace();
}
}
toolbar.deactivate(EditorToolbar.RUN);
}
}
});
}
@ -2237,8 +2249,8 @@ public class Editor extends JFrame implements RunnerListener {
}
return true;
}
public void handleSerial() {
if (uploading) return;
serialMonitor.setVisible(true);

View File

@ -305,16 +305,17 @@ public class EditorConsole extends JScrollPane {
public void flush() { }
public void write(byte b[]) { // appears never to be used
// if (currentConsole.isDisplayable()) {
currentConsole.write(b, 0, b.length, err);
// } else {
// systemOut.println("not displayable");
// if (err) {
// systemErr.write(b, 0, b.length);
// } else {
// systemOut.write(b, 0, b.length);
// }
// }
if (currentConsole != null) {
currentConsole.write(b, 0, b.length, err);
} else {
try {
if (err) {
systemErr.write(b);
} else {
systemOut.write(b);
}
} catch (IOException e) { } // just ignore, where would we write?
}
OutputStream echo = err ? stderrFile : stdoutFile;
if (echo != null) {
@ -329,18 +330,17 @@ public class EditorConsole extends JScrollPane {
}
public void write(byte b[], int offset, int length) {
currentConsole.write(b, offset, length, err);
// if (currentConsole.isDisplayable()) {
// systemOut.println("is displayable");
// currentConsole.write(b, offset, length, err);
// } else {
// systemOut.println("not displayable");
// if (err) {
// systemErr.write(b, offset, length);
// } else {
// systemOut.write(b, offset, length);
// }
// }
if (currentConsole != null) {
currentConsole.write(b, offset, length, err);
} else {
try {
if (err) {
systemErr.write(b);
} else {
systemOut.write(b);
}
} catch (IOException e) { } // just ignore, where would we write?
}
OutputStream echo = err ? stderrFile : stdoutFile;
if (echo != null) {
@ -356,7 +356,12 @@ public class EditorConsole extends JScrollPane {
public void write(int b) {
single[0] = (byte)b;
currentConsole.write(single, 0, 1, err);
if (currentConsole != null) {
currentConsole.write(single, 0, 1, err);
} else {
// redirect for all the extra handling above
write(new byte[] { (byte) b }, 0, 1);
}
OutputStream echo = err ? stderrFile : stdoutFile;
if (echo != null) {

View File

@ -53,7 +53,7 @@ public class EditorToolbar extends JComponent implements MouseInputListener {
static final int OPEN = 3;
static final int SAVE = 4;
static final int EXPORT = 5;
static final int SERIAL = 6;
static final int INACTIVE = 0;

View File

@ -3,7 +3,7 @@
/*
Part of the Processing project - http://processing.org
Copyright (c) 2004-06 Ben Fry and Casey Reas
Copyright (c) 2004-09 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
@ -34,8 +34,6 @@ import processing.app.syntax.*;
import processing.core.*;
/**
* Storage class for user preferences and environment settings.
* <P>
@ -144,9 +142,9 @@ public class Preferences {
// data model
static Hashtable defaults;
static Hashtable table = new Hashtable();;
static Hashtable prefixes = new Hashtable();
static HashMap<String,String> defaults;
static HashMap<String,String> table = new HashMap<String,String>();;
static HashMap<String,HashMap<String,String>> prefixes = new HashMap<String,HashMap<String,String>>();
static File preferencesFile;
@ -161,22 +159,8 @@ public class Preferences {
"You'll need to reinstall Arduino.", e);
}
// check for platform-specific properties in the defaults
String platformExt = "." + PConstants.platformNames[PApplet.platform];
int platformExtLength = platformExt.length();
Enumeration e = table.keys();
while (e.hasMoreElements()) {
String key = (String) e.nextElement();
if (key.endsWith(platformExt)) {
// this is a key specific to a particular platform
String actualKey = key.substring(0, key.length() - platformExtLength);
String value = get(key);
table.put(actualKey, value);
}
}
// clone the hash table
defaults = (Hashtable) table.clone();
defaults = (HashMap<String, String>) table.clone();
// other things that have to be set explicitly for the defaults
setColor("run.window.bgcolor", SystemColor.control);
@ -231,8 +215,8 @@ public class Preferences {
"Error reading the board definitions file (" +
new File(Base.getHardwareFolder(), "boards.txt").getAbsolutePath() + "). " +
"Please re-download or re-unzip Arduino.\n", ex);
}
}
try {
load(new FileInputStream(new File(Base.getHardwareFolder(), "programmers.txt")),
"programmers");
@ -445,6 +429,20 @@ public class Preferences {
top += d.height; // + GUI_SMALL;
label = new JLabel(preferencesFile.getAbsolutePath());
final JLabel clickable = label;
label.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
Base.openFolder(Base.getSettingsFolder());
}
public void mouseEntered(MouseEvent e) {
clickable.setForeground(new Color(0, 0, 140));
}
public void mouseExited(MouseEvent e) {
clickable.setForeground(Color.BLACK);
}
});
pain.add(label);
d = label.getPreferredSize();
label.setBounds(left, top, d.width, d.height);
@ -678,12 +676,16 @@ public class Preferences {
}
static protected void load(InputStream input, String prefix) throws IOException {
Map table = new LinkedHashMap();
LinkedHashMap<String,String> table = new LinkedHashMap<String,String>();
prefixes.put(prefix, table);
load(input, table);
}
static protected void load(InputStream input, Map table) throws IOException {
// check for platform-specific properties in the defaults
String platformExt = "." + PConstants.platformNames[PApplet.platform];
int platformExtLength = platformExt.length();
String[] lines = PApplet.loadStrings(input); // Reads as UTF-8
for (String line : lines) {
if ((line.length() == 0) ||
@ -693,6 +695,12 @@ public class Preferences {
int equals = line.indexOf('=');
if (equals != -1) {
String key = line.substring(0, equals).trim();
// check if this is a platform-specific key, and if so, shave things
if (key.endsWith(platformExt)) {
// this is a key specific to this platform
key = key.substring(0, key.length() - platformExtLength);
}
String value = line.substring(equals + 1).trim();
table.put(key, value);
}
@ -713,10 +721,8 @@ public class Preferences {
// Fix for 0163 to properly use Unicode when writing preferences.txt
PrintWriter writer = PApplet.createWriter(preferencesFile);
Enumeration e = table.keys(); //properties.propertyNames();
while (e.hasMoreElements()) {
String key = (String) e.nextElement();
writer.println(key + "=" + ((String) table.get(key)));
for (String key : table.keySet()) {
writer.println(key + "=" + table.get(key));
}
writer.flush();
@ -742,15 +748,15 @@ public class Preferences {
// preference files, look up the attribute in that file's Hashtable
// (don't override with or fallback to the main file). otherwise,
// look up the attribute in the main file's Hashtable.
Map table = Preferences.table;
HashMap<String,String> table = Preferences.table;
if (attribute.indexOf('.') != -1) {
String prefix = attribute.substring(0, attribute.indexOf('.'));
if (prefixes.containsKey(prefix)) {
table = (Map) prefixes.get(prefix);
table = prefixes.get(prefix);
attribute = attribute.substring(attribute.indexOf('.') + 1);
}
}
return (String) table.get(attribute);
return table.get(attribute);
/*
//String value = (properties != null) ?
//properties.getProperty(attribute) : applet.getParameter(attribute);
@ -785,7 +791,7 @@ public class Preferences {
static public String getDefault(String attribute) {
return (String) defaults.get(attribute);
return defaults.get(attribute);
}
@ -845,7 +851,7 @@ public class Preferences {
static public Color getColor(String name) {
Color parsed = Color.GRAY; // set a default
Color parsed = Color.GRAY; // set a default
String s = get(name);
if ((s != null) && (s.indexOf("#") == 0)) {
try {
@ -857,11 +863,6 @@ public class Preferences {
static public void setColor(String attr, Color what) {
// String r = Integer.toHexString(what.getRed());
// String g = Integer.toHexString(what.getGreen());
// String b = Integer.toHexString(what.getBlue());
// set(attr, "#" + r.substring(r.length() - 2) +
// g.substring(g.length() - 2) + b.substring(b.length() - 2));
set(attr, "#" + PApplet.hex(what.getRGB() & 0xffffff, 6));
}
@ -911,7 +912,7 @@ public class Preferences {
String s = st.nextToken();
if (s.indexOf("#") == 0) s = s.substring(1);
Color color = Color.DARK_GRAY;
Color color = Color.DARK_GRAY;
try {
color = new Color(Integer.parseInt(s, 16));
} catch (Exception e) { }

View File

@ -3,7 +3,7 @@
/*
Part of the Processing project - http://processing.org
Copyright (c) 2005-06 Ben Fry and Casey Reas
Copyright (c) 2005-09 Ben Fry and Casey Reas
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -59,7 +59,7 @@ public class PresentMode {
devices = environment.getScreenDevices();
GraphicsDevice defaultDevice = environment.getDefaultScreenDevice();
Vector names = new Vector();
Vector<String> names = new Vector<String>();
for (int i = 0; i < devices.length; i++) {
String name = String.valueOf(i + 1);
if (devices[i] == defaultDevice) {

View File

@ -3,7 +3,7 @@
/*
Part of the Processing project - http://processing.org
Copyright (c) 2004-08 Ben Fry and Casey Reas
Copyright (c) 2004-09 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
@ -1431,7 +1431,7 @@ public class Sketch {
upload(appletFolder.getPath(), foundName, verbose);
return true;
}
}
protected void size(String buildPath, String suggestedClassName)
@ -1439,23 +1439,23 @@ public class Sketch {
long size = 0;
long maxsize = Preferences.getInteger("boards." + Preferences.get("board") + ".upload.maximum_size");
Sizer sizer = new Sizer(buildPath, suggestedClassName);
try {
try {
size = sizer.computeSize();
System.out.println("Binary sketch size: " + size + " bytes (of a " +
maxsize + " byte maximum)");
} catch (RunnerException e) {
System.err.println("Couldn't determine program size: " + e.getMessage());
}
}
if (size > maxsize)
throw new RunnerException(
"Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.");
}
}
protected String upload(String buildPath, String suggestedClassName, boolean verbose)
throws RunnerException {
Uploader uploader;
// download the program
@ -1466,7 +1466,7 @@ public class Sketch {
verbose);
return success ? suggestedClassName : null;
}
}
/**
* Replace all commented portions of a given String as spaces.
@ -1528,8 +1528,8 @@ public class Sketch {
* Export to application via GUI.
*/
protected boolean exportApplication() throws IOException, RunnerException {
return false;
}
return false;
}
/**
@ -1537,8 +1537,8 @@ public class Sketch {
*/
public boolean exportApplication(String destPath,
int exportPlatform) throws IOException, RunnerException {
return false;
}
return false;
}
protected void addManifest(ZipOutputStream zos) throws IOException {
@ -1558,8 +1558,8 @@ public class Sketch {
* Read from a file with a bunch of attribute/value pairs
* that are separated by = and ignore comments with #.
*/
protected Hashtable readSettings(File inputFile) {
Hashtable outgoing = new Hashtable();
protected HashMap<String,String> readSettings(File inputFile) {
HashMap<String,String> outgoing = new HashMap<String,String>();
if (!inputFile.exists()) return outgoing; // return empty hash
String lines[] = PApplet.loadStrings(inputFile);
@ -1589,7 +1589,7 @@ public class Sketch {
*/
protected void packClassPathIntoZipFile(String path,
ZipOutputStream zos,
Hashtable zipFileContents)
HashMap<String,Object> zipFileContents)
throws IOException {
String[] pieces = PApplet.split(path, File.pathSeparatorChar);
@ -1601,7 +1601,7 @@ public class Sketch {
pieces[i].toLowerCase().endsWith(".zip")) {
try {
ZipFile file = new ZipFile(pieces[i]);
Enumeration entries = file.entries();
Enumeration<?> entries = file.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entries.nextElement();
if (entry.isDirectory()) {
@ -1887,8 +1887,8 @@ public class Sketch {
}
return codeFolder;
}
public ArrayList<File> getImportedLibraries() {
return importedLibraries;
}

View File

@ -39,9 +39,9 @@ import processing.core.*;
public class Theme {
/** Copy of the defaults in case the user mangles a preference. */
static Hashtable defaults;
static HashMap<String,String> defaults;
/** Table of attributes/values for the theme. */
static Hashtable table = new Hashtable();;
static HashMap<String,String> table = new HashMap<String,String>();;
static protected void init() {
@ -55,9 +55,7 @@ public class Theme {
// check for platform-specific properties in the defaults
String platformExt = "." + Base.getPlatformName();
int platformExtLength = platformExt.length();
Enumeration e = table.keys();
while (e.hasMoreElements()) {
String key = (String) e.nextElement();
for (String key : table.keySet()) {
if (key.endsWith(platformExt)) {
// this is a key specific to a particular platform
String actualKey = key.substring(0, key.length() - platformExtLength);
@ -70,7 +68,7 @@ public class Theme {
setColor("run.window.bgcolor", SystemColor.control);
// clone the hash table
defaults = (Hashtable) table.clone();
defaults = (HashMap<String, String>) table.clone();
}
@ -142,11 +140,7 @@ public class Theme {
static public void setColor(String attr, Color what) {
String r = Integer.toHexString(what.getRed());
String g = Integer.toHexString(what.getGreen());
String b = Integer.toHexString(what.getBlue());
set(attr, "#" + r.substring(r.length() - 2) +
g.substring(g.length() - 2) + b.substring(b.length() - 2));
set(attr, "#" + PApplet.hex(what.getRGB() & 0xffffff, 6));
}

View File

@ -73,7 +73,7 @@ public class Compiler implements MessageConsumer {
MessageStream pms = new MessageStream(this);
String avrBasePath = Base.getAvrBasePath();
List<File> objectFiles = new ArrayList<File>();
List includePaths = new ArrayList();
@ -99,15 +99,15 @@ public class Compiler implements MessageConsumer {
List commandAR = new ArrayList(baseCommandAR);
commandAR.add(file.getAbsolutePath());
execAsynchronously(commandAR);
}
}
// 2. compile the libraries, outputting .o files to: <buildPath>/<library>/
// use library directories as include paths for all libraries
for (File file : sketch.getImportedLibraries()) {
includePaths.add(file.getPath());
}
for (File libraryFolder : sketch.getImportedLibraries()) {
File outputFolder = new File(buildPath, libraryFolder.getName());
createFolder(outputFolder);
@ -125,17 +125,17 @@ public class Compiler implements MessageConsumer {
findFilesInFolder(new File(libraryFolder, "utility"), "cpp", false)));
// other libraries should not see this library's utility/ folder
includePaths.remove(includePaths.size() - 1);
}
}
// 3. compile the sketch (already in the buildPath)
objectFiles.addAll(
compileFiles(avrBasePath, buildPath, includePaths,
findFilesInPath(buildPath, "c", false),
findFilesInPath(buildPath, "cpp", false)));
// 4. link it all together into the .elf file
List baseCommandLinker = new ArrayList(Arrays.asList(new String[] {
avrBasePath + "avr-gcc",
"-Os",
@ -144,7 +144,7 @@ public class Compiler implements MessageConsumer {
"-o",
buildPath + File.separator + primaryClassName + ".elf"
}));
for (File file : objectFiles) {
baseCommandLinker.add(file.getAbsolutePath());
}
@ -185,14 +185,14 @@ public class Compiler implements MessageConsumer {
execAsynchronously(commandObjcopy);
return true;
}
}
private List<File> compileFiles(String avrBasePath,
String buildPath, List<File> includePaths,
List<File> cSources, List<File> cppSources)
throws RunnerException {
List<File> objectPaths = new ArrayList<File>();
for (File file : cSources) {
@ -201,7 +201,7 @@ public class Compiler implements MessageConsumer {
execAsynchronously(getCommandCompilerC(avrBasePath, includePaths,
file.getAbsolutePath(),
objectPath));
}
}
for (File file : cppSources) {
String objectPath = buildPath + File.separator + file.getName() + ".o";
@ -209,12 +209,12 @@ public class Compiler implements MessageConsumer {
execAsynchronously(getCommandCompilerCPP(avrBasePath, includePaths,
file.getAbsolutePath(),
objectPath));
}
}
return objectPaths;
}
}
boolean firstErrorFound;
boolean secondErrorFound;
@ -229,9 +229,9 @@ public class Compiler implements MessageConsumer {
if (verbose || Preferences.getBoolean("build.verbose")) {
for(int j = 0; j < command.length; j++) {
System.out.print(command[j] + " ");
}
}
System.out.println();
}
}
firstErrorFound = false; // haven't found any errors yet
secondErrorFound = false;
@ -244,8 +244,8 @@ public class Compiler implements MessageConsumer {
RunnerException re = new RunnerException(e.getMessage());
re.hideStackTrace();
throw re;
}
}
MessageSiphon in = new MessageSiphon(process.getInputStream(), this);
MessageSiphon err = new MessageSiphon(process.getErrorStream(), this);
@ -263,7 +263,7 @@ public class Compiler implements MessageConsumer {
compiling = false;
} catch (InterruptedException ignored) { }
}
// an error was queued up by message(), barf this back to compile(),
// which will barf it back to Editor. if you're having trouble
// discerning the imagery, consider how cows regurgitate their food
@ -271,18 +271,18 @@ public class Compiler implements MessageConsumer {
//
//System.out.println("throwing up " + exception);
if (exception != null) { throw exception; }
if (result > 1) {
// a failure in the tool (e.g. unable to locate a sub-executable)
System.err.println(command[0] + " returned " + result);
}
}
if (result != 0) {
RunnerException re = new RunnerException("Error compiling.");
re.hideStackTrace();
throw re;
}
}
}
}
/**
@ -312,14 +312,14 @@ public class Compiler implements MessageConsumer {
String partialTempPath = null;
int partialStartIndex = -1; //s.indexOf(partialTempPath);
int fileIndex = -1; // use this to build a better exception
// check the main sketch file first.
partialTempPath = buildPathSubst + primaryClassName;
partialStartIndex = s.indexOf(partialTempPath);
if (partialStartIndex != -1) {
fileIndex = 0;
} else {
} else {
// wasn't there, check the other (non-pde) files in the sketch.
// iterate through the project files to see who's causing the trouble
for (int i = 0; i < sketch.getCodeCount(); i++) {
@ -332,7 +332,7 @@ public class Compiler implements MessageConsumer {
fileIndex = i;
//System.out.println("fileIndex is " + fileIndex);
break;
}
}
}
//+ className + ".java";
}
@ -353,7 +353,7 @@ public class Compiler implements MessageConsumer {
System.err.print(s1);
//firstErrorFound = true;
return;
}
}
int lineNumber;
try {
@ -361,7 +361,7 @@ public class Compiler implements MessageConsumer {
} catch (NumberFormatException e) {
System.err.print(s1);
return;
}
}
//System.out.println("pde / line number: " + lineNumber);
@ -372,15 +372,15 @@ public class Compiler implements MessageConsumer {
if (sketch.getCode(i).getPreprocOffset() < lineNumber) {
fileIndex = i;
//System.out.println("i'm thinkin file " + i);
}
}
}
}
}
// XXX: DAM: if the lineNumber is less than sketch.getCode(0).getPreprocOffset()
// we shouldn't subtract anything from it, as the error is above the
// location where the function prototypes and #include "WProgram.h"
// were inserted.
lineNumber -= sketch.getCode(fileIndex).getPreprocOffset();
}
}
//String s2 = s1.substring(colon + 2);
int err = s1.indexOf(":");
@ -391,7 +391,7 @@ public class Compiler implements MessageConsumer {
if (firstErrorFound) {
secondErrorFound = true;
return;
}
}
// if executing at this point, this is *at least* the first error
firstErrorFound = true;
@ -421,13 +421,13 @@ public class Compiler implements MessageConsumer {
// are probably associated with the first error message,
// which is already in the status bar, and are likely to be
// of interest to the user, so spit them to the console.
//
//
if (!secondErrorFound) {
System.err.println(s);
}
}
}
/////////////////////////////////////////////////////////////////////////////
static private List getCommandCompilerC(String avrBasePath, List includePaths,
@ -447,13 +447,13 @@ public class Compiler implements MessageConsumer {
for (int i = 0; i < includePaths.size(); i++) {
baseCommandCompiler.add("-I" + (String) includePaths.get(i));
}
baseCommandCompiler.add(sourceName);
baseCommandCompiler.add("-o"+ objectName);
return baseCommandCompiler;
}
static private List getCommandCompilerCPP(String avrBasePath,
List includePaths, String sourceName, String objectName) {
@ -472,15 +472,15 @@ public class Compiler implements MessageConsumer {
for (int i = 0; i < includePaths.size(); i++) {
baseCommandCompilerCPP.add("-I" + (String) includePaths.get(i));
}
}
baseCommandCompilerCPP.add(sourceName);
baseCommandCompilerCPP.add("-o"+ objectName);
return baseCommandCompilerCPP;
}
/////////////////////////////////////////////////////////////////////////////

View File

@ -40,31 +40,9 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import com.sun.jdi.Field;
import com.sun.jdi.IncompatibleThreadStateException;
import com.sun.jdi.ThreadReference;
import com.sun.jdi.VMDisconnectedException;
import com.sun.jdi.Value;
import com.sun.jdi.VirtualMachine;
import com.sun.jdi.event.ClassPrepareEvent;
import com.sun.jdi.event.Event;
import com.sun.jdi.event.EventIterator;
import com.sun.jdi.event.EventQueue;
import com.sun.jdi.event.EventSet;
import com.sun.jdi.event.ExceptionEvent;
import com.sun.jdi.event.MethodEntryEvent;
import com.sun.jdi.event.MethodExitEvent;
import com.sun.jdi.event.ModificationWatchpointEvent;
import com.sun.jdi.event.StepEvent;
import com.sun.jdi.event.ThreadDeathEvent;
import com.sun.jdi.event.VMDeathEvent;
import com.sun.jdi.event.VMDisconnectEvent;
import com.sun.jdi.event.VMStartEvent;
import com.sun.jdi.request.EventRequest;
import com.sun.jdi.request.EventRequestManager;
import com.sun.jdi.request.ExceptionRequest;
import com.sun.jdi.request.ModificationWatchpointRequest;
import com.sun.jdi.request.StepRequest;
import com.sun.jdi.*;
import com.sun.jdi.event.*;
import com.sun.jdi.request.*;
/**
* This class processes incoming JDI events and displays them
@ -132,8 +110,9 @@ public class EventThread extends Thread {
// deathReq.setSuspendPolicy(EventRequest.SUSPEND_ALL);
// deathReq.enable();
// want all exceptions
// get only the uncaught exceptions
ExceptionRequest excReq = mgr.createExceptionRequest(null, false, true);
// this version reports all exceptions, caught or uncaught
//ExceptionRequest excReq = mgr.createExceptionRequest(null, true, true);
// suspend so we can step
excReq.setSuspendPolicy(EventRequest.SUSPEND_ALL);
@ -380,7 +359,7 @@ public class EventThread extends Thread {
}
private void exceptionEvent(ExceptionEvent event) {
// ObjectReference or = event.exception();
// com.sun.jdi.ObjectReference or = event.exception();
// System.out.println("exceptionEvent() fired " + or);
// System.out.println("catch location " + event.catchLocation());

View File

@ -3,7 +3,7 @@
/*
Part of the Processing project - http://processing.org
Copyright (c) 2004-08 Ben Fry and Casey Reas
Copyright (c) 2004-09 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
@ -379,11 +379,16 @@ public class Runner implements MessageConsumer {
//String addr = "localhost:" + (8000 + (int) (Math.random() * 1000));
//String addr = "" + (8000 + (int) (Math.random() * 1000));
String commandArgs = Base.isWindows() ?
"java -Xrunjdwp:transport=dt_shmem,address=" + addr + ",suspend=y " :
String commandArgs =
"java -Xrunjdwp:transport=dt_socket,address=" + addr + ",suspend=y ";
//String commandArgs = "java -agentlib:jdwp=transport=dt_socket,address=" + addr + ",suspend=y ";
//String commandArgs = "java -agentlib:jdwp=transport=dt_socket,address=" + addr + ",server=n,suspend=y ";
if (Base.isWindows()) {
commandArgs =
"java -Xrunjdwp:transport=dt_shmem,address=" + addr + ",suspend=y ";
} else if (Base.isMacOS()) {
commandArgs =
"java -d32 -Xrunjdwp:transport=dt_socket,address=" + addr + ",suspend=y ";
}
for (int i = 0; i < vmParams.length; i++) {
commandArgs = addArgument(commandArgs, vmParams[i], ' ');
}
@ -519,11 +524,13 @@ public class Runner implements MessageConsumer {
// Shutdown begins when event thread terminates
try {
if (eventThread != null) eventThread.join();
// System.out.println("in here");
// Bug #852 tracked to this next line in the code.
// http://dev.processing.org/bugs/show_bug.cgi?id=852
errThread.join(); // Make sure output is forwarded
// System.out.println("and then");
outThread.join(); // before we exit
//System.out.println("out of it");
// System.out.println("out of it");
// At this point, disable the run button.
// This happens when the sketch is exited by hitting ESC,
@ -573,6 +580,7 @@ public class Runner implements MessageConsumer {
public void exception(ExceptionEvent event) {
// System.out.println(event);
ObjectReference or = event.exception();
ReferenceType rt = or.referenceType();
String exceptionName = rt.name();
@ -644,7 +652,7 @@ public class Runner implements MessageConsumer {
// message to the console.
List<StackFrame> frames = thread.frames();
for (StackFrame frame : frames) {
//System.out.println("frame: " + frame);
// System.out.println("frame: " + frame);
Location location = frame.location();
String filename = null;
filename = location.sourceName();

View File

@ -86,13 +86,14 @@ public class ThinkDifferent implements ApplicationListener {
throw new IllegalStateException("handlePreferences: Base instance detached from listener");
}
}
public void handleOpenApplication(ApplicationEvent ae) {
}
public void handleOpenFile(ApplicationEvent ae) {
// System.out.println("got open file event " + ae.getFilename());
String filename = ae.getFilename();
base.handleOpen(filename);
ae.setHandled(true);

View File

@ -51,7 +51,7 @@ import java.util.Vector;
* + "}");</pre>
*
* @author Slava Pestov
* @version $Id: JEditTextArea.java 5343 2008-11-29 17:22:59Z fry $
* @version $Id: JEditTextArea.java 5625 2009-06-07 21:08:59Z fry $
*/
public class JEditTextArea extends JComponent
{
@ -103,6 +103,9 @@ public class JEditTextArea extends JComponent
painter.addMouseListener(new MouseHandler());
painter.addMouseMotionListener(new DragHandler());
addFocusListener(new FocusHandler());
// send tab keys through to the text area
// http://dev.processing.org/bugs/show_bug.cgi?id=1267
setFocusTraversalKeysEnabled(false);
// Load the defaults
setInputHandler(defaults.inputHandler);
@ -145,9 +148,9 @@ public class JEditTextArea extends JComponent
* Returns if this component can be traversed by pressing
* the Tab key. This returns false.
*/
public final boolean isManagingFocus() {
return true;
}
// public final boolean isManagingFocus() {
// return true;
// }
/**
* Returns the object responsible for painting this text area.
@ -1028,8 +1031,8 @@ public class JEditTextArea extends JComponent
{
select(selectionStart,selectionEnd);
}
public final boolean isSelectionActive()
{
return(selectionStart != selectionEnd);

View File

@ -30,6 +30,8 @@ implements TabExpander, Printable
{
/** True if inside printing, will handle disabling the highlight */
boolean printing;
/** Current setting for editor.antialias preference */
boolean antialias;
/**
* Creates a new repaint manager. This should be not be called
@ -54,6 +56,8 @@ implements TabExpander, Printable
setForeground(defaults.fgcolor);
setBackground(defaults.bgcolor);
antialias = Preferences.getBoolean("editor.antialias");
blockCaret = defaults.blockCaret;
styles = defaults.styles;
cols = defaults.cols;
@ -73,10 +77,10 @@ implements TabExpander, Printable
* Returns if this component can be traversed by pressing the
* Tab key. This returns false.
*/
public final boolean isManagingFocus()
{
return false;
}
// public final boolean isManagingFocus()
// {
// return false;
// }
/**
* Returns the syntax styles used to paint colorized text. Entry <i>n</i>
@ -366,11 +370,11 @@ implements TabExpander, Printable
*/
public void paint(Graphics gfx)
{
if (Base.isMacOS()) {
Graphics2D g2 = (Graphics2D) gfx;
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
}
Graphics2D g2 = (Graphics2D) gfx;
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
antialias ?
RenderingHints.VALUE_TEXT_ANTIALIAS_ON :
RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
tabSize = fm.charWidth(' ') * ((Integer)textArea.getDocument().getProperty(PlainDocument.tabSizeAttribute)).intValue();

View File

@ -3,13 +3,14 @@
/*
Part of the Processing project - http://processing.org
Copyright (c) 2005-06 Ben Fry and Casey Reas
Copyright (c) 2003 Martin Gomez, Ateneo de Manila University
Original Copyright (c) 1997, 1998 Van Di-Han HO. All Rights Reserved.
Updates Copyright (c) 2001 Jason Pell.
Further updates Copyright (c) 2003 Martin Gomez, Ateneo de Manila University
Bug fixes Copyright (c) 2005-09 Ben Fry and Casey Reas
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
the Free Software Foundation, version 2.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -24,13 +25,21 @@
package processing.app.tools;
import processing.app.*;
import processing.core.PApplet;
import java.io.*;
/**
* Alternate handler for dealing with auto format.
* Handler for dealing with auto format.
* Contributed by Martin Gomez, additional bug fixes by Ben Fry.
*
* After some further digging, this code in fact appears to be a modified
* version of Jason Pell's GPLed "Java Beautifier" class found here:
* http://www.geocities.com/jasonpell/programs.html
* Which is itself based on code from Van Di-Han Ho:
* http://www.geocities.com/~starkville/vancbj_idx.html
* [Ben Fry, August 2009]
*/
public class AutoFormat implements Tool {
Editor editor;
@ -38,15 +47,12 @@ public class AutoFormat implements Tool {
static final int BLOCK_MAXLEN = 1024;
StringBuffer strOut;
//String formattedText;
int indentValue;
String indentChar;
//String uhOh = null;
//String theStuff;
int EOF;
BufferedInputStream bin = null;
int nBytesRead, indexBlock, lineLength, lineNumber;
byte bArray[];
CharArrayReader reader;
int readCount, indexBlock, lineLength, lineNumber;
char chars[];
String strBlock;
int s_level[];
int c_level;
@ -64,23 +70,17 @@ public class AutoFormat implements Tool {
String w_if_, w_else, w_for, w_ds, w_case, w_cpp_comment, w_jdoc;
int jdoc, j;
char string[];
byte bstring[];
byte bblank;
char cc;
int s_flg, b_flg;
int s_flg;
int peek;
char peekc;
int tabs;
char next_char, last_char;
char lastc0, lastc1;
char c, c0;
char w_kptr;
char last_char;
char c;
String line_feed;
//static int outfil; // temporary
public void init(Editor editor) {
this.editor = editor;
}
@ -236,6 +236,7 @@ public class AutoFormat implements Tool {
}
}
public void cpp_comment() throws IOException
{
c = getchr();
@ -283,32 +284,26 @@ public class AutoFormat implements Tool {
indexBlock++;
if (indexBlock >= lineLength)
{
for (int ib=0; ib<nBytesRead; ib++) bArray[ib] = '\0';
for (int ib=0; ib<readCount; ib++) chars[ib] = '\0';
lineLength = nBytesRead = 0;
//try /* to get the next block */
//{
if (bin.available() > 0)
{
nBytesRead = bin.read(bArray);
lineLength = nBytesRead;
strBlock = new String(bArray);
indexBlock = 0;
last_char = strBlock.charAt(indexBlock);
peek = -1;
peekc = '`';
}
else
{
//System.out.println("eof a");
EOF = 1;
peekc = '\0';
}
//}
//catch(IOException ioe)
//{
//System.out.println(ioe.toString());
//}
lineLength = readCount = 0;
reader.mark(1);
if (reader.read() != -1)
{
reader.reset(); // back to the mark
readCount = reader.read(chars);
lineLength = readCount;
strBlock = new String(chars);
indexBlock = 0;
last_char = strBlock.charAt(indexBlock);
peek = -1;
peekc = '`';
}
else
{
EOF = 1;
peekc = '\0';
}
}
else
{
@ -446,13 +441,11 @@ public class AutoFormat implements Tool {
indentChar = new String(" ");
lineNumber = 0;
//BLOCK_MAXLEN = 256;
c_level = if_lev = level = e_flg = paren = 0;
a_flg = q_flg = j = b_flg = tabs = 0;
a_flg = q_flg = j = tabs = 0;
if_flg = peek = -1;
peekc = '`';
s_flg = 1;
bblank = ' ';
jdoc = 0;
s_level = new int[10];
@ -476,24 +469,23 @@ public class AutoFormat implements Tool {
// read as long as there is something to read
EOF = 0; // = 1 set in getchr when EOF
bArray = new byte[BLOCK_MAXLEN];
chars = new char[BLOCK_MAXLEN];
string = new char[BLOCK_MAXLEN];
try { // the whole process
// open for input
ByteArrayInputStream in =
new ByteArrayInputStream(originalText.getBytes());
reader = new CharArrayReader(originalText.toCharArray());
// add buffering to that InputStream
bin = new BufferedInputStream(in);
// bin = new BufferedInputStream(in);
for (int ib = 0; ib < BLOCK_MAXLEN; ib++) bArray[ib] = '\0';
for (int ib = 0; ib < BLOCK_MAXLEN; ib++) chars[ib] = '\0';
lineLength = nBytesRead = 0;
lineLength = readCount = 0;
// read up a block - remember how many bytes read
nBytesRead = bin.read(bArray);
strBlock = new String(bArray);
readCount = reader.read(chars);
strBlock = new String(chars);
lineLength = nBytesRead;
lineLength = readCount;
lineNumber = 1;
indexBlock = -1;
j = 0;
@ -561,6 +553,10 @@ public class AutoFormat implements Tool {
case '{':
if(lookup(w_else) == 1)gotelse();
if (s_if_lev.length == c_level) {
s_if_lev = PApplet.expand(s_if_lev);
s_if_flg = PApplet.expand(s_if_flg);
}
s_if_lev[c_level] = if_lev;
s_if_flg[c_level] = if_flg;
if_lev = if_flg = 0;
@ -736,7 +732,6 @@ public class AutoFormat implements Tool {
peekc = getchr();
if(peekc == ';')
{
//fprintf(outfil,";");
fprintf(";");
peek = -1;
peekc = '`';
@ -747,13 +742,11 @@ public class AutoFormat implements Tool {
}
getnl();
indent_puts();
//fprintf(outfil,"\n");
fprintf("\n");
s_flg = 1;
break;
case '/':
c0 = string[j];
string[j++] = c;
peekc = getchr();
@ -912,7 +905,7 @@ public class AutoFormat implements Tool {
selectionEnd = strOut.length() - 1;
}
bin.close(); // close buff
reader.close(); // close buff
String formattedText = strOut.toString();
if (formattedText.equals(originalText)) {

View File

@ -7,6 +7,13 @@ if [ $1 ]
then
RELEASE=$1
echo Creating Arduino release $RELEASE...
INFO_SOUGHT="<string>$RELEASE,"
INFO_FOUND=`cat ./dist/Arduino.app/Contents/Info.plist | grep $INFO_SOUGHT`
if [ -z "$INFO_FOUND" ]
then
echo Fix the version number in Info.plist
exit
fi
else
RELEASE=$REVISION
echo Creating Arduino distribution for revision $REVISION...

View File

@ -1,5 +1,22 @@
#!/bin/sh
# http://dev.processing.org/bugs/show_bug.cgi?id=1179
OSX_VERSION=`sw_vers | grep ProductVersion | awk '{print $2}' | awk '{print substr($0,1,4)}'`
if [ "$OSX_VERSION" = "10.4" ]
then
echo "This script uses the -X option for cp (to disable resource forks),"
echo "which is not supported on OS X 10.4. Please either upgrade to 10.5,"
echo "or modify this script to remove use of the -X switch to continue."
# and you will also need to remove this error message
exit
else
if [ "$OSX_VERSION" != "10.6" ]
then
echo "Note: This script has not been tested on this "
echo "release of Mac OS and may cause errors."
fi
fi
### -- SETUP WORK DIR -------------------------------------------
@ -27,7 +44,7 @@ else
cp -rX ../shared/lib "$RESOURCES/"
cp -rX ../shared/libraries "$RESOURCES/"
cp -rX ../shared/tools "$RESOURCES/"
cp -rX ../../hardware "$RESOURCES/"
cp -X ../../app/lib/antlr.jar "$RESOURCES/"
@ -41,7 +58,7 @@ else
echo Extracting reference...
unzip -q -d "$RESOURCES/" ../shared/reference.zip
echo Extracting avr tools...
unzip -q -d "$RESOURCES/hardware" dist/tools-universal.zip
fi
@ -115,4 +132,4 @@ cd ../..
echo
echo Done.
echo Done.

View File

@ -1,3 +1,188 @@
PROCESSING 1.0.7 (REV 0169) - 4 September 2009
Bug fixes and updates, also some tweaks for Mac OS X Snow Leopard.
[ changes ]
+ Tweaks for Mac OS X Snow Leopard, to force it to run in 32-bit mode.
This should bring back the video library (if temporarily), and hopefully
fix serial as well, though I didn't have a serial device handy to test.
+ Fix problem where line highlighting was off in 'static' mode.
http://dev.processing.org/bugs/show_bug.cgi?id=1263
+ Auto-format was killing Unicode characters (how did this last so long?)
http://dev.processing.org/bugs/show_bug.cgi?id=1312
+ PVector.angleDistance() returning NaN due to precision errors
http://dev.processing.org/bugs/show_bug.cgi?id=1316
+ Removed a major try/catch block from PApplet.main(), hopefully
this will allow some exception stuff to come through properly.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PROCESSING 1.0.6 (REV 0168) - 12 August 2009
Bug fixes and minor changes. Most important are replacement JOGL libraries
so that OpenGL applets won't present an "expired certificate" error.
[ bug fixes ]
+ Replaced the faulty JOGL library that had expired certificates (Sun bug).
http://dev.processing.org/bugs/show_bug.cgi?id=1271
https://jogl.dev.java.net/servlets/ProjectDocumentList?folderID=9260&expandFolder=9260&folderID=0
+ Updated the Linux launcher script that enables Processing to be run
from other directories, symlinks, or from launch items.
http://dev.processing.org/bugs/show_bug.cgi?id=825
Thanks to Ferdinand Kasper for the fix!
+ strokeWeight() was making lines 2x too thick with P2D
http://dev.processing.org/bugs/show_bug.cgi?id=1283
+ PImage.getImage() setting the wrong image type
http://dev.processing.org/bugs/show_bug.cgi?id=1282
+ image() not working with P2D, P3D, and OPENGL when noFill() used
http://dev.processing.org/bugs/show_bug.cgi?id=1299
http://dev.processing.org/bugs/show_bug.cgi?id=1222
+ Auto format problem with program deeper then 10 levels
http://dev.processing.org/bugs/show_bug.cgi?id=1297
+ Fixed a crash on startup problem (console being null)
+ Recursive subfolder copy of library folders when exporting application
http://dev.processing.org/bugs/show_bug.cgi?id=1295
[ changes ]
+ PDF member functions set protected instead of private
http://dev.processing.org/bugs/show_bug.cgi?id=1276
+ On OS X, update Info.plist to be 32/64 explicit and also updated
JavaApplicationStub for update 4.
+ Clicking the preferences location in the Preferences window will
now open the parent folder for the preferences file.
http://dev.processing.org/bugs/show_bug.cgi?id=1279
+ Update to Java 6 update 15 for the Windows and Linux releases.
[ fixed earlier ]
+ Mangled menu text with Java 6u10.
http://dev.processing.org/bugs/show_bug.cgi?id=1065
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PROCESSING 1.0.5 (REV 0167) - 7 June 2009
Bug fix release, mostly dealing with regressions from 1.0.4.
[ bug fixes ]
+ Make the tab key work again inside the editor
http://dev.processing.org/bugs/show_bug.cgi?id=1267
+ Deal with duplicate entries for sketchbook in the file menu
http://dev.processing.org/bugs/show_bug.cgi?id=1260
[ changes ]
+ Support for smooth text in the PDE editor. Set editor.antialias=true
inside preferences.txt to enable smooth text.
http://dev.processing.org/bugs/show_bug.cgi?id=1266
+ Updated reference files.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PROCESSING 1.0.4 (REV 0166) - 31 May 2009
Bug fix release.
[ changes ]
+ Changed the workaround for Apple's Java bug related to the menus in OS X.
Rather than placing the menubar inside the sketch window, File > Sketchbook
and File > Examples are simply dimmed out. Instead, use the Open button
on the toolbar, which provides access to the same items. The preference
to place the menu bar inside the window is still available, in case you
prefer the previous workaround.
http://dev.processing.org/bugs/show_bug.cgi?id=786
+ Also updated the included runtime on Windows and Linux to Java 6u14.
[ bug fixes ]
+ Fixed IDE crash when changing color scheme on windows
http://dev.processing.org/bugs/show_bug.cgi?id=1237
+ Typo in the Linux shell script was preventing it from running
http://dev.processing.org/bugs/show_bug.cgi?id=1250
+ OS X finder info on application updated to say 1.0.4
http://dev.processing.org/bugs/show_bug.cgi?id=1226
+ Removed warning message "Non-String for 8 value in 'Properties'
sub-dictionary in 'Java' sub-dictionary of Info.plist" on OS X
+ Added warning to build script for users on OS X 10.4
http://dev.processing.org/bugs/show_bug.cgi?id=1179
+ Disable point() going to set() from PGraphicsJava2D. The set() command
doesn't honor alpha consistently, and it also causes problems with PDF
+ PImage cacheMap problem when using PImage.get()
http://dev.processing.org/bugs/show_bug.cgi?id=1245
+ Fix problems with > 512 points and P3D/OPENGL
http://dev.processing.org/bugs/show_bug.cgi?id=1255
Thanks to user DopeShow for the patch
+ imageMode(CENTER) doesn't work properly with P2D
http://dev.processing.org/bugs/show_bug.cgi?id=1232
+ Reset matrices when using beginRecord() with PDF
http://dev.processing.org/bugs/show_bug.cgi?id=1227
+ Resizing window no longer distorts OpenGL graphics
http://dev.processing.org/bugs/show_bug.cgi?id=1176
Many thanks to Pablo Funes for the patch
+ Fix significant point() and set() slowdown on OS X
http://dev.processing.org/bugs/show_bug.cgi?id=1094
[ known issues ]
+ Currently no 64-bit support for any platforms. On some platforms, you'll
simply need to replace the Java folder with the distribution with something
more suitable for your operating system.
+ Command line support is currently broken
http://dev.processing.org/bugs/show_bug.cgi?id=1048
+ Text of menus/interface elements sometimes mangled (e.g. toolbar repeats
several times, other oddness). See bug report for a workaround
http://dev.processing.org/bugs/show_bug.cgi?id=1065
+ Video library threading problems with other libraries
http://dev.processing.org/bugs/show_bug.cgi?id=882
+ See dev.processing.org/bugs for much, much more!
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PROCESSING 1.0.3 (REV 0165) - 24 February 2009
Bug fix release to repair a couple of regressions caused by changes in 1.0.2,
@ -24,6 +209,9 @@ as well as a couple other new problems encountered since.
+ Update to iText 2.1.4 for the PDF library
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PROCESSING 1.0.2 (REV 0164) - 21 February 2009
This release fixes many bugs and adds two minor functions to the XML library.

Binary file not shown.

View File

@ -1,3 +1,53 @@
0168 core (1.0.6)
X getImage() setting the wrong image type
X http://dev.processing.org/bugs/show_bug.cgi?id=1282
X strokeWeight() makes lines 2x too thick with P2D
X http://dev.processing.org/bugs/show_bug.cgi?id=1283
X image() doesn't work with P2D, P3D, and OPENGL with noFill()
X http://dev.processing.org/bugs/show_bug.cgi?id=1299
o maybe using rgb instead of tint inside drawing loops?
X http://dev.processing.org/bugs/show_bug.cgi?id=1222
0167 core (1.0.5)
X changed text layout methods from private to protected
0166 core (1.0.4)
X disable point() going to set() from PGraphicsJava2D
X set() doesn't honor alpha consistently
X also causes problems with PDF
X preliminary thread() implementation
X double param version of map()
X PImage cacheMap problem when using PImage.get()
X http://dev.processing.org/bugs/show_bug.cgi?id=1245
X problems with > 512 points and P3D/OPENGL (thx DopeShow)
X http://dev.processing.org/bugs/show_bug.cgi?id=1255
X imageMode(CENTER) doesn't work properly with P2D
X http://dev.processing.org/bugs/show_bug.cgi?id=1232
X reset matrices when using beginRecord() with PDF
X http://dev.processing.org/bugs/show_bug.cgi?id=1227
X resizing window distorts gl graphics
X patch from Pablo Funes
X http://dev.processing.org/bugs/show_bug.cgi?id=1176
X significant point() and set() slowdown on OS X
X http://dev.processing.org/bugs/show_bug.cgi?id=1094
0165 core (1.0.3)
X update to itext 2.1.4
X endRecord or endRaw produces RuntimeException with PDF library
X http://dev.processing.org/bugs/show_bug.cgi?id=1169
X problem with beginRaw/endRaw and OpenGL
X http://dev.processing.org/bugs/show_bug.cgi?id=1171
X set strokeWeight with begin/endRaw
X http://dev.processing.org/bugs/show_bug.cgi?id=1172
X fix strokeWeight with P3D (better version of line hack)
X make P3D use proper weights
X ArrayIndexOutOfBoundsException with point()
X http://dev.processing.org/bugs/show_bug.cgi?id=1168
0164 core (1.0.2)
X requestImage() causing problems with JAVA2D
X fix minor strokeWeight bug with OpenGL

View File

@ -3,13 +3,12 @@
/*
Part of the Processing project - http://processing.org
Copyright (c) 2004-08 Ben Fry and Casey Reas
Copyright (c) 2004-09 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
License as published by the Free Software Foundation, version 2.1.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -606,13 +605,13 @@ public class PApplet extends Applet
// though it's here for applications anyway
start();
}
public int getSketchWidth() {
return DEFAULT_WIDTH;
}
public int getSketchHeight() {
return DEFAULT_HEIGHT;
}
@ -621,8 +620,8 @@ public class PApplet extends Applet
public String getSketchRenderer() {
return JAVA2D;
}
/**
* Called by the browser or applet viewer to inform this applet that it
* should start its execution. It is called after the init method and
@ -825,7 +824,7 @@ public class PApplet extends Applet
meth.add(o, method);
} catch (NoSuchMethodException nsme) {
die("There is no " + name + "() method in the class " +
die("There is no public " + name + "() method in the class " +
o.getClass().getName());
} catch (Exception e) {
@ -842,7 +841,7 @@ public class PApplet extends Applet
meth.add(o, method);
} catch (NoSuchMethodException nsme) {
die("There is no " + name + "() method in the class " +
die("There is no public " + name + "() method in the class " +
o.getClass().getName());
} catch (Exception e) {
@ -1391,6 +1390,9 @@ public class PApplet extends Applet
//System.out.println("handleDraw() " + frameCount);
g.beginDraw();
if (recorder != null) {
recorder.beginDraw();
}
long now = System.nanoTime();
@ -1442,6 +1444,9 @@ public class PApplet extends Applet
}
g.endDraw();
if (recorder != null) {
recorder.endDraw();
}
frameRateLastNanos = now;
frameCount++;
@ -2233,6 +2238,76 @@ public class PApplet extends Applet
}
//////////////////////////////////////////////////////////////
public void method(String name) {
// final Object o = this;
// final Class<?> c = getClass();
try {
Method method = getClass().getMethod(name, new Class[] {});
method.invoke(this, new Object[] { });
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.getTargetException().printStackTrace();
} catch (NoSuchMethodException nsme) {
System.err.println("There is no public " + name + "() method " +
"in the class " + getClass().getName());
} catch (Exception e) {
e.printStackTrace();
}
}
public void thread(final String name) {
Thread later = new Thread() {
public void run() {
method(name);
}
};
later.start();
}
/*
public void thread(String name) {
final Object o = this;
final Class<?> c = getClass();
try {
final Method method = c.getMethod(name, new Class[] {});
Thread later = new Thread() {
public void run() {
try {
method.invoke(o, new Object[] { });
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.getTargetException().printStackTrace();
}
}
};
later.start();
} catch (NoSuchMethodException nsme) {
System.err.println("There is no " + name + "() method " +
"in the class " + getClass().getName());
} catch (Exception e) {
e.printStackTrace();
}
}
*/
//////////////////////////////////////////////////////////////
// SCREEN GRABASS
@ -2813,6 +2888,13 @@ public class PApplet extends Applet
}
static public final double map(double value,
double istart, double istop,
double ostart, double ostop) {
return ostart + (ostop - ostart) * ((value - istart) / (istop - istart));
}
//////////////////////////////////////////////////////////////
@ -4417,7 +4499,8 @@ public class PApplet extends Applet
* "data" folder. However, when exported (as application or applet),
* sketch's data folder is exported as part of the applications jar file,
* and it's not possible to read/write from the jar file in a generic way.
* If you need to read data from the jar file, you should use createInput().
* If you need to read data from the jar file, you should use other methods
* such as createInput(), createReader(), or loadStrings().
*/
public String dataPath(String where) {
// isAbsolute() could throw an access exception, but so will writing
@ -4445,8 +4528,8 @@ public class PApplet extends Applet
static public void createPath(String path) {
createPath(new File(path));
}
static public void createPath(File file) {
try {
String parent = file.getParent();
@ -4455,7 +4538,7 @@ public class PApplet extends Applet
if (!unit.exists()) unit.mkdirs();
}
} catch (SecurityException se) {
System.err.println("You don't have permissions to create " +
System.err.println("You don't have permissions to create " +
file.getAbsolutePath());
}
}
@ -5257,10 +5340,10 @@ public class PApplet extends Applet
/**
* Split a String on a specific delimiter. Unlike Java's String.split()
* Split a String on a specific delimiter. Unlike Java's String.split()
* method, this does not parse the delimiter as a regexp because it's more
* confusing than necessary, and String.split() is always available for
* those who want regexp.
* those who want regexp.
*/
static public String[] split(String what, String delim) {
ArrayList<String> items = new ArrayList<String>();
@ -6345,9 +6428,9 @@ public class PApplet extends Applet
*
* --present put the applet into full screen presentation
* mode. requires java 1.4 or later.
*
*
* --exclusive use full screen exclusive mode when presenting.
* disables new windows or interaction with other
* disables new windows or interaction with other
* monitors, this is like a "game" mode.
*
* --hide-stop use to hide the stop button in situations where
@ -6401,104 +6484,103 @@ public class PApplet extends Applet
System.exit(1);
}
boolean external = false;
int[] location = null;
int[] editorLocation = null;
String name = null;
boolean present = false;
boolean exclusive = false;
Color backgroundColor = Color.BLACK;
Color stopColor = Color.GRAY;
GraphicsDevice displayDevice = null;
boolean hideStop = false;
String param = null, value = null;
// try to get the user folder. if running under java web start,
// this may cause a security exception if the code is not signed.
// http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Integrate;action=display;num=1159386274
String folder = null;
try {
boolean external = false;
int[] location = null;
int[] editorLocation = null;
folder = System.getProperty("user.dir");
} catch (Exception e) { }
String name = null;
boolean present = false;
boolean exclusive = false;
Color backgroundColor = Color.BLACK;
Color stopColor = Color.GRAY;
GraphicsDevice displayDevice = null;
boolean hideStop = false;
int argIndex = 0;
while (argIndex < args.length) {
int equals = args[argIndex].indexOf('=');
if (equals != -1) {
param = args[argIndex].substring(0, equals);
value = args[argIndex].substring(equals + 1);
String param = null, value = null;
if (param.equals(ARGS_EDITOR_LOCATION)) {
external = true;
editorLocation = parseInt(split(value, ','));
// try to get the user folder. if running under java web start,
// this may cause a security exception if the code is not signed.
// http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Integrate;action=display;num=1159386274
String folder = null;
try {
folder = System.getProperty("user.dir");
} catch (Exception e) { }
} else if (param.equals(ARGS_DISPLAY)) {
int deviceIndex = Integer.parseInt(value) - 1;
int argIndex = 0;
while (argIndex < args.length) {
int equals = args[argIndex].indexOf('=');
if (equals != -1) {
param = args[argIndex].substring(0, equals);
value = args[argIndex].substring(equals + 1);
//DisplayMode dm = device.getDisplayMode();
//if ((dm.getWidth() == 1024) && (dm.getHeight() == 768)) {
if (param.equals(ARGS_EDITOR_LOCATION)) {
external = true;
editorLocation = parseInt(split(value, ','));
} else if (param.equals(ARGS_DISPLAY)) {
int deviceIndex = Integer.parseInt(value) - 1;
//DisplayMode dm = device.getDisplayMode();
//if ((dm.getWidth() == 1024) && (dm.getHeight() == 768)) {
GraphicsEnvironment environment =
GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice devices[] = environment.getScreenDevices();
if ((deviceIndex >= 0) && (deviceIndex < devices.length)) {
displayDevice = devices[deviceIndex];
} else {
System.err.println("Display " + value + " does not exist, " +
"using the default display instead.");
}
} else if (param.equals(ARGS_BGCOLOR)) {
if (value.charAt(0) == '#') value = value.substring(1);
backgroundColor = new Color(Integer.parseInt(value, 16));
} else if (param.equals(ARGS_STOP_COLOR)) {
if (value.charAt(0) == '#') value = value.substring(1);
stopColor = new Color(Integer.parseInt(value, 16));
} else if (param.equals(ARGS_SKETCH_FOLDER)) {
folder = value;
} else if (param.equals(ARGS_LOCATION)) {
location = parseInt(split(value, ','));
GraphicsEnvironment environment =
GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice devices[] = environment.getScreenDevices();
if ((deviceIndex >= 0) && (deviceIndex < devices.length)) {
displayDevice = devices[deviceIndex];
} else {
System.err.println("Display " + value + " does not exist, " +
"using the default display instead.");
}
} else if (param.equals(ARGS_BGCOLOR)) {
if (value.charAt(0) == '#') value = value.substring(1);
backgroundColor = new Color(Integer.parseInt(value, 16));
} else if (param.equals(ARGS_STOP_COLOR)) {
if (value.charAt(0) == '#') value = value.substring(1);
stopColor = new Color(Integer.parseInt(value, 16));
} else if (param.equals(ARGS_SKETCH_FOLDER)) {
folder = value;
} else if (param.equals(ARGS_LOCATION)) {
location = parseInt(split(value, ','));
}
} else {
if (args[argIndex].equals(ARGS_PRESENT)) {
present = true;
} else if (args[argIndex].equals(ARGS_EXCLUSIVE)) {
exclusive = true;
} else if (args[argIndex].equals(ARGS_HIDE_STOP)) {
hideStop = true;
} else if (args[argIndex].equals(ARGS_EXTERNAL)) {
external = true;
} else {
if (args[argIndex].equals(ARGS_PRESENT)) {
present = true;
} else if (args[argIndex].equals(ARGS_EXCLUSIVE)) {
exclusive = true;
} else if (args[argIndex].equals(ARGS_HIDE_STOP)) {
hideStop = true;
} else if (args[argIndex].equals(ARGS_EXTERNAL)) {
external = true;
} else {
name = args[argIndex];
break;
}
name = args[argIndex];
break;
}
argIndex++;
}
argIndex++;
}
// Set this property before getting into any GUI init code
//System.setProperty("com.apple.mrj.application.apple.menu.about.name", name);
// This )*)(*@#$ Apple crap don't work no matter where you put it
// (static method of the class, at the top of main, wherever)
// Set this property before getting into any GUI init code
//System.setProperty("com.apple.mrj.application.apple.menu.about.name", name);
// This )*)(*@#$ Apple crap don't work no matter where you put it
// (static method of the class, at the top of main, wherever)
if (displayDevice == null) {
GraphicsEnvironment environment =
GraphicsEnvironment.getLocalGraphicsEnvironment();
displayDevice = environment.getDefaultScreenDevice();
}
if (displayDevice == null) {
GraphicsEnvironment environment =
GraphicsEnvironment.getLocalGraphicsEnvironment();
displayDevice = environment.getDefaultScreenDevice();
}
Frame frame = new Frame(displayDevice.getDefaultConfiguration());
Frame frame = new Frame(displayDevice.getDefaultConfiguration());
/*
Frame frame = null;
if (displayDevice != null) {
@ -6509,195 +6591,191 @@ public class PApplet extends Applet
*/
//Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
// remove the grow box by default
// users who want it back can call frame.setResizable(true)
frame.setResizable(false);
// remove the grow box by default
// users who want it back can call frame.setResizable(true)
frame.setResizable(false);
// Set the trimmings around the image
Image image = Toolkit.getDefaultToolkit().createImage(ICON_IMAGE);
frame.setIconImage(image);
frame.setTitle(name);
// Set the trimmings around the image
Image image = Toolkit.getDefaultToolkit().createImage(ICON_IMAGE);
frame.setIconImage(image);
frame.setTitle(name);
// Class c = Class.forName(name);
final PApplet applet;
try {
Class<?> c = Thread.currentThread().getContextClassLoader().loadClass(name);
final PApplet applet = (PApplet) c.newInstance();
// these are needed before init/start
applet.frame = frame;
applet.sketchPath = folder;
applet.args = PApplet.subset(args, 1);
applet.external = external;
// Need to save the window bounds at full screen,
// because pack() will cause the bounds to go to zero.
// http://dev.processing.org/bugs/show_bug.cgi?id=923
Rectangle fullScreenRect = null;
// For 0149, moving this code (up to the pack() method) before init().
// For OpenGL (and perhaps other renderers in the future), a peer is
// needed before a GLDrawable can be created. So pack() needs to be
// called on the Frame before applet.init(), which itself calls size(),
// and launches the Thread that will kick off setup().
// http://dev.processing.org/bugs/show_bug.cgi?id=891
// http://dev.processing.org/bugs/show_bug.cgi?id=908
if (present) {
frame.setUndecorated(true);
frame.setBackground(backgroundColor);
if (exclusive) {
displayDevice.setFullScreenWindow(frame);
fullScreenRect = frame.getBounds();
} else {
DisplayMode mode = displayDevice.getDisplayMode();
fullScreenRect = new Rectangle(0, 0, mode.getWidth(), mode.getHeight());
frame.setBounds(fullScreenRect);
frame.setVisible(true);
}
}
frame.setLayout(null);
frame.add(applet);
if (present) {
frame.invalidate();
} else {
frame.pack();
}
// insufficient, places the 100x100 sketches offset strangely
//frame.validate();
applet.init();
// Wait until the applet has figured out its width.
// In a static mode app, this will be after setup() has completed,
// and the empty draw() has set "finished" to true.
// TODO make sure this won't hang if the applet has an exception.
while (applet.defaultSize && !applet.finished) {
//System.out.println("default size");
try {
Thread.sleep(5);
} catch (InterruptedException e) {
//System.out.println("interrupt");
}
}
//println("not default size " + applet.width + " " + applet.height);
//println(" (g width/height is " + applet.g.width + "x" + applet.g.height + ")");
if (present) {
// After the pack(), the screen bounds are gonna be 0s
frame.setBounds(fullScreenRect);
applet.setBounds((fullScreenRect.width - applet.width) / 2,
(fullScreenRect.height - applet.height) / 2,
applet.width, applet.height);
if (!hideStop) {
Label label = new Label("stop");
label.setForeground(stopColor);
label.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
System.exit(0);
}
});
frame.add(label);
Dimension labelSize = label.getPreferredSize();
// sometimes shows up truncated on mac
//System.out.println("label width is " + labelSize.width);
labelSize = new Dimension(100, labelSize.height);
label.setSize(labelSize);
label.setLocation(20, fullScreenRect.height - labelSize.height - 20);
}
// not always running externally when in present mode
if (external) {
applet.setupExternalMessages();
}
} else { // if not presenting
// can't do pack earlier cuz present mode don't like it
// (can't go full screen with a frame after calling pack)
// frame.pack(); // get insets. get more.
Insets insets = frame.getInsets();
int windowW = Math.max(applet.width, MIN_WINDOW_WIDTH) +
insets.left + insets.right;
int windowH = Math.max(applet.height, MIN_WINDOW_HEIGHT) +
insets.top + insets.bottom;
frame.setSize(windowW, windowH);
if (location != null) {
// a specific location was received from PdeRuntime
// (applet has been run more than once, user placed window)
frame.setLocation(location[0], location[1]);
} else if (external) {
int locationX = editorLocation[0] - 20;
int locationY = editorLocation[1];
if (locationX - windowW > 10) {
// if it fits to the left of the window
frame.setLocation(locationX - windowW, locationY);
} else { // doesn't fit
// if it fits inside the editor window,
// offset slightly from upper lefthand corner
// so that it's plunked inside the text area
locationX = editorLocation[0] + 66;
locationY = editorLocation[1] + 66;
if ((locationX + windowW > applet.screen.width - 33) ||
(locationY + windowH > applet.screen.height - 33)) {
// otherwise center on screen
locationX = (applet.screen.width - windowW) / 2;
locationY = (applet.screen.height - windowH) / 2;
}
frame.setLocation(locationX, locationY);
}
} else { // just center on screen
frame.setLocation((applet.screen.width - applet.width) / 2,
(applet.screen.height - applet.height) / 2);
}
// frame.setLayout(null);
// frame.add(applet);
if (backgroundColor == Color.black) { //BLACK) {
// this means no bg color unless specified
backgroundColor = SystemColor.control;
}
frame.setBackground(backgroundColor);
int usableWindowH = windowH - insets.top - insets.bottom;
applet.setBounds((windowW - applet.width)/2,
insets.top + (usableWindowH - applet.height)/2,
applet.width, applet.height);
if (external) {
applet.setupExternalMessages();
} else { // !external
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
// handle frame resizing events
applet.setupFrameResizeListener();
// all set for rockin
if (applet.displayable()) {
frame.setVisible(true);
}
}
applet.requestFocus(); // ask for keydowns
//System.out.println("exiting main()");
applet = (PApplet) c.newInstance();
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
throw new RuntimeException(e);
}
// these are needed before init/start
applet.frame = frame;
applet.sketchPath = folder;
applet.args = PApplet.subset(args, 1);
applet.external = external;
// Need to save the window bounds at full screen,
// because pack() will cause the bounds to go to zero.
// http://dev.processing.org/bugs/show_bug.cgi?id=923
Rectangle fullScreenRect = null;
// For 0149, moving this code (up to the pack() method) before init().
// For OpenGL (and perhaps other renderers in the future), a peer is
// needed before a GLDrawable can be created. So pack() needs to be
// called on the Frame before applet.init(), which itself calls size(),
// and launches the Thread that will kick off setup().
// http://dev.processing.org/bugs/show_bug.cgi?id=891
// http://dev.processing.org/bugs/show_bug.cgi?id=908
if (present) {
frame.setUndecorated(true);
frame.setBackground(backgroundColor);
if (exclusive) {
displayDevice.setFullScreenWindow(frame);
fullScreenRect = frame.getBounds();
} else {
DisplayMode mode = displayDevice.getDisplayMode();
fullScreenRect = new Rectangle(0, 0, mode.getWidth(), mode.getHeight());
frame.setBounds(fullScreenRect);
frame.setVisible(true);
}
}
frame.setLayout(null);
frame.add(applet);
if (present) {
frame.invalidate();
} else {
frame.pack();
}
// insufficient, places the 100x100 sketches offset strangely
//frame.validate();
applet.init();
// Wait until the applet has figured out its width.
// In a static mode app, this will be after setup() has completed,
// and the empty draw() has set "finished" to true.
// TODO make sure this won't hang if the applet has an exception.
while (applet.defaultSize && !applet.finished) {
//System.out.println("default size");
try {
Thread.sleep(5);
} catch (InterruptedException e) {
//System.out.println("interrupt");
}
}
//println("not default size " + applet.width + " " + applet.height);
//println(" (g width/height is " + applet.g.width + "x" + applet.g.height + ")");
if (present) {
// After the pack(), the screen bounds are gonna be 0s
frame.setBounds(fullScreenRect);
applet.setBounds((fullScreenRect.width - applet.width) / 2,
(fullScreenRect.height - applet.height) / 2,
applet.width, applet.height);
if (!hideStop) {
Label label = new Label("stop");
label.setForeground(stopColor);
label.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
System.exit(0);
}
});
frame.add(label);
Dimension labelSize = label.getPreferredSize();
// sometimes shows up truncated on mac
//System.out.println("label width is " + labelSize.width);
labelSize = new Dimension(100, labelSize.height);
label.setSize(labelSize);
label.setLocation(20, fullScreenRect.height - labelSize.height - 20);
}
// not always running externally when in present mode
if (external) {
applet.setupExternalMessages();
}
} else { // if not presenting
// can't do pack earlier cuz present mode don't like it
// (can't go full screen with a frame after calling pack)
// frame.pack(); // get insets. get more.
Insets insets = frame.getInsets();
int windowW = Math.max(applet.width, MIN_WINDOW_WIDTH) +
insets.left + insets.right;
int windowH = Math.max(applet.height, MIN_WINDOW_HEIGHT) +
insets.top + insets.bottom;
frame.setSize(windowW, windowH);
if (location != null) {
// a specific location was received from PdeRuntime
// (applet has been run more than once, user placed window)
frame.setLocation(location[0], location[1]);
} else if (external) {
int locationX = editorLocation[0] - 20;
int locationY = editorLocation[1];
if (locationX - windowW > 10) {
// if it fits to the left of the window
frame.setLocation(locationX - windowW, locationY);
} else { // doesn't fit
// if it fits inside the editor window,
// offset slightly from upper lefthand corner
// so that it's plunked inside the text area
locationX = editorLocation[0] + 66;
locationY = editorLocation[1] + 66;
if ((locationX + windowW > applet.screen.width - 33) ||
(locationY + windowH > applet.screen.height - 33)) {
// otherwise center on screen
locationX = (applet.screen.width - windowW) / 2;
locationY = (applet.screen.height - windowH) / 2;
}
frame.setLocation(locationX, locationY);
}
} else { // just center on screen
frame.setLocation((applet.screen.width - applet.width) / 2,
(applet.screen.height - applet.height) / 2);
}
if (backgroundColor == Color.black) { //BLACK) {
// this means no bg color unless specified
backgroundColor = SystemColor.control;
}
frame.setBackground(backgroundColor);
int usableWindowH = windowH - insets.top - insets.bottom;
applet.setBounds((windowW - applet.width)/2,
insets.top + (usableWindowH - applet.height)/2,
applet.width, applet.height);
if (external) {
applet.setupExternalMessages();
} else { // !external
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
// handle frame resizing events
applet.setupFrameResizeListener();
// all set for rockin
if (applet.displayable()) {
frame.setVisible(true);
}
}
applet.requestFocus(); // ask for keydowns
//System.out.println("exiting main()");
}
@ -7225,6 +7303,11 @@ public class PApplet extends Applet
}
public float textWidth(char[] chars, int start, int length) {
return g.textWidth(chars, start, length);
}
public void text(char c) {
if (recorder != null) recorder.text(c);
g.text(c);

View File

@ -2604,6 +2604,14 @@ public class PGraphics extends PImage implements PConstants {
}
/**
* TODO not sure if this stays...
*/
public float textWidth(char[] chars, int start, int length) {
return textWidthImpl(chars, start, start + length);
}
/**
* Implementation of returning the text width of
* the chars [start, stop) in the buffer.
@ -2914,8 +2922,8 @@ public class PGraphics extends PImage implements PConstants {
* Emit a sentence of text, defined as a chunk of text without any newlines.
* @param stop non-inclusive, the end of the text in question
*/
private boolean textSentence(char[] buffer, int start, int stop,
float boxWidth, float spaceWidth) {
protected boolean textSentence(char[] buffer, int start, int stop,
float boxWidth, float spaceWidth) {
float runningX = 0;
// Keep track of this separately from index, since we'll need to back up
@ -2980,7 +2988,7 @@ public class PGraphics extends PImage implements PConstants {
}
private void textSentenceBreak(int start, int stop) {
protected void textSentenceBreak(int start, int stop) {
if (textBreakCount == textBreakStart.length) {
textBreakStart = PApplet.expand(textBreakStart);
textBreakStop = PApplet.expand(textBreakStop);

View File

@ -283,9 +283,9 @@ public class PGraphics2D extends PGraphics {
case TRIANGLE_FAN:
// do fill and stroke separately because otherwise
// the lines will be stroked more than necessary
if (fill) {
if (fill || textureImage != null) {
fpolygon.vertexCount = 3;
for (int i = 1; i < vertexCount-1; i++) {
// System.out.println(i + " of " + vertexCount);
@ -311,7 +311,7 @@ public class PGraphics2D extends PGraphics {
fpolygon.vertices[j][TX] = vertices[i+j][TX];
fpolygon.vertices[j][TY] = vertices[i+j][TY];
// System.out.println(fpolygon.vertices[j][TX] + " " + fpolygon.vertices[j][TY]);
if (textureImage != null) {
@ -342,7 +342,7 @@ public class PGraphics2D extends PGraphics {
increment = (shape == TRIANGLES) ? 3 : 1;
// do fill and stroke separately because otherwise
// the lines will be stroked more than necessary
if (fill) {
if (fill || textureImage != null) {
fpolygon.vertexCount = 3;
for (int i = 0; i < vertexCount-2; i += increment) {
for (int j = 0; j < 3; j++) {
@ -379,7 +379,7 @@ public class PGraphics2D extends PGraphics {
break;
case QUADS:
if (fill) {
if (fill || textureImage != null) {
fpolygon.vertexCount = 4;
for (int i = 0; i < vertexCount-3; i += 4) {
for (int j = 0; j < 4; j++) {
@ -412,14 +412,14 @@ public class PGraphics2D extends PGraphics {
break;
case QUAD_STRIP:
if (fill) {
if (fill || textureImage != null) {
fpolygon.vertexCount = 4;
for (int i = 0; i < vertexCount-3; i += 2) {
for (int j = 0; j < 4; j++) {
int jj = i+j;
if (j == 2) jj = i+3; // swap 2nd and 3rd vertex
if (j == 3) jj = i+2;
fpolygon.vertices[j][R] = vertices[jj][R];
fpolygon.vertices[j][G] = vertices[jj][G];
fpolygon.vertices[j][B] = vertices[jj][B];
@ -445,7 +445,7 @@ public class PGraphics2D extends PGraphics {
case POLYGON:
if (isConvex()) {
if (fill) {
if (fill || textureImage != null) {
//System.out.println("convex");
fpolygon.renderPolygon(vertices, vertexCount);
//if (stroke) polygon.unexpand();
@ -463,7 +463,7 @@ public class PGraphics2D extends PGraphics {
}
} else { // not convex
//System.out.println("concave");
if (fill) {
if (fill || textureImage != null) {
// the triangulator produces polygons that don't align
// when smoothing is enabled. but if there is a stroke around
// the polygon, then smoothing can be temporarily disabled.
@ -1041,14 +1041,14 @@ public class PGraphics2D extends PGraphics {
protected void ellipseImpl(float x, float y, float w, float h) {
if (smooth || (strokeWeight != 1) ||
fillAlpha || strokeAlpha || ctm.isWarped()) {
// identical to PGraphics version, but uses POLYGON
// identical to PGraphics version, but uses POLYGON
// for the fill instead of a TRIANGLE_FAN
float radiusH = w / 2;
float radiusV = h / 2;
float centerX = x + radiusH;
float centerY = y + radiusV;
float sx1 = screenX(x, y);
float sy1 = screenY(x, y);
float sx2 = screenX(x+w, y+h);
@ -1423,11 +1423,6 @@ public class PGraphics2D extends PGraphics {
*/
private void simple_image(PImage image, int sx1, int sy1,
int ix1, int iy1, int ix2, int iy2) {
if (imageMode == CENTER) {
sx1 -= image.width / 2;
sy1 -= image.height / 2;
}
int sx2 = sx1 + image.width;
int sy2 = sy1 + image.height;
@ -1703,7 +1698,7 @@ public class PGraphics2D extends PGraphics {
float len = (float) Math.sqrt(dX*dX + dY*dY);
// TODO stroke width should be transformed!
float rh = strokeWeight / len;
float rh = (strokeWeight / len) / 2;
float dx0 = rh * dY;
float dy0 = rh * dX;
@ -1765,7 +1760,7 @@ public class PGraphics2D extends PGraphics {
}
}
/**
* @param max is what to count to
* @param offset is offset to the 'next' vertex
@ -2018,7 +2013,7 @@ public class PGraphics2D extends PGraphics {
public float screenY(float x, float y) {
return ctm.m10 * x + ctm.m11 * y + ctm.m12;
}
//////////////////////////////////////////////////////////////

View File

@ -608,7 +608,7 @@ public class PGraphics3D extends PGraphics {
endShapeStroke(mode);
}
if (fill) {
if (fill || textureImage != null) {
endShapeFill();
}
@ -622,7 +622,7 @@ public class PGraphics3D extends PGraphics {
// render shape and fill here if not saving the shapes for later
// if true, the shapes will be rendered on endDraw
if (!hints[ENABLE_DEPTH_SORT]) {
if (fill) {
if (fill || textureImage != null) {
if (triangleCount > 0) {
renderTriangles(0, triangleCount);
if (raw != null) {
@ -957,8 +957,8 @@ public class PGraphics3D extends PGraphics {
protected void addPoint(int a) {
if (pointCount == points.length) {
int[][] temp = new int[pointCount << 1][LINE_FIELD_COUNT];
System.arraycopy(lines, 0, temp, 0, lineCount);
lines = temp;
System.arraycopy(points, 0, temp, 0, lineCount);
points = temp;
}
points[pointCount][VERTEX1] = a;
//points[pointCount][STROKE_MODE] = strokeCap | strokeJoin;
@ -1135,12 +1135,12 @@ public class PGraphics3D extends PGraphics {
protected void renderLines(int start, int stop) {
for (int i = start; i < stop; i++) {
renderLineVertices(vertices[lines[i][VERTEX1]],
renderLineVertices(vertices[lines[i][VERTEX1]],
vertices[lines[i][VERTEX2]]);
}
}
protected void renderLineVertices(float[] a, float[] b) {
// 2D hack added by ewjordan 6/13/07
// Offset coordinates by a little bit if drawing 2D graphics.
@ -1181,7 +1181,7 @@ public class PGraphics3D extends PGraphics {
float oy2 = b[TY];
// TODO strokeWeight should be transformed!
float weight = a[SW] / 2;
float weight = a[SW] / 2;
// when drawing points with stroke weight, need to extend a bit
if (ox1 == ox2 && oy1 == oy2) {
@ -2615,8 +2615,8 @@ public class PGraphics3D extends PGraphics {
//public void ellipse(float a, float b, float c, float d)
protected void ellipseImpl(float x, float y, float w, float h) {
float radiusH = w / 2;
float radiusV = h / 2;
@ -2632,7 +2632,7 @@ public class PGraphics3D extends PGraphics {
// returning to pre-1.0 version of algorithm because of problems
int rough = (int)(4+Math.sqrt(w+h)*3);
int accuracy = PApplet.constrain(rough, 6, 100);
if (fill) {
// returning to pre-1.0 version of algorithm because of problems
// int rough = (int)(4+Math.sqrt(w+h)*3);
@ -2755,7 +2755,7 @@ public class PGraphics3D extends PGraphics {
}
}
//////////////////////////////////////////////////////////////

File diff suppressed because it is too large Load Diff

View File

@ -203,7 +203,7 @@ public class PImage implements PConstants, Cloneable {
public java.awt.Image getImage() {
loadPixels();
int type = (format == RGB) ?
BufferedImage.TYPE_INT_ARGB : BufferedImage.TYPE_INT_RGB;
BufferedImage.TYPE_INT_RGB : BufferedImage.TYPE_INT_ARGB;
BufferedImage image = new BufferedImage(width, height, type);
WritableRaster wr = image.getRaster();
wr.setDataElements(0, 0, width, height, pixels);
@ -499,7 +499,11 @@ public class PImage implements PConstants, Cloneable {
*/
public PImage get() {
try {
return (PImage) clone();
PImage clone = (PImage) clone();
// don't want to pass this down to the others
// http://dev.processing.org/bugs/show_bug.cgi?id=1245
clone.cacheMap = null;
return clone;
} catch (CloneNotSupportedException e) {
return null;
}

View File

@ -529,9 +529,10 @@ public class PVector {
* @return the angle between the vectors
*/
static public float angleBetween(PVector v1, PVector v2) {
float dot = v1.dot(v2);
float theta = (float) Math.acos(dot / (v1.mag() * v2.mag()));
return theta;
double dot = v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
double v1mag = Math.sqrt(v1.x * v1.x + v1.y * v1.y + v1.z * v1.z);
double v2mag = Math.sqrt(v2.x * v2.x + v2.y * v2.y + v2.z * v2.z);
return (float) Math.acos(dot / (v1mag * v2mag));
}

View File

@ -1335,6 +1335,11 @@ public class XMLElement implements Serializable {
}
public String toString() {
return toString(true);
}
public String toString(boolean pretty) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputStreamWriter osw = new OutputStreamWriter(baos);

View File

@ -1,24 +1,58 @@
0165 core (1.0.3)
X update to itext 2.1.4
X endRecord or endRaw produces RuntimeException with PDF library
X http://dev.processing.org/bugs/show_bug.cgi?id=1169
X problem with beginRaw/endRaw and OpenGL
X http://dev.processing.org/bugs/show_bug.cgi?id=1171
X set strokeWeight with begin/endRaw
X http://dev.processing.org/bugs/show_bug.cgi?id=1172
X fix strokeWeight with P3D (better version of line hack)
X make P3D use proper weights
X ArrayIndexOutOfBoundsException with point()
X http://dev.processing.org/bugs/show_bug.cgi?id=1168
0169 core
X remove major try/catch block from PApplet.main()
X hopefully will allow some exception stuff to come through properly
X PVector.angleDistance() returns NaN
X http://dev.processing.org/bugs/show_bug.cgi?id=1316
_ make the index lookup use numbers up to 256?
_ decide whether to keep:
_ public float textWidth(char[] chars, int start, int length)
_ textAlign(JUSTIFY) (with implementation)
_ http://dev.processing.org/bugs/show_bug.cgi?id=1309
_ create characters on the fly when createFont() is used
_ Semitransparent rect drawn over image not rendered correctly
_ http://dev.processing.org/bugs/show_bug.cgi?id=1280
_ should map() actually constrain to the low and high values?
_ file chooser fails with opengl on linux
_ http://dev.processing.org/bugs/show_bug.cgi?id=1221
_ resizing opengl destroys context and textures
_ http://dev.processing.org/bugs/show_bug.cgi?id=1176
_ what's the difference with ascent on loadFont vs. createFont?
_ noCursor() doesn't work in present mode
_ http://dev.processing.org/bugs/show_bug.cgi?id=1177
_ modelx/y/z broken when aiming a camera
_ http://dev.processing.org/bugs/show_bug.cgi?id=1074
_ in P2D, two vertex() line calls with fill() causes duplicate output
_ works fine in other renderers, has to do with tesselation
_ http://dev.processing.org/bugs/show_bug.cgi?id=1191
_ extra triangles being seen in P2D
_ http://dev.processing.org/bugs/show_bug.cgi?id=1192
_ noloop ref even says that redraw will be called on resize, make sure it is
_ public PImage(java.awt.Image) sets format to RGB (but could be ARGB)
[ features ]
_ add version of math functions that use doubles?
_ what other methods should work with doubles? all math functions?
_ seems like internal (mostly static) things, but not graphics api
_ look into replacing nanoxml
_ http://www.exampledepot.com/egs/javax.xml.parsers/pkg.html
_ if no draw() method, and renderer is not displayable, then exit
_ static mode PDFs shouldn't just hang
_ public PImage(java.awt.Image) sets format to RGB (but could be ARGB)
[ known problems ]
_ memory leak problem with fonts in JAVA2D
_ http://dev.processing.org/bugs/show_bug.cgi?id=1252
_ OPENGL sketches flicker w/ Vista when background() not used inside draw()
_ http://dev.processing.org/bugs/show_bug.cgi?id=930
_ Disabling Aero scheme sometimes prevents the problem