new URLDownload(source, this, null).startDownload();
}
public void parse(byte result[], MapTileTreeNodeCore core) throws SAXException, IOException, ParserConfigurationException {
PartsObject po = new PartsObject(result);
String documentTest = new String(po.getParts().get(0));
ByteArrayInputStream sr = new ByteArrayInputStream(po.getParts().get(0));
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(sr);
Element docElem = doc.getDocumentElement();
// get the response tag
if (docElem.getNodeName().equalsIgnoreCase("response")) {
// get the maptile tag
NodeList maptileNodeList = docElem.getChildNodes();
for(int i2=0; i2<maptileNodeList.getLength(); i2++) {
Node maptileNode = maptileNodeList.item(i2);
if (maptileNode.getNodeType() == Node.ELEMENT_NODE) {
Element elemMapTile = (Element) maptileNode;
if (elemMapTile.getTagName().equalsIgnoreCase("maptile")) {
int attachment = Integer.parseInt(elemMapTile.getAttribute("attachment"));
if (elemMapTile.hasAttribute("byteorder")) {
core.setByteOrderNormal(elemMapTile.getAttribute("byteorder").equalsIgnoreCase("normal") ? true : false);
}
BufferedImage img = ImageIO.read(new ByteArrayInputStream(po.getParts().get(attachment)));
core.setDownloadedImage(img);
// find all submaptile tags and add them to the list
NodeList nodes = elemMapTile.getChildNodes();
for(int i=0; i<nodes.getLength(); i++) {