Skip to content

Commit 9055f15

Browse files
committed
restore deprecated versions of getFont() and getImage()
1 parent 0ac13ae commit 9055f15

4 files changed

Lines changed: 32 additions & 11 deletions

File tree

core/src/processing/core/PFont.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,16 @@ public void setNative(Object font) {
500500
}
501501

502502

503+
/**
504+
* Use the getNative() method instead, which allows library interfaces to be
505+
* written in a cross-platform fashion for desktop, Android, and others.
506+
*/
507+
@Deprecated
508+
public Font getFont() {
509+
return font;
510+
}
511+
512+
503513
/**
504514
* Return the native java.awt.Font associated with this PFont (if any).
505515
*/

core/src/processing/core/PImage.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
package processing.core;
2626

27+
import java.awt.Image;
2728
import java.awt.image.*;
2829
import java.io.*;
2930
import java.lang.reflect.Method;
@@ -265,7 +266,7 @@ protected void checkAlpha() {
265266
* @param img assumes a MediaTracker has been used to fully download
266267
* the data and the img is valid
267268
*/
268-
public PImage(java.awt.Image img) {
269+
public PImage(Image img) {
269270
format = RGB;
270271
if (img instanceof BufferedImage) {
271272
BufferedImage bi = (BufferedImage) img;
@@ -291,10 +292,19 @@ public PImage(java.awt.Image img) {
291292
}
292293

293294

295+
/**
296+
* Use the getNative() method instead, which allows library interfaces to be
297+
* written in a cross-platform fashion for desktop, Android, and others.
298+
*/
299+
@Deprecated
300+
public Image getImage() {
301+
return (Image) getNative();
302+
}
303+
304+
294305
/**
295306
* Returns a native BufferedImage from this PImage.
296307
*/
297-
// public java.awt.Image getImage() {
298308
public Object getNative() {
299309
loadPixels();
300310
int type = (format == RGB) ?

core/todo.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
0211 core
2+
X remove bad cast in PGL
3+
X new keyEvent methods not firing
4+
X http://code.google.com/p/processing/issues/detail?id=1225
5+
X double check that new key and mouse events are being addressed correctly
6+
X restore deprecated versions of getFont() and getImage()
7+
X Android getBitmap() and getTypeface() will not be restored
28

3-
_ new keyEvent methods not firing
4-
_ http://code.google.com/p/processing/issues/detail?id=1225
59

6-
_ remove subsetting stuff from PFont
7-
8-
_ add deprecated versions of getFont, getImage, etc.
9-
10-
11-
_ double check that new key and mouse events are being addressed correctly
10+
_ remove subsetting stuff from PFont?
11+
_ or use hint(ENABLE_FONT_SUBSETTING)?
1212

1313
hint(OPENGL_ERRORS) should be the opposite to enable the reporting, no?
1414

todo.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ X make file selectable from the OS X menubar
33
X http://code.google.com/p/processing/issues/detail?id=1215
44
X make Mode menu into a radio button, so it cannot be de-selected
55
X http://code.google.com/p/processing/issues/detail?id=1227
6-
6+
X no response with registerMethod keyEvent when key pressed or released
7+
X http://code.google.com/p/processing/issues/detail?id=1225
78

89
_ "Processing is damaged and should be put in the trash" for 2.0b2
910
_ http://code.google.com/p/processing/issues/detail?id=1226

0 commit comments

Comments
 (0)