com.esri.arcgis.carto
Interface ILegend2

All Superinterfaces:
Serializable
All Known Implementing Classes:
ILegend2Proxy, Legend

public interface ILegend2
extends Serializable

Provides access to additional members that control a legend.

Product Availability

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


Method Summary
 void addItem(ILegendItem item)
          Adds a new item to the legend (to the end of the list).
 void adjustColumns(int columns)
          Adjust the item settings so that the legend contains the specified number of columns.
 void clearItems()
          Removes all items from the legend.
 void delayEvents(boolean delay)
          Used to batch operations together to minimize notifications.
 void draw(IDisplay display, ITrackCancel trackCancel, IEnvelope bounds)
          Draws the map surround into the specified display bounds.
 void fitToBounds(IDisplay display, IEnvelope bounds, boolean[] changed)
          Adjusts the map surround to fit the bounds.
 ILegendItem getDefaultLegendItem(ILayer layer)
          The default legend item for the specified layer.
 ILegendFormat getFormat()
          The formatting options for the legend (can be stored in the style gallery).
 int getIcon()
          Icon used to represent the map surround.
 ILegendItem getItem(int index)
          The specified item from the legend.
 int getItemCount()
          Number of items in the legend.
 IMap getMap()
          The parent map.
 String getName()
          Name of the map surround.
 String getTitle()
          Title.
 void insertItem(int index, ILegendItem item)
          Inserts a new item into the legend (at the location specified by index).
 boolean isAutoAdd()
          Indicates if a new item should be added when a new layer is added to the map.
 boolean isAutoReorder()
          Indicates if the legend items should be kept in the same order as the layers.
 boolean isAutoVisibility()
          Indicates if items should be shown only when associated layers are visible.
 boolean isFlowRight()
          Reserved for future use.
 boolean isScaleSymbols()
          Indicates if symbols are scaled for the layer.
 void queryBounds(IDisplay display, IEnvelope oldBounds, IEnvelope newBounds)
          Returns the bounds of the map surround.
 void refresh()
          Makes sure the latest updates are refected the next time the Map Surround is drawn.
 void removeItem(int index)
          Removes the specified item from the legend.
 void setAutoAdd(boolean autoAdd)
          Indicates if a new item should be added when a new layer is added to the map.
 void setAutoReorder(boolean autoReorder)
          Indicates if the legend items should be kept in the same order as the layers.
 void setAutoVisibility(boolean autoVisibility)
          Indicates if items should be shown only when associated layers are visible.
 void setFlowRight(boolean flag)
          Reserved for future use.
 void setFormatByRef(ILegendFormat legendFormat)
          The formatting options for the legend (can be stored in the style gallery).
 void setMapByRef(IMap map)
          The parent map.
 void setName(String name)
          Name of the map surround.
 void setScaleSymbols(boolean scale)
          Indicates if symbols are scaled for the layer.
 void setTitle(String title)
          Title.
 

Method Detail

getMap

IMap getMap()
            throws IOException,
                   AutomationException
The parent map.

Product Availability

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

Returns:
A reference to a com.esri.arcgis.carto.IMap
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setMapByRef

void setMapByRef(IMap map)
                 throws IOException,
                        AutomationException
The parent map.

Product Availability

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

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.

getName

String getName()
               throws IOException,
                      AutomationException
Name of the map surround.

Product Availability

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

Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setName

void setName(String name)
             throws IOException,
                    AutomationException
Name of the map surround.

Product Availability

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

