Skip to content

Commit 7a06bf1

Browse files
committed
looking into icon swapping to avoid ugliness
1 parent 011e848 commit 7a06bf1

File tree

8 files changed

+47
-23
lines changed

8 files changed

+47
-23
lines changed

app/src/processing/app/UpdateCheck.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ public void updateCheck() throws Exception {
9696
System.getProperty("os.arch"));
9797

9898
int latest = readInt(downloadURL + "?" + info);
99-
System.out.println("latest is " + latest);
10099

101100
String lastString = Preferences.get("update.last");
102101
long now = System.currentTimeMillis();

core/src/icon/icon-16.png

3.34 KB
Loading

core/src/icon/icon-24.png

3.81 KB
Loading

core/src/icon/icon-32.png

4.61 KB
Loading

core/src/icon/icon-48.png

2.32 KB
Loading

core/src/icon/icon-64.png

7.71 KB
Loading

core/src/processing/core/PApplet.java

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9354,23 +9354,46 @@ public void componentResized(ComponentEvent e) {
93549354
}
93559355

93569356

9357-
/**
9358-
* GIF image of the Processing logo.
9359-
*/
9360-
static public final byte[] ICON_IMAGE = {
9361-
71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -77, 0, 0, 0, 0, 0, -1, -1, -1, 12,
9362-
12, 13, -15, -15, -14, 45, 57, 74, 54, 80, 111, 47, 71, 97, 62, 88, 117,
9363-
1, 14, 27, 7, 41, 73, 15, 52, 85, 2, 31, 55, 4, 54, 94, 18, 69, 109, 37,
9364-
87, 126, -1, -1, -1, 33, -7, 4, 1, 0, 0, 15, 0, 44, 0, 0, 0, 0, 16, 0, 16,
9365-
0, 0, 4, 122, -16, -107, 114, -86, -67, 83, 30, -42, 26, -17, -100, -45,
9366-
56, -57, -108, 48, 40, 122, -90, 104, 67, -91, -51, 32, -53, 77, -78, -100,
9367-
47, -86, 12, 76, -110, -20, -74, -101, 97, -93, 27, 40, 20, -65, 65, 48,
9368-
-111, 99, -20, -112, -117, -123, -47, -105, 24, 114, -112, 74, 69, 84, 25,
9369-
93, 88, -75, 9, 46, 2, 49, 88, -116, -67, 7, -19, -83, 60, 38, 3, -34, 2,
9370-
66, -95, 27, -98, 13, 4, -17, 55, 33, 109, 11, 11, -2, -128, 121, 123, 62,
9371-
91, 120, -128, 127, 122, 115, 102, 2, 119, 0, -116, -113, -119, 6, 102,
9372-
121, -108, -126, 5, 18, 6, 4, -102, -101, -100, 114, 15, 17, 0, 59
9373-
};
9357+
// /**
9358+
// * GIF image of the Processing logo.
9359+
// */
9360+
// static public final byte[] ICON_IMAGE = {
9361+
// 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -77, 0, 0, 0, 0, 0, -1, -1, -1, 12,
9362+
// 12, 13, -15, -15, -14, 45, 57, 74, 54, 80, 111, 47, 71, 97, 62, 88, 117,
9363+
// 1, 14, 27, 7, 41, 73, 15, 52, 85, 2, 31, 55, 4, 54, 94, 18, 69, 109, 37,
9364+
// 87, 126, -1, -1, -1, 33, -7, 4, 1, 0, 0, 15, 0, 44, 0, 0, 0, 0, 16, 0, 16,
9365+
// 0, 0, 4, 122, -16, -107, 114, -86, -67, 83, 30, -42, 26, -17, -100, -45,
9366+
// 56, -57, -108, 48, 40, 122, -90, 104, 67, -91, -51, 32, -53, 77, -78, -100,
9367+
// 47, -86, 12, 76, -110, -20, -74, -101, 97, -93, 27, 40, 20, -65, 65, 48,
9368+
// -111, 99, -20, -112, -117, -123, -47, -105, 24, 114, -112, 74, 69, 84, 25,
9369+
// 93, 88, -75, 9, 46, 2, 49, 88, -116, -67, 7, -19, -83, 60, 38, 3, -34, 2,
9370+
// 66, -95, 27, -98, 13, 4, -17, 55, 33, 109, 11, 11, -2, -128, 121, 123, 62,
9371+
// 91, 120, -128, 127, 122, 115, 102, 2, 119, 0, -116, -113, -119, 6, 102,
9372+
// 121, -108, -126, 5, 18, 6, 4, -102, -101, -100, 114, 15, 17, 0, 59
9373+
// };
9374+
9375+
9376+
static ArrayList<Image> iconImages;
9377+
9378+
public void setIconImage(Frame frame) {
9379+
//Image image = Toolkit.getDefaultToolkit().createImage(ICON_IMAGE);
9380+
//frame.setIconImage(image);
9381+
try {
9382+
if (iconImages == null) {
9383+
iconImages = new ArrayList<Image>();
9384+
final int[] sizes = { 16, 24, 32, 48, 64 };
9385+
9386+
for (int sz : sizes) {
9387+
URL url = getClass().getResource("icon/icon-" + sz + ".png");
9388+
Toolkit.getDefaultToolkit().getImage(url);
9389+
//iconImages.add(Toolkit.getLibImage("icons/pde-" + sz + ".png", frame));
9390+
}
9391+
}
9392+
frame.setIconImages(iconImages);
9393+
} catch (Exception e) {
9394+
e.printStackTrace();
9395+
}
9396+
}
93749397

93759398

93769399
// Not gonna do this dynamically, only on startup. Too much headache.
@@ -9621,11 +9644,6 @@ static public void runSketch(final String args[], final PApplet constructedApple
96219644
// frame.setResizable(false);
96229645
// moved later (issue #467)
96239646

9624-
// Set the trimmings around the image
9625-
Image image = Toolkit.getDefaultToolkit().createImage(ICON_IMAGE);
9626-
frame.setIconImage(image);
9627-
frame.setTitle(name);
9628-
96299647
final PApplet applet;
96309648
if (constructedApplet != null) {
96319649
applet = constructedApplet;
@@ -9638,6 +9656,10 @@ static public void runSketch(final String args[], final PApplet constructedApple
96389656
}
96399657
}
96409658

9659+
// Set the trimmings around the image
9660+
applet.setIconImage(frame);
9661+
frame.setTitle(name);
9662+
96419663
// frame.setIgnoreRepaint(true); // does nothing
96429664
// frame.addComponentListener(new ComponentAdapter() {
96439665
// public void componentResized(ComponentEvent e) {

todo.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ o http://eclipse.org/equinox/
1010
o http://eclipse.org/equinox/documents/quickstart-framework.php
1111
X Libraries not installed through IDE don't appear correctly
1212
X http://code.google.com/p/processing/issues/detail?id=1331
13+
X implement multiple sizes of icons for PDE and core
14+
X http://code.google.com/p/processing/issues/detail?id=632
15+
X (stubbing things in for artwork update later)
1316

1417

1518
2.0 FINAL / library/tool/mode manager cleanup

0 commit comments

Comments
 (0)