14,14c14,14 < import CH.ifa.draw.framework.*; --- > import CH.ifa.draw.framework.DrawingView; 38a39,39 > private DrawApplication myDrawApplication; 39,64d38 < < private DrawingChangeListener dcl = new DrawingChangeListener() { < /** Sent when an area is invalid < * < */ < public void drawingInvalidated(DrawingChangeEvent e) { < } < /** Sent when the drawing wants to be refreshed < * < */ < public void drawingRequestUpdate(DrawingChangeEvent e) { < } < /** < * Change all frames that contain this drawing. < */ < public void drawingTitleChanged(DrawingChangeEvent e) { < Drawing dwg = e.getDrawing(); < JInternalFrame[] jifs = getAllFrames(); < < for (int x=0; x protected DrawingView selectedView; 73a49,49 > setDrawApplication(newDrawApplication); 73,73c48,48 < public MDIDesktopPane() { --- > public MDIDesktopPane(DrawApplication newDrawApplication) { 78,89d53 < addDesktopListener( new DesktopListener() { < public void drawingViewAdded(DesktopEvent dpe){ < DrawingView dv = dpe.getDrawingView(); < dv.drawing().addDrawingChangeListener(dcl); < } < public void drawingViewRemoved(DesktopEvent dpe){ < DrawingView dv = dpe.getDrawingView(); < dv.drawing().removeDrawingChangeListener(dcl); < } < public void drawingViewSelected(DrawingView oldView, DesktopEvent dpe){ < } < }); 113a78,78 > * if this is the last view set it to null 113a200,200 > 114,114d199 < * 118a83,86 > if (getComponentCount() == 0){ > setActiveDrawingView(null); > fireDrawingViewSelectedEvent(selectedView); > } 145a114,114 > fireDrawingViewSelectedEvent(selectedView); 147a117,118 > //public void internalFrameDeactivated(InternalFrameEvent e) { > //} 148,153d116 < public void internalFrameDeactivated(InternalFrameEvent e) { < int x = getComponentCount(); < if (getComponentCount() == 1){ //could be a component without a DrawingView. should use helper here. < setActiveDrawingView(null); //mrfloppy, investigate using NullDrawingView here please.( i will assist) < } < } 187,187c152,152 < private void fireDrawingViewSelectedEvent(final DrawingView oldView, final DrawingView newView) { --- > private void fireDrawingViewSelectedEvent(final DrawingView dv) { 194,194c159,159 < dpe = new DesktopEvent(MDIDesktopPane.this, newView); --- > dpe = new DesktopEvent(MDIDesktopPane.this, dv); 197,197c162,162 < dpl.drawingViewSelected(oldView,dpe); --- > dpl.drawingViewSelected(dpe); 212a178,185 > > String applicationTitle; > if (dv.drawing().getTitle() == null) { > applicationTitle = getDrawApplication().getApplicationName() + " - " + getDrawApplication().getDefaultDrawingTitle(); > } > else { > applicationTitle = getDrawApplication().getApplicationName() + " - " + dv.drawing().getTitle(); > } 213a187,187 > internalFrame.setName(applicationTitle); 213,213c186,186 < JInternalFrame internalFrame = new JInternalFrame(dv.drawing().getTitle(), true, true, true, true); --- > JInternalFrame internalFrame = new JInternalFrame(applicationTitle, true, true, true, true); 224,224d197 < DrawingView oldSelectedView = selectedView; 226,226d198 < fireDrawingViewSelectedEvent(oldSelectedView, newSelectedView); 228,230d199 < /** < * @deprecated desktop will use drawing name change listener < */ 583,583d552 < } 584a554,556 > private void setDrawApplication(DrawApplication newDrawApplication) { > myDrawApplication = newDrawApplication; > } 585a558,561 > protected DrawApplication getDrawApplication() { > return myDrawApplication; > } > }