Package com.lbslocal.cc.objects.v0.common

Examples of com.lbslocal.cc.objects.v0.common.Point


      if (((co[z + 1]).toString().replace("|", "").length() < (precision + 2))) {
        DecimalFormat df = new DecimalFormat(format.replace("0", "#"));
        df.setMinimumFractionDigits(precision);

        Point pt = new Point();
        pt.setY(Double.parseDouble(df.format(
            (Integer.parseInt(df.format(ptList.get(y).getY()).replace(",", "").replace(".", "")) + Integer.parseInt(co[z]))
                * Math.pow(10, -precision)).replace(",", ".")));
        pt.setX(Double.parseDouble(df.format(
            (Integer.parseInt(df.format(ptList.get(y).getX()).replace(",", "").replace(".", "")) + Integer.parseInt(co[z + 1]))
                * Math.pow(10, -precision)).replace(",", ".")));

        ptList.add(pt);

        y++;
      } else {
        DecimalFormat df = new DecimalFormat(format.replace("0", "#"));
        df.setMinimumFractionDigits(precision);

        Point pt = new Point();
        pt.setY(Double.parseDouble(df.format(Integer.parseInt(co[z]) * Math.pow(10, -precision)).replace(",", ".")));
        pt.setX(Double.parseDouble(df.format(Integer.parseInt(co[z + 1]) * Math.pow(10, -precision)).replace(",", ".")));

        ptList.add(pt);
      }

      z++;
