Commit 80c9cd37 authored by Matti Pulkkinen's avatar Matti Pulkkinen
Browse files

added comments

parent a0c14355
......@@ -224,6 +224,7 @@ public class MapDialog extends JFrame {
public void run() {
URL url = null;
try {
// TODO StringBuilder
url = new URL("http://demo.mapserver.org/cgi-bin/wms?SERVICE="
+ "WMS&VERSION=1.1.1&REQUEST=GetMap&BBOX=" + MapDialog.this.westernLongitude + ","
+ MapDialog.this.southernLatitude + "," + MapDialog.this.easternLongitude + ","
......@@ -235,12 +236,18 @@ public class MapDialog extends JFrame {
e.printStackTrace();
}
MapDialog.this.imageLabel.setIcon(new ImageIcon(url));
}
} // run()
}.start();
} // updateImage()
private void populateLayerList()
throws ParserConfigurationException, SAXException, IOException, MalformedURLException {
/**
* Fetch the mapserver's capabilities and add their checkboxes to the left panel
*
* @throws ParserConfigurationException If the capability parser creation fails
* @throws SAXException If parsing the capabilities fails
* @throws IOException If any IO errors occur
*/
private void populateLayerList() throws ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder parser = factory.newDocumentBuilder();
Document document = parser.parse(new URL("http://demo.mapserver.org/cgi-bin/"
......@@ -253,14 +260,22 @@ public class MapDialog extends JFrame {
String title = layer.getElementsByTagName("Title").item(0).getTextContent();
this.leftPanel.add(new LayerCheckBox(name, title, (i == 0) ? true : false));
}
}
} // populateLayerList()
/**
* Updates the map focus coordinates according to the deltas provided.
*
* @param westDelta Difference in western longitude.
* @param eastDelta Difference in eastern longitude.
* @param southDelta Difference in southern latitude.
* @param northDelta Difference in northern latitude.
*/
private synchronized void updateCoordinates(int westDelta, int eastDelta, int southDelta,
int northDelta) {
this.westernLongitude += westDelta;
this.easternLongitude += eastDelta;
this.southernLatitude += southDelta;
this.northernLatitude += northDelta;
}
} // updateCoordinates(int, int, int, int)
// Käyttöliittymän komponentit
} // MapDialog
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment