14c14 < import CH.ifa.draw.framework.DrawingView; --- > import CH.ifa.draw.framework.*; 39c39,64 < private DrawApplication myDrawApplication; --- > > 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()); > } > } > } > }; 48,49c73 < public MDIDesktopPane(DrawApplication newDrawApplication) { < setDrawApplication(newDrawApplication); --- > public MDIDesktopPane() { 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){ > } > }); 113c149,150 < if (getComponentCount() == 0){ //could be a component without a DrawingView. should use helper here. --- > int x = getComponentCount(); > if (getComponentCount() == 1){ //could be a component without a DrawingView. should use helper here. 176,185c213 < < String applicationTitle; < if (dv.drawing().getTitle() == null) { < applicationTitle = getDrawApplication().getApplicationName() + " - " + getDrawApplication().getDefaultDrawingTitle(); < } < else { < applicationTitle = getDrawApplication().getApplicationName() + " - " + dv.drawing().getTitle(); < } < JInternalFrame internalFrame = new JInternalFrame(applicationTitle, true, true, true, true); < internalFrame.setName(applicationTitle); --- > JInternalFrame internalFrame = new JInternalFrame(dv.drawing().getTitle(), true, true, true, true); 200c228,230 < --- > /** > * @deprecated desktop will use drawing name change listener > */ 553,555d582 < < private void setDrawApplication(DrawApplication newDrawApplication) { < myDrawApplication = newDrawApplication; 558,561c585 < protected DrawApplication getDrawApplication() { < return myDrawApplication; < } < } --- >