Package org.geomajas.geometry

Examples of org.geomajas.geometry.Coordinate


  // -------------------------------------------------------------------------

  public PointDrawController(MapWidget mapWidget, AbstractFreeDrawingController parent) {
    super(mapWidget, parent);
    factory = new GeometryFactory(mapWidget.getMapModel().getSrid(), mapWidget.getMapModel().getPrecision());
    geometry = factory.createPoint(new Coordinate());
    drawStyle = new ShapeStyle("#FF7F00", 0.3f, "#FF7F00", 1, 2);
    symbolStyle = new SymbolInfo();
    CircleInfo c = new CircleInfo();
    symbolStyle.setCircle(c);
    c.setR(8);
View Full Code Here


  // -------------------------------------------------------------------------
  // MapController implementation:
  // -------------------------------------------------------------------------

  public void onMouseDown(MouseDownEvent event) {
    Coordinate newCoords = getWorldPosition(event);
    geometry = factory.createPoint(newCoords);
  }
View Full Code Here

  private void createTempPoint() {
    tempPoint = new GfxGeometry("PointDrawController.updatePoint");
    tempPoint.setStyle(drawStyle);
    tempPoint.setSymbolInfo(symbolStyle);

    Coordinate coords = getTransformer().worldToPan(geometry.getCoordinate());
    Point point = (Point) geometry.getGeometryFactory().createPoint(coords);
    tempPoint.setGeometry(point);
    mapWidget.render(tempPoint, RenderGroup.VECTOR, RenderStatus.ALL);
  }
View Full Code Here

      LinearRing ring = geometry.getGeometryFactory().createLinearRing(polygon.getCoordinates());
      if (ring != null && geometry.getCoordinates().length > 0) {

        Coordinate[] coordinates = ring.getCoordinates();
        Coordinate firstCoordinate = coordinates[0];
        Coordinate lastCoordinate = coordinates[coordinates.length - 2];

        LineString lineString1 = geometry.getGeometryFactory().createLineString(
            new Coordinate[] { getTransformer().worldToPan(lastCoordinate), getPanPosition(event) });
        tempLine1.setGeometry(lineString1);
View Full Code Here

    public void onMouseUp(ListenerEvent event) {
    }

    public void onMouseMove(ListenerEvent event) {
      Coordinate worldPosition = event.getWorldPosition();
      double x = ((double) Math.round(worldPosition.getX() * 1000)) / 1000;
      double y = ((double) Math.round(worldPosition.getY() * 1000)) / 1000;
      xLabel.setContents(xText + ": " + x);
      yLabel.setContents(yText + ": " + y);
    }
View Full Code Here

    String layer = "layerWmsCountries";
    SearchByPointRequest request = new SearchByPointRequest();
    request.setBbox(new Bbox(-3211986.0066263545, 98246.25012821658, 1.065471024672729E7, 3365675.229452881));
    request.setCrs("EPSG:900913");
    request.setLayerIds(new String[] {layer});
    request.setLocation(new Coordinate(672238.022713162, 2554015.0948743597));
    request.setScale(1.022083167709322E-4);
    CommandResponse response = dispatcher.execute(SearchByPointRequest.COMMAND, request, null, "en");
    Assert.assertFalse(response.isError());
    Assert.assertTrue(response instanceof SearchByPointResponse);
    SearchByPointResponse sbp = (SearchByPointResponse) response;
View Full Code Here

    IButton centerBTN = new IButton(I18nProvider.getSampleMessages().navigationBtnPosition());
    centerBTN.setWidth100();
    centerBTN.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getMapModel().getMapView().setCenterPosition(new Coordinate(-10000000, 2000000));
      }
    });

    // Create a button that translate the map:
    IButton translateBTN = new IButton(I18nProvider.getSampleMessages().navigationBtnTranslate());
View Full Code Here

     * @author Pieter De Graef
     */
    class MouseMoveListener extends AbstractListener {

      public void onMouseMove(ListenerEvent event) {
        Coordinate screenPosition = event.getScreenPosition();
        Coordinate worldPosition = event.getWorldPosition();
        String x = NumberFormat.getFormat("0.000").format(worldPosition.getX());
        String y = NumberFormat.getFormat("0.000").format(worldPosition.getY());
        label.setContents(I18nProvider.getSampleMessages().customControllerScreenCoordinates() + " = "
            + screenPosition + "<br/>"
            + I18nProvider.getSampleMessages().customControllerWorldCoordinates() + " = (" + x + ", " + y
            + ")");
      }
View Full Code Here

     * @author Pieter De Graef
     */
    class MouseMoveListener extends AbstractListener {

      public void onMouseMove(ListenerEvent event) {
        Coordinate screenPosition = event.getScreenPosition();
        Coordinate worldPosition = event.getWorldPosition();
        String x = NumberFormat.getFormat("0.000").format(worldPosition.getX());
        String y = NumberFormat.getFormat("0.000").format(worldPosition.getY());
        label.setContents(I18nProvider.getSampleMessages().customControllerScreenCoordinates() + " = "
            + screenPosition + "<br/>"
            + I18nProvider.getSampleMessages().customControllerWorldCoordinates() + " = (" + x + ", " + y
            + ")");
      }
View Full Code Here

    // Create the custom controller:
    GraphicsController customController = new AbstractGraphicsController(map) {
     
      public void onMouseMove(MouseMoveEvent event) {
        Coordinate screenPosition = getScreenPosition(event);
        Coordinate worldPosition = getWorldPosition(event);
        String x = NumberFormat.getFormat("0.000").format(worldPosition.getX());
        String y = NumberFormat.getFormat("0.000").format(worldPosition.getY());
        label.setContents(I18nProvider.getSampleMessages().customControllerScreenCoordinates() + " = "
            + screenPosition + "<br/>"
            + I18nProvider.getSampleMessages().customControllerWorldCoordinates()
            + " = (" + x + ", " + y + ")");
      }
View Full Code Here

TOP

Related Classes of org.geomajas.geometry.Coordinate

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.