Changeset 13159 in josm for trunk/src/org


Ignore:
Timestamp:
2017-11-25T02:42:41+01:00 (7 years ago)
Author:
Don-vip
Message:

see #13883, #15586 - avoid HeadlessException in unit tests

File:
1 edited

Legend:

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

    r13154 r13159  
    1313import java.awt.EventQueue;
    1414import java.awt.Font;
     15import java.awt.GraphicsEnvironment;
    1516import java.awt.GridBagLayout;
    1617import java.awt.MouseInfo;
     
    11931194    @Override
    11941195    public void zoomChanged() {
    1195         PointerInfo pointerInfo = MouseInfo.getPointerInfo();
    1196         if (pointerInfo != null) {
    1197             Point mp = pointerInfo.getLocation();
    1198             updateLatLonText(mp.x, mp.y);
     1196        if (!GraphicsEnvironment.isHeadless()) {
     1197            PointerInfo pointerInfo = MouseInfo.getPointerInfo();
     1198            if (pointerInfo != null) {
     1199                Point mp = pointerInfo.getLocation();
     1200                updateLatLonText(mp.x, mp.y);
     1201            }
    11991202        }
    12001203    }
Note: See TracChangeset for help on using the changeset viewer.