Package de.fhpotsdam.unfolding.events

Examples of de.fhpotsdam.unfolding.events.EventDispatcher


    mapDetail.setTweening(true);
    mapDetail.zoomToLevel(4);
    mapOverview = new UnfoldingMap(this, "overview", 605, 10, 185, 185);
    mapOverview.setTweening(true);

    EventDispatcher eventDispatcher = new EventDispatcher();

    // Add mouse interaction to both maps
    MouseHandler mouseHandler = new MouseHandler(this, mapDetail, mapOverview);
    eventDispatcher.addBroadcaster(mouseHandler);

    // Maps listen to each other, i.e. each interaction in one map is reflected in the other
    eventDispatcher.register(mapDetail, "pan", mapDetail.getId(), mapOverview.getId());
    eventDispatcher.register(mapDetail, "zoom", mapDetail.getId(), mapOverview.getId());
    eventDispatcher.register(mapOverview, "pan", mapDetail.getId(), mapOverview.getId());
    eventDispatcher.register(mapOverview, "zoom", mapDetail.getId(), mapOverview.getId());
  }
View Full Code Here


    // Detail map with default mouse and keyboard interactions
    mapDetail = new UnfoldingMap(this, "detail", 10, 10, 585, 580);
    mapDetail.zoomToLevel(4);
    mapDetail.setZoomRange(4, 10);
    mapDetail.setTweening(true);
    EventDispatcher eventDispatcher = MapUtils.createDefaultEventDispatcher(this, mapDetail);

    // Overview map listens to interaction events from the detail map
    mapOverview = new UnfoldingMap(this, "overview", 605, 10, 185, 185);
    mapOverview.zoomToLevel(1);
    mapOverview.setZoomRange(1, 7);
    mapOverview.setTweening(true);
    eventDispatcher.register(mapOverview, "pan", mapDetail.getId());
    eventDispatcher.register(mapOverview, "zoom", mapDetail.getId());

    // Static overview map
    mapOverviewStatic = new UnfoldingMap(this, "overviewStatic", 605, 205, 185, 185);
  }
View Full Code Here

   * @param maps
   *            One or many maps.
   * @return The EventDispatcher to use for additional event handling.
   */
  public static EventDispatcher createDefaultEventDispatcher(PApplet p, UnfoldingMap... maps) {
    EventDispatcher eventDispatcher = new EventDispatcher();

    MouseHandler mouseHandler = new MouseHandler(p, maps);
    KeyboardHandler keyboardHandler = new KeyboardHandler(p, maps);

    eventDispatcher.addBroadcaster(mouseHandler);
    eventDispatcher.addBroadcaster(keyboardHandler);

    for (UnfoldingMap map : maps) {
      eventDispatcher.register(map, PanMapEvent.TYPE_PAN, map.getId());
      eventDispatcher.register(map, ZoomMapEvent.TYPE_ZOOM, map.getId());
    }

    return eventDispatcher;
  }
View Full Code Here

   * @param maps
   *            One or many maps.
   * @return The EventDispatcher to use for additional event handling.
   */
  public static EventDispatcher createMouseEventDispatcher(PApplet p, UnfoldingMap... maps) {
    EventDispatcher eventDispatcher = new EventDispatcher();

    MouseHandler mouseHandler = new MouseHandler(p, maps);

    eventDispatcher.addBroadcaster(mouseHandler);

    for (UnfoldingMap map : maps) {
      eventDispatcher.register(map, PanMapEvent.TYPE_PAN, map.getId());
      eventDispatcher.register(map, ZoomMapEvent.TYPE_ZOOM, map.getId());
    }

    return eventDispatcher;
  }
View Full Code Here

  public void setup() {
    size(800, 600, OPENGL);
    map = new UnfoldingMap(this, "myMap");

    EventDispatcher eventDispatcher = MapUtils.createDefaultEventDispatcher(this, map);
    // Register this PApplet to listen to map events
    eventDispatcher.register(this, "pan", map.getId());
    eventDispatcher.register(this, "zoom", map.getId());
  }
View Full Code Here

    map = new UnfoldingMap(this);
    map.setTweening(false);
    map.zoomAndPanTo(13, new Location(1.283f, 103.833f));
    map.setPanningRestriction(new Location(1.283f, 103.833f), 30);

    eventDispatcher = new EventDispatcher();

    tuioCursorHandler = new TuioCursorHandler(this, false, map);
    eventDispatcher.addBroadcaster(tuioCursorHandler);
    eventDispatcher.register(map, "pan");
    eventDispatcher.register(map, "zoom");
View Full Code Here

  public void setup() {
    size(800, 600);

    map = new UnfoldingMap(this);

    eventDispatcher = new EventDispatcher();
    MouseHandler mouseHandler = new MouseHandler(this, map);
    eventDispatcher.addBroadcaster(mouseHandler);
    listen();

    slider = new ZoomSlider(this, map, 50, 30);
View Full Code Here

  public void setup() {
    size(1240, 420, OPENGL);
    smooth();

    // Creates non-default dispatcher to register own broadcasters and listeners.
    eventDispatcher = new EventDispatcher();

    // Creates default mapDisplay
    UnfoldingMap map1 = new UnfoldingMap(this, "map1", 10, 10, 400, 400);
    map1.setTweening(false);
    map1.setActive(false);
View Full Code Here

    map = new UnfoldingMap(this);
    map.setTweening(false);
    map.zoomAndPanTo(13, new Location(54.5, 13.4));

    eventDispatcher = new EventDispatcher();

    tuioCursorHandler = new TuioCursorHandler(this, false, map);
    eventDispatcher.addBroadcaster(tuioCursorHandler);
     // Disable panning for single touch, to be able to handle it independently
    // eventDispatcher.register(map, "pan");
View Full Code Here

    }

    // Init the map
    map = new UnfoldingMap(this);

    EventDispatcher eventDispatcher = new EventDispatcher();
    // Create multitouch input handler, and register map to listen to pan and zoom events.
    tuioCursorHandler = new TuioCursorHandler(this, map);
    eventDispatcher.addBroadcaster(tuioCursorHandler);
    eventDispatcher.register(map, "pan");
    eventDispatcher.register(map, "zoom");
  }
View Full Code Here

TOP

Related Classes of de.fhpotsdam.unfolding.events.EventDispatcher

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.