Examples of Coordinate


Examples of org.drools.guvnor.client.widgets.decoratedgrid.data.Coordinate

     *
     * @param cell
     * @return true if the Cell can accept "otherwise" values
     */
    protected boolean canAcceptOtherwiseValues(CellValue< ? > cell) {
        Coordinate c = cell.getCoordinate();
        MergableGridWidget<DTColumnConfig52> grid = widget.getGridWidget();
        DynamicColumn<DTColumnConfig52> column = grid.getColumns().get( c.getCol() );
        return canAcceptOtherwiseValues( column.getModelColumn() );
    }
View Full Code Here

Examples of org.drools.guvnor.client.widgets.drools.decoratedgrid.data.Coordinate

    }

    @Test
    public void testIndexing_PhysicalCoordinates() {

        Coordinate c;
        c = data.get( 0 ).get( 0 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      0 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 0 ).get( 1 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      0 );
        assertEquals( c.getCol(),
                      1 );
        c = data.get( 0 ).get( 2 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      0 );
        assertEquals( c.getCol(),
                      2 );

        c = data.get( 1 ).get( 0 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      1 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 1 ).get( 1 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      1 );
        assertEquals( c.getCol(),
                      1 );
        c = data.get( 1 ).get( 2 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      1 );
        assertEquals( c.getCol(),
                      2 );

        c = data.get( 2 ).get( 0 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      2 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 2 ).get( 1 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      2 );
        assertEquals( c.getCol(),
                      1 );
        c = data.get( 2 ).get( 2 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      2 );
        assertEquals( c.getCol(),
                      2 );

        data.addRow( 1,
                     makeRow() );
        assertEquals( data.size(),
                      4 );

        c = data.get( 0 ).get( 0 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      0 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 0 ).get( 1 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      0 );
        assertEquals( c.getCol(),
                      1 );
        c = data.get( 0 ).get( 2 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      0 );
        assertEquals( c.getCol(),
                      2 );

        c = data.get( 1 ).get( 0 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      1 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 1 ).get( 1 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      1 );
        assertEquals( c.getCol(),
                      1 );
        c = data.get( 1 ).get( 2 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      1 );
        assertEquals( c.getCol(),
                      2 );

        c = data.get( 2 ).get( 0 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      2 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 2 ).get( 1 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      2 );
        assertEquals( c.getCol(),
                      1 );
        c = data.get( 2 ).get( 2 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      2 );
        assertEquals( c.getCol(),
                      2 );

        c = data.get( 3 ).get( 0 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      3 );
        assertEquals( c.getCol(),
                      0 );
        c = data.get( 3 ).get( 1 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      3 );
        assertEquals( c.getCol(),
                      1 );
        c = data.get( 3 ).get( 2 ).getPhysicalCoordinate();
        assertEquals( c.getRow(),
                      3 );
        assertEquals( c.getCol(),
                      2 );
    }
View Full Code Here

