KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwt > applet > Applet


1 /*
2    SwingWT
3    Copyright(c)2003-2004, R. Rawson-Tetley
4
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7
8    Contact me by electronic mail: bobintetley@users.sourceforge.net
9
10    $Log: Applet.java,v $
11    Revision 1.1 2004/03/22 15:28:51 bobintetley
12    Complete stub Applet implementation
13
14    Revision 1.1 2004/03/21 17:22:53 bobintetley
15    Compatibility methods for awt Graphics, List and Label. Dummy Applet implementation
16
17    
18 */

19
20 package swingwt.applet;
21
22 import swingwt.awt.*;
23
24 import java.net.URL JavaDoc;
25 import java.util.Locale JavaDoc;
26
27 /**
28  * Dummy applet container. Doesn't actually do anything but provide
29  * fake applet services to subclasses.
30  *
31  * This is for Java applications that can project both a regular
32  * AWT interface and an Applet (and obviously only the regular
33  * AWT one will work).
34  *
35  * If enough people hassle me I'll implement AppletInfo
36  * and AppletContext - but you really shouldn't need them :-)
37  *
38  * @author Robin Rawson-Tetley
39  */

40 public class Applet extends swingwt.awt.Panel {
41
42     
43     public void destroy() {}
44
45     public String JavaDoc getAppletInfo() {
46         return "SwingWT dummy applet container.";
47     }
48     
49     public AudioClip getAudioClip(URL JavaDoc url) {
50         return new AudioClip() {
51             public void play() {}
52             public void stop() {}
53             public void loop() {}
54         };
55     }
56     
57     public AudioClip getAudioClip(URL JavaDoc url, String JavaDoc name) {
58         return getAudioClip(url);
59     }
60
61     public URL JavaDoc getCodeBase() {
62         return null;
63     }
64
65     public URL JavaDoc getDocumentBase() {
66         return null;
67     }
68
69     public Image getImage(URL JavaDoc image) {
70         return new swingwtx.swing.ImageIcon(image).getImage();
71     }
72
73     public Image getImage(URL JavaDoc image, String JavaDoc name) {
74         return getImage(image);
75     }
76
77     public Locale JavaDoc getLocale() {
78         return null;
79     }
80     
81     public String JavaDoc getParameter(String JavaDoc name) {
82         return null;
83     }
84     
85     public String JavaDoc[] getParameterInfo() {
86     return null;
87     }
88
89     public void init() {
90     }
91
92     public boolean isActive() {
93     return false;
94     }
95     
96     public static AudioClip newAudioClip(URL JavaDoc url) {
97         return new AudioClip() {
98             public void play() {}
99             public void stop() {}
100             public void loop() {}
101         };
102     }
103
104     public void play(URL JavaDoc url) {
105     }
106
107     public void play(URL JavaDoc url, String JavaDoc name) {
108     }
109
110     public void resize(Dimension d) {
111     }
112     
113     public void resize(int width, int height) {
114     }
115
116     public void showStatus(String JavaDoc message) {
117     }
118
119     public void start() {
120     }
121
122     public void stop() {
123     }
124     
125 }
126
Popular Tags