⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basicbookmark.java

📁 esri的ArcGIS Server超级学习模板程序(for java)
💻 JAVA
字号:
package com.esri.solutions.jitk.web.tasks.navigation.bookmark;

import com.esri.adf.web.data.geometry.WebExtent;
import com.esri.adf.web.data.geometry.WebSpatialReference;
import com.esri.adf.web.data.tasks.ADFTaskException;

/**
 * A simple implementation of an application-level bookmark.  A bookmark has
 * these things, according to this contract:<p/>
 * <ul>
 * <li/>a bookmark name, for simple referencing
 * <li/>a bookmark description, for a more-detailed explanation of the
 * bookmark's purpose <li/>a bookmark spatial extent, with a possibly-null
 * spatial reference
 * <li/>a bookmark spatial reference ID (should correspond to the spatial
 * reference instance)
 * <li/>a bookmark spatial reference instance (should correspond to the spatial
 * reference ID)
 * </ul>
 * 
 */
public class BasicBookmark implements Bookmark {
	private WebExtent extent;
	private String name;
	private String description;
	private WebSpatialReference spatialReference;
	private Integer spatialReferenceId;

	public BasicBookmark() {
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public WebExtent getExtent() {
		return extent;
	}

	public void setExtent(WebExtent extent) {
		this.extent = extent;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public WebSpatialReference getSpatialReference() {
		return spatialReference;
	}

	public void setSpatialReference(WebSpatialReference spatialReference) {
		this.spatialReference = spatialReference;
	}

	public Integer getSpatialReferenceId() {
		return spatialReferenceId;
	}

	/*
	 * This also instantiates the corresponding WebSpatialReference for the
	 * passed ID.
	 * 
	 * (non-Javadoc)
	 * 
	 * @see com.esri.arcgis.jitk.navigation.Bookmark#setSpatialReferenceId(java.lang.Integer)
	 */
	public void setSpatialReferenceId(Integer spatialReferenceId) {
		this.spatialReferenceId = spatialReferenceId;

		// allow nulls, but do not bother setting the spatial reference
		// reference if it IS null
		if (null != spatialReferenceId) {
			try {
				WebSpatialReference sref = WebSpatialReference
						.getWebSpatialReference(spatialReferenceId);
				if (sref == null) {
					throw new ADFTaskException(
						"Unable to create web spatial reference for wsref ID = "
						+ spatialReferenceId);
				}
				setSpatialReference(sref);
			} 
			catch (ADFTaskException e) {
				throw e;
			} 
			catch (RuntimeException e) {
				throw new ADFTaskException(
						"Unable to create web spatial reference for wsref ID = "
						+ spatialReferenceId, e);
			}
		}
	}

	public String toString() {
		return getName();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -