public void saveObject(XMLControl control, Object obj) {
   DrawingPanel3D panel = (DrawingPanel3D) obj;
   control.setValue("preferred x min", panel.getPreferredMinX());
   control.setValue("preferred x max", panel.getPreferredMaxX());
   control.setValue("preferred y min", panel.getPreferredMinY());
   control.setValue("preferred y max", panel.getPreferredMaxY());
   control.setValue("preferred z min", panel.getPreferredMinZ());
   control.setValue("preferred z max", panel.getPreferredMaxZ());
   control.setValue("visualization hints", panel.getVisualizationHints());
   control.setValue("camera", panel.getCamera());
   control.setValue("elements", panel.getElements());
 }
 public Object loadObject(XMLControl control, Object obj) {
   DrawingPanel3D panel = (DrawingPanel3D) obj;
   double minX = control.getDouble("preferred x min");
   double maxX = control.getDouble("preferred x max");
   double minY = control.getDouble("preferred y min");
   double maxY = control.getDouble("preferred y max");
   double minZ = control.getDouble("preferred z min");
   double maxZ = control.getDouble("preferred z max");
   panel.setPreferredMinMax(minX, maxX, minY, maxY, minZ, maxZ);
   Collection elements = (Collection) control.getObject("elements");
   if (elements != null) {
     panel.removeAllElements();
     Iterator it = elements.iterator();
     while (it.hasNext()) {
       panel.addElement((Element) it.next());
     }
   }
   // The subclass is responsible to load unmutable objects such as
   // the visualization hints or the camera
   // It is also responsible to update the screen after loading
   return obj;
 }