mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-17 06:52:18 +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
|
||||
|
||||
Copyright (c) 2004-08 Ben Fry and Casey Reas
|
||||
Copyright (c) 2004-09 Ben Fry and Casey Reas
|
||||
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
it under the terms of the GNU General Public License version 2
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -44,14 +43,14 @@ public class Base {
|
||||
static final int REVISION = 18;
|
||||
static String VERSION_NAME = "0018";
|
||||
|
||||
static HashMap<Integer, String> platformNames = new HashMap();
|
||||
static HashMap<Integer, String> platformNames = new HashMap<Integer, String>();
|
||||
static {
|
||||
platformNames.put(PConstants.WINDOWS, "windows");
|
||||
platformNames.put(PConstants.MACOSX, "macosx");
|
||||
platformNames.put(PConstants.LINUX, "linux");
|
||||
}
|
||||
|
||||
static HashMap<String, Integer> platformIndices = new HashMap();
|
||||
static HashMap<String, Integer> platformIndices = new HashMap<String, Integer>();
|
||||
static {
|
||||
platformIndices.put("windows", PConstants.WINDOWS);
|
||||
platformIndices.put("macosx", PConstants.MACOSX);
|
||||
@ -90,7 +89,7 @@ public class Base {
|
||||
static File untitledFolder;
|
||||
|
||||
// p5 icon for the window
|
||||
static Image icon;
|
||||
// static Image icon;
|
||||
|
||||
// int editorCount;
|
||||
// Editor[] editors;
|
||||
@ -102,8 +101,24 @@ public class Base {
|
||||
// int nextEditorX;
|
||||
// int nextEditorY;
|
||||
|
||||
// import com.sun.jna.Library;
|
||||
// import com.sun.jna.Native;
|
||||
|
||||
// public interface CLibrary extends Library {
|
||||
// CLibrary INSTANCE = (CLibrary)Native.loadLibrary("c", CLibrary.class);
|
||||
// int setenv(String name, String value, int overwrite);
|
||||
// String getenv(String name);
|
||||
// int unsetenv(String name);
|
||||
// int putenv(String string);
|
||||
// }
|
||||
|
||||
|
||||
static public void main(String args[]) {
|
||||
// /Users/fry/coconut/sketchbook/libraries/gsvideo/library
|
||||
// CLibrary clib = CLibrary.INSTANCE;
|
||||
// clib.setenv("DYLD_LIBRARY_PATH", "/Users/fry/coconut/sketchbook/libraries/gsvideo/library", 1);
|
||||
// System.out.println("env is now " + clib.getenv("DYLD_LIBRARY_PATH"));
|
||||
|
||||
try {
|
||||
File versionFile = getContentFile("lib/version.txt");
|
||||
if (versionFile.exists()) {
|
||||
@ -188,12 +203,14 @@ public class Base {
|
||||
"b { font: 13pt \"Lucida Grande\" }"+
|
||||
"p { font: 11pt \"Lucida Grande\"; margin-top: 8px }"+
|
||||
"</style> </head> <body>" +
|
||||
"<b>The standard menu bar has been disabled.</b>" +
|
||||
"<p>Due to an Apple bug, the Arduino menu bar " +
|
||||
"is unusable on Mac OS X 10.5. <br>" +
|
||||
"As a workaround, the menu bar will be placed inside " +
|
||||
"the editor window. This <br>setting can be changed in the " +
|
||||
"Preferences window. If this bug makes you sad, <br>" +
|
||||
"<b>Some menus have been disabled.</b>" +
|
||||
"<p>Due to an Apple bug, the Sketchbook and Example menus " +
|
||||
"are unusable. <br>" +
|
||||
"As a workaround, these items will be disabled from the " +
|
||||
"standard menu bar, <br>" +
|
||||
"but you can use the Open button on " +
|
||||
"the toolbar to access the same items. <br>" +
|
||||
"If this bug makes you sad, " +
|
||||
"please contact Apple via bugreporter.apple.com.</p>" +
|
||||
"</body> </html>";
|
||||
Object[] options = { "OK", "More Info" };
|
||||
@ -210,13 +227,18 @@ public class Base {
|
||||
// But don't bother setting the preference in the file
|
||||
} else {
|
||||
// Shut off in the preferences for next time
|
||||
Preferences.set(properMenuBar, "false");
|
||||
//Preferences.set(properMenuBar, "false");
|
||||
// For 1.0.4, we'll stick with the Apple menu bar,
|
||||
// and just disable the sketchbook and examples sub-menus.
|
||||
Preferences.set(properMenuBar, "true");
|
||||
if (result == 1) { // More Info
|
||||
Base.openURL("http://dev.processing.org/bugs/show_bug.cgi?id=786");
|
||||
}
|
||||
}
|
||||
// Whether or not canceled, set to false (right now) if we're on 10.5
|
||||
System.setProperty(properMenuBar, "false");
|
||||
//System.setProperty(properMenuBar, "false");
|
||||
// Changing this behavior for 1.0.4
|
||||
System.setProperty(properMenuBar, "true");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -711,13 +733,17 @@ public class Base {
|
||||
|
||||
|
||||
protected Editor handleOpen(String path, int[] location) {
|
||||
// System.err.println("entering handleOpen " + path);
|
||||
|
||||
File file = new File(path);
|
||||
if (!file.exists()) return null;
|
||||
|
||||
// System.err.println(" editors: " + editors);
|
||||
// Cycle through open windows to make sure that it's not already open.
|
||||
for (Editor editor : editors) {
|
||||
if (editor.getSketch().getMainFilePath().equals(path)) {
|
||||
editor.toFront();
|
||||
// System.err.println(" handleOpen: already opened");
|
||||
return editor;
|
||||
}
|
||||
}
|
||||
@ -736,10 +762,23 @@ public class Base {
|
||||
// }
|
||||
// }
|
||||
|
||||
// System.err.println(" creating new editor");
|
||||
Editor editor = new Editor(this, path, location);
|
||||
// Editor editor = null;
|
||||
// try {
|
||||
// editor = new Editor(this, path, location);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// System.err.flush();
|
||||
// System.out.flush();
|
||||
// System.exit(1);
|
||||
// }
|
||||
// System.err.println(" done creating new editor");
|
||||
// EditorConsole.systemErr.println(" done creating new editor");
|
||||
|
||||
// Make sure that the sketch actually loaded
|
||||
if (editor.getSketch() == null) {
|
||||
// System.err.println("sketch was null, getting out of handleOpen");
|
||||
return null; // Just walk away quietly
|
||||
}
|
||||
|
||||
@ -763,6 +802,8 @@ public class Base {
|
||||
// (don't do earlier, cuz we might move it based on a window being closed)
|
||||
editor.setVisible(true);
|
||||
|
||||
// System.err.println("exiting handleOpen");
|
||||
|
||||
return editor;
|
||||
}
|
||||
|
||||
@ -952,9 +993,16 @@ public class Base {
|
||||
protected void rebuildSketchbookMenu(JMenu menu) {
|
||||
//System.out.println("rebuilding sketchbook menu");
|
||||
//new Exception().printStackTrace();
|
||||
boolean nativeButBroken = Base.isMacOS() ?
|
||||
Preferences.getBoolean("apple.laf.useScreenMenuBar") : false;
|
||||
|
||||
try {
|
||||
if (nativeButBroken) { // osx workaround
|
||||
menu.setEnabled(false);
|
||||
} else {
|
||||
menu.removeAll();
|
||||
addSketches(menu, getSketchbookFolder(), false);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -971,33 +1019,45 @@ public class Base {
|
||||
// reset the table mapping imports to libraries
|
||||
importToLibraryTable = new HashMap<String, File>();
|
||||
|
||||
// Add libraries found in the sketchbook folder
|
||||
try {
|
||||
File sketchbookLibraries = getSketchbookLibrariesFolder();
|
||||
boolean found = addLibraries(importMenu, sketchbookLibraries);
|
||||
if (found) importMenu.addSeparator();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// Add from the "libraries" subfolder in the Processing directory
|
||||
try {
|
||||
addLibraries(importMenu, librariesFolder);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// Add libraries found in the sketchbook folder
|
||||
int separatorIndex = importMenu.getItemCount();
|
||||
try {
|
||||
File sketchbookLibraries = getSketchbookLibrariesFolder();
|
||||
boolean found = addLibraries(importMenu, sketchbookLibraries);
|
||||
if (found) {
|
||||
JMenuItem contrib = new JMenuItem("Contributed");
|
||||
contrib.setEnabled(false);
|
||||
importMenu.insert(contrib, separatorIndex);
|
||||
importMenu.insertSeparator(separatorIndex);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void rebuildExamplesMenu(JMenu menu) {
|
||||
//System.out.println("rebuilding examples menu");
|
||||
boolean nativeButBroken = Base.isMacOS() ?
|
||||
Preferences.getBoolean("apple.laf.useScreenMenuBar") : false;
|
||||
|
||||
try {
|
||||
if (nativeButBroken) { // osx workaround
|
||||
menu.setEnabled(false);
|
||||
} else {
|
||||
menu.removeAll();
|
||||
boolean found = addSketches(menu, examplesFolder, false);
|
||||
if (found) menu.addSeparator();
|
||||
found = addSketches(menu, getSketchbookLibrariesFolder(), false);
|
||||
if (found) menu.addSeparator();
|
||||
addSketches(menu, librariesFolder, false);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -1126,23 +1186,24 @@ public class Base {
|
||||
|
||||
boolean ifound = false;
|
||||
|
||||
for (String libraryName : list) {
|
||||
File subfolder = new File(folder, libraryName);
|
||||
for (String potentialName : list) {
|
||||
File subfolder = new File(folder, potentialName);
|
||||
// File libraryFolder = new File(subfolder, "library");
|
||||
// File libraryJar = new File(libraryFolder, libraryName + ".jar");
|
||||
// File libraryJar = new File(libraryFolder, potentialName + ".jar");
|
||||
// // If a .jar file of the same prefix as the folder exists
|
||||
// // inside the 'library' subfolder of the sketch
|
||||
// if (libraryJar.exists()) {
|
||||
String sanityCheck = Sketch.sanitizeName(libraryName);
|
||||
if (!sanityCheck.equals(libraryName)) {
|
||||
String sanityCheck = Sketch.sanitizeName(potentialName);
|
||||
if (!sanityCheck.equals(potentialName)) {
|
||||
String mess =
|
||||
"The library \"" + libraryName + "\" cannot be used.\n" +
|
||||
"The library \"" + potentialName + "\" cannot be used.\n" +
|
||||
"Library names must contain only basic letters and numbers.\n" +
|
||||
"(ascii only and no spaces, and it cannot start with a number)";
|
||||
"(ASCII only and no spaces, and it cannot start with a number)";
|
||||
Base.showMessage("Ignoring bad library name", mess);
|
||||
continue;
|
||||
}
|
||||
|
||||
String libraryName = potentialName;
|
||||
// // get the path for all .jar files in this code folder
|
||||
// String libraryClassPath =
|
||||
// Compiler.contentsToClassPath(libraryFolder);
|
||||
|
@ -3,13 +3,12 @@
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2004-08 Ben Fry and Casey Reas
|
||||
Copyright (c) 2004-09 Ben Fry and Casey Reas
|
||||
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
it under the terms of the GNU General Public License version 2
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -161,8 +160,8 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
// When bringing a window to front, let the Base know
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowActivated(WindowEvent e) {
|
||||
// System.err.println("activate"); // not coming through
|
||||
base.handleActivated(Editor.this);
|
||||
|
||||
// re-add the sub-menus that are shared by all windows
|
||||
fileMenu.insert(sketchbookMenu, 2);
|
||||
fileMenu.insert(examplesMenu, 3);
|
||||
@ -170,6 +169,17 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
toolsMenu.insert(boardsMenu, numTools);
|
||||
toolsMenu.insert(serialMenu, numTools + 1);
|
||||
}
|
||||
|
||||
// added for 1.0.5
|
||||
// http://dev.processing.org/bugs/show_bug.cgi?id=1260
|
||||
public void windowDeactivated(WindowEvent e) {
|
||||
// System.err.println("deactivate"); // not coming through
|
||||
fileMenu.remove(sketchbookMenu);
|
||||
fileMenu.remove(examplesMenu);
|
||||
sketchMenu.remove(importMenu);
|
||||
toolsMenu.remove(boardsMenu);
|
||||
toolsMenu.remove(serialMenu);
|
||||
}
|
||||
});
|
||||
|
||||
//PdeKeywords keywords = new PdeKeywords();
|
||||
@ -717,7 +727,7 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
|
||||
URL[] urlList = new URL[archives.length];
|
||||
for (int j = 0; j < urlList.length; j++) {
|
||||
urlList[j] = archives[j].toURL();
|
||||
urlList[j] = archives[j].toURI().toURL();
|
||||
}
|
||||
URLClassLoader loader = new URLClassLoader(urlList);
|
||||
|
||||
@ -963,6 +973,8 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
|
||||
|
||||
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 ");
|
||||
JMenuItem item;
|
||||
|
||||
|
@ -305,16 +305,17 @@ public class EditorConsole extends JScrollPane {
|
||||
public void flush() { }
|
||||
|
||||
public void write(byte b[]) { // appears never to be used
|
||||
// if (currentConsole.isDisplayable()) {
|
||||
if (currentConsole != null) {
|
||||
currentConsole.write(b, 0, b.length, err);
|
||||
// } else {
|
||||
// systemOut.println("not displayable");
|
||||
// if (err) {
|
||||
// systemErr.write(b, 0, b.length);
|
||||
// } else {
|
||||
// systemOut.write(b, 0, b.length);
|
||||
// }
|
||||
// }
|
||||
} else {
|
||||
try {
|
||||
if (err) {
|
||||
systemErr.write(b);
|
||||
} else {
|
||||
systemOut.write(b);
|
||||
}
|
||||
} catch (IOException e) { } // just ignore, where would we write?
|
||||
}
|
||||
|
||||
OutputStream echo = err ? stderrFile : stdoutFile;
|
||||
if (echo != null) {
|
||||
@ -329,18 +330,17 @@ public class EditorConsole extends JScrollPane {
|
||||
}
|
||||
|
||||
public void write(byte b[], int offset, int length) {
|
||||
if (currentConsole != null) {
|
||||
currentConsole.write(b, offset, length, err);
|
||||
// if (currentConsole.isDisplayable()) {
|
||||
// systemOut.println("is displayable");
|
||||
// currentConsole.write(b, offset, length, err);
|
||||
// } else {
|
||||
// systemOut.println("not displayable");
|
||||
// if (err) {
|
||||
// systemErr.write(b, offset, length);
|
||||
// } else {
|
||||
// systemOut.write(b, offset, length);
|
||||
// }
|
||||
// }
|
||||
} else {
|
||||
try {
|
||||
if (err) {
|
||||
systemErr.write(b);
|
||||
} else {
|
||||
systemOut.write(b);
|
||||
}
|
||||
} catch (IOException e) { } // just ignore, where would we write?
|
||||
}
|
||||
|
||||
OutputStream echo = err ? stderrFile : stdoutFile;
|
||||
if (echo != null) {
|
||||
@ -356,7 +356,12 @@ public class EditorConsole extends JScrollPane {
|
||||
|
||||
public void write(int b) {
|
||||
single[0] = (byte)b;
|
||||
if (currentConsole != null) {
|
||||
currentConsole.write(single, 0, 1, err);
|
||||
} else {
|
||||
// redirect for all the extra handling above
|
||||
write(new byte[] { (byte) b }, 0, 1);
|
||||
}
|
||||
|
||||
OutputStream echo = err ? stderrFile : stdoutFile;
|
||||
if (echo != null) {
|
||||
|
@ -3,7 +3,7 @@
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2004-06 Ben Fry and Casey Reas
|
||||
Copyright (c) 2004-09 Ben Fry and Casey Reas
|
||||
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@ -34,8 +34,6 @@ import processing.app.syntax.*;
|
||||
import processing.core.*;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Storage class for user preferences and environment settings.
|
||||
* <P>
|
||||
@ -144,9 +142,9 @@ public class Preferences {
|
||||
|
||||
// data model
|
||||
|
||||
static Hashtable defaults;
|
||||
static Hashtable table = new Hashtable();;
|
||||
static Hashtable prefixes = new Hashtable();
|
||||
static HashMap<String,String> defaults;
|
||||
static HashMap<String,String> table = new HashMap<String,String>();;
|
||||
static HashMap<String,HashMap<String,String>> prefixes = new HashMap<String,HashMap<String,String>>();
|
||||
static File preferencesFile;
|
||||
|
||||
|
||||
@ -161,22 +159,8 @@ public class Preferences {
|
||||
"You'll need to reinstall Arduino.", e);
|
||||
}
|
||||
|
||||
// check for platform-specific properties in the defaults
|
||||
String platformExt = "." + PConstants.platformNames[PApplet.platform];
|
||||
int platformExtLength = platformExt.length();
|
||||
Enumeration e = table.keys();
|
||||
while (e.hasMoreElements()) {
|
||||
String key = (String) e.nextElement();
|
||||
if (key.endsWith(platformExt)) {
|
||||
// this is a key specific to a particular platform
|
||||
String actualKey = key.substring(0, key.length() - platformExtLength);
|
||||
String value = get(key);
|
||||
table.put(actualKey, value);
|
||||
}
|
||||
}
|
||||
|
||||
// clone the hash table
|
||||
defaults = (Hashtable) table.clone();
|
||||
defaults = (HashMap<String, String>) table.clone();
|
||||
|
||||
// other things that have to be set explicitly for the defaults
|
||||
setColor("run.window.bgcolor", SystemColor.control);
|
||||
@ -445,6 +429,20 @@ public class Preferences {
|
||||
top += d.height; // + GUI_SMALL;
|
||||
|
||||
label = new JLabel(preferencesFile.getAbsolutePath());
|
||||
final JLabel clickable = label;
|
||||
label.addMouseListener(new MouseAdapter() {
|
||||
public void mousePressed(MouseEvent e) {
|
||||
Base.openFolder(Base.getSettingsFolder());
|
||||
}
|
||||
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
clickable.setForeground(new Color(0, 0, 140));
|
||||
}
|
||||
|
||||
public void mouseExited(MouseEvent e) {
|
||||
clickable.setForeground(Color.BLACK);
|
||||
}
|
||||
});
|
||||
pain.add(label);
|
||||
d = label.getPreferredSize();
|
||||
label.setBounds(left, top, d.width, d.height);
|
||||
@ -678,12 +676,16 @@ public class Preferences {
|
||||
}
|
||||
|
||||
static protected void load(InputStream input, String prefix) throws IOException {
|
||||
Map table = new LinkedHashMap();
|
||||
LinkedHashMap<String,String> table = new LinkedHashMap<String,String>();
|
||||
prefixes.put(prefix, table);
|
||||
load(input, table);
|
||||
}
|
||||
|
||||
static protected void load(InputStream input, Map table) throws IOException {
|
||||
// check for platform-specific properties in the defaults
|
||||
String platformExt = "." + PConstants.platformNames[PApplet.platform];
|
||||
int platformExtLength = platformExt.length();
|
||||
|
||||
String[] lines = PApplet.loadStrings(input); // Reads as UTF-8
|
||||
for (String line : lines) {
|
||||
if ((line.length() == 0) ||
|
||||
@ -693,6 +695,12 @@ public class Preferences {
|
||||
int equals = line.indexOf('=');
|
||||
if (equals != -1) {
|
||||
String key = line.substring(0, equals).trim();
|
||||
|
||||
// check if this is a platform-specific key, and if so, shave things
|
||||
if (key.endsWith(platformExt)) {
|
||||
// this is a key specific to this platform
|
||||
key = key.substring(0, key.length() - platformExtLength);
|
||||
}
|
||||
String value = line.substring(equals + 1).trim();
|
||||
table.put(key, value);
|
||||
}
|
||||
@ -713,10 +721,8 @@ public class Preferences {
|
||||
// Fix for 0163 to properly use Unicode when writing preferences.txt
|
||||
PrintWriter writer = PApplet.createWriter(preferencesFile);
|
||||
|
||||
Enumeration e = table.keys(); //properties.propertyNames();
|
||||
while (e.hasMoreElements()) {
|
||||
String key = (String) e.nextElement();
|
||||
writer.println(key + "=" + ((String) table.get(key)));
|
||||
for (String key : table.keySet()) {
|
||||
writer.println(key + "=" + table.get(key));
|
||||
}
|
||||
|
||||
writer.flush();
|
||||
@ -742,15 +748,15 @@ public class Preferences {
|
||||
// preference files, look up the attribute in that file's Hashtable
|
||||
// (don't override with or fallback to the main file). otherwise,
|
||||
// look up the attribute in the main file's Hashtable.
|
||||
Map table = Preferences.table;
|
||||
HashMap<String,String> table = Preferences.table;
|
||||
if (attribute.indexOf('.') != -1) {
|
||||
String prefix = attribute.substring(0, attribute.indexOf('.'));
|
||||
if (prefixes.containsKey(prefix)) {
|
||||
table = (Map) prefixes.get(prefix);
|
||||
table = prefixes.get(prefix);
|
||||
attribute = attribute.substring(attribute.indexOf('.') + 1);
|
||||
}
|
||||
}
|
||||
return (String) table.get(attribute);
|
||||
return table.get(attribute);
|
||||
/*
|
||||
//String value = (properties != null) ?
|
||||
//properties.getProperty(attribute) : applet.getParameter(attribute);
|
||||
@ -785,7 +791,7 @@ public class Preferences {
|
||||
|
||||
|
||||
static public String getDefault(String attribute) {
|
||||
return (String) defaults.get(attribute);
|
||||
return defaults.get(attribute);
|
||||
}
|
||||
|
||||
|
||||
@ -857,11 +863,6 @@ public class Preferences {
|
||||
|
||||
|
||||
static public void setColor(String attr, Color what) {
|
||||
// String r = Integer.toHexString(what.getRed());
|
||||
// String g = Integer.toHexString(what.getGreen());
|
||||
// String b = Integer.toHexString(what.getBlue());
|
||||
// set(attr, "#" + r.substring(r.length() - 2) +
|
||||
// g.substring(g.length() - 2) + b.substring(b.length() - 2));
|
||||
set(attr, "#" + PApplet.hex(what.getRGB() & 0xffffff, 6));
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2005-06 Ben Fry and Casey Reas
|
||||
Copyright (c) 2005-09 Ben Fry and Casey Reas
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -59,7 +59,7 @@ public class PresentMode {
|
||||
devices = environment.getScreenDevices();
|
||||
GraphicsDevice defaultDevice = environment.getDefaultScreenDevice();
|
||||
|
||||
Vector names = new Vector();
|
||||
Vector<String> names = new Vector<String>();
|
||||
for (int i = 0; i < devices.length; i++) {
|
||||
String name = String.valueOf(i + 1);
|
||||
if (devices[i] == defaultDevice) {
|
||||
|
@ -3,7 +3,7 @@
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2004-08 Ben Fry and Casey Reas
|
||||
Copyright (c) 2004-09 Ben Fry and Casey Reas
|
||||
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@ -1558,8 +1558,8 @@ public class Sketch {
|
||||
* Read from a file with a bunch of attribute/value pairs
|
||||
* that are separated by = and ignore comments with #.
|
||||
*/
|
||||
protected Hashtable readSettings(File inputFile) {
|
||||
Hashtable outgoing = new Hashtable();
|
||||
protected HashMap<String,String> readSettings(File inputFile) {
|
||||
HashMap<String,String> outgoing = new HashMap<String,String>();
|
||||
if (!inputFile.exists()) return outgoing; // return empty hash
|
||||
|
||||
String lines[] = PApplet.loadStrings(inputFile);
|
||||
@ -1589,7 +1589,7 @@ public class Sketch {
|
||||
*/
|
||||
protected void packClassPathIntoZipFile(String path,
|
||||
ZipOutputStream zos,
|
||||
Hashtable zipFileContents)
|
||||
HashMap<String,Object> zipFileContents)
|
||||
throws IOException {
|
||||
String[] pieces = PApplet.split(path, File.pathSeparatorChar);
|
||||
|
||||
@ -1601,7 +1601,7 @@ public class Sketch {
|
||||
pieces[i].toLowerCase().endsWith(".zip")) {
|
||||
try {
|
||||
ZipFile file = new ZipFile(pieces[i]);
|
||||
Enumeration entries = file.entries();
|
||||
Enumeration<?> entries = file.entries();
|
||||
while (entries.hasMoreElements()) {
|
||||
ZipEntry entry = (ZipEntry) entries.nextElement();
|
||||
if (entry.isDirectory()) {
|
||||
|
@ -39,9 +39,9 @@ import processing.core.*;
|
||||
public class Theme {
|
||||
|
||||
/** Copy of the defaults in case the user mangles a preference. */
|
||||
static Hashtable defaults;
|
||||
static HashMap<String,String> defaults;
|
||||
/** Table of attributes/values for the theme. */
|
||||
static Hashtable table = new Hashtable();;
|
||||
static HashMap<String,String> table = new HashMap<String,String>();;
|
||||
|
||||
|
||||
static protected void init() {
|
||||
@ -55,9 +55,7 @@ public class Theme {
|
||||
// check for platform-specific properties in the defaults
|
||||
String platformExt = "." + Base.getPlatformName();
|
||||
int platformExtLength = platformExt.length();
|
||||
Enumeration e = table.keys();
|
||||
while (e.hasMoreElements()) {
|
||||
String key = (String) e.nextElement();
|
||||
for (String key : table.keySet()) {
|
||||
if (key.endsWith(platformExt)) {
|
||||
// this is a key specific to a particular platform
|
||||
String actualKey = key.substring(0, key.length() - platformExtLength);
|
||||
@ -70,7 +68,7 @@ public class Theme {
|
||||
setColor("run.window.bgcolor", SystemColor.control);
|
||||
|
||||
// clone the hash table
|
||||
defaults = (Hashtable) table.clone();
|
||||
defaults = (HashMap<String, String>) table.clone();
|
||||
}
|
||||
|
||||
|
||||
@ -142,11 +140,7 @@ public class Theme {
|
||||
|
||||
|
||||
static public void setColor(String attr, Color what) {
|
||||
String r = Integer.toHexString(what.getRed());
|
||||
String g = Integer.toHexString(what.getGreen());
|
||||
String b = Integer.toHexString(what.getBlue());
|
||||
set(attr, "#" + r.substring(r.length() - 2) +
|
||||
g.substring(g.length() - 2) + b.substring(b.length() - 2));
|
||||
set(attr, "#" + PApplet.hex(what.getRGB() & 0xffffff, 6));
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,31 +40,9 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.sun.jdi.Field;
|
||||
import com.sun.jdi.IncompatibleThreadStateException;
|
||||
import com.sun.jdi.ThreadReference;
|
||||
import com.sun.jdi.VMDisconnectedException;
|
||||
import com.sun.jdi.Value;
|
||||
import com.sun.jdi.VirtualMachine;
|
||||
import com.sun.jdi.event.ClassPrepareEvent;
|
||||
import com.sun.jdi.event.Event;
|
||||
import com.sun.jdi.event.EventIterator;
|
||||
import com.sun.jdi.event.EventQueue;
|
||||
import com.sun.jdi.event.EventSet;
|
||||
import com.sun.jdi.event.ExceptionEvent;
|
||||
import com.sun.jdi.event.MethodEntryEvent;
|
||||
import com.sun.jdi.event.MethodExitEvent;
|
||||
import com.sun.jdi.event.ModificationWatchpointEvent;
|
||||
import com.sun.jdi.event.StepEvent;
|
||||
import com.sun.jdi.event.ThreadDeathEvent;
|
||||
import com.sun.jdi.event.VMDeathEvent;
|
||||
import com.sun.jdi.event.VMDisconnectEvent;
|
||||
import com.sun.jdi.event.VMStartEvent;
|
||||
import com.sun.jdi.request.EventRequest;
|
||||
import com.sun.jdi.request.EventRequestManager;
|
||||
import com.sun.jdi.request.ExceptionRequest;
|
||||
import com.sun.jdi.request.ModificationWatchpointRequest;
|
||||
import com.sun.jdi.request.StepRequest;
|
||||
import com.sun.jdi.*;
|
||||
import com.sun.jdi.event.*;
|
||||
import com.sun.jdi.request.*;
|
||||
|
||||
/**
|
||||
* This class processes incoming JDI events and displays them
|
||||
@ -132,8 +110,9 @@ public class EventThread extends Thread {
|
||||
// deathReq.setSuspendPolicy(EventRequest.SUSPEND_ALL);
|
||||
// deathReq.enable();
|
||||
|
||||
// want all exceptions
|
||||
// get only the uncaught exceptions
|
||||
ExceptionRequest excReq = mgr.createExceptionRequest(null, false, true);
|
||||
// this version reports all exceptions, caught or uncaught
|
||||
//ExceptionRequest excReq = mgr.createExceptionRequest(null, true, true);
|
||||
// suspend so we can step
|
||||
excReq.setSuspendPolicy(EventRequest.SUSPEND_ALL);
|
||||
@ -380,7 +359,7 @@ public class EventThread extends Thread {
|
||||
}
|
||||
|
||||
private void exceptionEvent(ExceptionEvent event) {
|
||||
// ObjectReference or = event.exception();
|
||||
// com.sun.jdi.ObjectReference or = event.exception();
|
||||
// System.out.println("exceptionEvent() fired " + or);
|
||||
// System.out.println("catch location " + event.catchLocation());
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2004-08 Ben Fry and Casey Reas
|
||||
Copyright (c) 2004-09 Ben Fry and Casey Reas
|
||||
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@ -379,11 +379,16 @@ public class Runner implements MessageConsumer {
|
||||
//String addr = "localhost:" + (8000 + (int) (Math.random() * 1000));
|
||||
//String addr = "" + (8000 + (int) (Math.random() * 1000));
|
||||
|
||||
String commandArgs = Base.isWindows() ?
|
||||
"java -Xrunjdwp:transport=dt_shmem,address=" + addr + ",suspend=y " :
|
||||
String commandArgs =
|
||||
"java -Xrunjdwp:transport=dt_socket,address=" + addr + ",suspend=y ";
|
||||
//String commandArgs = "java -agentlib:jdwp=transport=dt_socket,address=" + addr + ",suspend=y ";
|
||||
//String commandArgs = "java -agentlib:jdwp=transport=dt_socket,address=" + addr + ",server=n,suspend=y ";
|
||||
if (Base.isWindows()) {
|
||||
commandArgs =
|
||||
"java -Xrunjdwp:transport=dt_shmem,address=" + addr + ",suspend=y ";
|
||||
} else if (Base.isMacOS()) {
|
||||
commandArgs =
|
||||
"java -d32 -Xrunjdwp:transport=dt_socket,address=" + addr + ",suspend=y ";
|
||||
}
|
||||
|
||||
for (int i = 0; i < vmParams.length; i++) {
|
||||
commandArgs = addArgument(commandArgs, vmParams[i], ' ');
|
||||
}
|
||||
@ -519,9 +524,11 @@ public class Runner implements MessageConsumer {
|
||||
// Shutdown begins when event thread terminates
|
||||
try {
|
||||
if (eventThread != null) eventThread.join();
|
||||
// System.out.println("in here");
|
||||
// Bug #852 tracked to this next line in the code.
|
||||
// http://dev.processing.org/bugs/show_bug.cgi?id=852
|
||||
errThread.join(); // Make sure output is forwarded
|
||||
// System.out.println("and then");
|
||||
outThread.join(); // before we exit
|
||||
// System.out.println("out of it");
|
||||
|
||||
@ -573,6 +580,7 @@ public class Runner implements MessageConsumer {
|
||||
|
||||
|
||||
public void exception(ExceptionEvent event) {
|
||||
// System.out.println(event);
|
||||
ObjectReference or = event.exception();
|
||||
ReferenceType rt = or.referenceType();
|
||||
String exceptionName = rt.name();
|
||||
|
@ -93,6 +93,7 @@ public class ThinkDifferent implements ApplicationListener {
|
||||
|
||||
|
||||
public void handleOpenFile(ApplicationEvent ae) {
|
||||
// System.out.println("got open file event " + ae.getFilename());
|
||||
String filename = ae.getFilename();
|
||||
base.handleOpen(filename);
|
||||
ae.setHandled(true);
|
||||
|
@ -51,7 +51,7 @@ import java.util.Vector;
|
||||
* + "}");</pre>
|
||||
*
|
||||
* @author Slava Pestov
|
||||
* @version $Id: JEditTextArea.java 5343 2008-11-29 17:22:59Z fry $
|
||||
* @version $Id: JEditTextArea.java 5625 2009-06-07 21:08:59Z fry $
|
||||
*/
|
||||
public class JEditTextArea extends JComponent
|
||||
{
|
||||
@ -103,6 +103,9 @@ public class JEditTextArea extends JComponent
|
||||
painter.addMouseListener(new MouseHandler());
|
||||
painter.addMouseMotionListener(new DragHandler());
|
||||
addFocusListener(new FocusHandler());
|
||||
// send tab keys through to the text area
|
||||
// http://dev.processing.org/bugs/show_bug.cgi?id=1267
|
||||
setFocusTraversalKeysEnabled(false);
|
||||
|
||||
// Load the defaults
|
||||
setInputHandler(defaults.inputHandler);
|
||||
@ -145,9 +148,9 @@ public class JEditTextArea extends JComponent
|
||||
* Returns if this component can be traversed by pressing
|
||||
* the Tab key. This returns false.
|
||||
*/
|
||||
public final boolean isManagingFocus() {
|
||||
return true;
|
||||
}
|
||||
// public final boolean isManagingFocus() {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Returns the object responsible for painting this text area.
|
||||
|
@ -30,6 +30,8 @@ implements TabExpander, Printable
|
||||
{
|
||||
/** True if inside printing, will handle disabling the highlight */
|
||||
boolean printing;
|
||||
/** Current setting for editor.antialias preference */
|
||||
boolean antialias;
|
||||
|
||||
/**
|
||||
* Creates a new repaint manager. This should be not be called
|
||||
@ -54,6 +56,8 @@ implements TabExpander, Printable
|
||||
setForeground(defaults.fgcolor);
|
||||
setBackground(defaults.bgcolor);
|
||||
|
||||
antialias = Preferences.getBoolean("editor.antialias");
|
||||
|
||||
blockCaret = defaults.blockCaret;
|
||||
styles = defaults.styles;
|
||||
cols = defaults.cols;
|
||||
@ -73,10 +77,10 @@ implements TabExpander, Printable
|
||||
* Returns if this component can be traversed by pressing the
|
||||
* Tab key. This returns false.
|
||||
*/
|
||||
public final boolean isManagingFocus()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// public final boolean isManagingFocus()
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Returns the syntax styles used to paint colorized text. Entry <i>n</i>
|
||||
@ -366,11 +370,11 @@ implements TabExpander, Printable
|
||||
*/
|
||||
public void paint(Graphics gfx)
|
||||
{
|
||||
if (Base.isMacOS()) {
|
||||
Graphics2D g2 = (Graphics2D) gfx;
|
||||
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
|
||||
antialias ?
|
||||
RenderingHints.VALUE_TEXT_ANTIALIAS_ON :
|
||||
RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
|
||||
}
|
||||
|
||||
tabSize = fm.charWidth(' ') * ((Integer)textArea.getDocument().getProperty(PlainDocument.tabSizeAttribute)).intValue();
|
||||
|
||||
|
@ -3,13 +3,14 @@
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2005-06 Ben Fry and Casey Reas
|
||||
Copyright (c) 2003 Martin Gomez, Ateneo de Manila University
|
||||
Original Copyright (c) 1997, 1998 Van Di-Han HO. All Rights Reserved.
|
||||
Updates Copyright (c) 2001 Jason Pell.
|
||||
Further updates Copyright (c) 2003 Martin Gomez, Ateneo de Manila University
|
||||
Bug fixes Copyright (c) 2005-09 Ben Fry and Casey Reas
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
the Free Software Foundation, version 2.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -24,13 +25,21 @@
|
||||
package processing.app.tools;
|
||||
|
||||
import processing.app.*;
|
||||
import processing.core.PApplet;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
|
||||
/**
|
||||
* Alternate handler for dealing with auto format.
|
||||
* Handler for dealing with auto format.
|
||||
* Contributed by Martin Gomez, additional bug fixes by Ben Fry.
|
||||
*
|
||||
* After some further digging, this code in fact appears to be a modified
|
||||
* version of Jason Pell's GPLed "Java Beautifier" class found here:
|
||||
* http://www.geocities.com/jasonpell/programs.html
|
||||
* Which is itself based on code from Van Di-Han Ho:
|
||||
* http://www.geocities.com/~starkville/vancbj_idx.html
|
||||
* [Ben Fry, August 2009]
|
||||
*/
|
||||
public class AutoFormat implements Tool {
|
||||
Editor editor;
|
||||
@ -38,15 +47,12 @@ public class AutoFormat implements Tool {
|
||||
static final int BLOCK_MAXLEN = 1024;
|
||||
|
||||
StringBuffer strOut;
|
||||
//String formattedText;
|
||||
int indentValue;
|
||||
String indentChar;
|
||||
//String uhOh = null;
|
||||
//String theStuff;
|
||||
int EOF;
|
||||
BufferedInputStream bin = null;
|
||||
int nBytesRead, indexBlock, lineLength, lineNumber;
|
||||
byte bArray[];
|
||||
CharArrayReader reader;
|
||||
int readCount, indexBlock, lineLength, lineNumber;
|
||||
char chars[];
|
||||
String strBlock;
|
||||
int s_level[];
|
||||
int c_level;
|
||||
@ -64,22 +70,16 @@ public class AutoFormat implements Tool {
|
||||
String w_if_, w_else, w_for, w_ds, w_case, w_cpp_comment, w_jdoc;
|
||||
int jdoc, j;
|
||||
char string[];
|
||||
byte bstring[];
|
||||
byte bblank;
|
||||
char cc;
|
||||
int s_flg, b_flg;
|
||||
int s_flg;
|
||||
int peek;
|
||||
char peekc;
|
||||
int tabs;
|
||||
char next_char, last_char;
|
||||
char lastc0, lastc1;
|
||||
char c, c0;
|
||||
char w_kptr;
|
||||
char last_char;
|
||||
char c;
|
||||
|
||||
String line_feed;
|
||||
|
||||
//static int outfil; // temporary
|
||||
|
||||
|
||||
public void init(Editor editor) {
|
||||
this.editor = editor;
|
||||
@ -236,6 +236,7 @@ public class AutoFormat implements Tool {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void cpp_comment() throws IOException
|
||||
{
|
||||
c = getchr();
|
||||
@ -283,16 +284,16 @@ public class AutoFormat implements Tool {
|
||||
indexBlock++;
|
||||
if (indexBlock >= lineLength)
|
||||
{
|
||||
for (int ib=0; ib<nBytesRead; ib++) bArray[ib] = '\0';
|
||||
for (int ib=0; ib<readCount; ib++) chars[ib] = '\0';
|
||||
|
||||
lineLength = nBytesRead = 0;
|
||||
//try /* to get the next block */
|
||||
//{
|
||||
if (bin.available() > 0)
|
||||
lineLength = readCount = 0;
|
||||
reader.mark(1);
|
||||
if (reader.read() != -1)
|
||||
{
|
||||
nBytesRead = bin.read(bArray);
|
||||
lineLength = nBytesRead;
|
||||
strBlock = new String(bArray);
|
||||
reader.reset(); // back to the mark
|
||||
readCount = reader.read(chars);
|
||||
lineLength = readCount;
|
||||
strBlock = new String(chars);
|
||||
indexBlock = 0;
|
||||
last_char = strBlock.charAt(indexBlock);
|
||||
peek = -1;
|
||||
@ -300,15 +301,9 @@ public class AutoFormat implements Tool {
|
||||
}
|
||||
else
|
||||
{
|
||||
//System.out.println("eof a");
|
||||
EOF = 1;
|
||||
peekc = '\0';
|
||||
}
|
||||
//}
|
||||
//catch(IOException ioe)
|
||||
//{
|
||||
//System.out.println(ioe.toString());
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -446,13 +441,11 @@ public class AutoFormat implements Tool {
|
||||
indentChar = new String(" ");
|
||||
|
||||
lineNumber = 0;
|
||||
//BLOCK_MAXLEN = 256;
|
||||
c_level = if_lev = level = e_flg = paren = 0;
|
||||
a_flg = q_flg = j = b_flg = tabs = 0;
|
||||
a_flg = q_flg = j = tabs = 0;
|
||||
if_flg = peek = -1;
|
||||
peekc = '`';
|
||||
s_flg = 1;
|
||||
bblank = ' ';
|
||||
jdoc = 0;
|
||||
|
||||
s_level = new int[10];
|
||||
@ -476,24 +469,23 @@ public class AutoFormat implements Tool {
|
||||
// read as long as there is something to read
|
||||
EOF = 0; // = 1 set in getchr when EOF
|
||||
|
||||
bArray = new byte[BLOCK_MAXLEN];
|
||||
chars = new char[BLOCK_MAXLEN];
|
||||
string = new char[BLOCK_MAXLEN];
|
||||
try { // the whole process
|
||||
// open for input
|
||||
ByteArrayInputStream in =
|
||||
new ByteArrayInputStream(originalText.getBytes());
|
||||
reader = new CharArrayReader(originalText.toCharArray());
|
||||
|
||||
// add buffering to that InputStream
|
||||
bin = new BufferedInputStream(in);
|
||||
// bin = new BufferedInputStream(in);
|
||||
|
||||
for (int ib = 0; ib < BLOCK_MAXLEN; ib++) bArray[ib] = '\0';
|
||||
for (int ib = 0; ib < BLOCK_MAXLEN; ib++) chars[ib] = '\0';
|
||||
|
||||
lineLength = nBytesRead = 0;
|
||||
lineLength = readCount = 0;
|
||||
// read up a block - remember how many bytes read
|
||||
nBytesRead = bin.read(bArray);
|
||||
strBlock = new String(bArray);
|
||||
readCount = reader.read(chars);
|
||||
strBlock = new String(chars);
|
||||
|
||||
lineLength = nBytesRead;
|
||||
lineLength = readCount;
|
||||
lineNumber = 1;
|
||||
indexBlock = -1;
|
||||
j = 0;
|
||||
@ -561,6 +553,10 @@ public class AutoFormat implements Tool {
|
||||
|
||||
case '{':
|
||||
if(lookup(w_else) == 1)gotelse();
|
||||
if (s_if_lev.length == c_level) {
|
||||
s_if_lev = PApplet.expand(s_if_lev);
|
||||
s_if_flg = PApplet.expand(s_if_flg);
|
||||
}
|
||||
s_if_lev[c_level] = if_lev;
|
||||
s_if_flg[c_level] = if_flg;
|
||||
if_lev = if_flg = 0;
|
||||
@ -736,7 +732,6 @@ public class AutoFormat implements Tool {
|
||||
peekc = getchr();
|
||||
if(peekc == ';')
|
||||
{
|
||||
//fprintf(outfil,";");
|
||||
fprintf(";");
|
||||
peek = -1;
|
||||
peekc = '`';
|
||||
@ -747,13 +742,11 @@ public class AutoFormat implements Tool {
|
||||
}
|
||||
getnl();
|
||||
indent_puts();
|
||||
//fprintf(outfil,"\n");
|
||||
fprintf("\n");
|
||||
s_flg = 1;
|
||||
break;
|
||||
|
||||
case '/':
|
||||
c0 = string[j];
|
||||
string[j++] = c;
|
||||
peekc = getchr();
|
||||
|
||||
@ -912,7 +905,7 @@ public class AutoFormat implements Tool {
|
||||
selectionEnd = strOut.length() - 1;
|
||||
}
|
||||
|
||||
bin.close(); // close buff
|
||||
reader.close(); // close buff
|
||||
|
||||
String formattedText = strOut.toString();
|
||||
if (formattedText.equals(originalText)) {
|
||||
|
@ -7,6 +7,13 @@ if [ $1 ]
|
||||
then
|
||||
RELEASE=$1
|
||||
echo Creating Arduino release $RELEASE...
|
||||
INFO_SOUGHT="<string>$RELEASE,"
|
||||
INFO_FOUND=`cat ./dist/Arduino.app/Contents/Info.plist | grep $INFO_SOUGHT`
|
||||
if [ -z "$INFO_FOUND" ]
|
||||
then
|
||||
echo Fix the version number in Info.plist
|
||||
exit
|
||||
fi
|
||||
else
|
||||
RELEASE=$REVISION
|
||||
echo Creating Arduino distribution for revision $REVISION...
|
||||
|
@ -1,5 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
# http://dev.processing.org/bugs/show_bug.cgi?id=1179
|
||||
OSX_VERSION=`sw_vers | grep ProductVersion | awk '{print $2}' | awk '{print substr($0,1,4)}'`
|
||||
if [ "$OSX_VERSION" = "10.4" ]
|
||||
then
|
||||
echo "This script uses the -X option for cp (to disable resource forks),"
|
||||
echo "which is not supported on OS X 10.4. Please either upgrade to 10.5,"
|
||||
echo "or modify this script to remove use of the -X switch to continue."
|
||||
# and you will also need to remove this error message
|
||||
exit
|
||||
else
|
||||
if [ "$OSX_VERSION" != "10.6" ]
|
||||
then
|
||||
echo "Note: This script has not been tested on this "
|
||||
echo "release of Mac OS and may cause errors."
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
### -- SETUP WORK DIR -------------------------------------------
|
||||
|
||||
|
@ -1,3 +1,188 @@
|
||||
PROCESSING 1.0.7 (REV 0169) - 4 September 2009
|
||||
|
||||
Bug fixes and updates, also some tweaks for Mac OS X Snow Leopard.
|
||||
|
||||
[ changes ]
|
||||
|
||||
+ Tweaks for Mac OS X Snow Leopard, to force it to run in 32-bit mode.
|
||||
This should bring back the video library (if temporarily), and hopefully
|
||||
fix serial as well, though I didn't have a serial device handy to test.
|
||||
|
||||
+ Fix problem where line highlighting was off in 'static' mode.
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1263
|
||||
|
||||
+ Auto-format was killing Unicode characters (how did this last so long?)
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1312
|
||||
|
||||
+ PVector.angleDistance() returning NaN due to precision errors
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1316
|
||||
|
||||
+ Removed a major try/catch block from PApplet.main(), hopefully
|
||||
this will allow some exception stuff to come through properly.
|
||||
|
||||
|
||||
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
PROCESSING 1.0.6 (REV 0168) - 12 August 2009
|
||||
|
||||
Bug fixes and minor changes. Most important are replacement JOGL libraries
|
||||
so that OpenGL applets won't present an "expired certificate" error.
|
||||
|
||||
[ bug fixes ]
|
||||
|
||||
+ Replaced the faulty JOGL library that had expired certificates (Sun bug).
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1271
|
||||
https://jogl.dev.java.net/servlets/ProjectDocumentList?folderID=9260&expandFolder=9260&folderID=0
|
||||
|
||||
+ Updated the Linux launcher script that enables Processing to be run
|
||||
from other directories, symlinks, or from launch items.
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=825
|
||||
Thanks to Ferdinand Kasper for the fix!
|
||||
|
||||
+ strokeWeight() was making lines 2x too thick with P2D
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1283
|
||||
|
||||
+ PImage.getImage() setting the wrong image type
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1282
|
||||
|
||||
+ image() not working with P2D, P3D, and OPENGL when noFill() used
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1299
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1222
|
||||
|
||||
+ Auto format problem with program deeper then 10 levels
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1297
|
||||
|
||||
+ Fixed a crash on startup problem (console being null)
|
||||
|
||||
+ Recursive subfolder copy of library folders when exporting application
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1295
|
||||
|
||||
[ changes ]
|
||||
|
||||
+ PDF member functions set protected instead of private
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1276
|
||||
|
||||
+ On OS X, update Info.plist to be 32/64 explicit and also updated
|
||||
JavaApplicationStub for update 4.
|
||||
|
||||
+ Clicking the preferences location in the Preferences window will
|
||||
now open the parent folder for the preferences file.
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1279
|
||||
|
||||
+ Update to Java 6 update 15 for the Windows and Linux releases.
|
||||
|
||||
[ fixed earlier ]
|
||||
|
||||
+ Mangled menu text with Java 6u10.
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1065
|
||||
|
||||
|
||||
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
PROCESSING 1.0.5 (REV 0167) - 7 June 2009
|
||||
|
||||
Bug fix release, mostly dealing with regressions from 1.0.4.
|
||||
|
||||
[ bug fixes ]
|
||||
|
||||
+ Make the tab key work again inside the editor
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1267
|
||||
|
||||
+ Deal with duplicate entries for sketchbook in the file menu
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1260
|
||||
|
||||
[ changes ]
|
||||
|
||||
+ Support for smooth text in the PDE editor. Set editor.antialias=true
|
||||
inside preferences.txt to enable smooth text.
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1266
|
||||
|
||||
+ Updated reference files.
|
||||
|
||||
|
||||
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
PROCESSING 1.0.4 (REV 0166) - 31 May 2009
|
||||
|
||||
Bug fix release.
|
||||
|
||||
[ changes ]
|
||||
|
||||
+ Changed the workaround for Apple's Java bug related to the menus in OS X.
|
||||
Rather than placing the menubar inside the sketch window, File > Sketchbook
|
||||
and File > Examples are simply dimmed out. Instead, use the Open button
|
||||
on the toolbar, which provides access to the same items. The preference
|
||||
to place the menu bar inside the window is still available, in case you
|
||||
prefer the previous workaround.
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=786
|
||||
|
||||
+ Also updated the included runtime on Windows and Linux to Java 6u14.
|
||||
|
||||
[ bug fixes ]
|
||||
|
||||
+ Fixed IDE crash when changing color scheme on windows
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1237
|
||||
|
||||
+ Typo in the Linux shell script was preventing it from running
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1250
|
||||
|
||||
+ OS X finder info on application updated to say 1.0.4
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1226
|
||||
|
||||
+ Removed warning message "Non-String for 8 value in 'Properties'
|
||||
sub-dictionary in 'Java' sub-dictionary of Info.plist" on OS X
|
||||
|
||||
+ Added warning to build script for users on OS X 10.4
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1179
|
||||
|
||||
+ Disable point() going to set() from PGraphicsJava2D. The set() command
|
||||
doesn't honor alpha consistently, and it also causes problems with PDF
|
||||
|
||||
+ PImage cacheMap problem when using PImage.get()
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1245
|
||||
|
||||
+ Fix problems with > 512 points and P3D/OPENGL
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1255
|
||||
Thanks to user DopeShow for the patch
|
||||
|
||||
+ imageMode(CENTER) doesn't work properly with P2D
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1232
|
||||
|
||||
+ Reset matrices when using beginRecord() with PDF
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1227
|
||||
|
||||
+ Resizing window no longer distorts OpenGL graphics
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1176
|
||||
Many thanks to Pablo Funes for the patch
|
||||
|
||||
+ Fix significant point() and set() slowdown on OS X
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1094
|
||||
|
||||
[ known issues ]
|
||||
|
||||
+ Currently no 64-bit support for any platforms. On some platforms, you'll
|
||||
simply need to replace the Java folder with the distribution with something
|
||||
more suitable for your operating system.
|
||||
|
||||
+ Command line support is currently broken
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1048
|
||||
|
||||
+ Text of menus/interface elements sometimes mangled (e.g. toolbar repeats
|
||||
several times, other oddness). See bug report for a workaround
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=1065
|
||||
|
||||
+ Video library threading problems with other libraries
|
||||
http://dev.processing.org/bugs/show_bug.cgi?id=882
|
||||
|
||||
+ See dev.processing.org/bugs for much, much more!
|
||||
|
||||
|
||||
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
PROCESSING 1.0.3 (REV 0165) - 24 February 2009
|
||||
|
||||
Bug fix release to repair a couple of regressions caused by changes in 1.0.2,
|
||||
@ -24,6 +209,9 @@ as well as a couple other new problems encountered since.
|
||||
+ Update to iText 2.1.4 for the PDF library
|
||||
|
||||
|
||||
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
PROCESSING 1.0.2 (REV 0164) - 21 February 2009
|
||||
|
||||
This release fixes many bugs and adds two minor functions to the XML library.
|
||||
|
Binary file not shown.
@ -1,3 +1,53 @@
|
||||
0168 core (1.0.6)
|
||||
X getImage() setting the wrong image type
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1282
|
||||
X strokeWeight() makes lines 2x too thick with P2D
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1283
|
||||
X image() doesn't work with P2D, P3D, and OPENGL with noFill()
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1299
|
||||
o maybe using rgb instead of tint inside drawing loops?
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1222
|
||||
|
||||
|
||||
0167 core (1.0.5)
|
||||
X changed text layout methods from private to protected
|
||||
|
||||
|
||||
0166 core (1.0.4)
|
||||
X disable point() going to set() from PGraphicsJava2D
|
||||
X set() doesn't honor alpha consistently
|
||||
X also causes problems with PDF
|
||||
X preliminary thread() implementation
|
||||
X double param version of map()
|
||||
X PImage cacheMap problem when using PImage.get()
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1245
|
||||
X problems with > 512 points and P3D/OPENGL (thx DopeShow)
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1255
|
||||
X imageMode(CENTER) doesn't work properly with P2D
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1232
|
||||
X reset matrices when using beginRecord() with PDF
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1227
|
||||
X resizing window distorts gl graphics
|
||||
X patch from Pablo Funes
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1176
|
||||
X significant point() and set() slowdown on OS X
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1094
|
||||
|
||||
|
||||
0165 core (1.0.3)
|
||||
X update to itext 2.1.4
|
||||
X endRecord or endRaw produces RuntimeException with PDF library
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1169
|
||||
X problem with beginRaw/endRaw and OpenGL
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1171
|
||||
X set strokeWeight with begin/endRaw
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1172
|
||||
X fix strokeWeight with P3D (better version of line hack)
|
||||
X make P3D use proper weights
|
||||
X ArrayIndexOutOfBoundsException with point()
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1168
|
||||
|
||||
|
||||
0164 core (1.0.2)
|
||||
X requestImage() causing problems with JAVA2D
|
||||
X fix minor strokeWeight bug with OpenGL
|
||||
|
@ -3,13 +3,12 @@
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2004-08 Ben Fry and Casey Reas
|
||||
Copyright (c) 2004-09 Ben Fry and Casey Reas
|
||||
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
License as published by the Free Software Foundation, version 2.1.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -825,7 +824,7 @@ public class PApplet extends Applet
|
||||
meth.add(o, method);
|
||||
|
||||
} catch (NoSuchMethodException nsme) {
|
||||
die("There is no " + name + "() method in the class " +
|
||||
die("There is no public " + name + "() method in the class " +
|
||||
o.getClass().getName());
|
||||
|
||||
} catch (Exception e) {
|
||||
@ -842,7 +841,7 @@ public class PApplet extends Applet
|
||||
meth.add(o, method);
|
||||
|
||||
} catch (NoSuchMethodException nsme) {
|
||||
die("There is no " + name + "() method in the class " +
|
||||
die("There is no public " + name + "() method in the class " +
|
||||
o.getClass().getName());
|
||||
|
||||
} catch (Exception e) {
|
||||
@ -1391,6 +1390,9 @@ public class PApplet extends Applet
|
||||
//System.out.println("handleDraw() " + frameCount);
|
||||
|
||||
g.beginDraw();
|
||||
if (recorder != null) {
|
||||
recorder.beginDraw();
|
||||
}
|
||||
|
||||
long now = System.nanoTime();
|
||||
|
||||
@ -1442,6 +1444,9 @@ public class PApplet extends Applet
|
||||
}
|
||||
|
||||
g.endDraw();
|
||||
if (recorder != null) {
|
||||
recorder.endDraw();
|
||||
}
|
||||
|
||||
frameRateLastNanos = now;
|
||||
frameCount++;
|
||||
@ -2233,6 +2238,76 @@ public class PApplet extends Applet
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
public void method(String name) {
|
||||
// final Object o = this;
|
||||
// final Class<?> c = getClass();
|
||||
try {
|
||||
Method method = getClass().getMethod(name, new Class[] {});
|
||||
method.invoke(this, new Object[] { });
|
||||
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e) {
|
||||
e.getTargetException().printStackTrace();
|
||||
} catch (NoSuchMethodException nsme) {
|
||||
System.err.println("There is no public " + name + "() method " +
|
||||
"in the class " + getClass().getName());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void thread(final String name) {
|
||||
Thread later = new Thread() {
|
||||
public void run() {
|
||||
method(name);
|
||||
}
|
||||
};
|
||||
later.start();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
public void thread(String name) {
|
||||
final Object o = this;
|
||||
final Class<?> c = getClass();
|
||||
try {
|
||||
final Method method = c.getMethod(name, new Class[] {});
|
||||
Thread later = new Thread() {
|
||||
public void run() {
|
||||
try {
|
||||
method.invoke(o, new Object[] { });
|
||||
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e) {
|
||||
e.getTargetException().printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
later.start();
|
||||
|
||||
} catch (NoSuchMethodException nsme) {
|
||||
System.err.println("There is no " + name + "() method " +
|
||||
"in the class " + getClass().getName());
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// SCREEN GRABASS
|
||||
@ -2813,6 +2888,13 @@ public class PApplet extends Applet
|
||||
}
|
||||
|
||||
|
||||
static public final double map(double value,
|
||||
double istart, double istop,
|
||||
double ostart, double ostop) {
|
||||
return ostart + (ostop - ostart) * ((value - istart) / (istop - istart));
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
@ -4417,7 +4499,8 @@ public class PApplet extends Applet
|
||||
* "data" folder. However, when exported (as application or applet),
|
||||
* sketch's data folder is exported as part of the applications jar file,
|
||||
* and it's not possible to read/write from the jar file in a generic way.
|
||||
* If you need to read data from the jar file, you should use createInput().
|
||||
* If you need to read data from the jar file, you should use other methods
|
||||
* such as createInput(), createReader(), or loadStrings().
|
||||
*/
|
||||
public String dataPath(String where) {
|
||||
// isAbsolute() could throw an access exception, but so will writing
|
||||
@ -6401,7 +6484,6 @@ public class PApplet extends Applet
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
try {
|
||||
boolean external = false;
|
||||
int[] location = null;
|
||||
int[] editorLocation = null;
|
||||
@ -6518,9 +6600,13 @@ public class PApplet extends Applet
|
||||
frame.setIconImage(image);
|
||||
frame.setTitle(name);
|
||||
|
||||
// Class c = Class.forName(name);
|
||||
final PApplet applet;
|
||||
try {
|
||||
Class<?> c = Thread.currentThread().getContextClassLoader().loadClass(name);
|
||||
final PApplet applet = (PApplet) c.newInstance();
|
||||
applet = (PApplet) c.newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
// these are needed before init/start
|
||||
applet.frame = frame;
|
||||
@ -6657,9 +6743,6 @@ public class PApplet extends Applet
|
||||
(applet.screen.height - applet.height) / 2);
|
||||
}
|
||||
|
||||
// frame.setLayout(null);
|
||||
// frame.add(applet);
|
||||
|
||||
if (backgroundColor == Color.black) { //BLACK) {
|
||||
// this means no bg color unless specified
|
||||
backgroundColor = SystemColor.control;
|
||||
@ -6693,11 +6776,6 @@ public class PApplet extends Applet
|
||||
|
||||
applet.requestFocus(); // ask for keydowns
|
||||
//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) {
|
||||
if (recorder != null) recorder.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
|
||||
* 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.
|
||||
* @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 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) {
|
||||
textBreakStart = PApplet.expand(textBreakStart);
|
||||
textBreakStop = PApplet.expand(textBreakStop);
|
||||
|
@ -283,7 +283,7 @@ public class PGraphics2D extends PGraphics {
|
||||
case TRIANGLE_FAN:
|
||||
// do fill and stroke separately because otherwise
|
||||
// the lines will be stroked more than necessary
|
||||
if (fill) {
|
||||
if (fill || textureImage != null) {
|
||||
fpolygon.vertexCount = 3;
|
||||
|
||||
for (int i = 1; i < vertexCount-1; i++) {
|
||||
@ -342,7 +342,7 @@ public class PGraphics2D extends PGraphics {
|
||||
increment = (shape == TRIANGLES) ? 3 : 1;
|
||||
// do fill and stroke separately because otherwise
|
||||
// the lines will be stroked more than necessary
|
||||
if (fill) {
|
||||
if (fill || textureImage != null) {
|
||||
fpolygon.vertexCount = 3;
|
||||
for (int i = 0; i < vertexCount-2; i += increment) {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
@ -379,7 +379,7 @@ public class PGraphics2D extends PGraphics {
|
||||
break;
|
||||
|
||||
case QUADS:
|
||||
if (fill) {
|
||||
if (fill || textureImage != null) {
|
||||
fpolygon.vertexCount = 4;
|
||||
for (int i = 0; i < vertexCount-3; i += 4) {
|
||||
for (int j = 0; j < 4; j++) {
|
||||
@ -412,7 +412,7 @@ public class PGraphics2D extends PGraphics {
|
||||
break;
|
||||
|
||||
case QUAD_STRIP:
|
||||
if (fill) {
|
||||
if (fill || textureImage != null) {
|
||||
fpolygon.vertexCount = 4;
|
||||
for (int i = 0; i < vertexCount-3; i += 2) {
|
||||
for (int j = 0; j < 4; j++) {
|
||||
@ -445,7 +445,7 @@ public class PGraphics2D extends PGraphics {
|
||||
|
||||
case POLYGON:
|
||||
if (isConvex()) {
|
||||
if (fill) {
|
||||
if (fill || textureImage != null) {
|
||||
//System.out.println("convex");
|
||||
fpolygon.renderPolygon(vertices, vertexCount);
|
||||
//if (stroke) polygon.unexpand();
|
||||
@ -463,7 +463,7 @@ public class PGraphics2D extends PGraphics {
|
||||
}
|
||||
} else { // not convex
|
||||
//System.out.println("concave");
|
||||
if (fill) {
|
||||
if (fill || textureImage != null) {
|
||||
// the triangulator produces polygons that don't align
|
||||
// when smoothing is enabled. but if there is a stroke around
|
||||
// the polygon, then smoothing can be temporarily disabled.
|
||||
@ -1423,11 +1423,6 @@ public class PGraphics2D extends PGraphics {
|
||||
*/
|
||||
private void simple_image(PImage image, int sx1, int sy1,
|
||||
int ix1, int iy1, int ix2, int iy2) {
|
||||
if (imageMode == CENTER) {
|
||||
sx1 -= image.width / 2;
|
||||
sy1 -= image.height / 2;
|
||||
}
|
||||
|
||||
int sx2 = sx1 + image.width;
|
||||
int sy2 = sy1 + image.height;
|
||||
|
||||
@ -1703,7 +1698,7 @@ public class PGraphics2D extends PGraphics {
|
||||
float len = (float) Math.sqrt(dX*dX + dY*dY);
|
||||
|
||||
// TODO stroke width should be transformed!
|
||||
float rh = strokeWeight / len;
|
||||
float rh = (strokeWeight / len) / 2;
|
||||
|
||||
float dx0 = rh * dY;
|
||||
float dy0 = rh * dX;
|
||||
|
@ -608,7 +608,7 @@ public class PGraphics3D extends PGraphics {
|
||||
endShapeStroke(mode);
|
||||
}
|
||||
|
||||
if (fill) {
|
||||
if (fill || textureImage != null) {
|
||||
endShapeFill();
|
||||
}
|
||||
|
||||
@ -622,7 +622,7 @@ public class PGraphics3D extends PGraphics {
|
||||
// render shape and fill here if not saving the shapes for later
|
||||
// if true, the shapes will be rendered on endDraw
|
||||
if (!hints[ENABLE_DEPTH_SORT]) {
|
||||
if (fill) {
|
||||
if (fill || textureImage != null) {
|
||||
if (triangleCount > 0) {
|
||||
renderTriangles(0, triangleCount);
|
||||
if (raw != null) {
|
||||
@ -957,8 +957,8 @@ public class PGraphics3D extends PGraphics {
|
||||
protected void addPoint(int a) {
|
||||
if (pointCount == points.length) {
|
||||
int[][] temp = new int[pointCount << 1][LINE_FIELD_COUNT];
|
||||
System.arraycopy(lines, 0, temp, 0, lineCount);
|
||||
lines = temp;
|
||||
System.arraycopy(points, 0, temp, 0, lineCount);
|
||||
points = temp;
|
||||
}
|
||||
points[pointCount][VERTEX1] = a;
|
||||
//points[pointCount][STROKE_MODE] = strokeCap | strokeJoin;
|
||||
|
@ -467,11 +467,11 @@ public class PGraphicsJava2D extends PGraphics /*PGraphics2D*/ {
|
||||
|
||||
public void point(float x, float y) {
|
||||
if (stroke) {
|
||||
if (strokeWeight > 1) {
|
||||
// if (strokeWeight > 1) {
|
||||
line(x, y, x + EPSILON, y + EPSILON);
|
||||
} else {
|
||||
set((int) screenX(x, y), (int) screenY(x, y), strokeColor);
|
||||
}
|
||||
// } else {
|
||||
// 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,
|
||||
RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
|
||||
// RenderingHints.VALUE_INTERPOLATION_BILINEAR);
|
||||
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ public class PImage implements PConstants, Cloneable {
|
||||
public java.awt.Image getImage() {
|
||||
loadPixels();
|
||||
int type = (format == RGB) ?
|
||||
BufferedImage.TYPE_INT_ARGB : BufferedImage.TYPE_INT_RGB;
|
||||
BufferedImage.TYPE_INT_RGB : BufferedImage.TYPE_INT_ARGB;
|
||||
BufferedImage image = new BufferedImage(width, height, type);
|
||||
WritableRaster wr = image.getRaster();
|
||||
wr.setDataElements(0, 0, width, height, pixels);
|
||||
@ -499,7 +499,11 @@ public class PImage implements PConstants, Cloneable {
|
||||
*/
|
||||
public PImage get() {
|
||||
try {
|
||||
return (PImage) clone();
|
||||
PImage clone = (PImage) clone();
|
||||
// don't want to pass this down to the others
|
||||
// http://dev.processing.org/bugs/show_bug.cgi?id=1245
|
||||
clone.cacheMap = null;
|
||||
return clone;
|
||||
} catch (CloneNotSupportedException e) {
|
||||
return null;
|
||||
}
|
||||
|
@ -529,9 +529,10 @@ public class PVector {
|
||||
* @return the angle between the vectors
|
||||
*/
|
||||
static public float angleBetween(PVector v1, PVector v2) {
|
||||
float dot = v1.dot(v2);
|
||||
float theta = (float) Math.acos(dot / (v1.mag() * v2.mag()));
|
||||
return theta;
|
||||
double dot = v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
|
||||
double v1mag = Math.sqrt(v1.x * v1.x + v1.y * v1.y + v1.z * v1.z);
|
||||
double v2mag = Math.sqrt(v2.x * v2.x + v2.y * v2.y + v2.z * v2.z);
|
||||
return (float) Math.acos(dot / (v1mag * v2mag));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1335,6 +1335,11 @@ public class XMLElement implements Serializable {
|
||||
}
|
||||
|
||||
|
||||
public String toString() {
|
||||
return toString(true);
|
||||
}
|
||||
|
||||
|
||||
public String toString(boolean pretty) {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
OutputStreamWriter osw = new OutputStreamWriter(baos);
|
||||
|
@ -1,24 +1,58 @@
|
||||
0165 core (1.0.3)
|
||||
X update to itext 2.1.4
|
||||
X endRecord or endRaw produces RuntimeException with PDF library
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1169
|
||||
X problem with beginRaw/endRaw and OpenGL
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1171
|
||||
X set strokeWeight with begin/endRaw
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1172
|
||||
X fix strokeWeight with P3D (better version of line hack)
|
||||
X make P3D use proper weights
|
||||
X ArrayIndexOutOfBoundsException with point()
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1168
|
||||
0169 core
|
||||
X remove major try/catch block from PApplet.main()
|
||||
X hopefully will allow some exception stuff to come through properly
|
||||
X PVector.angleDistance() returns NaN
|
||||
X http://dev.processing.org/bugs/show_bug.cgi?id=1316
|
||||
|
||||
_ make the index lookup use numbers up to 256?
|
||||
|
||||
_ decide whether to keep:
|
||||
_ public float textWidth(char[] chars, int start, int length)
|
||||
|
||||
_ textAlign(JUSTIFY) (with implementation)
|
||||
_ http://dev.processing.org/bugs/show_bug.cgi?id=1309
|
||||
|
||||
_ create characters on the fly when createFont() is used
|
||||
|
||||
_ Semitransparent rect drawn over image not rendered correctly
|
||||
_ http://dev.processing.org/bugs/show_bug.cgi?id=1280
|
||||
|
||||
_ should map() actually constrain to the low and high values?
|
||||
|
||||
_ file chooser fails with opengl on linux
|
||||
_ http://dev.processing.org/bugs/show_bug.cgi?id=1221
|
||||
|
||||
_ resizing opengl destroys context and textures
|
||||
_ http://dev.processing.org/bugs/show_bug.cgi?id=1176
|
||||
_ what's the difference with ascent on loadFont vs. createFont?
|
||||
_ noCursor() doesn't work in present mode
|
||||
_ http://dev.processing.org/bugs/show_bug.cgi?id=1177
|
||||
_ modelx/y/z broken when aiming a camera
|
||||
_ http://dev.processing.org/bugs/show_bug.cgi?id=1074
|
||||
_ in P2D, two vertex() line calls with fill() causes duplicate output
|
||||
_ works fine in other renderers, has to do with tesselation
|
||||
_ http://dev.processing.org/bugs/show_bug.cgi?id=1191
|
||||
_ extra triangles being seen in P2D
|
||||
_ http://dev.processing.org/bugs/show_bug.cgi?id=1192
|
||||
_ noloop ref even says that redraw will be called on resize, make sure it is
|
||||
_ public PImage(java.awt.Image) sets format to RGB (but could be ARGB)
|
||||
|
||||
|
||||
[ features ]
|
||||
|
||||
_ add version of math functions that use doubles?
|
||||
_ what other methods should work with doubles? all math functions?
|
||||
_ seems like internal (mostly static) things, but not graphics api
|
||||
_ look into replacing nanoxml
|
||||
_ http://www.exampledepot.com/egs/javax.xml.parsers/pkg.html
|
||||
_ if no draw() method, and renderer is not displayable, then exit
|
||||
_ static mode PDFs shouldn't just hang
|
||||
_ public PImage(java.awt.Image) sets format to RGB (but could be ARGB)
|
||||
|
||||
|
||||
[ known problems ]
|
||||
|
||||
_ memory leak problem with fonts in JAVA2D
|
||||
_ http://dev.processing.org/bugs/show_bug.cgi?id=1252
|
||||
_ OPENGL sketches flicker w/ Vista when background() not used inside draw()
|
||||
_ http://dev.processing.org/bugs/show_bug.cgi?id=930
|
||||
_ Disabling Aero scheme sometimes prevents the problem
|
||||
|
Loading…
x
Reference in New Issue
Block a user