java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/Detail.java
changeset 179 2ed9f3231a28
parent 178 afee4e663992
child 180 7eb749d4a949
     1.1 --- a/java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/Detail.java	Wed Jan 26 02:24:34 2011 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,49 +0,0 @@
     1.4 -package cz.frantovo.nekurak.web;
     1.5 -
     1.6 -import cz.frantovo.nekurak.dto.Podnik;
     1.7 -import java.io.UnsupportedEncodingException;
     1.8 -import java.net.URLEncoder;
     1.9 -
    1.10 -/**
    1.11 - *
    1.12 - * @author fiki
    1.13 - */
    1.14 -public class Detail {
    1.15 -
    1.16 -	private HledacSluzby hledac = new HledacSluzby();
    1.17 -	private int id;
    1.18 -	private Podnik podnik;
    1.19 -
    1.20 -	/**
    1.21 -	 * @return URL mapy – obrázku nebo null při chybě nebo absenci souřadnic
    1.22 -	 */
    1.23 -	public String getMapa() {
    1.24 -		Podnik p = getPodnik();
    1.25 -
    1.26 -		if (p == null || p.getSirka() == null || p.getDelka() == null) {
    1.27 -			return null;
    1.28 -		} else {
    1.29 -			try {
    1.30 -				String souradnice = URLEncoder.encode(p.getSirka() + ", " + p.getDelka(), "UTF-8");
    1.31 -				return "http://maps.google.com/maps/api/staticmap?size=400x400&sensor=false&markers=size:big|color:green|" + souradnice;
    1.32 -			} catch (UnsupportedEncodingException e) {
    1.33 -				return null;
    1.34 -			}
    1.35 -		}
    1.36 -	}
    1.37 -
    1.38 -	public int getId() {
    1.39 -		return id;
    1.40 -	}
    1.41 -
    1.42 -	public void setId(int id) {
    1.43 -		this.id = id;
    1.44 -	}
    1.45 -
    1.46 -	public Podnik getPodnik() {
    1.47 -		if (podnik == null) {
    1.48 -			podnik = hledac.getPodnikEJB().getPodnik(id);
    1.49 -		}
    1.50 -		return podnik;
    1.51 -	}
    1.52 -}