com.esri.arcgis.carto
Class LabelCache

java.lang.Object
  extended by com.esri.arcgis.carto.LabelCache
All Implemented Interfaces:
IActiveViewEvents, ILabelCache, com.esri.arcgis.interop.RemoteObjRef, Serializable, EventListener

public class LabelCache
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, ILabelCache, IActiveViewEvents

Standard labeling label cache.

Remarks

This coclass is not supported for customization and may be removed at a future release.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
LabelCache()
          Constructs a LabelCache using ArcGIS Engine.
LabelCache(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
LabelCache theLabelCache = (LabelCache) obj;
 
Method Summary
 void addClass(int classID, ILabelEngineLayerProperties pLayerProps)
          Add a class to the label cache.
 void addLabel(IPlacedObject3 placedObject, IPoint anchorPoint, IEnvelope pEnvelope)
          Add a label to the label cache.
 void afterDraw(IActiveViewEventsAfterDrawEvent theEvent)
          Fired after the specified phase is drawn.
 void afterItemDraw(IActiveViewEventsAfterItemDrawEvent theEvent)
          Fired after an individual view item is drawn.
 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 empty()
          Empty label cache.
 boolean equals(Object o)
          Compare this object with another
 void focusMapChanged(IActiveViewEventsFocusMapChangedEvent theEvent)
          Fired when a new map is made active.
 int getClassCount()
          Number of classes in the cache.
static String getClsid()
          getClsid.
 void getDisplaySettings(double[] scale, double[] dataframeRotation)
          Settings of the display transformation when cache was created.
 void getPlacedLabel(int index, int[] classID, String[] label, IGeometry[] geom, double[] angle, IPoint[] anchorPoint, IEnvelope[] mbr)
          Retrieve a placed label from the label cache.
 int getPlacedLabelCount()
          Number of placed labels stored the cache.
 void getUnplacedLabel(int index, int[] classID, String[] label, IGeometry[] geom, double[] angle, IPoint[] anchorPoint, IEnvelope[] mbr)
          Retrieve an unplaced label from the label cache.
 int getUnplacedLabelCount()
          Number of unplaced labels stored the cache.
 int hashCode()
          the hashcode for this object
 void init(IMap map)
          Initialize label cache.
 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 putDisplaySettings(double scale, double dataframeRotation)
          Settings of the display transformation when cache was created.
 void queryClass(int index, int[] classID, String[] className, IFeatureLayer[] featureLayer, ITextSymbol[] textSymbol)
          Retrieve a class from the label cache.
 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

LabelCache

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

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

LabelCache

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

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

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

init

public void init(IMap map)
          throws IOException,
                 AutomationException
Initialize label cache.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
init in interface ILabelCache
Parameters:
map - 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.

empty

public void empty()
           throws IOException,
                  AutomationException
Empty label cache.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

addClass

public void addClass(int classID,
                     ILabelEngineLayerProperties pLayerProps)
              throws IOException,
                     AutomationException
Add a class to the label cache.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
addClass in interface ILabelCache
Parameters:
classID - The classID (in)
pLayerProps - A reference to a com.esri.arcgis.carto.ILabelEngineLayerProperties (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getClassCount

public int getClassCount()
                  throws IOException,
                         AutomationException
Number of classes in the cache.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getClassCount in interface ILabelCache
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryClass

public void queryClass(int index,
                       int[] classID,
                       String[] className,
                       IFeatureLayer[] featureLayer,
                       ITextSymbol[] textSymbol)
                throws IOException,
                       AutomationException
Retrieve a class from the label cache.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
queryClass in interface ILabelCache
Parameters:
index - The index (in)
classID - The classID (out: use single element array)
className - The className (out: use single element array)
featureLayer - A reference to a com.esri.arcgis.carto.IFeatureLayer (out: use single element array)
textSymbol - A reference to a com.esri.arcgis.display.ITextSymbol (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addLabel

public void addLabel(IPlacedObject3 placedObject,
                     IPoint anchorPoint,
                     IEnvelope pEnvelope)
              throws IOException,
                     AutomationException
Add a label to the label cache.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
addLabel in interface ILabelCache
Parameters:
placedObject - A reference to a com.esri.arcgis.carto.IPlacedObject3 (in)
anchorPoint - A reference to a com.esri.arcgis.geometry.IPoint (in)
pEnvelope - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPlacedLabelCount

public int getPlacedLabelCount()
                        throws IOException,
                               AutomationException
Number of placed labels stored the cache.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getPlacedLabelCount in interface ILabelCache
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPlacedLabel

public void getPlacedLabel(int index,
                           int[] classID,
                           String[] label,
                           IGeometry[] geom,
                           double[] angle,
                           IPoint[] anchorPoint,
                           IEnvelope[] mbr)
                    throws IOException,
                           AutomationException
Retrieve a placed label from the label cache.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getPlacedLabel in interface ILabelCache
Parameters:
index - The index (in)
classID - The classID (out: use single element array)
label - The label (out: use single element array)
geom - A reference to a com.esri.arcgis.geometry.IGeometry (out: use single element array)
angle - The angle (out: use single element array)
anchorPoint - A reference to a com.esri.arcgis.geometry.IPoint (out: use single element array)
mbr - A reference to a com.esri.arcgis.geometry.IEnvelope (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getUnplacedLabelCount

public int getUnplacedLabelCount()
                          throws IOException,
                                 AutomationException
Number of unplaced labels stored the cache.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getUnplacedLabelCount in interface ILabelCache
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getUnplacedLabel

public void getUnplacedLabel(int index,
                             int[] classID,
                             String[] label,
                             IGeometry[] geom,
                             double[] angle,
                             IPoint[] anchorPoint,
                             IEnvelope[] mbr)
                      throws IOException,
                             AutomationException
Retrieve an unplaced label from the label cache.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getUnplacedLabel in interface ILabelCache
Parameters:
index - The index (in)
classID - The classID (out: use single element array)
label - The label (out: use single element array)
geom - A reference to a com.esri.arcgis.geometry.IGeometry (out: use single element array)
angle - The angle (out: use single element array)
anchorPoint - A reference to a com.esri.arcgis.geometry.IPoint (out: use single element array)
mbr - A reference to a com.esri.arcgis.geometry.IEnvelope (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

putDisplaySettings

public void putDisplaySettings(double scale,
                               double dataframeRotation)
                        throws IOException,
                               AutomationException
Settings of the display transformation when cache was created.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
putDisplaySettings in interface ILabelCache
Parameters:
scale - The scale (in)
dataframeRotation - The dataframeRotation (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDisplaySettings

public void getDisplaySettings(double[] scale,
                               double[] dataframeRotation)
                        throws IOException,
                               AutomationException
Settings of the display transformation when cache was created.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getDisplaySettings in interface ILabelCache
Parameters:
scale - The scale (out: use single element array)
dataframeRotation - The dataframeRotation (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.