mirror of
https://github.com/processing/processing4.git
synced 2026-02-13 10:30:44 +01:00
removing applet, upgrading OpenGL
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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")
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -890,7 +890,8 @@ public class PdePreprocessor {
|
||||
public String[] getCoreImports() {
|
||||
return new String[] {
|
||||
"processing.core.*",
|
||||
"processing.data.*"
|
||||
"processing.data.*",
|
||||
"processing.opengl.*"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user