Changeset 9826 in josm
- Timestamp:
- 2016-02-18T22:06:36+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r9819 r9826 671 671 672 672 protected int estimateTileCacheSize() { 673 Dimension screenSize = GuiHelper.getScreenSize(); 673 Dimension screenSize = GuiHelper.getMaxiumScreenSize(); 674 674 int height = screenSize.height; 675 675 int width = screenSize.width; -
trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
r9778 r9826 10 10 import java.awt.Dialog; 11 11 import java.awt.Dimension; 12 import java.awt.DisplayMode; 12 13 import java.awt.Font; 14 import java.awt.GraphicsDevice; 13 15 import java.awt.GraphicsEnvironment; 14 16 import java.awt.GridBagLayout; … … 424 426 425 427 /** 428 * Gets the size of the screen. On systems with multiple displays, 429 * contrary to {@link #getScreenSize()}, the biggest display is used. 430 * This method returns always 800x600 in headless mode (useful for unit tests). 431 * @return the size of maximum screen, in pixels, or 800x600 432 * @see Toolkit#getScreenSize 433 * @since 9576 434 */ 435 436 public static Dimension getMaxiumScreenSize() { 437 if (GraphicsEnvironment.isHeadless()) { 438 return new Dimension(800, 600); 439 } 440 441 int height = 0; 442 int width = 0; 443 for (GraphicsDevice gd: GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) { 444 DisplayMode dm = gd.getDisplayMode(); 445 height = Math.max(height, dm.getHeight()); 446 width = Math.max(width, dm.getWidth()); 447 } 448 if (height == 0 || width == 0) { 449 return new Dimension(800, 600); 450 } 451 return new Dimension(width, height); 452 } 453 454 /** 426 455 * Gets the singleton instance of the system selection as a <code>Clipboard</code> object. 427 456 * This allows an application to read and modify the current, system-wide selection.
Note:
See TracChangeset
for help on using the changeset viewer.