showSidebar(sidebarCheckBox.isSelected());
}
}
protected BoundingBox askForBoundingBox() {
BoundingBox result = null;
JTextField minLat = new JTextField("-90");
JTextField minLon = new JTextField("-180");
JTextField maxLat = new JTextField("90");
JTextField maxLon = new JTextField("180");
if (getMap().getMarkers().size() == 2) {
MapNode m1 = getMap().getMarkers().get(0);
MapNode m2 = getMap().getMarkers().get(1);
minLat.setText(Float.toString(Math.min(m1.getLat(), m2.getLat())));
minLon.setText(Float.toString(Math.min(m1.getLon(), m2.getLon())));
maxLat.setText(Float.toString(Math.max(m1.getLat(), m2.getLat())));
maxLon.setText(Float.toString(Math.max(m1.getLon(), m2.getLon())));
}
Object[] content = new Object[] { "Min Latitude:", minLat,
"Min Longitude:", minLon, "Max Latitude:", maxLat,
"Max Longitude:", maxLon, };
boolean done;
do {
done = true;
if (JOptionPane.showConfirmDialog(this, content,
"Specify Bounding Box", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
try {
result = new BoundingBox(
Float.parseFloat(minLat.getText()), Float
.parseFloat(minLon.getText()), Float
.parseFloat(maxLat.getText()), Float
.parseFloat(maxLon.getText()));
} catch (NumberFormatException e) {