[OpenLayers-Commits] r3623 - in sandbox/euzuro/untiled3/lib/OpenLayers: . Handler

commits at openlayers.org commits at openlayers.org
Fri Jul 6 15:05:15 EDT 2007


Author: euzuro
Date: 2007-07-06 15:05:14 -0400 (Fri, 06 Jul 2007)
New Revision: 3623

Modified:
   sandbox/euzuro/untiled3/lib/OpenLayers/Events.js
   sandbox/euzuro/untiled3/lib/OpenLayers/Handler.js
   sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Drag.js
   sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Keyboard.js
   sandbox/euzuro/untiled3/lib/OpenLayers/Handler/MouseWheel.js
   sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Path.js
   sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Polygon.js
Log:
bringing up latest from trunk

Modified: sandbox/euzuro/untiled3/lib/OpenLayers/Events.js
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/Events.js	2007-07-06 18:30:09 UTC (rev 3622)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/Events.js	2007-07-06 19:05:14 UTC (rev 3623)
@@ -224,7 +224,6 @@
 
     /**
      * Method: _removeElementObservers
-     * *Private*.
      *
      * Parameters:
      * elementObservers - {Array(Object)} Array of (element, name, 
@@ -380,7 +379,7 @@
 	eventHandler: null,
 
     /** 
-	 * Property: fallThrough 
+	 * APIProperty: fallThrough 
 	 * {Boolean} 
 	 */
 	fallThrough: null,
@@ -394,7 +393,7 @@
      * added element - {DOMElement} A dom element to respond to browser events
      * eventTypes - {Array} Array of custom application events 
      * fallThrough - {Boolean} Allow events to fall through after these have
