org.opensourcephysics.display3d.core
Class Element.Loader

java.lang.Object
  extended by org.opensourcephysics.display3d.core.Element.Loader
All Implemented Interfaces:
XML.ObjectLoader
Direct Known Subclasses:
ElementArrow.Loader, ElementBox.Loader, ElementCircle.Loader, ElementCone.Loader, ElementCylinder.Loader, ElementEllipsoid.Loader, ElementImage.Loader, ElementObject.Loader, ElementPlane.ElementPlaneLoader, ElementPoints.ElementPointsLoader, ElementPolygon.ElementPolygonLoader, ElementSegment.Loader, ElementSpring.Loader, ElementSurface.Loader, ElementTessellation.Loader, ElementTetrahedron.Loader, ElementText.Loader, ElementTrail.Loader, Group.Loader
Enclosing interface:
Element

public abstract static class Element.Loader
extends java.lang.Object
implements XML.ObjectLoader

A class to save and load Element data.


Constructor Summary
Element.Loader()
           
 
Method Summary
abstract  java.lang.Object createObject(XMLControl control)
          Creates an object from data in an XMLControl.
 java.lang.Object loadObject(XMLControl control, java.lang.Object obj)
          Loads an object with data from an XMLControl.
 void saveObject(XMLControl control, java.lang.Object obj)
          Saves data from an object to an XMLControl.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Element.Loader

public Element.Loader()
Method Detail

createObject

public abstract java.lang.Object createObject(XMLControl control)
Description copied from interface: XML.ObjectLoader
Creates an object from data in an XMLControl. The returned object must be castable to the class control.getObjectClass().

Specified by:
createObject in interface XML.ObjectLoader
Parameters:
control - the xml control
Returns:
a new object

saveObject

public void saveObject(XMLControl control,
                       java.lang.Object obj)
Description copied from interface: XML.ObjectLoader
Saves data from an object to an XMLControl. The object must be castable to the class control.getObjectClass().

Specified by:
saveObject in interface XML.ObjectLoader
Parameters:
control - the xml control
obj - the object

loadObject

public java.lang.Object loadObject(XMLControl control,
                                   java.lang.Object obj)
Description copied from interface: XML.ObjectLoader
Loads an object with data from an XMLControl. The object must be castable to the class control.getObjectClass().

Specified by:
loadObject in interface XML.ObjectLoader
Parameters:
control - the xml control
obj - the object
Returns:
the loaded object