com.esri.adf.web.data
Class WebOverview

java.lang.Object
  extended by com.esri.adf.web.data.WebOverview
All Implemented Interfaces:
WebContextInitialize, WebContextObserver, Serializable

public class WebOverview
extends Object
implements WebContextInitialize, WebContextObserver, Serializable

This object represents the business logic behind the Overview map control.

See Also:
Serialized Form

Field Summary
protected  WebContext context
          The associated WebContext used for the overview map..
static int DEFAULT_DPI
          Default DPI of the overview map.
static int DEFAULT_HEIGHT
          Default height of the overview map in pixels.
static int DEFAULT_WIDTH
          Default width of the overview map in pixels.
protected  int dpi
          DPI of the overview map.
protected  WebExtent drawExtent
          The extent of the overview map.
protected  int height
          Height of the overview map.
protected  byte[] imageBytes
          The overview map stored in bytes representation.
protected  String imageFormat
          The image format of the overview map.
protected  WebExtent imageRect
          The the area of interest box in screen co-ordinates.
protected  boolean init
          Indicates whether the overview map is initialized, false by default.
protected  WebMap map
          The associated WebMap object used for the overview map.
protected  ArrayList<OverviewFunctionality> oFuncs
          Maintains the list of available overview functionalities in the WebContext object.
protected  boolean showFullExtent
          Indicates whether the overview map should show the full extent or the initial extent, true by default.
protected  boolean useMIMEData
          Indicates whether the overview map should request for MIME data or URL from the GIS Server, true by default.
protected  boolean visible
          Indicates whether the overview map is visible or not.
protected  int width
          Width of the overview map.
 
Constructor Summary
WebOverview()
           
 
Method Summary
 void destroy()
           The cleaup chores (such as releasing held resources) of attributes of a WebContext should be performed in this method.
 void exportImage()
          Creates an image of the overview map.
 int getDpi()
          Returns the dots per inches (DPI) of the overview map image.
 WebExtent getDrawExtent()
          Returns a WebExtent object encompassing the extent of the overview map.
 int getHeight()
          Returns the height of the overview map.
 String getImageFormat()
          Returns the image format for the overview map.
 WebExtent getImageRectangle()
          Returns the extent (in screen coordinates) of the area of interest box representing the current extent of the main map.
 String getImageUrl()
          Returns the image URL of the overview map.
 List<OverviewFunctionality> getOverviewFunctionalities()
          Returns a list of available overview functionalites in the WebContext object.
 String getStaticImageUrl()
          Returns the URL of the image to be used in overview map.
 WebContext getWebContext()
          Returns the WebContext associated with this object.
 int getWidth()
          Returns the width of the overview map.
 void handleEvent(OverviewEvent args)
          This method handle events such as recenter or resize on the area of interest box and adjusts the extent of the main map.
 void init(WebContext webContext)
          Initializes the WebOverview by associating itself with this context.
 boolean isInit()
          Returns an indicator of whether WebOverview is initialized.
 boolean isLastEnabledOverviewFunctionality(OverviewFunctionality overviewFunc)
          Return true if the specified overview functionality is enabled and last in the available overview functionalites.
 boolean isShowFullExtent()
          Returns an indicator whether the overview map should show the full extent or the initial extent.
 boolean isUseMIMEData()
          Returns an indicator whether the overview map should request for MIME data or URL.
 boolean isVisible()
          Returns an indicator whether this overview map is visible.
 void reloadImageRectangle()
          Reloads the extent of area of interest box based on the current extent of map control.
 void setDpi(int dpi)
          Sets the DPI of the overview map.
 void setDrawExtent(WebExtent drawExtent)
          Sets the extent to be used for the overview map.
 void setHeight(int height)
          Sets the height of the overview map.
 void setImageFormat(String imageFormat)
          Sets the image format for the overview map.
 void setInit(boolean init)
          Sets an indicator whether to initialize WebOverview.
 void setShowFullExtent(boolean showFullExtent)
          Sets whether the overview map should show the full extent or the initial extent.
 void setStaticImageUrl(String staticImageUrl)
          Sets the URL of the image to be used in overview map.
 void setUseMIMEData(boolean useMIMEData)
          Sets whether the overview map should request for MIME data or URL from the GIS Server.
 void setVisible(boolean visible)
          Sets the visibility of the overview map.
 void setWidth(int width)
          Sets the width of the overview map.
 void update(WebContext webContext, Object arg)
           This method is called by the WebContext on its registered WebContextObservers when users call the refresh() methods on the context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WIDTH

