camera.animateViewToCenterBounds(b,true,Constants.ANIMATION_DELAY); setModulesDisplayMode();
if (ChainBuilderAgent.DEBUG) System.err.println("zooming to canvas bounds.."); PActivity act = camera.animateViewToCenterBounds(b,true,Constants.ANIMATION_DELAY); PActivityDelegate delegate = new PActivityDelegate() { public void activityStarted(PActivity activity) { } public void activityStepped(PActivity activity) { } public void activityFinished(PActivity activity) { setModulesDisplayMode(); } }; act.setDelegate(delegate);
	private void evaluatePopup(PInputEvent e) {		postPopup=true;		PNode n = e.getPickedNode();		PNode p = n.getParent();		if (ChainBuilderAgent.DEBUG)			System.err.println("popup. zooming out of "+n);		if (n instanceof BufferedObject && (p == canvas.getLayer() 				|| p instanceof ChainView)) {			// if I'm on a module that's not in a chain or not. 			// I should zoom to view of whole canvas			PBounds b = canvas.getBufferedBounds();			PCamera camera =canvas.getCamera();			camera.animateViewToCenterBounds(b,true,Constants.ANIMATION_DELAY);				setModulesDisplayMode();		}		else {			double scaleFactor = 1/Constants.SCALE_FACTOR;			zoom(scaleFactor,e); 			}		e.setHandled(true);	}