1 package fr.ifremer.dali.ui.swing.util.map.layer;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 import org.geotools.data.FeatureSource;
25 import org.geotools.map.FeatureLayer;
26 import org.geotools.styling.Style;
27
28
29
30
31
32
33
34
35 public class DataFeatureLayer extends FeatureLayer implements DataLayer{
36
37
38
39
40 private final DataLayerCollection dataLayerCollection;
41
42 private final Integer id;
43
44 public DataFeatureLayer(DataLayerCollection dataLayerCollection, Integer id, FeatureSource featureSource, Style style, String title) {
45 super(featureSource, style, title);
46 assert title != null;
47 this.dataLayerCollection = dataLayerCollection;
48 this.id = id;
49 }
50
51 public DataLayerCollection getDataLayerCollection() {
52 return dataLayerCollection;
53 }
54
55 public Integer getId() {
56 return id;
57 }
58
59
60
61
62
63 @Override
64 public int hashCode() {
65 return getTitle().hashCode();
66 }
67
68 @Override
69 public boolean equals(Object obj) {
70 return obj instanceof DataFeatureLayer && hashCode() == obj.hashCode();
71 }
72
73 }