well, time for the 'ole git push that destroys everything, leaving devastation as i leave for the day.

This commit is contained in:
Ben Fry
2015-01-20 19:05:51 -05:00
parent bf93a7ec57
commit f56436a19d
7 changed files with 83 additions and 23 deletions
+5 -7
View File
@@ -53,8 +53,8 @@ public class Base {
// static private boolean RELEASE = false;
/** True if heavy debugging error/log messages are enabled */
// static public boolean DEBUG = false;
static public boolean DEBUG = true;
static public boolean DEBUG = false;
// static public boolean DEBUG = true;
static HashMap<Integer, String> platformNames =
new HashMap<Integer, String>();
@@ -2235,7 +2235,7 @@ public class Base {
// Path may have URL encoding, so remove it
String decodedPath = PApplet.urlDecode(path);
if (decodedPath.contains("/app/bin")) {
if (decodedPath.contains("/app/bin")) { // This means we're in Eclipse
if (Base.isMacOS()) {
processingRoot =
new File(path, "../../build/macosx/work/Processing.app/Contents/Java");
@@ -2252,11 +2252,9 @@ public class Base {
// This works for Windows, Linux, and Apple's Java 6 on OS X.
processingRoot = jarFolder.getParentFile();
} else if (Base.isMacOS()) {
// This works for Java 7 on OS X. The 'lib' folder is not part of the
// classpath on OS X, and adding it creates more problems than it's
// worth.
// This works for Java 8 on OS X. We don't have things inside a 'lib'
// folder on OS X. Adding it caused more problems than it was worth.
processingRoot = jarFolder;
}
if (processingRoot == null || !processingRoot.exists()) {
// Try working directory instead (user.dir, different from user.home)
+22 -1
View File
@@ -304,7 +304,28 @@ public abstract class Editor extends JFrame implements RunnerListener {
* solution where the listeners are handled properly.
*/
protected JEditTextArea createTextArea() {
return new JEditTextArea(new PdeTextAreaDefaults(mode));
return new JEditTextArea(new PdeTextAreaDefaults(mode)) {
// this is a kludge that needs to be removed [fry 150120]
public void processKeyEvent(KeyEvent evt) {
// this had to be added in Processing 007X, because the menu key
// events weren't making it up to the frame.
super.processKeyEvent(evt);
if (inputHandler != null) {
switch (evt.getID()) {
case KeyEvent.KEY_TYPED:
inputHandler.keyTyped(evt);
break;
case KeyEvent.KEY_PRESSED:
inputHandler.keyPressed(evt);
break;
case KeyEvent.KEY_RELEASED:
inputHandler.keyReleased(evt);
break;
}
}
}
};
}
+2 -2
View File
@@ -725,8 +725,8 @@ public class Toolkit {
if (!fontFile.exists()) {
// if we're debugging from Eclipse, grab it from the work folder (user.dir is /app)
//fontFile = new File(System.getProperty("user.dir"), "../build/shared/lib/fonts/" + filename);
// if we're debugging Java Mode from Eclipse, user.dir is the work folder
fontFile = new File(System.getProperty("user.dir"), "../../build/shared/lib/fonts/" + filename);
// if we're debugging the new Java Mode from Eclipse, paths are different
fontFile = new File(System.getProperty("user.dir"), "../../shared/lib/fonts/" + filename);
}
BufferedInputStream input = new BufferedInputStream(new FileInputStream(fontFile));
Font font = Font.createFont(Font.TRUETYPE_FONT, input);
@@ -1962,8 +1962,9 @@ public class JEditTextArea extends JComponent
break;
}
}
*/
*/
// protected members
protected static String CENTER = "center";
protected static String RIGHT = "right";
@@ -81,6 +81,7 @@ import processing.app.syntax.JEditTextArea;
import processing.app.syntax.PdeTextAreaDefaults;
import processing.core.PApplet;
import processing.mode.java.JavaEditor;
import processing.mode.java.PdeKeyListener;
import processing.mode.java.pdex.ErrorBar;
import processing.mode.java.pdex.ErrorCheckerService;
import processing.mode.java.pdex.ErrorMessageSimplifier;
@@ -1297,11 +1298,44 @@ public class DebugEditor extends JavaEditor implements ActionListener {
* @return the customized text area object
*/
@Override
// protected JEditTextArea createTextArea() {
// //System.out.println("overriding creation of text area");
// return new TextArea(new PdeTextAreaDefaults(mode), this);
// }
protected JEditTextArea createTextArea() {
//System.out.println("overriding creation of text area");
return new TextArea(new PdeTextAreaDefaults(mode), this);
return new TextArea(new PdeTextAreaDefaults(mode), this) {
// Forwards key events directly to the input handler. This is slightly
// faster than using a KeyListener because some Swing overhead is avoided.
PdeKeyListener editorListener = new PdeKeyListener(DebugEditor.this, this);
// Moved out of JEditTextArea for 3.0a6 to remove dependency on Java Mode
public void processKeyEvent(KeyEvent evt) {
// this had to be added in Processing 007X, because the menu key
// events weren't making it up to the frame.
super.processKeyEvent(evt);
if (inputHandler != null) {
switch (evt.getID()) {
case KeyEvent.KEY_TYPED:
if ((editorListener == null) || !editorListener.keyTyped(evt)) {
inputHandler.keyTyped(evt);
}
break;
case KeyEvent.KEY_PRESSED:
if ((editorListener == null) || !editorListener.keyPressed(evt)) {
inputHandler.keyPressed(evt);
}
break;
case KeyEvent.KEY_RELEASED:
inputHandler.keyReleased(evt);
break;
}
}
}
};
}
/**
* Set the line to highlight as currently suspended at. Will override the
* breakpoint color, if set. Switches to the appropriate tab and scroll to
@@ -58,12 +58,14 @@ public class XQPreprocessor {
private String[] coreImports, defaultImports;
public XQPreprocessor() {
PdePreprocessor p = new PdePreprocessor(null);
defaultImports = p.getDefaultImports();
coreImports = p.getCoreImports();
}
/**
* The main method that performs preprocessing. Converts code into compilable java.
* @param source - String
@@ -71,7 +73,7 @@ public class XQPreprocessor {
* @return String - Compile ready java code
*/
public String doYourThing(String source,
ArrayList<ImportStatement> programImports) {
ArrayList<ImportStatement> programImports) {
this.extraImports = programImports;
//source = prepareImports() + source;
Document doc = new Document(source);
@@ -118,9 +120,9 @@ public class XQPreprocessor {
return doc.get();
}
/**
* Returns all import statements as lines of code
*
* @return String - All import statements combined. Each import in a separate line.
*/
public String prepareImports() {
@@ -143,11 +145,13 @@ public class XQPreprocessor {
return totalImports;
}
public String prepareImports(ArrayList<ImportStatement> programImports) {
this.extraImports = programImports;
return prepareImports();
}
/**
* Visitor implementation that does all the substitution dirty work. <br>
* <LI>Any function not specified as being protected or private will be made
@@ -190,6 +194,7 @@ public class XQPreprocessor {
return true;
}
public boolean visit(NumberLiteral node) {
if (!node.getToken().endsWith("f")
@@ -206,6 +211,7 @@ public class XQPreprocessor {
return true;
}
// public boolean visit(FieldDeclaration node) {
// if (node.getType().toString().equals("color")){
// System.err.println("color type detected!");
@@ -231,13 +237,9 @@ public class XQPreprocessor {
*/
public boolean visit(SimpleType node) {
if (node.toString().equals("color")) {
System.err
.println("color type detected! \nThis shouldn't be happening! Please report this as an issue.");
System.err.println("color type detected! \nThis shouldn't be happening! Please report this as an issue.");
}
return true;
}
}
}
+7 -3
View File
@@ -78,11 +78,15 @@ X https://github.com/processing/processing/pull/3048
integration of pdex
X changed JLS4 to JLS8 (but make sure it doesn't introduce anything too weird)
X change build scripts, get things running
_ remove public 'ta' object in DebugEditor, also dmode
_ rename TextArea and TextAreaPainter to JavaTextArea
@SuppressWarnings({ "unused", "unchecked", "cast" })
change JLS4 to JLS8 (but make sure it doesn't introduce anything too weird)
_ DebugEditor.createTextArea() is copy & pasted from JavaEditor
_ this whole setup is really gross at the moment
_ auto-insert after antlr @SuppressWarnings({ "unused", "unchecked", "cast" })
_ crashed on startup w/ JavaScript mode as default b/c PdeKeyListener not found
_ because it's in the other package, can no longer rely on it
_ make examples pull/build automatic during dist