tweaking the preprocessor a bit

This commit is contained in:
benfry
2009-10-18 17:42:24 +00:00
parent a20538ba5f
commit b1196b0629
3 changed files with 16 additions and 4 deletions

View File

@@ -781,6 +781,13 @@ public class Editor extends JFrame implements RunnerListener {
menu.add(createToolMenuItem("processing.app.tools.Archiver"));
menu.add(createToolMenuItem("processing.app.tools.FixEncoding"));
/*
//menu.add(createToolMenuItem("processing.app.tools.android.Build"));
item = createToolMenuItem("processing.app.tools.android.Build");
item.setAccelerator(KeyStroke.getKeyStroke('D', modifiers));
menu.add(item);
*/
return menu;
}

View File

@@ -1189,6 +1189,11 @@ public class Sketch {
* @return null if compilation failed, main class name if not
*/
public String preprocess(String buildPath) throws RunnerException {
return preprocess(buildPath, new PdePreprocessor());
}
public String preprocess(String buildPath, PdePreprocessor preprocessor) throws RunnerException {
// make sure the user didn't hide the sketch folder
ensureExistence();
@@ -1259,7 +1264,7 @@ public class Sketch {
// Note that the headerOffset isn't applied until compile and run, because
// it only applies to the code after it's been written to the .java file.
int headerOffset = 0;
PdePreprocessor preprocessor = new PdePreprocessor();
//PdePreprocessor preprocessor = new PdePreprocessor();
try {
headerOffset = preprocessor.writePrefix(bigCode.toString(),
buildPath,

View File

@@ -386,7 +386,7 @@ public class PdePreprocessor {
}
}
int writeImports(PrintStream out) {
protected int writeImports(PrintStream out) {
out.println("import processing.core.*; ");
out.println("import processing.xml.*; ");
out.println();
@@ -425,7 +425,7 @@ public class PdePreprocessor {
* @param exporting Is this being exported from PDE?
* @param name Name of the class being created.
*/
void writeDeclaration(PrintStream out, String className) {
protected void writeDeclaration(PrintStream out, String className) {
String indent = " ";
@@ -450,7 +450,7 @@ public class PdePreprocessor {
*
* @param out PrintStream to write it to.
*/
void writeFooter(PrintStream out, String className) {
protected void writeFooter(PrintStream out, String className) {
if (programType == STATIC) {
// close off draw() definition