java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/Detail.java
changeset 145 0efefbf5f8b6
parent 107 e8371105fcc8
child 172 f0852ef58889
     1.1 --- a/java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/Detail.java	Tue Apr 27 16:13:36 2010 +0200
     1.2 +++ b/java/nekurak.net-web/src/java/cz/frantovo/nekurak/web/Detail.java	Sun Jun 20 14:46:47 2010 +0200
     1.3 @@ -10,40 +10,40 @@
     1.4   */
     1.5  public class Detail {
     1.6  
     1.7 -    private HledacSluzby hledac = new HledacSluzby();
     1.8 -    private int id;
     1.9 -    private Podnik podnik;
    1.10 +	private HledacSluzby hledac = new HledacSluzby();
    1.11 +	private int id;
    1.12 +	private Podnik podnik;
    1.13  
    1.14 -    /**
    1.15 -     * @return URL mapy – obrázku nebo null při chybě nebo absenci souřadnic
    1.16 -     */
    1.17 -    public String getMapa() {
    1.18 -	Podnik p = getPodnik();
    1.19 +	/**
    1.20 +	 * @return URL mapy – obrázku nebo null při chybě nebo absenci souřadnic
    1.21 +	 */
    1.22 +	public String getMapa() {
    1.23 +		Podnik p = getPodnik();
    1.24  
    1.25 -	if (p == null || p.getSirka() == null || p.getDelka() == null) {
    1.26 -	    return null;
    1.27 -	} else {
    1.28 -	    try {
    1.29 -		String souradnice = URLEncoder.encode(p.getSirka() + ", " + p.getDelka(), "UTF-8");
    1.30 -		return "http://maps.google.com/maps/api/staticmap?size=400x400&sensor=false&center=" + souradnice;
    1.31 -	    } catch (UnsupportedEncodingException e) {
    1.32 -		return null;
    1.33 -	    }
    1.34 +		if (p == null || p.getSirka() == null || p.getDelka() == null) {
    1.35 +			return null;
    1.36 +		} else {
    1.37 +			try {
    1.38 +				String souradnice = URLEncoder.encode(p.getSirka() + ", " + p.getDelka(), "UTF-8");
    1.39 +				return "http://maps.google.com/maps/api/staticmap?size=400x400&sensor=false&center=" + souradnice;
    1.40 +			} catch (UnsupportedEncodingException e) {
    1.41 +				return null;
    1.42 +			}
    1.43 +		}
    1.44  	}
    1.45 -    }
    1.46  
    1.47 -    public int getId() {
    1.48 -	return id;
    1.49 -    }
    1.50 +	public int getId() {
    1.51 +		return id;
    1.52 +	}
    1.53  
    1.54 -    public void setId(int id) {
    1.55 -	this.id = id;
    1.56 -    }
    1.57 +	public void setId(int id) {
    1.58 +		this.id = id;
    1.59 +	}
    1.60  
    1.61 -    public Podnik getPodnik() {
    1.62 -	if (podnik == null) {
    1.63 -	    podnik = hledac.getPodnikEJB().getPodnik(id);
    1.64 +	public Podnik getPodnik() {
    1.65 +		if (podnik == null) {
    1.66 +			podnik = hledac.getPodnikEJB().getPodnik(id);
    1.67 +		}
    1.68 +		return podnik;
    1.69  	}
    1.70 -	return podnik;
    1.71 -    }
    1.72  }