Package org.openstreetmap.gui.jmapviewer

Examples of org.openstreetmap.gui.jmapviewer.Coordinate


            } else if (inCoverage && "EastLongitude".equals(tagName)) {
                eastLon = Double.parseDouble(string);
            } else if (inCoverage && "WestLongitude".equals(tagName)) {
                westLon = Double.parseDouble(string);
            } else if ("BoundingBox".equals(tagName)) {
                curr.min = new Coordinate(southLat, westLon);
                curr.max = new Coordinate(northLat, eastLon);
            } else if ("CoverageArea".equals(tagName)) {
                inCoverage = false;
            }
            string = "";
        }
View Full Code Here


  }

  @Override
  public void mouseClicked(MouseEvent e) {
     if (e.getClickCount() == 2 && e.getButton() == MouseEvent.BUTTON1) {
      final Coordinate locationChoosen = getSelectedLocation(e.getPoint());
      if (locationCount < 1) {
        addMarkerToLocation(locationChoosen);
        locationCount++;
      }
      sendLocation(locationChoosen, getCurrentZoomLevel())
View Full Code Here

    setLocationChoiceUndoable(openMapsExtension, locationChoosen, zoom);
    refreshNode(node);
  }
 
  private void setLocationChoiceUndoable(final OpenMapsExtension extension, final Coordinate locationChoosen, final int zoomChoosen) {
    final Coordinate currentLocation = extension.getLocation();
    final int currentZoom = extension.getZoom();

    if (!currentLocation.equals(locationChoosen)) {
      final IActor actor = createUndoActor(extension, locationChoosen,
          currentLocation, zoomChoosen, currentZoom);
     
      Controller.getCurrentModeController().execute(actor,
          Controller.getCurrentModeController().getController()
View Full Code Here

  private int zoom;

  public OpenMapsExtension() {
                //Initialing Coodinate to values not included in lat/lon
                //measures - This allows undo to work.
                location = new Coordinate(500,500);
                zoom = 0;
  }
View Full Code Here

  public void updateZoom(int newZoom) {
    zoom = newZoom;
  }

  public void updateLocation(double location_x, double location_y) {
    location = new Coordinate(location_x, location_y);
  }
View Full Code Here

  public void updateLocation(double location_x, double location_y) {
    location = new Coordinate(location_x, location_y);
  }

  public void updateLocation(Coordinate locationChoosen) {
    location = new Coordinate(locationChoosen.getLat(), locationChoosen.getLon());
  }
View Full Code Here

                        // Only display bounds when no polygons (shapes) are defined for this provider
                    } else {
                        if (defaultTable.getSelectionModel().isSelectedIndex(i)) {
                            if (!mapRectangles.containsKey(i)) {
                                // Add new map rectangle
                                Coordinate topLeft = new Coordinate(bounds.getMaxLat(), bounds.getMinLon());
                                Coordinate bottomRight = new Coordinate(bounds.getMinLat(), bounds.getMaxLon());
                                MapRectangle rectangle = new MapRectangleImpl(topLeft, bottomRight);
                                mapRectangles.put(i, rectangle);
                                defaultMap.addMapRectangle(rectangle);
                            }
                        } else if (mapRectangles.containsKey(i)) {
View Full Code Here

        pStart.y <<= zoomDiff;

        iSelectionRectStart = pStart;
        iSelectionRectEnd = pEnd;

        Coordinate l1 = getPosition(p_max); // lon may be outside [-180,180]
        Coordinate l2 = getPosition(p_min); // lon may be outside [-180,180]
        Bounds b = new Bounds(
                new LatLon(
                        Math.min(l2.getLat(), l1.getLat()),
                        LatLon.toIntervalLon(Math.min(l1.getLon(), l2.getLon()))
                        ),
                        new LatLon(
                                Math.max(l2.getLat(), l1.getLat()),
                                LatLon.toIntervalLon(Math.max(l1.getLon(), l2.getLon())))
                );
        Bounds oldValue = this.bbox;
        this.bbox = b;
        repaint();
        firePropertyChange(BBOX_PROP, oldValue, this.bbox);
View Full Code Here

        return Main.getProjection().eastNorth2latlon(en.add(-getDx(), -getDy()));
    }

    private Coordinate getShiftedCoord(EastNorth en) {
        LatLon ll = getShiftedLatLon(en);
        return new Coordinate(ll.lat(),ll.lon());
    }
View Full Code Here

                throw new IllegalArgumentException(tr("Illegal longitude value ''{0}''", lon));
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException(MessageFormat.format("Illegal double value ''{0}''", sLon));
        }

        coords.add(new Coordinate(LatLon.roundToOsmPrecision(lat), LatLon.roundToOsmPrecision(lon)));
    }
View Full Code Here

TOP

Related Classes of org.openstreetmap.gui.jmapviewer.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.