MapView.java
1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.view;
import fi.insomnia.bortal.model.EventMap;
import fi.insomnia.bortal.model.Place;
import java.util.Map;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
/**
*
* @author tuukka
*/
@ManagedBean(name = "mapView")
@SessionScoped
public class MapView {
private EventMap activeMap;
/** Creates a new instance of MapView */
public MapView() {
}
public void placeSelectActionListener(ActionEvent e) {
FacesContext context = FacesContext.getCurrentInstance();
String clientId = e.getComponent().getClientId(context);
Map requestParams = context.getExternalContext().getRequestParameterMap();
int x = new Integer((String) requestParams.get(clientId + ".x")).intValue();
int y = new Integer((String) requestParams.get(clientId + ".y")).intValue();
Place place = getActiveMap().findPlace(x, y);
throw new UnsupportedOperationException("We got place, but are doing nothing with it");
}
public String getSelectPlaceMapUrl() {
throw new UnsupportedOperationException("Return map url");
}
/**
* @return the activeMap
*/
public EventMap getActiveMap() {
return activeMap;
}
/**
* @param activeMap the activeMap to set
*/
public void setActiveMap(EventMap activeMap) {
this.activeMap = activeMap;
}
}