/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. */
  5. package org.ala.spatial.analysis.web;
  6. import java.util.HashMap;
  7. import org.ala.spatial.util.SelectedArea;
  8. import org.zkoss.zk.ui.Executions;
  9. /**
  10. *
  11. * @author ajay
  12. */
  13. public class AddToolSpeciesListComposer extends AddToolComposer {
  14. String selectedLayers = "";
  15. int generation_count = 1;
  16. String layerLabel = "";
  17. String legendPath = "";
  18. String extraParams;
  19. @Override
  20. public void afterCompose() {
  21. super.afterCompose();
  22. this.selectedMethod = "Species list";
  23. this.totalSteps = 1;
  24. this.loadAreaLayers();
  25. this.updateWindowTitle();
  26. extraParams = (String) Executions.getCurrent().getArg().get("extraParams");
  27. }
  28. @Override
  29. public void onLastPanel() {
  30. super.onLastPanel();
  31. }
  32. @Override
  33. public boolean onFinish() {
  34. try {
  35. onClick$btnDownload();
  36. return true;
  37. } catch (Exception e) {
  38. e.printStackTrace();
  39. getMapComposer().showMessage("Unknown error.", this);
  40. }
  41. return false;
  42. }
  43. public void onClick$btnDownload() {
  44. SelectedArea sa = getSelectedArea();
  45. HashMap<String, Object> hm = new HashMap<String, Object>();
  46. hm.put("selectedarea", sa);
  47. hm.put("geospatialKosher", getGeospatialKosher());
  48. hm.put("chooseEndemic", Boolean.valueOf(chkEndemicSpecies.isChecked()));
  49. if(extraParams != null){
  50. hm.put("extraParams",extraParams);
  51. }
  52. SpeciesListResults window = (SpeciesListResults) Executions.createComponents("WEB-INF/zul/AnalysisSpeciesListResults.zul", getMapComposer(), hm);
  53. try {
  54. window.doModal();
  55. } catch (Exception e) {
  56. e.printStackTrace();
  57. }
  58. detach();
  59. }
  60. @Override
  61. void fixFocus() {
  62. rgArea.setFocus(true);
  63. }
  64. }