-     * been handled?
+     *                         been handled?
      */
     initialize: function (object, element, eventTypes, fallThrough) {
         this.object     = object;
@@ -411,7 +410,7 @@
         // custom application event.
         if (this.eventTypes != null) {
             for (var i = 0; i < this.eventTypes.length; i++) {
-                this.listeners[ this.eventTypes[i] ] = new Array();
+                this.addEventType(this.eventTypes[i]);
             }
         }
         
@@ -423,7 +422,7 @@
     },
 
     /**
-     * Method: destroy
+     * APIMethod: destroy
      */
     destroy: function () {
         if (this.element) {
@@ -439,6 +438,20 @@
     },
 
     /**
+     * APIMethod: addEventType
+     * Add a new event type to this events object.
+     * If the event type has already been added, do nothing.
+     * 
+     * Parameters:
+     * eventName - {String}
+     */
+    addEventType: function(eventName) {
+        if (!this.listeners[eventName]) {
+            this.listeners[eventName] = new Array();
+        }
+    },
+
+    /**
      * Method: attachToElement
      *
      * Parameters:
@@ -450,9 +463,7 @@
 
             // every browser event has a corresponding application event 
             // (whether it's listened for or not).
-            if (this.listeners[eventType] == null) {
-                this.listeners[eventType] = new Array();
-            }
+            this.addEventType(eventType);
             
             // use Prototype to register the event cross-browser
             OpenLayers.Event.observe(element, eventType, this.eventHandler);
@@ -462,7 +473,7 @@
     },
 
     /**
-     * Method: register
+     * APIMethod: register
      * Register an event on the events object.
      *
      * When the event is triggered, the 'func' function will be called, in the
@@ -502,18 +513,21 @@
     },
 
     /**
-     *   TODO: get rid of this in 3.0 - Decide whether listeners should be 
-     *         called in the order they were registered or in reverse order.
+     * APIMethod: registerPriority
+     * Same as register() but adds the new listener to the *front* of the
+     *     events queue instead of to the end.
+     *    
+     *     TODO: get rid of this in 3.0 - Decide whether listeners should be 
+     *     called in the order they were registered or in reverse order.
      *
-     * Method: registerPriority
      *
      * Parameters:
      * type - {String} Name of the event to register
      * obj - {Object} The object to bind the context to for the callback#.
-     *                     If no object is specified, default is the Events's 
-     *                     'object' property.
+     *                If no object is specified, default is the Events's 
+     *                'object' property.
      * func - {Function} The callback function. If no callback is 
-     *                        specified, this function does nothing.
+     *                   specified, this function does nothing.
      */
     registerPriority: function (type, obj, func) {
 
@@ -529,7 +543,7 @@
     },
     
     /**
-     * Method: unregister
+     * APIMethod: unregister
      *
      * Parameters:
      * type - {String} 
@@ -554,7 +568,7 @@
     /** 
      * Method: remove
      * Remove all listeners for a given event type. If type is not registered,
-     *   does nothing.
+     *     does nothing.
      *
      * Parameters:
      * type - {String} 
@@ -566,7 +580,7 @@
     },
 
     /**
-     * Method: triggerEvent
+     * APIMethod: triggerEvent
      * Trigger a specified registered event
      * 
      * Parameters:
@@ -613,11 +627,9 @@
     /**
      * Method: handleBrowserEvent
      * Basically just a wrapper to the triggerEvent() function, but takes 
-     *   care to set a property 'xy' on the event with the current mouse 
-     *   position.
+     *     care to set a property 'xy' on the event with the current mouse 
+     *     position.
      *
-     * Private function. 
-     *
      * Parameters:
      * evt - {Event} 
      */
@@ -628,14 +640,13 @@
 
     /**
      * Method: getMousePosition
-     * *Private* 
      * 
      * Parameters:
      * evt - {Event} 
      * 
      * Returns 
      * {<OpenLayers.Pixel>} The current xy coordinate of the mouse, adjusted
-     * for offsets
+     *                      for offsets
      */
     getMousePosition: function (evt) {
         if (!this.element.offsets) {

Modified: sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Drag.js
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Drag.js	2007-07-06 18:30:09 UTC (rev 3622)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Drag.js	2007-07-06 19:05:14 UTC (rev 3623)
@@ -31,7 +31,7 @@
 
     /**
      * Property: oldOnselectstart
-     * *Private*. {Function}
+     * {Function}
      */
     oldOnselectstart: null,
 

Modified: sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Keyboard.js
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Keyboard.js	2007-07-06 18:30:09 UTC (rev 3622)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Keyboard.js	2007-07-06 19:05:14 UTC (rev 3623)
@@ -27,7 +27,7 @@
 
     /** 
     * Property: eventListener
-    * *Private*. {Function}
+    * {Function}
     */
     eventListener: null,
 

Modified: sandbox/euzuro/untiled3/lib/OpenLayers/Handler/MouseWheel.js
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/Handler/MouseWheel.js	2007-07-06 18:30:09 UTC (rev 3622)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/Handler/MouseWheel.js	2007-07-06 19:05:14 UTC (rev 3623)
@@ -21,7 +21,7 @@
 
     /** 
      * Property: mousePosition
-     * *Private*. {<OpenLayers.Pixel>} mousePosition is necessary because
+     * {<OpenLayers.Pixel>} mousePosition is necessary because
      * evt.clientX/Y is buggy in Moz on wheel events, so we cache and use the
      * value from the last mousemove.
      */

Modified: sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Path.js
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Path.js	2007-07-06 18:30:09 UTC (rev 3622)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Path.js	2007-07-06 19:05:14 UTC (rev 3623)
@@ -21,7 +21,7 @@
     
     /**
      * Property: line
-     * *Private*. {<OpenLayers.Feature.Vector>}
+     * {<OpenLayers.Feature.Vector>}
      */
     line: null,
     
@@ -66,7 +66,7 @@
         
     /**
      * Method: createFeature
-     * *Private*. Add temporary geometries
+     * Add temporary geometries
      */
     createFeature: function() {
         this.line = new OpenLayers.Feature.Vector(
@@ -77,7 +77,7 @@
         
     /**
      * Method: destroyFeature
-     * *Private*. Destroy temporary geometries
+     * Destroy temporary geometries
      */
     destroyFeature: function() {
         this.line.destroy();
@@ -86,7 +86,7 @@
     
     /**
      * Method: addPoint
-     * *Private*. Add point to geometry.  Send the point index to override
+     * Add point to geometry.  Send the point index to override
      * the behavior of LinearRing that disregards adding duplicate points.
      */
     addPoint: function() {
@@ -97,7 +97,7 @@
     
     /**
      * Method: freehandMode
-     * *Private*. Determine whether to behave in freehand mode or not.
+     * Determine whether to behave in freehand mode or not.
      *
      * Return: {Boolean}
      */
@@ -108,7 +108,7 @@
 
     /**
      * Method: modifyFeature
-     * *Private*. Modify the existing geometry given the new point
+     * Modify the existing geometry given the new point
      */
     modifyFeature: function() {
         var index = this.line.geometry.components.length - 1;
@@ -118,7 +118,7 @@
     
     /**
      * Method: drawFeature
-     * *Private*. Render geometries on the temporary layer.
+     * Render geometries on the temporary layer.
      */
     drawFeature: function() {
         this.layer.drawFeature(this.line, this.style);
@@ -127,7 +127,7 @@
 
     /**
      * Method: geometryClone
-     * *Private*. Return a clone of the relevant geometry.
+     * Return a clone of the relevant geometry.
      *
      * Return: {<OpenLayers.Geometry.LineString>}
      */
@@ -137,7 +137,7 @@
 
     /**
      * Method: mousedown
-     * *Private*. Handle mouse down.  Add a new point to the geometry and
+     * Handle mouse down.  Add a new point to the geometry and
      * render it. Return determines whether to propagate the event on the map.
      * 
      * Parameters:
@@ -169,7 +169,7 @@
 
     /**
      * Method: mousemove
-     * *Private*. Handle mouse move.  Adjust the geometry and redraw.
+     * Handle mouse move.  Adjust the geometry and redraw.
      * Return determines whether to propagate the event on the map.
      * 
      * Parameters:
@@ -195,7 +195,7 @@
     
     /**
      * Method: mouseup
-     * *Private*. Handle mouse up.  Send the latest point in the geometry to
+     * Handle mouse up.  Send the latest point in the geometry to
      * the control. Return determines whether to propagate the event on the map.
      * 
      * Parameters:
@@ -222,7 +222,7 @@
   
     /**
      * Method: dblclick 
-     * *Private*. Handle double-clicks.  Finish the geometry and send it back
+     * Handle double-clicks.  Finish the geometry and send it back
      * to the control.
      * 
      * Parameters:

Modified: sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Polygon.js
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Polygon.js	2007-07-06 18:30:09 UTC (rev 3622)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/Handler/Polygon.js	2007-07-06 19:05:14 UTC (rev 3623)
@@ -21,7 +21,7 @@
     
     /**
      * Parameter: polygon
-     * *Private*. {<OpenLayers.Feature.Vector>}
+     * {<OpenLayers.Feature.Vector>}
      */
     polygon: null,
 

Modified: sandbox/euzuro/untiled3/lib/OpenLayers/Handler.js
===================================================================
--- sandbox/euzuro/untiled3/lib/OpenLayers/Handler.js	2007-07-06 18:30:09 UTC (rev 3622)
+++ sandbox/euzuro/untiled3/lib/OpenLayers/Handler.js	2007-07-06 19:05:14 UTC (rev 3623)
@@ -19,20 +19,20 @@
 OpenLayers.Handler.prototype = {
     /**
      * Property: id
-     * *Private*. {String}
+     * {String}
      */
     id: null,
         
     /**
      * Property: control
-     * *Private*. {<OpenLayers.Control>}. The control that initialized this
+     * {<OpenLayers.Control>}. The control that initialized this
      * handler.
      */
     control: null,
 
     /**
      * Property: map
-     * *Private*. {<OpenLayers.Map>}
+     * {<OpenLayers.Map>}
      */
     map: null,
 
@@ -44,7 +44,7 @@
 
     /**
      * Property: active
-     * *Private*. {Boolean}
+     * {Boolean}
      */
     active: false,
 



More information about the Commits mailing list