Examples of org.drools.workbench.screens.guided.dtree.client.widget.model.Coordinate

        initWidget( canvas );
    }

    public void setModel( final GuidedDecisionTree model ) {
        final Coordinate c = new Coordinate( width / 2,
                                             50 );

        //Walk model creating UIModel
        final TypeNode root = model.getRoot();
        uiModel.add( new TypeNodeElement( c,
View Full Code Here

Examples of org.freerealm.map.Coordinate

        xml.append("</builtTileImprovementsCount>\n");

        xml.append("<exploredCoordinates>\n");
        Iterator<Coordinate> exploredCoordinatesIterator = player.getExploredCoordinates().iterator();
        while (exploredCoordinatesIterator.hasNext()) {
            Coordinate coordinate = exploredCoordinatesIterator.next();
            xml.append((new CoordinateXMLWrapper(coordinate)).toXML() + "\n");
        }
        xml.append("</exploredCoordinates>\n");

        xml.append("<missions>\n");
View Full Code Here

Examples of org.geomajas.geometry.Coordinate

  @Autowired
  private GeoService service;

  @Test
  public void testConversion() throws Exception {
    Coordinate latlon = new Coordinate(50, 4);
    Coordinate google = GeoUtil.convertToGoogle(latlon);
    Envelope env = service.transform(new Envelope(0, 4, 0, 50), "EPSG:4326", "EPSG:900913");
    Assert.assertEquals(google.getX(), env.getMaxX(), 0.01);
    Assert.assertEquals(google.getY(), env.getMaxY(), 0.01);
  }
View Full Code Here

Examples of org.geomajas.geometry.Coordinate

    jtsC5 = new com.vividsolutions.jts.geom.Coordinate(12.0, 12.0);
    jtsC6 = new com.vividsolutions.jts.geom.Coordinate(12.0, 18.0);
    jtsC7 = new com.vividsolutions.jts.geom.Coordinate(18.0, 18.0);
    jtsC8 = new com.vividsolutions.jts.geom.Coordinate(18.0, 12.0);

    dtoC1 = new Coordinate(10.0, 10.0);
    dtoC2 = new Coordinate(20.0, 10.0);
    dtoC3 = new Coordinate(20.0, 20.0);
    dtoC4 = new Coordinate(10.0, 20.0);
    dtoC5 = new Coordinate(12.0, 12.0);
    dtoC6 = new Coordinate(12.0, 18.0);
    dtoC7 = new Coordinate(18.0, 18.0);
    dtoC8 = new Coordinate(18.0, 12.0);
  }
View Full Code Here

Examples of org.geomajas.geometry.Coordinate

      // combine location envelopes
      Envelope resultEnvelope = combineResultService.combine(results);
      Bbox bbox = dtoConverterService.toDto(resultEnvelope);
      response.setBbox(bbox);
      response.setCenter(new Coordinate(bbox.getX() + bbox.getWidth() / 2, bbox.getY() + bbox.getHeight() / 2));
    } else {
      List<GetLocationForStringAlternative> altList = new ArrayList<GetLocationForStringAlternative>();
      response.setAlternatives(altList);
      for (GetLocationResult[] altArr : alternatives) {
        for (GetLocationResult alt : altArr) {
          if (maxAlternatives > 0 && maxAlternatives <= altList.size()) {
            break;
          }
          GetLocationForStringAlternative one = new GetLocationForStringAlternative();

          String matchedLocation = location;
          List<String> matchedStrings = alt.getCanonicalStrings();
          if (null != matchedStrings) {
            matchedLocation = splitGeocoderStringService.combine(matchedStrings);
          }
          one.setCanonicalLocation(matchedLocation);

          // set additional info data
          one.setGeocoderName(alt.getGeocoderName());
          one.setUserData(alt.getUserData());

          // combine location envelopes
          Bbox bbox = dtoConverterService.toDto(alt.getEnvelope());
          one.setBbox(bbox);
          one.setCenter(
              new Coordinate(bbox.getX() + bbox.getWidth() / 2, bbox.getY() + bbox.getHeight() / 2));

          altList.add(one);
        }
      }
    }
View Full Code Here

Examples of org.geomajas.geometry.Coordinate

   */
  public static Coordinate convertToLatLon(Coordinate coordinate) {
    double lat = (coordinate.getY() / MERCATOR_WIDTH) * 180.0;
    double lon = (coordinate.getX() / MERCATOR_WIDTH) * 180.0;
    lat = 180 / Math.PI * (2 * Math.atan(Math.exp(lat * Math.PI / 180.0)) - Math.PI / 2.0);
    return new Coordinate(lat, lon);
  }
View Full Code Here

Examples of org.geomajas.geometry.Coordinate

   * @return google coordinate
   */
  public static Coordinate convertToGoogle(Coordinate coordinate) {
    double x = (coordinate.getY() / 180.0) * MERCATOR_WIDTH;
    double y = MERCATOR_WIDTH / Math.PI * Math.log(Math.tan((90.0 + coordinate.getX()) * Math.PI / 360.0));
    return new Coordinate(x, y);
  }
View Full Code Here

Examples of org.geomajas.geometry.Coordinate

   * Sets the center of the map.
   * @param lat latitude of the center
   * @param lon longitude of the center
   */
  public void setCenter(double lat, double lon) {
    getMapModel().getMapView().setCenterPosition(GeoUtil.convertToGoogle(new Coordinate(lat, lon)));
  }
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.