Custom Task
demo\GeorssTaskResults.java
/* Copyright 2010 ESRI
* 
* All rights reserved under the copyright laws of the United States
* and applicable international laws, treaties, and conventions.
* 
* You may freely redistribute and use this sample code, with or
* without modification, provided you include the original copyright
* notice and use restrictions.
* 
* See the use restrictions.
* 
*/
package demo;

import java.io.Serializable;
import java.util.Map;

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.geometry.WebGeometry;
import com.esri.adf.web.data.symbol.WebSimpleMarkerSymbol;

public class GeorssTaskResults implements Serializable {
  private static final long serialVersionUID = 1L;
  protected String rssName = null;

  protected Map rssDetails = null;

  protected WebGeometry highlightGeometry;

  protected WebContext webcontext = null;

  protected GraphicElement graphicElem;

  public GeorssTaskResults(WebContext webcontext,
      WebGeometry highlightGeometry) {
    this.webcontext = webcontext;
    if (highlightGeometry != null)
      this.highlightGeometry = webcontext.project(highlightGeometry);
    
    graphicElem = new GraphicElement();
    graphicElem.setGeometry(highlightGeometry);    
  }

  public String getRssName() {
    return rssName;
  }

  public void setRssName(String rssName) {
    this.rssName = rssName;
  }

  public Map getRssDetails() {
    return rssDetails;
  }

  public void setRssDetails(Map rssDetails) {
    this.rssDetails = rssDetails;
  }

  public void highlight() {
    WebSimpleMarkerSymbol pSymbol = new WebSimpleMarkerSymbol();
    pSymbol.setColor("255,255,0");
    pSymbol.setMarkerType(4);
    pSymbol.setOutlineColor("0,0,0");
    pSymbol.setWidth(20);
    graphicElem.setSymbol(pSymbol);
    
    WebGraphics graphics = webcontext.getWebGraphics();
    graphics.addGraphics(graphicElem);
  }

  public void clearHighlight() {
    WebGraphics graphics = webcontext.getWebGraphics();
    graphics.removeGraphics(graphicElem);
  }

}