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

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


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


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

    Calendar lCDateTime = Calendar.getInstance();
    String routeID = _maquina + "_" + lCDateTime.getTimeInMillis();

    try {
      try {
        response = requestRoute(routeID, true, rs, ro, new Extent(), mo.getMapSize(), null, idLicenca, _dataSource, methodID);
        ri.setRouteId(routeID);

        // ri.setProximityList(getRouteProximity(response, ro.radius,
        // idLicenca, ro.routeDetails.getRouteType()));
View Full Code Here

    String routeID = _maquina + "_" + Calendar.getInstance().getTimeInMillis();

    try {

      response = requestRoute(routeID, true, rs, ro, new Extent(), new MapSize(), null, idLicenca, _dataSource, methodID);

      ri.setRouteId(routeID);

      // ri.setProximityList(getRouteProximity(response, ro.radius,
      // idLicenca, ro.routeDetails.getRouteType()));

      MapInfo mapInfo = new MapInfo();
      mapInfo.setUrl("");

      String XMaxYMax = response.substring(response.indexOf("LLMAX=") + 6); // .substring(0,
                                          // response.substring(response.indexOf("LLMAX=")
                                          // +
                                          // 6).indexOf(Pattern.quote("|")));
      XMaxYMax = XMaxYMax.substring(0, XMaxYMax.indexOf("|"));
      String XMinYMin = response.substring(response.indexOf("LLMIN=") + 6); // .substring(0,
                                          // response.substring(response.indexOf("LLMIN=")
                                          // +
                                          // 6).indexOf(Pattern.quote("%")));
      XMinYMin = XMinYMin.substring(0, XMinYMin.indexOf("%"));

      mapInfo.setExtent(new Extent());
      mapInfo.getExtent().setXMax(Double.parseDouble(XMaxYMax.split(Pattern.quote(","))[1]));
      mapInfo.getExtent().setXMin(Double.parseDouble(XMinYMin.split(Pattern.quote(","))[1]));
      mapInfo.getExtent().setYMax(Double.parseDouble(XMaxYMax.split(Pattern.quote(","))[0]));
      mapInfo.getExtent().setYMin(Double.parseDouble(XMinYMin.split(Pattern.quote(","))[0]));
View Full Code Here

  }

  public SegmentDescription[] getRouteDescription(int idLicenca, RouteStop[] rs, RouteProximityOptions ro, int methodID) throws Exception {
    String response = "";

    Extent ext = new Extent();
    SegmentDescription[] segRet = new SegmentDescription[0];

    String routeID = _maquina + "_" + Calendar.getInstance().getTimeInMillis();

    try {
View Full Code Here

  }

  public RouteTotals getRouteTotals(int idLicenca, RouteStop[] rs, RouteProximityOptions ro, int methodID) throws Exception {
    String barriersRoute = "";

    String response = requestRoute("", false, rs, ro, new Extent(), new MapSize(), barriersRoute, idLicenca, _dataSource, methodID);

    SegmentDescription[] segDescription = getSegmentDescriptionAlternative(response, ro.getVehicle().getTollFeeCat(), ro, rs, _dataSource,
        idLicenca);
    RouteTotals rt = getTotals(segDescription, ro, rs, totalPedagios);
View Full Code Here

  }

  public RouteSummary[] getRouteSummary(int idLicenca, RouteStop[] rs, RouteProximityOptions ro, int methodID) throws Exception {
    String barriersRoute = "";

    String response = requestRoute("", false, rs, ro, new Extent(), new MapSize(), barriersRoute, idLicenca, _dataSource, methodID);

    SegmentDescription[] segDescription = getSegmentDescriptionAlternative(response, ro.getVehicle().getTollFeeCat(), ro, rs, _dataSource,
        idLicenca);
    RouteSummary[] routeSummary = getSummary(segDescription, rs, ro);
View Full Code Here

        response.setCharacterEncoding("UTF-8");
       
        ObjectsHelper[] dependencyObjects = new ObjectsHelper[2];
       
        dependencyObjects[0] = cr.new ObjectsHelper();
        dependencyObjects[0].object = new Extent();
        dependencyObjects[0].alias = "extent";
       
        dependencyObjects[1] = cr.new ObjectsHelper();
        dependencyObjects[1].object = new MapInfo();
        dependencyObjects[1].alias = "MapInfo";

        response.getWriter().write("<?xml version='1.0' encoding='UTF-8'?>\n" + cr.getXMLFromObject(mi, dependencyObjects) + "");
      }
      if (ph.fields[0].equals("getMap"))
      {
        MapInfo mi = new MapInfo();
       
        String mapType = cr.getFieldFromXML(ph.XMLFile, "maptype");
       
        if (!mapType.toLowerCase().equals("gif") && !mapType.toLowerCase().equals("png") && !mapType.toLowerCase().equals("jpg") ){
          mapType = "png";
        }
       
        Extent extent = (Extent) cr.getObjectFromXML(ph.XMLFile, "extent", Extent.class, null);
       
        ObjectsHelper[] mapOptionsDependencyObjects = new ObjectsHelper[4];
       
        mapOptionsDependencyObjects[0] = cr.new ObjectsHelper();
        mapOptionsDependencyObjects[0].object = new MapSize();
        mapOptionsDependencyObjects[0].alias = "mapSize";
       
        mapOptionsDependencyObjects[1] = cr.new ObjectsHelper();
        mapOptionsDependencyObjects[1].object = new Icon[0];
        mapOptionsDependencyObjects[1].alias = "icon";
       
        mapOptionsDependencyObjects[2] = cr.new ObjectsHelper();
        mapOptionsDependencyObjects[2].object = new Icon();
        mapOptionsDependencyObjects[2].alias = "Icon";
       
        mapOptionsDependencyObjects[3] = cr.new ObjectsHelper();
        mapOptionsDependencyObjects[3].object = new Point();
        mapOptionsDependencyObjects[3].alias = "point";
 
        MapOptions mo = (MapOptions) cr.getObjectFromXML(ph.XMLFile, "mo", MapOptions.class, mapOptionsDependencyObjects);
       
        String routeId = cr.getFieldFromXML(ph.XMLFile, "routeId");

       
        try
        {
          mi = cMr.getMap(routeId, extent, mo, id_licenca, mapType);
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
       
        response.setContentType("text/xml");
        response.setCharacterEncoding("UTF-8");
       
        ObjectsHelper[] dependencyObjects = new ObjectsHelper[2];
       
        dependencyObjects[0] = cr.new ObjectsHelper();
        dependencyObjects[0].object = new Extent();
        dependencyObjects[0].alias = "extent";
       
        dependencyObjects[1] = cr.new ObjectsHelper();
        dependencyObjects[1].object = new MapInfo();
        dependencyObjects[1].alias = "MapInfo";
View Full Code Here

    tcpDecarta = new TCPClientDecarta(server, port);
  }

  public Extent getNewExtent(Extent oldExtent, Extent newExtentInPixels, MapSize ms) {
    Extent newExtent = new Extent();

    newExtent.setXMax(oldExtent.getXMin() + (oldExtent.getXMax() - oldExtent.getXMin()) * newExtentInPixels.getXMax() / ms.getWidth());
    newExtent.setXMin(oldExtent.getXMin() + (oldExtent.getXMax() - oldExtent.getXMin()) * newExtentInPixels.getXMin() / ms.getWidth());
    newExtent.setYMax(oldExtent.getYMax() - (oldExtent.getYMax() - oldExtent.getYMin()) * newExtentInPixels.getYMax() / ms.getHeight());
    newExtent.setYMin(oldExtent.getYMax() - (oldExtent.getYMax() - oldExtent.getYMin()) * newExtentInPixels.getYMin() / ms.getHeight());

    return newExtent;
  }
View Full Code Here

      throw (ex);
    }
  }

  public Extent getExtentStateSQL(String uf, int idLicenca, String country) throws Exception {
    Extent extent = new Extent();

    try {
      Connection con = dataBase.getConnection(Functions.getDataBase(idLicenca, country).getSource());

      CallableStatement cst = con.prepareCall("{call CP_WS_TB_ESTADOS_SELECT(?)}");
      cst.setString(1, uf);

      cst.execute();

      ResultSet rs1 = cst.getResultSet();

      while (rs1.next()) {
        extent.setXMax(Double.parseDouble(rs1.getString("xmax").replace(",", ".")));
        extent.setXMin(Double.parseDouble(rs1.getString("xmin").replace(",", ".")));
        extent.setYMax(Double.parseDouble(rs1.getString("ymax").replace(",", ".")));
        extent.setYMin(Double.parseDouble(rs1.getString("ymin").replace(",", ".")));
      }
      rs1.close();

      cst.close();
      con.close();
View Full Code Here

TOP

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

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.