Changeset 38922
- Timestamp:
- 2024-04-09T19:46:25+12:00 (8 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/applet/GsdlCollageApplet/GsdlCollageApplet.java
r38908 r38922 144 144 //setLayout(new BorderLayout()); 145 145 //if(!isRunAsApplet) { 146 statusBar = new JLabel(); 146 statusBar = null; //new JLabel(); 147 147 148 //this.add(statusBar, BorderLayout.SOUTH); 148 /*149 Window win = SwingUtilities.getWindowAncestor(this);150 if(win instanceof JFrame) {151 JFrame topFrame = (JFrame)win;152 topFrame.add(statusBar, BorderLayout.SOUTH);153 } else { //AppletViewer or browser154 this.add(statusBar, BorderLayout.SOUTH);155 }*/149 150 ///Window win = SwingUtilities.getWindowAncestor(this); 151 ///if(win instanceof JFrame) { 152 /// JFrame topFrame = (JFrame)win; 153 /// topFrame.add(statusBar, BorderLayout.SOUTH); 154 ///} else { //AppletViewer or browser 155 /// this.add(statusBar, BorderLayout.SOUTH); 156 ///} 156 157 157 158 //Dimension d = statusBar.getSize(); … … 273 274 // we'll now always show and print to our manually added statusBar now 274 275 // not only if(!isRunAsApplet) when we needed to manually create a statusBar. 275 this.statusBar.setText(msg); 276 if(this.statusBar != null) { 277 this.statusBar.setText(msg); 278 } 276 279 if(isRunAsApplet) { 277 280 super.showStatus(msg); … … 287 290 // gets the parameters specified 288 291 String showStatusBar = getParameter("statusbar"); 289 if(showStatusBar == null || showStatusBar.equals("0")) { 290 System.err.println("### Hiding status bar (default)"); 291 statusBar.setVisible(false); 292 } 292 if(statusBar == null) { 293 System.err.println("### Status bar code turned off. Ignoring statusbar settings."); 294 } else { 295 if(showStatusBar == null || showStatusBar.equals("0")) { 296 System.err.println("### Hiding status bar (default)"); 297 statusBar.setVisible(false); 298 } 299 } 293 300 String verbosity_param = getParameter("verbosity"); 294 301 String is_java2_param = getParameter("isJava2"); … … 708 715 709 716 // status bar code. Not ideal, but had to add it here to get relative dimensions right 710 collageApp.setLayout(new BorderLayout());711 717 JLabel statusBar = collageApp.getStatusBar(); 712 frame.add(statusBar, BorderLayout.SOUTH); 713 Dimension d = statusBar.getSize(); 714 d.height = EXTRA_HEIGHT; 715 d.width = collageApp.getWidth(); 716 statusBar.setPreferredSize(d); 717 //statusBar.setPreferredSize(new Dimension(collageApp.getWidth(), EXTRA_HEIGHT)); 718 if(statusBar != null) { 719 collageApp.setLayout(new BorderLayout()); 720 721 frame.add(statusBar, BorderLayout.SOUTH); 722 Dimension d = statusBar.getSize(); 723 d.height = EXTRA_HEIGHT; 724 d.width = collageApp.getWidth(); 725 statusBar.setPreferredSize(d); 726 //statusBar.setPreferredSize(new Dimension(collageApp.getWidth(), EXTRA_HEIGHT)); 727 } 718 728 719 729 // Run it at last: manually calling (J)Applet methods init() and start()
Note:
See TracChangeset
for help on using the changeset viewer.