package de.fhpotsdam.unfolding.examples;

import processing.core.PApplet;
import codeanticode.glgraphics.GLConstants;
import de.fhpotsdam.unfolding.Map;
import de.fhpotsdam.unfolding.geo.Location;
import de.fhpotsdam.unfolding.utils.MapUtils;

public class SimpleMapApp extends PApplet {

	Map map;

	public void setup() {
		size(800, 600, GLConstants.GLGRAPHICS);

		map = new Map(this);
		map.zoomAndPanTo(new Location(52.5f, 13.4f), 10);

		MapUtils.createDefaultEventDispatcher(this, map);
	}

	public void draw() {
		background(0);
		map.draw();
	}

	public static void main(String[] args) {
		PApplet.main(new String[] { "de.fhpotsdam.unfolding.examples.SimpleMapApp" });
	}

}

@@ -241,261 +241,1490 @@
 s;%0A%0A
-public class SimpleMapApp extends PApplet %7B%0A%0A%09Map map;%0A%0A%09public void setup() %7B%0A%09%09size(800, 600, GLConstants.GLGRAPHICS);%0A%0A%09%09map = new Map(this);%0A%09%09map.zoomAndPanTo(new Location(52.5f, 13.4f), 10);%0A%0A%09%09MapUtils.createDefaultEventDispatcher(this, map);%0A%09%7D%0A
+/**%0A * This demonstrates how to create a simple application with Unfolding.%0A *%0A * You get a map in which you can do the things you expect: move, zoom, etc.%0A *%0A * In order to get an Unfolding app your main class needs to inherit from%0A * PApplet and implement setup() and draw().%0A */%0Apublic class SimpleMapApp extends PApplet %7B%0A%0A%09/**%0A%09 * Map is the main concept of Unfolding. It represents a map and offers lots%0A%09 * of functionality: zooming, panning, moving, translating cursor positions%0A%09 * to geo positions (Location), translating Location to cursor position, and%0A%09 * much more.%0A%09 */%0A%09Map map;%0A%0A%09/**%0A%09 * setup() gets called at the beginning. Here you shoud setup/initialize%0A%09 * your Unfolding stuff.%0A%09 */%0A%09public void setup() %7B%0A%09%09// set the display to 800x600 and use OpenGL acceleration%0A%09%09size(800, 600, GLConstants.GLGRAPHICS);%0A%09%09// if your computer does not offer OpenGL acceleration use the following%0A%09%09// line instead%0A%09%09//size(800, 600);%0A%0A%09%09// Here we actually create a the map and pass this. This way map knows%0A%09%09// where to%0A%09%09// draw on%0A%09%09map = new Map(this);%0A%0A%09%09// Then we zoom to a Location with given latitude and longtitude%0A%09%09map.zoomAndPanTo(new Location(52.5f, 13.4f), 10);%0A%0A%09%09// In order to have the expected behavior (movement and zooming with%0A%09%09// mouse and keyboard)%0A%09%09// default events get registered with the following function.%0A%09%09MapUtils.createDefaultEventDispatcher(this, map);%0A%09%7D%0A%0A%09/**%0A%09 * The draw function gets called periodically and needs to redraw.%0A%09 */
 %0A%09pu
@@ -1748,22 +1748,30 @@
 %7B%0A%09%09
-background(0);
+// Simply draw the map
 %0A%09%09m
@@ -1827,16 +1827,61 @@
 args) %7B%0A
+%09%09// Here we start the actual Unfolding part%0A
 %09%09PApple
@@ -1960,7 +1960,5 @@
 %0A%09%7D%0A
-%0A%7D%0A
+%7D

Add documentation to SimpleMapApp