private void cmdAddActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_cmdAddActionPerformed
   try {
     Double x = Double.valueOf(this.txtX.getText());
     Double y = Double.valueOf(this.txtY.getText());
     SurveyPointBean bean = new SurveyPointBean();
     bean.setX(x);
     bean.setY(y);
     // Ticket 98  - Set the id for the manually entered coordinate
     bean.setId(Integer.toString(theBean.getBeanList().size() + 1));
     this.theBean.getBeanList().add(bean);
   } catch (NumberFormatException ex) {
     Messaging.getInstance().show(GisMessage.CADASTRE_SURVEY_ADD_POINT);
   }
 } // GEN-LAST:event_cmdAddActionPerformed
示例#2
0
 private List<SurveyPointBean> getTargetPoints() {
   ExtendedLayerEditor cadastreObjectLayer = getTargetCadastreObjectLayer();
   List<SurveyPointBean> targetPoints = new ArrayList<SurveyPointBean>();
   for (VertexInformation vertexInformation : cadastreObjectLayer.getVertexList()) {
     Object labelAttribute =
         vertexInformation
             .getVertexFeature()
             .getAttribute(ControlsBundleForPlanGeneration.LAYER_FIELD_LABEL);
     if (labelAttribute == null) {
       continue;
     }
     SurveyPointBean surveyPoint = new SurveyPointBean();
     surveyPoint.setFeatureGeom(
         (Geometry) vertexInformation.getVertexFeature().getDefaultGeometry());
     surveyPoint.setId(labelAttribute.toString());
     targetPoints.add(surveyPoint);
   }
   return targetPoints;
 }