- Timestamp:
- 2017-05-13T01:12:44+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r11978 r12131 33 33 import org.openstreetmap.josm.tools.JosmRuntimeException; 34 34 import org.openstreetmap.josm.tools.Shortcut; 35 import org.openstreetmap.josm.tools.Utils; 35 36 36 37 /** … … 68 69 * Current policy is to except just everything, no matter how strange the result would be. 69 70 */ 70 private static final double TOLERANCE1 = Math.toRadians(45.); // within a way71 private static final double TOLERANCE2 = Math.toRadians(45.); // ways relative to each other71 private static final double TOLERANCE1 = Utils.toRadians(45.); // within a way 72 private static final double TOLERANCE2 = Utils.toRadians(45.); // ways relative to each other 72 73 73 74 /** -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r12103 r12131 76 76 private static final Color ORANGE_TRANSPARENT = new Color(Color.ORANGE.getRed(), Color.ORANGE.getGreen(), Color.ORANGE.getBlue(), 128); 77 77 78 private static final ArrowPaintHelper START_WAY_INDICATOR = new ArrowPaintHelper( Math.toRadians(90), 8);78 private static final ArrowPaintHelper START_WAY_INDICATOR = new ArrowPaintHelper(Utils.toRadians(90), 8); 79 79 80 80 static final CachingProperty<Boolean> USE_REPEATED_SHORTCUT … … 839 839 840 840 841 double curHdg = Math.toDegrees(getCurrentBaseNode().getEastNorth()841 double curHdg = Utils.toDegrees(getCurrentBaseNode().getEastNorth() 842 842 .heading(currentMouseEastNorth)); 843 843 double baseHdg = -1; … … 845 845 EastNorth en = previousNode.getEastNorth(); 846 846 if (en != null) { 847 baseHdg = Math.toDegrees(en.heading(getCurrentBaseNode().getEastNorth()));847 baseHdg = Utils.toDegrees(en.heading(getCurrentBaseNode().getEastNorth())); 848 848 } 849 849 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawSnapHelper.java
r11747 r12131 30 30 import org.openstreetmap.josm.gui.draw.SymbolShape; 31 31 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher; 32 import org.openstreetmap.josm.tools.Utils; 32 33 33 34 class DrawSnapHelper { … … 377 378 LatLon mouseLatLon = Main.map.mapView.getProjection().eastNorth2latlon(snapPoint); 378 379 double distance = this.drawAction.getCurrentBaseNode().getCoor().greatCircleDistance(mouseLatLon); 379 double hdg = Math.toDegrees(p0.heading(snapPoint));380 double hdg = Utils.toDegrees(p0.heading(snapPoint)); 380 381 // heading of segment from current to calculated point, not to mouse position 381 382 … … 485 486 486 487 double hdg = segmentPoint1.heading(segmentPoint2); 487 hdg = Math.toDegrees(hdg);488 hdg = Utils.toDegrees(hdg); 488 489 if (hdg < 0) { 489 490 hdg += 360; -
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r11045 r12131 8 8 import static java.lang.Math.sin; 9 9 import static java.lang.Math.sqrt; 10 import static java.lang.Math.toRadians;11 10 import static org.openstreetmap.josm.data.projection.Ellipsoid.WGS84; 12 11 import static org.openstreetmap.josm.tools.I18n.trc; 12 import static org.openstreetmap.josm.tools.Utils.toRadians; 13 13 14 14 import java.awt.geom.Area; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r12100 r12131 286 286 static final int FLAG_OUTERMEMBER_OF_SELECTED = 8; 287 287 288 private static final double PHI = Math.toRadians(20);288 private static final double PHI = Utils.toRadians(20); 289 289 private static final double cosPHI = Math.cos(PHI); 290 290 private static final double sinPHI = Math.sin(PHI); … … 978 978 fromAngle = Math.atan(dy / dx); 979 979 } 980 double fromAngleDeg = Math.toDegrees(fromAngle);980 double fromAngleDeg = Utils.toDegrees(fromAngle); 981 981 982 982 double vx = distanceFromVia * Math.cos(fromAngle); … … 1001 1001 if (pFrom.x >= pVia.x && pFrom.y >= pVia.y) { 1002 1002 if (!leftHandTraffic) { 1003 vx2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg - 90));1004 vy2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg - 90));1003 vx2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg - 90)); 1004 vy2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg - 90)); 1005 1005 } else { 1006 vx2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg + 90));1007 vy2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg + 90));1006 vx2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg + 90)); 1007 vy2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg + 90)); 1008 1008 } 1009 1009 iconAngle = 270+fromAngleDeg; … … 1011 1011 if (pFrom.x < pVia.x && pFrom.y >= pVia.y) { 1012 1012 if (!leftHandTraffic) { 1013 vx2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg));1014 vy2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg));1013 vx2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg)); 1014 vy2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg)); 1015 1015 } else { 1016 vx2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg + 180));1017 vy2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg + 180));1016 vx2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg + 180)); 1017 vy2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg + 180)); 1018 1018 } 1019 1019 iconAngle = 90-fromAngleDeg; … … 1021 1021 if (pFrom.x < pVia.x && pFrom.y < pVia.y) { 1022 1022 if (!leftHandTraffic) { 1023 vx2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg + 90));1024 vy2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg + 90));1023 vx2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg + 90)); 1024 vy2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg + 90)); 1025 1025 } else { 1026 vx2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg - 90));1027 vy2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg - 90));1026 vx2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg - 90)); 1027 vy2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg - 90)); 1028 1028 } 1029 1029 iconAngle = 90+fromAngleDeg; … … 1031 1031 if (pFrom.x >= pVia.x && pFrom.y < pVia.y) { 1032 1032 if (!leftHandTraffic) { 1033 vx2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg + 180));1034 vy2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg + 180));1033 vx2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg + 180)); 1034 vy2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg + 180)); 1035 1035 } else { 1036 vx2 = distanceFromWay * Math.sin( Math.toRadians(fromAngleDeg));1037 vy2 = distanceFromWay * Math.cos( Math.toRadians(fromAngleDeg));1036 vx2 = distanceFromWay * Math.sin(Utils.toRadians(fromAngleDeg)); 1037 vy2 = distanceFromWay * Math.cos(Utils.toRadians(fromAngleDeg)); 1038 1038 } 1039 1039 iconAngle = 270-fromAngleDeg; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
r11452 r12131 32 32 import org.openstreetmap.josm.gui.NavigatableComponent; 33 33 import org.openstreetmap.josm.gui.draw.MapPath2D; 34 import org.openstreetmap.josm.tools.Utils; 34 35 35 36 /** … … 90 91 91 92 /** Helper variable for {@link #drawSegment} */ 92 private static final ArrowPaintHelper ARROW_PAINT_HELPER = new ArrowPaintHelper( Math.toRadians(20), 10);93 private static final ArrowPaintHelper ARROW_PAINT_HELPER = new ArrowPaintHelper(Utils.toRadians(20), 10); 93 94 94 95 /** Helper variable for {@link #visit(Relation)} */ -
trunk/src/org/openstreetmap/josm/data/validation/PaintVisitor.java
r11893 r12131 18 18 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor; 19 19 import org.openstreetmap.josm.gui.MapView; 20 import org.openstreetmap.josm.tools.Utils; 20 21 21 22 /** … … 144 145 double cosT = 5 * Math.cos(t); 145 146 double sinT = 5 * Math.sin(t); 146 int deg = (int) Math.toDegrees(t);147 int deg = (int) Utils.toDegrees(t); 147 148 if (selected) { 148 149 g.setColor(getHighlightColor(color)); -
trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
r11893 r12131 53 53 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator; 54 54 import org.openstreetmap.josm.tools.ImageProvider; 55 import org.openstreetmap.josm.tools.Utils; 55 56 56 57 /** … … 184 185 protected LatLon getNorthWestLatLonOfTile(Point tile, int zoom) { 185 186 double lon = tile.x / Math.pow(2.0, zoom) * 360.0 - 180; 186 double lat = Math.toDegrees(Math.atan(Math.sinh(Math.PI - (2.0 * Math.PI * tile.y) / Math.pow(2.0, zoom))));187 double lat = Utils.toDegrees(Math.atan(Math.sinh(Math.PI - (2.0 * Math.PI * tile.y) / Math.pow(2.0, zoom)))); 187 188 return new LatLon(lat, lon); 188 189 } -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r12072 r12131 589 589 double rightdir = (headdir > 270) ? headdir - 270 : headdir + 90; 590 590 591 double ptx = p.x + Math.cos( Math.toRadians(headdir)) * arrowlength;592 double pty = p.y + Math.sin( Math.toRadians(headdir)) * arrowlength;593 594 double ltx = p.x + Math.cos( Math.toRadians(leftdir)) * arrowwidth/2;595 double lty = p.y + Math.sin( Math.toRadians(leftdir)) * arrowwidth/2;596 597 double rtx = p.x + Math.cos( Math.toRadians(rightdir)) * arrowwidth/2;598 double rty = p.y + Math.sin( Math.toRadians(rightdir)) * arrowwidth/2;591 double ptx = p.x + Math.cos(Utils.toRadians(headdir)) * arrowlength; 592 double pty = p.y + Math.sin(Utils.toRadians(headdir)) * arrowlength; 593 594 double ltx = p.x + Math.cos(Utils.toRadians(leftdir)) * arrowwidth/2; 595 double lty = p.y + Math.sin(Utils.toRadians(leftdir)) * arrowwidth/2; 596 597 double rtx = p.x + Math.cos(Utils.toRadians(rightdir)) * arrowwidth/2; 598 double rty = p.y + Math.sin(Utils.toRadians(rightdir)) * arrowwidth/2; 599 599 600 600 g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackAction.java
r10173 r12131 18 18 import org.openstreetmap.josm.gui.help.HelpUtil; 19 19 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 20 import org.openstreetmap.josm.tools.Utils; 20 21 21 22 /** … … 86 87 } 87 88 double avglat = latsum / latcnt; 88 double scale = Math.cos( Math.toRadians(avglat));89 double scale = Math.cos(Utils.toRadians(avglat)); 89 90 /* 90 91 * Compute buffer zone extents and maximum bounding box size. Note that the maximum we -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
r11935 r12131 86 86 private int hdoprange; 87 87 88 private static final double PHI = Math.toRadians(15);88 private static final double PHI = Utils.toRadians(15); 89 89 90 90 //// Variables used only to check cache validity -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r11756 r12131 620 620 */ 621 621 public static double degree_to_radians(double degree) { // NO_UCD (unused code) 622 return Math.toRadians(degree);622 return Utils.toRadians(degree); 623 623 } 624 624 -
trunk/src/org/openstreetmap/josm/gui/util/RotationAngle.java
r11893 r12131 153 153 case "ne": 154 154 case "northeast": 155 return Math.toRadians(45);155 return Utils.toRadians(45); 156 156 case "e": 157 157 case "east": 158 return Math.toRadians(90);158 return Utils.toRadians(90); 159 159 case "se": 160 160 case "southeast": 161 return Math.toRadians(135);161 return Utils.toRadians(135); 162 162 case "s": 163 163 case "south": … … 165 165 case "sw": 166 166 case "southwest": 167 return Math.toRadians(225);167 return Utils.toRadians(225); 168 168 case "w": 169 169 case "west": 170 return Math.toRadians(270);170 return Utils.toRadians(270); 171 171 case "nw": 172 172 case "northwest": 173 return Math.toRadians(315);173 return Utils.toRadians(315); 174 174 default: 175 175 throw new IllegalArgumentException("Unexpected cardinal direction " + cardinal); -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r11747 r12131 1317 1317 } 1318 1318 1319 double radian = Math.toRadians(angle);1319 double radian = Utils.toRadians(angle); 1320 1320 1321 1321 new ImageIcon(img); // load completely … … 1346 1346 1347 1347 // rotate the graphics about the center point of the icon 1348 g2d.rotate( Math.toRadians(originalAngle));1348 g2d.rotate(Utils.toRadians(originalAngle)); 1349 1349 1350 1350 g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
Note:
See TracChangeset
for help on using the changeset viewer.