51,51c51,51 < private String fApplicationName; --- > private static String fApplicationName; 54,54c54,54 < protected static String fgUntitled = "untitled"; --- > private String fgUntitled = "untitled"; 115a116,117 > DrawingView dv = getDesktop().getActiveDrawingView(); > if (dv == null || !dv.isInteractive()) {//this should be ASSERT and otherwise handled by context sensitive menus. 116,116c894,894 < if (view() == null) { --- > if (getDesktop().getActiveDrawingView() != null) { 121,121c122,122 < window.newWindow( view().drawing() ); --- > window.newWindow( dv.drawing() ); 122a124,124 > /* if (dv.drawing().getTitle() != null ) { 123,123d123 < if (view().drawing().getTitle() != null ) { 124,124c125,125 < window.setDrawingTitle(view().drawing().getTitle() + " (View)"); --- > window.setDrawingTitle(dv.drawing().getTitle() + " (View)"); 128,128c129,129 < } --- > }*/ 334,334c335,335 < this.view().setDisplayUpdate(new SimpleUpdateStrategy()); --- > getDesktop().getActiveDrawingView().setDisplayUpdate(new SimpleUpdateStrategy()); 341,341c342,342 < this.view().setDisplayUpdate(new BufferedUpdateStrategy()); --- > getDesktop().getActiveDrawingView().setDisplayUpdate(new BufferedUpdateStrategy()); 585,585c586,586 < return new JPanelDesktop(this); --- > return new JPanelDesktop(); 705,705c706,706 < return new DrawingView[] { view() }; --- > return new DrawingView[] { getDesktop().getActiveDrawingView() }; 869,870d869 < //toolDone(); < //view().setDrawing(createDrawing()); 895,895d893 < if (view() != null) { 943,943c942,942 < ((StandardDrawingView)view()).printAll(pg); --- > ((StandardDrawingView)getDesktop().getActiveDrawingView()).printAll(pg); 955a955,956 > DrawingView dv = getDesktop().getActiveDrawingView(); > if (dv != null && dv.isInteractive() ) { 956,958d954 < if (view() == null) { < return; < } 960,960c958,958 < String name = storeFormat.store(file, view().drawing()); --- > String name = storeFormat.store(file, dv.drawing()); 961,961c959,959 < view().drawing().setTitle(name); --- > dv.drawing().setTitle(name); 961a960,960 > updateApplicationTitle(); 962,962d959 < setDrawingTitle(name); 967a966,966 > } 1003a1003,1007 > protected void updateApplicationTitle() { > DrawingView dv = getDesktop().getActiveDrawingView(); > if(dv != null && dv.isInteractive()){ //mrfloppy, we can do away with null check and ASSERT once their is always at least a NullDrawingView > String drawingTitle = dv.drawing().getTitle(); > if (!getDefaultDrawingTitle().equals(drawingTitle)) { 1004,1008d1002 < protected void setDrawingTitle(String drawingTitle) { < if (getDefaultDrawingTitle().equals(drawingTitle)) { < setTitle(getApplicationName()); < } < else { 1011a1011,1013 > else { > setTitle(getApplicationName()); > } 1012,1017d1010 < < /** < * Return the title of the currently selected drawing < */ < protected String getDrawingTitle() { < return view().drawing().getTitle(); 1030,1030c1026,1026 < public String getApplicationName() { --- > public static String getApplicationName() { 1060a1057,1063 > /** > * I made this protected because it should only be used by the DrawApplication. > * This is because all created drawings will be created through createDrawing() > * which is a method of DrawApplication. > * dnoyeb@users.sourceforge.net 12/31/02 > */ > protected String getDefaultDrawingTitle() { 1061,1061d1056 < public String getDefaultDrawingTitle() { 1090a1093,1093 > updateApplicationTitle(); 1090,1090c1092,1092 < fireViewSelectionChangedEvent(oldView, view()); --- > fireViewSelectionChangedEvent(oldView, getDesktop().getActiveDrawingView());