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

Class pmr.cml.MOLNode

java.lang.Object
   |
   +----pmr.sgml.SGMLNode
           |
           +----pmr.sgml.DrawableSGMLNode
                   |
                   +----pmr.cml.DrawableX_Node
                           |
                           +----pmr.cml.MOLNode

public class MOLNode
extends DrawableX_Node
implements SubAddressable
The molecule class.
Author:
(C) P. Murray-Rust, 1996

Constructor Index

 o MOLNode(String, SGMLTree)
normal constructor

Method Index

 o action(Event, Object)
Reset button has to reset transformation matrix (rotMat) as well as scaling the scaler2d
 o addMolecularObject(MolecularObject, String)
add a MolecularObject (usually called from constructor of MolecularObject)
 o addSubAddress(IntRange)
 o addSubAddresses(IntRangeVector)
 o clearSubAddresses()
 o debug()
for debug
 o display()
Kicks off a ScrollableTopLevel which contains the object.
 o display(Graphics)
called from the display() routine of DrawableX_Node
 o drawBond(Graphics, int, int, int, int, int, double, double)
 o drawIcon(Graphics, int, int)
draw Icon
 o drawTruncated(Graphics, int, int, int, int, double, double)
 o get2DMolecule()
probably obsolete - just calculates mol2d
 o getAtomCount()
common get routines
 o getBondAtom(Choice2)
get array of all first atoms in bond or all second atoms
 o getBondCount()
 o getBondOrderCount(int)
return the number of bonds with a given (integer) order.
 o getBonds()
get serial numbers of bonded atoms, 2 per bond
 o getDoubleBondEquivalentCount()
get double bond equivalent count
 o getELSYM()
