Changeset 4479
- Timestamp:
- 2003-06-04T16:17:50+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r4397 r4479 209 209 } 210 210 211 // Size the screen 212 Dimension temp = config.getDimension("general.size", true); 213 if(temp != null) { 214 size = temp; 215 } 216 if (size.height > config.screen_size.height) { 217 size.setSize(size.width, config.screen_size.height); 218 } 219 if (size.width > config.screen_size.width) { 220 size.setSize(config.screen_size.width, size.height); 221 } 211 // Size and place the frame on the screen 212 Rectangle bounds = config.getBounds("general.bounds", true); 213 if (bounds != null) { 214 size = bounds.getSize(); 215 } 216 // Ensure width and height are reasonable 217 if (size.width < 640) { 218 size.width = 640; 219 } 220 else if (size.width > config.screen_size.width) { 221 size.width = config.screen_size.width; 222 } 223 if (size.height < 480) { 224 size.height = 480; 225 } 226 else if (size.height > config.screen_size.height) { 227 size.height = config.screen_size.height; 228 } 222 229 // Set default font 223 230 setUIFont(config.getFont("general.font", true), config.getFont("general.tooltip_font", true)); … … 245 252 246 253 // Center 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). 247 g_man.setLocation((config.screen_size.width - size.width) / 2, (config.screen_size.height - size.height) / 2); 254 // g_man.setLocation((config.screen_size.width - size.width) / 2, (config.screen_size.height - size.height) / 2); 255 g_man.setBounds(bounds); 248 256 g_man.setVisible(true); 249 257 // 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. … … 304 312 assoc_man = null; 305 313 } 306 // Check the current size of the Gatherer, and if its reasonable (ie greater than minsize) then store it for next time. 307 Dimension size = g_man.getSize(); 308 if(size.width > 100 && size.height > 100) { 309 config.setDimension("general.size", true, size); 310 } 314 315 // Store the current position and size (if reasonable) of the Gatherer for next time 316 Rectangle bounds = g_man.getBounds(); 317 config.setBounds("general.bounds", true, bounds); 311 318 312 319 // Save configuration.
Note:
See TracChangeset
for help on using the changeset viewer.