Ignore:
Timestamp:
2018-07-26T22:01:31+02:00 (6 years ago)
Author:
Don-vip
Message:

see #16010 - use JMockit to enable more extensive test coverage (patch by ris, modified)

see https://github.com/openstreetmap/josm/pull/24/commits for details

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MapViewState.java

    r13387 r14052  
    33
    44import java.awt.Container;
    5 import java.awt.GraphicsEnvironment;
    65import java.awt.Point;
    76import java.awt.geom.AffineTransform;
     
    146145
    147146    private static Point findTopLeftOnScreen(JComponent position) {
    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             }
     147        try {
     148            return position.getLocationOnScreen();
     149        } catch (JosmRuntimeException | IllegalArgumentException | IllegalStateException e) {
     150            throw BugReport.intercept(e).put("position", position).put("parent", position::getParent);
    158151        }
    159152    }
Note: See TracChangeset for help on using the changeset viewer.