예제 #1
0
 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;
 }