if (e.getWindow() == PatchEdit.desktop.getToolBar().getJFrame()) { if (e.getOppositeWindow() instanceof JSLFrame.JSLFrameProxy ) { lastselection = (JFrame)e.getOppositeWindow(); } else { lastselection = null; } } else if (e.getOppositeWindow()  == PatchEdit.desktop.getToolBar().getJFrame()) { if (e.getWindow() == lastselection) { lastselection = null; return; } else if (lastselection != null) { WindowEvent ne = new WindowEvent(lastselection, WindowEvent.WINDOW_DEACTIVATED, e.getWindow());    lastselection = null; windowDeactivated(ne); } }
	public void windowActivated(WindowEvent e) {	    if (e.getWindow() == PatchEdit.desktop.getToolBar().getJFrame()) {		if (e.getOppositeWindow() instanceof JSLFrame.JSLFrameProxy ) {		    lastselection = (JFrame)e.getOppositeWindow();		} else {		    lastselection = null;		}	    } else if (e.getOppositeWindow()  ==		               PatchEdit.desktop.getToolBar().getJFrame()) {		if (e.getWindow() == lastselection) {		    lastselection = null;		    return;		} else if (lastselection != null) {		    WindowEvent ne = 			new WindowEvent(lastselection,					WindowEvent.WINDOW_DEACTIVATED,					e.getWindow());		    // We don't tell who the opposite window is, so this		    // isn't necessary.		    /*		    e = new WindowEvent(e.getWindow(),					WindowEvent.WINDOW_ACTIVATED,					lastselection);		    */		    lastselection = null;		    windowDeactivated(ne);		}	    }	    ErrorMsg.reportStatus("\""+((JFrame)e.getWindow()).getTitle()				  +"\" activated.");	    JSLFrameEvent fe = 		new JSLFrameEvent(getJSLFrame(),				  JSLFrameEvent.ACTIVATED);	    Iterator it = listeners.iterator();	    while (it.hasNext()) {		((JSLFrameListener)it.next()).JSLFrameActivated(fe);	    }	}