com.esri.adf.web.data
Class ExtentHistory

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

public class ExtentHistory
extends Object
implements WebContextInitialize, WebContextObserver, Serializable

See Also:
Serialized Form

Field Summary
static double DEFAULT_TOLERANCE_RATIO
           
protected  WebExtent heldExtent
           
protected  WebContext mcontext
           
protected  WebMap mmap
           
protected  Stack<WebExtent> nextStack
           
protected  Stack<WebExtent> prevStack
           
protected  double toleranceRatio
           
 
Constructor Summary
ExtentHistory()
           
 
Method Summary
 void destroy()
           The cleaup chores (such as releasing held resources) of attributes of a WebContext should be performed in this method.
 void doNext()
           
 void doPrevious()
           
 double getToleranceRatio()
           
 WebContext getWebContext()
           
 void init(WebContext context)
           The initialization chores of attributes of a WebContext should be performed in this method.
 boolean isCanRedo()
           
 boolean isCanUndo()
           
 void push(WebExtent extent)
           
 WebExtent redo()
           
 void setToleranceRatio(double toleranceRatio)
           
 WebExtent undo()
           
 void update(WebContext context, 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_TOLERANCE_RATIO

public static final double DEFAULT_TOLERANCE_RATIO
See Also:
Constant Field Values

prevStack

protected Stack<WebExtent> prevStack

nextStack

protected Stack<WebExtent> nextStack

mcontext

protected WebContext mcontext

mmap

protected WebMap mmap

toleranceRatio

protected double toleranceRatio

heldExtent

protected WebExtent heldExtent
Constructor Detail

ExtentHistory

public ExtentHistory()
Method Detail

init

public void init(WebContext context)
Description copied from interface: WebContextInitialize

The initialization chores of attributes of a WebContext should be performed in this method.

Typically this method is called by the WebContext when the context itself is initialized. It is important to note that this method is again called by the context when a GISResource is dynamically added to or removed from the context. Classes that implement this method should keep this in mind and adapt the method to react to the callbacks in these circumstances as well.

A WebContext attribute is usable only after this method has been called.

Specified by:
init in interface WebContextInitialize
Parameters:
context - WebContext- the WebContext
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()

update

public void update(WebContext context,
                   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:
context - 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)

push

public void push(WebExtent extent)

undo

public WebExtent undo()

redo

public WebExtent redo()

doPrevious

public void doPrevious()

doNext

public void doNext()

isCanUndo

public boolean isCanUndo()

isCanRedo

public boolean isCanRedo()

getToleranceRatio

public double getToleranceRatio()

setToleranceRatio

public void setToleranceRatio(double toleranceRatio)

getWebContext

public WebContext getWebContext()