View Full Code Here


        for (int x = 0; x < rpi.getRouteSummary().length; x++) {
          ri.getRouteSummary()[x] = new RouteSummary();
          ri.getRouteSummary()[x].setDescription(rpi.getRouteSummary()[x].getDescription());
          ri.getRouteSummary()[x].setDistance(rpi.getRouteSummary()[x].getDistance());
          ri.getRouteSummary()[x].setPoint(new Point());
          ri.getRouteSummary()[x].setPoint(rpi.getRouteSummary()[x].getPoint());
        }
      }
      ri.setRouteTotals(new RouteTotals());
      ri.setRouteTotals(rpi.getRouteTotals());
      double totalTime = 0;
      if (rpi.getSegDescription() != null) {
        ri.setSegDescription(new SegmentDescription[rpi.getSegDescription().length]);

        for (int x = 0; x < rpi.getSegDescription().length; x++) {
          ri.getSegDescription()[x] = new SegmentDescription();
          ri.getSegDescription()[x].setCity(new City());
          ri.getSegDescription()[x].getCity().setName(rpi.getSegDescription()[x].getCity().getName());
          ri.getSegDescription()[x].getCity().setState(rpi.getSegDescription()[x].getCity().getState());

          ri.getSegDescription()[x].setCommand(rpi.getSegDescription()[x].getCommand());
          ri.getSegDescription()[x].setCumulativeDistance(rpi.getSegDescription()[x].getCumulativeDistance());
          ri.getSegDescription()[x].setDescription(rpi.getSegDescription()[x].getDescription());
          ri.getSegDescription()[x].setDistance(rpi.getSegDescription()[x].getDistance());
          ri.getSegDescription()[x].setPoint(new Point());
          ri.getSegDescription()[x].getPoint().setX(rpi.getSegDescription()[x].getPoint().getX());
          ri.getSegDescription()[x].getPoint().setY(rpi.getSegDescription()[x].getPoint().getY());
          ri.getSegDescription()[x].setPoiRoute(rpi.getSegDescription()[x].getPoiRoute());

          ri.getSegDescription()[x].setTime(rpi.getSegDescription()[x].getTime());
         
          if (!rpi.getSegDescription()[x].getTime().equals(""))
            totalTime += Double.parseDouble(rpi.getSegDescription()[x].getTime().substring(0,rpi.getSegDescription()[x].getTime().indexOf(' ')));
         
//          String teste="";
//          if (!ri.getSegDescription()[x].getFullCoords().equals(""))
//            teste = convertFromDecarta(7, ri.getSegDescription()[x].getFullCoords());
         
          int z = 0;

          if (rpi.getSegDescription()[x].getPoiRouteDetails() != null) {
            ri.getSegDescription()[x].setPoiRouteDetails(new POIDetails[rpi.getSegDescription()[x].getPoiRouteDetails().length]);

            for (z = 0; z < rpi.getSegDescription()[x].getPoiRouteDetails().length; z++) {
              ri.getSegDescription()[x].getPoiRouteDetails()[z] = new POIDetails();
              ri.getSegDescription()[x].getPoiRouteDetails()[z].setAddressInfo(rpi.getSegDescription()[x].getPoiRouteDetails()[z]
                  .getAddressInfo());
              ri.getSegDescription()[x].getPoiRouteDetails()[z].setClientID(rpi.getSegDescription()[x].getPoiRouteDetails()[z]
                  .getClientID());
              ri.getSegDescription()[x].getPoiRouteDetails()[z].setName(rpi.getSegDescription()[x].getPoiRouteDetails()[z].getName());
              ri.getSegDescription()[x].getPoiRouteDetails()[z].setPoint(new Point());
              ri.getSegDescription()[x].getPoiRouteDetails()[z].getPoint().setX(
                  rpi.getSegDescription()[x].getPoiRouteDetails()[z].getPoint().getX());
              ri.getSegDescription()[x].getPoiRouteDetails()[z].getPoint().setY(
                  rpi.getSegDescription()[x].getPoiRouteDetails()[z].getPoint().getY());
              ri.getSegDescription()[x].getPoiRouteDetails()[z].setSource(rpi.getSegDescription()[x].getPoiRouteDetails()[z]
View Full Code Here

        for (int x = 0; x < rpi.getRouteSummary().length; x++) {
          ri.getRouteSummary()[x] = new RouteSummary();
          ri.getRouteSummary()[x].setDescription(rpi.getRouteSummary()[x].getDescription());
          ri.getRouteSummary()[x].setDistance(rpi.getRouteSummary()[x].getDistance());
          ri.getRouteSummary()[x].setPoint(new Point());
          ri.getRouteSummary()[x].setPoint(rpi.getRouteSummary()[x].getPoint());
        }
      }

      ri.setRouteTotals(new RouteTotals());
      ri.setRouteTotals(rpi.getRouteTotals());

      if (rpi.getSegDescription() != null) {
        ri.setSegDescription(new SegmentDescription[rpi.getSegDescription().length]);

        for (int x = 0; x < rpi.getSegDescription().length; x++) {
          ri.getSegDescription()[x] = new SegmentDescription();
          ri.getSegDescription()[x].setCity(new City());
          ri.getSegDescription()[x].getCity().setName(rpi.getSegDescription()[x].getCity().getName());
          ri.getSegDescription()[x].getCity().setState(rpi.getSegDescription()[x].getCity().getState());

          ri.getSegDescription()[x].setCommand(rpi.getSegDescription()[x].getCommand());
          ri.getSegDescription()[x].setCumulativeDistance(rpi.getSegDescription()[x].getCumulativeDistance());
          ri.getSegDescription()[x].setDescription(rpi.getSegDescription()[x].getDescription());
          ri.getSegDescription()[x].setDistance(rpi.getSegDescription()[x].getDistance());
          ri.getSegDescription()[x].setPoint(new Point());
          ri.getSegDescription()[x].getPoint().setX(rpi.getSegDescription()[x].getPoint().getX());
          ri.getSegDescription()[x].getPoint().setY(rpi.getSegDescription()[x].getPoint().getY());
          ri.getSegDescription()[x].setPoiRoute(rpi.getSegDescription()[x].getPoiRoute());

          int z = 0;

          if (rpi.getSegDescription()[x].getPoiRouteDetails() != null) {
            ri.getSegDescription()[x].setPoiRouteDetails(new POIDetails[rpi.getSegDescription()[x].getPoiRouteDetails().length]);

            for (z = 0; z < rpi.getSegDescription()[x].getPoiRouteDetails().length; z++) {
              ri.getSegDescription()[x].getPoiRouteDetails()[z] = new POIDetails();
              ri.getSegDescription()[x].getPoiRouteDetails()[z].setAddressInfo(rpi.getSegDescription()[x].getPoiRouteDetails()[z]
                  .getAddressInfo());
              ri.getSegDescription()[x].getPoiRouteDetails()[z].setClientID(rpi.getSegDescription()[x].getPoiRouteDetails()[z]
                  .getClientID());
              ri.getSegDescription()[x].getPoiRouteDetails()[z].setName(rpi.getSegDescription()[x].getPoiRouteDetails()[z].getName());
              ri.getSegDescription()[x].getPoiRouteDetails()[z].setPoint(new Point());
              ri.getSegDescription()[x].getPoiRouteDetails()[z].getPoint().setX(
                  rpi.getSegDescription()[x].getPoiRouteDetails()[z].getPoint().getX());
              ri.getSegDescription()[x].getPoiRouteDetails()[z].getPoint().setY(
                  rpi.getSegDescription()[x].getPoiRouteDetails()[z].getPoint().getY());
              ri.getSegDescription()[x].getPoiRouteDetails()[z].setSource(rpi.getSegDescription()[x].getPoiRouteDetails()[z]
View Full Code Here

    iniDate = System.currentTimeMillis();

    ProximityInfo pi = new ProximityInfo();

    try {
      Point point = new Point();

      if (Functions.IsNullOrEmpty(ad.getStreet()) && Functions.IsNullOrEmpty(ad.getHouseNumber()) && Functions.IsNullOrEmpty(ad.getZip())
          && (!Functions.IsNullOrEmpty(ad.getCity().getName()) && !Functions.IsNullOrEmpty(ad.getCity().getState()))) {
        try {
          point = af.findCity(ad.getCity(), new AddressOptions(true, 10, new ResultRange(1, 1)), idLicenca).getCityLocation()[0].getPoint();
        } catch (Exception ex) {
          throw (new Exception("Nao foi possivel geocodificar o endereco."));
        }
      } else {
        point = af.getXY(ad, idLicenca);
      }

      if (point.getX() == 0)
        throw (new Exception("Nao foi possivel geocodificar o endereco."));

      pi = px.findClosestFromXY(point, po, idLicenca);

      /*** Gravar acesso no log ***/
 
View Full Code Here

    iniDate = System.currentTimeMillis();

    ProximityInfo pi = new ProximityInfo();

    try {
      Point point = new Point();

      if (Functions.IsNullOrEmpty(ad.getStreet()) && Functions.IsNullOrEmpty(ad.getHouseNumber()) && Functions.IsNullOrEmpty(ad.getZip())
          && (!Functions.IsNullOrEmpty(ad.getCity().getName()) && !Functions.IsNullOrEmpty(ad.getCity().getState()))) {
        try {
          point = af.findCity(ad.getCity(), new AddressOptions(true, 0, new ResultRange(1, 1)), idLicenca).getCityLocation()[0].getPoint();
        } catch (Exception ex) {
          throw (new Exception("Nao foi possivel geocodificar o endereco."));
        }
      } else {
        point = af.getXY(ad, idLicenca);
      }

      if (point.getX() == 0)
        throw (new Exception("Nao foi possivel geocodificar o endereco."));

      pi = px.findRadiusFromXY(point, radius, po, idLicenca);

      /*** Gravar acesso no log ***/
 
View Full Code Here

    Value[0] = 0;
    Value[1] = 0;

    try {
      ShapeDetect shp = new ShapeDetect();

      for (int x = 0; x < rs.length; x++) {
        try {
          shp = Functions.getCity(rs[x].getPoint(), _server, _port, _dataSource);
View Full Code Here

  public static ShapeDetect getCity(Point ptClick, String server, Integer port, String dataSource) throws Exception {
    if (ptClick.getX() == 0 && ptClick.getY() == 0) {
      throw (new Exception("Coordenadas do ponto devem ser informadas."));
    }

    ShapeDetect shp = new ShapeDetect();

    try {
      TCPClientDecarta tcpDecarta = new TCPClientDecarta(server, port);
      String response = tcpDecarta.Send("S2LN|%LL=" + String.valueOf(ptClick.getY()).replace(",", ".") + ","
          + String.valueOf(ptClick.getX()).replace(",", ".") + "|%RAD=m15%INTERPADDR%ALLATTRS%LL%DS=" + dataSource + "||");
View Full Code Here

            } else if (tp.equals(TypeConteneur.POINT)) {
              System.out.println("[" + pseudo
                  + "] J'ai recu le point :");

              Point p = (Point) c.getObject();
              System.out.println("Symbole = " + p.getSymbole()
                  + " X = " + p.getX() + " Y = " + p.getY());

              // action sur la reception d'un point
              jxoGui.showPointAdversaire(p);


            } else if (tp.equals(TypeConteneur.GAGNE)) {
              // J'ai gagné
              System.out.println("[" + pseudo+"] Vous avez gagne !");

              jxoGui.desactiverTousChamps();
              jxoGui.info("Vous avez gagne cette partie !\nFelicitations !");

              fini = veutTerminer();

//              if(jxoGui.rejouer()){
//              envoyerMessage(TypeConteneur.REJOUER_OK, TypeConteneur.REJOUER_OK);
//              }else{
//              envoyerMessage(TypeConteneur.REJOUER_KO, TypeConteneur.REJOUER_KO);
//              fini = true;
//              disconnect();
//              }


            }else if(tp.equals(TypeConteneur.MATCH_NUL)){
              System.out.println("[" + pseudo+"] Match nul");

              jxoGui.desactiverTousChamps();
              jxoGui.info("Match Nul !");

              fini = veutTerminer();

//              if(jxoGui.rejouer()){
//              envoyerMessage(TypeConteneur.REJOUER_OK, TypeConteneur.REJOUER_OK);
//              }else{
//              envoyerMessage(TypeConteneur.REJOUER_KO, TypeConteneur.REJOUER_KO);
//              fini = true;
//              disconnect();
//              }

              jxoGui.resetMainPanel();
              jxoGui.desactiverTousChamps();

            }else if (tp.equals(TypeConteneur.PERDU)) {
              // J'ai perdu
              System.out.println("[" + pseudo+"]J'ai perdu !");

              // affichage du point du gagnant.
              Point p = (Point) c.getObject();
              jxoGui.showPointAdversaire(p);

              jxoGui.desactiverTousChamps();

              jxoGui.info("Vous avez perdu cette partie !");
View Full Code Here

   * @param i Abscisse du point a envoyer
   * @param j Ordonnee du point a envoyer
   * @throws IOException Si quelque chose tourne mal.
   */
  public void envoyerPoint(int i, int j) throws IOException{
    Point p = new Point(i,j, this.symbole);
    Conteneur c1 = new Conteneur(TypeConteneur.POINT, p);
    c1.setPseudo(this.userName);
    this.leClient.envoyerConteneur(c1);
  }
View Full Code Here

              // c.getPseudo();//(String)joueurs.get(client);
              if (pseudo == null) {               
                return;
              }
                           
              Point point = (Point) c.getObject();

              // Création de la partie si elle n'existe pas
              if (dernierePartie == null) {
                dernierePartie = gs.aJouer(pseudo, point);
              }
View Full Code Here

TOP

Related Classes of com.lbslocal.cc.objects.v0.common.Point

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.