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 package ca.uhn.hl7v2.testpanel.ui;
31
32 import java.net.URL;
33 import java.util.HashMap;
34 import java.util.Map;
35
36 import javax.swing.Icon;
37 import javax.swing.ImageIcon;
38
39
40
41
42
43 public class ImageFactory {
44
45
46
47 private static Map<String, ImageIcon> ourIcons = new HashMap<String, ImageIcon>();
48
49
50
51
52 public static ImageIcon getButtonExecute() {
53 return getImageIcon("ca/uhn/hl7v2/testpanel/images/button_execute.png");
54 }
55
56 public static ImageIcon getProfile() {
57 return getImageIcon("ca/uhn/hl7v2/testpanel/images/profile.png");
58 }
59
60 public static ImageIcon getProfileGroup() {
61 return getImageIcon("ca/uhn/hl7v2/testpanel/images/new_tree.png");
62 }
63
64 public static ImageIcon getFile() {
65 return getImageIcon("ca/uhn/hl7v2/testpanel/images/file.png");
66 }
67
68 public static ImageIcon getTable() {
69 return getImageIcon("ca/uhn/hl7v2/testpanel/images/table.png");
70 }
71
72 public static ImageIcon getNo() {
73 return getImageIcon("ca/uhn/hl7v2/testpanel/images/no.png");
74 }
75
76 private static ImageIcon getImageIcon(String theLocation) {
77 ImageIcon retVal = ourIcons.get(theLocation);
78
79 if (retVal == null) {
80 URL resource = ImageFactory.class.getClassLoader().getResource(theLocation);
81 if (resource == null) {
82 throw new Error(theLocation);
83 }
84 retVal = new ImageIcon(resource);
85 ourIcons.put(theLocation, retVal);
86 }
87
88 return retVal;
89 }
90
91 public static ImageIcon getInterfaceOff() {
92 return getImageIcon("ca/uhn/hl7v2/testpanel/images/interface_off.png");
93 }
94
95 public static ImageIcon getHapi64() {
96 return getImageIcon("ca/uhn/hl7v2/testpanel/images/hapi_64.png");
97 }
98
99 public static ImageIcon getInterfaceOn() {
100 return getImageIcon("ca/uhn/hl7v2/testpanel/images/interface_on.png");
101 }
102
103 public static Icon getInterfaceStarting() {
104 return getImageIcon("ca/uhn/hl7v2/testpanel/images/interface_starting.png");
105 }
106
107 public static ImageIcon getMessageHl7() {
108 return getImageIcon("ca/uhn/hl7v2/testpanel/images/message_hl7.png");
109 }
110
111 public static ImageIcon getMessageIn() {
112 return getImageIcon("ca/uhn/hl7v2/testpanel/images/message_in.png");
113 }
114
115 public static ImageIcon getMessageOut() {
116 return getImageIcon("ca/uhn/hl7v2/testpanel/images/message_out.png");
117 }
118
119 public static ImageIcon getMessageXml() {
120 return getImageIcon("ca/uhn/hl7v2/testpanel/images/message_xml.png");
121 }
122
123 public static ImageIcon getTabLog() {
124 return getImageIcon("ca/uhn/hl7v2/testpanel/images/tab_log.png");
125 }
126
127 public static ImageIcon getTest() {
128 return getImageIcon("ca/uhn/hl7v2/testpanel/images/test.png");
129 }
130
131 public static ImageIcon getTestFailed() {
132 return getImageIcon("ca/uhn/hl7v2/testpanel/images/test_failed.png");
133 }
134
135 public static ImageIcon getTestPassed() {
136 return getImageIcon("ca/uhn/hl7v2/testpanel/images/test_passed.png");
137 }
138
139 public static ImageIcon getTestRunning() {
140 return getImageIcon("ca/uhn/hl7v2/testpanel/images/test_running.png");
141 }
142
143 public static ImageIcon getTreeBundle() {
144 return getImageIcon("ca/uhn/hl7v2/testpanel/images/tree_bundle.png");
145 }
146
147 public static ImageIcon getTreeLeaf() {
148 return getImageIcon("ca/uhn/hl7v2/testpanel/images/tree_leaf.png");
149 }
150
151 public static ImageIcon getValFailed() {
152 return getImageIcon("ca/uhn/hl7v2/testpanel/images/val_failed.png");
153 }
154
155 public static Icon getValFailedChild() {
156 return getImageIcon("ca/uhn/hl7v2/testpanel/images/val_failed_child.png");
157 }
158
159 public static ImageIcon getValPassed() {
160 return getImageIcon("ca/uhn/hl7v2/testpanel/images/val_passed.png");
161 }
162
163 public static ImageIcon getValPassedGreen() {
164 return getImageIcon("ca/uhn/hl7v2/testpanel/images/val_passed_green.png");
165 }
166 }