Replace LF by CRLF

This commit is contained in:
Victor Shcherb 2011-09-18 12:01:12 +02:00
parent a2a1113791
commit f571c8f317
4 changed files with 129 additions and 129 deletions

View file

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/bzip2-20090327.jar"/> <classpathentry kind="lib" path="lib/bzip2-20090327.jar"/>
<classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/> <classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/json-20090211.jar"/> <classpathentry kind="lib" path="lib/json-20090211.jar"/>
<classpathentry kind="lib" path="lib/h2-latest.jar"/> <classpathentry kind="lib" path="lib/h2-latest.jar"/>
<classpathentry kind="lib" path="lib/bsh-core-2.0b4.jar"/> <classpathentry kind="lib" path="lib/bsh-core-2.0b4.jar"/>
<classpathentry kind="lib" path="lib/junidecode-0.1.jar"/> <classpathentry kind="lib" path="lib/junidecode-0.1.jar"/>
<classpathentry kind="lib" path="lib/jleveldb-v01.jar"/> <classpathentry kind="lib" path="lib/jleveldb-v01.jar"/>
<classpathentry kind="lib" path="lib/sqlite-jdbc-3.7.2.jar"/> <classpathentry kind="lib" path="lib/sqlite-jdbc-3.7.2.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

View file

@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"> <launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/DataExtractionOSM/src/net/osmand/swing/OsmExtractionUI.java"/> <listEntry value="/DataExtractionOSM/src/net/osmand/swing/OsmExtractionUI.java"/>
</listAttribute> </listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/> <listEntry value="1"/>
</listAttribute> </listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/> <listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute> </listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.osmand.swing.OsmExtractionUI"/> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.osmand.swing.OsmExtractionUI"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="DataExtractionOSM"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="DataExtractionOSM"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-XX:+UseParallelGC -Xmx640M -Xmn256M"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-XX:+UseParallelGC -Xmx640M -Xmn256M"/>
</launchConfiguration> </launchConfiguration>

View file

@ -1,34 +1,34 @@
package net.osmand; package net.osmand;
import android.location.Location; import android.location.Location;
public class LatLonUtils { public class LatLonUtils {
public static Location middleLocation(Location start, Location end, public static Location middleLocation(Location start, Location end,
float meters) { float meters) {
double lat1 = toRad(start.getLatitude()); double lat1 = toRad(start.getLatitude());
double lon1 = toRad(start.getLongitude()); double lon1 = toRad(start.getLongitude());
double R = 6371; // radius of earth in km double R = 6371; // radius of earth in km
double d = meters / 1000; // in km double d = meters / 1000; // in km
float brng = (float) (toRad(start.bearingTo(end))); float brng = (float) (toRad(start.bearingTo(end)));
double lat2 = Math.asin(Math.sin(lat1) * Math.cos(d / R) double lat2 = Math.asin(Math.sin(lat1) * Math.cos(d / R)
+ Math.cos(lat1) * Math.sin(d / R) * Math.cos(brng)); + Math.cos(lat1) * Math.sin(d / R) * Math.cos(brng));
double lon2 = lon1 double lon2 = lon1
+ Math.atan2(Math.sin(brng) * Math.sin(d / R) * Math.cos(lat1), + Math.atan2(Math.sin(brng) * Math.sin(d / R) * Math.cos(lat1),
Math.cos(d / R) - Math.sin(lat1) * Math.sin(lat2)); Math.cos(d / R) - Math.sin(lat1) * Math.sin(lat2));
Location nl = new Location(start); Location nl = new Location(start);
nl.setLatitude(toDegree(lat2)); nl.setLatitude(toDegree(lat2));
nl.setLongitude(toDegree(lon2)); nl.setLongitude(toDegree(lon2));
nl.setBearing(brng); nl.setBearing(brng);
return nl; return nl;
} }
private static double toDegree(double radians) { private static double toDegree(double radians) {
return radians * 180 / Math.PI; return radians * 180 / Math.PI;
} }
private static double toRad(double degree) { private static double toRad(double degree) {
return degree * Math.PI / 180; return degree * Math.PI / 180;
} }
} }

View file

@ -1,65 +1,65 @@
package net.osmand.plus.activities; package net.osmand.plus.activities;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.osmand.LatLonUtils; import net.osmand.LatLonUtils;
import android.location.Location; import android.location.Location;
public class RouteAnimation { public class RouteAnimation {
private Thread routeAnimation; private Thread routeAnimation;
public boolean isRouteAnimating() { public boolean isRouteAnimating() {
return routeAnimation != null; return routeAnimation != null;
} }
public void startStopRouteAnimation(final RoutingHelper routingHelper, public void startStopRouteAnimation(final RoutingHelper routingHelper,
final MapActivity ma) { final MapActivity ma) {
if (!isRouteAnimating()) { if (!isRouteAnimating()) {
routeAnimation = new Thread() { routeAnimation = new Thread() {
public void run() { public void run() {
final List<Location> directions = new ArrayList<Location>( final List<Location> directions = new ArrayList<Location>(
routingHelper.getCurrentRoute()); routingHelper.getCurrentRoute());
Location current = null; Location current = null;
float meters = 20.0f; float meters = 20.0f;
while (!directions.isEmpty() && routeAnimation != null) { while (!directions.isEmpty() && routeAnimation != null) {
if (current == null) { if (current == null) {
current = new Location(directions.remove(0)); current = new Location(directions.remove(0));
} else { } else {
if (current.distanceTo(directions.get(0)) > meters) { if (current.distanceTo(directions.get(0)) > meters) {
current = LatLonUtils.middleLocation(current, current = LatLonUtils.middleLocation(current,
directions.get(0), meters); directions.get(0), meters);
} else { } else {
current = new Location(directions.remove(0)); current = new Location(directions.remove(0));
} }
} }
current.setSpeed(meters); current.setSpeed(meters);
current.setTime(System.currentTimeMillis()); current.setTime(System.currentTimeMillis());
ma.setLocation(current); ma.setLocation(current);
try { try {
Thread.sleep(1000); Thread.sleep(1000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
// do nothing // do nothing
} }
} }
RouteAnimation.this.stop(); RouteAnimation.this.stop();
}; };
}; };
routeAnimation.start(); routeAnimation.start();
} else { } else {
// stop the animation // stop the animation
stop(); stop();
} }
} }
private void stop() { private void stop() {
routeAnimation = null; routeAnimation = null;
} }
public void close() { public void close() {
if (isRouteAnimating()) { if (isRouteAnimating()) {
stop(); stop();
} }
} }
} }