Class pmr.cml.CMLTree
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pmr.cml.CMLTree

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

public class CMLTree
extends SGMLTree
Tree holding a CML document instance; primarily used to derive specific 'filetypes'. and to provide generic 'get' routines. This is also still an applet
Author:
(C) P. Murray-Rust, 1996

Constructor Index

 o CMLTree()
 o CMLTree(ESISStream)
 o CMLTree(SGMLStream)

Method Index

 o createGeneralTOC(int)
create a chemical TOC
 o display()
the 'default' display for this object, rather than the tree.
 o display(Graphics)
as above, but output to preselected Graphics; not sure yet what to do about Scaler2D for multiple nodes
 o getCMLTreeFromMIME(String, String)
returns a CMLTree from a file/URL.
 o getGraph()
gets first Graph object in file (often the only one).
 o getMOL()
gets first MOL object in file (often the only one).
 o getScaler2D()
 o getSEQUENCENodes(int)
return SEQUENCENodes if they exist as children of index
 o getSpectrum()
gets first Spectrum object in file (often the only one).
 o init()
when an applet
 o removeDisplayNode(DrawableX_Node)
 o setDisplayNode(DrawableX_Node)
a CMLTree can have one or more displayNodes which are displayed when display() is invoked.
 o setScaler2D(Scaler2D)
set and get the Scaler2D for displaying nodes; however only the Screen Window will be used - I have yet to work all this out!!
 o showHelp()
display Help

Constructors

 o CMLTree
  public CMLTree()
 o CMLTree
  public CMLTree(SGMLStream s) throws BadSGMLFileException, BadAttributeException
 o CMLTree
  public CMLTree(ESISStream e) throws BadESISFileException, BadAttributeException

Methods

 o showHelp
  public void showHelp()
display Help
Overrides:
showHelp in class SGMLTree
 o init
  public void init()
when an applet
Overrides:
init in class SGMLTree
 o createGeneralTOC
  public GeneralTOC createGeneralTOC(int depth)
create a chemical TOC
Overrides:
createGeneralTOC in class SGMLTree
 o getMOL
  public MOLNode getMOL()
gets first MOL object in file (often the only one). Returns a null object if none found; This will need updating
 o getSpectrum
  public XLISTNode getSpectrum()
gets first Spectrum object in file (often the only one). Returns a null object if none found; This will need updating
 o getGraph
  public XLISTNode getGraph()
gets first Graph object in file (often the only one). Returns a null object if none found; This will need updating
 o getSEQUENCENodes
  public SEQUENCENode[] getSEQUENCENodes(int index)
return SEQUENCENodes if they exist as children of index
 o setScaler2D
  public void setScaler2D(Scaler2D s2d)
set and get the Scaler2D for displaying nodes; however only the Screen Window will be used - I have yet to work all this out!!
 o getScaler2D
  public Scaler2D getScaler2D()
 o setDisplayNode
  public void setDisplayNode(DrawableX_Node n)
a CMLTree can have one or more displayNodes which are displayed when display() is invoked. These may be set when the CMLTree is created (e.g. the MOLNodes might be highlighted for molecules
 o removeDisplayNode
  public void removeDisplayNode(DrawableX_Node n)
 o display
  public void display()
the 'default' display for this object, rather than the tree. One or more subnodes (DrawableX_Nodes) can be set with setDisplayNode() and these are displayed; output to new Frame (Window)
 o display
  public void display(Graphics g)
as above, but output to preselected Graphics; not sure yet what to do about Scaler2D for multiple nodes
 o getCMLTreeFromMIME
  public static CMLTree getCMLTreeFromMIME(String filename,
                                           String mime) throws BadFileException, FileNotFoundException, IOException
returns a CMLTree from a file/URL. Takes a MIME type; if this is null or "", makes a guess; returns null if fails, without Exception

NOTE: only chemical/x-cml, text/sgml are allowed as mimetypes; this function is normally overridden by ChemicalMIMETree

Throws: BadFileException
cannot interpret file as given MIME type, or cannot guess

All Packages  Class Hierarchy  This Package  Previous  Next  Index