mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-18 07:52:14 +01:00
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:
parent
240607a4a6
commit
3dc7fc0781
@ -3,13 +3,12 @@
|
|||||||
/*
|
/*
|
||||||
Part of the Processing project - http://processing.org
|
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
|
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License version 2
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
as published by the Free Software Foundation.
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -44,14 +43,14 @@ public class Base {
|
|||||||
static final int REVISION = 18;
|
static final int REVISION = 18;
|
||||||
static String VERSION_NAME = "0018";
|
static String VERSION_NAME = "0018";
|
||||||
|
|
||||||
static HashMap<Integer, String> platformNames = new HashMap();
|
static HashMap<Integer, String> platformNames = new HashMap<Integer, String>();
|
||||||
static {
|
static {
|
||||||
platformNames.put(PConstants.WINDOWS, "windows");
|
platformNames.put(PConstants.WINDOWS, "windows");
|
||||||
platformNames.put(PConstants.MACOSX, "macosx");
|
platformNames.put(PConstants.MACOSX, "macosx");
|
||||||
platformNames.put(PConstants.LINUX, "linux");
|
platformNames.put(PConstants.LINUX, "linux");
|
||||||
}
|
}
|
||||||
|
|
||||||
static HashMap<String, Integer> platformIndices = new HashMap();
|
static HashMap<String, Integer> platformIndices = new HashMap<String, Integer>();
|
||||||
static {
|
static {
|
||||||
platformIndices.put("windows", PConstants.WINDOWS);
|
platformIndices.put("windows", PConstants.WINDOWS);
|
||||||
platformIndices.put("macosx", PConstants.MACOSX);
|
platformIndices.put("macosx", PConstants.MACOSX);
|
||||||
@ -90,7 +89,7 @@ public class Base {
|
|||||||
static File untitledFolder;
|
static File untitledFolder;
|
||||||
|
|
||||||
// p5 icon for the window
|
// p5 icon for the window
|
||||||
static Image icon;
|
// static Image icon;
|
||||||
|
|
||||||
// int editorCount;
|
// int editorCount;
|
||||||
// Editor[] editors;
|
// Editor[] editors;
|
||||||
@ -102,8 +101,24 @@ public class Base {
|
|||||||
// int nextEditorX;
|
// int nextEditorX;
|
||||||
// int nextEditorY;
|
// 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[]) {
|
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 {
|
try {
|
||||||
File versionFile = getContentFile("lib/version.txt");
|
File versionFile = getContentFile("lib/version.txt");
|
||||||
if (versionFile.exists()) {
|
if (versionFile.exists()) {
|
||||||
@ -188,12 +203,14 @@ public class Base {
|
|||||||
"b { font: 13pt \"Lucida Grande\" }"+
|
"b { font: 13pt \"Lucida Grande\" }"+
|
||||||
"p { font: 11pt \"Lucida Grande\"; margin-top: 8px }"+
|
"p { font: 11pt \"Lucida Grande\"; margin-top: 8px }"+
|
||||||
"</style> </head> <body>" +
|
"</style> </head> <body>" +
|
||||||
"<b>The standard menu bar has been disabled.</b>" +
|
"<b>Some menus have been disabled.</b>" +
|
||||||
"<p>Due to an Apple bug, the Arduino menu bar " +
|
"<p>Due to an Apple bug, the Sketchbook and Example menus " +
|
||||||
"is unusable on Mac OS X 10.5. <br>" +
|
"are unusable. <br>" +
|
||||||
"As a workaround, the menu bar will be placed inside " +
|
"As a workaround, these items will be disabled from the " +
|
||||||
"the editor window. This <br>setting can be changed in the " +
|
"standard menu bar, <br>" +
|
||||||
"Preferences window. If this bug makes you sad, <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>" +
|
"please contact Apple via bugreporter.apple.com.</p>" +
|
||||||
"</body> </html>";
|
"</body> </html>";
|
||||||
Object[] options = { "OK", "More Info" };
|
Object[] options = { "OK", "More Info" };
|
||||||
@ -210,13 +227,18 @@ public class Base {
|
|||||||
// But don't bother setting the preference in the file
|
// But don't bother setting the preference in the file
|
||||||
} else {
|
} else {
|
||||||
// Shut off in the preferences for next time
|
// 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
|
if (result == 1) { // More Info
|
||||||
Base.openURL("http://dev.processing.org/bugs/show_bug.cgi?id=786");
|
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
|
// 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) {
|
protected Editor handleOpen(String path, int[] location) {
|
||||||
|
// System.err.println("entering handleOpen " + path);
|
||||||
|
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
if (!file.exists()) return null;
|
if (!file.exists()) return null;
|
||||||
|
|
||||||
|
// System.err.println(" editors: " + editors);
|
||||||
// Cycle through open windows to make sure that it's not already open.
|
// Cycle through open windows to make sure that it's not already open.
|
||||||
for (Editor editor : editors) {
|
for (Editor editor : editors) {
|
||||||
if (editor.getSketch().getMainFilePath().equals(path)) {
|
if (editor.getSketch().getMainFilePath().equals(path)) {
|
||||||
editor.toFront();
|
editor.toFront();
|
||||||
|
// System.err.println(" handleOpen: already opened");
|
||||||
return editor;
|
return editor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -736,10 +762,23 @@ public class Base {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// System.err.println(" creating new editor");
|
||||||
Editor editor = new Editor(this, path, location);
|
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
|
// Make sure that the sketch actually loaded
|
||||||
if (editor.getSketch() == null) {
|
if (editor.getSketch() == null) {
|
||||||
|
// System.err.println("sketch was null, getting out of handleOpen");
|
||||||
return null; // Just walk away quietly
|
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)
|
// (don't do earlier, cuz we might move it based on a window being closed)
|
||||||
editor.setVisible(true);
|
editor.setVisible(true);
|
||||||
|
|
||||||
|
// System.err.println("exiting handleOpen");
|
||||||
|
|
||||||
return editor;
|
return editor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -952,9 +993,16 @@ public class Base {
|
|||||||
protected void rebuildSketchbookMenu(JMenu menu) {
|
protected void rebuildSketchbookMenu(JMenu menu) {
|
||||||
//System.out.println("rebuilding sketchbook menu");
|
//System.out.println("rebuilding sketchbook menu");
|
||||||
//new Exception().printStackTrace();
|
//new Exception().printStackTrace();
|
||||||
|
boolean nativeButBroken = Base.isMacOS() ?
|
||||||
|
Preferences.getBoolean("apple.laf.useScreenMenuBar") : false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (nativeButBroken) { // osx workaround
|
||||||
|
menu.setEnabled(false);
|
||||||
|
} else {
|
||||||
menu.removeAll();
|
menu.removeAll();
|
||||||
addSketches(menu, getSketchbookFolder(), false);
|
addSketches(menu, getSketchbookFolder(), false);
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -971,33 +1019,45 @@ public class Base {
|
|||||||
// reset the table mapping imports to libraries
|
// reset the table mapping imports to libraries
|
||||||
importToLibraryTable = new HashMap<String, File>();
|
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
|
// Add from the "libraries" subfolder in the Processing directory
|
||||||
try {
|
try {
|
||||||
addLibraries(importMenu, librariesFolder);
|
addLibraries(importMenu, librariesFolder);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
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) {
|
public void rebuildExamplesMenu(JMenu menu) {
|
||||||
//System.out.println("rebuilding examples menu");
|
//System.out.println("rebuilding examples menu");
|
||||||
|
boolean nativeButBroken = Base.isMacOS() ?
|
||||||
|
Preferences.getBoolean("apple.laf.useScreenMenuBar") : false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (nativeButBroken) { // osx workaround
|
||||||
|
menu.setEnabled(false);
|
||||||
|
} else {
|
||||||
menu.removeAll();
|
menu.removeAll();
|
||||||
boolean found = addSketches(menu, examplesFolder, false);
|
boolean found = addSketches(menu, examplesFolder, false);
|
||||||
if (found) menu.addSeparator();
|
if (found) menu.addSeparator();
|
||||||
found = addSketches(menu, getSketchbookLibrariesFolder(), false);
|
found = addSketches(menu, getSketchbookLibrariesFolder(), false);
|
||||||
if (found) menu.addSeparator();
|
if (found) menu.addSeparator();
|
||||||
addSketches(menu, librariesFolder, false);
|
addSketches(menu, librariesFolder, false);
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -1126,23 +1186,24 @@ public class Base {
|
|||||||
|
|
||||||
boolean ifound = false;
|
boolean ifound = false;
|
||||||
|
|
||||||
for (String libraryName : list) {
|
for (String potentialName : list) {
|
||||||
File subfolder = new File(folder, libraryName);
|
File subfolder = new File(folder, potentialName);
|
||||||
// File libraryFolder = new File(subfolder, "library");
|
// 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
|
// // If a .jar file of the same prefix as the folder exists
|
||||||
// // inside the 'library' subfolder of the sketch
|
// // inside the 'library' subfolder of the sketch
|
||||||
// if (libraryJar.exists()) {
|
// if (libraryJar.exists()) {
|
||||||
String sanityCheck = Sketch.sanitizeName(libraryName);
|
String sanityCheck = Sketch.sanitizeName(potentialName);
|
||||||
if (!sanityCheck.equals(libraryName)) {
|
if (!sanityCheck.equals(potentialName)) {
|
||||||
String mess =
|
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" +
|
"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);
|
Base.showMessage("Ignoring bad library name", mess);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String libraryName = potentialName;
|
||||||
// // get the path for all .jar files in this code folder
|
// // get the path for all .jar files in this code folder
|
||||||
// String libraryClassPath =
|
// String libraryClassPath =
|
||||||
// Compiler.contentsToClassPath(libraryFolder);
|
// Compiler.contentsToClassPath(libraryFolder);
|
||||||
|
@ -3,13 +3,12 @@
|
|||||||
/*
|
/*
|
||||||
Part of the Processing project - http://processing.org
|
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
|
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License version 2
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
as published by the Free Software Foundation.
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -161,8 +160,8 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
// When bringing a window to front, let the Base know
|
// When bringing a window to front, let the Base know
|
||||||
addWindowListener(new WindowAdapter() {
|
addWindowListener(new WindowAdapter() {
|
||||||
public void windowActivated(WindowEvent e) {
|
public void windowActivated(WindowEvent e) {
|
||||||
|
// System.err.println("activate"); // not coming through
|
||||||
base.handleActivated(Editor.this);
|
base.handleActivated(Editor.this);
|
||||||
|
|
||||||
// re-add the sub-menus that are shared by all windows
|
// re-add the sub-menus that are shared by all windows
|
||||||
fileMenu.insert(sketchbookMenu, 2);
|
fileMenu.insert(sketchbookMenu, 2);
|
||||||
fileMenu.insert(examplesMenu, 3);
|
fileMenu.insert(examplesMenu, 3);
|
||||||
@ -170,6 +169,17 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
toolsMenu.insert(boardsMenu, numTools);
|
toolsMenu.insert(boardsMenu, numTools);
|
||||||
toolsMenu.insert(serialMenu, numTools + 1);
|
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();
|
//PdeKeywords keywords = new PdeKeywords();
|
||||||
@ -717,7 +727,7 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
|
|
||||||
URL[] urlList = new URL[archives.length];
|
URL[] urlList = new URL[archives.length];
|
||||||
for (int j = 0; j < urlList.length; j++) {
|
for (int j = 0; j < urlList.length; j++) {
|
||||||
urlList[j] = archives[j].toURL();
|
urlList[j] = archives[j].toURI().toURL();
|
||||||
}
|
}
|
||||||
URLClassLoader loader = new URLClassLoader(urlList);
|
URLClassLoader loader = new URLClassLoader(urlList);
|
||||||
|
|
||||||
@ -963,6 +973,8 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
|
|
||||||
|
|
||||||
protected JMenu buildHelpMenu() {
|
protected JMenu buildHelpMenu() {
|
||||||
|
// 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 ");
|
JMenu menu = new JMenu("Help ");
|
||||||
JMenuItem item;
|
JMenuItem item;
|
||||||
|
|
||||||
|
@ -305,16 +305,17 @@ public class EditorConsole extends JScrollPane {
|
|||||||
public void flush() { }
|
public void flush() { }
|
||||||
|
|
||||||
public void write(byte b[]) { // appears never to be used
|
public void write(byte b[]) { // appears never to be used
|
||||||
// if (currentConsole.isDisplayable()) {
|
if (currentConsole != null) {
|
||||||
currentConsole.write(b, 0, b.length, err);
|
currentConsole.write(b, 0, b.length, err);
|
||||||
// } else {
|
} else {
|
||||||
// systemOut.println("not displayable");
|
try {
|
||||||
// if (err) {
|
if (err) {
|
||||||
// systemErr.write(b, 0, b.length);
|
systemErr.write(b);
|
||||||
// } else {
|
} else {
|
||||||
// systemOut.write(b, 0, b.length);
|
systemOut.write(b);
|
||||||
// }
|
}
|
||||||
// }
|
} catch (IOException e) { } // just ignore, where would we write?
|
||||||
|
}
|
||||||
|
|
||||||
OutputStream echo = err ? stderrFile : stdoutFile;
|
OutputStream echo = err ? stderrFile : stdoutFile;
|
||||||
if (echo != null) {
|
if (echo != null) {
|
||||||
@ -329,18 +330,17 @@ public class EditorConsole extends JScrollPane {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void write(byte b[], int offset, int length) {
|
public void write(byte b[], int offset, int length) {
|
||||||
|
if (currentConsole != null) {
|
||||||
currentConsole.write(b, offset, length, err);
|
currentConsole.write(b, offset, length, err);
|
||||||
// if (currentConsole.isDisplayable()) {
|
} else {
|
||||||
// systemOut.println("is displayable");
|
try {
|
||||||
// currentConsole.write(b, offset, length, err);
|
if (err) {
|
||||||
// } else {
|
systemErr.write(b);
|
||||||
// systemOut.println("not displayable");
|
} else {
|
||||||
// if (err) {
|
systemOut.write(b);
|
||||||
// systemErr.write(b, offset, length);
|
}
|
||||||
// } else {
|
} catch (IOException e) { } // just ignore, where would we write?
|
||||||
// systemOut.write(b, offset, length);
|
}
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
OutputStream echo = err ? stderrFile : stdoutFile;
|
OutputStream echo = err ? stderrFile : stdoutFile;
|
||||||
if (echo != null) {
|
if (echo != null) {
|
||||||
@ -356,7 +356,12 @@ public class EditorConsole extends JScrollPane {
|
|||||||
|
|
||||||
public void write(int b) {
|
public void write(int b) {
|
||||||
single[0] = (byte)b;
|
single[0] = (byte)b;
|
||||||
|
if (currentConsole != null) {
|
||||||
currentConsole.write(single, 0, 1, err);
|
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;
|
OutputStream echo = err ? stderrFile : stdoutFile;
|
||||||
if (echo != null) {
|
if (echo != null) {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
/*
|
/*
|
||||||
Part of the Processing project - http://processing.org
|
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
|
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@ -34,8 +34,6 @@ import processing.app.syntax.*;
|
|||||||
import processing.core.*;
|
import processing.core.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Storage class for user preferences and environment settings.
|
* Storage class for user preferences and environment settings.
|
||||||
* <P>
|
* <P>
|
||||||
@ -144,9 +142,9 @@ public class Preferences {
|
|||||||
|
|
||||||
// data model
|
// data model
|
||||||
|
|
||||||
static Hashtable defaults;
|
static HashMap<String,String> defaults;
|
||||||
static Hashtable table = new Hashtable();;
|
static HashMap<String,String> table = new HashMap<String,String>();;
|
||||||
static Hashtable prefixes = new Hashtable();
|
static HashMap<String,HashMap<String,String>> prefixes = new HashMap<String,HashMap<String,String>>();
|
||||||
static File preferencesFile;
|
static File preferencesFile;
|
||||||
|
|
||||||
|
|
||||||
@ -161,22 +159,8 @@ public class Preferences {
|
|||||||
"You'll need to reinstall Arduino.", e);
|
"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
|
// 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
|
// other things that have to be set explicitly for the defaults
|
||||||
setColor("run.window.bgcolor", SystemColor.control);
|
setColor("run.window.bgcolor", SystemColor.control);
|
||||||
@ -445,6 +429,20 @@ public class Preferences {
|
|||||||
top += d.height; // + GUI_SMALL;
|
top += d.height; // + GUI_SMALL;
|
||||||
|
|
||||||
label = new JLabel(preferencesFile.getAbsolutePath());
|
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);
|
pain.add(label);
|
||||||
d = label.getPreferredSize();
|
d = label.getPreferredSize();
|
||||||
label.setBounds(left, top, d.width, d.height);
|
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 {
|
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);
|
prefixes.put(prefix, table);
|
||||||
load(input, table);
|
load(input, table);
|
||||||
}
|
}
|
||||||
|
|
||||||
static protected void load(InputStream input, Map table) throws IOException {
|
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
|
String[] lines = PApplet.loadStrings(input); // Reads as UTF-8
|
||||||
for (String line : lines) {
|
for (String line : lines) {
|
||||||
if ((line.length() == 0) ||
|
if ((line.length() == 0) ||
|
||||||
@ -693,6 +695,12 @@ public class Preferences {
|
|||||||
int equals = line.indexOf('=');
|
int equals = line.indexOf('=');
|
||||||
if (equals != -1) {
|
if (equals != -1) {
|
||||||
String key = line.substring(0, equals).trim();
|
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();
|
String value = line.substring(equals + 1).trim();
|
||||||
table.put(key, value);
|
table.put(key, value);
|
||||||
}
|
}
|
||||||
@ -713,10 +721,8 @@ public class Preferences {
|
|||||||
// Fix for 0163 to properly use Unicode when writing preferences.txt
|
// Fix for 0163 to properly use Unicode when writing preferences.txt
|
||||||
PrintWriter writer = PApplet.createWriter(preferencesFile);
|
PrintWriter writer = PApplet.createWriter(preferencesFile);
|
||||||
|
|
||||||
Enumeration e = table.keys(); //properties.propertyNames();
|
for (String key : table.keySet()) {
|
||||||
while (e.hasMoreElements()) {
|
writer.println(key + "=" + table.get(key));
|
||||||
String key = (String) e.nextElement();
|
|
||||||
writer.println(key + "=" + ((String) table.get(key)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.flush();
|
writer.flush();
|
||||||
@ -742,15 +748,15 @@ public class Preferences {
|
|||||||
// preference files, look up the attribute in that file's Hashtable
|
// preference files, look up the attribute in that file's Hashtable
|
||||||
// (don't override with or fallback to the main file). otherwise,
|
// (don't override with or fallback to the main file). otherwise,
|
||||||
// look up the attribute in the main file's Hashtable.
|
// look up the attribute in the main file's Hashtable.
|
||||||
Map table = Preferences.table;
|
HashMap<String,String> table = Preferences.table;
|
||||||
if (attribute.indexOf('.') != -1) {
|
if (attribute.indexOf('.') != -1) {
|
||||||
String prefix = attribute.substring(0, attribute.indexOf('.'));
|
String prefix = attribute.substring(0, attribute.indexOf('.'));
|
||||||
if (prefixes.containsKey(prefix)) {
|
if (prefixes.containsKey(prefix)) {
|
||||||
table = (Map) prefixes.get(prefix);
|
table = prefixes.get(prefix);
|
||||||
attribute = attribute.substring(attribute.indexOf('.') + 1);
|
attribute = attribute.substring(attribute.indexOf('.') + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (String) table.get(attribute);
|
return table.get(attribute);
|
||||||
/*
|
/*
|
||||||
//String value = (properties != null) ?
|
//String value = (properties != null) ?
|
||||||
//properties.getProperty(attribute) : applet.getParameter(attribute);
|
//properties.getProperty(attribute) : applet.getParameter(attribute);
|
||||||
@ -785,7 +791,7 @@ public class Preferences {
|
|||||||
|
|
||||||
|
|
||||||
static public String getDefault(String attribute) {
|
static public String getDefault(String attribute) {
|
||||||
return (String) defaults.get(attribute);
|
return defaults.get(attribute);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -857,11 +863,6 @@ public class Preferences {
|
|||||||
|
|
||||||
|
|
||||||
static public void setColor(String attr, Color what) {
|
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));
|
set(attr, "#" + PApplet.hex(what.getRGB() & 0xffffff, 6));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
/*
|
/*
|
||||||
Part of the Processing project - http://processing.org
|
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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -59,7 +59,7 @@ public class PresentMode {
|
|||||||
devices = environment.getScreenDevices();
|
devices = environment.getScreenDevices();
|
||||||
GraphicsDevice defaultDevice = environment.getDefaultScreenDevice();
|
GraphicsDevice defaultDevice = environment.getDefaultScreenDevice();
|
||||||
|
|
||||||
Vector names = new Vector();
|
Vector<String> names = new Vector<String>();
|
||||||
for (int i = 0; i < devices.length; i++) {
|
for (int i = 0; i < devices.length; i++) {
|
||||||
String name = String.valueOf(i + 1);
|
String name = String.valueOf(i + 1);
|
||||||
if (devices[i] == defaultDevice) {
|
if (devices[i] == defaultDevice) {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
/*
|
/*
|
||||||
Part of the Processing project - http://processing.org
|
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
|
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@ -1558,8 +1558,8 @@ public class Sketch {
|
|||||||
* Read from a file with a bunch of attribute/value pairs
|
* Read from a file with a bunch of attribute/value pairs
|
||||||
* that are separated by = and ignore comments with #.
|
* that are separated by = and ignore comments with #.
|
||||||
*/
|
*/
|
||||||
protected Hashtable readSettings(File inputFile) {
|
protected HashMap<String,String> readSettings(File inputFile) {
|
||||||
Hashtable outgoing = new Hashtable();
|
HashMap<String,String> outgoing = new HashMap<String,String>();
|
||||||
if (!inputFile.exists()) return outgoing; // return empty hash
|
if (!inputFile.exists()) return outgoing; // return empty hash
|
||||||
|
|
||||||
String lines[] = PApplet.loadStrings(inputFile);
|
String lines[] = PApplet.loadStrings(inputFile);
|
||||||
@ -1589,7 +1589,7 @@ public class Sketch {
|
|||||||
*/
|
*/
|
||||||
protected void packClassPathIntoZipFile(String path,
|
protected void packClassPathIntoZipFile(String path,
|
||||||
ZipOutputStream zos,
|
ZipOutputStream zos,
|
||||||
Hashtable zipFileContents)
|
HashMap<String,Object> zipFileContents)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
String[] pieces = PApplet.split(path, File.pathSeparatorChar);
|
String[] pieces = PApplet.split(path, File.pathSeparatorChar);
|
||||||
|
|
||||||
@ -1601,7 +1601,7 @@ public class Sketch {
|
|||||||
pieces[i].toLowerCase().endsWith(".zip")) {
|
pieces[i].toLowerCase().endsWith(".zip")) {
|
||||||
try {
|
try {
|
||||||
ZipFile file = new ZipFile(pieces[i]);
|
ZipFile file = new ZipFile(pieces[i]);
|
||||||
Enumeration entries = file.entries();
|
Enumeration<?> entries = file.entries();
|
||||||
while (entries.hasMoreElements()) {
|
while (entries.hasMoreElements()) {
|
||||||
ZipEntry entry = (ZipEntry) entries.nextElement();
|
ZipEntry entry = (ZipEntry) entries.nextElement();
|
||||||
if (entry.isDirectory()) {
|
if (entry.isDirectory()) {
|
||||||
|
@ -39,9 +39,9 @@ import processing.core.*;
|
|||||||
public class Theme {
|
public class Theme {
|
||||||
|
|
||||||
/** Copy of the defaults in case the user mangles a preference. */
|
/** 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. */
|
/** 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() {
|
static protected void init() {
|
||||||
@ -55,9 +55,7 @@ public class Theme {
|
|||||||
// check for platform-specific properties in the defaults
|
// check for platform-specific properties in the defaults
|
||||||
String platformExt = "." + Base.getPlatformName();
|
String platformExt = "." + Base.getPlatformName();
|
||||||
int platformExtLength = platformExt.length();
|
int platformExtLength = platformExt.length();
|
||||||
Enumeration e = table.keys();
|
for (String key : table.keySet()) {
|
||||||
while (e.hasMoreElements()) {
|
|
||||||
String key = (String) e.nextElement();
|
|
||||||
if (key.endsWith(platformExt)) {
|
if (key.endsWith(platformExt)) {
|
||||||
// this is a key specific to a particular platform
|
// this is a key specific to a particular platform
|
||||||
String actualKey = key.substring(0, key.length() - platformExtLength);
|
String actualKey = key.substring(0, key.length() - platformExtLength);
|
||||||
@ -70,7 +68,7 @@ public class Theme {
|
|||||||
setColor("run.window.bgcolor", SystemColor.control);
|
setColor("run.window.bgcolor", SystemColor.control);
|
||||||
|
|
||||||
// clone the hash table
|
// 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) {
|
static public void setColor(String attr, Color what) {
|
||||||
String r = Integer.toHexString(what.getRed());
|
set(attr, "#" + PApplet.hex(what.getRGB() & 0xffffff, 6));
|
||||||
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));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,31 +40,9 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.sun.jdi.Field;
|
import com.sun.jdi.*;
|
||||||
import com.sun.jdi.IncompatibleThreadStateException;
|
import com.sun.jdi.event.*;
|
||||||
import com.sun.jdi.ThreadReference;
|
import com.sun.jdi.request.*;
|
||||||
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;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class processes incoming JDI events and displays them
|
* This class processes incoming JDI events and displays them
|
||||||
@ -132,8 +110,9 @@ public class EventThread extends Thread {
|
|||||||
// deathReq.setSuspendPolicy(EventRequest.SUSPEND_ALL);
|
// deathReq.setSuspendPolicy(EventRequest.SUSPEND_ALL);
|
||||||
// deathReq.enable();
|
// deathReq.enable();
|
||||||
|
|
||||||
// want all exceptions
|
// get only the uncaught exceptions
|
||||||
ExceptionRequest excReq = mgr.createExceptionRequest(null, false, true);
|
ExceptionRequest excReq = mgr.createExceptionRequest(null, false, true);
|
||||||
|
// this version reports all exceptions, caught or uncaught
|
||||||
//ExceptionRequest excReq = mgr.createExceptionRequest(null, true, true);
|
//ExceptionRequest excReq = mgr.createExceptionRequest(null, true, true);
|
||||||
// suspend so we can step
|
// suspend so we can step
|
||||||
excReq.setSuspendPolicy(EventRequest.SUSPEND_ALL);
|
excReq.setSuspendPolicy(EventRequest.SUSPEND_ALL);
|
||||||
@ -380,7 +359,7 @@ public class EventThread extends Thread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void exceptionEvent(ExceptionEvent event) {
|
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("exceptionEvent() fired " + or);
|
||||||
// System.out.println("catch location " + event.catchLocation());
|
// System.out.println("catch location " + event.catchLocation());
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
/*
|
/*
|
||||||
Part of the Processing project - http://processing.org
|
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
|
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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 = "localhost:" + (8000 + (int) (Math.random() * 1000));
|
||||||
//String addr = "" + (8000 + (int) (Math.random() * 1000));
|
//String addr = "" + (8000 + (int) (Math.random() * 1000));
|
||||||
|
|
||||||
String commandArgs = Base.isWindows() ?
|
String commandArgs =
|
||||||
"java -Xrunjdwp:transport=dt_shmem,address=" + addr + ",suspend=y " :
|
|
||||||
"java -Xrunjdwp:transport=dt_socket,address=" + addr + ",suspend=y ";
|
"java -Xrunjdwp:transport=dt_socket,address=" + addr + ",suspend=y ";
|
||||||
//String commandArgs = "java -agentlib:jdwp=transport=dt_socket,address=" + addr + ",suspend=y ";
|
if (Base.isWindows()) {
|
||||||
//String commandArgs = "java -agentlib:jdwp=transport=dt_socket,address=" + addr + ",server=n,suspend=y ";
|
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++) {
|
for (int i = 0; i < vmParams.length; i++) {
|
||||||
commandArgs = addArgument(commandArgs, vmParams[i], ' ');
|
commandArgs = addArgument(commandArgs, vmParams[i], ' ');
|
||||||
}
|
}
|
||||||
@ -519,9 +524,11 @@ public class Runner implements MessageConsumer {
|
|||||||
// Shutdown begins when event thread terminates
|
// Shutdown begins when event thread terminates
|
||||||
try {
|
try {
|
||||||
if (eventThread != null) eventThread.join();
|
if (eventThread != null) eventThread.join();
|
||||||
|
// System.out.println("in here");
|
||||||
// Bug #852 tracked to this next line in the code.
|
// Bug #852 tracked to this next line in the code.
|
||||||
// http://dev.processing.org/bugs/show_bug.cgi?id=852
|
// http://dev.processing.org/bugs/show_bug.cgi?id=852
|
||||||
errThread.join(); // Make sure output is forwarded
|
errThread.join(); // Make sure output is forwarded
|
||||||
|
// System.out.println("and then");
|
||||||
outThread.join(); // before we exit
|
outThread.join(); // before we exit
|
||||||
// System.out.println("out of it");
|
// System.out.println("out of it");
|
||||||
|
|
||||||
@ -573,6 +580,7 @@ public class Runner implements MessageConsumer {
|
|||||||
|
|
||||||
|
|
||||||
public void exception(ExceptionEvent event) {
|
public void exception(ExceptionEvent event) {
|
||||||
|
// System.out.println(event);
|
||||||
ObjectReference or = event.exception();
|
ObjectReference or = event.exception();
|
||||||
ReferenceType rt = or.referenceType();
|
ReferenceType rt = or.referenceType();
|
||||||
String exceptionName = rt.name();
|
String exceptionName = rt.name();
|
||||||
|
@ -93,6 +93,7 @@ public class ThinkDifferent implements ApplicationListener {
|
|||||||
|
|
||||||
|
|
||||||
public void handleOpenFile(ApplicationEvent ae) {
|
public void handleOpenFile(ApplicationEvent ae) {
|
||||||
|
// System.out.println("got open file event " + ae.getFilename());
|
||||||
String filename = ae.getFilename();
|
String filename = ae.getFilename();
|
||||||
base.handleOpen(filename);
|
base.handleOpen(filename);
|
||||||
ae.setHandled(true);
|
ae.setHandled(true);
|
||||||
|
@ -51,7 +51,7 @@ import java.util.Vector;
|
|||||||
* + "}");</pre>
|
* + "}");</pre>
|
||||||
*
|
*
|
||||||
* @author Slava Pestov
|
* @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
|
public class JEditTextArea extends JComponent
|
||||||
{
|
{
|
||||||
@ -103,6 +103,9 @@ public class JEditTextArea extends JComponent
|
|||||||
painter.addMouseListener(new MouseHandler());
|
painter.addMouseListener(new MouseHandler());
|
||||||
painter.addMouseMotionListener(new DragHandler());
|
painter.addMouseMotionListener(new DragHandler());
|
||||||
addFocusListener(new FocusHandler());
|
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
|
// Load the defaults
|
||||||
setInputHandler(defaults.inputHandler);
|
setInputHandler(defaults.inputHandler);
|
||||||
@ -145,9 +148,9 @@ public class JEditTextArea extends JComponent
|
|||||||
* Returns if this component can be traversed by pressing
|
* Returns if this component can be traversed by pressing
|
||||||
* the Tab key. This returns false.
|
* the Tab key. This returns false.
|
||||||
*/
|
*/
|
||||||
public final boolean isManagingFocus() {
|
// public final boolean isManagingFocus() {
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the object responsible for painting this text area.
|
* Returns the object responsible for painting this text area.
|
||||||
|
@ -30,6 +30,8 @@ implements TabExpander, Printable
|
|||||||
{
|
{
|
||||||
/** True if inside printing, will handle disabling the highlight */
|
/** True if inside printing, will handle disabling the highlight */
|
||||||
boolean printing;
|
boolean printing;
|
||||||
|
/** Current setting for editor.antialias preference */
|
||||||
|
boolean antialias;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new repaint manager. This should be not be called
|
* Creates a new repaint manager. This should be not be called
|
||||||
@ -54,6 +56,8 @@ implements TabExpander, Printable
|
|||||||
setForeground(defaults.fgcolor);
|
setForeground(defaults.fgcolor);
|
||||||
setBackground(defaults.bgcolor);
|
setBackground(defaults.bgcolor);
|
||||||
|
|
||||||
|
antialias = Preferences.getBoolean("editor.antialias");
|
||||||
|
|
||||||
blockCaret = defaults.blockCaret;
|
blockCaret = defaults.blockCaret;
|
||||||
styles = defaults.styles;
|
styles = defaults.styles;
|
||||||
cols = defaults.cols;
|
cols = defaults.cols;
|
||||||
@ -73,10 +77,10 @@ implements TabExpander, Printable
|
|||||||
* Returns if this component can be traversed by pressing the
|
* Returns if this component can be traversed by pressing the
|
||||||
* Tab key. This returns false.
|
* Tab key. This returns false.
|
||||||
*/
|
*/
|
||||||
public final boolean isManagingFocus()
|
// public final boolean isManagingFocus()
|
||||||
{
|
// {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the syntax styles used to paint colorized text. Entry <i>n</i>
|
* 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)
|
public void paint(Graphics gfx)
|
||||||
{
|
{
|
||||||
if (Base.isMacOS()) {
|
|
||||||
Graphics2D g2 = (Graphics2D) gfx;
|
Graphics2D g2 = (Graphics2D) gfx;
|
||||||
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
|
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
|
||||||
|
antialias ?
|
||||||
|
RenderingHints.VALUE_TEXT_ANTIALIAS_ON :
|
||||||
RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
|
RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
|
||||||
}
|
|
||||||
|
|
||||||
tabSize = fm.charWidth(' ') * ((Integer)textArea.getDocument().getProperty(PlainDocument.tabSizeAttribute)).intValue();
|
tabSize = fm.charWidth(' ') * ((Integer)textArea.getDocument().getProperty(PlainDocument.tabSizeAttribute)).intValue();
|
||||||
|
|
||||||
|
@ -3,13 +3,14 @@
|
|||||||
/*
|
/*
|
||||||
Part of the Processing project - http://processing.org
|
Part of the Processing project - http://processing.org
|
||||||
|
|
||||||
Copyright (c) 2005-06 Ben Fry and Casey Reas
|
Original Copyright (c) 1997, 1998 Van Di-Han HO. All Rights Reserved.
|
||||||
Copyright (c) 2003 Martin Gomez, Ateneo de Manila University
|
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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation, version 2.
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -24,13 +25,21 @@
|
|||||||
package processing.app.tools;
|
package processing.app.tools;
|
||||||
|
|
||||||
import processing.app.*;
|
import processing.app.*;
|
||||||
|
import processing.core.PApplet;
|
||||||
|
|
||||||
import java.io.*;
|
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.
|
* 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 {
|
public class AutoFormat implements Tool {
|
||||||
Editor editor;
|
Editor editor;
|
||||||
@ -38,15 +47,12 @@ public class AutoFormat implements Tool {
|
|||||||
static final int BLOCK_MAXLEN = 1024;
|
static final int BLOCK_MAXLEN = 1024;
|
||||||
|
|
||||||
StringBuffer strOut;
|
StringBuffer strOut;
|
||||||
//String formattedText;
|
|
||||||
int indentValue;
|
int indentValue;
|
||||||
String indentChar;
|
String indentChar;
|
||||||
//String uhOh = null;
|
|
||||||
//String theStuff;
|
|
||||||
int EOF;
|
int EOF;
|
||||||
BufferedInputStream bin = null;
|
CharArrayReader reader;
|
||||||
int nBytesRead, indexBlock, lineLength, lineNumber;
|
int readCount, indexBlock, lineLength, lineNumber;
|
||||||
byte bArray[];
|
char chars[];
|
||||||
String strBlock;
|
String strBlock;
|
||||||
int s_level[];
|
int s_level[];
|
||||||
int c_level;
|
int c_level;
|
||||||
@ -64,22 +70,16 @@ public class AutoFormat implements Tool {
|
|||||||
String w_if_, w_else, w_for, w_ds, w_case, w_cpp_comment, w_jdoc;
|
String w_if_, w_else, w_for, w_ds, w_case, w_cpp_comment, w_jdoc;
|
||||||
int jdoc, j;
|
int jdoc, j;
|
||||||
char string[];
|
char string[];
|
||||||
byte bstring[];
|
|
||||||
byte bblank;
|
|
||||||
char cc;
|
char cc;
|
||||||
int s_flg, b_flg;
|
int s_flg;
|
||||||
int peek;
|
int peek;
|
||||||
char peekc;
|
char peekc;
|
||||||
int tabs;
|
int tabs;
|
||||||
char next_char, last_char;
|
char last_char;
|
||||||
char lastc0, lastc1;
|
char c;
|
||||||
char c, c0;
|
|
||||||
char w_kptr;
|
|
||||||
|
|
||||||
String line_feed;
|
String line_feed;
|
||||||
|
|
||||||
//static int outfil; // temporary
|
|
||||||
|
|
||||||
|
|
||||||
public void init(Editor editor) {
|
public void init(Editor editor) {
|
||||||
this.editor = editor;
|
this.editor = editor;
|
||||||
@ -236,6 +236,7 @@ public class AutoFormat implements Tool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void cpp_comment() throws IOException
|
public void cpp_comment() throws IOException
|
||||||
{
|
{
|
||||||
c = getchr();
|
c = getchr();
|
||||||
@ -283,16 +284,16 @@ public class AutoFormat implements Tool {
|
|||||||
indexBlock++;
|
indexBlock++;
|
||||||
if (indexBlock >= lineLength)
|
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;
|
lineLength = readCount = 0;
|
||||||
//try /* to get the next block */
|
reader.mark(1);
|
||||||
//{
|
if (reader.read() != -1)
|
||||||
if (bin.available() > 0)
|
|
||||||
{
|
{
|
||||||
nBytesRead = bin.read(bArray);
|
reader.reset(); // back to the mark
|
||||||
lineLength = nBytesRead;
|
readCount = reader.read(chars);
|
||||||
strBlock = new String(bArray);
|
lineLength = readCount;
|
||||||
|
strBlock = new String(chars);
|
||||||
indexBlock = 0;
|
indexBlock = 0;
|
||||||
last_char = strBlock.charAt(indexBlock);
|
last_char = strBlock.charAt(indexBlock);
|
||||||
peek = -1;
|
peek = -1;
|
||||||
@ -300,15 +301,9 @@ public class AutoFormat implements Tool {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//System.out.println("eof a");
|
|
||||||
EOF = 1;
|
EOF = 1;
|
||||||
peekc = '\0';
|
peekc = '\0';
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
//catch(IOException ioe)
|
|
||||||
//{
|
|
||||||
//System.out.println(ioe.toString());
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -446,13 +441,11 @@ public class AutoFormat implements Tool {
|
|||||||
indentChar = new String(" ");
|
indentChar = new String(" ");
|
||||||
|
|
||||||
lineNumber = 0;
|
lineNumber = 0;
|
||||||
//BLOCK_MAXLEN = 256;
|
|
||||||
c_level = if_lev = level = e_flg = paren = 0;
|
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;
|
if_flg = peek = -1;
|
||||||
peekc = '`';
|
peekc = '`';
|
||||||
s_flg = 1;
|
s_flg = 1;
|
||||||
bblank = ' ';
|
|
||||||
jdoc = 0;
|
jdoc = 0;
|
||||||
|
|
||||||
s_level = new int[10];
|
s_level = new int[10];
|
||||||
@ -476,24 +469,23 @@ public class AutoFormat implements Tool {
|
|||||||
// read as long as there is something to read
|
// read as long as there is something to read
|
||||||
EOF = 0; // = 1 set in getchr when EOF
|
EOF = 0; // = 1 set in getchr when EOF
|
||||||
|
|
||||||
bArray = new byte[BLOCK_MAXLEN];
|
chars = new char[BLOCK_MAXLEN];
|
||||||
string = new char[BLOCK_MAXLEN];
|
string = new char[BLOCK_MAXLEN];
|
||||||
try { // the whole process
|
try { // the whole process
|
||||||
// open for input
|
// open for input
|
||||||
ByteArrayInputStream in =
|
reader = new CharArrayReader(originalText.toCharArray());
|
||||||
new ByteArrayInputStream(originalText.getBytes());
|
|
||||||
|
|
||||||
// add buffering to that InputStream
|
// 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
|
// read up a block - remember how many bytes read
|
||||||
nBytesRead = bin.read(bArray);
|
readCount = reader.read(chars);
|
||||||
strBlock = new String(bArray);
|
strBlock = new String(chars);
|
||||||
|
|
||||||
lineLength = nBytesRead;
|
lineLength = readCount;
|
||||||
lineNumber = 1;
|
lineNumber = 1;
|
||||||
indexBlock = -1;
|
indexBlock = -1;
|
||||||
j = 0;
|
j = 0;
|
||||||
@ -561,6 +553,10 @@ public class AutoFormat implements Tool {
|
|||||||
|
|
||||||
case '{':
|
case '{':
|
||||||
if(lookup(w_else) == 1)gotelse();
|
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_lev[c_level] = if_lev;
|
||||||
s_if_flg[c_level] = if_flg;
|
s_if_flg[c_level] = if_flg;
|
||||||
if_lev = if_flg = 0;
|
if_lev = if_flg = 0;
|
||||||
@ -736,7 +732,6 @@ public class AutoFormat implements Tool {
|
|||||||
peekc = getchr();
|
peekc = getchr();
|
||||||
if(peekc == ';')
|
if(peekc == ';')
|
||||||
{
|
{
|
||||||
//fprintf(outfil,";");
|
|
||||||
fprintf(";");
|
fprintf(";");
|
||||||
peek = -1;
|
peek = -1;
|
||||||
peekc = '`';
|
peekc = '`';
|
||||||
@ -747,13 +742,11 @@ public class AutoFormat implements Tool {
|
|||||||
}
|
}
|
||||||
getnl();
|
getnl();
|
||||||
indent_puts();
|
indent_puts();
|
||||||
//fprintf(outfil,"\n");
|
|
||||||
fprintf("\n");
|
fprintf("\n");
|
||||||
s_flg = 1;
|
s_flg = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '/':
|
case '/':
|
||||||
c0 = string[j];
|
|
||||||
string[j++] = c;
|
string[j++] = c;
|
||||||
peekc = getchr();
|
peekc = getchr();
|
||||||
|
|
||||||
@ -912,7 +905,7 @@ public class AutoFormat implements Tool {
|
|||||||
selectionEnd = strOut.length() - 1;
|
selectionEnd = strOut.length() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bin.close(); // close buff
|
reader.close(); // close buff
|
||||||
|
|
||||||
String formattedText = strOut.toString();
|
String formattedText = strOut.toString();
|
||||||
if (formattedText.equals(originalText)) {
|
if (formattedText.equals(originalText)) {
|
||||||
|
@ -7,6 +7,13 @@ if [ $1 ]
|
|||||||
then
|
then
|
||||||
RELEASE=$1
|
RELEASE=$1
|
||||||
echo Creating Arduino release $RELEASE...
|
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
|
else
|
||||||
RELEASE=$REVISION
|
RELEASE=$REVISION
|
||||||
echo Creating Arduino distribution for revision $REVISION...
|
echo Creating Arduino distribution for revision $REVISION...
|
||||||
|
@ -1,5 +1,22 @@
|
|||||||
#!/bin/sh
|
#!/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 -------------------------------------------
|
### -- SETUP WORK DIR -------------------------------------------
|
||||||
|
|
||||||
|
@ -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
|
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,
|
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
|
+ Update to iText 2.1.4 for the PDF library
|
||||||
|
|
||||||
|
|
||||||
|
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||||
|
|
||||||
|
|
||||||
PROCESSING 1.0.2 (REV 0164) - 21 February 2009
|
PROCESSING 1.0.2 (REV 0164) - 21 February 2009
|
||||||
|
|
||||||
This release fixes many bugs and adds two minor functions to the XML library.
|
This release fixes many bugs and adds two minor functions to the XML library.
|
||||||
|
Binary file not shown.
@ -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)
|
0164 core (1.0.2)
|
||||||
X requestImage() causing problems with JAVA2D
|
X requestImage() causing problems with JAVA2D
|
||||||
X fix minor strokeWeight bug with OpenGL
|
X fix minor strokeWeight bug with OpenGL
|
||||||
|
@ -3,13 +3,12 @@
|
|||||||
/*
|
/*
|
||||||
Part of the Processing project - http://processing.org
|
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
|
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
License as published by the Free Software Foundation; either
|
License as published by the Free Software Foundation, version 2.1.
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
This library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -825,7 +824,7 @@ public class PApplet extends Applet
|
|||||||
meth.add(o, method);
|
meth.add(o, method);
|
||||||
|
|
||||||
} catch (NoSuchMethodException nsme) {
|
} 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());
|
o.getClass().getName());
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -842,7 +841,7 @@ public class PApplet extends Applet
|
|||||||
meth.add(o, method);
|
meth.add(o, method);
|
||||||
|
|
||||||
} catch (NoSuchMethodException nsme) {
|
} 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());
|
o.getClass().getName());
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -1391,6 +1390,9 @@ public class PApplet extends Applet
|
|||||||
//System.out.println("handleDraw() " + frameCount);
|
//System.out.println("handleDraw() " + frameCount);
|
||||||
|
|
||||||
g.beginDraw();
|
g.beginDraw();
|
||||||
|
if (recorder != null) {
|
||||||
|
recorder.beginDraw();
|
||||||
|
}
|
||||||
|
|
||||||
long now = System.nanoTime();
|
long now = System.nanoTime();
|
||||||
|
|
||||||
@ -1442,6 +1444,9 @@ public class PApplet extends Applet
|
|||||||
}
|
}
|
||||||
|
|
||||||
g.endDraw();
|
g.endDraw();
|
||||||
|
if (recorder != null) {
|
||||||
|
recorder.endDraw();
|
||||||
|
}
|
||||||
|
|
||||||
frameRateLastNanos = now;
|
frameRateLastNanos = now;
|
||||||
frameCount++;
|
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
|
// 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),
|
* "data" folder. However, when exported (as application or applet),
|
||||||
* sketch's data folder is exported as part of the applications jar file,
|
* 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.
|
* 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) {
|
public String dataPath(String where) {
|
||||||
// isAbsolute() could throw an access exception, but so will writing
|
// isAbsolute() could throw an access exception, but so will writing
|
||||||
@ -6401,7 +6484,6 @@ public class PApplet extends Applet
|
|||||||
System.exit(1);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
boolean external = false;
|
boolean external = false;
|
||||||
int[] location = null;
|
int[] location = null;
|
||||||
int[] editorLocation = null;
|
int[] editorLocation = null;
|
||||||
@ -6518,9 +6600,13 @@ public class PApplet extends Applet
|
|||||||
frame.setIconImage(image);
|
frame.setIconImage(image);
|
||||||
frame.setTitle(name);
|
frame.setTitle(name);
|
||||||
|
|
||||||
// Class c = Class.forName(name);
|
final PApplet applet;
|
||||||
|
try {
|
||||||
Class<?> c = Thread.currentThread().getContextClassLoader().loadClass(name);
|
Class<?> c = Thread.currentThread().getContextClassLoader().loadClass(name);
|
||||||
final PApplet applet = (PApplet) c.newInstance();
|
applet = (PApplet) c.newInstance();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
// these are needed before init/start
|
// these are needed before init/start
|
||||||
applet.frame = frame;
|
applet.frame = frame;
|
||||||
@ -6657,9 +6743,6 @@ public class PApplet extends Applet
|
|||||||
(applet.screen.height - applet.height) / 2);
|
(applet.screen.height - applet.height) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// frame.setLayout(null);
|
|
||||||
// frame.add(applet);
|
|
||||||
|
|
||||||
if (backgroundColor == Color.black) { //BLACK) {
|
if (backgroundColor == Color.black) { //BLACK) {
|
||||||
// this means no bg color unless specified
|
// this means no bg color unless specified
|
||||||
backgroundColor = SystemColor.control;
|
backgroundColor = SystemColor.control;
|
||||||
@ -6693,11 +6776,6 @@ public class PApplet extends Applet
|
|||||||
|
|
||||||
applet.requestFocus(); // ask for keydowns
|
applet.requestFocus(); // ask for keydowns
|
||||||
//System.out.println("exiting main()");
|
//System.out.println("exiting main()");
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
System.exit(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -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) {
|
public void text(char c) {
|
||||||
if (recorder != null) recorder.text(c);
|
if (recorder != null) recorder.text(c);
|
||||||
g.text(c);
|
g.text(c);
|
||||||
|
@ -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
|
* Implementation of returning the text width of
|
||||||
* the chars [start, stop) in the buffer.
|
* the chars [start, stop) in the buffer.
|
||||||
@ -2914,7 +2922,7 @@ public class PGraphics extends PImage implements PConstants {
|
|||||||
* Emit a sentence of text, defined as a chunk of text without any newlines.
|
* 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
|
* @param stop non-inclusive, the end of the text in question
|
||||||
*/
|
*/
|
||||||
private boolean textSentence(char[] buffer, int start, int stop,
|
protected boolean textSentence(char[] buffer, int start, int stop,
|
||||||
float boxWidth, float spaceWidth) {
|
float boxWidth, float spaceWidth) {
|
||||||
float runningX = 0;
|
float runningX = 0;
|
||||||
|
|
||||||
@ -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) {
|
if (textBreakCount == textBreakStart.length) {
|
||||||
textBreakStart = PApplet.expand(textBreakStart);
|
textBreakStart = PApplet.expand(textBreakStart);
|
||||||
textBreakStop = PApplet.expand(textBreakStop);
|
textBreakStop = PApplet.expand(textBreakStop);
|
||||||
|
@ -283,7 +283,7 @@ public class PGraphics2D extends PGraphics {
|
|||||||
case TRIANGLE_FAN:
|
case TRIANGLE_FAN:
|
||||||
// do fill and stroke separately because otherwise
|
// do fill and stroke separately because otherwise
|
||||||
// the lines will be stroked more than necessary
|
// the lines will be stroked more than necessary
|
||||||
if (fill) {
|
if (fill || textureImage != null) {
|
||||||
fpolygon.vertexCount = 3;
|
fpolygon.vertexCount = 3;
|
||||||
|
|
||||||
for (int i = 1; i < vertexCount-1; i++) {
|
for (int i = 1; i < vertexCount-1; i++) {
|
||||||
@ -342,7 +342,7 @@ public class PGraphics2D extends PGraphics {
|
|||||||
increment = (shape == TRIANGLES) ? 3 : 1;
|
increment = (shape == TRIANGLES) ? 3 : 1;
|
||||||
// do fill and stroke separately because otherwise
|
// do fill and stroke separately because otherwise
|
||||||
// the lines will be stroked more than necessary
|
// the lines will be stroked more than necessary
|
||||||
if (fill) {
|
if (fill || textureImage != null) {
|
||||||
fpolygon.vertexCount = 3;
|
fpolygon.vertexCount = 3;
|
||||||
for (int i = 0; i < vertexCount-2; i += increment) {
|
for (int i = 0; i < vertexCount-2; i += increment) {
|
||||||
for (int j = 0; j < 3; j++) {
|
for (int j = 0; j < 3; j++) {
|
||||||
@ -379,7 +379,7 @@ public class PGraphics2D extends PGraphics {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case QUADS:
|
case QUADS:
|
||||||
if (fill) {
|
if (fill || textureImage != null) {
|
||||||
fpolygon.vertexCount = 4;
|
fpolygon.vertexCount = 4;
|
||||||
for (int i = 0; i < vertexCount-3; i += 4) {
|
for (int i = 0; i < vertexCount-3; i += 4) {
|
||||||
for (int j = 0; j < 4; j++) {
|
for (int j = 0; j < 4; j++) {
|
||||||
@ -412,7 +412,7 @@ public class PGraphics2D extends PGraphics {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case QUAD_STRIP:
|
case QUAD_STRIP:
|
||||||
if (fill) {
|
if (fill || textureImage != null) {
|
||||||
fpolygon.vertexCount = 4;
|
fpolygon.vertexCount = 4;
|
||||||
for (int i = 0; i < vertexCount-3; i += 2) {
|
for (int i = 0; i < vertexCount-3; i += 2) {
|
||||||
for (int j = 0; j < 4; j++) {
|
for (int j = 0; j < 4; j++) {
|
||||||
@ -445,7 +445,7 @@ public class PGraphics2D extends PGraphics {
|
|||||||
|
|
||||||
case POLYGON:
|
case POLYGON:
|
||||||
if (isConvex()) {
|
if (isConvex()) {
|
||||||
if (fill) {
|
if (fill || textureImage != null) {
|
||||||
//System.out.println("convex");
|
//System.out.println("convex");
|
||||||
fpolygon.renderPolygon(vertices, vertexCount);
|
fpolygon.renderPolygon(vertices, vertexCount);
|
||||||
//if (stroke) polygon.unexpand();
|
//if (stroke) polygon.unexpand();
|
||||||
@ -463,7 +463,7 @@ public class PGraphics2D extends PGraphics {
|
|||||||
}
|
}
|
||||||
} else { // not convex
|
} else { // not convex
|
||||||
//System.out.println("concave");
|
//System.out.println("concave");
|
||||||
if (fill) {
|
if (fill || textureImage != null) {
|
||||||
// the triangulator produces polygons that don't align
|
// the triangulator produces polygons that don't align
|
||||||
// when smoothing is enabled. but if there is a stroke around
|
// when smoothing is enabled. but if there is a stroke around
|
||||||
// the polygon, then smoothing can be temporarily disabled.
|
// the polygon, then smoothing can be temporarily disabled.
|
||||||
@ -1423,11 +1423,6 @@ public class PGraphics2D extends PGraphics {
|
|||||||
*/
|
*/
|
||||||
private void simple_image(PImage image, int sx1, int sy1,
|
private void simple_image(PImage image, int sx1, int sy1,
|
||||||
int ix1, int iy1, int ix2, int iy2) {
|
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 sx2 = sx1 + image.width;
|
||||||
int sy2 = sy1 + image.height;
|
int sy2 = sy1 + image.height;
|
||||||
|
|
||||||
@ -1703,7 +1698,7 @@ public class PGraphics2D extends PGraphics {
|
|||||||
float len = (float) Math.sqrt(dX*dX + dY*dY);
|
float len = (float) Math.sqrt(dX*dX + dY*dY);
|
||||||
|
|
||||||
// TODO stroke width should be transformed!
|
// TODO stroke width should be transformed!
|
||||||
float rh = strokeWeight / len;
|
float rh = (strokeWeight / len) / 2;
|
||||||
|
|
||||||
float dx0 = rh * dY;
|
float dx0 = rh * dY;
|
||||||
float dy0 = rh * dX;
|
float dy0 = rh * dX;
|
||||||
|
@ -608,7 +608,7 @@ public class PGraphics3D extends PGraphics {
|
|||||||
endShapeStroke(mode);
|
endShapeStroke(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fill) {
|
if (fill || textureImage != null) {
|
||||||
endShapeFill();
|
endShapeFill();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -622,7 +622,7 @@ public class PGraphics3D extends PGraphics {
|
|||||||
// render shape and fill here if not saving the shapes for later
|
// render shape and fill here if not saving the shapes for later
|
||||||
// if true, the shapes will be rendered on endDraw
|
// if true, the shapes will be rendered on endDraw
|
||||||
if (!hints[ENABLE_DEPTH_SORT]) {
|
if (!hints[ENABLE_DEPTH_SORT]) {
|
||||||
if (fill) {
|
if (fill || textureImage != null) {
|
||||||
if (triangleCount > 0) {
|
if (triangleCount > 0) {
|
||||||
renderTriangles(0, triangleCount);
|
renderTriangles(0, triangleCount);
|
||||||
if (raw != null) {
|
if (raw != null) {
|
||||||
@ -957,8 +957,8 @@ public class PGraphics3D extends PGraphics {
|
|||||||
protected void addPoint(int a) {
|
protected void addPoint(int a) {
|
||||||
if (pointCount == points.length) {
|
if (pointCount == points.length) {
|
||||||
int[][] temp = new int[pointCount << 1][LINE_FIELD_COUNT];
|
int[][] temp = new int[pointCount << 1][LINE_FIELD_COUNT];
|
||||||
System.arraycopy(lines, 0, temp, 0, lineCount);
|
System.arraycopy(points, 0, temp, 0, lineCount);
|
||||||
lines = temp;
|
points = temp;
|
||||||
}
|
}
|
||||||
points[pointCount][VERTEX1] = a;
|
points[pointCount][VERTEX1] = a;
|
||||||
//points[pointCount][STROKE_MODE] = strokeCap | strokeJoin;
|
//points[pointCount][STROKE_MODE] = strokeCap | strokeJoin;
|
||||||
|
@ -467,11 +467,11 @@ public class PGraphicsJava2D extends PGraphics /*PGraphics2D*/ {
|
|||||||
|
|
||||||
public void point(float x, float y) {
|
public void point(float x, float y) {
|
||||||
if (stroke) {
|
if (stroke) {
|
||||||
if (strokeWeight > 1) {
|
// if (strokeWeight > 1) {
|
||||||
line(x, y, x + EPSILON, y + EPSILON);
|
line(x, y, x + EPSILON, y + EPSILON);
|
||||||
} else {
|
// } else {
|
||||||
set((int) screenX(x, y), (int) screenY(x, y), strokeColor);
|
// set((int) screenX(x, y), (int) screenY(x, y), strokeColor);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -745,6 +745,7 @@ public class PGraphicsJava2D extends PGraphics /*PGraphics2D*/ {
|
|||||||
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
||||||
RenderingHints.VALUE_ANTIALIAS_ON);
|
RenderingHints.VALUE_ANTIALIAS_ON);
|
||||||
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
|
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
|
||||||
|
// RenderingHints.VALUE_INTERPOLATION_BILINEAR);
|
||||||
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
|
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ public class PImage implements PConstants, Cloneable {
|
|||||||
public java.awt.Image getImage() {
|
public java.awt.Image getImage() {
|
||||||
loadPixels();
|
loadPixels();
|
||||||
int type = (format == RGB) ?
|
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);
|
BufferedImage image = new BufferedImage(width, height, type);
|
||||||
WritableRaster wr = image.getRaster();
|
WritableRaster wr = image.getRaster();
|
||||||
wr.setDataElements(0, 0, width, height, pixels);
|
wr.setDataElements(0, 0, width, height, pixels);
|
||||||
@ -499,7 +499,11 @@ public class PImage implements PConstants, Cloneable {
|
|||||||
*/
|
*/
|
||||||
public PImage get() {
|
public PImage get() {
|
||||||
try {
|
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) {
|
} catch (CloneNotSupportedException e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -529,9 +529,10 @@ public class PVector {
|
|||||||
* @return the angle between the vectors
|
* @return the angle between the vectors
|
||||||
*/
|
*/
|
||||||
static public float angleBetween(PVector v1, PVector v2) {
|
static public float angleBetween(PVector v1, PVector v2) {
|
||||||
float dot = v1.dot(v2);
|
double dot = v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
|
||||||
float theta = (float) Math.acos(dot / (v1.mag() * v2.mag()));
|
double v1mag = Math.sqrt(v1.x * v1.x + v1.y * v1.y + v1.z * v1.z);
|
||||||
return theta;
|
double v2mag = Math.sqrt(v2.x * v2.x + v2.y * v2.y + v2.z * v2.z);
|
||||||
|
return (float) Math.acos(dot / (v1mag * v2mag));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1335,6 +1335,11 @@ public class XMLElement implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return toString(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String toString(boolean pretty) {
|
public String toString(boolean pretty) {
|
||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
OutputStreamWriter osw = new OutputStreamWriter(baos);
|
OutputStreamWriter osw = new OutputStreamWriter(baos);
|
||||||
|
@ -1,24 +1,58 @@
|
|||||||
0165 core (1.0.3)
|
0169 core
|
||||||
X update to itext 2.1.4
|
X remove major try/catch block from PApplet.main()
|
||||||
X endRecord or endRaw produces RuntimeException with PDF library
|
X hopefully will allow some exception stuff to come through properly
|
||||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1169
|
X PVector.angleDistance() returns NaN
|
||||||
X problem with beginRaw/endRaw and OpenGL
|
X http://dev.processing.org/bugs/show_bug.cgi?id=1316
|
||||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1171
|
|
||||||
X set strokeWeight with begin/endRaw
|
_ make the index lookup use numbers up to 256?
|
||||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1172
|
|
||||||
X fix strokeWeight with P3D (better version of line hack)
|
_ decide whether to keep:
|
||||||
X make P3D use proper weights
|
_ public float textWidth(char[] chars, int start, int length)
|
||||||
X ArrayIndexOutOfBoundsException with point()
|
|
||||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1168
|
_ 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
|
_ if no draw() method, and renderer is not displayable, then exit
|
||||||
_ static mode PDFs shouldn't just hang
|
_ static mode PDFs shouldn't just hang
|
||||||
_ public PImage(java.awt.Image) sets format to RGB (but could be ARGB)
|
|
||||||
|
|
||||||
|
|
||||||
[ known problems ]
|
[ 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()
|
_ OPENGL sketches flicker w/ Vista when background() not used inside draw()
|
||||||
_ http://dev.processing.org/bugs/show_bug.cgi?id=930
|
_ http://dev.processing.org/bugs/show_bug.cgi?id=930
|
||||||
_ Disabling Aero scheme sometimes prevents the problem
|
_ Disabling Aero scheme sometimes prevents the problem
|
||||||
|
Loading…
x
Reference in New Issue
Block a user