Rename ol.Observable#dispatchChangeEvent() to #changed()

Since dispatchChangeEvent does not only dispatch a change event, but
also increases the revision counter, the method name should reflect
this.
This commit is contained in:
Andreas Hocevar
2014-09-04 19:30:48 -06:00
parent 5de537001f
commit ebe3b48e0a
32 changed files with 66 additions and 66 deletions
+3 -3
View File
@@ -182,7 +182,7 @@ ol.geom.Circle.prototype.setCenterAndRadius =
flatCoordinates[offset++] = flatCoordinates[i];
}
flatCoordinates.length = offset;
this.dispatchChangeEvent();
this.changed();
}
};
@@ -194,7 +194,7 @@ ol.geom.Circle.prototype.setCenterAndRadius =
ol.geom.Circle.prototype.setFlatCoordinates =
function(layout, flatCoordinates) {
this.setFlatCoordinatesInternal(layout, flatCoordinates);
this.dispatchChangeEvent();
this.changed();
};
@@ -205,7 +205,7 @@ ol.geom.Circle.prototype.setFlatCoordinates =
ol.geom.Circle.prototype.setRadius = function(radius) {
goog.asserts.assert(!goog.isNull(this.flatCoordinates));
this.flatCoordinates[this.stride] = this.flatCoordinates[0] + radius;
this.dispatchChangeEvent();
this.changed();
};
+4 -4
View File
@@ -61,7 +61,7 @@ ol.geom.GeometryCollection.prototype.unlistenGeometriesChange_ = function() {
for (i = 0, ii = this.geometries_.length; i < ii; ++i) {
goog.events.unlisten(
this.geometries_[i], goog.events.EventType.CHANGE,
this.dispatchChangeEvent, false, this);
this.changed, false, this);
}
};
@@ -77,7 +77,7 @@ ol.geom.GeometryCollection.prototype.listenGeometriesChange_ = function() {
for (i = 0, ii = this.geometries_.length; i < ii; ++i) {
goog.events.listen(
this.geometries_[i], goog.events.EventType.CHANGE,
this.dispatchChangeEvent, false, this);
this.changed, false, this);
}
};
@@ -243,7 +243,7 @@ ol.geom.GeometryCollection.prototype.setGeometriesArray = function(geometries) {
this.unlistenGeometriesChange_();
this.geometries_ = geometries;
this.listenGeometriesChange_();
this.dispatchChangeEvent();
this.changed();
};
@@ -256,7 +256,7 @@ ol.geom.GeometryCollection.prototype.applyTransform = function(transformFn) {
for (i = 0, ii = geometries.length; i < ii; ++i) {
geometries[i].applyTransform(transformFn);
}
this.dispatchChangeEvent();
this.changed();
};
+2 -2
View File
@@ -138,7 +138,7 @@ ol.geom.LinearRing.prototype.setCoordinates =
}
this.flatCoordinates.length = ol.geom.flat.deflate.coordinates(
this.flatCoordinates, 0, coordinates, this.stride);
this.dispatchChangeEvent();
this.changed();
}
};
@@ -150,5 +150,5 @@ ol.geom.LinearRing.prototype.setCoordinates =
ol.geom.LinearRing.prototype.setFlatCoordinates =
function(layout, flatCoordinates) {
this.setFlatCoordinatesInternal(layout, flatCoordinates);
this.dispatchChangeEvent();
this.changed();
};
+3 -3
View File
@@ -70,7 +70,7 @@ ol.geom.LineString.prototype.appendCoordinate = function(coordinate) {
} else {
ol.array.safeExtend(this.flatCoordinates, coordinate);
}
this.dispatchChangeEvent();
this.changed();
};
@@ -206,7 +206,7 @@ ol.geom.LineString.prototype.setCoordinates =
}
this.flatCoordinates.length = ol.geom.flat.deflate.coordinates(
this.flatCoordinates, 0, coordinates, this.stride);
this.dispatchChangeEvent();
this.changed();
}
};
@@ -218,5 +218,5 @@ ol.geom.LineString.prototype.setCoordinates =
ol.geom.LineString.prototype.setFlatCoordinates =
function(layout, flatCoordinates) {
this.setFlatCoordinatesInternal(layout, flatCoordinates);
this.dispatchChangeEvent();
this.changed();
};
+3 -3
View File
@@ -66,7 +66,7 @@ ol.geom.MultiLineString.prototype.appendLineString = function(lineString) {
this.flatCoordinates, lineString.getFlatCoordinates().slice());
}
this.ends_.push(this.flatCoordinates.length);
this.dispatchChangeEvent();
this.changed();
};
@@ -261,7 +261,7 @@ ol.geom.MultiLineString.prototype.setCoordinates =
var ends = ol.geom.flat.deflate.coordinatess(
this.flatCoordinates, 0, coordinates, this.stride, this.ends_);
this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];
this.dispatchChangeEvent();
this.changed();
}
};
@@ -282,7 +282,7 @@ ol.geom.MultiLineString.prototype.setFlatCoordinates =
}
this.setFlatCoordinatesInternal(layout, flatCoordinates);
this.ends_ = ends;
this.dispatchChangeEvent();
this.changed();
};
+3 -3
View File
@@ -41,7 +41,7 @@ ol.geom.MultiPoint.prototype.appendPoint = function(point) {
} else {
ol.array.safeExtend(this.flatCoordinates, point.getFlatCoordinates());
}
this.dispatchChangeEvent();
this.changed();
};
@@ -158,7 +158,7 @@ ol.geom.MultiPoint.prototype.setCoordinates =
}
this.flatCoordinates.length = ol.geom.flat.deflate.coordinates(
this.flatCoordinates, 0, coordinates, this.stride);
this.dispatchChangeEvent();
this.changed();
}
};
@@ -170,5 +170,5 @@ ol.geom.MultiPoint.prototype.setCoordinates =
ol.geom.MultiPoint.prototype.setFlatCoordinates =
function(layout, flatCoordinates) {
this.setFlatCoordinatesInternal(layout, flatCoordinates);
this.dispatchChangeEvent();
this.changed();
};
+3 -3
View File
@@ -104,7 +104,7 @@ ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) {
}
}
this.endss_.push(ends);
this.dispatchChangeEvent();
this.changed();
};
@@ -338,7 +338,7 @@ ol.geom.MultiPolygon.prototype.setCoordinates =
this.flatCoordinates.length = lastEnds.length === 0 ?
0 : lastEnds[lastEnds.length - 1];
}
this.dispatchChangeEvent();
this.changed();
}
};
@@ -360,7 +360,7 @@ ol.geom.MultiPolygon.prototype.setFlatCoordinates =
}
this.setFlatCoordinatesInternal(layout, flatCoordinates);
this.endss_ = endss;
this.dispatchChangeEvent();
this.changed();
};
+2 -2
View File
@@ -108,7 +108,7 @@ ol.geom.Point.prototype.setCoordinates = function(coordinates, opt_layout) {
}
this.flatCoordinates.length = ol.geom.flat.deflate.coordinate(
this.flatCoordinates, 0, coordinates, this.stride);
this.dispatchChangeEvent();
this.changed();
}
};
@@ -119,5 +119,5 @@ ol.geom.Point.prototype.setCoordinates = function(coordinates, opt_layout) {
*/
ol.geom.Point.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
this.setFlatCoordinatesInternal(layout, flatCoordinates);
this.dispatchChangeEvent();
this.changed();
};
+3 -3
View File
@@ -94,7 +94,7 @@ ol.geom.Polygon.prototype.appendLinearRing = function(linearRing) {
ol.array.safeExtend(this.flatCoordinates, linearRing.getFlatCoordinates());
}
this.ends_.push(this.flatCoordinates.length);
this.dispatchChangeEvent();
this.changed();
};
@@ -312,7 +312,7 @@ ol.geom.Polygon.prototype.setCoordinates = function(coordinates, opt_layout) {
var ends = ol.geom.flat.deflate.coordinatess(
this.flatCoordinates, 0, coordinates, this.stride, this.ends_);
this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];
this.dispatchChangeEvent();
this.changed();
}
};
@@ -333,7 +333,7 @@ ol.geom.Polygon.prototype.setFlatCoordinates =
}
this.setFlatCoordinatesInternal(layout, flatCoordinates);
this.ends_ = ends;
this.dispatchChangeEvent();
this.changed();
};
+1 -1
View File
@@ -249,7 +249,7 @@ ol.geom.SimpleGeometry.prototype.setLayout =
ol.geom.SimpleGeometry.prototype.applyTransform = function(transformFn) {
if (!goog.isNull(this.flatCoordinates)) {
transformFn(this.flatCoordinates, this.flatCoordinates, this.stride);
this.dispatchChangeEvent();
this.changed();
}
};