Examples of PanMapEvent


Examples of de.fhpotsdam.unfolding.events.PanMapEvent

          // FIXME Use toLocation instead of panLeft, etc to allow listening maps to pan
          // correctly.
          if (keyCode == PConstants.LEFT || keyCode == PConstants.RIGHT || keyCode == PConstants.UP
              || keyCode == PConstants.DOWN) {
            PanMapEvent panMapEvent = new PanMapEvent(this, map.getId());
            switch (keyCode) {
            case PConstants.LEFT:
              panMapEvent.setSubType(PanMapEvent.PAN_LEFT);
              break;
            case PConstants.RIGHT:
              panMapEvent.setSubType(PanMapEvent.PAN_RIGHT);
              break;
            case PConstants.UP:
              panMapEvent.setSubType(PanMapEvent.PAN_UP);
              break;
            case PConstants.DOWN:
              panMapEvent.setSubType(PanMapEvent.PAN_DOWN);
              break;
            }
            eventDispatcher.fireMapEvent(panMapEvent);
          }
        }
View Full Code Here

Examples of de.fhpotsdam.unfolding.events.PanMapEvent

  }

  public void keyPressed() {
    if (key == ' ') {
      log.debug("programmed: fire panTo + zoomTo");
      PanMapEvent panMapEvent = new PanMapEvent(this, maps.get(0).getId());
      Location location = new Location(52.4115f, 13.0516f);
      panMapEvent.setToLocation(location);
      eventDispatcher.fireMapEvent(panMapEvent);
      ZoomMapEvent zoomMapEvent = new ZoomMapEvent(this, maps.get(0).getId());
      zoomMapEvent.setSubType("zoomTo");
      zoomMapEvent.setZoomLevel(14);
      eventDispatcher.fireMapEvent(zoomMapEvent);
View Full Code Here

Examples of de.fhpotsdam.unfolding.events.PanMapEvent

            Location fromLocation = map.mapDisplay.getLocation(oldTuioPoint.getScreenX(p.width),
                oldTuioPoint.getScreenY(p.height));
            Location toLocation = map.mapDisplay.getLocation(tuioCursor1.getScreenX(p.width),
                tuioCursor1.getScreenY(p.height));

            PanMapEvent panMapEvent = new PanMapEvent(this, map.getId(), PanMapEvent.PAN_BY);
            panMapEvent.setFromLocation(fromLocation);
            panMapEvent.setToLocation(toLocation);
            eventDispatcher.fireMapEvent(panMapEvent);
          }
        }
      }
    }
View Full Code Here

Examples of de.fhpotsdam.unfolding.events.PanMapEvent

    for (UnfoldingMap map : maps) {
      if (map.isHit(mouseX, mouseY)) {
        if (mouseButton == PConstants.LEFT && mouseEvent.getCount() == 2) {

          // Pan + Zoom (order is important)
          PanMapEvent panMapEvent = new PanMapEvent(this, map.getId());
          Location location = map.getLocation(mouseX, mouseY);
          panMapEvent.setToLocation(location);
          eventDispatcher.fireMapEvent(panMapEvent);

          ZoomMapEvent zoomMapEvent = new ZoomMapEvent(this, map.getId(), ZoomMapEvent.ZOOM_BY_LEVEL, 1);
          zoomMapEvent.setTransformationCenterLocation(location);
          eventDispatcher.fireMapEvent(zoomMapEvent);
View Full Code Here

Examples of de.fhpotsdam.unfolding.events.PanMapEvent

          // Pan between two locations, so other listening maps can pan correctly

          Location oldLocation = map.getLocation(pmouseX, pmouseY);
          Location newLocation = map.getLocation(mouseX, mouseY);

          PanMapEvent panMapEvent = new PanMapEvent(this, map.getId(), PanMapEvent.PAN_BY);
          panMapEvent.setFromLocation(oldLocation);
          panMapEvent.setToLocation(newLocation);
          eventDispatcher.fireMapEvent(panMapEvent);
        }
      }
    }
  }
View Full Code Here

Examples of de.fhpotsdam.unfolding.events.PanMapEvent

  public void mouseReleased() {
    if (mouseX > 610 && mouseX < 790 && mouseY > 210 && mouseY < 290) {
      // mapDetail.zoomAndPanTo() would not update mapOverview

      PanMapEvent panMapEvent = new PanMapEvent(this, mapDetail.getId());
      panMapEvent.setToLocation(berlinLocation);
      eventDispatcher.fireMapEvent(panMapEvent);

      ZoomMapEvent zoomMapEvent = new ZoomMapEvent(this, mapDetail.getId(), ZoomMapEvent.ZOOM_TO_LEVEL);
      zoomMapEvent.setZoomLevel(berlinZoomLevel);
      zoomMapEvent.setTransformationCenterLocation(berlinLocation);
      eventDispatcher.fireMapEvent(zoomMapEvent);


      // TODO Create convenience methods to fire map events.
      // MapUtils.fireZoomEvent(eventDispatcher, mapDetail, ZoomMapEvent.ZOOM_TO_LEVEL, berlinZoomLevel);
      // MapUtils.firePanEvent(eventDispatcher, mapDetail, berlinLocation);

    } else if (mouseX > 610 && mouseX < 790 && mouseY > 310 && mouseY < 390) {
      PanMapEvent panMapEvent = new PanMapEvent(this, mapDetail.getId());
      panMapEvent.setToLocation(universityLocation);
      eventDispatcher.fireMapEvent(panMapEvent);

      ZoomMapEvent zoomMapEvent = new ZoomMapEvent(this, mapDetail.getId(), ZoomMapEvent.ZOOM_TO_LEVEL);
      zoomMapEvent.setZoomLevel(universityZoomLevel);
      zoomMapEvent.setTransformationCenterLocation(universityLocation);
View Full Code Here

Examples of de.fhpotsdam.unfolding.events.PanMapEvent

    tint(255, 255);
    mapGoogleSmallSat.draw();
  }

  public void zoomAndPanTo(Location location) {
    PanMapEvent panMapEvent = new PanMapEvent(this, mapOSM.getId());
    panMapEvent.setToLocation(location);
    eventDispatcher.fireMapEvent(panMapEvent);
    ZoomMapEvent zoomMapEvent = new ZoomMapEvent(this, mapOSM.getId(), ZoomMapEvent.ZOOM_TO_LEVEL);
    zoomMapEvent.setTransformationCenterLocation(location);
    zoomMapEvent.setZoomLevel(10);
    eventDispatcher.fireMapEvent(zoomMapEvent);
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.