KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > SURLIcon


1 /*
2  * $Id: SURLIcon.java,v 1.4 2005/05/27 12:51:29 blueshift Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package org.wings;
15
16 import java.net.URL JavaDoc;
17
18 /**
19  * SURLIcon - Some icon whose only thing we know is its URL.
20  *
21  * @author <a HREF="mailto:armin@hyperion.intranet.mercatis.de">Armin Haaf</a>
22  * @version $Revision
23  */

24 public class SURLIcon extends SAbstractIcon {
25
26     protected SimpleURL url;
27
28     public SURLIcon(URL JavaDoc u) {
29         this(u.toString());
30     }
31
32     public SURLIcon(SimpleURL u) {
33         url = u;
34     }
35
36     public SURLIcon(String JavaDoc u) {
37         this(new SimpleURL(u));
38     }
39
40     public SURLIcon(String JavaDoc u, int width, int height) {
41         this(u);
42
43         setIconWidth(width);
44         setIconHeight(height);
45     }
46
47     public SimpleURL getURL() {
48         return url;
49     }
50
51     public String JavaDoc toString() {
52         return url.toString();
53     }
54
55 }// SURLIcon
56

57
58
Popular Tags