	public View(Window window, boolean offscreen, boolean isSharedUniverse)
	{		
		super(getPreferredConfiguration(window), offscreen);
		if(offscreen)
		{
			getScreen3D().setPhysicalScreenWidth(0.0254/90.0 * 1600);
			getScreen3D().setPhysicalScreenHeight(0.0254/90.0 * 1200); 
		}
		if(isSharedUniverse)
		{
			if(sharedUniverse==null)
			{
				sharedUniverse=new SimpleUniverse(this);
				universe=View.sharedUniverse;
				viewingPlatform=universe.getViewingPlatform();			
				universe.addBranchGraph(
					createLights(new BoundingSphere(new Point3d(),Double.MAX_VALUE)));
			}
			else
			{
				universe=View.sharedUniverse;
				viewingPlatform=createViewingPlatform();
				sharedUniverse.getLocale().addBranchGraph(viewingPlatform);
			}
		}
		else
		{
			universe=new SimpleUniverse(this);
			viewingPlatform=universe.getViewingPlatform();			
			universe.addBranchGraph(createLights(new BoundingSphere(new Point3d(),Double.MAX_VALUE)));
		}
		orbit.setCapability(Node.ALLOW_BOUNDS_WRITE);
		viewingPlatform.setViewPlatformBehavior(orbit);		
		originAxisSwitch.setCapability(Switch.ALLOW_SWITCH_READ);
		originAxisSwitch.setCapability(Switch.ALLOW_SWITCH_WRITE);
		fixedAxisSwitch.setCapability(Switch.ALLOW_SWITCH_READ);
		fixedAxisSwitch.setCapability(Switch.ALLOW_SWITCH_WRITE);
		fixedAxisTransformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
		createAxis(originAxisTransformGroup);
		originAxisSwitch.addChild(originAxisTransformGroup);			
		ViewSpecificGroup vsp=new ViewSpecificGroup();				
		vsp.addView(getView());		
		vsp.addChild(originAxisSwitch);
		axisBranchGroup.addChild(vsp);
		universe.addBranchGraph(axisBranchGroup);
		createClipBranchGroup();
		createWidgetsBranchGroup();
		createUnClipWidgetsBranchGroup();
		final TransformGroup tg=new TransformGroup();
		tg.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
		tg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
		Transform3D t3d=new Transform3D();
		t3d.set(new Vector3d(-4, -4, -40));
		createAxis(fixedAxisTransformGroup);		
		tg.setTransform(t3d);
		tg.addChild(fixedAxisTransformGroup);
		fixedAxisSwitch.addChild(tg);
		PlatformGeometry pg=new PlatformGeometry();
		vsp=new ViewSpecificGroup();
		vsp.addView(getView());
		vsp.addChild(fixedAxisSwitch);
		pg.addChild(vsp);		
		axisBehavior=new AxisBehavior(fixedAxisTransformGroup,
			viewingPlatform.getViewPlatformTransform());
		pg.addChild(axisBehavior);
		viewingPlatform.setPlatformGeometry(pg);
		addComponentListener(new ComponentAdapter()
		{
			private Transform3D myT3d=new Transform3D();
			public void componentResized(ComponentEvent e)
			{
				tg.getTransform(myT3d);
				myT3d.set(new Vector3d(-4, -4*((float)getHeight())/getWidth(), -40));
				tg.setTransform(myT3d);
			}
		});
		getView().setFieldOfView(Math.PI/12);
		getView().setFrontClipPolicy(javax.media.j3d.View.PHYSICAL_EYE);
		getView().setBackClipPolicy(javax.media.j3d.View.PHYSICAL_EYE);
		zoomTo(0,0,0,1.0f);	
		addKeyListener(new PAKeyListener());
    }	

	public View(Window window, boolean offscreen, boolean isSharedUniverse)
	{		
		super(getPreferredConfiguration(window), offscreen);
		if(offscreen)
		{
			getScreen3D().setPhysicalScreenWidth(0.0254/90.0 * 1600);
			getScreen3D().setPhysicalScreenHeight(0.0254/90.0 * 1200); 
		}
		if(isSharedUniverse)
		{
			if(sharedUniverse==null)
			{
				sharedUniverse=new SimpleUniverse(this);
				universe=View.sharedUniverse;
				viewingPlatform=universe.getViewingPlatform();			
				universe.addBranchGraph(
					createLights(new BoundingSphere(new Point3d(),Double.MAX_VALUE)));
			}
			else
			{
				universe=View.sharedUniverse;
				viewingPlatform=createViewingPlatform();
				sharedUniverse.getLocale().addBranchGraph(viewingPlatform);
			}
		}
		else
		{
			universe=new SimpleUniverse(this);
			viewingPlatform=universe.getViewingPlatform();			
			universe.addBranchGraph(createLights(new BoundingSphere(new Point3d(),Double.MAX_VALUE)));
		}
		orbit.setCapability(Node.ALLOW_BOUNDS_WRITE);
		viewingPlatform.setViewPlatformBehavior(orbit);		
		originAxisSwitch.setCapability(Switch.ALLOW_SWITCH_READ);
		originAxisSwitch.setCapability(Switch.ALLOW_SWITCH_WRITE);
		fixedAxisSwitch.setCapability(Switch.ALLOW_SWITCH_READ);
		fixedAxisSwitch.setCapability(Switch.ALLOW_SWITCH_WRITE);
		fixedAxisTransformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
		createAxis(originAxisTransformGroup);
		originAxisSwitch.addChild(originAxisTransformGroup);			
		ViewSpecificGroup vsp=new ViewSpecificGroup();				
		vsp.addView(getView());		
		vsp.addChild(originAxisSwitch);
		axisBranchGroup.addChild(vsp);
		universe.addBranchGraph(axisBranchGroup);
		createClipBranchGroup();
		createWidgetsBranchGroup();
		createUnClipWidgetsBranchGroup();
		final TransformGroup tg=new TransformGroup();
		tg.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
		tg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
		Transform3D t3d=new Transform3D();
		t3d.set(new Vector3d(-4, -4, -40));
		createAxis(fixedAxisTransformGroup);		
		tg.setTransform(t3d);
		tg.addChild(fixedAxisTransformGroup);
		fixedAxisSwitch.addChild(tg);
		PlatformGeometry pg=new PlatformGeometry();
		vsp=new ViewSpecificGroup();
		vsp.addView(getView());
		vsp.addChild(fixedAxisSwitch);
		pg.addChild(vsp);		
		axisBehavior=new AxisBehavior(fixedAxisTransformGroup,
			viewingPlatform.getViewPlatformTransform());
		pg.addChild(axisBehavior);
		viewingPlatform.setPlatformGeometry(pg);
		addComponentListener(new ComponentAdapter()
		{
			private Transform3D myT3d=new Transform3D();
			public void componentResized(ComponentEvent e)
			{
				if(getWidth()!=0)
				{
					tg.getTransform(myT3d);
					myT3d.set(new Vector3d(-4, -4*((float)getHeight())/getWidth(), -40));
					tg.setTransform(myT3d);
				}
			}
		});
		getView().setFieldOfView(Math.PI/12);
		getView().setFrontClipPolicy(javax.media.j3d.View.PHYSICAL_EYE);
		getView().setBackClipPolicy(javax.media.j3d.View.PHYSICAL_EYE);
		zoomTo(0,0,0,1.0f);	
		addKeyListener(new PAKeyListener());
    }	