public static final int DEFAULT_WIDTH
Default width of the overview map in pixels.

See Also:
Constant Field Values

DEFAULT_HEIGHT

public static final int DEFAULT_HEIGHT
Default height of the overview map in pixels.

See Also:
Constant Field Values

DEFAULT_DPI

public static final int DEFAULT_DPI
Default DPI of the overview map.

See Also:
Constant Field Values

height

protected int height
Height of the overview map. Defaults to DEFAULT_HEIGHT.


width

protected int width
Width of the overview map. Defaults to DEFAULT_WIDTH.


dpi

protected int dpi
DPI of the overview map. Defaults to DEFAULT_DPI.


visible

protected boolean visible
Indicates whether the overview map is visible or not. true by default.


init

protected boolean init
Indicates whether the overview map is initialized, false by default.


imageFormat

protected String imageFormat
The image format of the overview map.


map

protected WebMap map
The associated WebMap object used for the overview map.


useMIMEData

protected boolean useMIMEData
Indicates whether the overview map should request for MIME data or URL from the GIS Server, true by default.


showFullExtent

protected boolean showFullExtent
Indicates whether the overview map should show the full extent or the initial extent, true by default.


context

protected WebContext context
The associated WebContext used for the overview map..


oFuncs

protected ArrayList<OverviewFunctionality> oFuncs
Maintains the list of available overview functionalities in the WebContext object.


drawExtent

protected WebExtent drawExtent
The extent of the overview map.


imageRect

protected WebExtent imageRect
The the area of interest box in screen co-ordinates.


imageBytes

protected byte[] imageBytes
The overview map stored in bytes representation.

Constructor Detail

WebOverview

public WebOverview()
Method Detail

init

public void init(WebContext webContext)
Initializes the WebOverview by associating itself with this context. Concrete implementations may want to override this method to do other initialization tasks. This method is called by the ADF when the WebOverview is initialized.

Specified by:
init in interface WebContextInitialize
Parameters:
webContext - the WebContext object.
See Also:
WebContext.init(WebContext), WebContext.addResource(String, GISResource, int), WebContext.removeResource(GISResource)

destroy

public void destroy()
Description copied from interface: WebContextInitialize

The cleaup chores (such as releasing held resources) of attributes of a WebContext should be performed in this method.

Typically this method is called by the WebContext when the context itself is destroyed.

The WebContext attribute is unusable after this method has been called.

Specified by:
destroy in interface WebContextInitialize
See Also:
WebContext.destroy()

getImageUrl

public String getImageUrl()
Returns the image URL of the overview map.

Returns:
the image URL of the overview map

getImageRectangle

public WebExtent getImageRectangle()
Returns the extent (in screen coordinates) of the area of interest box representing the current extent of the main map.

Returns:
the extent of the bounding envelope
See Also:
WebExtent

handleEvent

public void handleEvent(OverviewEvent args)
This method handle events such as recenter or resize on the area of interest box and adjusts the extent of the main map.


update

public void update(WebContext webContext,
                   Object arg)
Description copied from interface: WebContextObserver

This method is called by the WebContext on its registered WebContextObservers when users call the refresh() methods on the context.

To setup an object to be updated by the context, one needs to use the WebContext.addObserver(WebContextObserver) to register itself with the context. All context attributes are wired up to the WebContext. When users change state on any of the attributes and need to intimate other attributes of the context to react to the change they call either the WebContext.refresh() or WebContext.refresh(Object) methods. The context in turns calls the WebContextObserver.update(WebContext, Object) methods on all its registered observers.

