Class pmr.chemime.ChemTree
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pmr.chemime.ChemTree

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----pmr.simplegraph.SimpleApplet
                                           |
                                           +----pmr.sgml.SGMLApplet
                                                   |
                                                   +----pmr.sgml.SGMLTree
                                                           |
                                                           +----pmr.cml.CMLTree
                                                                   |
                                                                   +----pmr.chemime.ChemTree

public class ChemTree
extends CMLTree
a superclass for all the ChemicalMIME objects
Author:
P.Murray-Rust, Copyright 1997

Variable Index

 o cmlIndex
 o docroot
 o headIndex
 o omitTable
 o title
 o titleIndex

Constructor Index

 o ChemTree()
create from an SGMLStream (either text/sgml or chemical/x-cml)
 o ChemTree(SGMLStream)
create from an SGMLStream (either text/sgml or chemical/x-cml)

Method Index

 o createTitle()
and an optional title; I'm not sure this is a good idea for all cases.
 o createTree()
all ChemTrees have a default root structure
 o getChemTree(String, String, StringList)
returns a CMLTree from a file/URL.
 o getTreeName()
return the tree name ("ChemTree")
 o init()
when an applet
 o main(String[])
this is only run when an application.
 o mimeViewer(String[], StringList)
simple chemical/MIME viewer; takes input from filename if lines==null, else uses lines
 o readObject(String, StringList)
static routine to read a CMLTree as a Drawable object if possible.
 o showHelp()
display Help

Variables

 o docroot
  protected int docroot
 o title
  protected String title
 o headIndex
  protected int headIndex
 o titleIndex
  protected int titleIndex
 o cmlIndex
  protected int cmlIndex
 o omitTable
  protected Hashtable omitTable

Constructors

 o ChemTree
  public ChemTree()
create from an SGMLStream (either text/sgml or chemical/x-cml)
 o ChemTree
  public ChemTree(SGMLStream sgmlStream) throws BadAttributeException, BadSGMLFileException
create from an SGMLStream (either text/sgml or chemical/x-cml)
Throws: BadAttributeException
SGMLStream was corrupt
Throws: BadSGMLFileException
SGMLStream was corrupt

Methods

 o init
  public void init()
when an applet
Overrides:
init in class CMLTree
 o showHelp
  public void showHelp()
display Help
Overrides:
showHelp in class CMLTree
 o getTreeName
  public String getTreeName()
return the tree name ("ChemTree")
Overrides:
getTreeName in class SGMLTree
 o createTree
  public void createTree()
all ChemTrees have a default root structure
Overrides:
createTree in class SGMLApplet
 o createTitle
  public void createTitle()
and an optional title; I'm not sure this is a good idea for all cases.
 o readObject
  public static DrawableX_Node readObject(String filename,
                                          StringList lines)
static routine to read a CMLTree as a Drawable object if possible. i.e. it will navigate down the tree to find something useful to display. This will be much better done with TEI navigation :-)

experimental!

 o getChemTree
  public static ChemTree getChemTree(String filename,
                                     String mime,
                                     StringList lines) throws BadFileException, FileNotFoundException, IOException
returns a CMLTree from a file/URL. Takes a MIME type; if this is nulll or "", makes a guess; returns null if fails, without Exception
Parameters:
filename - reads inpu from filename
mime - defines type of file (e.g. chemical/x-pdb)
lines - if not null, provides file content instead of filename
Throws: BadFileException
cannot interpret file as given MIME type, or cannot guess
 o mimeViewer
  public static void mimeViewer(String args[],
                                StringList lines)
simple chemical/MIME viewer; takes input from filename if lines==null, else uses lines
 o main
  public static void main(String args[])
this is only run when an application.

All Packages  Class Hierarchy  This Package  Previous  Next  Index