📄 zoomtobookmarktask.java
字号:
try {
WebExtentBuilder extBuilder = new WebExtentBuilder();
bookmarkExtent = extBuilder.toWebExtent(bookmark);
bookmarkExtent.setSpatialReference(bookmarkWebSpatRef);
bookmarkExtent.project(mapSref);
} catch (Exception ex) {
_logger.error("Projection Error",ex);
}
return bookmarkExtent;
}
/*protected WebExtent projectBookmark(BookmarkType bookmark, WebContext webContext) {
//TODO: Impliment this
SpatialReference bookmarkSpatRef = bookmark.getEnvelope().getSpatialReference();
WebSpatialReference mapSref = webContext.getSpatialReference();
WebSpatialReference bookmarkWebSpatRef = WebSpatialReference.getWebSpatialReference(bookmarkSpatRef.getWKT());
WebExtent extent = webContext.getWebMap().getCurrentExtent();
// no matter what, the bookmark's extent prevails
bookmark.getEnvelope().setSpatialReference(bookmarkSpatRef);
WebExtentBuilder extBuilder = new WebExtentBuilder();
WebExtent bookmarkExtent = extBuilder.toWebExtent(bookmark);
bookmarkExtent.setSpatialReference(bookmarkWebSpatRef);
GeometryTransformationResult xformationResult=null;
try {
xformationResult = ProjectionUtils.transformAdfGeometry(bookmarkExtent, mapSref, false);
} catch (ProjectionException e) {
_logger.error("Unable to transform extent for bookmark named '"
+ bookmark.getId() + "'", e);
//_taskInfo.generalErrorState("Unable to transform extent for bookmark named '" + bookmark.getId() + "'" + e.toString());
}
return bookmarkExtent;
}*/
/**
* Getter for the currently-selected bookmark among all possible choices.
* @return the current setting (can be null if never set!)
*/
public String getSelectedBookmark() {
return _selectedBookmark;
}
/**
* Simple setter for the currently-selectedd bookmark.
*/
public void setSelectedBookmark(String selectedBookmark) {
this._selectedBookmark = selectedBookmark;
}
/**
* Getter for the new bookmark .
* @return the current setting (can be null if never set!)
*/
public String getNewBookmark() {
return _newBookmark;
}
/**
* Simple setter for the new bookmark.
*/
public void setNewBookmark(String newBookmark) {
this._newBookmark = newBookmark;
}
public Map<String, Bookmark> getBookmarksList() {
return _bookmarks;
}
/**
* Simple setter of the mapping of key/value pairs
*/
public void setBookmarksList(Map<String, Bookmark> bookmarks) {
this._bookmarks = bookmarks;
}
public String getCurrentDescription() {
return getCurrentBookmark().getDescription();
}
/**
* Sets the description of the Bookmark was inputed by the
* user.
*/
public void setDescription (String desc) {
_description = desc;
}
public String getDescription() {
return _description;
}
public String getId() {
IBookmark bkm = getCurrentBookmark();
return bkm.getId().toString();
}
public String getName() {
return _newBookmark;
}
/**
* Sets the name of the Bookmark that was inputed by the user.
*
* @param name Name of the Bookmark inputed by the user.
*/
public void setName (String name) {
_newBookmark = name;
}
public WebExtent getWebExtent() {
// TODO Auto-generated method stub
return null;
}
private IBookmark getCurrentBookmark() {
IBookmark bkmark = (IBookmark) _PersonalizationContext.getAttribute("CURRENT_BOOKMARK_KEY");
return bkmark;
}
public boolean isNew() {
return getCurrentBookmark().isNew();
}
public boolean getNew () {
return isNew();
}
public String getBookmarkId() {
return _bookmarkId;
}
public void setBookmarkId(String bookmarkId) {
this._bookmarkId = bookmarkId;
}
public void setBookmarkIds(List<IBookmark> bookmarks) throws PersonalizationException {
this._bookmarkIds = new LinkedHashMap<String, IBookmark>();
for (Iterator <IBookmark> bkItr = bookmarks.iterator(); bkItr.hasNext();) {
IBookmark bookmark = (IBookmark)bkItr.next();
_bookmarkIds.put(bookmark.getName(), bookmark);
}
}
public void setBookmarkIdStrs(List<IBookmark> bookmarks) throws PersonalizationException {
this._bookmarkIdss = new LinkedHashMap<String, String>();
for (Iterator <IBookmark> bkItr = bookmarks.iterator(); bkItr.hasNext();) {
IBookmark bookmark = (IBookmark)bkItr.next();
_bookmarkIdss.put(bookmark.getId().toString(), bookmark.getName());
}
}
public Map<String,IBookmark> getBookmarkIdsAsList() {
return this._bookmarkIds;
}
public Map<String,String> getBookmarkIdStrsAsList() {
return this._bookmarkIdss;
}
public Map<String, String> getBookmarkIdss() {
return _bookmarkIdss;
}
public void setBookmarkIdss(Map<String, String> bookmarkIdss) {
this._bookmarkIdss = bookmarkIdss;
}
public String getBookmarkIdStr() {
return _bookmarkIdStr;
}
public void setBookmarkIdStr(String bookmarkIdStr) {
this._bookmarkIdStr = bookmarkIdStr;
}
public String getErrormessage() {
return errormessage;
}
public void setErrormessage(String errormessage) {
this.errormessage = errormessage;
}
/**
* Get tab 1
*/
public String getTab1(){
return this._tab1;
}
/**
* Set tab 1
*/
public void setTab1(String tab){
this._tab1 = tab;
}
/**
* Get tab 2
*/
public String getTab2(){
return this._tab2;
}
/**
* Set tab 2
*/
public void setTab2(String tab){
this._tab2 = tab;
}
/**
* Get footer note on tab 1
*/
public String getFooterNoteTab1(){
return this._footerNoteTab1;
}
/**
* Set footer note on tab 1
*/
public void setFooterNoteTab1(String footerNote){
this._footerNoteTab1 = footerNote;
}
/**
* Get footer note on tab 2
*/
public String getFooterNoteTab2(){
return this._footerNoteTab2;
}
/**
* Set footer note on tab 2
*/
public void setFooterNoteTab2(String footerNote){
this._footerNoteTab2 = footerNote;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -