KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > swing > JSVGCanvasBeanInfo


1 /*
2
3    Copyright 2001 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.swing;
19
20 import java.awt.Image JavaDoc;
21 import java.beans.SimpleBeanInfo JavaDoc;
22
23 /**
24  * A <tt>BeanInfo</tt> for the <tt>JSVGCanvas</tt>.
25  *
26  * @author <a HREF="mailto:tkormann@apache.org">Thierry Kormann</a>
27  * @version $Id: JSVGCanvasBeanInfo.java,v 1.4 2004/08/18 07:15:32 vhardy Exp $
28  */

29 public class JSVGCanvasBeanInfo extends SimpleBeanInfo JavaDoc {
30
31     /** A color 16x16 icon. */
32     protected Image JavaDoc iconColor16x16;
33
34     /** A greyscale 16x16 icon. */
35     protected Image JavaDoc iconMono16x16;
36
37     /** A color 32x32 icon. */
38     protected Image JavaDoc iconColor32x32;
39
40     /** A greyscale 32x32 icon. */
41     protected Image JavaDoc iconMono32x32;
42
43     /**
44      * Constructs a new <tt>BeanInfo</tt> for a <tt>JSVGCanvas</tt>.
45      */

46     public JSVGCanvasBeanInfo() {
47         iconColor16x16 = loadImage("resources/batikColor16x16.gif");
48         iconMono16x16 = loadImage("resources/batikMono16x16.gif");
49         iconColor32x32 = loadImage("resources/batikColor32x32.gif");
50         iconMono32x32 = loadImage("resources/batikMono32x32.gif");
51     }
52
53     /**
54      * Returns an icon for the specified type.
55      */

56     public Image JavaDoc getIcon(int iconType) {
57         switch(iconType) {
58         case ICON_COLOR_16x16:
59             return iconColor16x16;
60         case ICON_MONO_16x16:
61             return iconMono16x16;
62         case ICON_COLOR_32x32:
63             return iconColor32x32;
64         case ICON_MONO_32x32:
65             return iconMono32x32;
66         default:
67             return null;
68         }
69     }
70 }
71
72
Popular Tags