highlightactionhandler.java
来自「esri的ArcGIS Server超级学习模板程序(for java)」· Java 代码 · 共 88 行
JAVA
88 行
package com.esri.solutions.jitk.web.tasks.search.csw.actions;
import com.esri.adf.web.data.WebApplication;
import com.esri.adf.web.data.WebContext;
import com.esri.adf.web.data.geometry.WebGeometry;
import com.esri.adf.web.data.query.WebQuery;
import com.esri.solutions.jitk.common.metadata.BasicMetadataExporter;
import org.apache.log4j.Logger;
public class HighlightActionHandler implements IActionHandler {
private static final Logger _logger = Logger.getLogger(HighlightActionHandler.class);
private String _name = null;
private WebContext _context = null;
private WebGeometry _geometry = null;
/**
* Highlights the CS/W search result on the map by calling
* {@link WebQuery#addDisplayGeometry(WebGeometry)}.
*/
public void execute() {
WebQuery webQuery = null;
if (_geometry == null) {
_logger.warn("Invalid WebGeometry - cannot highlight");
return;
}
webQuery = _context.getWebQuery();
if (!webQuery.containsDisplayGeometry(_geometry)) {
webQuery.addDisplayGeometry(_geometry);
}
}
/*
* (non-Javadoc)
* @see com.esri.solutions.jitk.web.tasks.search.csw.actions.IActionHandler#getActionKey()
*/
public String getActionKey() {
return WebApplication.getResourceString(
"SearchAttributesTask.SearchResultContextMenuHighLight");
}
/*
* (non-Javadoc)
* @see com.esri.solutions.jitk.web.tasks.search.csw.actions.IActionHandler#getName()
*/
public String getName() {
return _name;
}
/*
* (non-Javadoc)
* @see com.esri.solutions.jitk.web.tasks.search.csw.actions.IActionHandler#setName(java.lang.String)
*/
public void setName(String name) {
_name = name;
}
/*
* (non-Javadoc)
* @see com.esri.solutions.jitk.web.tasks.search.csw.actions.IActionHandler#shouldDisplay(com.esri.solutions.jitk.common.metadata.BasicMetadataExporter)
*/
public boolean shouldDisplay(BasicMetadataExporter exporter) {
return true;
}
/*
* (non-Javadoc)
* @see com.esri.solutions.jitk.web.tasks.search.csw.actions.IActionHandler#setWebContext(com.esri.adf.web.data.WebContext)
*/
public void setWebContext(WebContext context) {
_context = context;
}
/*
* (non-Javadoc)
* @see com.esri.solutions.jitk.web.tasks.search.csw.actions.IActionHandler#setWebGeometry(com.esri.adf.web.data.geometry.WebGeometry)
*/
public void setWebGeometry(WebGeometry geom) {
_geometry = geom;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?