currentPolygon = p;
polygonHash.put(p.getZoneDetailsId(), p);
String n = "";
for (Iterator iterator = zoneDetailsList.iterator(); iterator
.hasNext();) {
ZoneDetails zoneDetails = (ZoneDetails) iterator.next();
if(zoneDetails.getId().equals(currentPolygon.getZoneDetailsId()))
{
n = zoneDetails.getName();
}
}
vertices.setText("Current polygon in ZoneListing=" + n);
}
});
eventBus.addHandler(EndEditPolygonEvent.TYPE,
new EndEditPolygonEventHandler() {
public void onEndEditPolygon(EndEditPolygonEvent event) {
TagPolygon p = event.getPolygon();
currentPolygon = p;
currentZoneDetailId = p.getZoneDetailsId();
polygonHash.put(p.getZoneDetailsId(), p);
polyline.setText(p.getZoneDetailsId());
String n = "";
for (Iterator iterator = zoneDetailsList.iterator(); iterator
.hasNext();) {
ZoneDetails zoneDetails = (ZoneDetails) iterator.next();
if(zoneDetails.getId().equals(currentPolygon.getZoneDetailsId()))
{
n = zoneDetails.getName();
}
}
vertices.setText("Current polyline in ZoneListing=" + n);
String zoneName = Window.prompt("Name this zone", "");
if( zoneName == null)
{
eventBus.fireEvent(new CancelZoneEvent(p.getZoneDetailsId()));
} else {
name.setText(zoneName);
description.setText("");
}
}
});
eventBus.addHandler(GetZonesEvent.TYPE, new GetZonesEventHandler() {
public void onGetZones(GetZonesEvent event) {
clearZoneEditView();
refreshZoneDetails = true;
fetchZoneDetails();
}
});
eventBus.addHandler(SentUpdatedPolygonEvent.TYPE,
new SentUpdatedPolygonEventHandler() {
@Override
public void onSentUpdatedPolygon(SentUpdatedPolygonEvent event) {
currentPolygon = event.tagPolygon;
}
});
/*
eventBus.addHandler(DebugEvent.TYPE,
new DebugEventHandler() {
public void onDebug(DebugEvent event) {
GWT.log("DEBUG ========================= BEGIN DEBUG EVENT IN ROADLISTING ===============");
GWT.log("DEBUG RoadListing: polylineHash keys=" + polygonHash.keySet());
GWT.log("DEBUG RoadListing: currentPolyline=" + currentPolygon);
}
});
*/
eventBus.addHandler(EditZoneDetailsBySegmentEvent.TYPE,
new EditZoneDetailsBySegmentEventHandler() {
@Override
public void onEditZoneDetailsBySegment(EditZoneDetailsBySegmentEvent event) {
String id = event.getId();
if( id == null )
{
clearZoneEditView();
return;
}
// find the roadDetails with this id in
for (Iterator iterator = zoneDetailsList.iterator(); iterator
.hasNext();) {
ZoneDetails zoneDetails = (ZoneDetails) iterator.next();
//GWT.log("EDIT road details loop, working on id=" + roadDetails.getId());
if( zoneDetails.getId().equals(id))
{
loadZoneDetails(zoneDetails);
break;
}
}