aboutsummaryrefslogtreecommitdiff
path: root/src/net/cbaines/suma/DataHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/cbaines/suma/DataHandler.java')
-rw-r--r--src/net/cbaines/suma/DataHandler.java147
1 files changed, 75 insertions, 72 deletions
diff --git a/src/net/cbaines/suma/DataHandler.java b/src/net/cbaines/suma/DataHandler.java
index 25f66ff..852f035 100644
--- a/src/net/cbaines/suma/DataHandler.java
+++ b/src/net/cbaines/suma/DataHandler.java
@@ -27,88 +27,91 @@ import org.xml.sax.helpers.DefaultHandler;
public class DataHandler extends DefaultHandler {
- // this holds the data
- private PathOverlay _data;
+ // this holds the data
+ private PathOverlay _data;
- private int colour;
- private ResourceProxy resProxy;
+ private int colour;
+ private ResourceProxy resProxy;
- public DataHandler(int colour, ResourceProxy resProxy) {
- this.colour = colour;
- this.resProxy = resProxy;
- }
+ public DataHandler(int colour, ResourceProxy resProxy) {
+ this.colour = colour;
+ this.resProxy = resProxy;
+ }
- /**
- * Returns the data object
- *
- * @return
- */
- public PathOverlay getData() {
- return _data;
- }
+ /**
+ * Returns the data object
+ *
+ * @return
+ */
+ public PathOverlay getData() {
+ return _data;
+ }
- /**
- * This gets called when the xml document is first opened
- *
- * @throws SAXException
- */
- @Override
- public void startDocument() throws SAXException {
- _data = new PathOverlay(colour, resProxy);
- }
+ /**
+ * This gets called when the xml document is first opened
+ *
+ * @throws SAXException
+ */
+ @Override
+ public void startDocument() throws SAXException {
+ _data = new PathOverlay(colour, resProxy);
+ }
- /**
- * Called when it's finished handling the document
- *
- * @throws SAXException
- */
- @Override
- public void endDocument() throws SAXException {
+ /**
+ * Called when it's finished handling the document
+ *
+ * @throws SAXException
+ */
+ @Override
+ public void endDocument() throws SAXException {
- }
+ }
- /**
- * This gets called at the start of an element. Here we're also setting the booleans to true if it's at that
- * specific tag. (so we know where we are)
- *
- * @param namespaceURI
- * @param localName
- * @param qName
- * @param atts
- * @throws SAXException
- */
- @Override
- public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
- if (localName.equals("trkpt")) {
- // Log.v("DataHandler", "Adding point to route overlay " + atts.getValue("lat") + " " +
- // atts.getValue("lon"));
- _data.addPoint(Util.csLatLongToGeoPoint(atts.getValue("lat"), atts.getValue("lon")));
+ /**
+ * This gets called at the start of an element. Here we're also setting the
+ * booleans to true if it's at that specific tag. (so we know where we are)
+ *
+ * @param namespaceURI
+ * @param localName
+ * @param qName
+ * @param atts
+ * @throws SAXException
+ */
+ @Override
+ public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
+ if (localName.equals("trkpt")) {
+ // Log.v("DataHandler", "Adding point to route overlay " +
+ // atts.getValue("lat") + " " +
+ // atts.getValue("lon"));
+ _data.addPoint(Util.csLatLongToGeoPoint(atts.getValue("lat"), atts.getValue("lon")));
+ }
}
- }
- /**
- * Called at the end of the element. Setting the booleans to false, so we know that we've just left that tag.
- *
- * @param namespaceURI
- * @param localName
- * @param qName
- * @throws SAXException
- */
- @Override
- public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
+ /**
+ * Called at the end of the element. Setting the booleans to false, so we
+ * know that we've just left that tag.
+ *
+ * @param namespaceURI
+ * @param localName
+ * @param qName
+ * @throws SAXException
+ */
+ @Override
+ public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
- }
+ }
- /**
- * Calling when we're within an element. Here we're checking to see if there is any content in the tags that we're
- * interested in and populating it in the Config object.
- *
- * @param ch
- * @param start
- * @param length
- */
- @Override
- public void characters(char ch[], int start, int length) {
+ /**
+ * Calling when we're within an element. Here we're checking to see if there
+ * is any content in the tags that we're interested in and populating it in
+ * the Config object.
+ *
+ * @param ch
+ * @param start
+ * @param length
+ */
+ @Override
+ public void characters(char ch[], int start, int length) {
- }
+ }
}