Skip to content

Commit d35d415

Browse files
committed
Cleanup code
* Remove empty JavaDoc * Use textblocks
1 parent 9ac5271 commit d35d415

File tree

6 files changed

+30
-63
lines changed

6 files changed

+30
-63
lines changed

vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/LeafletView.java

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
1414
import com.vaadin.flow.router.Route;
1515

16-
import com.vaadin.flow.router.RouteAlias;
1716
import software.xdev.vaadin.maps.leaflet.flow.LMap;
1817
import software.xdev.vaadin.maps.leaflet.flow.data.LCenter;
1918
import software.xdev.vaadin.maps.leaflet.flow.data.LCircle;
@@ -35,7 +34,6 @@ public class LeafletView extends VerticalLayout
3534
* UI-Components
3635
*/
3736
private final Button btnLunch = new Button("Where do XDEV employees go for lunch?");
38-
private final Button btnCenter = new Button("Center on Caribbean");
3937
private LMap map;
4038

4139
private LMarker markerZob;
@@ -61,7 +59,9 @@ public LeafletView()
6159
hlButtonContainer.setSpacing(false);
6260
hlButtonContainer.add(
6361
this.btnLunch,
64-
this.btnCenter,
62+
new Button("Center on Caribbean", e -> this.map.centerAndZoom(
63+
new LPoint(14.467727, -61.69703),
64+
new LPoint(16.33426, -60.921676))),
6565
new Button("Open dialog over map", ev ->
6666
{
6767
final Icon icoClose = VaadinIcon.CLOSE.create();
@@ -73,7 +73,6 @@ public LeafletView()
7373

7474
icoClose.addClickListener(iev -> dialog.close());
7575
}));
76-
this.btnCenter.addClickListener(e-> map.centerAndZoom(new LPoint(14.467727, -61.69703), new LPoint(16.33426,-60.921676)));
7776
this.add(this.map, hlButtonContainer);
7877
this.setSizeFull();
7978
}
@@ -106,29 +105,33 @@ private void initMapComponents()
106105

107106
final LMarker markerXDev = new LMarker(49.675806677512824, 12.160990185846394);
108107
final LIcon xDevLogo = new LIcon(
109-
// Important replace # with %23!
110-
"data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"200\" viewBox=\"0 0 18300 4500\" style=\"background-color:rgba(180,180,180,0.7)\">\n"
111-
+ " <defs>\n"
112-
+ " <style>\n"
113-
+ " .fil0{fill:%23d71e23}\n"
114-
+ " </style>\n"
115-
+ " </defs>\n"
116-
+ " <g>\n"
117-
+ " <path class=\"fil0\" d=\"M9763 10965h-920l-17-6-1503-588-1506 588-11 4-13 2-1562 148-1102 105 1064-369 2311-801-1638-633-683-263h1609l16 6 1515 588 1521-588 10-4 9-1 1388-211 1177-178-1131 441-2177 849 1675 647 682 264zM25514 9520l-1909 1442-22 17h-693l-23-19-1765-1440-285-233h907l22 17 1490 1178 1395-1177 23-19h1171zM20426 10961h-4015V9260h4126l-1 127-1 99v126h-112l-3041-3 2 322 3038 3h110l2 124 1 83 2 128h-3146v352l3035-6h112v346z\" transform=\"translate(-5400 -7700)\"/>\n"
118-
+ " <path class=\"fil0\" d=\"M10994 9275h2026a12150 12150 0 0 1 1368 73c292 35 559 83 798 143h1c290 73 510 158 659 254 165 106 248 229 248 368 0 134-85 254-254 359-151 94-375 180-672 256-292 76-618 132-977 170-359 37-751 56-1174 56h-2102V9275h79zm917 1354h1106c300 0 574-14 822-41 247-27 469-67 665-121h1a2470 2470 0 0 0 277-96c176-79 264-164 264-256 0-60-39-118-117-173-92-66-234-125-425-178-197-55-418-96-665-123-248-27-522-41-822-41h-1106v1029z\" transform=\"translate(-5400 -7700)\"/>\n"
119-
+ " </g>\n"
120-
+ "</svg>");
108+
"""
109+
data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="1000" height="200" viewBox="0 0 18300 4500" style="background-color:rgba(180,180,180,0.7)">
110+
<defs>
111+
<style>
112+
.fil0{fill:%23d71e23}
113+
</style>
114+
</defs>
115+
<g>
116+
<path class="fil0" d="M9763 10965h-920l-17-6-1503-588-1506 588-11 4-13 2-1562 148-1102 105 1064-369 2311-801-1638-633-683-263h1609l16 6 1515 588 1521-588 10-4 9-1 1388-211 1177-178-1131 441-2177 849 1675 647 682 264zM25514 9520l-1909 1442-22 17h-693l-23-19-1765-1440-285-233h907l22 17 1490 1178 1395-1177 23-19h1171zM20426 10961h-4015V9260h4126l-1 127-1 99v126h-112l-3041-3 2 322 3038 3h110l2 124 1 83 2 128h-3146v352l3035-6h112v346z" transform="translate(-5400 -7700)"/>
117+
<path class="fil0" d="M10994 9275h2026a12150 12150 0 0 1 1368 73c292 35 559 83 798 143h1c290 73 510 158 659 254 165 106 248 229 248 368 0 134-85 254-254 359-151 94-375 180-672 256-292 76-618 132-977 170-359 37-751 56-1174 56h-2102V9275h79zm917 1354h1106c300 0 574-14 822-41 247-27 469-67 665-121h1a2470 2470 0 0 0 277-96c176-79 264-164 264-256 0-60-39-118-117-173-92-66-234-125-425-178-197-55-418-96-665-123-248-27-522-41-822-41h-1106v1029z" transform="translate(-5400 -7700)"/>
118+
</g>
119+
</svg>
120+
""");
121121

