removing applet, upgrading OpenGL

This commit is contained in:
benfry
2012-07-20 20:57:51 +00:00
parent 74a0aa9bb1
commit a2f5c06873
6 changed files with 39 additions and 41 deletions

View File

@@ -240,25 +240,25 @@ public class JavaBuild {
}
}
// initSketchSize() sets the internal sketchWidth/Height/Renderer vars
// in the preprocessor. Those are used in preproc.write() so that they
// can be turned into sketchXxxx() methods.
// This also returns the size info as an array so that we can figure out
// if this fella is OpenGL, and if so, to add the import. It's messy and
// gross and someday we'll just always include OpenGL.
String[] sizeInfo =
preprocessor.initSketchSize(sketch.getMainProgram(), sizeWarning);
//PdePreprocessor.parseSketchSize(sketch.getMainProgram(), false);
if (sizeInfo != null) {
String sketchRenderer = sizeInfo[3];
if (sketchRenderer != null) {
if (sketchRenderer.equals("P2D") ||
sketchRenderer.equals("P3D") ||
sketchRenderer.equals("OPENGL")) {
bigCode.insert(0, "import processing.opengl.*; ");
}
}
}
// // initSketchSize() sets the internal sketchWidth/Height/Renderer vars
// // in the preprocessor. Those are used in preproc.write() so that they
// // can be turned into sketchXxxx() methods.
// // This also returns the size info as an array so that we can figure out
// // if this fella is OpenGL, and if so, to add the import. It's messy and
// // gross and someday we'll just always include OpenGL.
// String[] sizeInfo =
// preprocessor.initSketchSize(sketch.getMainProgram(), sizeWarning);
// //PdePreprocessor.parseSketchSize(sketch.getMainProgram(), false);
// if (sizeInfo != null) {
// String sketchRenderer = sizeInfo[3];
// if (sketchRenderer != null) {
// if (sketchRenderer.equals("P2D") ||
// sketchRenderer.equals("P3D") ||
// sketchRenderer.equals("OPENGL")) {
// bigCode.insert(0, "import processing.opengl.*; ");
// }
// }
// }
PreprocessorResult result;
try {

View File

@@ -54,15 +54,16 @@ public class JavaEditor extends Editor {
handleExportApplication();
}
});
String appletTitle = JavaToolbar.getTitle(JavaToolbar.EXPORT, true);
JMenuItem exportApplet = Base.newJMenuItemShift(appletTitle, 'E');
exportApplet.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
handleExportApplet();
}
});
// String appletTitle = JavaToolbar.getTitle(JavaToolbar.EXPORT, true);
// JMenuItem exportApplet = Base.newJMenuItemShift(appletTitle, 'E');
// exportApplet.addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// handleExportApplet();
// }
// });
return buildFileMenu(new JMenuItem[] { exportApplication, exportApplet });
// return buildFileMenu(new JMenuItem[] { exportApplication, exportApplet });
return buildFileMenu(new JMenuItem[] { exportApplication });
}

View File

@@ -139,11 +139,11 @@ public class JavaMode extends Mode {
public File[] getExampleCategoryFolders() {
// Basics, Topics, 3D, Books
// Basics, Topics, OpenGL, Books
return new File[] {
new File(examplesFolder, "Basics"),
new File(examplesFolder, "Topics"),
new File(examplesFolder, "3D"),
new File(examplesFolder, "OpenGL"),
new File(examplesFolder, "Books")
};
}

View File

@@ -72,7 +72,8 @@ public class JavaToolbar extends EditorToolbar {
case NEW: return !shift ? "New" : "New Editor Window";
case OPEN: return !shift ? "Open" : "Open in Another Window";
case SAVE: return "Save";
case EXPORT: return !shift ? "Export Application" : "Export Applet";
// case EXPORT: return !shift ? "Export Application" : "Export Applet";
case EXPORT: return "Export Application";
}
return null;
}
@@ -115,11 +116,11 @@ public class JavaToolbar extends EditorToolbar {
break;
case EXPORT:
if (shift) {
jeditor.handleExportApplet();
} else {
jeditor.handleExportApplication();
}
// if (shift) {
// jeditor.handleExportApplet();
// } else {
jeditor.handleExportApplication();
// }
break;
}
}

View File

@@ -890,7 +890,8 @@ public class PdePreprocessor {
public String[] getCoreImports() {
return new String[] {
"processing.core.*",
"processing.data.*"
"processing.data.*",
"processing.opengl.*"
};
}