Specified by:
update in interface WebContextObserver
Parameters:
webContext - the WebContext that has been refreshed
arg - the argument passed to the WebContext's refresh(arg) method
See Also:
WebContext.refresh(Object), WebContext.addObserver(WebContextObserver), WebContext.removeObserver(WebContextObserver)

getOverviewFunctionalities

public List<OverviewFunctionality> getOverviewFunctionalities()
Returns a list of available overview functionalites in the WebContext object.


reloadImageRectangle

public void reloadImageRectangle()
Reloads the extent of area of interest box based on the current extent of map control.


exportImage

public void exportImage()
Creates an image of the overview map.


getDrawExtent

public WebExtent getDrawExtent()
Returns a WebExtent object encompassing the extent of the overview map.

Returns:
the extent of the bounding envelope
See Also:
WebExtent

setDrawExtent

public void setDrawExtent(WebExtent drawExtent)
Sets the extent to be used for the overview map.

Parameters:
drawExtent - the extent of the overview map.
See Also:
WebExtent

isLastEnabledOverviewFunctionality

public boolean isLastEnabledOverviewFunctionality(OverviewFunctionality overviewFunc)
Return true if the specified overview functionality is enabled and last in the available overview functionalites.

Parameters:
overviewFunc - the overview functionality.
Returns:
true if the specified overview functionality is enabled and last

setHeight

public void setHeight(int height)
Sets the height of the overview map.

Parameters:
height - the overview map height in pixels.

getHeight

public int getHeight()
Returns the height of the overview map.

Returns:
the height of the overview map in pixels

setWidth

public void setWidth(int width)
Sets the width of the overview map.

Parameters:
width - the width of the overview map in pixels.

getWidth

public int getWidth()
Returns the width of the overview map.

Returns:
the width in pixels

setDpi

public void setDpi(int dpi)
Sets the DPI of the overview map.

Parameters:
dpi - the DPI.

getDpi

public int getDpi()
Returns the dots per inches (DPI) of the overview map image.

Returns:
the value of DPI

setImageFormat

public void setImageFormat(String imageFormat)
Sets the image format for the overview map.

Parameters:
imageFormat - the format string.

getImageFormat

public String getImageFormat()
Returns the image format for the overview map.

Returns:
the image format string

setVisible

public void setVisible(boolean visible)
Sets the visibility of the overview map.

Parameters:
visible - if true, visible.

isVisible

public boolean isVisible()
Returns an indicator whether this overview map is visible.

Returns:
if true, visible

setInit

public void setInit(boolean init)
Sets an indicator whether to initialize WebOverview.

Parameters:
init - if true, initialize.

isInit

public boolean isInit()
Returns an indicator of whether WebOverview is initialized.

Returns:
true if it is initialized

getWebContext

public WebContext getWebContext()
Returns the WebContext associated with this object.

Returns:
the web context object associated with this web overview object

setUseMIMEData

public void setUseMIMEData(boolean useMIMEData)
Sets whether the overview map should request for MIME data or URL from the GIS Server. Default is true.

Parameters:
useMIMEData - if true , MIME data is requested from the GIS Server.

isUseMIMEData

public boolean isUseMIMEData()
Returns an indicator whether the overview map should request for MIME data or URL.

Returns:
if true, MIME data is requested

setShowFullExtent

public void setShowFullExtent(boolean showFullExtent)
Sets whether the overview map should show the full extent or the initial extent.

Parameters:
showFullExtent - if true, display the full extent of map in the overview control.

isShowFullExtent

public boolean isShowFullExtent()
Returns an indicator whether the overview map should show the full extent or the initial extent.

Returns:
if true, display the full extent of map in the overview control

setStaticImageUrl

public void setStaticImageUrl(String staticImageUrl)
Sets the URL of the image to be used in overview map. The image must represent the full extent of the main map. If URL is not specified, the services associated with WebMap are used to generate the image.
 For Example,
   overview.setStaticImageUrl("http://localhost/mycontext/images/overview.png");
        [OR}
   overview.setStaticImageUrl("images/overview.png");
 

Parameters:
staticImageUrl - the URL of the static image.

getStaticImageUrl

public String getStaticImageUrl()
Returns the URL of the image to be used in overview map.

Returns:
the static image URL of the overview map