Examples of ZoneDetails


Examples of org.worldbank.transport.tamt.shared.ZoneDetails

     
      // delete zones
      ArrayList<ZoneDetails> zones = zoneDAO.getZoneDetails(region);
      ArrayList<String> zoneIds = new ArrayList<String>();
      for (Iterator iterator = zones.iterator(); iterator.hasNext();) {
        ZoneDetails zone = (ZoneDetails) iterator.next();
        zoneIds.add(zone.getId());
      }
      logger.debug("Deleting zones for study region: " + studyRegionId);
      zoneDAO.deleteZoneDetails(zoneIds)
     
      // delete roads
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.ZoneDetails

        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;
            }
          }
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.ZoneDetails

 
  private void saveZoneDetails() {
   
    refreshZoneDetails = true;
   
    ZoneDetails zoneDetails = new ZoneDetails();
    zoneDetails.setName(name.getText());
    zoneDetails.setDescription(description.getText());
    zoneDetails.setId(currentZoneDetailId);
    zoneDetails.setZoneType(zoneTypes.getValue(zoneTypes.getSelectedIndex())); // match to UI bit for zoneType
    zoneDetails.setRegion(currentStudyRegion);
   
    ArrayList<Vertex> vertices = new ArrayList<Vertex>();
    try {
      if( currentZoneDetailId == null)
      {
        currentPolygon = null;
      }
      vertices = polylgonToVertexArrayList(currentPolygon);
      zoneDetails.setVertices(vertices);
     
      zoneService.saveZoneDetails(zoneDetails, new AsyncCallback<ZoneDetails>() {

        @Override
        public void onFailure(Throwable caught) {
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.ZoneDetails

              // create a hash of <roadId>|vertex array to throw over to TagMap for rendering
              vertexHash = new HashMap<String, ArrayList<Vertex>>();
             
              for (int i = 0; i < zoneDetailsList.size(); i++) {
              final int count = i;
          final ZoneDetails zoneDetails = zoneDetailsList.get(i);
         
          // stick the vertices for this zoneDetails in the vertexHash
          vertexHash.put(zoneDetails.getId(), zoneDetails.getVertices());
         
          CheckBox cb = new CheckBox();
          cb.setFormValue(zoneDetails.getId()); //store the id in the checkbox value
          checkboxes.add(cb); // keep track for selecting all|none to delete
          cb.setStyleName(style.checkbox());

          // if a checkbox is checked, deselect the master checkbox
          cb.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
              uncheckMasterCheckBox();
            }
          });
         
          Label name = new Label(zoneDetails.getName());
          name.setStyleName(style.zoneList());
          name.addStyleName(style.clickable());
          name.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.ZoneDetails

            // convert a linestring to a JTS geometry
            WKTReader reader = new WKTReader();
            Geometry geometry = reader.read(lineString);
            Point centroidJTS = geometry.getCentroid();
           
            ZoneDetails zoneDetails = new ZoneDetails();
            zoneDetails.setId(id);
            zoneDetails.setName(name);
            zoneDetails.setDescription(description);
            zoneDetails.setZoneType(zoneType);
           
            // now convert the geometry to an ArrayList<Vertex> and
            // set in the roadDetails
            ArrayList<Vertex> vertices = Utils.geometryToVertexArrayList(geometry);
            zoneDetails.setVertices(vertices);
           
            // convert the centroid point into a Vertex
            Vertex centroid = new Vertex();
            centroid.setLat(centroidJTS.getY());
            centroid.setLng(centroidJTS.getX());
            zoneDetails.setCentroid(centroid);
           
            //TODO: do I need to include the study region id, description here?
            zoneDetails.setRegion(region);
           
            zoneDetailsList.add(zoneDetails);
      }
      connection.close(); // returns connection to the pool
    }
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.ZoneDetails

  {
    ArrayList<ZoneDetails> zoneDetails = new ArrayList<ZoneDetails>();
    int sample = 10;
    for (int i = 0; i < sample; i++) {
      UUID id = UUID.randomUUID();
      ZoneDetails t = new ZoneDetails();
      t.setName("Name-" + id.toString());
      t.setDescription("Desc-"+id.toString());
      zoneDetails.add(t);
    }
    return zoneDetails;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.