org.opensourcephysics.controls
Interface XML.ObjectLoader

All Known Implementing Classes:
ArrowLoader, BoundedShape.BoundedShapeLoader, Camera.CameraLoader, Camera.Loader, CircleLoader, ComplexPlotFrame.ComplexPlotFrameLoader, DataColumn.Loader, DataFunction.Loader, Dataset.Loader, DrawableShapeLoader, DrawableTextLine.DrawableTextLineLoader, DrawingFrame.DrawingFrameLoader, DrawingFrame3D.Loader, DrawingPanel3D.Loader, Element.Loader, ElementArrow.Loader, ElementBox.Loader, ElementCircle.Loader, ElementCone.Loader, ElementCone.Loader, ElementCylinder.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, GeneralPathLoader, Group.Loader, Group.Loader, Histogram.HistogramLoader, HistogramDataset.HistogramDatasetLoader, HistogramFrame.HistogramFrameLoader, ImageCoordSystem.Loader, InteractiveArrow.InteractiveArrowLoader, InteractiveCenteredArrow.InteractiveCenteredArrowLoader, InteractiveCircle.InteractiveCircleLoader, InteractiveShape.InteractiveShapeLoader, InteractiveTextLine.InteractiveTextLineLoader, Launcher.LaunchSet, Matrix2DTransformation.Matrix2DTransformationLoader, Matrix3DTransformation.Affine3DTransformationLoader, Plot2DLoader, PlotFrame.PlotFrameLoader, Quaternion.QuaternionLoader, Resolution.ResolutionLoader, Stripchart.StripchartLoader, Style.Loader, Style.StyleLoader, UserFunction.Loader, VisualizationHints.Loader, VisualizationHints.VisualizationHintsLoader, XMLJavaLoader, XMLLoader
Enclosing class:
XML

public static interface XML.ObjectLoader

This defines methods for moving xml data between an XMLControl and a corresponding Java object.

Version:
1.0
Author:
Douglas Brown

Method Summary
 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.
 

Method Detail

saveObject

void saveObject(XMLControl control,
                java.lang.Object obj)
Saves data from an object to an XMLControl. The object must be castable to the class control.getObjectClass().

Parameters:
control - the xml control
obj - the object

createObject

java.lang.Object createObject(XMLControl control)
Creates an object from data in an XMLControl. The returned object must be castable to the class control.getObjectClass().

Parameters:
control - the xml control
Returns:
a new object

loadObject

java.lang.Object loadObject(XMLControl control,
                            java.lang.Object obj)
Loads an object with data from an XMLControl. The object must be castable to the class control.getObjectClass().

Parameters:
control - the xml control
obj - the object
Returns:
the loaded object