Changeset 2519 in josm
- Timestamp:
- 2009-11-27T12:57:56+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/download/SlippyMapChooser.java
r2512 r2519 53 53 // standard dimension 54 54 private Dimension iDownloadDialogDimension; 55 // screen size56 private Dimension iScreenSize;57 55 58 56 private TileSource[] sources = { new OsmTileSource.Mapnik(), new OsmTileSource.TilesAtHome(), … … 240 238 */ 241 239 public void resizeSlippyMap() { 242 if (iScreenSize == null) { 243 Component c = iGui.getParent().getParent().getParent().getParent().getParent().getParent().getParent() 244 .getParent().getParent(); 245 // remember the initial set screen dimensions 246 iDownloadDialogDimension = c.getSize(); 247 // retrive the size of the display 248 iScreenSize = Toolkit.getDefaultToolkit().getScreenSize(); 249 } 250 251 // resize 252 Component co = iGui.getParent().getParent().getParent().getParent().getParent().getParent().getParent() 253 .getParent().getParent(); 254 Dimension currentDimension = co.getSize(); 255 240 Dimension iScreenSize = Toolkit.getDefaultToolkit().getScreenSize(); 256 241 // enlarge 257 if (currentDimension.equals(iDownloadDialogDimension)) { 242 if(iDownloadDialogDimension == null) { 243 iDownloadDialogDimension = iGui.getSize(); 258 244 // make the each dimension 90% of the absolute display size and 259 245 // center the DownloadDialog 246 // retrieve the size of the display 260 247 int w = iScreenSize.width * 90 / 100; 261 248 int h = iScreenSize.height * 90 / 100; 262 co.setBounds((iScreenSize.width - w) / 2, (iScreenSize.height - h) / 2, w, h); 263 249 iGui.setBounds((iScreenSize.width - w) / 2, (iScreenSize.height - h) / 2, w, h); 264 250 } 265 251 // shrink … … 269 255 int w = iDownloadDialogDimension.width; 270 256 int h = iDownloadDialogDimension.height; 271 co.setBounds((iScreenSize.width - w) / 2, (iScreenSize.height - h) / 2, w, h);272 257 iGui.setBounds((iScreenSize.width - w) / 2, (iScreenSize.height - h) / 2, w, h); 258 iDownloadDialogDimension = null; 273 259 } 274 260
Note:
See TracChangeset
for help on using the changeset viewer.