01: /*
02: * Copyright (C) 2007 Jared Alexander Spigner
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: *
18: * jspigner@openjx.org
19: *
20: * JXViewer.java
21: *
22: * Created on June 7, 2007, 11:53 PM
23: *
24: */
25:
26: package org.openjx.display;
27:
28: import javax.swing.JApplet;
29:
30: /**
31: * This is an abstract class representing the viewing capability of the
32: * application. It allows OpenJX to be viewed as an applet or an applicaiton.
33: *
34: * @author Jared Spigner
35: */
36: public abstract class JXViewer extends JApplet {
37:
38: /** This is a reference to the JXWindow class. */
39: public JXWindow jxWindow;
40:
41: /**
42: * This is the constructor for the JXViewer class. It creates a new
43: * instance of JXViewer.
44: */
45: public JXViewer() {
46: this .jxWindow = null;
47: }
48:
49: /**
50: * This method takes care of settings that are display mode dependendent.
51: *
52: * @param mode is the mode of display (desktop or applet) modes.
53: *
54: * @return true on success, else false on failure.
55: */
56: public boolean displayMode(String mode) {
57: if (mode.equals("desktop")) {
58: this .jxWindow = new JXWindow(this );
59: }
60:
61: return true;
62: }
63:
64: /**
65: * This method is required to support JApplet capabilities. It is
66: * equivalent to a main function in an application.
67: */
68: public abstract void init();
69:
70: }
|