Skip to content

Commit 21852aa

Browse files
paodbjavier-godoy
authored andcommitted
style: apply code formatting
1 parent d240f9f commit 21852aa

File tree

12 files changed

+821
-773
lines changed

12 files changed

+821
-773
lines changed

src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMap.java

Lines changed: 229 additions & 221 deletions
Large diffs are not rendered by default.

src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapMarker.java

Lines changed: 193 additions & 198 deletions
Large diffs are not rendered by default.

src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPoint.java

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,25 +30,28 @@
3030
@NpmPackage(value = "@flowingcode/google-map", version = "3.0.2")
3131
public class GoogleMapPoint extends Component {
3232

33-
public GoogleMapPoint(LatLon latlon) {
34-
this(latlon.getLat(),latlon.getLon());
35-
}
36-
37-
public GoogleMapPoint(Double latitude, Double longitude) {
38-
this.setLatitude(latitude);
39-
this.setLongitude(longitude);
40-
}
41-
42-
public Double getLatitude() {
43-
return this.getElement().getProperty("latitude", 0d);
44-
}
45-
public void setLatitude(Double latitude) {
46-
this.getElement().setProperty("latitude", latitude);
47-
}
48-
public Double getLongitude() {
49-
return this.getElement().getProperty("longitude", 0d);
50-
}
51-
public void setLongitude(Double longitude) {
52-
this.getElement().setProperty("longitude", longitude);
53-
}
33+
public GoogleMapPoint(LatLon latlon) {
34+
this(latlon.getLat(), latlon.getLon());
35+
}
36+
37+
public GoogleMapPoint(Double latitude, Double longitude) {
38+
this.setLatitude(latitude);
39+
this.setLongitude(longitude);
40+
}
41+
42+
public Double getLatitude() {
43+
return this.getElement().getProperty("latitude", 0d);
44+
}
45+
46+
public void setLatitude(Double latitude) {
47+
this.getElement().setProperty("latitude", latitude);
48+
}
49+
50+
public Double getLongitude() {
51+
return this.getElement().getProperty("longitude", 0d);
52+
}
53+
54+
public void setLongitude(Double longitude) {
55+
this.getElement().setProperty("longitude", longitude);
56+
}
5457
}

src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapPolygon.java

Lines changed: 135 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,10 +19,6 @@
1919
*/
2020
package com.flowingcode.vaadin.addons.googlemaps;
2121

22-
import java.util.Arrays;
23-
import java.util.List;
24-
import java.util.stream.Collectors;
25-
2622
import com.vaadin.flow.component.ClickEvent;
2723
import com.vaadin.flow.component.Component;
2824
import com.vaadin.flow.component.ComponentEventListener;
@@ -31,140 +27,145 @@
3127
import com.vaadin.flow.component.dependency.JsModule;
3228
import com.vaadin.flow.component.dependency.NpmPackage;
3329
import com.vaadin.flow.shared.Registration;
30+
import java.util.Arrays;
31+
import java.util.List;
32+
import java.util.stream.Collectors;
3433

