1 package org.argosfields.image;
2
3 import org.apache.commons.logging.Log;
4 import org.apache.commons.logging.LogFactory;
5 import org.argosfields.resource.ResourceManager;
6 import org.eclipse.swt.graphics.Image;
7
8 /***
9 * UnitImageSet.java
10 *
11 * @author Xavier Cho
12 * @version $Revision: 1.2 $ $Date: 2003/10/23 14:59:56 $
13 */
14 public final class UnitImageSet extends ImageSet {
15 private static Log log = LogFactory.getLog(UnitImageSet.class);
16
17 private static UnitImageSet instance;
18 private Image image;
19
20 private UnitImageSet() {
21 if (log.isDebugEnabled()) {
22 String msg = "Loading unit image set...";
23 log.debug(msg);
24 }
25
26 ResourceManager resources = ResourceManager.getInstance();
27 this.image = resources.getImage("image.units");
28 }
29
30 public static UnitImageSet getInstance() {
31 if (instance == null) {
32 synchronized (UnitImageSet.class) {
33 instance = new UnitImageSet();
34 }
35 }
36
37 return instance;
38 }
39
40 /***
41 * @see org.argosfields.image.ImageSet#getColumns()
42 */
43 public final int getColumns() {
44 return 24;
45 }
46
47 /***
48 * @see org.argosfields.image.ImageSet#getIconHeight()
49 */
50 public final int getIconHeight() {
51 return 28;
52 }
53
54 /***
55 * @see org.argosfields.image.ImageSet#getIconWidth()
56 */
57 public final int getIconWidth() {
58 return 32;
59 }
60
61 /***
62 * @see org.argosfields.image.ImageSet#getImage()
63 */
64 protected Image getImage() {
65 return image;
66 }
67
68 /***
69 * @see org.argosfields.image.ImageSet#getRows()
70 */
71 public final int getRows() {
72 return 12;
73 }
74 }
This page was automatically generated by Maven