Class pmr.sgml.SGMLApplet
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pmr.sgml.SGMLApplet

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----pmr.simplegraph.SimpleApplet
                                           |
                                           +----pmr.sgml.SGMLApplet

public class SGMLApplet
extends SimpleApplet
implements Helpable
simple SGMLfile viewer; acts as a SGML 'consumer' - at present only inputNames, and URLs. Since the class manages menus, it will normally be necessary to subclass it as a way to deal with events.

Note: this is hardcoded to accept:

Author:
(C) P. Murray-Rust, 1996

Variable Index

 o helpText
 o inputName
 o inputRoot
 o inputUrl
 o lines
 o mytree

Constructor Index

 o SGMLApplet()
 o SGMLApplet(String)

Method Index

 o addHelp(String[])
 o createTree()
create a Tree from the file that has just been read in
 o fileMenu(String[])
 o getInputRoot()
 o getSGMLTree()
 o handleEvent(Event)
this is called when the main menu bar is activated.
 o helpMenu(String)
 o init()
It creates a tree via createTree();
 o main(String[])
this is only run when an application.
 o paint(Graphics)
 o readURLInput(String)
this is only run when an applet.
 o showHelp()
display Help
 o showMenuItem(MenuItem)

Variables

 o mytree
  protected SGMLTree mytree
 o inputName
  protected String inputName
 o lines
  protected StringList lines
 o inputUrl
  protected URL inputUrl
 o inputRoot
  protected static String inputRoot
 o helpText
  protected StringList helpText

Constructors

 o SGMLApplet
  public SGMLApplet()
 o SGMLApplet
  public SGMLApplet(String inputName)

Methods

 o paint
  public void paint(Graphics g)
Overrides:
paint in class SimpleApplet
 o addHelp
  public void addHelp(String s[])
Overrides:
addHelp in class SimpleApplet
 o showHelp
  public void showHelp()
display Help
Overrides:
showHelp in class SimpleApplet
 o init
  public void init()
It creates a tree via createTree();
Overrides:
init in class SimpleApplet
 o readURLInput
  public void readURLInput(String inputName)
this is only run when an applet. It requires PARAM INPUTURL to be set. It reads the lines from the input and stores them internally
 o createTree
  public void createTree()
create a Tree from the file that has just been read in
 o handleEvent
  public boolean handleEvent(Event event)
this is called when the main menu bar is activated. Quit is dealt with, but normally this class should be subclassed as a way of dealing with events
Overrides:
handleEvent in class SimpleApplet
 o showMenuItem
  public boolean showMenuItem(MenuItem mi)
Overrides:
showMenuItem in class SimpleApplet
 o fileMenu
  public boolean fileMenu(String labels[])
Overrides:
fileMenu in class SimpleApplet
 o helpMenu
  public boolean helpMenu(String label)
Overrides:
helpMenu in class SimpleApplet
 o getInputRoot
  public static String getInputRoot()
 o getSGMLTree
  public SGMLTree getSGMLTree()
 o main
  public static void main(String args[])
this is only run when an application. Note that running the class (e.g. java pmr.sgml.SGMLApplet ) is enough to run it. A subclass should override everything in this routine

All Packages  Class Hierarchy  This Package  Previous  Next  Index