📄 selectbypointbuffertask.java
字号:
package com.esri.solutions.jitk.web.tasks.query.pointbuffer;
import com.esri.adf.web.aims.data.AIMSMapFunctionality;
import com.esri.adf.web.aims.data.AIMSMapResource;
import com.esri.adf.web.data.GISResource;
import com.esri.adf.web.data.GraphicElement;
import com.esri.adf.web.data.WebContext;
import com.esri.adf.web.data.WebGraphics;
import com.esri.adf.web.data.WebLayerInfo;
import com.esri.adf.web.data.WebMap;
import com.esri.adf.web.data.geometry.WebGeometry;
import com.esri.adf.web.data.geometry.WebPoint;
import com.esri.adf.web.data.geometry.WebPolygon;
import com.esri.adf.web.data.query.IdentifyCriteria;
import com.esri.adf.web.data.query.PredefinedQueryCriteria;
import com.esri.adf.web.data.query.QueryResult;
import com.esri.adf.web.data.query.WebQuery;
import com.esri.adf.web.data.results.WebResults;
import com.esri.adf.web.data.symbol.WebSimpleMarkerSymbol;
import com.esri.adf.web.data.symbol.WebSimplePolygonSymbol;
import com.esri.adf.web.data.tasks.TaskInfo;
import com.esri.adf.web.faces.event.MapEvent;
import com.esri.adf.web.faces.event.TaskEvent;
import com.esri.adf.web.util.ADFDownloadServlet;
import com.esri.aims.mtier.model.map.layer.Layer;
import com.esri.solutions.jitk.common.agslocal.IServerContextFactory;
import com.esri.solutions.jitk.common.analysis.buffer.BufferCalculatorFactory;
import com.esri.solutions.jitk.common.analysis.buffer.IBufferCalculator;
import com.esri.solutions.jitk.common.web.layer.WebLayerInfoUtil;
import com.esri.solutions.jitk.web.data.geometry.GeomUtil;
import com.esri.solutions.jitk.web.tasks.FeatureSelectionAgsLocalTask;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* This task supports creating a buffer by selecting a point on the map view and providing a user entered distance.
*/
@SuppressWarnings({"unchecked",
"deprecation"
})
public class SelectByPointBufferTask extends FeatureSelectionAgsLocalTask {
private static final long serialVersionUID = 3538061927155405748L;
private static final Logger _logger = LogManager.getLogger(SelectByPointBufferTask.class);
private static final String POINT_BUFFER_TASK = "Point Buffer Task";
private static final String FILL_COLOR = "255,255,0";
private static final String POINT_COLOR = "255,0,0";
private static final double TRANSPARENCY_FACTOR = 0.5;
private SelectByPointBufferTaskInfo taskInfo = null;
private String taskName = null;
private LinkedHashMap<String, String> layerList = null;
private LinkedHashMap<Integer, String> unitList = null;
private String layer = null;
private Integer unit = null;
private String distance = "0.0";
private String displayAttribute = "true";
private String unitParam = null;
private String targetLayerParam = null;
private String distanceLabel = null;
private String specifyPointLabel = null;
private String errorLabel = null;
private String findDataLabel = null;
private String messageLabel = null;
private String uiMessage = null;
private String footerNote = null;
private QueryResult currentHighlighted = null;
public SelectByPointBufferTask() {
super();
setTaskInfo(new SelectByPointBufferTaskInfo());
this.taskName = POINT_BUFFER_TASK;
this._agsServerContextFactory = null;
}
public TaskInfo getTaskInfo() {
if (this._context == null) {
taskInfo.getTaskDescriptor().setDisabled(true);
}
if (this.unit == null) {
this.unit = GeomUtil.findUnit(this.unitParam);
}
if ((this.layer == null) && (this.targetLayerParam != null)) {
Iterator<Map.Entry<String, String>> it = this.layerList.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, String> entry = (Map.Entry<String, String>) it.next();
String key = (String) entry.getKey();
String value = (String) entry.getValue();
if (value.equalsIgnoreCase(targetLayerParam)) {
this.layer = key;
break;
}
}
}
return this.taskInfo;
}
public void setTaskInfo(TaskInfo taskInfo) {
this.taskInfo = (SelectByPointBufferTaskInfo) taskInfo;
super.setTaskInfo(this.taskInfo);
}
public void setContext(WebContext context) {
if (context != null) {
super.setContext(context);
this.layerList = new LayerList(context);
} else {
taskInfo.getTaskDescriptor().setDisabled(true);
}
}
public void setHighlightQueriedFeature() {}
/**
* Get findData label
*/
public String getFindDataLabel() {
return this.findDataLabel;
}
/**
* Set findData label
*/
public void setFindDataLabel(String findDataLabel) {
this.findDataLabel = findDataLabel;
}
/**
* Get message label
*/
public String getMessageLabel() {
return this.messageLabel;
}
/**
* Set message label
*/
public void setMessageLabel(String messageLabel) {
this.messageLabel = messageLabel;
}
/**
* Get ui message
*/
public String getUiMessage() {
return this.uiMessage;
}
/**
* Set ui message
*/
public void setUiMessage(String uiMessage) {
this.uiMessage = uiMessage;
}
/**
* Get footer note
*/
public String getFooterNote() {
return this.footerNote;
}
/**
* Set footer note
*/
public void setFooterNote(String footerNote) {
this.footerNote = footerNote;
}
/**
* Get distance label
*/
public String getDistanceLabel() {
return this.distanceLabel;
}
/**
* Set distance label
*/
public void setDistanceLabel(String distanceLabel) {
this.distanceLabel = distanceLabel;
}
/**
* Get specify point label
*/
public String getSpecifyPointLabel() {
return this.specifyPointLabel;
}
/**
* Set specify point label
*/
public void setSpecifyPointLabel(String specifyPointLabel) {
this.specifyPointLabel = specifyPointLabel;
}
/**
* Get error label
*/
public String getErrorLabel() {
return this.errorLabel;
}
/**
* Set error label
*/
public void setErrorLabel(String errorLabel) {
this.errorLabel = errorLabel;
}
/**
* Get task name
*/
public String getTaskName() {
return taskName;
}
/**
* Set task name
*/
public void setTaskName(String taskName) {
this.taskName = taskName;
}
/**
* Get selected layer for buffer query
*/
public String getLayer() {
return this.layer;
}
/**
* Set selected layer for buffer query
*/
public void setLayer(String layer) {
this.layer = layer;
}
/**
* Get target layer parameter
*/
public String getTargetLayerParam() {
return this.targetLayerParam;
}
/**
* Set target layer parameter
*/
public void setTargetLayerParam(String targetLayerParam) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -