Ignore:
Timestamp:
2017-05-15T15:57:36+02:00 (3 years ago)
Author:
michael2402
Message:

Make use of ILatLon#getEastNorth

File:
1 edited

Legend:

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

    r12119 r12163  
    3737import org.openstreetmap.josm.data.SystemOfMeasurement;
    3838import org.openstreetmap.josm.data.ViewportData;
    39 import org.openstreetmap.josm.data.coor.CachedLatLon;
    4039import org.openstreetmap.josm.data.coor.EastNorth;
     40import org.openstreetmap.josm.data.coor.ILatLon;
    4141import org.openstreetmap.josm.data.coor.LatLon;
    4242import org.openstreetmap.josm.data.osm.BBox;
     
    510510    /**
    511511     * Return the point on the screen where this Coordinate would be.
     512     *
     513     * Alternative: {@link #getState()}, then {@link MapViewState#getPointFor(ILatLon)}
    512514     * @param latlon The point, where this geopoint would be drawn.
    513515     * @return The point on screen where "point" would be drawn, relative to the own top/left.
    514516     */
    515517    public Point2D getPoint2D(LatLon latlon) {
    516         if (latlon == null)
     518        if (latlon == null) {
    517519            return new Point();
    518         else if (latlon instanceof CachedLatLon)
    519             return getPoint2D(((CachedLatLon) latlon).getEastNorth());
    520         else
    521             return getPoint2D(getProjection().latlon2eastNorth(latlon));
     520        } else {
     521            return getPoint2D(latlon.getEastNorth());
     522        }
    522523    }
    523524
    524525    /**
    525526     * Return the point on the screen where this Node would be.
     527     *
     528     * Alternative: {@link #getState()}, then {@link MapViewState#getPointFor(ILatLon)}
    526529     * @param n The node, where this geopoint would be drawn.
    527530     * @return The point on screen where "node" would be drawn, relative to the own top/left.
Note: See TracChangeset for help on using the changeset viewer.