35-
/**
36-
* A class representing a polygon overlay of Google Maps.
37-
*/
34+
/** A class representing a polygon overlay of Google Maps. */
3835
@SuppressWarnings("serial")
3936
@Tag("google-map-poly")
4037
@JsModule("@flowingcode/google-map/google-map-poly.js")
4138
@JsModule("@flowingcode/google-map/google-map-point.js")
4239
@NpmPackage(value = "@flowingcode/google-map", version = "3.0.2")
4340
public class GoogleMapPolygon extends Component {
4441

45-
private static final double DEFAULT_FILL_OPACITY = 0.5d;
46-
private static final String DEFAULT_FILL_COLOR = "blue";
47-
48-
public enum StrokePosition {
49-
CENTER, INSIDE, OUTSIDE
50-
}
51-
52-
public GoogleMapPolygon(List<GoogleMapPoint> points) {
53-
getElement().removeProperty("draggable");
54-
setClosed(true);
55-
setFillColor(DEFAULT_FILL_COLOR);
56-
setFillOpacity(DEFAULT_FILL_OPACITY);
57-
setPoints(points);
58-
}
59-
60-
public void setFillOpacity(double opacity) {
61-
this.getElement().setProperty("fillOpacity", opacity);
62-
}
63-
64-
public double getFillOpacity() {
65-
return this.getElement().getProperty("fillOpacity", 1d);
66-
}
67-
68-
public void setStrokeOpacity(double opacity) {
69-
this.getElement().setProperty("strokeOpacity", opacity);
70-
}
71-
72-
public double getStrokeOpacity() {
73-
return this.getElement().getProperty("strokeOpacity", 1d);
74-
}
75-
76-
public void setStrokePosition(StrokePosition position) {
77-
this.getElement().setProperty("strokePosition", position.name().toLowerCase());
78-
}
79-
80-
public StrokePosition getStrokePosition() {
81-
return StrokePosition.valueOf(this.getElement().getProperty("strokePosition").toUpperCase());
82-
}
83-
84-
public void setStrokeWeight(double weight) {
85-
this.getElement().setProperty("strokeWeight", weight);
86-
}
87-
88-
public double getStrokeWeight() {
89-
return this.getElement().getProperty("strokeWeight", 1d);
90-
}
91-
92-
public void setZIndex(double zindex) {
93-
this.getElement().setProperty("zIndex", zindex);
94-
}
95-
96-
public double getZIndex() {
97-
return this.getElement().getProperty("zIndex", 1d);
98-
}
99-
100-
public void setFillColor(String string) {
101-
this.getElement().setProperty("fillColor", string);
102-
}
103-
104-
public String getFillColor() {
105-
return this.getElement().getProperty("fillColor");
106-
}
107-
108-
public void setStrokeColor(String string) {
109-
this.getElement().setProperty("strokeColor", string);
110-
}
111-
112-
public String getStrokeColor() {
113-
return this.getElement().getProperty("strokeColor");
114-
}
115-
116-
public void setClosed(boolean b) {
117-
this.getElement().setProperty("closed", b);
118-
}
119-
120-
public boolean isClosed() {
121-
return this.getElement().getProperty("closed", false);
122-
}
123-
124-
public void setGeodesic(boolean b) {
125-
this.getElement().setProperty("geodesic", b);
126-
}
127-
128-
public boolean isGeodesic() {
129-
return this.getElement().getProperty("geodesic", false);
130-
}
131-
132-
public void setPoints(Iterable<GoogleMapPoint> points) {
133-
points.forEach(point -> this.getElement().appendChild(point.getElement()));
134-
}
135-
136-
public GoogleMapPoint addPoint(LatLon position) {
137-
GoogleMapPoint point = new GoogleMapPoint(position.getLat(), position.getLon());
138-
this.getElement().appendChild(point.getElement());
139-
return point;
140-
}
141-
142-
public void addPoint(GoogleMapPoint point) {
143-
this.getElement().appendChild(point.getElement());
144-
}
145-
146-
@SuppressWarnings("squid:S3242")
147-
public void removePoint(GoogleMapPoint point) {
148-
this.getElement().removeChild(point.getElement());
149-
}
150-
151-
@DomEvent("google-map-poly-click")
152-
public static class GoogleMapPolygonClickEvent extends ClickEvent<GoogleMapPolygon> {
153-
public GoogleMapPolygonClickEvent(GoogleMapPolygon source, boolean fromClient) {
154-
super(source);
155-
}
156-
}
157-
158-
public Registration addClickListener(ComponentEventListener<GoogleMapPolygonClickEvent> listener) {
159-
this.getElement().setProperty("clickable", true);
160-
this.getElement().setProperty("clickEvents", true);
161-
return addListener(GoogleMapPolygonClickEvent.class, listener);
162-
}
163-
164-
public void setIcons(Icon... icons) {
165-
String iconsStr = "["
166-
+ Arrays.asList(icons).stream().map(Icon::getJson).collect(Collectors.joining(",")) + "]";
167-
getElement().executeJs("this.icons=" + iconsStr);
168-
}
169-
42+
private static final double DEFAULT_FILL_OPACITY = 0.5d;
43+
private static final String DEFAULT_FILL_COLOR = "blue";
44+
45+
public enum StrokePosition {
46+
CENTER,
47+
INSIDE,
48+
OUTSIDE
49+
}
50+
51+
public GoogleMapPolygon(List<GoogleMapPoint> points) {
52+
getElement().removeProperty("draggable");
53+
setClosed(true);
54+
setFillColor(DEFAULT_FILL_COLOR);
55+
setFillOpacity(DEFAULT_FILL_OPACITY);
56+
setPoints(points);
57+
}
58+
59+
public void setFillOpacity(double opacity) {
60+
this.getElement().setProperty("fillOpacity", opacity);
61+
}
62+
63+
public double getFillOpacity() {
64+
return this.getElement().getProperty("fillOpacity", 1d);
65+
}
66+
67+
public void setStrokeOpacity(double opacity) {
68+
this.getElement().setProperty("strokeOpacity", opacity);
69+
}
70+
71+
public double getStrokeOpacity() {
72+
return this.getElement().getProperty("strokeOpacity", 1d);
73+
}
74+
75+
public void setStrokePosition(StrokePosition position) {
76+
this.getElement().setProperty("strokePosition", position.name().toLowerCase());
77+
}
78+
79+
public StrokePosition getStrokePosition() {
80+
return StrokePosition.valueOf(this.getElement().getProperty("strokePosition").toUpperCase());
81+
}
82+
83+
public void setStrokeWeight(double weight) {
84+
this.getElement().setProperty("strokeWeight", weight);
85+
}
86+
87+
public double getStrokeWeight() {
88+
return this.getElement().getProperty("strokeWeight", 1d);
89+
}
90+
91+
public void setZIndex(double zindex) {
92+
this.getElement().setProperty("zIndex", zindex);
93+
}
94+
95+
public double getZIndex() {
96+
return this.getElement().getProperty("zIndex", 1d);
97+
}
98+
99+
public void setFillColor(String string) {
100+
this.getElement().setProperty("fillColor", string);
101+
}
102+
103+
public String getFillColor() {
104+
return this.getElement().getProperty("fillColor");
105+
}
106+
107+
public void setStrokeColor(String string) {
108+
this.getElement().setProperty("strokeColor", string);
109+
}
110+
111+
public String getStrokeColor() {
112+
return this.getElement().getProperty("strokeColor");
113+
}
114+
115+
public void setClosed(boolean b) {
116+
this.getElement().setProperty("closed", b);
117+
}
118+
119+
public boolean isClosed() {
120+
return this.getElement().getProperty("closed", false);
121+
}
122+
123+
public void setGeodesic(boolean b) {
124+
this.getElement().setProperty("geodesic", b);
125+
}
126+
127+
public boolean isGeodesic() {
128+
return this.getElement().getProperty("geodesic", false);
129+
}
130+
131+
public void setPoints(Iterable<GoogleMapPoint> points) {
132+
points.forEach(point -> this.getElement().appendChild(point.getElement()));
133+
}
134+
135+
public GoogleMapPoint addPoint(LatLon position) {
136+
GoogleMapPoint point = new GoogleMapPoint(position.getLat(), position.getLon());
137+
this.getElement().appendChild(point.getElement());
138+
return point;
139+
}
140+
141+
public void addPoint(GoogleMapPoint point) {
142+
this.getElement().appendChild(point.getElement());
143+
}
144+
145+
@SuppressWarnings("squid:S3242")
146+
public void removePoint(GoogleMapPoint point) {
147+
this.getElement().removeChild(point.getElement());
148+
}
149+
150+
@DomEvent("google-map-poly-click")
151+
public static class GoogleMapPolygonClickEvent extends ClickEvent<GoogleMapPolygon> {
152+
public GoogleMapPolygonClickEvent(GoogleMapPolygon source, boolean fromClient) {
153+
super(source);
154+
}
155+
}
156+
157+
public Registration addClickListener(
158+
ComponentEventListener<GoogleMapPolygonClickEvent> listener) {
159+
this.getElement().setProperty("clickable", true);
160+
this.getElement().setProperty("clickEvents", true);
161+
return addListener(GoogleMapPolygonClickEvent.class, listener);
162+
}
163+
164+
public void setIcons(Icon... icons) {
165+
String iconsStr =
166+
"["
167+
+ Arrays.asList(icons).stream().map(Icon::getJson).collect(Collectors.joining(","))
168+
+ "]";
169+
getElement().executeJs("this.icons=" + iconsStr);
170+
}
170171
}

0 commit comments

Comments
 (0)