Changeset 13181 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-12-02T15:13:32+01:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapViewState.java
r13175 r13181 3 3 4 4 import java.awt.Container; 5 import java.awt.GraphicsEnvironment; 5 6 import java.awt.Point; 6 7 import java.awt.geom.AffineTransform; … … 145 146 146 147 private static Point findTopLeftOnScreen(JComponent position) { 147 try { 148 return position.getLocationOnScreen(); 149 } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) { 150 throw BugReport.intercept(e).put("position", position).put("parent", position::getParent); 148 if (GraphicsEnvironment.isHeadless()) { 149 // in our imaginary universe the window is always (10, 10) from the top left of the screen 150 Point topLeftInWindow = findTopLeftInWindow(position); 151 return new Point(topLeftInWindow.x + 10, topLeftInWindow.y + 10); 152 } else { 153 try { 154 return position.getLocationOnScreen(); 155 } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) { 156 throw BugReport.intercept(e).put("position", position).put("parent", position::getParent); 157 } 151 158 } 152 159 } -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r13154 r13181 3 3 4 4 import java.awt.Cursor; 5 import java.awt.GraphicsEnvironment; 5 6 import java.awt.Point; 6 7 import java.awt.Rectangle; … … 320 321 321 322 protected boolean isVisibleOnScreen() { 322 return SwingUtilities.getWindowAncestor(this) != null && isShowing(); 323 return GraphicsEnvironment.isHeadless() || ( 324 SwingUtilities.getWindowAncestor(this) != null && isShowing() 325 ); 323 326 } 324 327
Note:
See TracChangeset
for help on using the changeset viewer.