remove some eclipse warnings, and add a new PImage constructor

This commit is contained in:
benfry
2006-04-26 02:47:24 +00:00
parent 127eaa2a3e
commit d4f4a3558d
3 changed files with 12 additions and 7 deletions
+3 -3
View File
@@ -3306,7 +3306,7 @@ public class PApplet extends Applet
static public File inputFile(String prompt, Frame parentFrame) {
if (parentFrame == null) parentFrame = new Frame();
FileDialog fd = new FileDialog(parentFrame, prompt, FileDialog.LOAD);
fd.show();
fd.setVisible(true);
String directory = fd.getDirectory();
String filename = fd.getFile();
@@ -3350,7 +3350,7 @@ public class PApplet extends Applet
static public File outputFile(String prompt, Frame parentFrame) {
if (parentFrame == null) parentFrame = new Frame();
FileDialog fd = new FileDialog(parentFrame, prompt, FileDialog.SAVE);
fd.show();
fd.setVisible(true);
String directory = fd.getDirectory();
String filename = fd.getFile();
@@ -5968,7 +5968,7 @@ public class PApplet extends Applet
// all set for rockin
if (applet.displayable()) {
frame.show();
frame.setVisible(true);
}
}
+4 -4
View File
@@ -971,11 +971,11 @@ public class PFont implements PConstants {
// GraphicsEnvironment.getLocalGraphicsEnvironment();
Class geClass = Class.forName("java.awt.GraphicsEnvironment");
Method glgeMethod =
geClass.getMethod("getLocalGraphicsEnvironment", null);
Object ge = glgeMethod.invoke(null, null);
geClass.getMethod("getLocalGraphicsEnvironment", (Class[]) null);
Object ge = glgeMethod.invoke((Class[]) null, (Object[]) null);
Method gafMethod = geClass.getMethod("getAllFonts", null);
Font fonts[] = (Font[]) gafMethod.invoke(ge, null); //ge.getAllFonts();
Method gafMethod = geClass.getMethod("getAllFonts", (Class[]) null);
Font fonts[] = (Font[]) gafMethod.invoke(ge, (Object[]) null); //ge.getAllFonts();
String list[] = new String[fonts.length];
for (int i = 0; i < list.length; i++) {
list[i] = fonts[i].getName();
+5
View File
@@ -115,6 +115,11 @@ public class PImage implements PConstants, Cloneable {
}
public PImage(int width, int height, int format) {
init(width, height, format);
}
public PImage(int pixels[], int width, int height, int format) {
this.pixels = pixels;
this.width = width;