Class MSNode

All Implemented Interfaces:
ROLS, Serializable, Cloneable, MutableTreeNode, TreeNode
Direct Known Subclasses:
Atom, BondedTerm, Joint, MSGroup, MSRoot, ROLSP

public class MSNode extends DefaultMutableTreeNode implements ROLS
The MSNode class forms the basic unit that all data classes extend.
Since:
1.0
Author:
Michael J. Schnieders
See Also:
  • Field Details

    • selected

      protected boolean selected
      True if this node is selected.
  • Constructor Details

    • MSNode

      public MSNode()
      Default MSNode Constructor
    • MSNode

      public MSNode(String n)
      Constructs a MSNode with the name n.
      Parameters:
      n - a String object.
    • MSNode

      public MSNode(String n, int multiScaleLevel)
      Constructor for MSNode.
      Parameters:
      n - a String object.
      multiScaleLevel - The multiscale level of this node.
  • Method Details

    • contains

      public MSNode contains(MSNode msNode)
      If this MSNode or any MSNode below it equals the argument, that MSNode is returned.
      Parameters:
      msNode - a MSNode object.
      Returns:
      a MSNode object.
    • destroy

      public boolean destroy()
      destroy
      Returns:
      a boolean.
    • drawLabel

      public void drawLabel(org.jogamp.java3d.Canvas3D graphics, org.jogamp.java3d.J3DGraphics2D g2d, org.jogamp.java3d.Node node)
      drawLabel
      Specified by:
      drawLabel in interface ROLS
      Parameters:
      graphics - a Canvas3D object.
      g2d - a J3DGraphics2D object.
      node - a Node object.
    • equals

      public boolean equals(Object o)

      MSNode equality := same class and same name. Consider replacing with a Comparator<MSNode> for cases where non-reference equality is desired.

      Overrides:
      equals in class Object
    • getAngleList

      public List<Angle> getAngleList()
      Returns a List of all Angles below the present MSNode.
      Returns:
      a List object.
    • getAngleTorsionList

      public List<AngleTorsion> getAngleTorsionList()
      Returns a List of all AngleTorsions below the present MSNode.
      Returns:
      a List object.
    • getAtomList

      public List<Atom> getAtomList()
      Returns a List of all Atoms below the present MSNode.
      Returns:
      a new List object.
    • getAtomList

      public List<Atom> getAtomList(boolean originalOrder)
      getAtomList.
      Parameters:
      originalOrder - a boolean.
      Returns:
      a List object.
    • getBondList

      public List<Bond> getBondList()
      Returns a List of all Bonds below the present MSNode.
      Returns:
      a List object.
    • getCenter

      public double[] getCenter(boolean w)
      getCenter
      Specified by:
      getCenter in interface ROLS
      Parameters:
      w - a boolean.
      Returns:
      an array of double.
    • getChildList

      public List<MSNode> getChildList()
      Returns a List of the MSNode's Children (instead of using an Enumeration).
      Returns:
      a List object.
    • getExtent

      public double getExtent()
      getExtent
      Returns:
      a double.
    • getImproperTorsionList

      public List<ImproperTorsion> getImproperTorsionList()
      Returns a List of all ImproperTorsions below the present MSNode.
      Returns:
      a List object.
    • getList

      public <T extends TreeNode> List<T> getList(Class<T> c)
    • getList

      public <T extends TreeNode> List<T> getList(Class<T> c, List<T> nodes)
      getList
      Specified by:
      getList in interface ROLS
      Type Parameters:
      T - Node Type to collect.
      Parameters:
      c - a Class object.
      nodes - a List object.
      Returns:
      a List object.
    • getMSCount

      public <T extends TreeNode> long getMSCount(Class<T> c, long count)
      getMSCount
      Specified by:
      getMSCount in interface ROLS
      Type Parameters:
      T - Node Type to count.
      Parameters:
      c - a Class object.
      count - a long.
      Returns:
      a long.
    • getMSNode

      public <T extends TreeNode> T getMSNode(Class<T> c)
      getMSNode
      Specified by:
      getMSNode in interface ROLS
      Type Parameters:
      T - Node Type to look for.
      Parameters:
      c - a Class object.
      Returns:
      The node.
    • getMW

      public double getMW()
      getMW
      Specified by:
      getMW in interface ROLS
      Returns:
      a double.
    • getName

      public String getName()
      Returns the name of this MSNode.
      Returns:
      a String object.
    • setName

      public void setName(String n)
      Sets the name of this NodeObject to n.
      Parameters:
      n - a String object.
    • getOutOfPlaneBendList

      public List<OutOfPlaneBend> getOutOfPlaneBendList()
      Returns a List of all Out-of-Plane Bends below the present MSNode.
      Returns:
      a List object.
    • getPiOrbitalTorsionList

      public List<PiOrbitalTorsion> getPiOrbitalTorsionList()
      Returns a List of all Pi-Orbital Torsions below the present MSNode.
      Returns:
      a List object.
    • getStretchBendList

      public List<StretchBend> getStretchBendList()
      Returns a List of all Stretch-Bends below the present MSNode.
      Returns:
      a List object.
    • getStretchTorsionList

      public List<StretchTorsion> getStretchTorsionList()
      Returns a List of all StretchTorsions below the present MSNode.
      Returns:
      a List object.
    • getTorsionList

      public List<Torsion> getTorsionList()
      Returns a List of all Torsions below the present MSNode.
      Returns:
      a List object.
    • getTorsionTorsionList

      public List<TorsionTorsion> getTorsionTorsionList()
      Returns a List of all Torsion-Torsions below the present MSNode.
      Returns:
      a List object.
    • getTotalMass

      public double getTotalMass()
      Returns the total mass of all atoms in the MolecularAssembly, calculating the mass if it has not already been done, defaulting to simple addition.
      Returns:
      Total mass of atoms in system.
    • getUreyBradleyList

      public List<UreyBradley> getUreyBradleyList()
      Returns a List of all Urey-Bradleys below the present MSNode.
      Returns:
      a List object.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isSelected

      public boolean isSelected()
      isSelected
      Returns:
      a boolean.
    • setSelected

      public void setSelected(boolean b)
      Setter for the field selected.
      Parameters:
      b - a boolean.
    • print

      public void print()
      Prints the MSNode's name
    • removeChild

      public void removeChild(MSNode child)
      removeChild.
      Parameters:
      child - a MSNode object.
    • setColor

      public void setColor(RendererCache.ColorModel colorModel, org.jogamp.vecmath.Color3f color, org.jogamp.java3d.Material mat)
      setColor
      Specified by:
      setColor in interface ROLS
      Parameters:
      colorModel - a RendererCache.ColorModel object.
      color - a Color3f object.
      mat - a Material object.
    • setView

      public void setView(RendererCache.ViewModel viewModel, List<org.jogamp.java3d.BranchGroup> newShapes)
      setView
      Specified by:
      setView in interface ROLS
      Parameters:
      viewModel - a RendererCache.ViewModel object.
      newShapes - a List object.
    • toString

      public String toString()

      Overridden toString method returns the MSNode's name

      Overrides:
      toString in class DefaultMutableTreeNode
    • update

      public void update()
      update
      Specified by:
      update in interface ROLS