📄 aimsbuffertask.java
字号:
for(int i=0; i<resultLayer.getRecordset().getCount(); i++)
{
this.resultRecords.add(new AIMSBufferResultRecord(resultLayer.getRecordset().getRecords(i), resultLayer.getRecordset().getTableDesc(), i));
}
//add the buffer result to WebResults
this.results = this.context.getWebResults();
java.util.Map actions = new LinkedHashMap();
//actions.put("Zoom", "zoom");
//actions.put("HighLight", "highlight");
//System.out.println(this.resultRecords.size());
this.results.addResultsWithActionMap("Results", this.resultRecords, "getName", "getDetails", actions);
this.currentHighlighted.highlight();
this.context.refresh();
//AIMSBufferTaskUtil.showQueryResults(this.context);
}
catch(Exception e)
{
System.out.println(e.toString());
}
}
private AIMSMapResource getResourceById(int id)
{
try
{
ArrayList resourceList = new ArrayList();
if(context != null)
{
LinkedHashMap resources = (LinkedHashMap)context.getResources();
Object resource;
for(Iterator iter = resources.keySet().iterator(); iter.hasNext();)
{
String i = (String)iter.next();
resource = resources.get(i);
if (resource instanceof AIMSMapResource)
{
AIMSMapResource tempAimsResource = (AIMSMapResource)resource;
resourceList.add(tempAimsResource);
}
}
}
return (AIMSMapResource)(resourceList.get(id));
}
catch(Exception e)
{
System.out.println(e.toString());
return null;
}
}
private int getLayerIdxByName(AIMSMapResource aimsResource, String layerName)
{
int index = -1;
Map aims_map = null;
Layers aims_layers = null;
if(aimsResource == null)
{
return -1;
}
AIMSMapFunctionality aims_map_func = (AIMSMapFunctionality)(aimsResource).getFunctionality("map");
aims_map = aims_map_func.getMap();
aims_layers = aims_map.getLayers();
for(int i=0; i<aims_layers.getCount(); i++)
{
if(aims_layers.item(i).getName().equalsIgnoreCase(layerName) == true)
{
index = i;
break;
}
}
if(index >= 0) return index;
else
return -1;
}
public TaskInfo getTaskInfo()
{
if(context == null)
{
taskInfo.getTaskDescriptor().setDisabled(true);
}
return this.taskInfo;
}
public void setTaskInfo(TaskInfo taskInfo)
{
}
public AIMSMapResource getAimsResource()
{
return aimsResource;
}
public void setAimsResource(AIMSMapResource aimsResource)
{
this.aimsResource = aimsResource;
}
public WebContext getContext()
{
return context;
}
public void setContext(WebContext context)
{
if (context != null)
{
this.context = context;
this.results = this.context.getWebResults();
this.aimsResourceList = AIMSBufferTaskUtil.getAimsResourceList(this.context);
if(this.aimsResource == null)
{
this.setAimsResource(getResourceById(0));
}
this.layerList = AIMSBufferTaskUtil.getQueryLayerList(((WebQuery)context.getAttribute("query")).getQueryLayers());
this.bufferLayerList = AIMSBufferTaskUtil.getLayerList(this.aimsResource);
this.targetLayerList = AIMSBufferTaskUtil.getLayerList(this.aimsResource);
this.bufferUnitList = AIMSBufferTaskUtil.getBufferUnitList();
context.addObserver(this);
}
else
{
taskInfo.getTaskDescriptor().setDisabled(true);
}
}
public String getTaskName()
{
return taskName;
}
public void setTaskName(String taskName)
{
this.taskName = taskName;
taskInfo.getTaskDescriptor().setDisplayName(taskName);
}
public LinkedHashMap getBufferLayerList()
{
this.bufferLayerList = AIMSBufferTaskUtil.getLayerList(this.aimsResource);
return bufferLayerList;
}
public void setBufferLayerList(LinkedHashMap bufferLayerList)
{
this.bufferLayerList = bufferLayerList;
}
public LinkedHashMap getTargetLayerList()
{
this.targetLayerList = AIMSBufferTaskUtil.getLayerList(this.aimsResource);
return targetLayerList;
}
public void setTargetLayerList(LinkedHashMap targetLayerList)
{
this.targetLayerList = targetLayerList;
}
public int getBufferDistance() {
return bufferDistance;
}
public void setBufferDistance(int bufferDistance) {
this.bufferDistance = bufferDistance;
}
public String getBufferUnit() {
return bufferUnit;
}
public void setBufferUnit(String bufferUnit) {
this.bufferUnit = bufferUnit;
}
public String getWhereClause() {
return whereClause;
}
public void setWhereClause(String whereClause) {
this.whereClause = whereClause;
}
public int getBufferLayerId() {
return bufferLayerId;
}
public void setBufferLayerId(int bufferLayerId) {
this.bufferLayerId = bufferLayerId;
}
public int getTargetLayerId() {
return targetLayerId;
}
public void setTargetLayerId(int targetLayerId) {
this.targetLayerId = targetLayerId;
}
public int getBufferUnitId() {
return bufferUnitId;
}
public void setBufferUnitId(int bufferUnitId) {
this.bufferUnitId = bufferUnitId;
}
public LinkedHashMap getBufferUnitList()
{
this.bufferUnitList = AIMSBufferTaskUtil.getBufferUnitList();
return this.bufferUnitList;
}
public void setBufferUnitList(LinkedHashMap bufferUnitList)
{
this.bufferUnitList = bufferUnitList;
}
public WebResults getResults() {
return results;
}
public void setResults(WebResults results) {
this.results = results;
}
public WebResultsToc getResultsToc() {
return resultsToc;
}
public void setResultsToc(WebResultsToc resultsToc) {
this.resultsToc = resultsToc;
}
public AIMSBufferResultRecord getCurrentRecords() {
return currentRecords;
}
public void setCurrentRecords(AIMSBufferResultRecord currentRecords) {
this.currentRecords = currentRecords;
}
public ArrayList getResultRecords() {
return resultRecords;
}
public void setResultRecords(ArrayList resultRecords) {
this.resultRecords = resultRecords;
}
public int getAimsResourceId() {
return aimsResourceId;
}
public void setAimsResourceId(int aimsResourceId) {
this.aimsResourceId = aimsResourceId;
}
public LinkedHashMap getAimsResourceList() {
this.aimsResourceList = AIMSBufferTaskUtil.getAimsResourceList(this.context);
return aimsResourceList;
}
public void setAimsResourceList(LinkedHashMap aimsResourceList) {
this.aimsResourceList = aimsResourceList;
}
public int getLayerId() {
return layerId;
}
public void setLayerId(int layerId) {
this.layerId = layerId;
}
public LinkedHashMap getLayerList() {
this.layerList = AIMSBufferTaskUtil.getQueryLayerList(((WebQuery)context.getAttribute("query")).getQueryLayers());
return layerList;
}
public void setLayerList(LinkedHashMap layerList) {
this.layerList = layerList;
}
public QueryResult getCurrentHighlighted() {
return currentHighlighted;
}
public void setCurrentHighlighted(QueryResult currentHighlighted) {
this.currentHighlighted = currentHighlighted;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -