org.jscience.physics.solids
Class AtlasObject

java.lang.Object
  extended by org.jscience.physics.solids.AtlasObject
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
AtlasConstraint, AtlasCoordSys, AtlasDOF, AtlasElement, AtlasLoad, AtlasMaterial, AtlasPosition, AtlasResult, AtlasSection, AtlasSolution, AtlasVector

public abstract class AtlasObject
extends java.lang.Object
implements java.lang.Comparable

Abstract object that everything that resides in an AtlasModel must extend.

There are two attributes of an AtlasObject that are important, the id and the type of the object. These are used to store and retrieve the object from an AtlasModel.


Constructor Summary
AtlasObject()
           
 
Method Summary
 int compareTo(java.lang.Object rhs)
          Compares two objects for sorting.
 boolean equals(java.lang.Object rhs)
          Checks for equality.
 java.lang.String getId()
          Returns the id of the object.
 AtlasModel getParentModel()
          Returns the parent model, or null if this is a standalone object.
abstract  java.lang.String getType()
          Returns the type of the object.
 org.jdom.Element loadJDOMElement()
          Method to load e JDOM element up with information.
 void populateGeometry(javax.media.j3d.BranchGroup geometryRoot)
          Adds geometry contributions to the scene graph.
 void setId(java.lang.String id)
          Sets the identifier of the object.
 void setParentModel(AtlasModel parent)
          Sets the model that owns this object.
 java.lang.String toString()
          Convenience method to dump information about the object.
static AtlasObject unloadJDOMElement(AtlasModel parent, org.jdom.Element e)
          Method to marshall AtlasObjects from the XML.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AtlasObject

public AtlasObject()
Method Detail

setId

public void setId(java.lang.String id)
Sets the identifier of the object.


getId

public java.lang.String getId()
Returns the id of the object.


getType

public abstract java.lang.String getType()
Returns the type of the object. The type returned will be specific to each object that extends this class.


toString

public java.lang.String toString()
Convenience method to dump information about the object.

Overrides:
toString in class java.lang.Object

setParentModel

public void setParentModel(AtlasModel parent)
Sets the model that owns this object.


getParentModel

public AtlasModel getParentModel()
Returns the parent model, or null if this is a standalone object.


compareTo

public int compareTo(java.lang.Object rhs)
Compares two objects for sorting. If object types are different, returns the alpha compariaon of the type. If the types are the same, this method will try to do a numerical comparison between the id- failing that, it reverts to alpha. This approach prevents "Node 2" from falling after "Node 10".

Specified by:
compareTo in interface java.lang.Comparable

equals

public boolean equals(java.lang.Object rhs)
Checks for equality.

Overrides:
equals in class java.lang.Object

loadJDOMElement

public org.jdom.Element loadJDOMElement()
Method to load e JDOM element up with information. This should be ovverriden by subclasses.


unloadJDOMElement

public static AtlasObject unloadJDOMElement(AtlasModel parent,
                                            org.jdom.Element e)
Method to marshall AtlasObjects from the XML. This must be overridden by subclasses.


populateGeometry

public void populateGeometry(javax.media.j3d.BranchGroup geometryRoot)
Adds geometry contributions to the scene graph. This only needs to be overridden if this object needs to be displayed.