com.esri.arcgis.trackinganalyst
Class LabelEngine

java.lang.Object
  extended by com.esri.arcgis.trackinganalyst.LabelEngine
All Implemented Interfaces:
IActiveViewEvents, com.esri.arcgis.interop.RemoteObjRef, ISupportErrorInfo, ITrackingLabelDraw, ITrackingLabelEngine, ITrackingLabelEngine2, Serializable, EventListener

public class LabelEngine
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, ITrackingLabelEngine, ITrackingLabelEngine2, ITrackingLabelDraw, ISupportErrorInfo, IActiveViewEvents

Controls functionality of the label engine.

Description

This object controls the tracking label engine used for dynamically changing labels and provides access to events that occur when the state of the active view changes.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

See Also:
Serialized Form

Constructor Summary
LabelEngine()
          Constructs a LabelEngine using ArcGIS Engine.
LabelEngine(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
LabelEngine theLabelEngine = (LabelEngine) obj;
 
Method Summary
 void addLabel(String bstrID, ILayer piLayer, ITrackingLabel piLabel)
          Adds a tracking label to the map display.
 void afterDraw(IActiveViewEventsAfterDrawEvent theEvent)
          Fired after the specified phase is drawn.
 void afterItemDraw(IActiveViewEventsAfterItemDrawEvent theEvent)
          Fired after an individual view item is drawn.
 void attach(IMap piMap)
          Attaches a label to a given feature on the map.
 void attachMap(Object piMap)
          Attaches a label to a given feature on the map.
 void contentsChanged(IActiveViewEventsContentsChangedEvent theEvent)
          Fired when the contents of the view changes.
 void contentsCleared(IActiveViewEventsContentsClearedEvent theEvent)
          Fired when the contents of the view is cleared.
 void draw(IDisplay piDisplay)
          Draws the labels to the map display.
 void drawLayerLabels(ILayer piLayerToDraw, IDisplay piDisplay)
          Draws the labels for a particular layer to the display object.
 boolean equals(Object o)
          Compare this object with another
 ITrackingLabel findLabel(String bstrID, ILayer piLayer)
          Finds a given label for the map display.
 void focusMapChanged(IActiveViewEventsFocusMapChangedEvent theEvent)
          Fired when a new map is made active.
static String getClsid()
          getClsid.
 int hashCode()
          the hashcode for this object
 void hideLabels(ILayer piLayer, IGeometry piGeometry)
          Hides labels from the map display.
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 void itemAdded(IActiveViewEventsItemAddedEvent theEvent)
          Fired when an item is added to the view.
 void itemDeleted(IActiveViewEventsItemDeletedEvent theEvent)
          Fired when an item is deleted from the view.
 void itemReordered(IActiveViewEventsItemReorderedEvent theEvent)
          Fired when a view item is reordered.
 void removeAllLabels()
          Removes all labels from the map display.
 void removeLabel(String bstrID, ILayer piLayer)
          Removes a tracking label from the map display.
 void removeLayerLabels(ILayer piLayer)
          Remove labels from a given layer.
 void selectionChanged(IActiveViewEventsSelectionChangedEvent theEvent)
          Call this function to fire the selection changed event.
 void spatialReferenceChanged(IActiveViewEventsSpatialReferenceChangedEvent theEvent)
          Fired when the spatial reference is changed.
 void viewRefreshed(IActiveViewEventsViewRefreshedEvent theEvent)
          Fired when view is refreshed before draw happens.
 
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

LabelEngine

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

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

LabelEngine

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

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

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

addLabel

public void addLabel(String bstrID,
                     ILayer piLayer,
                     ITrackingLabel piLabel)
              throws IOException,
                     AutomationException
Adds a tracking label to the map display.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
addLabel in interface ITrackingLabelEngine
Parameters:
bstrID - The bstrID (in)
piLayer - A reference to a com.esri.arcgis.carto.ILayer (in)
piLabel - A reference to a com.esri.arcgis.trackinganalyst.ITrackingLabel (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

findLabel

public ITrackingLabel findLabel(String bstrID,
                                ILayer piLayer)
                         throws IOException,
                                AutomationException
Finds a given label for the map display.

Description

This method finds a given label specified by the ID for the map display.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
findLabel in interface ITrackingLabelEngine
Parameters:
bstrID - The bstrID (in)
piLayer - A reference to a com.esri.arcgis.carto.ILayer (in)
Returns:
A reference to a com.esri.arcgis.trackinganalyst.ITrackingLabel
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

draw

public void draw(IDisplay piDisplay)
          throws IOException,
                 AutomationException
Draws the labels to the map display.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
draw in interface ITrackingLabelEngine
Parameters:
piDisplay - A reference to a com.esri.arcgis.display.IDisplay (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeLabel

public void removeLabel(String bstrID,
                        ILayer piLayer)
                 throws IOException,
                        AutomationException
Removes a tracking label from the map display.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
removeLabel in interface ITrackingLabelEngine
Parameters:
bstrID - The bstrID (in)
piLayer - A reference to a com.esri.arcgis.carto.ILayer (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeAllLabels

public void removeAllLabels()
                     throws IOException,
                            AutomationException
Removes all labels from the map display.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

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

attach

public void attach(IMap piMap)
            throws IOException,
                   AutomationException
Attaches a label to a given feature on the map.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
attach in interface ITrackingLabelEngine
Parameters:
piMap - A reference to a com.esri.arcgis.carto.IMap (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

hideLabels

public void hideLabels(ILayer piLayer,
                       IGeometry piGeometry)
                throws IOException,
                       AutomationException
Hides labels from the map display.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
hideLabels in interface ITrackingLabelEngine
Parameters:
piLayer - A reference to a com.esri.arcgis.carto.ILayer (in)
piGeometry - A reference to a com.esri.arcgis.geometry.IGeometry (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeLayerLabels

public void removeLayerLabels(ILayer piLayer)
                       throws IOException,
                              AutomationException
Remove labels from a given layer.

Description

This method removes labels from a given layer.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
removeLayerLabels in interface ITrackingLabelEngine
Parameters:
piLayer - A reference to a com.esri.arcgis.carto.ILayer (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

attachMap

public void attachMap(Object piMap)
               throws IOException,
                      AutomationException
Attaches a label to a given feature on the map.

Remarks

AttachMap hooks the Tracking Analyst Label Engine to the map. The input to this method is a BasicMap. This method supersedes ITrackingLabelEngine::Attach.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
attachMap in interface ITrackingLabelEngine2
Parameters:
piMap - A reference to another Object (IUnknown) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

drawLayerLabels

public void drawLayerLabels(ILayer piLayerToDraw,
                            IDisplay piDisplay)
                     throws IOException,
                            AutomationException
Draws the labels for a particular layer to the display object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Tracking Analyst Extension.

Specified by:
drawLayerLabels in interface ITrackingLabelDraw
Parameters:
piLayerToDraw - A reference to a com.esri.arcgis.carto.ILayer (in)
piDisplay - A reference to a com.esri.arcgis.display.IDisplay (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

contentsChanged

public void contentsChanged(IActiveViewEventsContentsChangedEvent theEvent)
                     throws IOException,
                            AutomationException
Fired when the contents of the view changes.

Remarks

The Map object fires this event when a new document is loaded. Adding a new layer to a Map does not trigger this event.

The PageLayout object fires the event when IGraphicsContainer::DeleteAllElements in called and when a new document is loaded.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
contentsChanged in interface IActiveViewEvents
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IActiveView.contentsChanged()

contentsCleared

public void contentsCleared(IActiveViewEventsContentsClearedEvent theEvent)
                     throws IOException,
                            AutomationException
Fired when the contents of the view is cleared.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
contentsCleared in interface IActiveViewEvents
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

itemAdded

public void itemAdded(IActiveViewEventsItemAddedEvent theEvent)
               throws IOException,
                      AutomationException
Fired when an item is added to the view.

Remarks

The Map fires the event every time a new layer is added.

The PageLayout fires this event whenever a new element is added to the layout. Elements include not only graphics but data frames as well.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
itemAdded in interface IActiveViewEvents
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

itemDeleted

public void itemDeleted(IActiveViewEventsItemDeletedEvent theEvent)
                 throws IOException,
                        AutomationException
Fired when an item is deleted from the view.

Remarks

The PageLayout object fires this event whenever elements are deleted from the layout.

The Map object fires this event when a layer is removed.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
itemDeleted in interface IActiveViewEvents
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

itemReordered

public void itemReordered(IActiveViewEventsItemReorderedEvent theEvent)
                   throws IOException,
                          AutomationException
Fired when a view item is reordered.

Remarks

The Map objects only fire this event whenever IMap::MoveLayer is called. In the ArcMap application, this occurs when you reorder layers in the table of contents. The Map will also fire this event when new layers are added.

The PageLayout object fires this event when changing the order of graphics. For example, IGraphicsContainer::BringToFront, PutElementOrder, SendToBack, SendBackward, and BringForward all fire this event. These functions are on ArcMap's Drawing menu under the Order pull right menu. Although the Map object is also a graphics container, it does not fire this event when its graphics are reordered.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
itemReordered in interface IActiveViewEvents
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

selectionChanged

public void selectionChanged(IActiveViewEventsSelectionChangedEvent theEvent)
                      throws IOException,
                             AutomationException
Call this function to fire the selection changed event.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
selectionChanged in interface IActiveViewEvents
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

viewRefreshed

public void viewRefreshed(IActiveViewEventsViewRefreshedEvent theEvent)
                   throws IOException,
                          AutomationException
Fired when view is refreshed before draw happens.

Description

Method that gets fired in response to IActiveView::Refresh and IActiveView::PartialRefresh.

Remarks

This event is useful in the case where you're watching for something to change in the view and there aren't any specific events for that change (e.g. ContentsChanged, ItemAdded). You can always listen for this method as a last resort. Care must be taken however to be very efficient in your implementation of this event because it will be called quite often.

The event parameters directly coincide with the arguments to IActiveView::PartialRefresh. For additional information about the arguments, see the help for that method.

If the event object connects to both the layout and a map, then the view parameter tells you which object initiated the event.

In an implementation of this method you typically want to check the phase and respond to only one. Otherwise, your code will execute multiple times per drawing sequence.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
viewRefreshed in interface IActiveViewEvents
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

afterDraw

public void afterDraw(IActiveViewEventsAfterDrawEvent theEvent)
               throws IOException,
                      AutomationException
Fired after the specified phase is drawn.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
afterDraw in interface IActiveViewEvents
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

afterItemDraw

public void afterItemDraw(IActiveViewEventsAfterItemDrawEvent theEvent)
                   throws IOException,
                          AutomationException
Fired after an individual view item is drawn. Example: view items include layers in a map or elements in a page layout.

Remarks

AfterItemDraw can be used to execute after each individual item has drawn. Event firing can be an expensive operation (time consuming) when there are many layers in a map, however. As a result, the AfterItemDraw event is only fired when the IViewManger::VerboseEvents property is set to True. By default this property is False.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
afterItemDraw in interface IActiveViewEvents
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

focusMapChanged

public void focusMapChanged(IActiveViewEventsFocusMapChangedEvent theEvent)
                     throws IOException,
                            AutomationException
Fired when a new map is made active.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
focusMapChanged in interface IActiveViewEvents
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

spatialReferenceChanged

public void spatialReferenceChanged(IActiveViewEventsSpatialReferenceChangedEvent theEvent)
                             throws IOException,
                                    AutomationException
Fired when the spatial reference is changed.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
spatialReferenceChanged in interface IActiveViewEvents
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.