get the ATOMS Object public ATOMSNode getATOMS() { if (!processed) {process();} return cat; } /** get element symbols as array
 o getHydrogenCount()
get the hydrogen count as best as possible
 o getMolecularWeight()
gets molecular weight
 o getORDER()
get bond orders
 o getRingCount()
get ring count
 o getSimpleSMILES()
gets (unnormalised) SMILES; not yet working
 o getSTER()
get bond stereochemistries
 o getSubAddresses()
 o getXYZ3()
get the coordinates as a Point3Vector; this is a REFERENCE, so will change if 'this' changes its coordinates
 o highlight(IntSet)
general highlighting routine (for any node) assumes it is the ATOMS.
 o highlightAtom(int)
 o highlightAtoms(IntSet)
highlight atoms
 o highlightSubAddresses(boolean)
 o mayContain(SGMLNode)
can this node contain others.
 o mouseDown(Event, int, int)
action when mouse is clicked; if not overridden, no action
 o mouseDrag(Event, int, int)
action when mouse is dragged; if not overridden, no action
 o mouseUp(Event, int, int)
action when mouse is unclicked; if not overridden, no action
 o process()
complex objects may require processing; override this.
 o setMolecularObjectSelection(String, boolean)
select/unselect molecular object
 o showHelp()
display Help (includes ATOMS and BONDS)

Constructors

 o MOLNode
  public MOLNode(String giName,
                 SGMLTree tree)
normal constructor

Methods

 o showHelp
  public void showHelp()
display Help (includes ATOMS and BONDS)
Overrides:
showHelp in class DrawableX_Node
 o getBondOrderCount
  public int getBondOrderCount(int order)
return the number of bonds with a given (integer) order. You cannot rely on anything other than 1, 2, or 3 at this stage
 o getRingCount
  public int getRingCount()
get ring count
 o getDoubleBondEquivalentCount
  public int getDoubleBondEquivalentCount()
get double bond equivalent count
 o getHydrogenCount
  public int getHydrogenCount()
get the hydrogen count as best as possible
 o getMolecularWeight
  public double getMolecularWeight()
gets molecular weight
 o getSimpleSMILES
  public SimpleSMILES getSimpleSMILES()
gets (unnormalised) SMILES; not yet working
 o get2DMolecule
  public void get2DMolecule()
probably obsolete - just calculates mol2d
 o drawBond
  public void drawBond(Graphics g,
                       int x0,
                       int y0,
                       int x1,
                       int y1,
                       int order,
                       double f0,
                       double f1)
 o drawTruncated
  public void drawTruncated(Graphics g,
                            int x0,
                            int y0,
                            int x1,
                            int y1,
                            double f0,
                            double f1)
 o mayContain
  public boolean mayContain(SGMLNode n)
can this node contain others.
Overrides:
mayContain in class DrawableX_Node
 o process
  public void process()
complex objects may require processing; override this.
Overrides:
process in class DrawableSGMLNode
 o getAtomCount
  public int getAtomCount()
common get routines
 o getBondCount
  public int getBondCount()
 o getXYZ3
  public Point3Vector getXYZ3()
get the coordinates as a Point3Vector; this is a REFERENCE, so will change if 'this' changes its coordinates
 o getELSYM
  public String[] getELSYM()
get the ATOMS Object public ATOMSNode getATOMS() { if (!processed) {process();} return cat; } /** get element symbols as array
 o getORDER
  public int[] getORDER()
get bond orders
 o getSTER
  public int[] getSTER()
get bond stereochemistries
 o getBonds
  public Int2Vector getBonds()
get serial numbers of bonded atoms, 2 per bond
 o getBondAtom
  public IntArray getBondAtom(Choice2 c)
get array of all first atoms in bond or all second atoms
 o addMolecularObject
  public void addMolecularObject(MolecularObject mo,
                                 String name)
add a MolecularObject (usually called from constructor of MolecularObject)
 o setMolecularObjectSelection
  public void setMolecularObjectSelection(String name,
                                          boolean selected)
select/unselect molecular object
 o display
  public void display()
Kicks off a ScrollableTopLevel which contains the object.
Overrides:
display in class DrawableSGMLNode
 o display
  public void display(Graphics g)
called from the display() routine of DrawableX_Node
Overrides:
display in class DrawableX_Node
 o drawIcon
  public int drawIcon(Graphics g,
                      int x,
                      int y)
draw Icon
Overrides:
drawIcon in class DrawableX_Node
 o highlightAtoms
  public void highlightAtoms(IntSet is)
highlight atoms
 o highlight
  public void highlight(IntSet is)
general highlighting routine (for any node) assumes it is the ATOMS. (for bonds you have to use BONDS)
Overrides:
highlight in class DrawableX_Node
 o highlightAtom
  public void highlightAtom(int jatom)
 o action
  public boolean action(Event e,
                        Object arg)
Reset button has to reset transformation matrix (rotMat) as well as scaling the scaler2d
Overrides:
action in class DrawableX_Node
 o mouseUp
  public boolean mouseUp(Event evt,
                         int x,
                         int y)
action when mouse is unclicked; if not overridden, no action
Overrides:
mouseUp in class DrawableX_Node
 o mouseDown
  public boolean mouseDown(Event evt,
                           int x,
                           int y)
action when mouse is clicked; if not overridden, no action
Overrides:
mouseDown in class DrawableX_Node
 o mouseDrag
  public boolean mouseDrag(Event evt,
                           int x,
                           int y)
action when mouse is dragged; if not overridden, no action
Overrides:
mouseDrag in class DrawableX_Node
 o clearSubAddresses
  public void clearSubAddresses()
 o addSubAddress
  public void addSubAddress(IntRange ir)
 o addSubAddresses
  public void addSubAddresses(IntRangeVector irv)
 o getSubAddresses
  public IntRangeVector getSubAddresses()
 o highlightSubAddresses
  public void highlightSubAddresses(boolean onOff)
 o debug
  public void debug()
for debug
Overrides:
debug in class DrawableX_Node

All Packages  Class Hierarchy  This Package  Previous  Next  Index