Ignore:
Timestamp:
2017-05-15T15:43:30+02:00 (7 years ago)
Author:
michael2402
Message:

See #13415: Add the ILatLon interface, unify handling of Nodes and CachedLatLon

File:
1 edited

Legend:

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

    r11817 r12161  
    99
    1010import org.openstreetmap.josm.data.coor.EastNorth;
    11 import org.openstreetmap.josm.data.osm.Node;
     11import org.openstreetmap.josm.data.coor.ILatLon;
    1212import org.openstreetmap.josm.gui.MapView;
    1313import org.openstreetmap.josm.gui.MapViewState;
     
    5757     * @return this for easy chaining.
    5858     */
    59     public MapViewPath moveTo(Node n) {
    60         moveTo(n.getEastNorth());
     59    public MapViewPath moveTo(ILatLon n) {
     60        moveTo(n.getEastNorth(state.getProjecting()));
    6161        return this;
    6262    }
     
    8585     * @return this for easy chaining.
    8686     */
    87     public MapViewPath lineTo(Node n) {
    88         lineTo(n.getEastNorth());
     87    public MapViewPath lineTo(ILatLon n) {
     88        lineTo(n.getEastNorth(state.getProjecting()));
    8989        return this;
    9090    }
     
    115115     * @return this for easy chaining.
    116116     */
    117     public MapViewPath shapeAround(Node p1, SymbolShape symbol, double size) {
    118         shapeAround(p1.getEastNorth(), symbol, size);
     117    public MapViewPath shapeAround(ILatLon p1, SymbolShape symbol, double size) {
     118        shapeAround(p1.getEastNorth(state.getProjecting()), symbol, size);
    119119        return this;
    120120    }
     
    144144     * @return this for easy chaining.
    145145     */
    146     public MapViewPath append(Iterable<Node> nodes, boolean connect) {
     146    public MapViewPath append(Iterable<? extends ILatLon> nodes, boolean connect) {
    147147        appendWay(nodes, connect, false);
    148148        return this;
     
    155155     * @return this for easy chaining.
    156156     */
    157     public MapViewPath appendClosed(Iterable<Node> nodes, boolean connect) {
     157    public MapViewPath appendClosed(Iterable<? extends ILatLon> nodes, boolean connect) {
    158158        appendWay(nodes, connect, true);
    159159        return this;
    160160    }
    161161
    162     private void appendWay(Iterable<Node> nodes, boolean connect, boolean close) {
     162    private void appendWay(Iterable<? extends ILatLon> nodes, boolean connect, boolean close) {
    163163        boolean useMoveTo = !connect;
    164         Node first = null;
    165         for (Node n : nodes) {
     164        ILatLon first = null;
     165        for (ILatLon n : nodes) {
    166166            if (useMoveTo) {
    167167                moveTo(n);
Note: See TracChangeset for help on using the changeset viewer.