Skip to content

Commit

Permalink
fixed javadoc warningss
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabor committed Jul 6, 2020
1 parent 64c81cd commit f7de2b4
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
/**
* The layers control gives users the ability to switch between different base
* layers and switch overlays on/off (check out the detailed example). Extends
* Control. </br>
* </br>
* Control. <br>
* <br>
* The baseLayers and overlays parameters are object literals with layer names
* as keys and Layer objects as values. </br>
* </br>
* as keys and Layer objects as values. <br>
* <br>
* The layer names can contain HTML, which allows you to add additional styling
* to the items.
*
Expand Down Expand Up @@ -153,14 +153,24 @@ public void collapse() {
/**
* Adds a base layer (radio button entry) with the given name to the
* control.
*
* @param layer
* the layer to be added to map as a base layer
* @param name
* the name of the base layer
*/
public void addBaseLayer(Layer layer, String name) {
this.baseLayers.put(name, layer);
executeJs(this, "addBaseLayer", layer, name);
}

/**
* Adds an overlay (checkbox entry) with the given name to the control.
* Adds an overlay (checkbox entry) with the given name to the control. *
*
* @param layer
* the layer to be added to map as an overlay
* @param name
* the name of the overlay
*/
public void addOverlay(Layer layer, String name) {
this.overlays.put(name, layer);
Expand All @@ -169,6 +179,7 @@ public void addOverlay(Layer layer, String name) {

/**
* Remove the given layer from the control.
* @param layer the layer which should be removed from the {@link LayersControl}
*/
public void removeLayer(Layer layer) {
// TODO remove layer from overlays or baselayers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ default void closePopup() {

/**
* Opens the bound popup
*
* @param latLng the popup location
*/
default void openPopup() {
executeJs("closePopup");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ default void closeTooltip() {

/**
* Opens the bound tooltip
*
* @param latLng the tooltip location
*/
default void openTooltip() {
executeJs("closeTooltip");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public interface FeatureGroupFunctions extends ExecutableFunctions {
* Sets the given path options to each layer of the group that has a setStyle
* method.
*
* @param geoJsonObject
* @param pathOptions the options to each layer of the group
*/
default void setStyle(PathOptions pathOptions) {
executeJs("setStyle", pathOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ private void setLayerStyle(Layer layer, StyleHandler styleHandler) {
/**
* Normalize GeoJSON geometries/features into GeoJSON features.
*
* @param the geoJson to be converted to Feature
* @param geoJson the
* {@link GeoJSON} to be converted as a {@link Feature}
* @return return a {@link Feature} object which wraps the given {@link GeoJSON}
*/
public static Feature asFeature(GeoJsonObject geoJson) {
if (geoJson instanceof Feature) {
Expand All @@ -129,16 +131,20 @@ public static Feature asFeature(GeoJsonObject geoJson) {
* Creates a Layer from a given GeoJsonObject object. Can use a custom
* pointToLayer and/or coordsToLatLng functions if provided as options.
*
* @param geoJsonObject the geojson to convert
* @param options a custom options
* @param geoJsonObject
* the geojson to convert
* @param options
* a custom options
*
* @see GeoJSONOptions
* @return return a {@link Layer} which has been added to this
* {@link GeoJSON} layer, the type of the added layer depends on
* type of the given {@link GeoJSON}
*/
public static Layer geometryToLayer(GeoJsonObject geoJsonObject, GeoJSONOptions options) {
Layer layer = null;

CoordsToLatLngHandler coordsToLatLng = options.coordsToLatLngHandler() != null ? options.coordsToLatLngHandler()
: GeoJSON::coordinateToLatLng;
CoordsToLatLngHandler coordsToLatLng = options.coordsToLatLngHandler() != null ? options.coordsToLatLngHandler() : GeoJSON::coordinateToLatLng;

if (geoJsonObject instanceof Feature) {
Feature feature = (Feature) geoJsonObject;
Expand All @@ -150,24 +156,20 @@ public static Layer geometryToLayer(GeoJsonObject geoJsonObject, GeoJSONOptions
layer = pointToLayer(options.pointToLayer(), point, latLng);
} else if (geoJsonObject instanceof LineString) {
LineString lineString = (LineString) geoJsonObject;
List<LatLng> latLngs = lineString.getCoordinates().stream().map(coordsToLatLng::convert)
.collect(Collectors.toList());
List<LatLng> latLngs = lineString.getCoordinates().stream().map(coordsToLatLng::convert).collect(Collectors.toList());
layer = new Polyline(latLngs);
} else if (geoJsonObject instanceof MultiPoint) {
MultiPoint multiPoint = (MultiPoint) geoJsonObject;
FeatureGroup featureGroup = new FeatureGroup();
multiPoint.getCoordinates().stream().map(coordsToLatLng::convert)
.map((latLng) -> pointToLayer(options.pointToLayer(), multiPoint, latLng))
.forEach((l) -> l.addTo(featureGroup));
multiPoint.getCoordinates().stream().map(coordsToLatLng::convert).map((latLng) -> pointToLayer(options.pointToLayer(), multiPoint, latLng)).forEach((l) -> l.addTo(featureGroup));
layer = featureGroup;
} else if (geoJsonObject instanceof MultiLineString) {
MultiLineString multiLineString = (MultiLineString) geoJsonObject;
MultiLatLngArray latLngs = multiCoordinateToLatLng(multiLineString.getCoordinates(), coordsToLatLng);
layer = new MultiPolyline(latLngs);
} else if (geoJsonObject instanceof org.geojson.Polygon) {
org.geojson.Polygon polygon = (org.geojson.Polygon) geoJsonObject;
List<LatLng> exteriorLatlngs = polygon.getExteriorRing().stream().map(coordsToLatLng::convert)
.collect(Collectors.toList());
List<LatLng> exteriorLatlngs = polygon.getExteriorRing().stream().map(coordsToLatLng::convert).collect(Collectors.toList());
MultiLatLngArray interiorLatLngs = multiCoordinateToLatLng(polygon.getInteriorRings(), coordsToLatLng);
layer = new Polygon(exteriorLatlngs, interiorLatLngs);
} else if (geoJsonObject instanceof MultiPolygon) {
Expand All @@ -181,16 +183,14 @@ public static Layer geometryToLayer(GeoJsonObject geoJsonObject, GeoJSONOptions
} else if (geoJsonObject instanceof GeometryCollection) {
FeatureGroup geometryFeatureGroup = new FeatureGroup();
GeometryCollection geometryCollection = (GeometryCollection) geoJsonObject;
geometryCollection.getGeometries().stream().map((geometry) -> geometryToLayer(geometry, options))
.forEach(geometryLayer -> geometryLayer.addTo(geometryFeatureGroup));
geometryCollection.getGeometries().stream().map((geometry) -> geometryToLayer(geometry, options)).forEach(geometryLayer -> geometryLayer.addTo(geometryFeatureGroup));
layer = geometryFeatureGroup;
}

return layer;
}

private static MultiLatLngArray multiCoordinateToLatLng(List<List<LngLatAlt>> multiLngLatAlts,
CoordsToLatLngHandler coordsToLatLng) {
private static MultiLatLngArray multiCoordinateToLatLng(List<List<LngLatAlt>> multiLngLatAlts, CoordsToLatLngHandler coordsToLatLng) {
MultiLatLngArray multiLatLngArray = new MultiLatLngArray();
for (List<LngLatAlt> coords : multiLngLatAlts) {
List<LatLng> latLngs = coords.stream().map(coordsToLatLng::convert).collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public interface GeoJSONFunctions extends ExecutableFunctions {
* Adds a GeoJSON object to the layer.
*
* @param geoJsonObject the geojson object
* @return the current GeoJSON layer
*/
GeoJSON addData(GeoJsonObject geoJsonObject);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ default void setZIndexOffset(int offset) {
/**
* Returns the current icon used by the marker
*
* @param icon the current icon used by the marker
* @return the current icon used by the marker
*/
Icon getIcon();

Expand All @@ -73,7 +73,7 @@ default void setIcon(Icon icon) {
* Changes the opacity of the marker.
*
*
* @param icon the new opacity of the marker
* @param opacity the new opacity of the marker
*/
default void setOpacity(double opacity) {
executeJs("setOpacity", opacity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,18 @@
*/
public interface GeometryStructure {

/**
* Returns true if the geometry structure has no LatLngs.
*/
boolean isEmpty();
/**
* Returns true if the geometry structure has no LatLngs.
*
* @return return true if this geometry structure has no coordinates
* otherwise return false.
*/
boolean isEmpty();

/**
* Calculate the boundary of this geometry structure
*
* @return
*/
LatLngBounds getBounds();
/**
* Calculate the boundary of this geometry structure
*
* @return the {@link LatLngBounds} of the geometry
*/
LatLngBounds getBounds();
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@
* <h3>Leaflet.Control.FullScreen</h3>
*
* Web component: <a href=
* "https://www.npmjs.com/package/leaflet.fullscreen">https://www.npmjs.com/package/leaflet.fullscreen</a></br>
* </br>
* "https://www.npmjs.com/package/leaflet.fullscreen">https://www.npmjs.com/package/leaflet.fullscreen</a><br>
* <br>
*
* Simple plugin for Leaflet that adds fullscreen button to your maps.</br>
* </br>
* Simple plugin for Leaflet that adds fullscreen button to your maps.<br>
* <br>
*
*
* If your map have a zoomControl the fullscreen button will be added at the
* bottom of this one.</br>
* </br>
* bottom of this one.<br>
* <br>
*
* If your map doesn't have a zoomContron the fullscreen button will be added to
* topleft corner of the map (same as the zoomcontrol).</br>
* </br>
* topleft corner of the map (same as the zoomcontrol).<br>
* <br>
*
* If you want to use the plugin on a map embedded in an iframe, don't forget to
* set allowfullscreen attribute on your iframe.</br>
* </br>
* set allowfullscreen attribute on your iframe.<br>
* <br>
*
* <h3>FullScreen options</h3>
* <ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public HeatLayer(List<LatLng> latLngs) {
* Constructs a heatmap layer with custom layer options
*
* @param options the custom options to be used
* @see @HeatLayerOptions
* @see HeatLayerOptions
*/
public HeatLayer(HeatLayerOptions options) {
this(new ArrayList<>(), options);
Expand All @@ -101,8 +101,8 @@ public HeatLayer(HeatLayerOptions options) {
*
* @param latLngs the initial points to be added
* @param options the custom options to be used
* @see @HeatLayerOptions
* @see @LatLng
* @see HeatLayerOptions
* @see LatLng
*/
public HeatLayer(List<LatLng> latLngs, HeatLayerOptions options) {
this.latLngs = latLngs;
Expand All @@ -113,7 +113,7 @@ public HeatLayer(List<LatLng> latLngs, HeatLayerOptions options) {
* Adds a new point to the heatmap and redraws it.
*
* @param latLng a new point to be added
* @see @LatLng
* @see LatLng
*/
public void addLatLng(LatLng latLng) {
this.latLngs.add(latLng);
Expand All @@ -124,7 +124,7 @@ public void addLatLng(LatLng latLng) {
* Resets heatmap data and redraws it.
*
* @param laLngs the list of the new points to be added
* @see @LatLng
* @see LatLng
*/
public void setLatLngs(List<LatLng> laLngs) {
this.latLngs = laLngs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.vaadin.addon.leaflet4vaadin.layer.events.LeafletEvent;
import com.vaadin.addon.leaflet4vaadin.layer.events.LeafletEventListener;
import com.vaadin.addon.leaflet4vaadin.layer.events.MouseEvent;
import com.vaadin.addon.leaflet4vaadin.layer.groups.FeatureGroup;
import com.vaadin.addon.leaflet4vaadin.layer.vectors.PathOptions;
import com.vaadin.flow.component.dependency.CssImport;
Expand All @@ -17,12 +16,12 @@
* <h3>Leaflet.markercluster</h3>
*
* Web component: <a href=
* "https://www.npmjs.com/package/leaflet.markercluster">https://www.npmjs.com/package/leaflet.markercluster</a></br>
* </br>
* "https://www.npmjs.com/package/leaflet.markercluster">https://www.npmjs.com/package/leaflet.markercluster</a><br>
* <br>
*
* Provides Beautiful Animated Marker Clustering functionality for
* LeafletMap.</br>
* </br>
* LeafletMap.<br>
* <br>
*
*
* @author <strong>Gabor Kokeny</strong> Email:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.vaadin.addon.leaflet4vaadin.types;

/**
* Represents a lightweight icon for markers that uses a simple <div> element
* Represents a lightweight icon for markers that uses a simple element
* instead of an image. Inherits from Icon but ignores the iconUrl and shadow
* options. </br>
* </br>
* options. <br>
* <br>
* By default, it has a 'leaflet-div-icon' CSS class and is styled as a little
* white square with a shadow.
*
Expand Down

0 comments on commit f7de2b4

Please sign in to comment.