Parameters:
name - The name (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getIcon

int getIcon()
            throws IOException,
                   AutomationException
Icon used to represent the map surround.

Product Availability

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

Returns:
The hIcon (A COM typedef)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryBounds

void queryBounds(IDisplay display,
                 IEnvelope oldBounds,
                 IEnvelope newBounds)
                 throws IOException,
                        AutomationException
Returns the bounds of the map surround.

Product Availability

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

Parameters:
display - A reference to a com.esri.arcgis.display.IDisplay (in)
oldBounds - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
newBounds - 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.

fitToBounds

void fitToBounds(IDisplay display,
                 IEnvelope bounds,
                 boolean[] changed)
                 throws IOException,
                        AutomationException
Adjusts the map surround to fit the bounds. The changed argument indicates whether the size of the map surround was changed.

Product Availability

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

Parameters:
display - A reference to a com.esri.arcgis.display.IDisplay (in)
bounds - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
changed - The changed (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

delayEvents

void delayEvents(boolean delay)
                 throws IOException,
                        AutomationException
Used to batch operations together to minimize notifications.

Product Availability

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

Parameters:
delay - The delay (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

refresh

void refresh()
             throws IOException,
                    AutomationException
Makes sure the latest updates are refected the next time the Map Surround is drawn.

Product Availability

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

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

draw

void draw(IDisplay display,
          ITrackCancel trackCancel,
          IEnvelope bounds)
          throws IOException,
                 AutomationException
Draws the map surround into the specified display bounds.

Product Availability

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

Parameters:
display - A reference to a com.esri.arcgis.display.IDisplay (in)
trackCancel - A reference to a com.esri.arcgis.system.ITrackCancel (in)
bounds - 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.

getFormat

ILegendFormat getFormat()
                        throws IOException,
                               AutomationException
The formatting options for the legend (can be stored in the style gallery).

Product Availability

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

Returns:
A reference to a com.esri.arcgis.carto.ILegendFormat
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFormatByRef

void setFormatByRef(ILegendFormat legendFormat)
                    throws IOException,
                           AutomationException
The formatting options for the legend (can be stored in the style gallery).

Product Availability

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

Parameters:
legendFormat - A reference to a com.esri.arcgis.carto.ILegendFormat (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTitle

String getTitle()
                throws IOException,
                       AutomationException
Title.

Product Availability

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

Returns:
The title
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setTitle

void setTitle(String title)
              throws IOException,
                     AutomationException
Title.

Product Availability

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

Parameters:
title - The title (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isAutoAdd

boolean isAutoAdd()
                  throws IOException,
                         AutomationException
Indicates if a new item should be added when a new layer is added to the map.

Product Availability

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

Returns:
The autoAdd
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAutoAdd

void setAutoAdd(boolean autoAdd)
                throws IOException,
                       AutomationException
Indicates if a new item should be added when a new layer is added to the map.

Product Availability

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

Parameters:
autoAdd - The autoAdd (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isAutoReorder

boolean isAutoReorder()
                      throws IOException,
                             AutomationException
Indicates if the legend items should be kept in the same order as the layers.

Product Availability

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

Returns:
The autoReorder
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAutoReorder

void setAutoReorder(boolean autoReorder)
                    throws IOException,
                           AutomationException
Indicates if the legend items should be kept in the same order as the layers.

Product Availability

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

Parameters:
autoReorder - The autoReorder (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isAutoVisibility

boolean isAutoVisibility()
                         throws IOException,
                                AutomationException
Indicates if items should be shown only when associated layers are visible.

Product Availability

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

Returns:
The autoVisibility
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAutoVisibility

void setAutoVisibility(boolean autoVisibility)
                       throws IOException,
                              AutomationException
Indicates if items should be shown only when associated layers are visible.

Product Availability

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

Parameters:
autoVisibility - The autoVisibility (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isFlowRight

boolean isFlowRight()
                    throws IOException,
                           AutomationException
Reserved for future use.

Product Availability

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

Returns:
The flag
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFlowRight

void setFlowRight(boolean flag)
                  throws IOException,
                         AutomationException
Reserved for future use.

Product Availability

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

Parameters:
flag - The flag (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getItemCount

int getItemCount()
                 throws IOException,
                        AutomationException
Number of items in the legend.

Product Availability

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

Returns:
The numItems
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getItem

ILegendItem getItem(int index)
                    throws IOException,
                           AutomationException
The specified item from the legend.

Product Availability

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

Parameters:
index - The index (in)
Returns:
A reference to a com.esri.arcgis.carto.ILegendItem
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addItem

void addItem(ILegendItem item)
             throws IOException,
                    AutomationException
Adds a new item to the legend (to the end of the list).

Product Availability

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

Parameters:
item - A reference to a com.esri.arcgis.carto.ILegendItem (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

insertItem

void insertItem(int index,
                ILegendItem item)
                throws IOException,
                       AutomationException
Inserts a new item into the legend (at the location specified by index).

Product Availability

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

Parameters:
index - The index (in)
item - A reference to a com.esri.arcgis.carto.ILegendItem (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeItem

void removeItem(int index)
                throws IOException,
                       AutomationException
Removes the specified item from the legend.

Product Availability

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

Parameters:
index - The index (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clearItems

void clearItems()
                throws IOException,
                       AutomationException
Removes all items from the legend.

Product Availability

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

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDefaultLegendItem

ILegendItem getDefaultLegendItem(ILayer layer)
                                 throws IOException,
                                        AutomationException
The default legend item for the specified layer.

Product Availability

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

Parameters:
layer - A reference to a com.esri.arcgis.carto.ILayer (in)
Returns:
A reference to a com.esri.arcgis.carto.ILegendItem
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isScaleSymbols

boolean isScaleSymbols()
                       throws IOException,
                              AutomationException
Indicates if symbols are scaled for the layer.

Product Availability

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

Returns:
The scale
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setScaleSymbols

void setScaleSymbols(boolean scale)
                     throws IOException,
                            AutomationException
Indicates if symbols are scaled for the layer.

Product Availability

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

Parameters:
scale - The scale (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

adjustColumns

void adjustColumns(int columns)
                   throws IOException,
                          AutomationException
Adjust the item settings so that the legend contains the specified number of columns.

Product Availability

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

Parameters:
columns - The columns (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.