aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorSammysHP <sven@sammyshp.de>2011-11-17 22:27:04 +0100
committerSammysHP <sven@sammyshp.de>2011-11-17 22:59:54 +0100
commitc22298e4e831b9aebd4779d567f7e48dcd8b274b (patch)
treecd3f18b05cbd18b88621f1acfcc97c0097458019 /main
parent16224b5f392b3cbb50b97584bb0715bec73f3e9e (diff)
downloadcgeo-c22298e4e831b9aebd4779d567f7e48dcd8b274b.zip
cgeo-c22298e4e831b9aebd4779d567f7e48dcd8b274b.tar.gz
cgeo-c22298e4e831b9aebd4779d567f7e48dcd8b274b.tar.bz2
Remove Format.LAT_LON_DECMINUTE_PIPE
This format is used often in c:geo, but is not very common outside of it. Usually coordinates are written without the pipe.
Diffstat (limited to 'main')
-rw-r--r--main/src/cgeo/geocaching/cgeo.java5
-rw-r--r--main/src/cgeo/geocaching/cgeocaches.java5
-rw-r--r--main/src/cgeo/geocaching/cgeodetail.java5
-rw-r--r--main/src/cgeo/geocaching/cgeonavigate.java10
-rw-r--r--main/src/cgeo/geocaching/cgeowaypoint.java3
-rw-r--r--main/src/cgeo/geocaching/geopoint/GeopointFormatter.java28
6 files changed, 26 insertions, 30 deletions
diff --git a/main/src/cgeo/geocaching/cgeo.java b/main/src/cgeo/geocaching/cgeo.java
index 6547793..6e1466e 100644
--- a/main/src/cgeo/geocaching/cgeo.java
+++ b/main/src/cgeo/geocaching/cgeo.java
@@ -5,7 +5,6 @@ import cgeo.geocaching.activity.ActivityMixin;
import cgeo.geocaching.enumerations.CacheType;
import cgeo.geocaching.enumerations.StatusCode;
import cgeo.geocaching.geopoint.Geopoint;
-import cgeo.geocaching.geopoint.GeopointFormatter;
import cgeo.geocaching.maps.CGeoMap;
import org.apache.commons.collections.CollectionUtils;
@@ -603,9 +602,9 @@ public class cgeo extends AbstractActivity {
} else {
if (geo.altitudeNow != null) {
final String humanAlt = cgBase.getHumanDistance(geo.altitudeNow.floatValue() / 1000);
- navLocation.setText(geo.coordsNow.format(GeopointFormatter.Format.LAT_LON_DECMINUTE_PIPE) + " | " + humanAlt);
+ navLocation.setText(geo.coordsNow + " | " + humanAlt);
} else {
- navLocation.setText(geo.coordsNow.format(GeopointFormatter.Format.LAT_LON_DECMINUTE_PIPE));
+ navLocation.setText(geo.coordsNow.toString());
}
}
} else {
diff --git a/main/src/cgeo/geocaching/cgeocaches.java b/main/src/cgeo/geocaching/cgeocaches.java
index e8c8078..3eda003 100644
--- a/main/src/cgeo/geocaching/cgeocaches.java
+++ b/main/src/cgeo/geocaching/cgeocaches.java
@@ -14,7 +14,6 @@ import cgeo.geocaching.filter.cgFilterBySize;
import cgeo.geocaching.filter.cgFilterByTrackables;
import cgeo.geocaching.filter.cgFilterByType;
import cgeo.geocaching.geopoint.Geopoint;
-import cgeo.geocaching.geopoint.GeopointFormatter;
import cgeo.geocaching.maps.CGeoMap;
import cgeo.geocaching.sorting.CacheComparator;
import cgeo.geocaching.sorting.DateComparator;
@@ -612,7 +611,7 @@ public class cgeocaches extends AbstractListActivity {
break;
case COORDINATE:
action = "planning";
- title = coords.format(GeopointFormatter.Format.LAT_LON_DECMINUTE_PIPE);
+ title = coords.toString();
setTitle(title);
showProgress(true);
setLoadingCaches();
@@ -639,7 +638,7 @@ public class cgeocaches extends AbstractListActivity {
showProgress(true);
setLoadingCaches();
} else {
- title = coords.format(GeopointFormatter.Format.LAT_LON_DECMINUTE_PIPE);
+ title = coords.toString();
setTitle(title);
showProgress(true);
setLoadingCaches();
diff --git a/main/src/cgeo/geocaching/cgeodetail.java b/main/src/cgeo/geocaching/cgeodetail.java
index f98a6f6..78474f6 100644
--- a/main/src/cgeo/geocaching/cgeodetail.java
+++ b/main/src/cgeo/geocaching/cgeodetail.java
@@ -8,7 +8,6 @@ import cgeo.geocaching.compatibility.Compatibility;
import cgeo.geocaching.connector.ConnectorFactory;
import cgeo.geocaching.connector.IConnector;
import cgeo.geocaching.enumerations.CacheType;
-import cgeo.geocaching.geopoint.GeopointFormatter;
import cgeo.geocaching.geopoint.GeopointFormatter.Format;
import cgeo.geocaching.network.HtmlImage;
import cgeo.geocaching.utils.CancellableHandler;
@@ -839,7 +838,7 @@ public class cgeodetail extends AbstractActivity {
// cache coordinates
if (cache.getCoords() != null) {
- addCacheDetail(R.string.cache_coordinates, cache.getLatitude() + " | " + cache.getLongitude());
+ addCacheDetail(R.string.cache_coordinates, cache.getCoords().toString());
}
// cache attributes
@@ -1028,7 +1027,7 @@ public class cgeodetail extends AbstractActivity {
TextView nameView = (TextView) waypointView.findViewById(R.id.name);
if (StringUtils.isBlank(wpt.getName())) {
- nameView.setText(wpt.getCoords().format(GeopointFormatter.Format.LAT_LON_DECMINUTE_PIPE));
+ nameView.setText(wpt.getCoords().toString());
} else {
nameView.setText(StringEscapeUtils.unescapeHtml4(wpt.getName()));
}
diff --git a/main/src/cgeo/geocaching/cgeonavigate.java b/main/src/cgeo/geocaching/cgeonavigate.java
index afd3bd8..b3b7554 100644
--- a/main/src/cgeo/geocaching/cgeonavigate.java
+++ b/main/src/cgeo/geocaching/cgeonavigate.java
@@ -2,8 +2,6 @@ package cgeo.geocaching;
import cgeo.geocaching.activity.AbstractActivity;
import cgeo.geocaching.geopoint.Geopoint;
-import cgeo.geocaching.geopoint.GeopointFormatter;
-import cgeo.geocaching.geopoint.GeopointFormatter.Format;
import cgeo.geocaching.maps.CGeoMap;
import org.apache.commons.lang3.StringUtils;
@@ -278,7 +276,7 @@ public class cgeonavigate extends AbstractActivity {
setDestCoords();
updateDistanceInfo();
- Log.d(Settings.tag, "destination set: " + title + " (" + dstCoords.format(Format.LAT_LON_DECMINUTE_PIPE) + ")");
+ Log.d(Settings.tag, "destination set: " + title + " (" + dstCoords + ")");
return true;
}
@@ -298,7 +296,7 @@ public class cgeonavigate extends AbstractActivity {
return;
}
- ((TextView) findViewById(R.id.destination)).setText(dstCoords.format(GeopointFormatter.Format.LAT_LON_DECMINUTE_PIPE));
+ ((TextView) findViewById(R.id.destination)).setText(dstCoords.toString());
}
public void setDest(final Geopoint coords) {
@@ -382,9 +380,9 @@ public class cgeonavigate extends AbstractActivity {
if (geo.altitudeNow != null) {
final String humanAlt = cgBase.getHumanDistance(geo.altitudeNow.floatValue() / 1000);
- navLocation.setText(geo.coordsNow.format(GeopointFormatter.Format.LAT_LON_DECMINUTE_PIPE) + " | " + humanAlt);
+ navLocation.setText(geo.coordsNow + " | " + humanAlt);
} else {
- navLocation.setText(geo.coordsNow.format(GeopointFormatter.Format.LAT_LON_DECMINUTE_PIPE));
+ navLocation.setText(geo.coordsNow.toString());
}
updateDistanceInfo();
diff --git a/main/src/cgeo/geocaching/cgeowaypoint.java b/main/src/cgeo/geocaching/cgeowaypoint.java
index dbb9a2d..ec2547e 100644
--- a/main/src/cgeo/geocaching/cgeowaypoint.java
+++ b/main/src/cgeo/geocaching/cgeowaypoint.java
@@ -2,7 +2,6 @@ package cgeo.geocaching;
import cgeo.geocaching.activity.AbstractActivity;
import cgeo.geocaching.apps.cache.navi.NavigationAppFactory;
-import cgeo.geocaching.geopoint.GeopointFormatter;
import org.apache.commons.lang3.StringUtils;
@@ -76,7 +75,7 @@ public class cgeowaypoint extends AbstractActivity {
waypoint.setIcon(res, identification);
if (waypoint.getCoords() != null) {
- coords.setText(Html.fromHtml(waypoint.getCoords().format(GeopointFormatter.Format.LAT_LON_DECMINUTE_PIPE)), TextView.BufferType.SPANNABLE);
+ coords.setText(Html.fromHtml(waypoint.getCoords().toString()), TextView.BufferType.SPANNABLE);
compass.setVisibility(View.VISIBLE);
separator.setVisibility(View.VISIBLE);
} else {
diff --git a/main/src/cgeo/geocaching/geopoint/GeopointFormatter.java b/main/src/cgeo/geocaching/geopoint/GeopointFormatter.java
index 133e6e3..a85e63e 100644
--- a/main/src/cgeo/geocaching/geopoint/GeopointFormatter.java
+++ b/main/src/cgeo/geocaching/geopoint/GeopointFormatter.java
@@ -11,25 +11,31 @@ public class GeopointFormatter
* Predefined formats.
*/
public static enum Format {
- /** Example: "-0,123456 10,123456" */
+ /** Example: "10,123456 -0,123456" */
LAT_LON_DECDEGREE,
- /** Example: "-0.123456,10.123456" (unlocalized) */
+
+ /** Example: "10.123456,-0.123456" (unlocalized) */
LAT_LON_DECDEGREE_COMMA,
- /** Example: "W 5° 12,345 N 10° 12,345" */
+
+ /** Example: "N 10° 12,345 W 5° 12,345" */
LAT_LON_DECMINUTE,
- /** Example: "W 5° 12,345 | N 10° 12,345" */
- LAT_LON_DECMINUTE_PIPE,
+
/** Example: "-0.123456" (unlocalized latitude) */
LAT_DECDEGREE_RAW,
- /** Example: "W 5° 12,345" */
+
+ /** Example: "N 10° 12,345" */
LAT_DECMINUTE,
- /** Example: "W 5 12,345" */
+
+ /** Example: "N 10 12,345" */
LAT_DECMINUTE_RAW,
+
/** Example: "-0.123456" (unlocalized longitude) */
LON_DECDEGREE_RAW,
- /** Example: "N 10° 12,345" */
+
+ /** Example: "W 5° 12,345" */
LON_DECMINUTE,
- /** Example: "N 10 12,345" */
+
+ /** Example: "W 5 12,345" */
LON_DECMINUTE_RAW;
}
@@ -66,10 +72,6 @@ public class GeopointFormatter
return String.format("%c %02.0f° %.3f %c %03.0f° %.3f",
latDir, latFloor, latMin, lonDir, lonFloor, lonMin);
- case LAT_LON_DECMINUTE_PIPE:
- return String.format("%c %02.0f° %.3f | %c %03.0f° %.3f",
- latDir, latFloor, latMin, lonDir, lonFloor, lonMin);
-
case LAT_DECDEGREE_RAW:
return String.format((Locale) null, "%.6f", latSigned);