mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
remove some eclipse warnings, and add a new PImage constructor
This commit is contained in:
+3
-3
@@ -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
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user