/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
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package org.ala.spatial.analysis.web;
- import java.util.HashMap;
- import org.ala.spatial.util.SelectedArea;
- import org.zkoss.zk.ui.Executions;
- /**
- *
- * @author ajay
- */
- public class AddToolSpeciesListComposer extends AddToolComposer {
- String selectedLayers = "";
- int generation_count = 1;
- String layerLabel = "";
- String legendPath = "";
- String extraParams;
- @Override
- public void afterCompose() {
- super.afterCompose();
- this.selectedMethod = "Species list";
- this.totalSteps = 1;
- this.loadAreaLayers();
- this.updateWindowTitle();
- extraParams = (String) Executions.getCurrent().getArg().get("extraParams");
- }
- @Override
- public void onLastPanel() {
- super.onLastPanel();
- }
- @Override
- public boolean onFinish() {
- try {
- onClick$btnDownload();
- return true;
- } catch (Exception e) {
- e.printStackTrace();
- getMapComposer().showMessage("Unknown error.", this);
- }
- return false;
- }
- public void onClick$btnDownload() {
- SelectedArea sa = getSelectedArea();
- HashMap<String, Object> hm = new HashMap<String, Object>();
- hm.put("selectedarea", sa);
- hm.put("geospatialKosher", getGeospatialKosher());
- hm.put("chooseEndemic", Boolean.valueOf(chkEndemicSpecies.isChecked()));
-
- if(extraParams != null){
- hm.put("extraParams",extraParams);
- }
- SpeciesListResults window = (SpeciesListResults) Executions.createComponents("WEB-INF/zul/AnalysisSpeciesListResults.zul", getMapComposer(), hm);
- try {
- window.doModal();
- } catch (Exception e) {
- e.printStackTrace();
- }
- detach();
- }
- @Override
- void fixFocus() {
- rgArea.setFocus(true);
- }
- }