Changeset 1908 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2009-08-04T21:26:40+02:00 (15 years ago)
Author:
stoecker
Message:

minor cleanup

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

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

    r1722 r1908  
    2525
    2626    @Override public void paint(Graphics g) {
    27         double dist = mv.getDist100Pixel();
    28         String text = dist >= 2000 ? Math.round(dist/100)/10 +" km" : (dist >= 1
    29         ? Math.round(dist*10)/10 +" m" : "< 1 m");
     27        String text = mv.getDist100PixelText();
    3028        Rectangle2D bound = g.getFontMetrics().getStringBounds(text, g);
    3129        g.setColor(getColor());
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r1899 r1908  
    6868        id.update(x.getBytes());
    6969        return new Long(id.getValue()).intValue();
     70    }
     71
     72    public String getDist100PixelText()
     73    {
     74        double dist = getDist100Pixel();
     75        return dist >= 2000 ? Math.round(dist/100)/10 +" km" : (dist >= 1
     76        ? Math.round(dist*10)/10 +" m" : "< 1 m");
    7077    }
    7178
Note: See TracChangeset for help on using the changeset viewer.