diff options
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/wordpress/tipsforjava/swing/StretchIcon.java | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/com/wordpress/tipsforjava/swing/StretchIcon.java b/src/com/wordpress/tipsforjava/swing/StretchIcon.java index 667f1cd..d41bbfe 100644 --- a/src/com/wordpress/tipsforjava/swing/StretchIcon.java +++ b/src/com/wordpress/tipsforjava/swing/StretchIcon.java | |||
@@ -10,6 +10,7 @@ import java.awt.Image; | |||
10 | import java.awt.Insets; | 10 | import java.awt.Insets; |
11 | import java.awt.image.ImageObserver; | 11 | import java.awt.image.ImageObserver; |
12 | import java.net.URL; | 12 | import java.net.URL; |
13 | |||
13 | import javax.swing.ImageIcon; | 14 | import javax.swing.ImageIcon; |
14 | 15 | ||
15 | /** | 16 | /** |
@@ -44,7 +45,7 @@ public class StretchIcon extends ImageIcon { | |||
44 | * | 45 | * |
45 | * @see ImageIcon#ImageIcon(byte[]) | 46 | * @see ImageIcon#ImageIcon(byte[]) |
46 | */ | 47 | */ |
47 | public StretchIcon(byte[] imageData) { | 48 | public StretchIcon(final byte[] imageData) { |
48 | super(imageData); | 49 | super(imageData); |
49 | } | 50 | } |
50 | 51 | ||
@@ -62,7 +63,7 @@ public class StretchIcon extends ImageIcon { | |||
62 | * | 63 | * |
63 | * @see ImageIcon#ImageIcon(byte[]) | 64 | * @see ImageIcon#ImageIcon(byte[]) |
64 | */ | 65 | */ |
65 | public StretchIcon(byte[] imageData, boolean proportionate) { | 66 | public StretchIcon(final byte[] imageData, final boolean proportionate) { |
66 | super(imageData); | 67 | super(imageData); |
67 | this.proportionate = proportionate; | 68 | this.proportionate = proportionate; |
68 | } | 69 | } |
@@ -78,7 +79,7 @@ public class StretchIcon extends ImageIcon { | |||
78 | * | 79 | * |
79 | * @see ImageIcon#ImageIcon(byte[], java.lang.String) | 80 | * @see ImageIcon#ImageIcon(byte[], java.lang.String) |
80 | */ | 81 | */ |
81 | public StretchIcon(byte[] imageData, String description) { | 82 | public StretchIcon(final byte[] imageData, final String description) { |
82 | super(imageData, description); | 83 | super(imageData, description); |
83 | } | 84 | } |
84 | 85 | ||
@@ -99,7 +100,7 @@ public class StretchIcon extends ImageIcon { | |||
99 | * | 100 | * |
100 | * @see ImageIcon#ImageIcon(byte[], java.lang.String) | 101 | * @see ImageIcon#ImageIcon(byte[], java.lang.String) |
101 | */ | 102 | */ |
102 | public StretchIcon(byte[] imageData, String description, boolean proportionate) { | 103 | public StretchIcon(final byte[] imageData, final String description, final boolean proportionate) { |
103 | super(imageData, description); | 104 | super(imageData, description); |
104 | this.proportionate = proportionate; | 105 | this.proportionate = proportionate; |
105 | } | 106 | } |
@@ -112,7 +113,7 @@ public class StretchIcon extends ImageIcon { | |||
112 | * | 113 | * |
113 | * @see ImageIcon#ImageIcon(java.awt.Image) | 114 | * @see ImageIcon#ImageIcon(java.awt.Image) |
114 | */ | 115 | */ |
115 | public StretchIcon(Image image) { | 116 | public StretchIcon(final Image image) { |
116 | super(image); | 117 | super(image); |
117 | } | 118 | } |
118 | 119 | ||
@@ -128,7 +129,7 @@ public class StretchIcon extends ImageIcon { | |||
128 | * | 129 | * |
129 | * @see ImageIcon#ImageIcon(java.awt.Image) | 130 | * @see ImageIcon#ImageIcon(java.awt.Image) |
130 | */ | 131 | */ |
131 | public StretchIcon(Image image, boolean proportionate) { | 132 | public StretchIcon(final Image image, final boolean proportionate) { |
132 | super(image); | 133 | super(image); |
133 | this.proportionate = proportionate; | 134 | this.proportionate = proportionate; |
134 | } | 135 | } |
@@ -143,7 +144,7 @@ public class StretchIcon extends ImageIcon { | |||
143 | * | 144 | * |
144 | * @see ImageIcon#ImageIcon(java.awt.Image, java.lang.String) | 145 | * @see ImageIcon#ImageIcon(java.awt.Image, java.lang.String) |
145 | */ | 146 | */ |
146 | public StretchIcon(Image image, String description) { | 147 | public StretchIcon(final Image image, final String description) { |
147 | super(image, description); | 148 | super(image, description); |
148 | } | 149 | } |
149 | 150 | ||
@@ -161,7 +162,7 @@ public class StretchIcon extends ImageIcon { | |||
161 | * | 162 | * |
162 | * @see ImageIcon#ImageIcon(java.awt.Image, java.lang.String) | 163 | * @see ImageIcon#ImageIcon(java.awt.Image, java.lang.String) |
163 | */ | 164 | */ |
164 | public StretchIcon(Image image, String description, boolean proportionate) { | 165 | public StretchIcon(final Image image, final String description, final boolean proportionate) { |
165 | super(image, description); | 166 | super(image, description); |
166 | this.proportionate = proportionate; | 167 | this.proportionate = proportionate; |
167 | } | 168 | } |
@@ -174,7 +175,7 @@ public class StretchIcon extends ImageIcon { | |||
174 | * | 175 | * |
175 | * @see ImageIcon#ImageIcon(java.lang.String) | 176 | * @see ImageIcon#ImageIcon(java.lang.String) |
176 | */ | 177 | */ |
177 | public StretchIcon(String filename) { | 178 | public StretchIcon(final String filename) { |
178 | super(filename); | 179 | super(filename); |
179 | } | 180 | } |
180 | 181 | ||
@@ -191,7 +192,7 @@ public class StretchIcon extends ImageIcon { | |||
191 | * | 192 | * |
192 | * @see ImageIcon#ImageIcon(java.lang.String) | 193 | * @see ImageIcon#ImageIcon(java.lang.String) |
193 | */ | 194 | */ |
194 | public StretchIcon(String filename, boolean proportionate) { | 195 | public StretchIcon(final String filename, final boolean proportionate) { |
195 | super(filename); | 196 | super(filename); |
196 | this.proportionate = proportionate; | 197 | this.proportionate = proportionate; |
197 | } | 198 | } |
@@ -206,7 +207,7 @@ public class StretchIcon extends ImageIcon { | |||
206 | * | 207 | * |
207 | * @see ImageIcon#ImageIcon(java.lang.String, java.lang.String) | 208 | * @see ImageIcon#ImageIcon(java.lang.String, java.lang.String) |
208 | */ | 209 | */ |
209 | public StretchIcon(String filename, String description) { | 210 | public StretchIcon(final String filename, final String description) { |
210 | super(filename, description); | 211 | super(filename, description); |
211 | } | 212 | } |
212 | 213 | ||
@@ -225,7 +226,7 @@ public class StretchIcon extends ImageIcon { | |||
225 | * | 226 | * |
226 | * @see ImageIcon#ImageIcon(java.awt.Image, java.lang.String) | 227 | * @see ImageIcon#ImageIcon(java.awt.Image, java.lang.String) |
227 | */ | 228 | */ |
228 | public StretchIcon(String filename, String description, boolean proportionate) { | 229 | public StretchIcon(final String filename, final String description, final boolean proportionate) { |
229 | super(filename, description); | 230 | super(filename, description); |
230 | this.proportionate = proportionate; | 231 | this.proportionate = proportionate; |
231 | } | 232 | } |
@@ -238,7 +239,7 @@ public class StretchIcon extends ImageIcon { | |||
238 | * | 239 | * |
239 | * @see ImageIcon#ImageIcon(java.net.URL) | 240 | * @see ImageIcon#ImageIcon(java.net.URL) |
240 | */ | 241 | */ |
241 | public StretchIcon(URL location) { | 242 | public StretchIcon(final URL location) { |
242 | super(location); | 243 | super(location); |
243 | } | 244 | } |
244 | 245 | ||
@@ -254,7 +255,7 @@ public class StretchIcon extends ImageIcon { | |||
254 | * | 255 | * |
255 | * @see ImageIcon#ImageIcon(java.net.URL) | 256 | * @see ImageIcon#ImageIcon(java.net.URL) |
256 | */ | 257 | */ |
257 | public StretchIcon(URL location, boolean proportionate) { | 258 | public StretchIcon(final URL location, final boolean proportionate) { |
258 | super(location); | 259 | super(location); |
259 | this.proportionate = proportionate; | 260 | this.proportionate = proportionate; |
260 | } | 261 | } |
@@ -269,7 +270,7 @@ public class StretchIcon extends ImageIcon { | |||
269 | * | 270 | * |
270 | * @see ImageIcon#ImageIcon(java.net.URL, java.lang.String) | 271 | * @see ImageIcon#ImageIcon(java.net.URL, java.lang.String) |
271 | */ | 272 | */ |
272 | public StretchIcon(URL location, String description) { | 273 | public StretchIcon(final URL location, final String description) { |
273 | super(location, description); | 274 | super(location, description); |
274 | } | 275 | } |
275 | 276 | ||
@@ -287,7 +288,7 @@ public class StretchIcon extends ImageIcon { | |||
287 | * | 288 | * |
288 | * @see ImageIcon#ImageIcon(java.net.URL, java.lang.String) | 289 | * @see ImageIcon#ImageIcon(java.net.URL, java.lang.String) |
289 | */ | 290 | */ |
290 | public StretchIcon(URL location, String description, boolean proportionate) { | 291 | public StretchIcon(final URL location, final String description, final boolean proportionate) { |
291 | super(location, description); | 292 | super(location, description); |
292 | this.proportionate = proportionate; | 293 | this.proportionate = proportionate; |
293 | } | 294 | } |
@@ -317,23 +318,23 @@ public class StretchIcon extends ImageIcon { | |||
317 | * @see ImageIcon#paintIcon(java.awt.Component, java.awt.Graphics, int, int) | 318 | * @see ImageIcon#paintIcon(java.awt.Component, java.awt.Graphics, int, int) |
318 | */ | 319 | */ |
319 | @Override | 320 | @Override |
320 | public synchronized void paintIcon(Component c, Graphics g, int x, int y) { | 321 | public synchronized void paintIcon(final Component c, final Graphics g, int x, int y) { |
321 | if (getImage() == null) { | 322 | if (this.getImage() == null) { |
322 | return; | 323 | return; |
323 | } | 324 | } |
324 | Insets insets = ((Container) c).getInsets(); | 325 | final Insets insets = ((Container) c).getInsets(); |
325 | x = insets.left; | 326 | x = insets.left; |
326 | y = insets.top; | 327 | y = insets.top; |
327 | 328 | ||
328 | int w = c.get |