formatting

This commit is contained in:
Hannes Janetzek 2013-02-04 20:14:58 +01:00
parent 303e0cb4ce
commit f2b7a9fdf8
72 changed files with 403 additions and 240 deletions

View File

@ -70,12 +70,14 @@ public class MapPosition {
// (float) (MercatorProjection.latitudeToPixelY(in.getLatitude(), zoomLevel) - y); // (float) (MercatorProjection.latitudeToPixelY(in.getLatitude(), zoomLevel) - y);
// } // }
/** @param geoPoint /**
* @param geoPoint
* the map position. * the map position.
* @param zoomLevel * @param zoomLevel
* the zoom level. * the zoom level.
* @param scale * @param scale
* ... */ * ...
*/
public MapPosition(GeoPoint geoPoint, byte zoomLevel, float scale) { public MapPosition(GeoPoint geoPoint, byte zoomLevel, float scale) {
this.zoomLevel = zoomLevel; this.zoomLevel = zoomLevel;
this.scale = scale; this.scale = scale;

View File

@ -49,6 +49,7 @@ public final class MercatorProjection {
/** /**
* Calculates the distance on the ground that is represented by a single * Calculates the distance on the ground that is represented by a single
* pixel on the map. * pixel on the map.
*
* @param latitude * @param latitude
* the latitude coordinate at which the resolution should be * the latitude coordinate at which the resolution should be
* calculated. * calculated.
@ -64,6 +65,7 @@ public final class MercatorProjection {
/** /**
* Converts a latitude coordinate (in degrees) to a pixel Y coordinate at a * Converts a latitude coordinate (in degrees) to a pixel Y coordinate at a
* certain zoom level. * certain zoom level.
*
* @param latitude * @param latitude
* the latitude coordinate that should be converted. * the latitude coordinate that should be converted.
* @param zoomLevel * @param zoomLevel
@ -84,6 +86,7 @@ public final class MercatorProjection {
/** /**
* Projects a longitude coordinate (in degrees) to the range [0.0,1.0] * Projects a longitude coordinate (in degrees) to the range [0.0,1.0]
*
* @param latitude * @param latitude
* the latitude coordinate that should be converted. * the latitude coordinate that should be converted.
* @return the position . * @return the position .
@ -96,6 +99,7 @@ public final class MercatorProjection {
/** /**
* Converts a latitude coordinate (in degrees) to a tile Y number at a * Converts a latitude coordinate (in degrees) to a tile Y number at a
* certain zoom level. * certain zoom level.
*
* @param latitude * @param latitude
* the latitude coordinate that should be converted. * the latitude coordinate that should be converted.
* @param zoomLevel * @param zoomLevel
@ -138,6 +142,7 @@ public final class MercatorProjection {
/** /**
* Converts a longitude coordinate (in degrees) to a pixel X coordinate at a * Converts a longitude coordinate (in degrees) to a pixel X coordinate at a
* certain zoom level. * certain zoom level.
*
* @param longitude * @param longitude
* the longitude coordinate that should be converted. * the longitude coordinate that should be converted.
* @param zoomLevel * @param zoomLevel
@ -155,6 +160,7 @@ public final class MercatorProjection {
/** /**
* Projects a longitude coordinate (in degrees) to the range [0.0,1.0] * Projects a longitude coordinate (in degrees) to the range [0.0,1.0]
*
* @param longitude * @param longitude
* the longitude coordinate that should be converted. * the longitude coordinate that should be converted.
* @return the position . * @return the position .
@ -166,6 +172,7 @@ public final class MercatorProjection {
/** /**
* Converts a longitude coordinate (in degrees) to the tile X number at a * Converts a longitude coordinate (in degrees) to the tile X number at a
* certain zoom level. * certain zoom level.
*
* @param longitude * @param longitude
* the longitude coordinate that should be converted. * the longitude coordinate that should be converted.
* @param zoomLevel * @param zoomLevel
@ -179,6 +186,7 @@ public final class MercatorProjection {
/** /**
* Converts a pixel X coordinate at a certain zoom level to a longitude * Converts a pixel X coordinate at a certain zoom level to a longitude
* coordinate. * coordinate.
*
* @param pixelX * @param pixelX
* the pixel X coordinate that should be converted. * the pixel X coordinate that should be converted.
* @param zoomLevel * @param zoomLevel
@ -191,6 +199,7 @@ public final class MercatorProjection {
/** /**
* Converts a pixel X coordinate to the tile X number. * Converts a pixel X coordinate to the tile X number.
*
* @param pixelX * @param pixelX
* the pixel X coordinate that should be converted. * the pixel X coordinate that should be converted.
* @param zoomLevel * @param zoomLevel
@ -205,6 +214,7 @@ public final class MercatorProjection {
/** /**
* Converts a pixel Y coordinate at a certain zoom level to a latitude * Converts a pixel Y coordinate at a certain zoom level to a latitude
* coordinate. * coordinate.
*
* @param pixelY * @param pixelY
* the pixel Y coordinate that should be converted. * the pixel Y coordinate that should be converted.
* @param zoomLevel * @param zoomLevel
@ -218,6 +228,7 @@ public final class MercatorProjection {
/** /**
* Converts a pixel Y coordinate to the tile Y number. * Converts a pixel Y coordinate to the tile Y number.
*
* @param pixelY * @param pixelY
* the pixel Y coordinate that should be converted. * the pixel Y coordinate that should be converted.
* @param zoomLevel * @param zoomLevel
@ -232,6 +243,7 @@ public final class MercatorProjection {
/** /**
* Converts a tile X number at a certain zoom level to a longitude * Converts a tile X number at a certain zoom level to a longitude
* coordinate. * coordinate.
*
* @param tileX * @param tileX
* the tile X number that should be converted. * the tile X number that should be converted.
* @param zoomLevel * @param zoomLevel
@ -245,6 +257,7 @@ public final class MercatorProjection {
/** /**
* Converts a tile Y number at a certain zoom level to a latitude * Converts a tile Y number at a certain zoom level to a latitude
* coordinate. * coordinate.
*
* @param tileY * @param tileY
* the tile Y number that should be converted. * the tile Y number that should be converted.
* @param zoomLevel * @param zoomLevel

View File

@ -25,6 +25,7 @@ public interface IMapDatabase {
/** /**
* Starts a database query with the given parameters. * Starts a database query with the given parameters.
*
* @param tile * @param tile
* the tile to read. * the tile to read.
* @param mapDatabaseCallback * @param mapDatabaseCallback
@ -48,6 +49,7 @@ public interface IMapDatabase {
/** /**
* Opens MapDatabase * Opens MapDatabase
*
* @param options * @param options
* the options. * the options.
* @return a OpenResult containing an error message in case of a failure. * @return a OpenResult containing an error message in case of a failure.

View File

@ -19,6 +19,9 @@ import org.oscim.database.mapfile.MapDatabase;
/** /**
* Callback methods which can be triggered from the {@link MapDatabase}. * Callback methods which can be triggered from the {@link MapDatabase}.
* ____
* NOTE: All parameters passed belong to the caller! i.e. dont hold
* references to any arrays after callback function returns.
*/ */
public interface IMapDatabaseCallback { public interface IMapDatabaseCallback {
/** /**
@ -44,15 +47,16 @@ public interface IMapDatabaseCallback {
* Renders a single way or area (closed way). * Renders a single way or area (closed way).
* *
* @param layer * @param layer
* the layer of the way. * the osm layer of the way.
* @param tags * @param tags
* the tags of the way. * the tags of the way.
* @param wayNodes * @param wayNodes
* the geographical coordinates of the way nodes in the order longitude/latitude. * the geographical coordinates of the way nodes in the order
* longitude/latitude or x/y depending on the projection.
* @param wayLength * @param wayLength
* length of way data in wayNodes * length of way data in wayNodes
* @param closed * @param closed
* way is closed (means need to add endpoint == startpoint) * wheter the way is an polygon.
* @param prio TODO * @param prio TODO
*/ */
void renderWay(byte layer, Tag[] tags, float[] wayNodes, short[] wayLength, void renderWay(byte layer, Tag[] tags, float[] wayNodes, short[] wayLength,
@ -65,7 +69,8 @@ public interface IMapDatabaseCallback {
* ... * ...
* @param closed * @param closed
* ... * ...
* @return true if the way will be rendered (i.e. found match in RenderTheme) * @return true if the way will be rendered (i.e. found match in
* RenderTheme)
*/ */
boolean checkWay(Tag[] tags, boolean closed); boolean checkWay(Tag[] tags, boolean closed);

View File

@ -25,7 +25,8 @@ public final class MapDatabaseFactory {
/** /**
* @param attributeSet * @param attributeSet
* A collection of attributes which includes the desired MapDatabase. * A collection of attributes which includes the desired
* MapDatabase.
* @return a new MapDatabase instance. * @return a new MapDatabase instance.
*/ */
public static IMapDatabase createMapDatabase(AttributeSet attributeSet) { public static IMapDatabase createMapDatabase(AttributeSet attributeSet) {

View File

@ -80,7 +80,8 @@ public class MapInfo {
public final Byte startZoomLevel; public final Byte startZoomLevel;
/** /**
* Zoomlevels provided by this Database, if null then any zoomlevel can be queried. * Zoomlevels provided by this Database, if null then any zoomlevel can be
* queried.
*/ */
public final int[] zoomLevel; public final int[] zoomLevel;

View File

@ -14,9 +14,9 @@
*/ */
package org.oscim.database; package org.oscim.database;
/** /**
* A FileOpenResult is a simple DTO which is returned by IMapDatabase#openFile(File). * A FileOpenResult is a simple DTO which is returned by
* IMapDatabase#openFile(File).
*/ */
public class OpenResult { public class OpenResult {
/** /**

View File

@ -30,7 +30,8 @@ final class Deserializer {
* @return the long value. * @return the long value.
*/ */
static long getFiveBytesLong(byte[] buffer, int offset) { static long getFiveBytesLong(byte[] buffer, int offset) {
return (buffer[offset] & 0xffL) << 32 | (buffer[offset + 1] & 0xffL) << 24 | (buffer[offset + 2] & 0xffL) << 16 return (buffer[offset] & 0xffL) << 32 | (buffer[offset + 1] & 0xffL) << 24
| (buffer[offset + 2] & 0xffL) << 16
| (buffer[offset + 3] & 0xffL) << 8 | (buffer[offset + 4] & 0xffL); | (buffer[offset + 3] & 0xffL) << 8 | (buffer[offset + 4] & 0xffL);
} }
@ -46,7 +47,8 @@ final class Deserializer {
* @return the int value. * @return the int value.
*/ */
static int getInt(byte[] buffer, int offset) { static int getInt(byte[] buffer, int offset) {
return buffer[offset] << 24 | (buffer[offset + 1] & 0xff) << 16 | (buffer[offset + 2] & 0xff) << 8 return buffer[offset] << 24 | (buffer[offset + 1] & 0xff) << 16
| (buffer[offset + 2] & 0xff) << 8
| (buffer[offset + 3] & 0xff); | (buffer[offset + 3] & 0xff);
} }
@ -62,9 +64,11 @@ final class Deserializer {
* @return the long value. * @return the long value.
*/ */
static long getLong(byte[] buffer, int offset) { static long getLong(byte[] buffer, int offset) {
return (buffer[offset] & 0xffL) << 56 | (buffer[offset + 1] & 0xffL) << 48 | (buffer[offset + 2] & 0xffL) << 40 return (buffer[offset] & 0xffL) << 56 | (buffer[offset + 1] & 0xffL) << 48
| (buffer[offset + 2] & 0xffL) << 40
| (buffer[offset + 3] & 0xffL) << 32 | (buffer[offset + 4] & 0xffL) << 24 | (buffer[offset + 3] & 0xffL) << 32 | (buffer[offset + 4] & 0xffL) << 24
| (buffer[offset + 5] & 0xffL) << 16 | (buffer[offset + 6] & 0xffL) << 8 | (buffer[offset + 7] & 0xffL); | (buffer[offset + 5] & 0xffL) << 16 | (buffer[offset + 6] & 0xffL) << 8
| (buffer[offset + 7] & 0xffL);
} }
/** /**

View File

@ -37,7 +37,8 @@ class IndexCache {
/** /**
* Maximum size in bytes of one index block. * Maximum size in bytes of one index block.
*/ */
private static final int SIZE_OF_INDEX_BLOCK = INDEX_ENTRIES_PER_BLOCK * SubFileParameter.BYTES_PER_INDEX_ENTRY; private static final int SIZE_OF_INDEX_BLOCK = INDEX_ENTRIES_PER_BLOCK
* SubFileParameter.BYTES_PER_INDEX_ENTRY;
private final Map<IndexCacheEntryKey, byte[]> map; private final Map<IndexCacheEntryKey, byte[]> map;
private final RandomAccessFile randomAccessFile; private final RandomAccessFile randomAccessFile;
@ -63,11 +64,13 @@ class IndexCache {
} }
/** /**
* Returns the index entry of a block in the given map file. If the required index entry is not cached, it will be * Returns the index entry of a block in the given map file. If the required
* index entry is not cached, it will be
* read from the map file index and put in the cache. * read from the map file index and put in the cache.
* *
* @param subFileParameter * @param subFileParameter
* the parameters of the map file for which the index entry is needed. * the parameters of the map file for which the index entry is
* needed.
* @param blockNumber * @param blockNumber
* the number of the block in the map file. * the number of the block in the map file.
* @return the index entry or -1 if the block number is invalid. * @return the index entry or -1 if the block number is invalid.
@ -83,13 +86,15 @@ class IndexCache {
long indexBlockNumber = blockNumber / INDEX_ENTRIES_PER_BLOCK; long indexBlockNumber = blockNumber / INDEX_ENTRIES_PER_BLOCK;
// create the cache entry key for this request // create the cache entry key for this request
IndexCacheEntryKey indexCacheEntryKey = new IndexCacheEntryKey(subFileParameter, indexBlockNumber); IndexCacheEntryKey indexCacheEntryKey = new IndexCacheEntryKey(subFileParameter,
indexBlockNumber);
// check for cached index block // check for cached index block
byte[] indexBlock = this.map.get(indexCacheEntryKey); byte[] indexBlock = this.map.get(indexCacheEntryKey);
if (indexBlock == null) { if (indexBlock == null) {
// cache miss, seek to the correct index block in the file and read it // cache miss, seek to the correct index block in the file and read it
long indexBlockPosition = subFileParameter.indexStartAddress + indexBlockNumber * SIZE_OF_INDEX_BLOCK; long indexBlockPosition = subFileParameter.indexStartAddress + indexBlockNumber
* SIZE_OF_INDEX_BLOCK;
int remainingIndexSize = (int) (subFileParameter.indexEndAddress - indexBlockPosition); int remainingIndexSize = (int) (subFileParameter.indexEndAddress - indexBlockPosition);
int indexBlockSize = Math.min(SIZE_OF_INDEX_BLOCK, remainingIndexSize); int indexBlockSize = Math.min(SIZE_OF_INDEX_BLOCK, remainingIndexSize);

View File

@ -48,7 +48,8 @@ class IndexCacheEntryKey {
IndexCacheEntryKey other = (IndexCacheEntryKey) obj; IndexCacheEntryKey other = (IndexCacheEntryKey) obj;
if (this.subFileParameter == null && other.subFileParameter != null) { if (this.subFileParameter == null && other.subFileParameter != null) {
return false; return false;
} else if (this.subFileParameter != null && !this.subFileParameter.equals(other.subFileParameter)) { } else if (this.subFileParameter != null
&& !this.subFileParameter.equals(other.subFileParameter)) {
return false; return false;
} else if (this.indexBlockNumber != other.indexBlockNumber) { } else if (this.indexBlockNumber != other.indexBlockNumber) {
return false; return false;
@ -66,7 +67,8 @@ class IndexCacheEntryKey {
*/ */
private int calculateHashCode() { private int calculateHashCode() {
int result = 7; int result = 7;
result = 31 * result + ((this.subFileParameter == null) ? 0 : this.subFileParameter.hashCode()); result = 31 * result
+ ((this.subFileParameter == null) ? 0 : this.subFileParameter.hashCode());
result = 31 * result + (int) (this.indexBlockNumber ^ (this.indexBlockNumber >>> 32)); result = 31 * result + (int) (this.indexBlockNumber ^ (this.indexBlockNumber >>> 32));
return result; return result;
} }

View File

@ -51,8 +51,10 @@ public class ReadBuffer {
} }
/** /**
* Reads the given amount of bytes from the file into the read buffer and resets the internal buffer position. If * Reads the given amount of bytes from the file into the read buffer and
* the capacity of the read buffer is too small, a larger one is created automatically. * resets the internal buffer position. If
* the capacity of the read buffer is too small, a larger one is created
* automatically.
* *
* @param length * @param length
* the amount of bytes to read from the file. * the amount of bytes to read from the file.
@ -134,8 +136,9 @@ public class ReadBuffer {
/** /**
* Converts a variable amount of bytes from the read buffer to a signed int. * Converts a variable amount of bytes from the read buffer to a signed int.
* <p> * <p>
* The first bit is for continuation info, the other six (last byte) or seven (all other bytes) bits are for data. * The first bit is for continuation info, the other six (last byte) or
* The second bit in the last byte indicates the sign of the number. * seven (all other bytes) bits are for data. The second bit in the last
* byte indicates the sign of the number.
* *
* @return the value. * @return the value.
*/ */
@ -192,10 +195,12 @@ public class ReadBuffer {
} }
/** /**
* Converts a variable amount of bytes from the read buffer to a signed int array. * Converts a variable amount of bytes from the read buffer to a signed int
* array.
* <p> * <p>
* The first bit is for continuation info, the other six (last byte) or seven (all other bytes) bits are for data. * The first bit is for continuation info, the other six (last byte) or
* The second bit in the last byte indicates the sign of the number. * seven (all other bytes) bits are for data. The second bit in the last
* byte indicates the sign of the number.
* *
* @param values * @param values
* result values * result values
@ -322,9 +327,11 @@ public class ReadBuffer {
// } // }
/** /**
* Converts a variable amount of bytes from the read buffer to an unsigned int. * Converts a variable amount of bytes from the read buffer to an unsigned
* int.
* <p> * <p>
* The first bit is for continuation info, the other seven bits are for data. * The first bit is for continuation info, the other seven bits are for
* data.
* *
* @return the int value. * @return the int value.
*/ */
@ -396,7 +403,8 @@ public class ReadBuffer {
if (stringLength > 0 && mBufferPosition + stringLength <= mBufferData.length) { if (stringLength > 0 && mBufferPosition + stringLength <= mBufferData.length) {
mBufferPosition += stringLength; mBufferPosition += stringLength;
try { try {
return new String(mBufferData, mBufferPosition - stringLength, stringLength, CHARSET_UTF8); return new String(mBufferData, mBufferPosition - stringLength, stringLength,
CHARSET_UTF8);
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
throw new IllegalStateException(e); throw new IllegalStateException(e);
} }

View File

@ -59,7 +59,8 @@ final class OptionalFields {
*/ */
private static final int START_ZOOM_LEVEL_MAX = 22; private static final int START_ZOOM_LEVEL_MAX = 22;
static OpenResult readOptionalFields(ReadBuffer readBuffer, MapFileInfoBuilder mapFileInfoBuilder) { static OpenResult readOptionalFields(ReadBuffer readBuffer,
MapFileInfoBuilder mapFileInfoBuilder) {
OptionalFields optionalFields = new OptionalFields(readBuffer.readByte()); OptionalFields optionalFields = new OptionalFields(readBuffer.readByte());
mapFileInfoBuilder.optionalFields = optionalFields; mapFileInfoBuilder.optionalFields = optionalFields;
@ -106,13 +107,15 @@ final class OptionalFields {
if (this.hasStartPosition) { if (this.hasStartPosition) {
// get and check the start position latitude (4 byte) // get and check the start position latitude (4 byte)
int mapStartLatitude = readBuffer.readInt(); int mapStartLatitude = readBuffer.readInt();
if (mapStartLatitude < RequiredFields.LATITUDE_MIN || mapStartLatitude > RequiredFields.LATITUDE_MAX) { if (mapStartLatitude < RequiredFields.LATITUDE_MIN
|| mapStartLatitude > RequiredFields.LATITUDE_MAX) {
return new OpenResult("invalid map start latitude: " + mapStartLatitude); return new OpenResult("invalid map start latitude: " + mapStartLatitude);
} }
// get and check the start position longitude (4 byte) // get and check the start position longitude (4 byte)
int mapStartLongitude = readBuffer.readInt(); int mapStartLongitude = readBuffer.readInt();
if (mapStartLongitude < RequiredFields.LONGITUDE_MIN || mapStartLongitude > RequiredFields.LONGITUDE_MAX) { if (mapStartLongitude < RequiredFields.LONGITUDE_MIN
|| mapStartLongitude > RequiredFields.LONGITUDE_MAX) {
return new OpenResult("invalid map start longitude: " + mapStartLongitude); return new OpenResult("invalid map start longitude: " + mapStartLongitude);
} }

View File

@ -104,11 +104,13 @@ final class RequiredFields {
return new OpenResult("invalid longitude range: " + minLongitude + SPACE + maxLongitude); return new OpenResult("invalid longitude range: " + minLongitude + SPACE + maxLongitude);
} }
mapFileInfoBuilder.boundingBox = new BoundingBox(minLatitude, minLongitude, maxLatitude, maxLongitude); mapFileInfoBuilder.boundingBox = new BoundingBox(minLatitude, minLongitude, maxLatitude,
maxLongitude);
return OpenResult.SUCCESS; return OpenResult.SUCCESS;
} }
static OpenResult readFileSize(ReadBuffer readBuffer, long fileSize, MapFileInfoBuilder mapFileInfoBuilder) { static OpenResult readFileSize(ReadBuffer readBuffer, long fileSize,
MapFileInfoBuilder mapFileInfoBuilder) {
// get and check the file size (8 bytes) // get and check the file size (8 bytes)
long headerFileSize = readBuffer.readLong(); long headerFileSize = readBuffer.readLong();
if (headerFileSize != fileSize) { if (headerFileSize != fileSize) {
@ -174,7 +176,8 @@ final class RequiredFields {
return OpenResult.SUCCESS; return OpenResult.SUCCESS;
} }
static OpenResult readProjectionName(ReadBuffer readBuffer, MapFileInfoBuilder mapFileInfoBuilder) { static OpenResult readProjectionName(ReadBuffer readBuffer,
MapFileInfoBuilder mapFileInfoBuilder) {
// get and check the projection name // get and check the projection name
String projectionName = readBuffer.readUTF8EncodedString(); String projectionName = readBuffer.readUTF8EncodedString();
if (!MERCATOR.equals(projectionName)) { if (!MERCATOR.equals(projectionName)) {

View File

@ -120,14 +120,18 @@ public class SubFileParameter {
this.hashCodeValue = calculateHashCode(); this.hashCodeValue = calculateHashCode();
// calculate the XY numbers of the boundary tiles in this sub-file // calculate the XY numbers of the boundary tiles in this sub-file
this.boundaryTileBottom = MercatorProjection.latitudeToTileY(subFileParameterBuilder.boundingBox.minLatitudeE6 this.boundaryTileBottom = MercatorProjection.latitudeToTileY(
/ COORDINATES_DIVISOR, this.baseZoomLevel); subFileParameterBuilder.boundingBox.minLatitudeE6
this.boundaryTileLeft = MercatorProjection.longitudeToTileX(subFileParameterBuilder.boundingBox.minLongitudeE6 / COORDINATES_DIVISOR, this.baseZoomLevel);
/ COORDINATES_DIVISOR, this.baseZoomLevel); this.boundaryTileLeft = MercatorProjection.longitudeToTileX(
this.boundaryTileTop = MercatorProjection.latitudeToTileY(subFileParameterBuilder.boundingBox.maxLatitudeE6 subFileParameterBuilder.boundingBox.minLongitudeE6
/ COORDINATES_DIVISOR, this.baseZoomLevel); / COORDINATES_DIVISOR, this.baseZoomLevel);
this.boundaryTileRight = MercatorProjection.longitudeToTileX(subFileParameterBuilder.boundingBox.maxLongitudeE6 this.boundaryTileTop = MercatorProjection.latitudeToTileY(
/ COORDINATES_DIVISOR, this.baseZoomLevel); subFileParameterBuilder.boundingBox.maxLatitudeE6
/ COORDINATES_DIVISOR, this.baseZoomLevel);
this.boundaryTileRight = MercatorProjection.longitudeToTileX(
subFileParameterBuilder.boundingBox.maxLongitudeE6
/ COORDINATES_DIVISOR, this.baseZoomLevel);
// calculate the horizontal and vertical amount of blocks in this sub-file // calculate the horizontal and vertical amount of blocks in this sub-file
this.blocksWidth = this.boundaryTileRight - this.boundaryTileLeft + 1; this.blocksWidth = this.boundaryTileRight - this.boundaryTileLeft + 1;

View File

@ -1239,8 +1239,10 @@ public class MapDatabase implements IMapDatabase {
mCacheFile = null; mCacheFile = null;
} }
/* All code below is taken from or based on Google's Protocol Buffers /*
* implementation: */ * All code below is taken from or based on Google's Protocol Buffers
* implementation:
*/
// Protocol Buffers - Google's data interchange format // Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved. // Copyright 2008 Google Inc. All rights reserved.

View File

@ -107,7 +107,8 @@ abstract class Geometry implements Serializable {
boolean haveMeasure = false; boolean haveMeasure = false;
/** /**
* The OGIS geometry type of this feature. this is final as it never changes, it is bound to the subclass of the * The OGIS geometry type of this feature. this is final as it never
* changes, it is bound to the subclass of the
* instance. * instance.
*/ */
final int type; final int type;
@ -165,7 +166,8 @@ abstract class Geometry implements Serializable {
} }
/** /**
* geometry specific equals implementation - only defined for non-null values * geometry specific equals implementation - only defined for non-null
* values
* *
* @param other * @param other
* ... * ...
@ -180,7 +182,8 @@ abstract class Geometry implements Serializable {
} }
/** /**
* Whether test coordinates for geometry - subclass specific code Implementors can assume that dimensin, type, srid * Whether test coordinates for geometry - subclass specific code
* Implementors can assume that dimensin, type, srid
* and haveMeasure are equal, other != null and other is the same subclass. * and haveMeasure are equal, other != null and other is the same subclass.
* *
* @param other * @param other
@ -245,7 +248,8 @@ abstract class Geometry implements Serializable {
} }
/** /**
* Queries the number of geometric dimensions of this geometry. This does not include measures, as opposed to the * Queries the number of geometric dimensions of this geometry. This does
* not include measures, as opposed to the
* server. * server.
* *
* @return The dimensionality (eg, 2D or 3D) of this geometry. * @return The dimensionality (eg, 2D or 3D) of this geometry.
@ -264,7 +268,8 @@ abstract class Geometry implements Serializable {
} }
/** /**
* Recursively sets the srid on this geometry and all contained subgeometries * Recursively sets the srid on this geometry and all contained
* subgeometries
* *
* @param srid * @param srid
* ... * ...
@ -286,7 +291,8 @@ abstract class Geometry implements Serializable {
} }
/** /**
* Render the WKT version of this Geometry (without SRID) into the given StringBuffer. * Render the WKT version of this Geometry (without SRID) into the given
* StringBuffer.
* *
* @param sb * @param sb
* ... * ...
@ -306,7 +312,8 @@ abstract class Geometry implements Serializable {
} }
/** /**
* Render the WKT without the type name, but including the brackets into the StringBuffer * Render the WKT without the type name, but including the brackets into the
* StringBuffer
* *
* @param sb * @param sb
* ... * ...
@ -318,7 +325,8 @@ abstract class Geometry implements Serializable {
} }
/** /**
* Render the "inner" part of the WKT (inside the brackets) into the StringBuffer. * Render the "inner" part of the WKT (inside the brackets) into the
* StringBuffer.
* *
* @param SB * @param SB
* ... * ...
@ -337,10 +345,14 @@ abstract class Geometry implements Serializable {
} }
/** /**
* Do some internal consistency checks on the geometry. Currently, all Geometries must have a valid dimension (2 or * Do some internal consistency checks on the geometry. Currently, all
* 3) and a valid type. 2-dimensional Points must have Z=0.0, as well as non-measured Points must have m=0.0. * Geometries must have a valid dimension (2 or
* Composed geometries must have all equal SRID, dimensionality and measures, as well as that they do not contain * 3) and a valid type. 2-dimensional Points must have Z=0.0, as well as
* NULL or inconsistent subgeometries. BinaryParser and WKTParser should only generate consistent geometries. * non-measured Points must have m=0.0.
* Composed geometries must have all equal SRID, dimensionality and
* measures, as well as that they do not contain
* NULL or inconsistent subgeometries. BinaryParser and WKTParser should
* only generate consistent geometries.
* BinaryWriter may produce invalid results on inconsistent geometries. * BinaryWriter may produce invalid results on inconsistent geometries.
* *
* @return true if all checks are passed. * @return true if all checks are passed.

View File

@ -248,7 +248,8 @@ public class MapDatabase implements IMapDatabase {
} }
/** /**
* Parse a binary encoded geometry. Is synchronized to protect offset counter. (Unfortunately, Java does not have * Parse a binary encoded geometry. Is synchronized to protect offset
* counter. (Unfortunately, Java does not have
* neither call by reference nor multiple return values.) * neither call by reference nor multiple return values.)
* *
* @param value * @param value

View File

@ -66,7 +66,8 @@ abstract class ValueGetter {
protected abstract int getInt(int index); protected abstract int getInt(int index);
/** /**
* Get a long value. This is not needed directly, but as a nice side-effect from GetDouble. * Get a long value. This is not needed directly, but as a nice side-effect
* from GetDouble.
* *
* @param index * @param index
* ... * ...
@ -101,9 +102,12 @@ abstract class ValueGetter {
protected long getLong(int index) { protected long getLong(int index) {
return ((long) (data[index] & 0xFF) << 56) | ((long) (data[index + 1] & 0xFF) << 48) return ((long) (data[index] & 0xFF) << 56) | ((long) (data[index + 1] & 0xFF) << 48)
| ((long) (data[index + 2] & 0xFF) << 40) | ((long) (data[index + 3] & 0xFF) << 32) | ((long) (data[index + 2] & 0xFF) << 40)
| ((long) (data[index + 4] & 0xFF) << 24) | ((long) (data[index + 5] & 0xFF) << 16) | ((long) (data[index + 3] & 0xFF) << 32)
| ((long) (data[index + 6] & 0xFF) << 8) | ((long) (data[index + 7] & 0xFF) << 0); | ((long) (data[index + 4] & 0xFF) << 24)
| ((long) (data[index + 5] & 0xFF) << 16)
| ((long) (data[index + 6] & 0xFF) << 8)
| ((long) (data[index + 7] & 0xFF) << 0);
} }
} }
@ -122,9 +126,12 @@ abstract class ValueGetter {
@Override @Override
protected long getLong(int index) { protected long getLong(int index) {
return ((long) (data[index + 7] & 0xFF) << 56) | ((long) (data[index + 6] & 0xFF) << 48) return ((long) (data[index + 7] & 0xFF) << 56)
| ((long) (data[index + 5] & 0xFF) << 40) | ((long) (data[index + 4] & 0xFF) << 32) | ((long) (data[index + 6] & 0xFF) << 48)
| ((long) (data[index + 3] & 0xFF) << 24) | ((long) (data[index + 2] & 0xFF) << 16) | ((long) (data[index + 5] & 0xFF) << 40)
| ((long) (data[index + 4] & 0xFF) << 32)
| ((long) (data[index + 3] & 0xFF) << 24)
| ((long) (data[index + 2] & 0xFF) << 16)
| ((long) (data[index + 1] & 0xFF) << 8) | ((long) (data[index] & 0xFF) << 0); | ((long) (data[index + 1] & 0xFF) << 8) | ((long) (data[index] & 0xFF) << 0);
} }

View File

@ -14,7 +14,6 @@
*/ */
package org.oscim.database.test; package org.oscim.database.test;
import org.oscim.core.BoundingBox; import org.oscim.core.BoundingBox;
import org.oscim.core.Tag; import org.oscim.core.Tag;
import org.oscim.core.Tile; import org.oscim.core.Tile;

View File

@ -210,6 +210,7 @@ public class TileGenerator implements IRenderCallback, IMapDatabaseCallback {
/** /**
* Sets the scale stroke factor for the given zoom level. * Sets the scale stroke factor for the given zoom level.
*
* @param zoomLevel * @param zoomLevel
* the zoom level for which the scale stroke factor should be * the zoom level for which the scale stroke factor should be
* set. * set.

View File

@ -33,6 +33,7 @@ public class DefaultResourceProxyImpl implements ResourceProxy, MapViewConstants
/** /**
* Constructor. * Constructor.
*
* @param pContext * @param pContext
* Used to get the display metrics that are used for scaling the * Used to get the display metrics that are used for scaling the
* bitmaps returned by {@@link getBitmap}. Can be null, * bitmaps returned by {@@link getBitmap}. Can be null,

View File

@ -188,6 +188,7 @@ public class ItemizedIconOverlay<Item extends OverlayItem> extends ItemizedOverl
* When a content sensitive action is performed the content item needs to be * When a content sensitive action is performed the content item needs to be
* identified. This method does that and then performs the assigned task on * identified. This method does that and then performs the assigned task on
* that item. * that item.
*
* @param event * @param event
* ... * ...
* @param mapView * @param mapView
@ -256,6 +257,7 @@ public class ItemizedIconOverlay<Item extends OverlayItem> extends ItemizedOverl
* When the item is touched one of these methods may be invoked depending on * When the item is touched one of these methods may be invoked depending on
* the type of touch. Each of them returns true if the event was completely * the type of touch. Each of them returns true if the event was completely
* handled. * handled.
*
* @param <T> * @param <T>
* .... * ....
*/ */

View File

@ -39,6 +39,7 @@ import android.opengl.Matrix;
* lowest index is drawn as last and therefore the 'topmost' marker. It also * lowest index is drawn as last and therefore the 'topmost' marker. It also
* gets checked for onTap first. This class is generic, because you then you get * gets checked for onTap first. This class is generic, because you then you get
* your custom item-class passed back in onTap(). * your custom item-class passed back in onTap().
*
* @param <Item> * @param <Item>
* ... * ...
*/ */
@ -220,6 +221,7 @@ public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay
/** /**
* Method by which subclasses create the actual Items. This will only be * Method by which subclasses create the actual Items. This will only be
* called from populate() we'll cache them for later use. * called from populate() we'll cache them for later use.
*
* @param i * @param i
* ... * ...
* @return ... * @return ...
@ -228,6 +230,7 @@ public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay
/** /**
* The number of items in this overlay. * The number of items in this overlay.
*
* @return ... * @return ...
*/ */
public abstract int size(); public abstract int size();
@ -293,6 +296,7 @@ public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay
/** /**
* Returns the Item at the given index. * Returns the Item at the given index.
*
* @param position * @param position
* the position of the item to return * the position of the item to return
* @return the Item of the given index. * @return the Item of the given index.
@ -321,6 +325,7 @@ public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay
* Override to modify the way an item is hit tested. The hit point is * Override to modify the way an item is hit tested. The hit point is
* relative to the marker's bounds. The default implementation just checks * relative to the marker's bounds. The default implementation just checks
* to see if the hit point is within the touchable bounds of the marker. * to see if the hit point is within the touchable bounds of the marker.
*
* @param item * @param item
* the item to hit test * the item to hit test
* @param marker * @param marker
@ -340,6 +345,7 @@ public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay
/** /**
* Set whether or not to draw the focused item. The default is to draw it, * Set whether or not to draw the focused item. The default is to draw it,
* but some clients may prefer to draw the focused item themselves. * but some clients may prefer to draw the focused item themselves.
*
* @param drawFocusedItem * @param drawFocusedItem
* ... * ...
*/ */
@ -354,6 +360,7 @@ public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay
* move the map, so if the Item isn't already centered, the user may get * move the map, so if the Item isn't already centered, the user may get
* confused. If the Item is not found, this is a no-op. You can also pass * confused. If the Item is not found, this is a no-op. You can also pass
* null to remove focus. * null to remove focus.
*
* @param item * @param item
* ... * ...
*/ */
@ -373,6 +380,7 @@ public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay
* Adjusts a drawable's bounds so that (0,0) is a pixel in the location * Adjusts a drawable's bounds so that (0,0) is a pixel in the location
* described by the hotspot parameter. Useful for "pin"-like graphics. For * described by the hotspot parameter. Useful for "pin"-like graphics. For
* convenience, returns the same drawable that was passed in. * convenience, returns the same drawable that was passed in.
*
* @param marker * @param marker
* the drawable to adjust * the drawable to adjust
* @param hotspot * @param hotspot

View File

@ -19,6 +19,7 @@ package org.oscim.overlay;
/** /**
* This class contains constants used by the map view. * This class contains constants used by the map view.
*
* @author Nicolas Gramlich * @author Nicolas Gramlich
*/ */
public interface MapViewConstants { public interface MapViewConstants {

View File

@ -36,6 +36,7 @@ import android.view.MotionEvent;
* {@link android.view.GestureDetector.SimpleOnGestureListener} and * {@link android.view.GestureDetector.SimpleOnGestureListener} and
* GestureDetector.OnGestureListener. The difference is there is an additional * GestureDetector.OnGestureListener. The difference is there is an additional
* argument for the item. * argument for the item.
*
* @author Nicolas Gramlich * @author Nicolas Gramlich
*/ */
public abstract class Overlay implements OverlayConstants { public abstract class Overlay implements OverlayConstants {
@ -94,6 +95,7 @@ public abstract class Overlay implements OverlayConstants {
/** /**
* Sets whether the Overlay is marked to be enabled. This setting does * Sets whether the Overlay is marked to be enabled. This setting does
* nothing by default, but should be checked before calling draw(). * nothing by default, but should be checked before calling draw().
*
* @param pEnabled * @param pEnabled
* ... * ...
*/ */
@ -104,6 +106,7 @@ public abstract class Overlay implements OverlayConstants {
/** /**
* Specifies if the Overlay is marked to be enabled. This should be checked * Specifies if the Overlay is marked to be enabled. This should be checked
* before calling draw(). * before calling draw().
*
* @return true if the Overlay is marked enabled, false otherwise * @return true if the Overlay is marked enabled, false otherwise
*/ */
public boolean isEnabled() { public boolean isEnabled() {
@ -115,6 +118,7 @@ public abstract class Overlay implements OverlayConstants {
* IDs cannot be fixed at compile time. Overlays should use this method to * IDs cannot be fixed at compile time. Overlays should use this method to
* obtain and store a menu id for each menu item at construction time. This * obtain and store a menu id for each menu item at construction time. This
* will ensure that two overlays don't use the same id. * will ensure that two overlays don't use the same id.
*
* @return an integer suitable to be used as a menu identifier * @return an integer suitable to be used as a menu identifier
*/ */
protected final static int getSafeMenuId() { protected final static int getSafeMenuId() {
@ -125,6 +129,7 @@ public abstract class Overlay implements OverlayConstants {
* Similar to <see cref="getSafeMenuId" />, except this reserves a sequence * Similar to <see cref="getSafeMenuId" />, except this reserves a sequence
* of IDs of length <param name="count" />. The returned number is the * of IDs of length <param name="count" />. The returned number is the
* starting index of that sequential list. * starting index of that sequential list.
*
* @param count * @param count
* .... * ....
* @return an integer suitable to be used as a menu identifier * @return an integer suitable to be used as a menu identifier
@ -159,6 +164,7 @@ public abstract class Overlay implements OverlayConstants {
/** /**
* Override to perform clean up of resources before shutdown. By default * Override to perform clean up of resources before shutdown. By default
* does nothing. * does nothing.
*
* @param mapView * @param mapView
* ... * ...
*/ */
@ -170,6 +176,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If * Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the * you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event. * underlying {@link MapView} has the chance to handle this event.
*
* @param keyCode * @param keyCode
* ... * ...
* @param event * @param event
@ -187,6 +194,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If * Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the * you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event. * underlying {@link MapView} has the chance to handle this event.
*
* @param keyCode * @param keyCode
* ... * ...
* @param event * @param event
@ -205,6 +213,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If * Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the * you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event. * underlying {@link MapView} has the chance to handle this event.
*
* @param e * @param e
* ... * ...
* @param mapView * @param mapView
@ -220,6 +229,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If * Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the * you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event. * underlying {@link MapView} has the chance to handle this event.
*
* @param e * @param e
* ... * ...
* @param mapView * @param mapView
@ -237,6 +247,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If * Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the * you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event. * underlying {@link MapView} has the chance to handle this event.
*
* @param e * @param e
* ... * ...
* @param mapView * @param mapView
@ -252,6 +263,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If * Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the * you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event. * underlying {@link MapView} has the chance to handle this event.
*
* @param e * @param e
* ... * ...
* @param mapView * @param mapView
@ -267,6 +279,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If * Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the * you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event. * underlying {@link MapView} has the chance to handle this event.
*
* @param e * @param e
* ... * ...
* @param mapView * @param mapView
@ -284,6 +297,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If * Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the * you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event. * underlying {@link MapView} has the chance to handle this event.
*
* @param e * @param e
* ... * ...
* @param mapView * @param mapView
@ -299,6 +313,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If * Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the * you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event. * underlying {@link MapView} has the chance to handle this event.
*
* @param pEvent1 * @param pEvent1
* ... * ...
* @param pEvent2 * @param pEvent2
@ -321,6 +336,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If * Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the * you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event. * underlying {@link MapView} has the chance to handle this event.
*
* @param e * @param e
* ... * ...
* @param mapView * @param mapView
@ -336,6 +352,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If * Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the * you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event. * underlying {@link MapView} has the chance to handle this event.
*
* @param pEvent1 * @param pEvent1
* ... * ...
* @param pEvent2 * @param pEvent2
@ -368,6 +385,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If * Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the * you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event. * underlying {@link MapView} has the chance to handle this event.
*
* @param e * @param e
* ... * ...
* @param mapView * @param mapView
@ -428,6 +446,7 @@ public abstract class Overlay implements OverlayConstants {
/** /**
* Checks to see if the given x and y are close enough to an item * Checks to see if the given x and y are close enough to an item
* resulting in snapping the current action (e.g. zoom) to the item. * resulting in snapping the current action (e.g. zoom) to the item.
*
* @param x * @param x
* The x in screen coordinates. * The x in screen coordinates.
* @param y * @param y

View File

@ -24,6 +24,7 @@ import android.graphics.drawable.Drawable;
/** /**
* Immutable class describing a GeoPoint with a Title and a Description. * Immutable class describing a GeoPoint with a Title and a Description.
*
* @author Nicolas Gramlich * @author Nicolas Gramlich
* @author Theodore Hong * @author Theodore Hong
* @author Fred Eisele * @author Fred Eisele
@ -102,7 +103,8 @@ public class OverlayItem {
return mGeoPoint; return mGeoPoint;
} }
/* (copied from Google API docs) Returns the marker that should be used when /*
* (copied from Google API docs) Returns the marker that should be used when
* drawing this item on the map. A null value means that the default marker * drawing this item on the map. A null value means that the default marker
* should be drawn. Different markers can be returned for different states. * should be drawn. Different markers can be returned for different states.
* The different markers can have different bounds. The default behavior is * The different markers can have different bounds. The default behavior is
@ -110,7 +112,8 @@ public class OverlayItem {
* overlay item's marker, if it exists, and then return it. * overlay item's marker, if it exists, and then return it.
* @param stateBitset The current state. * @param stateBitset The current state.
* @return The marker for the current state, or null if the default marker * @return The marker for the current state, or null if the default marker
* for the overlay should be used. */ * for the overlay should be used.
*/
public Drawable getMarker(final int stateBitset) { public Drawable getMarker(final int stateBitset) {
// marker not specified // marker not specified
if (mMarker == null) { if (mMarker == null) {
@ -141,12 +144,14 @@ public class OverlayItem {
// =========================================================== // ===========================================================
// Methods // Methods
// =========================================================== // ===========================================================
/* (copied from the Google API docs) Sets the state of a drawable to match a /*
* (copied from the Google API docs) Sets the state of a drawable to match a
* given state bitset. This is done by converting the state bitset bits * given state bitset. This is done by converting the state bitset bits
* into * into
* a state set of R.attr.state_pressed, R.attr.state_selected and * a state set of R.attr.state_pressed, R.attr.state_selected and
* R.attr.state_focused attributes, and then calling {@link * R.attr.state_focused attributes, and then calling {@link
* Drawable.setState(int[])}. */ * Drawable.setState(int[])}.
*/
public static void setState(final Drawable drawable, final int stateBitset) { public static void setState(final Drawable drawable, final int stateBitset) {
final int[] states = new int[3]; final int[] states = new int[3];
int index = 0; int index = 0;

View File

@ -192,6 +192,7 @@ public class PathOverlay extends Overlay {
/** /**
* Draw a great circle. Calculate a point for every 100km along the path. * Draw a great circle. Calculate a point for every 100km along the path.
*
* @param startPoint * @param startPoint
* start point of the great circle * start point of the great circle
* @param endPoint * @param endPoint
@ -212,6 +213,7 @@ public class PathOverlay extends Overlay {
/** /**
* Draw a great circle. * Draw a great circle.
*
* @param startPoint * @param startPoint
* start point of the great circle * start point of the great circle
* @param endPoint * @param endPoint

View File

@ -53,6 +53,7 @@ public interface ResourceProxy {
/** /**
* Use a string resource as a format definition, and format using the * Use a string resource as a format definition, and format using the
* supplied format arguments. * supplied format arguments.
*
* @param pResId * @param pResId
* ... * ...
* @param formatArgs * @param formatArgs
@ -65,6 +66,7 @@ public interface ResourceProxy {
/** /**
* Get a bitmap as a {@link Drawable} * Get a bitmap as a {@link Drawable}
*
* @param pResId * @param pResId
* ... * ...
* @return ... * @return ...
@ -73,6 +75,7 @@ public interface ResourceProxy {
/** /**
* Gets the density from the current screen's DisplayMetrics * Gets the density from the current screen's DisplayMetrics
*
* @return the screen's density * @return the screen's density
*/ */
float getDisplayMetricsDensity(); float getDisplayMetricsDensity();

View File

@ -146,6 +146,7 @@ public final class PolygonRenderer {
/** /**
* draw polygon layers (unil layer.next is not polygon layer) * draw polygon layers (unil layer.next is not polygon layer)
* using stencil buffer method * using stencil buffer method
*
* @param pos * @param pos
* used to fade layers accorind to 'fade' * used to fade layers accorind to 'fade'
* in layer.area. * in layer.area.
@ -234,6 +235,7 @@ public final class PolygonRenderer {
/** /**
* Draw a tile filling rectangle to set stencil- and depth buffer * Draw a tile filling rectangle to set stencil- and depth buffer
* appropriately * appropriately
*
* @param first in the first run the clip region is set based on * @param first in the first run the clip region is set based on
* depth buffer and depth buffer is updated * depth buffer and depth buffer is updated
*/ */
@ -305,8 +307,10 @@ public final class PolygonRenderer {
glUniformMatrix4fv(hPolygonMatrix, 1, false, matrix, 0); glUniformMatrix4fv(hPolygonMatrix, 1, false, matrix, 0);
} }
/* clear stencilbuffer (tile region) by drawing /*
* a quad with func 'always' and op 'zero' */ * clear stencilbuffer (tile region) by drawing
* a quad with func 'always' and op 'zero'
*/
// disable drawing to framebuffer (will be re-enabled in fill) // disable drawing to framebuffer (will be re-enabled in fill)
glColorMask(false, false, false, false); glColorMask(false, false, false, false);

View File

@ -160,8 +160,10 @@ public abstract class ScanBox {
} }
} }
/* ported from Polymaps: Layer.js Copyright (c) 2010, SimpleGeo and Stamen /*
* Design */ * ported from Polymaps: Layer.js Copyright (c) 2010, SimpleGeo and Stamen
* Design
*/
// // scan-line conversion // // scan-line conversion
// function edge(a, b) { // function edge(a, b) {

View File

@ -152,6 +152,7 @@ public class TileManager {
* Update list of visible tiles and passes them to TileManager, when not * Update list of visible tiles and passes them to TileManager, when not
* available tiles are created and added to JobQueue (mapView.addJobs) for * available tiles are created and added to JobQueue (mapView.addJobs) for
* loading by TileGenerator class * loading by TileGenerator class
*
* @param clear * @param clear
* whether to clear and reload all tiles * whether to clear and reload all tiles
*/ */
@ -292,6 +293,7 @@ public class TileManager {
/** /**
* set mNewTiles for the visible tiles and pass it to GLRenderer, add jobs * set mNewTiles for the visible tiles and pass it to GLRenderer, add jobs
* for not yet loaded tiles * for not yet loaded tiles
*
* @param mapPosition * @param mapPosition
* the current MapPosition * the current MapPosition
* @param zdir * @param zdir
@ -556,6 +558,7 @@ public class TileManager {
/** /**
* called from MapWorker Thread when tile is loaded by TileGenerator * called from MapWorker Thread when tile is loaded by TileGenerator
*
* @param jobTile * @param jobTile
* Tile ready for upload to GL * Tile ready for upload to GL
* @return ... caller does not care * @return ... caller does not care

View File

@ -57,6 +57,7 @@ public final class LineLayer extends Layer {
/** /**
* line extrusion is based on code from GLMap * line extrusion is based on code from GLMap
* (https://github.com/olofsj/GLMap/) * (https://github.com/olofsj/GLMap/)
*
* @param points * @param points
* array of points as x,y pairs * array of points as x,y pairs
* @param index * @param index

View File

@ -45,6 +45,7 @@ public abstract class RenderOverlay {
* called 1. by GLRenderer. Set 'newData' true when 'compile()' should be * called 1. by GLRenderer. Set 'newData' true when 'compile()' should be
* called * called
* before next 'render()' * before next 'render()'
*
* @param curPos TODO * @param curPos TODO
* @param positionChanged * @param positionChanged
* true when MapPosition has changed * true when MapPosition has changed
@ -61,6 +62,7 @@ public abstract class RenderOverlay {
/** /**
* called 3. draw overlay * called 3. draw overlay
*
* @param pos * @param pos
* current MapPosition * current MapPosition
* @param mv * @param mv
@ -73,6 +75,7 @@ public abstract class RenderOverlay {
/** /**
* Utility: set matrix relative to the difference of current MapPosition * Utility: set matrix relative to the difference of current MapPosition
* and the last updated Overlay MapPosition * and the last updated Overlay MapPosition
*
* @param curPos ... * @param curPos ...
* @param matrix ... * @param matrix ...
*/ */
@ -106,6 +109,7 @@ public abstract class RenderOverlay {
/** /**
* Utility: update mMapPosition * Utility: update mMapPosition
*
* @return true if position has changed * @return true if position has changed
*/ */
protected boolean updateMapPosition() { protected boolean updateMapPosition() {

View File

@ -21,9 +21,9 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.ObjectInputStream; import java.io.ObjectInputStream;
/** /**
* An ExternalRenderTheme allows for customizing the rendering style of the map via an XML file. * An ExternalRenderTheme allows for customizing the rendering style of the map
* via an XML file.
*/ */
public class ExternalRenderTheme implements Theme { public class ExternalRenderTheme implements Theme {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -101,7 +101,8 @@ public class ExternalRenderTheme implements Theme {
mHashCodeValue = calculateHashCode(); mHashCodeValue = calculateHashCode();
} }
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { private void readObject(ObjectInputStream objectInputStream) throws IOException,
ClassNotFoundException {
objectInputStream.defaultReadObject(); objectInputStream.defaultReadObject();
calculateTransientValues(); calculateTransientValues();
} }

View File

@ -276,6 +276,7 @@ public class RenderTheme {
/** /**
* Matches a way with the given parameters against this RenderTheme. * Matches a way with the given parameters against this RenderTheme.
*
* @param renderCallback * @param renderCallback
* the callback implementation which will be executed on each * the callback implementation which will be executed on each
* match. * match.
@ -442,6 +443,7 @@ public class RenderTheme {
/** /**
* Scales the stroke width of this RenderTheme by the given factor. * Scales the stroke width of this RenderTheme by the given factor.
*
* @param scaleFactor * @param scaleFactor
* the factor by which the stroke width should be scaled. * the factor by which the stroke width should be scaled.
*/ */
@ -453,6 +455,7 @@ public class RenderTheme {
/** /**
* Scales the text size of this RenderTheme by the given factor. * Scales the text size of this RenderTheme by the given factor.
*
* @param scaleFactor * @param scaleFactor
* the factor by which the text size should be scaled. * the factor by which the text size should be scaled.
*/ */

View File

@ -21,7 +21,8 @@ enum FontFamily {
/** /**
* @return the typeface object of this FontFamily. * @return the typeface object of this FontFamily.
* @see <a href="http://developer.android.com/reference/android/graphics/Typeface.html">Typeface</a> * @see <a
* href="http://developer.android.com/reference/android/graphics/Typeface.html">Typeface</a>
*/ */
Typeface toTypeface() { Typeface toTypeface() {
switch (this) { switch (this) {

View File

@ -19,7 +19,8 @@ enum FontStyle {
/** /**
* @return the constant int value of this FontStyle. * @return the constant int value of this FontStyle.
* @see <a href="http://developer.android.com/reference/android/graphics/Typeface.html">Typeface</a> * @see <a
* href="http://developer.android.com/reference/android/graphics/Typeface.html">Typeface</a>
*/ */
int toInt() { int toInt() {
switch (this) { switch (this) {

View File

@ -27,7 +27,8 @@ public final class AndroidUtils {
private static final String[] EMULATOR_NAMES = { "google_sdk", "sdk" }; private static final String[] EMULATOR_NAMES = { "google_sdk", "sdk" };
/** /**
* @return true if the application is running on the Android emulator, false otherwise. * @return true if the application is running on the Android emulator, false
* otherwise.
*/ */
public static boolean applicationRunsOnAndroidEmulator() { public static boolean applicationRunsOnAndroidEmulator() {
for (int i = 0, n = EMULATOR_NAMES.length; i < n; ++i) { for (int i = 0, n = EMULATOR_NAMES.length; i < n; ++i) {

View File

@ -23,6 +23,7 @@ public final class GeometryUtils {
/** /**
* Calculates the center of the minimum bounding rectangle for the given * Calculates the center of the minimum bounding rectangle for the given
* coordinates. * coordinates.
*
* @param coordinates * @param coordinates
* the coordinates for which calculation should be done. * the coordinates for which calculation should be done.
* @return the center coordinates of the minimum bounding rectangle. * @return the center coordinates of the minimum bounding rectangle.

View File

@ -126,7 +126,8 @@ public class GlConfigChooser implements GLSurfaceView.EGLConfigChooser {
int s = findConfigAttrib(egl, display, config, EGL10.EGL_STENCIL_SIZE, 0); int s = findConfigAttrib(egl, display, config, EGL10.EGL_STENCIL_SIZE, 0);
/* /*
* EGL_CONFIG_CAVEAT value #define EGL_NONE 0x3038 #define EGL_SLOW_CONFIG 0x3050 #define * EGL_CONFIG_CAVEAT value #define EGL_NONE 0x3038 #define
* EGL_SLOW_CONFIG 0x3050 #define
* EGL_NON_CONFORMANT_CONFIG 0x3051 * EGL_NON_CONFORMANT_CONFIG 0x3051
*/ */

View File

@ -18,8 +18,10 @@ import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
/** /**
* An LRUCache with a fixed size and an access-order policy. Old mappings are automatically removed from the cache when * An LRUCache with a fixed size and an access-order policy. Old mappings are
* new mappings are added. This implementation uses an {@link LinkedHashMap} internally. * automatically removed from the cache when
* new mappings are added. This implementation uses an {@link LinkedHashMap}
* internally.
* *
* @param <K> * @param <K>
* the type of the map key, see {@link Map}. * the type of the map key, see {@link Map}.

View File

@ -111,7 +111,8 @@ public abstract class PausableThread extends Thread {
} }
/** /**
* Called once when this thread continues to work after a pause. The default implementation is empty. * Called once when this thread continues to work after a pause. The default
* implementation is empty.
*/ */
protected void afterPause() { protected void afterPause() {
// do nothing // do nothing
@ -122,7 +123,8 @@ public abstract class PausableThread extends Thread {
} }
/** /**
* Called once at the end of the {@link #run()} method. The default implementation is empty. * Called once at the end of the {@link #run()} method. The default
* implementation is empty.
*/ */
protected void afterRun() { protected void afterRun() {
// do nothing // do nothing
@ -142,7 +144,8 @@ public abstract class PausableThread extends Thread {
protected abstract String getThreadName(); protected abstract String getThreadName();
/** /**
* @return the priority of this thread. The default value is {@link Thread#NORM_PRIORITY}. * @return the priority of this thread. The default value is
* {@link Thread#NORM_PRIORITY}.
*/ */
protected int getThreadPriority() { protected int getThreadPriority() {
return Thread.NORM_PRIORITY; return Thread.NORM_PRIORITY;

View File

@ -100,6 +100,7 @@ public abstract class MapActivity extends Activity {
/** /**
* This method is called once by each MapView during its setup process. * This method is called once by each MapView during its setup process.
*
* @param mapView * @param mapView
* the calling MapView. * the calling MapView.
*/ */

View File

@ -27,7 +27,8 @@ import android.graphics.Paint;
import android.graphics.Typeface; import android.graphics.Typeface;
/** /**
* A MapScaleBar displays the ratio of a distance on the map to the corresponding distance on the ground. * A MapScaleBar displays the ratio of a distance on the map to the
* corresponding distance on the ground.
*/ */
public class MapScaleBar { public class MapScaleBar {
/** /**
@ -128,7 +129,8 @@ public class MapScaleBar {
/** /**
* @param imperialUnits * @param imperialUnits
* true if imperial units should be used rather than metric units. * true if imperial units should be used rather than metric
* units.
*/ */
public void setImperialUnits(boolean imperialUnits) { public void setImperialUnits(boolean imperialUnits) {
mImperialUnits = imperialUnits; mImperialUnits = imperialUnits;

View File

@ -273,6 +273,7 @@ public class MapView extends RelativeLayout {
/** /**
* Calculates all necessary tiles and adds jobs accordingly. * Calculates all necessary tiles and adds jobs accordingly.
*
* @param changedPos TODO * @param changedPos TODO
*/ */
public void redrawMap(boolean changedPos) { public void redrawMap(boolean changedPos) {
@ -344,6 +345,7 @@ public class MapView extends RelativeLayout {
/** /**
* Sets the MapDatabase for this MapView. * Sets the MapDatabase for this MapView.
*
* @param options * @param options
* the new MapDatabase options. * the new MapDatabase options.
* @return ... * @return ...
@ -395,6 +397,7 @@ public class MapView extends RelativeLayout {
/** /**
* Sets the internal theme which is used for rendering the map. * Sets the internal theme which is used for rendering the map.
*
* @param internalRenderTheme * @param internalRenderTheme
* the internal rendering theme. * the internal rendering theme.
* @return ... * @return ...
@ -419,6 +422,7 @@ public class MapView extends RelativeLayout {
/** /**
* Sets the theme file which is used for rendering the map. * Sets the theme file which is used for rendering the map.
*
* @param renderThemePath * @param renderThemePath
* the path to the XML file which defines the rendering theme. * the path to the XML file which defines the rendering theme.
* @throws IllegalArgumentException * @throws IllegalArgumentException
@ -572,6 +576,7 @@ public class MapView extends RelativeLayout {
/** /**
* Sets the center and zoom level of this MapView and triggers a redraw. * Sets the center and zoom level of this MapView and triggers a redraw.
*
* @param mapPosition * @param mapPosition
* the new map position of this MapView. * the new map position of this MapView.
*/ */
@ -585,6 +590,7 @@ public class MapView extends RelativeLayout {
/** /**
* Sets the center of the MapView and triggers a redraw. * Sets the center of the MapView and triggers a redraw.
*
* @param geoPoint * @param geoPoint
* the new center point of the map. * the new center point of the map.
*/ */
@ -604,6 +610,7 @@ public class MapView extends RelativeLayout {
/** /**
* add jobs and remember MapWorkers that stuff needs to be done * add jobs and remember MapWorkers that stuff needs to be done
*
* @param jobs * @param jobs
* tile jobs * tile jobs
*/ */
@ -644,6 +651,7 @@ public class MapView extends RelativeLayout {
* You can add/remove/reorder your Overlays using the List of * You can add/remove/reorder your Overlays using the List of
* {@link Overlay}. The first (index 0) Overlay gets drawn first, the one * {@link Overlay}. The first (index 0) Overlay gets drawn first, the one
* with the highest as the last one. * with the highest as the last one.
*
* @return ... * @return ...
*/ */
public List<Overlay> getOverlays() { public List<Overlay> getOverlays() {

View File

@ -247,6 +247,7 @@ public class MapViewPosition {
/** /**
* ... * ...
*
* @return BoundingBox containing view * @return BoundingBox containing view
*/ */
public synchronized BoundingBox getViewBox() { public synchronized BoundingBox getViewBox() {
@ -298,6 +299,7 @@ public class MapViewPosition {
/** /**
* for x,y in screen coordinates get the point on the map in map-tile * for x,y in screen coordinates get the point on the map in map-tile
* coordinates * coordinates
*
* @param x ... * @param x ...
* @param y ... * @param y ...
* @param reuse ... * @param reuse ...
@ -320,6 +322,7 @@ public class MapViewPosition {
/** /**
* get the GeoPoint for x,y in screen coordinates * get the GeoPoint for x,y in screen coordinates
*
* @param x screen pixel x * @param x screen pixel x
* @param y screen pixel y * @param y screen pixel y
* @return the corresponding GeoPoint * @return the corresponding GeoPoint
@ -344,6 +347,7 @@ public class MapViewPosition {
/** /**
* get the screen pixel for a GeoPoint * get the screen pixel for a GeoPoint
*
* @param geoPoint ... * @param geoPoint ...
* @param reuse ... * @param reuse ...
* @return ... * @return ...
@ -456,6 +460,7 @@ public class MapViewPosition {
/** /**
* Moves this MapViewPosition by the given amount of pixels. * Moves this MapViewPosition by the given amount of pixels.
*
* @param mx the amount of pixels to move the map horizontally. * @param mx the amount of pixels to move the map horizontally.
* @param my the amount of pixels to move the map vertically. * @param my the amount of pixels to move the map vertically.
*/ */
@ -492,6 +497,7 @@ public class MapViewPosition {
/** /**
* - * -
*
* @param scale ... * @param scale ...
* @param pivotX ... * @param pivotX ...
* @param pivotY ... * @param pivotY ...
@ -537,6 +543,7 @@ public class MapViewPosition {
/** /**
* rotate map around pivot cx,cy * rotate map around pivot cx,cy
*
* @param angle ... * @param angle ...
* @param cx ... * @param cx ...
* @param cy ... * @param cy ...

View File

@ -52,6 +52,7 @@ public class TriangleJNI {
/** /**
* !!! NOT for general use!!! - this is specifically for ExtrusionLayer * !!! NOT for general use!!! - this is specifically for ExtrusionLayer
* . * .
*
* @param points points to use: array of x,y coordinates * @param points points to use: array of x,y coordinates
* @param numRings number of rings in polygon == outer(1) + inner rings * @param numRings number of rings in polygon == outer(1) + inner rings
* @param io input: 1. number of all points, 2.. number of points in rings - * @param io input: 1. number of all points, 2.. number of points in rings -