01: /*
02: * @(#)DemoApplet.java 1.5 06/10/10
03: *
04: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: */
26: package personal;
27:
28: import java.applet.*;
29: import java.awt.*;
30: import java.awt.event.*;
31: import java.util.ArrayList;
32: import basis.Builder;
33:
34: public class DemoApplet extends Applet {
35: protected static ArrayList demos = new ArrayList();
36: private Builder builder;
37:
38: static {
39: demos.add("basis.demos.GraphicsDemo");
40: demos.add("basis.demos.FontDemo");
41: demos.add("basis.demos.EventDemo");
42: demos.add("basis.demos.MiscDemo");
43: demos.add("basis.demos.GameDemo");
44: demos.add("personal.demos.WidgetDemo");
45: }
46:
47: public static void main(String[] args) throws Exception {
48: System.out.println("");
49: System.out.println("USAGE:");
50: System.out
51: .println(" cvm sun.applet.AppletViewer personal/DemoApplet.html");
52: System.out.println("");
53: System.exit(1);
54: }
55:
56: public DemoApplet() {
57: builder = new Builder(demos);
58: }
59:
60: public void init() {
61: System.out.println("Applet: init");
62: try {
63: builder.build(this );
64: } catch (Exception e) {
65: e.printStackTrace();
66: }
67: }
68:
69: public void start() {
70: System.out.println("Applet: start");
71: builder.showDemo("Color");
72: }
73:
74: public void stop() {
75: System.out.println("Applet: stop");
76: }
77:
78: public void destroy() {
79: System.out.println("Applet: destroy");
80: }
81: }
|