PageRenderTime 14ms CodeModel.GetById 6ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/webportal/src/main/java/org/ala/spatial/analysis/web/AddToolSpeciesListComposer.java

http://alageospatialportal.googlecode.com/
Java | 76 lines | 56 code | 12 blank | 8 comment | 2 complexity | ab7e26176df15d411f40c986f979da60 MD5 | raw file
 1/*
 2 * To change this template, choose Tools | Templates
 3 * and open the template in the editor.
 4 */
 5package org.ala.spatial.analysis.web;
 6
 7import java.util.HashMap;
 8import org.ala.spatial.util.SelectedArea;
 9import org.zkoss.zk.ui.Executions;
10
11/**
12 *
13 * @author ajay
14 */
15public class AddToolSpeciesListComposer extends AddToolComposer {
16
17    String selectedLayers = "";
18    int generation_count = 1;
19    String layerLabel = "";
20    String legendPath = "";
21    String extraParams;
22
23    @Override
24    public void afterCompose() {
25        super.afterCompose();
26
27        this.selectedMethod = "Species list";
28        this.totalSteps = 1;
29
30        this.loadAreaLayers();
31        this.updateWindowTitle();
32        extraParams = (String) Executions.getCurrent().getArg().get("extraParams");
33    }
34
35    @Override
36    public void onLastPanel() {
37        super.onLastPanel();
38    }
39
40    @Override
41    public boolean onFinish() {
42        try {
43            onClick$btnDownload();
44            return true;
45        } catch (Exception e) {
46            e.printStackTrace();
47            getMapComposer().showMessage("Unknown error.", this);
48        }
49        return false;
50    }
51
52    public void onClick$btnDownload() {
53        SelectedArea sa = getSelectedArea();
54        HashMap<String, Object> hm = new HashMap<String, Object>();
55        hm.put("selectedarea", sa);
56        hm.put("geospatialKosher", getGeospatialKosher());
57        hm.put("chooseEndemic", Boolean.valueOf(chkEndemicSpecies.isChecked()));
58        
59        if(extraParams != null){
60            hm.put("extraParams",extraParams);
61        }        
62        SpeciesListResults window = (SpeciesListResults) Executions.createComponents("WEB-INF/zul/AnalysisSpeciesListResults.zul", getMapComposer(), hm);
63        try {
64            window.doModal();
65        } catch (Exception e) {
66            e.printStackTrace();
67        }
68
69        detach();
70    }
71
72    @Override
73    void fixFocus() {
74        rgArea.setFocus(true);
75    }
76}