|
@@ -28,8 +28,6 @@ import com.dmdirc.util.URLBuilder;
|
28
|
28
|
|
29
|
29
|
import java.awt.Image;
|
30
|
30
|
import java.awt.Toolkit;
|
31
|
|
-import java.io.File;
|
32
|
|
-import java.io.IOException;
|
33
|
31
|
import java.net.URL;
|
34
|
32
|
import java.util.HashMap;
|
35
|
33
|
import java.util.Map;
|
|
@@ -87,6 +85,26 @@ public final class IconManager implements ConfigChangeListener {
|
87
|
85
|
}
|
88
|
86
|
return icons.get(type);
|
89
|
87
|
}
|
|
88
|
+
|
|
89
|
+ /**
|
|
90
|
+ * Retrieves the icon with the specified type. Returns null if the icon
|
|
91
|
+ * wasn't found.
|
|
92
|
+ *
|
|
93
|
+ * @param type The name of the icon type to retrieve
|
|
94
|
+ * @param width width of the image
|
|
95
|
+ * @param height height of the image
|
|
96
|
+ *
|
|
97
|
+ * @return The icon that should be used for the specified type
|
|
98
|
+ *
|
|
99
|
+ * @since 0.6.3
|
|
100
|
+ */
|
|
101
|
+ public Icon getScaledIcon(final String type, final int width, final int height) {
|
|
102
|
+ if (!icons.containsKey(type)) {
|
|
103
|
+ icons.put(type, new ImageIcon(getScaledImage(
|
|
104
|
+ new ImageIcon(getIconURL(type)).getImage(), width, height)));
|
|
105
|
+ }
|
|
106
|
+ return icons.get(type);
|
|
107
|
+ }
|
90
|
108
|
|
91
|
109
|
/**
|
92
|
110
|
* Retrieves the image with the specified type. Returns null if the icon
|
|
@@ -152,6 +170,7 @@ public final class IconManager implements ConfigChangeListener {
|
152
|
170
|
}
|
153
|
171
|
|
154
|
172
|
/** {@inheritDoc} */
|
|
173
|
+ @Override
|
155
|
174
|
public void configChanged(final String domain, final String key) {
|
156
|
175
|
if ("icon".equals(domain)) {
|
157
|
176
|
if (images.containsKey(key)) {
|