1 package fr.ifremer.dali.ui.swing.util.map;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 import fr.ifremer.dali.ui.swing.util.map.layer.DataFeatureLayer;
25 import org.geotools.geometry.DirectPosition2D;
26
27 import java.awt.Point;
28 import java.util.EventObject;
29 import java.util.Set;
30
31
32
33
34 public class DataSelectionEvent extends EventObject {
35
36 public enum Type {
37
38
39
40
41
42 DATA_LAYER_SELECTED,
43
44
45
46
47 EMPTY_SELECTION
48 }
49
50 private Type type;
51
52 private Set<DataFeatureLayer> selectedDataLayers;
53
54 private Point screenPoint;
55
56 private DirectPosition2D worldPos;
57
58 public DataSelectionEvent(DataMapPane source, Type type) {
59 this(source, type, null, null, null);
60 }
61
62
63
64
65
66
67
68
69
70
71
72 public DataSelectionEvent(DataMapPane source, Type type, Set<DataFeatureLayer> dataLayers, Point screenPoint, DirectPosition2D worldPos) {
73 super(source);
74 this.type = type;
75 this.selectedDataLayers = dataLayers;
76 this.screenPoint = screenPoint;
77 this.worldPos = worldPos;
78 }
79
80 @Override
81 public DataMapPane getSource() {
82 return (DataMapPane) super.getSource();
83 }
84
85 public Type getType() {
86 return type;
87 }
88
89 public Set<DataFeatureLayer> getSelectedDataLayers() {
90 return selectedDataLayers;
91 }
92
93 public Point getScreenPoint() {
94 return screenPoint;
95 }
96
97 public DirectPosition2D getWorldPos() {
98 return worldPos;
99 }
100 }