Main Page | Alphabetical List | Class List | File List | Class Members

JWebPresenterSS Class Reference

List of all members.

Public Member Functions

void init ()

Static Public Member Functions

void main (String argv[])

Package Attributes

final JApplet me = this
JWPFrameSS frame = null

Static Package Attributes

final String ver = "JWebPresenter SS 1.3 (2005-01-23), L. Zhao"

Detailed Description

The main class. We basically have two running mode: applet or application. When in applet mode, parameters can be specified by the WWW page where JWebPresenterSS is embeded (see the sample index.html for detailed usage). In application mode, on the other hand, parameters must be given from the command line.

Definition at line 62 of file JWebPresenterSS.java.


Member Function Documentation

void JWebPresenterSS.init  ) 
 

We can initialize the applet instance by adding a button, which shows the frame when pressed (parameters are passed by JApplet.getParameter()). 2005-01-23 Alternatively, we can show the picture in the viewer (e.g., browser) with no new window by giving empty (or null) cmdText.

Parameters:
cmdText text (empty for no window) of the start button, 2005-01-23.
slideURL URL of the FIRST slide (e.g., http://host/slide-1.png).
debugMode 0 to disable the debug function, nonzero to enable.
ctlURL URL for the initial control parameters, see document too. If given ctlURL is invalid, then slideURL is used repeatedly.
fetchTime default time interval (in 100ms) to fetch parameters.
baseURL the base URL, see the note of 2004-04-21.
windowWidth the width of JWebPresenter window (see NOTICE), 2005-01-20
windowHeight the height of JWebPresenter window, 2005-01-20
NOTICE: 2004-04-21, both slideURL and ctlURL can be (re-)specified by control parameters Slide and nextCtl (ctlURL) respectively. They (slideURL and ctlURL) are determined as follows: If Slide (nextCtl) is an absolute URL, use it; otherwise use baseURL + Slide (baseURL + nextCtl).

NOTICE: 2005-01-20, Dove told me that specifying window size at start time could be helpful. This is. The default size is full screen if width or height is invalid.

Definition at line 101 of file JWebPresenterSS.java.

References frame, and me.

00101                        {
00102         Container pane = getContentPane(); // get the drawing pane.
00103 
00104         String cmdText = me.getParameter("cmdText"); // Get the cmdText string.
00105         if (cmdText == null) cmdText = "";           // Then cmdText is not null.
00106         if (cmdText.length() == 0) { // empty string means not to create window.
00107             pane.add(new JWPPanelSS(null, // no window
00108                                     me.getParameter("slideURL"),
00109                                     me.getParameter("debugMode"),
00110                                     me.getParameter("ctlURL"),
00111                                     me.getParameter("baseURL"),
00112                                     me.getParameter("fetchTime"),
00113                                     true)); // "true" is for applet.
00114         }
00115         else { // create the window
00116             JButton startButton = new JButton(cmdText);
00117             startButton.addActionListener(new ActionListener() {
00118                 public void actionPerformed(ActionEvent e) {
00119                     if (frame == null) {
00120                         frame = new JWPFrameSS(me.getParameter("slideURL"),
00121                                                me.getParameter("debugMode"),
00122                                                me.getParameter("ctlURL"),
00123                                                me.getParameter("baseURL"),
00124                                                me.getParameter("fetchTime"),
00125                                                me.getParameter("windowWidth"),
00126                                                me.getParameter("windowHeight"),
00127                                                true); // "true" is for applet.
00128                     }
00129                     frame.setVisible(true);
00130                 }
00131             });
00132             pane.add(startButton);
00133         }
00134     }

void JWebPresenterSS.main String  argv[]  )  [static]
 

main function, hence we can also run as an application.

Definition at line 139 of file JWebPresenterSS.java.

00139                                            {
00140         if (argv.length < 1) {
00141             System.out.println("JWebPresenter Project :: " + ver + "\n"
00142                 + "Usage: java JWebPresenterSS parameters\n"
00143                 + "Parameters can be given like name=value (no space around =) in any order.\n"
00144                 + "  slideURL:  initial URL to get slides, can be omitted if given by ctlURL.\n"
00145                 + "  ctlURL:    initial URL to get control parameters;\n"
00146                 + "  debugMode: debug mode, 0 to disable (default), 1 or above to enable;\n"
00147                 + "  baseURL:   base URL, used if a URL obtained from ctlURL is not absolute;\n"
00148                 + "  fetchTime: time in 100ms to fetch targets (default 50);\n"
00149                 + "  width:     width of presentation window (can be modified after start);\n"
00150                 + "  height:    height of presentation window (can be modified after start).\n"
00151                 + "If no width or height is specified, full screen mode is used.\n"
00152                 + "Parameter's name can be abbreviated if no confusion happens.\n"
00153                 + "For example: s=ftp://host/slide.png c=http://host/ctl.txt b=ftp://host/\n");
00154             System.exit(1);
00155         }
00156         
00157         String slideURL  = "";
00158         String ctlURL    = "";
00159         String debugMode = "";
00160         String baseURL   = "";
00161         String fetchTime = "";
00162         String width     = "";
00163         String height    = "";
00164 
00165         for (int i=0; i<argv.length; i++) {
00166             int j = argv[i].indexOf("=");
00167             if (j == -1) {
00168                 System.out.println("Bad parameter ("+argv[i] +") omitted");
00169                 continue;
00170             }
00171             // else {
00172             switch (argv[i].charAt(0)) {
00173                 case 's' : slideURL  = argv[i].substring(j+1); break;
00174                 case 'c' : ctlURL    = argv[i].substring(j+1); break;
00175                 case 'd' : debugMode = argv[i].substring(j+1); break;
00176                 case 'b' : baseURL   = argv[i].substring(j+1); break;
00177                 case 'f' : fetchTime = argv[i].substring(j+1); break;
00178                 case 'w' : width     = argv[i].substring(j+1); break;
00179                 case 'h' : height    = argv[i].substring(j+1); break;
00180                 default  :
00181                     System.out.println("Bad parameter ("+argv[i]+") omitted.");
00182             }
00183         }
00184 
00185         new JWPFrameSS(slideURL, debugMode, ctlURL, baseURL, fetchTime, width, height, false).setVisible(true);
00186     }


Member Data Documentation

JWPFrameSS JWebPresenterSS.frame = null [package]
 

Reference to the frame instance, valid only for nonempty cmdText.

Definition at line 76 of file JWebPresenterSS.java.

Referenced by init().

final JApplet JWebPresenterSS.me = this [package]
 

Reference to myself (the applet).

Definition at line 71 of file JWebPresenterSS.java.

Referenced by init().

final String JWebPresenterSS.ver = "JWebPresenter SS 1.3 (2005-01-23), L. Zhao" [static, package]
 

Version description.

Definition at line 66 of file JWebPresenterSS.java.


The documentation for this class was generated from the following file:
Generated on Sun Jan 23 16:25:29 2005 for JWebPresenter by  doxygen 1.3.9.1