forked from pquiring/javaforce
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIcons.java
More file actions
56 lines (48 loc) · 1.23 KB
/
Copy pathIcons.java
File metadata and controls
56 lines (48 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package javaforce.ui;
/** Icon Resources
*
* @author pquiring
*/
import javaforce.*;
public class Icons {
private static Image arrow_up;
private static Image arrow_down;
private static Image arrow_left;
private static Image arrow_right;
public static Image loadImage(String name) {
try {
Image image = new Image();
if (!image.loadPNG(new JF().getClass().getResourceAsStream(name))) {
throw new Exception("Load resource failed:" + name);
}
return image;
} catch (Exception e) {
JFLog.log(e);
return null;
}
}
public static Image getArrowUp() {
if (arrow_up == null) {
arrow_up = loadImage("/javaforce/icons/16/icon_up.png");
}
return arrow_up;
}
public static Image getArrowDown() {
if (arrow_down == null) {
arrow_down = loadImage("/javaforce/icons/16/icon_down.png");
}
return arrow_down;
}
public static Image getArrowLeft() {
if (arrow_left == null) {
arrow_left = loadImage("/javaforce/icons/16/icon_left.png");
}
return arrow_left;
}
public static Image getArrowRight() {
if (arrow_right == null) {
arrow_right = loadImage("/javaforce/icons/16/icon_right.png");
}
return arrow_right;
}
}