Merge all changes from the naturaldocs sandbox. This brings all the work that

has been done in the NaturalDocs branch back to trunk. Thanks to everyone who
helped out in making this happen. (I could list people, but the list would
be long, and I'm already mentally on vacation.)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@3545 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-06-29 15:59:20 +00:00
parent f1c61fd0d6
commit 3948913bfc
107 changed files with 8658 additions and 4011 deletions

View File

@@ -3,36 +3,44 @@
* for the full text of the license. */
/**
* @class
*
* @requires OpenLayers/Control.js
*
* Class: OpenLayers.Control.Panel
*
* Inherits from:
* - <OpenLayers.Control>
*/
OpenLayers.Control.Panel = OpenLayers.Class.create();
OpenLayers.Control.Panel.prototype =
OpenLayers.Class.inherit( OpenLayers.Control, {
/**
* @type Array(OpenLayers.Control)
* Property: controls
* Array({<OpenLayers.Control>})
*/
controls: null,
/**
* The control which is activated when the control is activated (turned
* on), which also happens at instantiation.
* @type OpenLayers.Control
* APIProperty: defaultControl
* <OpenLayers.Control> The control which is activated when the control is
* activated (turned on), which also happens at instantiation.
*/
defaultControl: null,
/**
* @constructor
* Constructor: OpenLayers.Control
*
* @param {DOMElement} element
* @param {String} base
* Parameters:
* element - {DOMElement}
* base - {String}
*/
initialize: function(element) {
OpenLayers.Control.prototype.initialize.apply(this, arguments);
this.controls = [];
},
/**
* APIMethod: destroy
*/
destroy: function() {
OpenLayers.Control.prototype.destroy.apply(this, arguments);
for(var i = this.controls.length - 1 ; i >= 0; i--) {
@@ -41,6 +49,9 @@ OpenLayers.Control.Panel.prototype =
}
},
/**
* APIMethod: activate
*/
activate: function() {
if (OpenLayers.Control.prototype.activate.apply(this, arguments)) {
for(var i = 0; i < this.controls.length; i++) {
@@ -55,6 +66,9 @@ OpenLayers.Control.Panel.prototype =
}
},
/**
* APIMethod: deactivate
*/
deactivate: function() {
if (OpenLayers.Control.prototype.deactivate.apply(this, arguments)) {
for(var i = 0; i < this.controls.length; i++) {
@@ -68,7 +82,9 @@ OpenLayers.Control.Panel.prototype =
},
/**
* @type DOMElement
* Method: draw
*
* Returns: {DOMElement}
*/
draw: function() {
OpenLayers.Control.prototype.draw.apply(this, arguments);
@@ -81,7 +97,7 @@ OpenLayers.Control.Panel.prototype =
},
/**
* @private
* Method: redraw
*/
redraw: function() {
this.div.innerHTML = "";
@@ -98,6 +114,12 @@ OpenLayers.Control.Panel.prototype =
}
},
/**
* APIMethod: activateControl
*
* Parameters:
* control - {<OpenLayers.Control>}
*/
activateControl: function (control) {
if (!this.active) { return false; }
if (control.type == OpenLayers.Control.TYPE_BUTTON) {
@@ -125,10 +147,13 @@ OpenLayers.Control.Panel.prototype =
},
/**
* APIMethod: addControls
* To build a toolbar, you add a set of controls to it. addControls
* lets you add a single control or a list of controls to the
* Control Panel.
* @param {OpenLayers.Control} controls
*
* Parameters:
* controls - {<OpenLayers.Control>}
*/
addControls: function(controls) {
if (!(controls instanceof Array)) {
@@ -159,7 +184,10 @@ OpenLayers.Control.Panel.prototype =
this.redraw();
}
},
/**
* Method: onClick
*/
onClick: function (ctrl, evt) {
OpenLayers.Event.stop(evt ? evt : window.event);
this.activateControl(ctrl);