Rename ol.interaction.PointerInteraction

This commit is contained in:
ahocevar
2014-03-03 10:11:37 +01:00
committed by tsauerwein
parent fa434bedda
commit 05dd760287
7 changed files with 32 additions and 32 deletions

View File

@@ -8,7 +8,7 @@ goog.require('goog.asserts');
goog.require('goog.events.Event');
goog.require('ol.events.ConditionType');
goog.require('ol.events.condition');
goog.require('ol.interaction.PointerInteraction');
goog.require('ol.interaction.Pointer');
goog.require('ol.render.Box');
@@ -69,7 +69,7 @@ goog.inherits(ol.DragBoxEvent, goog.events.Event);
* This interaction is only supported for mouse devices.
*
* @constructor
* @extends {ol.interaction.PointerInteraction}
* @extends {ol.interaction.Pointer}
* @param {olx.interaction.DragBoxOptions=} opt_options Options.
* @todo stability experimental
*/
@@ -105,7 +105,7 @@ ol.interaction.DragBox = function(opt_options) {
options.condition : ol.events.condition.always;
};
goog.inherits(ol.interaction.DragBox, ol.interaction.PointerInteraction);
goog.inherits(ol.interaction.DragBox, ol.interaction.Pointer);
/**

View File

@@ -9,7 +9,7 @@ goog.require('ol.events.ConditionType');
goog.require('ol.events.condition');
goog.require('ol.interaction.Drag');
goog.require('ol.interaction.Interaction');
goog.require('ol.interaction.PointerInteraction');
goog.require('ol.interaction.Pointer');
/**
@@ -26,7 +26,7 @@ ol.interaction.DRAGROTATEANDZOOM_ANIMATION_DURATION = 400;
*
* This interaction is not included in the default interactions.
* @constructor
* @extends {ol.interaction.PointerInteraction}
* @extends {ol.interaction.Pointer}
* @param {olx.interaction.DragRotateAndZoomOptions=} opt_options Options.
* @todo stability experimental
*/
@@ -63,7 +63,7 @@ ol.interaction.DragRotateAndZoom = function(opt_options) {
};
goog.inherits(ol.interaction.DragRotateAndZoom,
ol.interaction.PointerInteraction);
ol.interaction.Pointer);
/**

View File

@@ -6,7 +6,7 @@ goog.require('ol.events.ConditionType');
goog.require('ol.events.condition');
goog.require('ol.interaction.Drag');
goog.require('ol.interaction.Interaction');
goog.require('ol.interaction.PointerInteraction');
goog.require('ol.interaction.Pointer');
/**
@@ -24,7 +24,7 @@ ol.interaction.DRAGROTATE_ANIMATION_DURATION = 250;
* This interaction is only supported for mouse devices.
*
* @constructor
* @extends {ol.interaction.PointerInteraction}
* @extends {ol.interaction.Pointer}
* @param {olx.interaction.DragRotateOptions=} opt_options Options.
*/
ol.interaction.DragRotate = function(opt_options) {
@@ -47,7 +47,7 @@ ol.interaction.DragRotate = function(opt_options) {
this.lastAngle_ = undefined;
};
goog.inherits(ol.interaction.DragRotate, ol.interaction.PointerInteraction);
goog.inherits(ol.interaction.DragRotate, ol.interaction.Pointer);
/**

View File

@@ -8,14 +8,14 @@ goog.require('ol.PreRenderFunction');
goog.require('ol.View2D');
goog.require('ol.coordinate');
goog.require('ol.events.condition');
goog.require('ol.interaction.PointerInteraction');
goog.require('ol.interaction.Pointer');
/**
* Allows the user to pan the map by dragging the map.
* @constructor
* @extends {ol.interaction.PointerInteraction}
* @extends {ol.interaction.Pointer}
* @param {olx.interaction.PanOptions=} opt_options Options.
* @todo stability experimental
*/
@@ -56,7 +56,7 @@ ol.interaction.Pan = function(opt_options) {
this.noKinetic_ = false;
};
goog.inherits(ol.interaction.Pan, ol.interaction.PointerInteraction);
goog.inherits(ol.interaction.Pan, ol.interaction.Pointer);
/**
@@ -65,7 +65,7 @@ goog.inherits(ol.interaction.Pan, ol.interaction.PointerInteraction);
ol.interaction.Pan.prototype.handlePointerDrag = function(mapBrowserEvent) {
goog.asserts.assert(this.targetPointers.length >= 1);
var centroid =
ol.interaction.PointerInteraction.centroid(this.targetPointers);
ol.interaction.Pointer.centroid(this.targetPointers);
if (!goog.isNull(this.lastCentroid)) {
if (this.kinetic_) {
this.kinetic_.update(centroid[0], centroid[1]);

View File

@@ -1,4 +1,4 @@
goog.provide('ol.interaction.PointerInteraction');
goog.provide('ol.interaction.Pointer');
goog.require('goog.asserts');
goog.require('goog.functions');
@@ -17,7 +17,7 @@ goog.require('ol.interaction.Interaction');
* @constructor
* @extends {ol.interaction.Interaction}
*/
ol.interaction.PointerInteraction = function() {
ol.interaction.Pointer = function() {
goog.base(this);
@@ -40,14 +40,14 @@ ol.interaction.PointerInteraction = function() {
this.targetPointers = [];
};
goog.inherits(ol.interaction.PointerInteraction, ol.interaction.Interaction);
goog.inherits(ol.interaction.Pointer, ol.interaction.Interaction);
/**
* @param {Array.<ol.pointer.PointerEvent>} pointerEvents
* @return {ol.Pixel} Centroid pixel.
*/
ol.interaction.PointerInteraction.centroid = function(pointerEvents) {
ol.interaction.Pointer.centroid = function(pointerEvents) {
var length = pointerEvents.length;
var clientX = 0;
var clientY = 0;
@@ -65,7 +65,7 @@ ol.interaction.PointerInteraction.centroid = function(pointerEvents) {
* or pointerup event.
* @private
*/
ol.interaction.PointerInteraction.prototype.isPointerDraggingEvent_ =
ol.interaction.Pointer.prototype.isPointerDraggingEvent_ =
function(mapBrowserEvent) {
var type = mapBrowserEvent.type;
return (
@@ -79,7 +79,7 @@ ol.interaction.PointerInteraction.prototype.isPointerDraggingEvent_ =
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
* @private
*/
ol.interaction.PointerInteraction.prototype.updateTrackedPointers_ =
ol.interaction.Pointer.prototype.updateTrackedPointers_ =
function(mapBrowserEvent) {
if (this.isPointerDraggingEvent_(mapBrowserEvent)) {
var event = mapBrowserEvent.pointerEvent;
@@ -102,7 +102,7 @@ ol.interaction.PointerInteraction.prototype.updateTrackedPointers_ =
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
* @protected
*/
ol.interaction.PointerInteraction.prototype.handlePointerDrag =
ol.interaction.Pointer.prototype.handlePointerDrag =
goog.nullFunction;
@@ -111,7 +111,7 @@ ol.interaction.PointerInteraction.prototype.handlePointerDrag =
* @protected
* @return {boolean} Capture dragging.
*/
ol.interaction.PointerInteraction.prototype.handlePointerUp =
ol.interaction.Pointer.prototype.handlePointerUp =
goog.functions.FALSE;
@@ -120,14 +120,14 @@ ol.interaction.PointerInteraction.prototype.handlePointerUp =
* @protected
* @return {boolean} Capture dragging.
*/
ol.interaction.PointerInteraction.prototype.handlePointerDown =
ol.interaction.Pointer.prototype.handlePointerDown =
goog.functions.FALSE;
/**
* @inheritDoc
*/
ol.interaction.PointerInteraction.prototype.handleMapBrowserEvent =
ol.interaction.Pointer.prototype.handleMapBrowserEvent =
function(mapBrowserEvent) {
if (!(mapBrowserEvent instanceof ol.MapBrowserPointerEvent)) {
return true;
@@ -172,5 +172,5 @@ ol.interaction.PointerInteraction.prototype.handleMapBrowserEvent =
* @param {boolean} handled Was the event handled by the interaction?
* @return {boolean} Should the event be stopped?
*/
ol.interaction.PointerInteraction.prototype.shouldStopEvent =
ol.interaction.Pointer.prototype.shouldStopEvent =
goog.functions.FALSE;

View File

@@ -6,7 +6,7 @@ goog.require('goog.asserts');
goog.require('goog.style');
goog.require('ol.Coordinate');
goog.require('ol.interaction.Interaction');
goog.require('ol.interaction.PointerInteraction');
goog.require('ol.interaction.Pointer');
/**
@@ -20,7 +20,7 @@ ol.interaction.ROTATE_ANIMATION_DURATION = 250;
* Allows the user to rotate the map by twisting with two fingers
* on a touch screen.
* @constructor
* @extends {ol.interaction.PointerInteraction}
* @extends {ol.interaction.Pointer}
* @param {olx.interaction.RotateOptions=} opt_options Options.
* @todo stability experimental
*/
@@ -61,7 +61,7 @@ ol.interaction.Rotate = function(opt_options) {
this.threshold_ = goog.isDef(options.threshold) ? options.threshold : 0.3;
};
goog.inherits(ol.interaction.Rotate, ol.interaction.PointerInteraction);
goog.inherits(ol.interaction.Rotate, ol.interaction.Pointer);
/**
@@ -98,7 +98,7 @@ ol.interaction.Rotate.prototype.handlePointerDrag =
// touch0,touch1 and previousTouch0,previousTouch1
var viewportPosition = goog.style.getClientPosition(map.getViewport());
var centroid =
ol.interaction.PointerInteraction.centroid(this.targetPointers);
ol.interaction.Pointer.centroid(this.targetPointers);
centroid[0] -= viewportPosition.x;
centroid[1] -= viewportPosition.y;
this.anchor_ = map.getCoordinateFromPixel(centroid);

View File

@@ -6,7 +6,7 @@ goog.require('goog.asserts');
goog.require('goog.style');
goog.require('ol.Coordinate');
goog.require('ol.interaction.Interaction');
goog.require('ol.interaction.PointerInteraction');
goog.require('ol.interaction.Pointer');
@@ -14,7 +14,7 @@ goog.require('ol.interaction.PointerInteraction');
* Allows the user to zoom the map by pinching with two fingers
* on a touch screen.
* @constructor
* @extends {ol.interaction.PointerInteraction}
* @extends {ol.interaction.Pointer}
* @param {olx.interaction.ZoomOptions=} opt_options Options.
* @todo stability experimental
*/
@@ -49,7 +49,7 @@ ol.interaction.Zoom = function(opt_options) {
this.lastScaleDelta_ = 1;
};
goog.inherits(ol.interaction.Zoom, ol.interaction.PointerInteraction);
goog.inherits(ol.interaction.Zoom, ol.interaction.Pointer);
/**
@@ -84,7 +84,7 @@ ol.interaction.Zoom.prototype.handlePointerDrag =
// scale anchor point.
var viewportPosition = goog.style.getClientPosition(map.getViewport());
var centroid =
ol.interaction.PointerInteraction.centroid(this.targetPointers);
ol.interaction.Pointer.centroid(this.targetPointers);
centroid[0] -= viewportPosition.x;
centroid[1] -= viewportPosition.y;
this.anchor_ = map.getCoordinateFromPixel(centroid);