com.esri.arcgis.display
Class CancelTracker

java.lang.Object
  extended by com.esri.arcgis.display.CancelTracker
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, ITrackCancel, ITrackCancel2, Serializable

public class CancelTracker
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, ITrackCancel, ITrackCancel2

Cancel tracker class for interrupting drawing.

Description

The CancelTracker object is the object used by ArcObjects to monitor the Esc key (optionally, the space bar and mouse clicks as well) and to terminate processes at the request of the user. A CancelTracker is typically handed into or created just prior to functions that execute a lengthy operation such as, printing, exporting and drawing.

The ITrackCancel interface provides access to properties and methods that determine if a cancellation has been executed by the user, and also allows developers to specify what actions constitute a cancellation.

Remarks

A CancelTracker object can be retrieved through a couple of different methods (IAppDisplay::CancelTracker, IScreenDisplay::CancelTracker, and others), but it is not recommended that you attempt to use the object when obtained in this manner. The CancelTracker object used with these interfaces is for internal use.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
CancelTracker()
          Constructs a CancelTracker using ArcGIS Engine.
CancelTracker(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
CancelTracker theCancelTracker = (CancelTracker) obj;
 
Method Summary
 void cancel()
          Cancels the associated operation.
 boolean equals(Object o)
          Compare this object with another
 boolean esri_continue()
          Called frequently while associated operation is progressing.
 int getCheckTime()
          The interval at which the operation will be interrupted to advance progressors and process messages.
static String getClsid()
          getClsid.
 IProgressor getProgressor()
          The progressor used to show progress during lengthy operations.
 int getTimeout()
          The time out in ms interval for a lengthy operation.
 int hashCode()
          the hashcode for this object
 boolean isCancelOnClick()
          Indicates whether mouse clicks should cancel the operation.
 boolean isCancelOnKeyPress()
          Indicates whether the escape key and spacebar should cancel the operation.
 boolean isProcessMessages()
          An obsolete method.
 boolean isTimerFired()
          An obsolete method.
 void reset()
          Resets the manager after the associated operation is finished.
 void setCancelOnClick(boolean pCancelOnClick)
          Indicates whether mouse clicks should cancel the operation.
 void setCancelOnKeyPress(boolean pCancelOnKeyPress)
          Indicates whether the escape key and spacebar should cancel the operation.
 void setCheckTime(int milliseconds)
          The interval at which the operation will be interrupted to advance progressors and process messages.
 void setProcessMessages(boolean processMessages)
          An obsolete method.
 void setProgressor(IProgressor progressor)
          The progressor used to show progress during lengthy operations.
 void setTimeout(int timeoutMS)
          The time out in ms interval for a lengthy operation.
 void startTimer(int hWnd, int milliseconds)
          An obsolete method.
 void stopTimer()
          An obsolete method.
 void trackMouseMove(boolean bYesNo)
          Turns on/off tracking of mouse movements.
 void trackNavigationKeys(boolean bYesNo)
          Turns on/off tracking of navigation keys.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

CancelTracker

public CancelTracker()
              throws IOException,
                     UnknownHostException
Constructs a CancelTracker using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

CancelTracker

public CancelTracker(Object obj)
              throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
CancelTracker theCancelTracker = (CancelTracker) obj;

Construct a CancelTracker using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to CancelTracker.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

setCheckTime

public void setCheckTime(int milliseconds)
                  throws IOException,
                         AutomationException
The interval at which the operation will be interrupted to advance progressors and process messages.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setCheckTime in interface ITrackCancel
Parameters:
milliseconds - The milliseconds (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCheckTime

public int getCheckTime()
                 throws IOException,
                        AutomationException
The interval at which the operation will be interrupted to advance progressors and process messages.

Description

The CheckTime property indicates the frequency the CancelTracker will process any pending Windows (mouse and keyboard) messages. By default the CheckTime is 1000 milliseconds.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getCheckTime in interface ITrackCancel
Returns:
The milliseconds
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setProgressor

public void setProgressor(IProgressor progressor)
                   throws IOException,
                          AutomationException
The progressor used to show progress during lengthy operations.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setProgressor in interface ITrackCancel
Parameters:
progressor - A reference to a com.esri.arcgis.system.IProgressor (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getProgressor

public IProgressor getProgressor()
                          throws IOException,
                                 AutomationException
The progressor used to show progress during lengthy operations.

Description

Use the Progressor property to bind the CancelTracker with a progress object (for example, a progress bar, a progress dialog or a progress animation) that displays the progress of the lengthy operation. Once the Progressor has been set it will be updated automatically as the operation is executed.

Remarks

If the progressor is a step progressor, the MaxRange should be set to equal the number of iterations that the operation will progress through; this number should also match the number of times Continue will be called in the operation’s innermost loop.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getProgressor in interface ITrackCancel
Returns:
A reference to a com.esri.arcgis.system.IProgressor
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

cancel

public void cancel()
            throws IOException,
                   AutomationException
Cancels the associated operation.

Description

By default a cancel will occur under the following circumstances:

Whether a cancel occurs will depend on when the key or button was pressed and the CheckTime property. For example, if a map redraw was cancelled by a key press then it is possible that some phases of the redraw will complete before the key press is handled.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
cancel in interface ITrackCancel
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

reset

public void reset()
           throws IOException,
                  AutomationException
Resets the manager after the associated operation is finished.

Description

The Reset method should be called just before a process that may be cancelled, such as a lengthy operation, begins. The Reset method sets the state of the CancelTracker to uncancelled and returns the internal counter, which is used to update the Progressor to zero.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
reset in interface ITrackCancel
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

esri_continue

public boolean esri_continue()
                      throws IOException,
                             AutomationException
Called frequently while associated operation is progressing. A return value of false indicates that the operation should stop.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
esri_continue in interface ITrackCancel
Returns:
The keepGoing
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setProcessMessages

public void setProcessMessages(boolean processMessages)
                        throws IOException,
                               AutomationException
An obsolete method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setProcessMessages in interface ITrackCancel
Parameters:
processMessages - The processMessages (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isProcessMessages

public boolean isProcessMessages()
                          throws IOException,
                                 AutomationException
An obsolete method.

Description

Do not use this method as it is obsolete.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isProcessMessages in interface ITrackCancel
Returns:
The processMessages
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

startTimer

public void startTimer(int hWnd,
                       int milliseconds)
                throws IOException,
                       AutomationException
An obsolete method.

Description

Do not use this method as it is obsolete.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
startTimer in interface ITrackCancel
Parameters:
hWnd - The hWnd (in)
milliseconds - The milliseconds (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isTimerFired

public boolean isTimerFired()
                     throws IOException,
                            AutomationException
An obsolete method.

Description

Do not use this method as it is obsolete.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isTimerFired in interface ITrackCancel
Returns:
The timerFired
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

stopTimer

public void stopTimer()
               throws IOException,
                      AutomationException
An obsolete method.

Description

Do not use this method as it is obsolete.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
stopTimer in interface ITrackCancel
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isCancelOnClick

public boolean isCancelOnClick()
                        throws IOException,
                               AutomationException
Indicates whether mouse clicks should cancel the operation.

Description

Indicates whether the user can use the left and right mouse buttons to cancel the operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isCancelOnClick in interface ITrackCancel
Returns:
The pCancelOnClick
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCancelOnClick

public void setCancelOnClick(boolean pCancelOnClick)
                      throws IOException,
                             AutomationException
Indicates whether mouse clicks should cancel the operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setCancelOnClick in interface ITrackCancel
Parameters:
pCancelOnClick - The pCancelOnClick (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isCancelOnKeyPress

public boolean isCancelOnKeyPress()
                           throws IOException,
                                  AutomationException
Indicates whether the escape key and spacebar should cancel the operation.

Description

Indicates whether the user can use the space bar to cancel the operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isCancelOnKeyPress in interface ITrackCancel
Returns:
The pCancelOnKeyPress
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCancelOnKeyPress

public void setCancelOnKeyPress(boolean pCancelOnKeyPress)
                         throws IOException,
                                AutomationException
Indicates whether the escape key and spacebar should cancel the operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setCancelOnKeyPress in interface ITrackCancel
Parameters:
pCancelOnKeyPress - The pCancelOnKeyPress (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setTimeout

public void setTimeout(int timeoutMS)
                throws IOException,
                       AutomationException
The time out in ms interval for a lengthy operation. The negative value means no timeout.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setTimeout in interface ITrackCancel2
Parameters:
timeoutMS - The timeoutMS (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTimeout

public int getTimeout()
               throws IOException,
                      AutomationException
The time out in ms interval for a lengthy operation. The negative value means no timeout.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getTimeout in interface ITrackCancel2
Returns:
The timeoutMS
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

trackMouseMove

public void trackMouseMove(boolean bYesNo)
                    throws IOException,
                           AutomationException
Turns on/off tracking of mouse movements. If bYesNo is true, the cancel is triggered by the mouse move.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
trackMouseMove in interface ITrackCancel2
Parameters:
bYesNo - The bYesNo (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

trackNavigationKeys

public void trackNavigationKeys(boolean bYesNo)
                         throws IOException,
                                AutomationException
Turns on/off tracking of navigation keys. If bYesNo is true, the cancel is triggered by the navigation key press.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
trackNavigationKeys in interface ITrackCancel2
Parameters:
bYesNo - The bYesNo (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.