Package de.fhpotsdam.unfolding.utils

Examples of de.fhpotsdam.unfolding.utils.ScreenPosition


    } else {
      startLocation = map.getLocation(p.width / 2, p.height / 2);
      destLocation = GeoUtils.getDestinationLocation(startLocation, 90f, distance);
    }
    // Calculate distance between both locations in screen coordinates
    ScreenPosition destPos = map.getScreenPosition(destLocation);
    ScreenPosition startPos = map.getScreenPosition(startLocation);
    float dx = destPos.x - startPos.x;

    // Display
    p.fill(color);
    if (autoAlignment && x > map.mapDisplay.getWidth() / 2) {
View Full Code Here


  @Override
  public boolean isInside(UnfoldingMap map, float checkX, float checkY) {
    List<ScreenPosition> positions = new ArrayList<ScreenPosition>();
    for (Location location : locations) {
      ScreenPosition pos = map.getScreenPosition(location);
      positions.add(pos);
    }
    return isInside(checkX, checkY, positions);
  }
View Full Code Here

   *            y position on the screen.
   */
  public CompassUI(PApplet p, UnfoldingMap map, PImage img, float x, float y) {
    this.p = p;
    this.map = map;
    this.pos = new ScreenPosition(x, y);
    this.img = img;
    scale = 1;
  }
View Full Code Here

  @Override
  public ScreenPosition getScreenPosition(Location location) {
    synchronized (this) {
      float innerObjectXY[] = getInnerObjectFromLocation(location);
      return new ScreenPosition(getScreenFromInnerObjectPosition(innerObjectXY[0], innerObjectXY[1]));
    }
  }
View Full Code Here

  }

  public void draw() {
    map.draw();

    ScreenPosition topRight = map.getScreenPosition(visNorthWest);
    ScreenPosition bottomLeft = map.getScreenPosition(visSouthEast);

    float width = bottomLeft.x - topRight.x;
    float height = bottomLeft.y - topRight.y;

    tint(255, 127);
View Full Code Here

  }

  public void draw() {
    map.draw();

    ScreenPosition topRight = map.getScreenPosition(visNorthWest);
    ScreenPosition bottomLeft = map.getScreenPosition(visSouthEast);

    float width = bottomLeft.x - topRight.x;
    float height = bottomLeft.y - topRight.y;

    tint(255, 127);
View Full Code Here

    stroke(0, 200, 0, 200);
    strokeWeight(3);
    beginShape();
    synchronized (locations) {
      for (Location location : locations) {
        ScreenPosition pos = map.getScreenPosition(location);
        vertex(pos.x, pos.y);
      }
    }
    endShape();
View Full Code Here

  public void draw() {
    background(0);

    map.draw();

    ScreenPosition pos = map.mapDisplay.getScreenPosition(location);
    stroke(255, 0, 0);
    noFill();
    ellipse(pos.x, pos.y, 10, 10);
  }
View Full Code Here

  public void draw() {
    map.draw();
   
    if (lastZoomLocation != null) {
      // Animates a rectangle to indicate where the zoom happened
      ScreenPosition pos = map.getScreenPosition(lastZoomLocation);
      noFill();
      stroke(255, 0, 0, 200);
      rectMode(CENTER);
      rect(pos.x, pos.y, rectSize, rectSize);
      rectSize += rectSizeDiff;
View Full Code Here

   * @param y
   *            The y position in screen coordinates.
   * @return The geographic location with latitude and longitude.
   */
  public Location getLocation(float x, float y) {
    return mapDisplay.getLocation(new ScreenPosition(x, y));
  }
View Full Code Here

TOP

Related Classes of de.fhpotsdam.unfolding.utils.ScreenPosition

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.