use of org.zkoss.zk.ui.event.Event in project spatial-portal by AtlasOfLivingAustralia.
the class AreaReportController method listJournalmap.
public void listJournalmap() {
if (journalmapHtml != null) {
Event ev = new Event(StringConstants.ONCLICK, this, "Journalmap Documents\n" + journalmapHtml);
getMapComposer().openHTML(ev);
}
}
use of org.zkoss.zk.ui.event.Event in project spatial-portal by AtlasOfLivingAustralia.
the class ExternalContentComposer method doOverlapped.
@Override
public void doOverlapped() {
super.doOverlapped();
this.getFellow("hide").addEventListener(StringConstants.ONCLICK, new EventListener() {
public void onEvent(Event event) throws Exception {
close();
}
});
this.getFellow(StringConstants.RESET).addEventListener(StringConstants.ONCLICK, new EventListener() {
public void onEvent(Event event) throws Exception {
Events.echoEvent(StringConstants.SET_SRC, event.getTarget().getParent().getParent(), null);
}
});
this.getFellow(StringConstants.BREAKOUT).addEventListener(StringConstants.ONCLICK, new EventListener() {
public void onEvent(Event event) throws Exception {
close();
}
});
}
use of org.zkoss.zk.ui.event.Event in project spatial-portal by AtlasOfLivingAustralia.
the class AreaUploadShapefile method afterCompose.
@Override
public void afterCompose() {
super.afterCompose();
txtLayerName.setValue(getMapComposer().getNextAreaLayerName(CommonData.lang(StringConstants.DEFAULT_AREA_LAYER_NAME)));
fileUpload.addEventListener("onUpload", new EventListener() {
public void onEvent(Event event) throws Exception {
onClick$btnOk(event);
}
});
}
use of org.zkoss.zk.ui.event.Event in project spatial-portal by AtlasOfLivingAustralia.
the class TabulationComposer method onFinish.
@Override
public boolean onFinish() {
String f1DisplayName = cbTabLayers1.getSelectedItem().getValue();
String f2DisplayName = cbTabLayers2.getSelectedItem().getValue();
String f1Name = "", f2Name = "";
Iterator<FieldDTO> it = tabLayers.keySet().iterator();
while (it.hasNext()) {
FieldDTO fi = it.next();
if (f1DisplayName.equals(fi.getDisplayName())) {
f1Name = fi.getName();
} else if (f2DisplayName.equals(fi.getDisplayName())) {
f2Name = fi.getName();
}
}
Event e = new Event("tabulation", this, CommonData.getLayersServer() + "/tabulation/" + cbTabType.getSelectedItem().getValue() + "/" + f1Name + "/" + f2Name + "/tabulation.html" + "\n" + StringConstants.TABULATION + "\n" + CommonData.getLayersServer() + "/tabulation/" + cbTabType.getSelectedItem().getValue() + "/" + f1Name + "/" + f2Name + "/tabulation.csv");
getMapComposer().openUrl(e);
remoteLogger.logMapAnalysis(StringConstants.TABULATION, "Tool - Tabulation", "", "", f1Name + ":" + f2Name, "", (String) cbTabType.getSelectedItem().getValue(), StringConstants.STARTED);
this.detach();
return true;
}
use of org.zkoss.zk.ui.event.Event in project spatial-portal by AtlasOfLivingAustralia.
the class TabulationComposer method afterCompose.
@Override
public void afterCompose() {
super.afterCompose();
this.selectedMethod = StringConstants.TABULATION;
this.totalSteps = 1;
this.updateWindowTitle();
cbTabLayers1.setFocus(true);
tabLayers = new HashMap<FieldDTO, List<FieldDTO>>();
tabLayerDisplayNames = new HashMap<String, List<String>>();
try {
int i;
HttpClient client = new HttpClient();
GetMethod get = new GetMethod(CommonData.getLayersServer() + "/tabulations.json");
get.addRequestHeader(StringConstants.ACCEPT, StringConstants.APPLICATION_JSON);
client.executeMethod(get);
String tlayers = get.getResponseBodyAsString();
JSONParser jp = new JSONParser();
JSONObject joTop = (JSONObject) jp.parse(tlayers);
JSONArray joarr = (JSONArray) joTop.get("tabulations");
for (i = 0; i < joarr.size(); i++) {
JSONObject jo = (JSONObject) joarr.get(i);
FieldDTO f1 = new FieldDTO(jo.get("fid1").toString(), jo.get("name1").toString(), "");
FieldDTO f2 = new FieldDTO(jo.get("fid2").toString(), jo.get("name2").toString(), "");
load(f1, f2);
load(f2, f1);
}
Set keySet = (Set) tabLayerDisplayNames.keySet();
List keyList = new ArrayList(keySet);
Collections.sort(keyList);
LOGGER.debug("keyList1=" + keyList);
for (int j = 0; j < keyList.size(); j++) {
String temp = (String) keyList.get(j);
LOGGER.debug("temp=" + temp);
Comboitem ci = new Comboitem(temp);
ci.setValue(temp);
ci.setParent(cbTabLayers1);
}
cbTabLayers1.addEventListener("onChange", new EventListener() {
public void onEvent(Event event) throws Exception {
onChange$cbTabLayer1(event);
}
});
cbTabLayers1.setSelectedIndex(0);
onChange$cbTabLayer1(null);
cbTabLayers2.setSelectedIndex(0);
cbTabType.setSelectedIndex(0);
} catch (Exception e) {
LOGGER.debug("Unable to call tabulation service for a list of layers", e);
}
}
Aggregations