diff options
author | blafoo <github@blafoo.de> | 2011-10-26 16:52:36 +0200 |
---|---|---|
committer | blafoo <github@blafoo.de> | 2011-10-26 23:25:40 +0200 |
commit | a7824dc9af750ebb771e4343423eac1225f9645b (patch) | |
tree | 70ce833ba7583b6be1a4f76459ae80820599fdc7 /main/src/cgeo/geocaching/cgeowaypointadd.java | |
parent | 02701ff1964407b780b8c0be0d69d513ed1cce85 (diff) | |
download | cgeo-a7824dc9af750ebb771e4343423eac1225f9645b.zip cgeo-a7824dc9af750ebb771e4343423eac1225f9645b.tar.gz cgeo-a7824dc9af750ebb771e4343423eac1225f9645b.tar.bz2 |
No direct access to fields
Diffstat (limited to 'main/src/cgeo/geocaching/cgeowaypointadd.java')
-rw-r--r-- | main/src/cgeo/geocaching/cgeowaypointadd.java | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/main/src/cgeo/geocaching/cgeowaypointadd.java b/main/src/cgeo/geocaching/cgeowaypointadd.java index 5d21f0e..be90847 100644 --- a/main/src/cgeo/geocaching/cgeowaypointadd.java +++ b/main/src/cgeo/geocaching/cgeowaypointadd.java @@ -53,19 +53,19 @@ public class cgeowaypointadd extends AbstractActivity { id = -1; } else { - geocode = waypoint.geocode; - type = waypoint.type; + geocode = waypoint.getGeocode(); + type = waypoint.getWaypointType(); prefix = waypoint.getPrefix(); - lookup = waypoint.lookup; + lookup = waypoint.getLookup(); app.setAction(geocode); - if (waypoint.coords != null) { - ((Button) findViewById(R.id.buttonLatitude)).setText(cgBase.formatLatitude(waypoint.coords.getLatitude(), true)); - ((Button) findViewById(R.id.buttonLongitude)).setText(cgBase.formatLongitude(waypoint.coords.getLongitude(), true)); + if (waypoint.getCoords() != null) { + ((Button) findViewById(R.id.buttonLatitude)).setText(cgBase.formatLatitude(waypoint.getCoords().getLatitude(), true)); + ((Button) findViewById(R.id.buttonLongitude)).setText(cgBase.formatLongitude(waypoint.getCoords().getLongitude(), true)); } - ((EditText) findViewById(R.id.name)).setText(Html.fromHtml(StringUtils.trimToEmpty(waypoint.name)).toString()); - ((EditText) findViewById(R.id.note)).setText(Html.fromHtml(StringUtils.trimToEmpty(waypoint.note)).toString()); + ((EditText) findViewById(R.id.name)).setText(Html.fromHtml(StringUtils.trimToEmpty(waypoint.getName())).toString()); + ((EditText) findViewById(R.id.note)).setText(Html.fromHtml(StringUtils.trimToEmpty(waypoint.getNote())).toString()); if (waitDialog != null) { waitDialog.dismiss(); @@ -223,8 +223,8 @@ public class cgeowaypointadd extends AbstractActivity { public void onClick(View arg0) { Geopoint gp = null; - if (waypoint != null && waypoint.coords != null) - gp = waypoint.coords; + if (waypoint != null && waypoint.getCoords() != null) + gp = waypoint.getCoords(); cgeocoords coordsDialog = new cgeocoords(cgeowaypointadd.this, gp, geo); coordsDialog.setCancelable(true); coordsDialog.setOnCoordinateUpdate(new cgeocoords.CoordinateUpdate() { @@ -233,7 +233,7 @@ public class cgeowaypointadd extends AbstractActivity { ((Button) findViewById(R.id.buttonLatitude)).setText(gp.format(GeopointFormatter.Format.LAT_DECMINUTE)); ((Button) findViewById(R.id.buttonLongitude)).setText(gp.format(GeopointFormatter.Format.LON_DECMINUTE)); if (waypoint != null) { - waypoint.coords = gp; + waypoint.setCoords(gp); } } }); @@ -329,13 +329,13 @@ public class cgeowaypointadd extends AbstractActivity { final String note = ((EditText) findViewById(R.id.note)).getText().toString().trim(); final cgWaypoint waypoint = new cgWaypoint(); - waypoint.type = type; - waypoint.geocode = geocode; + waypoint.setWaypointType(type); + waypoint.setGeocode(geocode); waypoint.setPrefix(prefix); - waypoint.lookup = lookup; - waypoint.name = name; - waypoint.coords = new Geopoint(coords.get(0), coords.get(1)); - waypoint.note = note; + waypoint.setLookup(lookup); + waypoint.setName(name); + waypoint.setCoords(new Geopoint(coords.get(0), coords.get(1))); + waypoint.setNote(note); if (app.saveOwnWaypoint(id, geocode, waypoint)) { app.removeCacheFromCache(geocode); @@ -348,6 +348,7 @@ public class cgeowaypointadd extends AbstractActivity { } } + @Override public void goManual(View view) { if (id >= 0) { ActivityMixin.goManual(this, "c:geo-waypoint-edit"); |