KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hero > client > grapheditor > IconManager


1 /**
2  *
3  * Bonita
4  * Copyright (C) 1999 Bull S.A.
5  * Bull 68 route de versailles 78434 Louveciennes Cedex France
6  * Further information: bonita@objectweb.org
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21  * USA
22  *
23  *
24 --------------------------------------------------------------------------
25  * $Id: IconManager.java,v 1.1 2004/07/30 14:57:57 mvaldes Exp $
26  *
27 --------------------------------------------------------------------------
28  */

29
30 package hero.client.grapheditor;
31
32
33 import java.awt.Image JavaDoc;
34 import java.awt.Toolkit JavaDoc;
35 import java.net.URL JavaDoc;
36
37 public class IconManager {
38
39     public static Image JavaDoc getIcon(String JavaDoc name) {
40         URL JavaDoc iconUrl = Thread.currentThread().getContextClassLoader().getResource(Frame.imageBase + name);
41         return Toolkit.getDefaultToolkit().getImage(iconUrl);
42     }
43
44     public static URL JavaDoc getIconUrl(String JavaDoc name) {
45         return Thread.currentThread().getContextClassLoader().getResource(Frame.imageBase + name);
46     }
47
48     public static String JavaDoc[] listAvailablesIcons() {
49         return new String JavaDoc[] {
50             "publiee-icon.png",
51             "classic-icon.png",
52             "waiting-icon.png",
53             "locked-red-icon.png",
54             "locked-yellow-icon.png",
55             "creation-icon.png",
56             "ok-icon.png",
57             "archived-icon.png" };
58     }
59     
60     public static String JavaDoc getDefaultIcon() {
61         return "classic-icon.png";
62     }
63
64 }
65
Popular Tags