diff options
author | Christopher Baines <cbaines8@gmail.com> | 2012-02-28 22:27:49 +0000 |
---|---|---|
committer | Christopher Baines <cbaines8@gmail.com> | 2012-02-28 22:27:49 +0000 |
commit | cde3c08d7e9e486d7d1a795832ea1b767d96a4f3 (patch) | |
tree | f1af1424ebf5cb3a548a7d73257723395dccb267 /src/net/cbaines/suma/DataHandler.java | |
parent | 7e88b00e017bde16c12e6adb78883acf7b2ba575 (diff) | |
parent | 5f2b8712079aeb5b7cee476b06b36013edac4fb3 (diff) | |
download | southamptonuniversitymap-cde3c08d7e9e486d7d1a795832ea1b767d96a4f3.tar southamptonuniversitymap-cde3c08d7e9e486d7d1a795832ea1b767d96a4f3.tar.gz |
Merge branch 'dev'
Conflicts:
src/net/cbaines/suma/BusSpecificStopView.java
src/net/cbaines/suma/StopView.java
Diffstat (limited to 'src/net/cbaines/suma/DataHandler.java')
-rw-r--r-- | src/net/cbaines/suma/DataHandler.java | 147 |
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) { - } + } } |