com.esri.arcgis.carto
Class ILegend2Proxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.carto.ILegend2Proxy
All Implemented Interfaces:
ILegend2, Externalizable, Serializable

public class ILegend2Proxy
extends com.esri.arcgis.interop.Dispatch
implements ILegend2, Serializable

Provides access to additional members that control a legend.

Product Availability

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

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, E
 
Constructor Summary
  ILegend2Proxy()
           
  ILegend2Proxy(Object obj)
           
protected ILegend2Proxy(Object obj, String iid)
           
 
Method Summary
 void addItem(ILegendItem item)
          Adds a new item to the legend (to the end of the list).
 void addListener(String iidStr, Object theListener, Object theSource)
           
 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 readExternal(ObjectInput in)
           
 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 removeListener(String iidStr, Object theListener)
           
 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.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class com.esri.arcgis.interop.Dispatch
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, queryInterface, release, setNativeMode, setPropertyByName, toString, vtblInvoke
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ILegend2Proxy

public ILegend2Proxy()

ILegend2Proxy

public ILegend2Proxy(Object obj)
              throws IOException
Throws:
IOException

ILegend2Proxy

protected ILegend2Proxy(Object obj,
                        String iid)
                 throws IOException
Throws:
IOException
Method Detail

addListener

public void addListener(String iidStr,
                        Object theListener,
                        Object theSource)
                 throws IOException
Overrides:
addListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

getMap

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

Product Availability

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

Specified by:
getMap in interface ILegend2
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

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

Product Availability

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

Specified by:
setMapByRef in interface ILegend2
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

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

Product Availability

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

Specified by:
getName in interface ILegend2
Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setName

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

Product Availability

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

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

getIcon

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

Product Availability

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

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

queryBounds

public 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.

Specified by:
queryBounds in interface ILegend2
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

public 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.

Specified by:
fitToBounds in interface ILegend2
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

public 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.

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

refresh

public 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.

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

draw

public 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.

Specified by:
draw in interface ILegend2
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

public 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.

Specified by:
getFormat in interface ILegend2
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

public 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.

Specified by:
setFormatByRef in interface ILegend2
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

public String getTitle()
                throws IOException,
                       AutomationException
Title.

Product Availability

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

Specified by:
getTitle in interface ILegend2
Returns:
The title
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setTitle

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

Product Availability

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

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

isAutoAdd

public 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.

Specified by:
isAutoAdd in interface ILegend2
Returns:
The autoAdd
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAutoAdd

public 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.

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

isAutoReorder

public 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.

Specified by:
isAutoReorder in interface ILegend2
Returns:
The autoReorder
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAutoReorder

public 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.

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

isAutoVisibility

public 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.

Specified by:
isAutoVisibility in interface ILegend2
Returns:
The autoVisibility
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAutoVisibility

public 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.

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

isFlowRight

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

Product Availability

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

Specified by:
isFlowRight in interface ILegend2
Returns:
The flag
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFlowRight

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

Product Availability

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

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

getItemCount

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

Product Availability

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

Specified by:
getItemCount in interface ILegend2
Returns:
The numItems
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getItem

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

Product Availability

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

Specified by:
getItem in interface ILegend2
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

public 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.

Specified by:
addItem in interface ILegend2
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

public 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.

Specified by:
insertItem in interface ILegend2
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

public 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.

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

clearItems

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

Product Availability

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

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

getDefaultLegendItem

public 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.

Specified by:
getDefaultLegendItem in interface ILegend2
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

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

Product Availability

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

Specified by:
isScaleSymbols in interface ILegend2
Returns:
The scale
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setScaleSymbols

public 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.

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

adjustColumns

public 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.

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

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class com.esri.arcgis.interop.Dispatch
Throws:
IOException
ClassNotFoundException