Examples of CoordsAttribute


Examples of com.agiletec.plugins.jpgeoref.aps.system.services.content.model.extraAttribute.CoordsAttribute

        double southY = MAX_NORTH;
        while (iter.hasNext()) {
          String contentId = (String) iter.next();
          Content content = (Content) contentManager.loadContent(contentId, true);
          if (null != content) {
            CoordsAttribute coords = this.extractCoordAttribute(content);
            if (coords != null && coords.getX() != 0 && coords.getY() != 0) {
              GeorefInfoBean geoInfoBean = new GeorefInfoBean();
              geoInfoBean.setContentId(contentId);
              geoInfoBean.setX(coords.getX());
              geoInfoBean.setY(coords.getY());
              geoInfoBean.setZ(coords.getZ());
              geoPoints.add(geoInfoBean);

              double currentX = coords.getX();
              double currentY = coords.getY();
              westX = (westX>currentX) ? currentX : westX;
              eastX = (eastX<currentX) ? currentX : eastX;
              northY = (northY<currentY) ? currentY : northY;
              southY = (southY>currentY) ? currentY : southY;
              sumx += currentX;
View Full Code Here

Examples of com.agiletec.plugins.jpgeoref.aps.system.services.content.model.extraAttribute.CoordsAttribute

   * @param tracer Attribute tracer
   * @param request Request
   */
  @Override
  protected void updateAttribute(AttributeInterface attribute, AttributeTracer tracer, HttpServletRequest request) {
    CoordsAttribute coordsAttribute = (CoordsAttribute) attribute;
    String x = this.getValueFromForm(attribute, tracer, GeoRefSystemConstants.COORDS_ATTRIBUTE_X, request);
    if (x != null && x.trim().length()>0) {
      try {
        coordsAttribute.setX(Double.parseDouble(x));
      } catch (NumberFormatException e) {
        throw new RuntimeException("Error in extracting coordinate x", e);
      }
    } else {
      coordsAttribute.setX(0);
    }
    String y = this.getValueFromForm(attribute, tracer, GeoRefSystemConstants.COORDS_ATTRIBUTE_Y, request);
    if (y != null && y.trim().length()>0) {
      try {
        coordsAttribute.setY(Double.parseDouble(y));
      } catch (NumberFormatException e) {
        throw new RuntimeException("Error in extracting coordinate y", e);
      }
    } else {
      coordsAttribute.setY(0);
    }
    String z = this.getValueFromForm(attribute, tracer, GeoRefSystemConstants.COORDS_ATTRIBUTE_Z, request);
    if (z != null && z.trim().length()>0) {
      try {
        coordsAttribute.setZ(Double.parseDouble(z));
      } catch (NumberFormatException e) {
        throw new RuntimeException("Error in extracting coordinate z", e);
      }
    } else {
      coordsAttribute.setZ(0);
    }
  }
View Full Code Here

Examples of com.agiletec.plugins.jpgeoref.aps.system.services.content.model.extraAttribute.CoordsAttribute

   */
  private void endCoords(StringBuffer textBuffer, String property) {
    if (null != textBuffer && null != this.getCurrentAttr()) {
      String coordsString = textBuffer.toString();
      double coord = Double.parseDouble(coordsString);
      CoordsAttribute attribute = (CoordsAttribute) this.getCurrentAttr();
      try {
        BeanUtils.setProperty(attribute, property, new Double(coord));
      } catch (Throwable t) {
        throw new RuntimeException("Error setting '" + property + "' property", t);
      }
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.