14,14c14,14 < import CH.ifa.draw.framework.DrawingView; --- > import CH.ifa.draw.framework.*; 38a39,64 > > 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 if (dwg == Helper.getDrawingView(jifs[x]).drawing()) { > jifs[x].setTitle(dwg.getTitle()); > } > } > } > }; 39,39d38 < private DrawApplication myDrawApplication; 48,48c73,73 < public MDIDesktopPane(DrawApplication newDrawApplication) { --- > public MDIDesktopPane() { 49,49d73 < setDrawApplication(newDrawApplication); 53a78,89 > 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){ > } > }); 112a149,149 > int x = getComponentCount(); 113,113c150,150 < if (getComponentCount() == 0){ //could be a component without a DrawingView. should use helper here. --- > if (getComponentCount() == 1){ //could be a component without a DrawingView. should use helper here. 176,183d212 < < String applicationTitle; < if (dv.drawing().getTitle() == null) { < applicationTitle = getDrawApplication().getApplicationName() + " - " + getDrawApplication().getDefaultDrawingTitle(); < } < else { < applicationTitle = getDrawApplication().getApplicationName() + " - " + dv.drawing().getTitle(); < } 184,184c213,213 < JInternalFrame internalFrame = new JInternalFrame(applicationTitle, true, true, true, true); --- > JInternalFrame internalFrame = new JInternalFrame(dv.drawing().getTitle(), true, true, true, true); 185,185d213 < internalFrame.setName(applicationTitle); 199a228,230 > /** > * @deprecated desktop will use drawing name change listener > */ 200,200c585,585 < --- > 553,555d582 < < private void setDrawApplication(DrawApplication newDrawApplication) { < myDrawApplication = newDrawApplication; 558,561d584 < protected DrawApplication getDrawApplication() { < return myDrawApplication; < } < }