Package de.fhpotsdam.unfolding.utils

Examples of de.fhpotsdam.unfolding.utils.ScreenPosition


    fill(255, 0, 0, 100);
    noStroke();
    float maxSize = map(map.getZoomLevel(), 0, 6, 4, 40);
    for (Feature feature : features) {
      PointFeature pf = (PointFeature) feature;
      ScreenPosition pos = map.getScreenPosition(pf.getLocation());
      pushMatrix();
      translate(pos.x, pos.y);
      float magnitude = (Float) feature.getProperty("magnitude");
      if (useColorCoding) {
        int color = mapToColor(magnitude);
View Full Code Here


    translate(-width/2, -height/2);
    map.draw();

    mousePos = getMouse3D();

    ScreenPosition pos1 = map.getScreenPosition(berlinLocation);
    ScreenPosition pos2 = map.getScreenPosition(hamburgLocation);
    ScreenPosition pos4 = map.getScreenPosition(warsawLocation);

    noFill();
    stroke(20, 20, 200, 50);
    strokeWeight(2);
    // Draw full bezier
View Full Code Here

    translate(0, -160, -100);
    map.draw();

    mousePos = getMouse3D();

    ScreenPosition pos1 = map.getScreenPosition(berlinLocation);
    ScreenPosition pos2 = map.getScreenPosition(hamburgLocation);
    ScreenPosition pos3 = map.getScreenPosition(munichLocation);
    ScreenPosition warsawPos = map.getScreenPosition(warsawLocation);

    noFill();
    stroke(255, 0, 0, 100);
    strokeWeight(6);
   
View Full Code Here

    fill(255, 0, 0, 100);
    noStroke();
    float maxSize = map(map.getZoomLevel(), 0, 6, 4, 40);
    for (Feature feature : features) {
      PointFeature pf = (PointFeature) feature;
      ScreenPosition pos = map.getScreenPosition(pf.getLocation());
      float magnitude = (Float) feature.getProperty("magnitude");
      float s = map(magnitude, 4, 8, 4, maxSize);
      beginShape(QUAD);
      vertex(pos.x, pos.y, 5);
      vertex(pos.x + s, pos.y, 5);
View Full Code Here

    mousePos = getMouse3D();

    fill(255, 0, 0, 100);
    noStroke();
    ScreenPosition hamburgPos = map.getScreenPosition(hamburgLocation);
    translate(hamburgPos.x, hamburgPos.y);
    sphere(20);

    popMatrix();
View Full Code Here

    translate(0, -160, -100);
    map.draw();

    mousePos = getMouse3D();
   
    ScreenPosition pos1 = map.getScreenPosition(berlinLocation);
    ScreenPosition pos2 = map.getScreenPosition(hamburgLocation);
    ScreenPosition pos3 = map.getScreenPosition(munichLocation);
    ScreenPosition warsawPos = map.getScreenPosition(warsawLocation);

    noFill();
    stroke(255, 0, 0, 100);
    strokeWeight(6);
    drawBezier(pos1, pos2);
View Full Code Here

    map.draw();

    for (Marker marker : markers) {
      DateTime markerTime = new DateTime(marker.getProperty("date"));
      if (markerTime.isBefore(currentTime)) {
        ScreenPosition pos = map.getScreenPosition(marker.getLocation());
        drawGrowingEarthquakeDots(pos, markerTime);
      }
    }

    // Each 4 frame (and if currently animating)
View Full Code Here

    for (Marker marker : markers) {
      DateTime markerTime = new DateTime(marker.getStringProperty("date"));
      // Check if earthquake has occurred before current time, i.e. visible
      if (markerTime.isBefore(currentTime)) {
        ScreenPosition pos = map.getScreenPosition(marker.getLocation());
        drawEarthquakeMarker(pos);
      }
    }

    // Every 10 frames increase current time by 1h
View Full Code Here

    Location location = map.getLocation(mouseX, mouseY);
    text("geo:" + location.toString(), mouseX, mouseY);

    // Shows marker at Berlin location
    Location loc = new Location(52.5f, 13.4f);
    ScreenPosition pos = map.getScreenPosition(loc);
    ellipse(pos.x, pos.y, 20, 20);

    String berlinDescription = "Berlin at pixel (" + (int) pos.x + "," + (int) pos.y + ")";
    text(berlinDescription, pos.x, pos.y);
  }
View Full Code Here

  public void restrictPanning() {
    Location mapTopLeft = map.getTopLeftBorder();
    Location mapBottomRight = map.getBottomRightBorder();

    ScreenPosition mapTopLeftPos = map.getScreenPosition(mapTopLeft);
    ScreenPosition boundTopLeftPos = map.getScreenPosition(boundTopLeft);
    if (boundTopLeft.getLon() > mapTopLeft.getLon()) {
      map.panBy(mapTopLeftPos.x - boundTopLeftPos.x, 0);
    }
    if (boundTopLeft.getLat() < mapTopLeft.getLat()) {
      map.panBy(0, mapTopLeftPos.y - boundTopLeftPos.y);
    }

    ScreenPosition mapBottomRightPos = map.getScreenPosition(mapBottomRight);
    ScreenPosition boundBottomRightPos = map.getScreenPosition(boundBottomRight);
    if (boundBottomRight.getLon() < mapBottomRight.getLon()) {
      map.panBy(mapBottomRightPos.x - boundBottomRightPos.x, 0);
    }
    if (boundBottomRight.getLat() > mapBottomRight.getLat()) {
      map.panBy(0, mapBottomRightPos.y - boundBottomRightPos.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.