From efdb345e2596386886bfab0947bc573b1f33b310 Mon Sep 17 00:00:00 2001 From: Emux Date: Thu, 7 May 2026 13:50:14 +0300 Subject: [PATCH] Javadoc improvements --- .../vector/geometries/PolygonDrawable.java | 8 ++++---- .../vector/geometries/RectangleDrawable.java | 7 +++++-- vtm/src/org/oscim/core/GeometryBuffer.java | 6 +++--- vtm/src/org/oscim/core/MercatorProjection.java | 2 +- .../org/oscim/layers/marker/MarkerLayer.java | 2 +- vtm/src/org/oscim/renderer/GLMatrix.java | 2 +- vtm/src/org/oscim/renderer/LayerRenderer.java | 10 ---------- .../oscim/renderer/bucket/LineTexBucket.java | 2 +- .../oscim/tiling/source/mapfile/MapFile.java | 4 ++-- vtm/src/org/oscim/utils/ColorUtil.java | 18 +++++++++--------- vtm/src/org/oscim/utils/KeyMap.java | 1 - vtm/src/org/oscim/utils/RTree.java | 12 +++++------- vtm/src/org/oscim/utils/quadtree/BoxTree.java | 2 +- 13 files changed, 33 insertions(+), 43 deletions(-) diff --git a/vtm-jts/src/org/oscim/layers/vector/geometries/PolygonDrawable.java b/vtm-jts/src/org/oscim/layers/vector/geometries/PolygonDrawable.java index 0367d5990..177ae5cd1 100644 --- a/vtm-jts/src/org/oscim/layers/vector/geometries/PolygonDrawable.java +++ b/vtm-jts/src/org/oscim/layers/vector/geometries/PolygonDrawable.java @@ -60,8 +60,8 @@ public PolygonDrawable(List points, Style style) { * * @param points * @param holePoints - * @param outlineColor - * @param outlineAlpha + * @param lineWidth + * @param lineColor * @param fillColor * @param fillAlpha */ @@ -80,8 +80,8 @@ public PolygonDrawable(GeoPoint[] points, GeoPoint[] holePoints, float lineWidth * * @param points * @param holePoints - * @param outlineColor - * @param outlineAlpha + * @param lineWidth + * @param lineColor * @param fillColor * @param fillAlpha */ diff --git a/vtm-jts/src/org/oscim/layers/vector/geometries/RectangleDrawable.java b/vtm-jts/src/org/oscim/layers/vector/geometries/RectangleDrawable.java index a97659eb3..1af905c3c 100644 --- a/vtm-jts/src/org/oscim/layers/vector/geometries/RectangleDrawable.java +++ b/vtm-jts/src/org/oscim/layers/vector/geometries/RectangleDrawable.java @@ -40,8 +40,11 @@ public RectangleDrawable(GeoPoint topLeft, GeoPoint bottomRight, Style style) { * Creates a Rectangle given the top-left and the bottom-right coordinate of * it * - * @param topLeft - * @param bottomRight + * @param minLat + * @param minLon + * @param maxLat + * @param maxLon + * @param style */ public RectangleDrawable(double minLat, double minLon, double maxLat, double maxLon, Style style) { super(style); diff --git a/vtm/src/org/oscim/core/GeometryBuffer.java b/vtm/src/org/oscim/core/GeometryBuffer.java index a75df08ef..bd40527ca 100644 --- a/vtm/src/org/oscim/core/GeometryBuffer.java +++ b/vtm/src/org/oscim/core/GeometryBuffer.java @@ -151,10 +151,10 @@ public GeometryBuffer(GeometryBuffer buffer) { } /** - * @param out PointF to set coordinates to. - * @param i the 2D point position. - * @return when out is null a temporary PointF is + * When out is null a temporary PointF is * returned which belongs to GeometryBuffer. + * @param i the 2D point position. + * @param out PointF to set coordinates to. */ public void getPoint(int i, PointF out) { out.x = points[(i << 1)]; diff --git a/vtm/src/org/oscim/core/MercatorProjection.java b/vtm/src/org/oscim/core/MercatorProjection.java index 13811c4d9..f3be257bc 100644 --- a/vtm/src/org/oscim/core/MercatorProjection.java +++ b/vtm/src/org/oscim/core/MercatorProjection.java @@ -77,7 +77,7 @@ public static GeoPoint fromPixels(double pixelX, double pixelY, long mapSize) { /** * @param scale the scale factor for which the size of the world map should be returned. * @return the horizontal and vertical size of the map in pixel at the given scale. - * @throws IllegalArgumentException if the given scale factor is < 1 + * @throws IllegalArgumentException if the given scale factor is {@code < 1} */ public static long getMapSizeWithScale(double scale) { if (scale < 1) { diff --git a/vtm/src/org/oscim/layers/marker/MarkerLayer.java b/vtm/src/org/oscim/layers/marker/MarkerLayer.java index 3dec2801e..2632c2b30 100644 --- a/vtm/src/org/oscim/layers/marker/MarkerLayer.java +++ b/vtm/src/org/oscim/layers/marker/MarkerLayer.java @@ -32,7 +32,7 @@ * Draws a list of {@link MarkerInterface} as markers to a map. The item with the * 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 - * your custom item-class passed back in onTap(). << TODO + * your custom item-class passed back in onTap(). */ public abstract class MarkerLayer extends Layer { diff --git a/vtm/src/org/oscim/renderer/GLMatrix.java b/vtm/src/org/oscim/renderer/GLMatrix.java index 08685ba74..47596d233 100644 --- a/vtm/src/org/oscim/renderer/GLMatrix.java +++ b/vtm/src/org/oscim/renderer/GLMatrix.java @@ -109,7 +109,7 @@ public void prj2D(float[] vec2, int offset, int length) { /** * Project Vectors with Matrix * - * @param vec2 Vector to project + * @param src Vector to project */ public void prj2D(float[] src, int src_offset, float[] dst, int dst_offset, int length) { if (src == null || src_offset < 0 || length + src_offset * 2 > src.length) diff --git a/vtm/src/org/oscim/renderer/LayerRenderer.java b/vtm/src/org/oscim/renderer/LayerRenderer.java index 84e54e2b9..ffa2528d3 100644 --- a/vtm/src/org/oscim/renderer/LayerRenderer.java +++ b/vtm/src/org/oscim/renderer/LayerRenderer.java @@ -51,21 +51,11 @@ public boolean setup() { /** * 1. Called first by MapRenderer: Update the state here, compile * vertex-data and set setReady(true). - * - * @param position current MapPosition - * @param changed true when MapPosition has changed since last frame - * @param matrices contains the current view- and projection-matrices - * and 'mvp' matrix for temporary use. */ public abstract void update(GLViewport viewport); /** * 2. Draw layer: called by MapRenderer when isReady == true. - * - * @param position current MapPosition - * @param matrices contains the current view- and projection-matrices. - * 'matrices.mvp' is for temporary use to build the model- - * view-projection to set as uniform. */ public abstract void render(GLViewport viewport); diff --git a/vtm/src/org/oscim/renderer/bucket/LineTexBucket.java b/vtm/src/org/oscim/renderer/bucket/LineTexBucket.java index 4c5f3e730..e37ece3a3 100644 --- a/vtm/src/org/oscim/renderer/bucket/LineTexBucket.java +++ b/vtm/src/org/oscim/renderer/bucket/LineTexBucket.java @@ -73,7 +73,7 @@ * 6, 5, 7, *

* BIG NOTE: renderer assumes to be able to offset vertex array position - * so that in the first pass 'pos1' offset will be < 0 if no data precedes + * so that in the first pass 'pos1' offset will be {@code < 0} if no data precedes * - in our case there is always the polygon fill array at start * - see addLine hack otherwise. */ diff --git a/vtm/src/org/oscim/tiling/source/mapfile/MapFile.java b/vtm/src/org/oscim/tiling/source/mapfile/MapFile.java index bd2a72684..4aad33e14 100644 --- a/vtm/src/org/oscim/tiling/source/mapfile/MapFile.java +++ b/vtm/src/org/oscim/tiling/source/mapfile/MapFile.java @@ -1125,7 +1125,7 @@ public MapReadResult readNamedItems(Tile tile) { /** * Reads data for an area defined by the tile in the upper left and the tile in * the lower right corner. - * Precondition: upperLeft.tileX <= lowerRight.tileX && upperLeft.tileY <= lowerRight.tileY + * Precondition: {@code upperLeft.tileX <= lowerRight.tileX && upperLeft.tileY <= lowerRight.tileY} * * @param upperLeft tile that defines the upper left corner of the requested area. * @param lowerRight tile that defines the lower right corner of the requested area. @@ -1148,7 +1148,7 @@ public MapReadResult readMapData(Tile tile) { /** * Reads data for an area defined by the tile in the upper left and the tile in * the lower right corner. - * Precondition: upperLeft.tileX <= lowerRight.tileX && upperLeft.tileY <= lowerRight.tileY + * Precondition: {@code upperLeft.tileX <= lowerRight.tileX && upperLeft.tileY <= lowerRight.tileY} * * @param upperLeft tile that defines the upper left corner of the requested area. * @param lowerRight tile that defines the lower right corner of the requested area. diff --git a/vtm/src/org/oscim/utils/ColorUtil.java b/vtm/src/org/oscim/utils/ColorUtil.java index 94db82da4..5b348a758 100644 --- a/vtm/src/org/oscim/utils/ColorUtil.java +++ b/vtm/src/org/oscim/utils/ColorUtil.java @@ -97,9 +97,9 @@ public static synchronized int modHsv(int color, double hue, double saturation, * Assumes r, g, and b are contained in the set [0, 255] and * returns h, s, and l in the set [0, 1]. * - * @param Number r The red color value - * @param Number g The green color value - * @param Number b The blue color value + * @param r The red color value + * @param g The green color value + * @param b The blue color value * @return Array The HSL representation */ public static Vec3 rgbToHsl(double r, double g, double b, Vec3 out) { @@ -140,9 +140,9 @@ public static Vec3 rgbToHsl(double r, double g, double b) { * Assumes h, s, and l are contained in the set [0, 1] and * returns r, g, and b in the set [0, 255]. * - * @param Number h The hue - * @param Number s The saturation - * @param Number l The lightness + * @param h The hue + * @param s The saturation + * @param l The lightness * @return Array The RGB representation */ public static int hslToRgb(double h, double s, double l, Vec3 out) { @@ -184,9 +184,9 @@ static double hue2rgb(double p, double q, double t) { * Assumes r, g, and b are contained in the set [0, 255] and * returns h, s, and v in the set [0, 1]. * - * @param Number r The red color value - * @param Number g The green color value - * @param Number b The blue color value + * @param r The red color value + * @param g The green color value + * @param b The blue color value * @return Array The HSV representation */ public static Vec3 rgbToHsv(double r, double g, double b, Vec3 out) { diff --git a/vtm/src/org/oscim/utils/KeyMap.java b/vtm/src/org/oscim/utils/KeyMap.java index 810b93f05..a03411b1a 100644 --- a/vtm/src/org/oscim/utils/KeyMap.java +++ b/vtm/src/org/oscim/utils/KeyMap.java @@ -242,7 +242,6 @@ public K get(HashItem key) { * Maps the specified key to the specified value. * * @param key the key. - * @param value the value. * @return the value of any previous mapping with the specified key or * {@code null} if there was no such mapping. */ diff --git a/vtm/src/org/oscim/utils/RTree.java b/vtm/src/org/oscim/utils/RTree.java index 3267fc3e3..ee2ce43c6 100644 --- a/vtm/src/org/oscim/utils/RTree.java +++ b/vtm/src/org/oscim/utils/RTree.java @@ -343,13 +343,11 @@ public boolean remove(Box box, T item) { /** * Find all items within search rectangle. * - * @param a_min Min of search bounding rect - * @param a_max Max of search bounding rect - * @param a_searchResult Search result array. Caller should set grow size. - * Function will reset, not append to array. - * @param a_resultCallback Callback function to return result. Callback - * should return 'true' to continue searching - * @param a_context User context to pass as parameter to a_resultCallback + * @param min Min of search bounding rect + * @param max Max of search bounding rect + * @param cb Callback function to return result. Callback + * should return 'true' to continue searching + * @param context User context to pass as parameter to a_resultCallback * @return Returns the number of entries found */ public boolean search(double min[], double max[], SearchCb cb, Object context) { diff --git a/vtm/src/org/oscim/utils/quadtree/BoxTree.java b/vtm/src/org/oscim/utils/quadtree/BoxTree.java index 691156199..5b9edb4f8 100644 --- a/vtm/src/org/oscim/utils/quadtree/BoxTree.java +++ b/vtm/src/org/oscim/utils/quadtree/BoxTree.java @@ -152,7 +152,7 @@ boolean isPowerOfTwo(int x) { * BoxTreee for the range [-extents, extents] * * @param extents must be power of two - * @param maxDepth must be <= 30 + * @param maxDepth must be {@code <= 30} */ public BoxTree(int extents, int maxDepth) { super();