Changeset 7923
- Timestamp:
- 2004-08-10T11:24:13+12:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r7739 r7923 113 113 /** A public reference to the GUIManager. */ 114 114 static public GUIManager g_man; 115 static public boolean g_man_built = false; 116 115 117 /** A static reference to ourselves. */ 116 118 static public Gatherer self; … … 374 376 if (splash != null) { splash.toFront(); } 375 377 376 g_man.display(); 377 378 // Place the window in the desired location on the screen, if this is do-able (not under most linux window managers apparently. In fact you're lucky if they listen to any of your screen size requests). 379 g_man.setLocation(bounds.x, bounds.y); 380 g_man.setVisible(true); 381 382 // After the window has been made visible, check that it is in the correct place 383 // sometimes java places a window not in the correct place, 384 // but with an offset. If so, we work out what the offset is 385 // and change the desired location to take that into account 386 Point location = g_man.getLocation(); 387 int x_offset = bounds.x - location.x; 388 int y_offset = bounds.y - location.y; 389 // If not, offset the window to move it into the correct location 390 if (x_offset > 0 || y_offset > 0) { 391 ///ystem.err.println("changing the location to "+(bounds.x + x_offset)+" "+ (bounds.y + y_offset)); 392 g_man.setLocation(bounds.x + x_offset, bounds.y + y_offset); 393 } 394 395 // The 'after-display' triggers several events which don't occur until after the visual components are actually available on screen. Examples of these would be the various html renderings, as they can't happen offscreen. 396 g_man.afterDisplay(); 378 if (!g_man_built) { 379 380 g_man.display(); 381 382 // Place the window in the desired location on the screen, if this is do-able (not under most linux window managers apparently. In fact you're lucky if they listen to any of your screen size requests). 383 g_man.setLocation(bounds.x, bounds.y); 384 g_man.setVisible(true); 385 386 // After the window has been made visible, check that it is in the correct place 387 // sometimes java places a window not in the correct place, 388 // but with an offset. If so, we work out what the offset is 389 // and change the desired location to take that into account 390 Point location = g_man.getLocation(); 391 int x_offset = bounds.x - location.x; 392 int y_offset = bounds.y - location.y; 393 // If not, offset the window to move it into the correct location 394 if (x_offset > 0 || y_offset > 0) { 395 ///ystem.err.println("changing the location to "+(bounds.x + x_offset)+" "+ (bounds.y + y_offset)); 396 g_man.setLocation(bounds.x + x_offset, bounds.y + y_offset); 397 } 398 399 // The 'after-display' triggers several events which don't occur until after the visual components are actually available on screen. Examples of these would be the various html renderings, as they can't happen offscreen. 400 g_man.afterDisplay(); 401 g_man_built = true; 402 } 403 else { 404 g_man.setVisible(true); 405 } 397 406 398 407 if (splash != null) { … … 431 440 } 432 441 442 // Store the current position and size (if reasonable) of the Gatherer for next time 443 Rectangle bounds = g_man.getBounds(); 444 config.setBounds("general.bounds", true, bounds); 445 446 // Save configuration. 447 saveConfig(); 448 433 449 // Get the gui to deallocate 434 450 g_man.hide(); 435 451 g_man.destroy(); 436 437 // Store the current position and size (if reasonable) of the Gatherer for next time 438 Rectangle bounds = g_man.getBounds(); 439 config.setBounds("general.bounds", true, bounds); 440 441 // Save configuration. 442 saveConfig(); 452 g_man_built = false; 453 443 454 444 455 // Flush dictionary -
trunk/gli/src/org/greenstone/gatherer/GathererApplet.java
r7738 r7923 94 94 public void init() 95 95 { 96 // Work-around to reduce number of 97 // 'Could not lock user prefs' error messages. 98 // Thanks to Walter Schatz from the java forums. 99 System.setProperty("java.util.prefs.syncInterval","2000000"); 96 try { 97 // Work-around to reduce number of 98 // 'Could not lock user prefs' error messages. 99 // Thanks to Walter Schatz from the java forums. 100 System.setProperty("java.util.prefs.syncInterval","2000000"); 101 } 102 103 catch (Exception exception) { 104 // convenient way of finding out if user has agreed to 105 // to requested security settings 106 107 JLabel lab 108 = new JLabel("Greenstone Librarian Interface Applet deactivated", 109 JLabel.CENTER); 110 getContentPane().add(lab); 111 return; 112 } 100 113 101 114 // Ensure platform specific LAF … … 187 200 bttn.addActionListener(this); 188 201 getContentPane().add(bttn); 189 190 // getContentPane().add("Center", g_man.getRootPane());191 202 } 192 203 … … 215 226 public void actionPerformed(ActionEvent e) 216 227 { 217 Object obj = e.getSource();218 219 // Splash screen.220 // Splash splash = new Splash();221 222 228 Splash splash = null; 223 229
Note:
See TracChangeset
for help on using the changeset viewer.