mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 19:05:34 +01:00
tweaking the preprocessor a bit
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user