01: /*
02: * Copyright 2000,2005 wingS development team.
03: *
04: * This file is part of wingS (http://wingsframework.org).
05: *
06: * wingS is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * Please see COPYING for the complete licence.
12: */
13: package org.wings;
14:
15: import java.net.URL;
16:
17: /**
18: * SIcon which is backed by an URL to get the image.
19: *
20: * @author <a href="mailto:armin@hyperion.intranet.mercatis.de">Armin Haaf</a>
21: */
22: public class SURLIcon extends SAbstractIcon {
23:
24: protected SimpleURL url;
25:
26: public SURLIcon(URL u) {
27: this (u.toString());
28: }
29:
30: public SURLIcon(SimpleURL u) {
31: url = u;
32: }
33:
34: public SURLIcon(String u) {
35: this (new SimpleURL(u));
36: }
37:
38: public SURLIcon(String u, int width, int height) {
39: this (u);
40:
41: setIconWidth(width);
42: setIconHeight(height);
43: }
44:
45: public SimpleURL getURL() {
46: return url;
47: }
48:
49: public String toString() {
50: return url.toString();
51: }
52:
53: }// SURLIcon
|