122122
xDevLogo.setIconSize(100, 20);
123123
xDevLogo.setIconAnchor(50, 0);
124-
markerXDev.setPopup("<a href='https://xdev.software/en' target='" + AnchorTarget.BLANK.getValue() + "'>XDEV Software GmbH</a>");
124+
markerXDev.setPopup(
125+
"<a href='https://xdev.software/en' target='" + AnchorTarget.BLANK.getValue() + "'>XDEV Software "
126+
+ "GmbH</a>");
125127
markerXDev.setIcon(xDevLogo);
126128

127129
final LMarker markerInfo = new LMarker(49.674095, 12.162257);
128-
final LDivIcon div = new LDivIcon(
129-
"<p><center><b>Welcome to Weiden in der Oberpfalz!</b></center></p><p>This demo shows you different markers,<br> popups, polygons and other stuff</p>");
130130

131-
markerInfo.setDivIcon(div);
131+
markerInfo.setDivIcon(new LDivIcon("""
132+
<p><center><b>Welcome to Weiden in der Oberpfalz!</b></center></p>
133+
<p>This demo shows you different markers,<br> popups, polygons and other stuff</p>
134+
"""));
132135

133136
final LPolygon polygonNoc = new LPolygon(
134137
Arrays.asList(

vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/flow/LMap.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,16 @@ public void setViewPoint(final LCenter viewpoint)
110110
}
111111

112112
/**
113-
* Uses fitBounds https://leafletjs.com/reference.html#map-fitbounds
114-
* to compute zoom level and center coordinates to zoom the map on the given rectangle
115-
* @param noPoint : Top let point on the map
116-
* @param sePoint : Bottom right point on the map
113+
* Uses <a href="https://leafletjs.com/reference.html#map-fitbounds">fitBounds</a> to compute zoom level and center
114+
* coordinates to zoom the map on the given rectangle
115+
*
116+
* @param nwPoint Top let point on the map
117+
* @param sePoint Bottom right point on the map
117118
*/
118-
public void centerAndZoom(final LPoint noPoint, final LPoint sePoint)
119+
public void centerAndZoom(final LPoint nwPoint, final LPoint sePoint)
119120
{
120121
this.getElement().executeJs(CLIENT_MAP + ".fitBounds(["
121-
+ "[" + noPoint.getLat() + ", " + noPoint.getLon() + "],"
122+
+ "[" + nwPoint.getLat() + ", " + nwPoint.getLon() + "],"
122123
+ "[" + sePoint.getLat() + ", " + sePoint.getLon() + "]"
123124
+ "]);");
124125
}

vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/flow/data/LCenter.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ public int getZoom()
4545

4646
/**
4747
* Sets the zoom level at the start
48-
*
49-
* @param zoom
5048
*/
5149
public void setZoom(final int zoom)
5250
{

vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/flow/data/LMarker.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ public class LMarker implements LComponent
3333

3434
/**
3535
* Creates a new Marker at the latitude, longitude
36-
*
37-
* @param lat
38-
* @param lon
3936
*/
4037
public LMarker(final double lat, final double lon)
4138
{
@@ -118,8 +115,6 @@ public String getPopup()
118115

119116
/**
120117
* Sets a Pop-up to the Marker
121-
*
122-
* @param popup
123118
*/
124119
public void setPopup(final String popup)
125120
{

vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/flow/data/LPolygon.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ public boolean isStroke()
6565

6666
/**
6767
* Draws a border, default is true.
68-
*
69-
* @param stroke
7068
*/
7169
public void setStroke(final boolean stroke)
7270
{
@@ -80,8 +78,6 @@ public String getStrokeColor()
8078

8179
/**
8280
* Set a Color to the border.
83-
*
84-
* @param strokeColor
8581
*/
8682
public void setStrokeColor(final String strokeColor)
8783
{
@@ -95,8 +91,6 @@ public double getStrokeOpacity()
9591

9692
/**
9793
* Sets the opacity of the border.
98-
*
99-
* @param strokeOpacity
10094
*/
10195
public void setStrokeOpacity(final double strokeOpacity)
10296
{
@@ -110,8 +104,6 @@ public int getStrokeWeight()
110104

111105
/**
112106
* Sets the width of the border.
113-
*
114-
* @param strokeWeight
115107
*/
116108
public void setStrokeWeight(final int strokeWeight)
117109
{
@@ -130,8 +122,6 @@ public String getLineJoin()
130122
* <li>bevel</li>
131123
* <li>miter-clip</li>
132124
* <li>arcs</li>
133-
*
134-
* @param lineJoin
135125
*/
136126
public void setLineJoin(final String lineJoin)
137127
{
@@ -146,8 +136,6 @@ public String getDashArray()
146136
/**
147137
* A string that defines the stroke dash pattern.<br>
148138
* For example: "2 1 3 1 2"
149-
*
150-
* @param dashArray
151139
*/
152140
public void setDashArray(final String dashArray)
153141
{
@@ -162,8 +150,6 @@ public String getDashOffset()
162150
/**
163151
* A string that defines the distance into the dash pattern to start the dash.<br>
164152
* For example: "2" - The start of the dash array computation is pulled by 3 user units
165-
*
166-
* @param dashOffset
167153
*/
168154
public void setDashOffset(final String dashOffset)
169155
{
@@ -177,8 +163,6 @@ public boolean isFill()
177163

178164
/**
179165
* Whether to fill the path with color. Set it to false to disable filling.
180-
*
181-
* @param fill
182166
*/
183167
public void setFill(final boolean fill)
184168
{
@@ -192,8 +176,6 @@ public String getFillColor()
192176

193177
/**
194178
* Fill color.
195-
*
196-
* @param fillColor
197179
*/
198180
public void setFillColor(final String fillColor)
199181
{
@@ -207,8 +189,6 @@ public double getFillOpacity()
207189

208190
/**
209191
* Fill opacity.
210-
*
211-
* @param fillOpacity
212192
*/
213193
public void setFillOpacity(final double fillOpacity)
214194
{
@@ -223,8 +203,6 @@ public String getPopup()
223203

224204
/**
225205
* Set Pop-up message.
226-
*
227-
* @param popup
228206
*/
229207
public void setPopup(final String popup)
230208
{
@@ -240,8 +218,6 @@ public String getFillRule()
240218
* A string that defines how the inside of a shape is determined.<br>
241219
* <li>evenodd</li>
242220
* <li>nonzero</li>
243-
*
244-
* @param fillRule
245221
*/
246222
public void setFillRule(final String fillRule)
247223
{
@@ -255,8 +231,6 @@ public boolean isNoClip()
255231

256232
/**
257233
* Disable polyline clipping.
258-
*
259-
* @param noClip
260234
*/
261235
public void setNoClip(final boolean noClip)
262236
{
@@ -271,8 +245,6 @@ public double getSmoothFactor()
271245
/**
272246
* How much to simplify the polyline on each zoom level.<br>
273247
* More means better performance and smoother look, and less means more accurate representation.
274-
*
275-
* @param smoothFactor
276248
*/
277249
public void setSmoothFactor(final double smoothFactor)
278250
{

vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/flow/data/LPolygonOptions.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ public double getRadius()
4747

4848
/**
4949
* Only for Circle
50-
*
51-
* @param radius
5250
*/
5351
public void setRadius(final double radius)
5452
{

0 commit comments

Comments
 (0)