KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > SAbstractIcon


1 /*
2  * $Id: SAbstractIcon.java,v 1.6 2005/06/07 12:55:58 neurolabs 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 /**
17  * SAbstractIcon.java
18  * <p/>
19  * <p/>
20  * Created: Tue Nov 19 09:17:25 2002
21  *
22  * @author <a HREF="mailto:armin.haaf@mercatis.de">Armin Haaf</a>
23  * @version $Revision: 1.6 $
24  */

25 public abstract class SAbstractIcon implements SIcon {
26
27     /**
28      * The width of the icon. This is the width it is rendered, not
29      * the real width of the icon. A value <0 means, no width is rendered
30      */

31     protected int width = -1;
32
33     /**
34      * The height of the icon. This is the height it is rendered, not
35      * the real width of the icon. A value <0 means, no height is rendered
36      */

37     protected int height = -1;
38
39     /**
40      * Title of icon, <code>""</code> if not set.
41      */

42     protected String JavaDoc title = null;
43
44
45     protected SAbstractIcon() {
46     }
47
48
49     protected SAbstractIcon(int width, int height) {
50         setIconWidth(width);
51         setIconHeight(height);
52     }
53
54     public int getIconWidth() {
55         return width;
56     }
57
58     public int getIconHeight() {
59         return height;
60     }
61
62     public void setIconWidth(int w) {
63         width = w;
64     }
65
66     public void setIconHeight(int h) {
67         height = h;
68     }
69
70     public String JavaDoc getIconTitle() {
71         return (title!=null) ? title : "";
72     }
73     
74     public void setIconTitle(String JavaDoc title) {
75         this.title = title;
76     }
77 }// SAbstractIcon
78

79
Popular Tags