Package es.emergya.bbdd.bean

Examples of es.emergya.bbdd.bean.Routing


                .latlon2eastNorth(new LatLon(x, y)), view
                .getScale());
          }
        } else if (centerOptions.getSelectedItem().equals(
            i18n.getString("map.street"))) {
          Routing r = RoutingConsultas.find(street.getText());
          if (r != null && r.getGeometria() != null) {
            Point center = r.getGeometria().getCentroid()
                .getCentroid();
            view
                .zoomTo(Main.proj.latlon2eastNorth(new LatLon(
                    center.getY(), center.getX())), view
                    .getScale());
          }

        } else if (centerOptions.getSelectedItem().equals(
            i18n.getString("map.incidence"))) {

          final Object incidencia = incidences.getSelectedItem();
          if (incidencia == null) {
            return null;
          }

          Incidencia i = null;
          if (incidencia instanceof Incidencia) {
            i = (Incidencia) incidencia;
          } else {
            i = IncidenciaConsultas.find(incidencia.toString());
          }

          Geometry geom = i.getGeometria();
          if (geom == null) {
            return null;
          }

          Point center = geom.getCentroid();
          view.zoomTo(Main.proj.latlon2eastNorth(new LatLon(center
              .getY(), center.getX())), view.getScale());
          return null;

        } else if (centerOptions.getSelectedItem().equals(
            i18n.getString("map.resource"))) {
          final Object selectedItem = resources.getSelectedItem();
          if (selectedItem == null) {
            return null;
          }
          if (selectedItem instanceof Recurso) {
            Recurso r = (Recurso) selectedItem;
            HistoricoGPS h = null;
            if (r.getId() != null) {
              h = HistoricoGPSConsultas.lastGPSForRecurso(r);
            } else
              try {
                h = r.getHistoricoGps();
              } catch (Throwable t) {
                h = null;
              }
            if (h == null) {
              return null;
            }
            view.zoomTo(Main.proj.latlon2eastNorth(new LatLon(h
                .getPosY(), h.getPosX())), view.getScale());
          } else if (selectedItem instanceof String) {
            String r = (String) selectedItem;
            HistoricoGPS h = HistoricoGPSConsultas
                .lastGPSForRecurso(r);
            if (h == null) {
              return null;
            }
            view.zoomTo(Main.proj.latlon2eastNorth(new LatLon(h
                .getPosY(), h.getPosX())), view.getScale());
          } else if (selectedItem instanceof GpxLayer) {
            MyGpxLayer r = (MyGpxLayer) selectedItem;
            if (r == null || r.getLatLon() == null) {
              return null;
            }

            view.zoomTo(Main.proj.latlon2eastNorth(r.getLatLon()),
                view.getScale());
          }
        }
        return null;
      }
View Full Code Here


      this.name = texto;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
      Routing r = RoutingConsultas.find(this.name);
      if (r != null && r.getGeometria() != null) {
        Point center = r.getGeometria().getCentroid().getCentroid();
        view.zoomTo(Main.proj.latlon2eastNorth(new LatLon(
            center.getY(), center.getX())), view.getScale());
      }
    }
View Full Code Here

   * @param num
   * @return list of streets
   */
  @Transactional(readOnly = true, rollbackFor = Throwable.class)
  public Routing find(final String calle) {
    Routing res = null;
    try {
      res = (Routing) getSession().createCriteria(Routing.class).add(
          Restrictions.eq("name", calle)).add(
          Restrictions.isNotNull("geometria")).addOrder(
          Order.asc("id")).setMaxResults(1).uniqueResult();
View Full Code Here

TOP

Related Classes of es.emergya.bbdd.bean.Routing

Copyright © 2018 www.massapicom. 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.