devicemap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wk...@apache.org
Subject svn commit: r1749209 [1/7] - in /devicemap/trunk/examples/1.0/java/gwtcanvas: ./ .gwt/ .settings/ src/ src/org/ src/org/apache/ src/org/apache/devicemap/ src/org/apache/devicemap/gwt/ src/org/apache/devicemap/gwt/gwtcanvasdemo/ src/org/apache/devicemap...
Date Sun, 19 Jun 2016 21:56:47 GMT
Author: wkeil
Date: Sun Jun 19 21:56:46 2016
New Revision: 1749209

URL: http://svn.apache.org/viewvc?rev=1749209&view=rev
Log:
DMAP-153: Add a demo for HTML5 Canvas 

Task-Url: https://issues.apache.org/jira/browse/DMAP-153

Added:
    devicemap/trunk/examples/1.0/java/gwtcanvas/   (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/.classpath
    devicemap/trunk/examples/1.0/java/gwtcanvas/.gitignore
    devicemap/trunk/examples/1.0/java/gwtcanvas/.gwt/
    devicemap/trunk/examples/1.0/java/gwtcanvas/.gwt/.gwt-log
    devicemap/trunk/examples/1.0/java/gwtcanvas/.project
    devicemap/trunk/examples/1.0/java/gwtcanvas/.settings/
    devicemap/trunk/examples/1.0/java/gwtcanvas/.settings/com.google.gwt.eclipse.core.prefs
    devicemap/trunk/examples/1.0/java/gwtcanvas/.settings/org.eclipse.core.resources.prefs
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/DmapGwtCanvas.gwt.xml
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Ball.java
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/BallGroup.java
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/DmapGwtCanvas.java
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Lens.java
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Logo.java
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/LogoGroup.java
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/SpringObject.java
    devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Vector.java
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/DmapGwtCanvas.css
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/DmapGwtCanvas.html
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/   (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/.gitignore
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/lib/
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/lib/gwt-servlet.jar   (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/web.xml
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/1F3415A1E505353447A37AC06942BACA.cache.html
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/7FF5D1B42B099CE211B37843C6F0C06D.cache.html
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/ADBF2F8AC80D342B0419E68C9ED5DE95.cache.html
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/CA46384733F54DD5934866FB0CCC0B18.cache.html
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/E8CB2998FA92C29DF73EAF12F9511C08.cache.html
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/clear.cache.gif   (with
props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/images/
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/images/corner.png
  (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/images/corner_ie6.png
  (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/images/hborder.png
  (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/images/hborder_ie6.png
  (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/images/ie6/
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/images/ie6/corner_dialog_topleft.png
  (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/images/ie6/corner_dialog_topright.png
  (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/images/ie6/hborder_blue_shadow.png
  (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/images/ie6/hborder_gray_shadow.png
  (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/images/ie6/vborder_blue_shadow.png
  (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/images/ie6/vborder_gray_shadow.png
  (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/images/splitPanelThumb.png
  (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/images/vborder.png
  (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/images/vborder_ie6.png
  (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/standard.css
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwt/standard/standard_rtl.css
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/gwtcanvasdemo.nocache.js
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtcanvasdemo/hosted.html
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtlogo.png   (with props)
    devicemap/trunk/examples/1.0/java/gwtcanvas/war/gwtlogo40_40.png   (with props)

Propchange: devicemap/trunk/examples/1.0/java/gwtcanvas/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Jun 19 21:56:46 2016
@@ -0,0 +1 @@
+gwt-unitCache

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/.classpath
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/.classpath?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/.classpath (added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/.classpath Sun Jun 19 21:56:46 2016
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="lib" path="C:/Users/Werner/.m2/repository/org/apache/devicemap/devicemap-client/1.2.0-SNAPSHOT/devicemap-client-1.2.0-SNAPSHOT.jar"/>
+	<classpathentry kind="output" path="war/WEB-INF/classes"/>
+</classpath>

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/.gitignore
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/.gitignore?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/.gitignore (added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/.gitignore Sun Jun 19 21:56:46 2016
@@ -0,0 +1,3 @@
+/.gwt/
+/.settings/
+/gwt-unitCache/

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/.gwt/.gwt-log
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/.gwt/.gwt-log?rev=1749209&view=auto
==============================================================================
    (empty)

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/.project
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/.project?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/.project (added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/.project Sun Jun 19 21:56:46 2016
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>dmap-gwtcanvas</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>com.google.gwt.eclipse.core.gwtNature</nature>
+	</natures>
+</projectDescription>

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/.settings/com.google.gwt.eclipse.core.prefs
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/.settings/com.google.gwt.eclipse.core.prefs?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/.settings/com.google.gwt.eclipse.core.prefs
(added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/.settings/com.google.gwt.eclipse.core.prefs
Sun Jun 19 21:56:46 2016
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+filesCopiedToWebInfLib=gwt-servlet.jar
+gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+T0JGVVNDQVRFRDwvb3V0cHV0LXN0eWxlPjxleHRyYS1hcmdzPjwhW0NEQVRBW11dPjwvZXh0cmEtYXJncz48dm0tYXJncz48IVtDREFUQVstWG14NTEybV1dPjwvdm0tYXJncz48ZW50cnktcG9pbnQtbW9kdWxlPmNvbS5nb29nbGUuZ3d0Lmd3dGNhbnZhc2RlbW8uR3d0Q2FudmFzRGVtbzwvZW50cnktcG9pbnQtbW9kdWxlPjwvZ3d0LWNvbXBpbGUtc2V0dGluZ3M+

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/.settings/org.eclipse.core.resources.prefs
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/.settings/org.eclipse.core.resources.prefs?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/.settings/org.eclipse.core.resources.prefs
(added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/.settings/org.eclipse.core.resources.prefs
Sun Jun 19 21:56:46 2016
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/DmapGwtCanvas.gwt.xml
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/DmapGwtCanvas.gwt.xml?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/DmapGwtCanvas.gwt.xml
(added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/DmapGwtCanvas.gwt.xml
Sun Jun 19 21:56:46 2016
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 0.0.999//EN" "http://google-web-toolkit.googlecode.com/svn/tags/0.0.999/distro-source/core/src/gwt-module.dtd">
+<module rename-to='gwtcanvasdemo'>
+  <!-- Inherit the core Web Toolkit stuff.                        -->
+  <inherits name='com.google.gwt.user.User'/>
+
+  <!-- Inherit the default GWT style sheet.  You can change       -->
+  <!-- the theme of your GWT application by uncommenting          -->
+  <!-- any one of the following lines.                            -->
+  <inherits name='com.google.gwt.user.theme.standard.Standard'/>
+  <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
+  <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->
+
+  <!-- Other module inherits                                      -->
+
+  <!-- Specify the app entry point class.                         -->
+  <entry-point class='org.apache.devicemap.gwt.gwtcanvasdemo.client.DmapGwtCanvas'/>
+
+  <!-- Specify the paths for translatable code                    -->
+  <source path='client'/>
+  <source path='shared'/>
+
+</module>

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Ball.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Ball.java?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Ball.java
(added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Ball.java
Sun Jun 19 21:56:46 2016
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2016 Apache DeviceMap.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.devicemap.gwt.gwtcanvasdemo.client;
+
+import com.google.gwt.canvas.dom.client.Context2d;
+import com.google.gwt.canvas.dom.client.CssColor;
+
+public class Ball extends SpringObject {
+  public CssColor color;
+  public double posZ, velZ, goalZ;
+  public double radius;
+  public Vector startPos;
+  public double startPosZ;
+  public double startRadius;
+
+  public Ball(Vector start, double startPosZ, double radius, CssColor color) {
+    super(start);
+    this.color = color;
+    this.posZ = startPosZ;
+    this.velZ = 0;
+    this.goalZ = startPosZ;
+    this.radius = radius;
+    this.startPos = new Vector(start);
+    this.startPosZ = startPosZ;
+    this.startRadius = radius;
+  }
+  
+  public Ball(double x, double y, double z, double radius, String color) {
+    this(new Vector(x, y), z, radius, CssColor.make(color));
+  }
+  
+  public void update() {
+    super.update();
+    
+    Vector dh = Vector.sub(startPos, pos);
+    double dist = dh.mag();
+    goalZ = dist / 100.0 + 1.0;
+    double dgZ = goalZ - posZ;
+    double aZ = dgZ * springStrength;
+    velZ += aZ;
+    velZ *= friction;
+    posZ += velZ;
+    
+    radius = startRadius * posZ;
+    radius = radius < 1 ? 1 : radius;
+  }
+  
+  public void draw(Context2d context) {
+    context.setFillStyle(color);
+    context.beginPath();
+    context.arc(pos.x, pos.y, radius, 0, Math.PI * 2.0, true);
+    context.closePath();
+    context.fill();
+  }
+}

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/BallGroup.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/BallGroup.java?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/BallGroup.java
(added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/BallGroup.java
Sun Jun 19 21:56:46 2016
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2016 Apache DeviceMap.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.devicemap.gwt.gwtcanvasdemo.client;
+
+import com.google.gwt.canvas.dom.client.Context2d;
+
+import java.util.ArrayList;
+
+public class BallGroup {
+  final double width;
+  final double height;
+  Ball[] balls;
+  
+  public BallGroup(double width, double height) {
+    this.width = width;
+    this.height = height;
+    ArrayList<Ball> ballsArrayList = new ArrayList<Ball>(0);
+    
+    // init balls (values from Google's homepage)
+    ballsArrayList.add(new Ball(202, 78, 0, 9, "#ed9d33"));
+    ballsArrayList.add(new Ball(348, 83, 0, 9, "#d44d61"));
+    ballsArrayList.add(new Ball(256, 69, 0, 9, "#4f7af2"));
+    ballsArrayList.add(new Ball(214, 59, 0, 9, "#ef9a1e"));
+    ballsArrayList.add(new Ball(265, 36, 0, 9, "#4976f3"));
+    ballsArrayList.add(new Ball(300, 78, 0, 9, "#269230"));
+    ballsArrayList.add(new Ball(294, 59, 0, 9, "#1f9e2c"));
+    ballsArrayList.add(new Ball(45, 88, 0, 9, "#1c48dd"));
+    ballsArrayList.add(new Ball(268, 52, 0, 9, "#2a56ea"));
+    ballsArrayList.add(new Ball(73, 83, 0, 9, "#3355d8"));
+    ballsArrayList.add(new Ball(294, 6, 0, 9, "#36b641"));
+    ballsArrayList.add(new Ball(235, 62, 0, 9, "#2e5def"));
+    ballsArrayList.add(new Ball(353, 42, 0, 8, "#d53747"));
+    ballsArrayList.add(new Ball(336, 52, 0, 8, "#eb676f"));
+    ballsArrayList.add(new Ball(208, 41, 0, 8, "#f9b125"));
+    ballsArrayList.add(new Ball(321, 70, 0, 8, "#de3646"));
+    ballsArrayList.add(new Ball(8, 60, 0, 8, "#2a59f0"));
+    ballsArrayList.add(new Ball(180, 81, 0, 8, "#eb9c31"));
+    ballsArrayList.add(new Ball(146, 65, 0, 8, "#c41731"));
+    ballsArrayList.add(new Ball(145, 49, 0, 8, "#d82038"));
+    ballsArrayList.add(new Ball(246, 34, 0, 8, "#5f8af8"));
+    ballsArrayList.add(new Ball(169, 69, 0, 8, "#efa11e"));
+    ballsArrayList.add(new Ball(273, 99, 0, 8, "#2e55e2"));
+    ballsArrayList.add(new Ball(248, 120, 0, 8, "#4167e4"));
+    ballsArrayList.add(new Ball(294, 41, 0, 8, "#0b991a"));
+    ballsArrayList.add(new Ball(267, 114, 0, 8, "#4869e3"));
+    ballsArrayList.add(new Ball(78, 67, 0, 8, "#3059e3"));
+    ballsArrayList.add(new Ball(294, 23, 0, 8, "#10a11d"));
+    ballsArrayList.add(new Ball(117, 83, 0, 8, "#cf4055"));
+    ballsArrayList.add(new Ball(137, 80, 0, 8, "#cd4359"));
+    ballsArrayList.add(new Ball(14, 71, 0, 8, "#2855ea"));
+    ballsArrayList.add(new Ball(331, 80, 0, 8, "#ca273c"));
+    ballsArrayList.add(new Ball(25, 82, 0, 8, "#2650e1"));
+    ballsArrayList.add(new Ball(233, 46, 0, 8, "#4a7bf9"));
+    ballsArrayList.add(new Ball(73, 13, 0, 8, "#3d65e7"));
+    ballsArrayList.add(new Ball(327, 35, 0, 6, "#f47875"));
+    ballsArrayList.add(new Ball(319, 46, 0, 6, "#f36764"));
+    ballsArrayList.add(new Ball(256, 81, 0, 6, "#1d4eeb"));
+    ballsArrayList.add(new Ball(244, 88, 0, 6, "#698bf1"));
+    ballsArrayList.add(new Ball(194, 32, 0, 6, "#fac652"));
+    ballsArrayList.add(new Ball(97, 56, 0, 6, "#ee5257"));
+    ballsArrayList.add(new Ball(105, 75, 0, 6, "#cf2a3f"));
+    ballsArrayList.add(new Ball(42, 4, 0, 6, "#5681f5"));
+    ballsArrayList.add(new Ball(10, 27, 0, 6, "#4577f6"));
+    ballsArrayList.add(new Ball(166, 55, 0, 6, "#f7b326"));
+    ballsArrayList.add(new Ball(266, 88, 0, 6, "#2b58e8"));
+    ballsArrayList.add(new Ball(178, 34, 0, 6, "#facb5e"));
+    ballsArrayList.add(new Ball(100, 65, 0, 6, "#e02e3d"));
+    ballsArrayList.add(new Ball(343, 32, 0, 6, "#f16d6f"));
+    ballsArrayList.add(new Ball(59, 5, 0, 6, "#507bf2"));
+    ballsArrayList.add(new Ball(27, 9, 0, 6, "#5683f7"));
+    ballsArrayList.add(new Ball(233, 116, 0, 6, "#3158e2"));
+    ballsArrayList.add(new Ball(123, 32, 0, 6, "#f0696c"));
+    ballsArrayList.add(new Ball(6, 38, 0, 6, "#3769f6"));
+    ballsArrayList.add(new Ball(63, 62, 0, 6, "#6084ef"));
+    ballsArrayList.add(new Ball(6, 49, 0, 6, "#2a5cf4"));
+    ballsArrayList.add(new Ball(108, 36, 0, 6, "#f4716e"));
+    ballsArrayList.add(new Ball(169, 43, 0, 6, "#f8c247"));
+    ballsArrayList.add(new Ball(137, 37, 0, 6, "#e74653"));
+    ballsArrayList.add(new Ball(318, 58, 0, 6, "#ec4147"));
+    ballsArrayList.add(new Ball(226, 100, 0, 5, "#4876f1"));
+    ballsArrayList.add(new Ball(101, 46, 0, 5, "#ef5c5c"));
+    ballsArrayList.add(new Ball(226, 108, 0, 5, "#2552ea"));
+    ballsArrayList.add(new Ball(17, 17, 0, 5, "#4779f7"));
+    ballsArrayList.add(new Ball(232, 93, 0, 5, "#4b78f1"));
+    
+    // adjust sizes for this demo
+    double scale = 0.70f;
+    for (int i = ballsArrayList.size() - 1; i >= 0; i--) {
+      Ball ball = ballsArrayList.get(i);
+      ball.pos.x = width / 2 - scale * 180 + scale * ball.pos.x;
+      ball.pos.y = height / 2 - scale * 65 + scale * ball.pos.y;
+      ball.radius = scale * ball.radius;
+      ball.startRadius = scale * ball.startRadius;
+      ball.startPos.x = ball.pos.x;
+      ball.startPos.y = ball.pos.y;
+    }
+    
+    // add balls to array
+    balls = new Ball[ballsArrayList.size()];
+    for (int i = ballsArrayList.size() - 1; i >= 0; i--) {
+      Ball ball = ballsArrayList.get(i);
+      balls[i] = ball;
+    }
+  }
+  
+  public void update(double mouseX, double mouseY) {
+    Vector d = new Vector(0, 0);
+    for (int i = balls.length - 1; i >= 0; i--) {
+      Ball ball = balls[i];
+      d.x = mouseX - ball.pos.x;
+      d.y = mouseY - ball.pos.y;
+      if (d.magSquared() < 100*100) {
+        ball.goal = Vector.sub(ball.pos, d);
+      } else {
+        ball.goal.set(ball.startPos);
+      }
+      
+      ball.update();
+    }
+  }
+  
+  public void draw(Context2d context) {
+    for(int i = balls.length - 1; i >= 0; i--) {
+      balls[i].draw(context);
+    }
+  }
+}

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/DmapGwtCanvas.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/DmapGwtCanvas.java?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/DmapGwtCanvas.java
(added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/DmapGwtCanvas.java
Sun Jun 19 21:56:46 2016
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2016 Apache DeviceMap.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.devicemap.gwt.gwtcanvasdemo.client;
+
+import com.google.gwt.canvas.client.Canvas;
+import com.google.gwt.canvas.dom.client.Context2d;
+import com.google.gwt.canvas.dom.client.CssColor;
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.dom.client.Touch;
+import com.google.gwt.event.dom.client.GestureStartEvent;
+import com.google.gwt.event.dom.client.GestureStartHandler;
+import com.google.gwt.event.dom.client.MouseMoveEvent;
+import com.google.gwt.event.dom.client.MouseMoveHandler;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOutHandler;
+import com.google.gwt.event.dom.client.TouchEndEvent;
+import com.google.gwt.event.dom.client.TouchEndHandler;
+import com.google.gwt.event.dom.client.TouchMoveEvent;
+import com.google.gwt.event.dom.client.TouchMoveHandler;
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.RootPanel;
+
+public class DmapGwtCanvas implements EntryPoint {
+  static final String holderId = "canvasholder";
+
+  static final String upgradeMessage = "Your browser does not support the HTML5 Canvas. Please
upgrade your browser to view this demo.";
+
+  Canvas canvas;
+  Canvas backBuffer;
+  LogoGroup logoGroup;
+  BallGroup ballGroup;
+  Lens lens;
+  
+  // mouse positions relative to canvas
+  int mouseX, mouseY;
+
+  //timer refresh rate, in milliseconds
+  static final int refreshRate = 25;
+  
+  // canvas size, in px
+  static final int height = 400;
+  static final int width = 400;
+  
+  final CssColor redrawColor = CssColor.make("rgba(255,255,255,0.6)");
+  Context2d context;
+  Context2d backBufferContext;
+  
+  public void onModuleLoad() {
+    canvas = Canvas.createIfSupported();
+    backBuffer = Canvas.createIfSupported();
+    if (canvas == null) {
+      RootPanel.get(holderId).add(new Label(upgradeMessage));
+      return;
+    }
+
+    // init the canvases
+    canvas.setWidth(width + "px");
+    canvas.setHeight(height + "px");
+    canvas.setCoordinateSpaceWidth(width);
+    canvas.setCoordinateSpaceHeight(height);
+    backBuffer.setCoordinateSpaceWidth(width);
+    backBuffer.setCoordinateSpaceHeight(height);
+    RootPanel.get(holderId).add(canvas);
+    context = canvas.getContext2d();
+    backBufferContext = backBuffer.getContext2d();
+    
+    // init the objects
+    logoGroup = new LogoGroup(width, height, 18, 165);
+    ballGroup = new BallGroup(width, height);
+    lens = new Lens(35, 15, width, height, new Vector(320, 150), new Vector(1, 1));
+
+    // init handlers
+    initHandlers();
+    
+    // setup timer
+    final Timer timer = new Timer() {
+      @Override
+      public void run() {
+        doUpdate();
+      }
+    };
+    timer.scheduleRepeating(refreshRate);
+  }
+
+  void doUpdate() {
+    // update the back canvas
+    backBufferContext.setFillStyle(redrawColor);
+    backBufferContext.fillRect(0, 0, width, height);
+    logoGroup.update(mouseX, mouseY);
+    ballGroup.update(mouseX, mouseY);
+    logoGroup.draw(backBufferContext);
+    ballGroup.draw(backBufferContext);
+
+    // update the front canvas
+    lens.update();
+    lens.draw(backBufferContext, context);
+  }
+  
+  void initHandlers() {
+    canvas.addMouseMoveHandler(new MouseMoveHandler() {
+      public void onMouseMove(MouseMoveEvent event) {
+        mouseX = event.getRelativeX(canvas.getElement());
+        mouseY = event.getRelativeY(canvas.getElement());
+      }
+    });
+
+    canvas.addMouseOutHandler(new MouseOutHandler() {
+      public void onMouseOut(MouseOutEvent event) {
+        mouseX = -200;
+        mouseY = -200;
+      }
+    });
+
+    canvas.addTouchMoveHandler(new TouchMoveHandler() {
+      public void onTouchMove(TouchMoveEvent event) {
+        event.preventDefault();
+        if (event.getTouches().length() > 0) {
+          Touch touch = event.getTouches().get(0);
+          mouseX = touch.getRelativeX(canvas.getElement());
+          mouseY = touch.getRelativeY(canvas.getElement());
+        }
+        event.preventDefault();
+      }
+    });
+
+    canvas.addTouchEndHandler(new TouchEndHandler() {
+      public void onTouchEnd(TouchEndEvent event) {
+        event.preventDefault();
+        mouseX = -200;
+        mouseY = -200;
+      }
+    });
+
+    canvas.addGestureStartHandler(new GestureStartHandler() {
+      public void onGestureStart(GestureStartEvent event) {
+        event.preventDefault();
+      }
+    });
+  }
+}

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Lens.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Lens.java?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Lens.java
(added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Lens.java
Sun Jun 19 21:56:46 2016
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2016 Apache DeviceMap.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.devicemap.gwt.gwtcanvasdemo.client;
+
+import com.google.gwt.canvas.dom.client.CanvasPixelArray;
+import com.google.gwt.canvas.dom.client.Context2d;
+import com.google.gwt.canvas.dom.client.CssColor;
+import com.google.gwt.canvas.dom.client.FillStrokeStyle;
+import com.google.gwt.canvas.dom.client.ImageData;
+import com.google.gwt.core.client.GWT;
+
+import java.util.ArrayList;
+
+public class Lens {
+  final int radius;
+  final int mag;
+  final int width; // maximum bounds of canvases
+  final int height;
+  
+  Vector pos;
+  Vector vel;
+  int[][] lensArray;
+  
+  // color of lens outline
+  final FillStrokeStyle strokeStyle = CssColor.make("#333300");
+  
+  public Lens(int radius, int mag, int w, int h, Vector initPos, Vector vel) {
+    this.radius = radius;
+    this.mag = mag;
+    this.width = w;
+    this.height = h;
+    this.pos = initPos;
+    this.vel = vel;
+    
+    // calculate lens array
+    ArrayList<int[]> calcLensArray = new ArrayList<int[]>(0);
+    int a, b;
+    double s = Math.sqrt(radius*radius - mag*mag);
+    for (int y = -radius; y < radius; y++) {
+      for (int x = -radius; x < radius; x++) {
+        if(x*x + y*y < s*s) {
+          double z = Math.sqrt(radius*radius - x*x - y*y);
+          a = (int)(x * mag / z + 0.5);
+          b = (int)(y * mag / z + 0.5);
+          int dstIdx = (y + radius) * 2 * radius + (x + radius);
+          int srcIdx = (b + radius) * 2 * radius + (a + radius);
+          calcLensArray.add(new int[]{dstIdx, srcIdx});
+        }
+      }
+    }
+    // store lens array in an int array
+    lensArray = new int[calcLensArray.size()][2];
+    for(int i = 0; i < calcLensArray.size(); i++) {
+      int[] fromTo = calcLensArray.get(i);
+      lensArray[i][0] = fromTo[0];
+      lensArray[i][1] = fromTo[1];
+    }
+  }
+  
+  public void update() {
+    if (pos.x + radius + vel.x > width || pos.x - radius + vel.x < 0) {
+      vel.x *= -1;
+    }
+    if (pos.y + radius + vel.y > height || pos.y - radius + vel.y < 0) {
+      vel.y *= -1;
+    }
+    
+    pos.x += vel.x;
+    pos.y += vel.y;
+  }
+  
+  public void draw(Context2d back, Context2d front) {
+    front.drawImage(back.getCanvas(), 0, 0);
+    
+    if (!GWT.isScript()) {
+      // in devmode this effect is slow so we disable it here
+    } else {
+      ImageData frontData = front.getImageData((int)(pos.x - radius), (int)(pos.y - radius),
2 * radius, 2 * radius);
+      CanvasPixelArray frontPixels = frontData.getData();
+      ImageData backData = back.getImageData((int)(pos.x - radius), (int)(pos.y - radius),
2 * radius, 2 * radius);
+      CanvasPixelArray backPixels = backData.getData();
+      int srcIdx, dstIdx;
+      for(int i = lensArray.length - 1; i >= 0 ; i--) {
+        dstIdx = 4 * lensArray[i][0];
+        srcIdx = 4 * lensArray[i][1];
+        frontPixels.set(dstIdx + 0, backPixels.get(srcIdx + 0));
+        frontPixels.set(dstIdx + 1, backPixels.get(srcIdx + 1));
+        frontPixels.set(dstIdx + 2, backPixels.get(srcIdx + 2));
+      }
+      front.putImageData(frontData, (int)(pos.x - radius), (int)(pos.y - radius));
+    }
+    
+    front.setStrokeStyle(strokeStyle);
+    front.beginPath();
+    front.arc(pos.x, pos.y, radius, 0, Math.PI * 2, true);
+    front.closePath();
+    front.stroke();
+  }
+}

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Logo.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Logo.java?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Logo.java
(added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Logo.java
Sun Jun 19 21:56:46 2016
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2016 Apache DeviceMap.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.devicemap.gwt.gwtcanvasdemo.client;
+
+import com.google.gwt.canvas.dom.client.Context2d;
+import com.google.gwt.dom.client.ImageElement;
+
+public class Logo extends SpringObject {
+  ImageElement image;
+  double rot;
+
+  Logo(ImageElement image) {
+    super(new Vector(0,0));
+    this.image = image;
+    this.rot = 0;
+  }
+  
+  void draw(Context2d context) {
+    context.save();
+    context.translate(this.pos.x, this.pos.y);
+    context.rotate(rot);
+    context.drawImage(image, 0, 0);
+    context.restore();
+  }
+}

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/LogoGroup.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/LogoGroup.java?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/LogoGroup.java
(added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/LogoGroup.java
Sun Jun 19 21:56:46 2016
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2016 Apache DeviceMap.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.devicemap.gwt.gwtcanvasdemo.client;
+
+import com.google.gwt.canvas.dom.client.Context2d;
+import com.google.gwt.dom.client.ImageElement;
+import com.google.gwt.event.dom.client.LoadEvent;
+import com.google.gwt.event.dom.client.LoadHandler;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.RootPanel;
+
+public class LogoGroup {
+  final double width;
+  final double height;
+  final int numLogos;
+  final double radius;
+  Image logoImg;
+  Logo[] logos;
+  boolean imageLoaded;
+  
+  double k;
+  
+  public LogoGroup(double width, double height, int numLogos, double radius) {
+    this.width = width;
+    this.height = height;
+    this.numLogos = numLogos;
+    this.radius = radius;
+
+    // init logos array
+    logos = new Logo[numLogos];
+    
+    // init image
+    logoImg = new Image("gwtlogo40_40.png");
+    logoImg.addLoadHandler(new LoadHandler() {
+      public void onLoad(LoadEvent event) {
+        imageLoaded = true;
+        // once image is loaded, init logo objects
+        ImageElement imageElement = (ImageElement) logoImg.getElement().cast();
+        for (int i = logos.length - 1; i >= 0; i--) {
+          Logo logo = new Logo(imageElement);
+          logo.pos.x = LogoGroup.this.width / 2;
+          logo.pos.y = LogoGroup.this.height / 2;
+          logos[i] = logo;
+        }
+      }
+    });
+    logoImg.setVisible(false);
+    RootPanel.get().add(logoImg); // image must be on page to fire load
+  }
+  
+  public void update(double mouseX, double mouseY) {
+    if (!imageLoaded) {
+      return;
+    }
+    
+    k = (k + Math.PI/2.0* 0.009);
+    
+    for (int i = numLogos - 1; i >= 0; i--) {
+      Logo logo = logos[i];
+      double logoPerTPi = 2 * Math.PI * i / numLogos;
+      Vector goal = new Vector(width / 2 + radius * Math.cos(k + logoPerTPi), 
+          height / 2 + radius * Math.sin(k + logoPerTPi));
+      logo.goal.set(goal);
+      logo.rot = k + logoPerTPi + Math.PI / 2.0;
+      
+      Vector d = new Vector(mouseX, mouseY);
+      d.sub(logo.pos);
+      if (d.magSquared() < 50*50) {
+        logo.goal = Vector.sub(logo.pos, d);
+      }
+      
+      logo.update();
+    }
+  }
+  
+  public void draw(Context2d context) {
+    if (!imageLoaded) {
+      return;
+    }
+    
+    for (int i = numLogos - 1; i >= 0; i--) {
+      logos[i].draw(context);
+    }
+  }
+}

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/SpringObject.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/SpringObject.java?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/SpringObject.java
(added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/SpringObject.java
Sun Jun 19 21:56:46 2016
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2016 Apache DeviceMap.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.devicemap.gwt.gwtcanvasdemo.client;
+
+public class SpringObject {
+  public static final double springStrength = 0.1;
+  public static final double friction = 0.8;
+  public Vector pos, vel, goal;
+  
+  public SpringObject(Vector start) {
+    this.pos = new Vector(start);
+    this.vel = new Vector(0, 0);
+    this.goal = new Vector(start);
+  }
+  
+  public void update() {
+    Vector d = Vector.sub(goal, pos);
+    d.mult(springStrength);
+    vel.add(d);
+    vel.mult(friction);
+    pos.add(vel);
+  }
+}

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Vector.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Vector.java?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Vector.java
(added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/src/org/apache/devicemap/gwt/gwtcanvasdemo/client/Vector.java
Sun Jun 19 21:56:46 2016
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2016 Apache DeviceMap.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.devicemap.gwt.gwtcanvasdemo.client;
+
+public class Vector {
+  public double x, y;
+  
+  public Vector() {
+    this(0, 0);
+  }
+  
+  public Vector(double x, double y) {
+    this.x = x;
+    this.y = y;
+  }
+  
+  public Vector(Vector v) {
+    this(v.x, v.y);
+  }
+  
+  public void add(double x, double y) {
+    this.x += x;
+    this.y += y;
+  }
+  
+  public void add(Vector v) {
+    add(v.x, v.y);
+  }
+  
+  public void sub(Vector v) {
+    sub(v.x, v.y);
+  }
+  
+  public void sub(double x, double y) {
+    this.x -= x;
+    this.y -= y;
+  }
+  
+  public void mult(double x, double y) {
+    this.x *= x;
+    this.y *= y;
+  }
+  
+  public void mult(Vector v) {
+    mult(v.x, v.y);
+  }
+  
+  public void mult(double c) {
+    mult(c, c);
+  }
+  
+  public double mag() {
+    if (x == 0 && y == 0) {
+      return 0;
+    } else {
+      return Math.sqrt(x * x + y * y);
+    }
+  }
+  
+  public double magSquared() {
+    return x * x + y * y;
+  }
+  
+  public void set(Vector v) {
+    x = v.x;
+    y = v.y;
+  }
+  
+  public static Vector sub(Vector a, Vector b) {
+    return new Vector(a.x - b.x, a.y - b.y);
+  }
+  
+  public static Vector mult(Vector v, double c) {
+    return new Vector(v.x * c, v.y * c);
+  }
+}

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/war/DmapGwtCanvas.css
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/war/DmapGwtCanvas.css?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/war/DmapGwtCanvas.css (added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/war/DmapGwtCanvas.css Sun Jun 19 21:56:46
2016
@@ -0,0 +1,23 @@
+body {
+  text-align: center;
+  margin: 0px;
+  padding: 0px;
+}
+
+h1 {
+  font-size: 2em;
+  font-weight: bold;
+  color: #777777;
+  margin: 10px 0px 10px;
+  text-align: center;
+}
+
+#source {
+  font-size: 1em;
+  color: #777777;
+  text-align: center;
+}
+
+#source a {
+  text-decoration: none;
+}
\ No newline at end of file

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/war/DmapGwtCanvas.html
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/war/DmapGwtCanvas.html?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/war/DmapGwtCanvas.html (added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/war/DmapGwtCanvas.html Sun Jun 19 21:56:46
2016
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+  <head>
+    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+    <meta name="viewport" content="width=device-width, user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-cache" /> 
+    <link type="text/css" rel="stylesheet" href="DmapGwtCanvas.css">
+    <title>GWT Canvas Demo</title>
+    <script type="text/javascript" language="javascript" src="gwtcanvasdemo/gwtcanvasdemo.nocache.js"></script>
+  </head>
+  <body>
+    <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
+    <noscript>
+      <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color:
red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
+        Your web browser must have JavaScript enabled
+        in order for this application to display correctly.
+      </div>
+    </noscript>
+
+    <h1>GWT Canvas Demo</h1>
+    <div id="canvasholder"></div>
+    <br/>
+    <span id="source">
+    <a href="http://code.google.com/p/gwtcanvasdemo/source/browse/#svn%2Ftrunk%2Fsrc%2Fcom%2Fgoogle%2Fgwt%2Fgwtcanvasdemo%2Fclient">View
the source</a>
+    </span>
+  </body>
+</html>

Propchange: devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Jun 19 21:56:46 2016
@@ -0,0 +1,2 @@
+deploy
+classes

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/.gitignore
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/.gitignore?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/.gitignore (added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/.gitignore Sun Jun 19 21:56:46
2016
@@ -0,0 +1 @@
+/classes/

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/lib/gwt-servlet.jar
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/lib/gwt-servlet.jar?rev=1749209&view=auto
==============================================================================
Binary file - no diff available.

Propchange: devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/lib/gwt-servlet.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/web.xml?rev=1749209&view=auto
==============================================================================
--- devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/web.xml (added)
+++ devicemap/trunk/examples/1.0/java/gwtcanvas/war/WEB-INF/web.xml Sun Jun 19 21:56:46 2016
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app
+    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+    "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+  <!-- Default page to serve -->
+  <welcome-file-list>
+    <welcome-file>DmapGwtCanvas.html</welcome-file>
+  </welcome-file-list>
+</web-app>




Mime
View raw message