Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 package com.generalrobotix.ui.util;
00011
00012 import java.util.*;
00013 import java.net.*;
00014 import javax.swing.ImageIcon;
00015
00016 public class IconProperties {
00017 protected static IconProperties this_;
00018 protected static ResourceBundle resource_;
00019
00020 public static final int WIDTH = 27;
00021 public static final int HEIGHT = 27;
00022
00023 private IconProperties() {
00024 resource_ = ResourceBundle.getBundle("resources.icon");
00025 }
00026
00027 public static ImageIcon get(String key) {
00028 if (this_ == null) {
00029 this_ = new IconProperties();
00030 }
00031
00032 String str = resource_.getString(key);
00033 if (str.equals("none")) {
00034 return new ImageIcon();
00035 } else {
00036 URL url = IconProperties.class.getResource(str);
00037 if (url == null) {
00038 return new ImageIcon();
00039 }
00040 return new ImageIcon(url);
00041 }
00042 }
00043 }
00044