Skip to content

Commit e525cea

Browse files
committed
Dedup code
1 parent 020c564 commit e525cea

File tree

3 files changed

+82
-112
lines changed

3 files changed

+82
-112
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
* Copyright © 2019 XDEV Software (https://xdev.software)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package software.xdev.vaadin.maps.leaflet.map;
17+
18+
public class AbstractLMapPanOptions<T extends AbstractLMapPanOptions<T>>
19+
implements LMapPanBaseOptions<T>
20+
{
21+
private Boolean animate;
22+
private Double duration;
23+
private Double easeLinearity;
24+
private Boolean noMoveStart;
25+
26+
@Override
27+
public Boolean getAnimate()
28+
{
29+
return this.animate;
30+
}
31+
32+
@Override
33+
public void setAnimate(final Boolean animate)
34+
{
35+
this.animate = animate;
36+
}
37+
38+
@Override
39+
public T withAnimate(final Boolean animate)
40+
{
41+
return LMapPanBaseOptions.super.withAnimate(animate);
42+
}
43+
44+
@Override
45+
public Double getDuration()
46+
{
47+
return this.duration;
48+
}
49+
50+
@Override
51+
public void setDuration(final Double duration)
52+
{
53+
this.duration = duration;
54+
}
55+
56+
@Override
57+
public Double getEaseLinearity()
58+
{
59+
return this.easeLinearity;
60+
}
61+
62+
@Override
63+
public void setEaseLinearity(final Double easeLinearity)
64+
{
65+
this.easeLinearity = easeLinearity;
66+
}
67+
68+
@Override
69+
public Boolean getNoMoveStart()
70+
{
71+
return this.noMoveStart;
72+
}
73+
74+
@Override
75+
public void setNoMoveStart(final Boolean noMoveStart)
76+
{
77+
this.noMoveStart = noMoveStart;
78+
}
79+
}

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

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -15,70 +15,13 @@
1515
*/
1616
package software.xdev.vaadin.maps.leaflet.map;
1717

18-
/**
19-
* @see <a href="https://leafletjs.com/reference.html#zoom/pan-options">Leaflet docs</a>
20-
*/
2118
public class AbstractLMapZoomPanOptions<T extends AbstractLMapZoomPanOptions<T>>
22-
implements
23-
LMapZoomBaseOptions<T>,
24-
LMapPanBaseOptions<T>
19+
extends AbstractLMapPanOptions<T>
20+
implements LMapZoomBaseOptions<T>
2521
{
26-
private Boolean animate;
27-
private Double duration;
28-
private Double easeLinearity;
29-
private Boolean noMoveStart;
30-
31-
@Override
32-
public Boolean getAnimate()
33-
{
34-
return this.animate;
35-
}
36-
37-
@Override
38-
public void setAnimate(final Boolean animate)
39-
{
40-
this.animate = animate;
41-
}
42-
4322
@Override
4423
public T withAnimate(final Boolean animate)
4524
{
4625
return LMapZoomBaseOptions.super.withAnimate(animate);
4726
}
48-
49-
@Override
50-
public Double getDuration()
51-
{
52-
return this.duration;
53-
}
54-
55-
@Override
56-
public void setDuration(final Double duration)
57-
{
58-
this.duration = duration;
59-
}
60-
61-
@Override
62-
public Double getEaseLinearity()
63-
{
64-
return this.easeLinearity;
65-
}
66-
67-
@Override
68-
public void setEaseLinearity(final Double easeLinearity)
69-
{
70-
this.easeLinearity = easeLinearity;
71-
}
72-
73-
@Override
74-
public Boolean getNoMoveStart()
75-
{
76-
return this.noMoveStart;
77-
}
78-
79-
@Override
80-
public void setNoMoveStart(final Boolean noMoveStart)
81-
{
82-
this.noMoveStart = noMoveStart;
83-
}
8427
}

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

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -18,58 +18,6 @@
1818
/**
1919
* @see <a href="https://leafletjs.com/reference.html#pan-options">Leaflet docs</a>
2020
*/
21-
public class LMapPanOptions implements LMapPanBaseOptions<LMapPanOptions>
21+
public class LMapPanOptions extends AbstractLMapPanOptions<LMapPanOptions>
2222
{
23-
private Boolean animate;
24-
private Double duration;
25-
private Double easeLinearity;
26-
private Boolean noMoveStart;
27-
28-
@Override
29-
public Boolean getAnimate()
30-
{
31-
return this.animate;
32-
}
33-
34-
@Override
35-
public void setAnimate(final Boolean animate)
36-
{
37-
this.animate = animate;
38-
}
39-
40-
@Override
41-
public Double getDuration()
42-
{
43-
return this.duration;
44-
}
45-
46-
@Override
47-
public void setDuration(final Double duration)
48-
{
49-
this.duration = duration;
50-
}
51-
52-
@Override
53-
public Double getEaseLinearity()
54-
{
55-
return this.easeLinearity;
56-
}
57-
58-
@Override
59-
public void setEaseLinearity(final Double easeLinearity)
60-
{
61-
this.easeLinearity = easeLinearity;
62-
}
63-
64-
@Override
65-
public Boolean getNoMoveStart()
66-
{
67-
return this.noMoveStart;
68-
}
69-
70-
@Override
71-
public void setNoMoveStart(final Boolean noMoveStart)
72-
{
73-
this.noMoveStart = noMoveStart;
74-
}
7523
}

0 commit comments

Comments
 (0)