public Viewer(Canvas3D[] userCanvases, PhysicalBody userBody, PhysicalEnvironment userEnvironment, boolean setVisible ) {  if (userBody == null) { physicalBody = new PhysicalBody(); } else { physicalBody = userBody; }  if (userEnvironment == null) { physicalEnvironment = new PhysicalEnvironment(); } else { physicalEnvironment = userEnvironment; }   if (userCanvases == null) { GraphicsConfiguration config = ConfiguredUniverse.getPreferredConfiguration();  canvases = new Canvas3D[1]; canvases[0] = new Canvas3D(config); try { canvases[0].setFocusable( true ); } catch(NoSuchMethodError e) {} createFramesAndPanels(setVisible); } else { canvases = new Canvas3D[userCanvases.length]; for (int i=0; i<userCanvases.length; i++) { canvases[i] = userCanvases[i]; try { canvases[i].setFocusable( true ); } catch(NoSuchMethodError e) {} } }    view = new View();  synchronized (viewerMap) { Viewer.viewerMap.put(view, this); } for (int i=0; i<canvases.length; i++) { view.addCanvas3D(canvases[i]); } view.setPhysicalBody(physicalBody); view.setPhysicalEnvironment(physicalEnvironment);
public Viewer() {  this(null, null, null, true);
    public Viewer(Canvas3D[] userCanvases, PhysicalBody userBody,		  PhysicalEnvironment userEnvironment, boolean setVisible ) {	if (userBody == null) {            physicalBody = new PhysicalBody();        } else {            physicalBody = userBody;	}        if (userEnvironment == null) {            physicalEnvironment = new PhysicalEnvironment();        } else {            physicalEnvironment = userEnvironment;	}        // Create Canvas3D object if none was passed in.        if (userCanvases == null) {	    GraphicsConfiguration config =		ConfiguredUniverse.getPreferredConfiguration();	    canvases = new Canvas3D[1];	    canvases[0] = new Canvas3D(config);            try {	        canvases[0].setFocusable( true );            } catch(NoSuchMethodError e) {}	    createFramesAndPanels(setVisible);        }	else {	    canvases = new Canvas3D[userCanvases.length];	    for (int i=0; i<userCanvases.length; i++) {		canvases[i] = userCanvases[i];                try {	            canvases[i].setFocusable( true );                } catch(NoSuchMethodError e) {}	    }	}        // Create a View and attach the Canvas3D and the physical        // body and environment to the view.        view = new View();	// Add it to the Viewer's HashMap.	synchronized (viewerMap) {	    Viewer.viewerMap.put(view, this);	}	for (int i=0; i<canvases.length; i++) {	    view.addCanvas3D(canvases[i]);	}        view.setPhysicalBody(physicalBody);        view.setPhysicalEnvironment(physicalEnvironment);    }