DOCUMENT Elastic.as and MapEvent.as.
authorSteve Bennett <stevagewp@gmail.com>
Sat, 5 Feb 2011 12:43:16 +0000 (12:43 +0000)
committerSteve Bennett <stevagewp@gmail.com>
Sat, 5 Feb 2011 12:43:16 +0000 (12:43 +0000)
net/systemeD/halcyon/Elastic.as
net/systemeD/halcyon/MapEvent.as

index 2cd8ad9..f0daa9d 100644 (file)
@@ -12,6 +12,7 @@ package net.systemeD.halcyon {
        import net.systemeD.halcyon.styleparser.*;
     import net.systemeD.halcyon.connection.*;
 
+       /** The elastic is a visual indication of a way that the user is currently in the process of drawing. */
        public class Elastic {
 
                public var map:Map;                                                     // reference to parent map
@@ -19,6 +20,7 @@ package net.systemeD.halcyon {
         private var _start:Point;
         private var _end:Point;
 
+               /** Create and draw the elastic. */
                public function Elastic(map:Map, start:Point, end:Point) {
                        this.map = map;
                        this._start = start;
@@ -44,20 +46,18 @@ package net.systemeD.halcyon {
                    return _end;
                }
                
+               /** Remove all currently existing sprites */
                public function removeSprites():void {
-                       // Remove all currently existing sprites
+                       
                        while (sprites.length>0) {
                                var d:DisplayObject=sprites.pop(); d.parent.removeChild(d);
                        }
         }
         
+               /** Draws the elastic - a dashed line on the highest paint layer. */
                public function redraw():void {
                    removeSprites();
 
-                       // Iterate through each sublayer, drawing any styles on that layer
-                       var p0:Point = start;
-                       var p1:Point = end;
-
                        // Create stroke object
                        var stroke:Shape = new Shape();
             stroke.graphics.lineStyle(1, 0xff0000, 1, false, "normal", CapsStyle.ROUND, JointStyle.ROUND);
index efb0852..da51402 100644 (file)
@@ -5,17 +5,26 @@ package net.systemeD.halcyon {
     /** Defines map-related events. */
     public class MapEvent extends Event {
 
+               /** Data has been requested for download. */
                public static const DOWNLOAD:String = "download";
+               /** Viewport size has changed. */
                public static const RESIZE:String = "resize";
+               /** Map has moved relative to viewport. */
                public static const MOVE:String = "move";
+               /** Zoom level has changed. */
                public static const SCALE:String = "scale";
+               /** Background imagery has moved relative to map. */
                public static const NUDGE_BACKGROUND:String = "nudge_background";
+        /** Map has been created and is ready, although data is not yet downloaded. */
         public static const INITIALISED:String = "initialized";
+               /** Backrgound imagery has changed to one with attribution that must not be obscured. */
                public static const BUMP:String = "bump";
                public static const ERROR:String = "error";                             // ** FIXME - this should be a dedicated ErrorEvent class
 
+               /** Event-specific parameters. */
                public var params:Object;
 
+        /** Creates event with name given by a constant, with event-specific parameters. */
         public function MapEvent(eventname:String, params:Object) {
             super(eventname);
             this.params=params;