com.esri.arcgis.carto
Class LayerFactoryHelper

java.lang.Object
  extended by com.esri.arcgis.carto.LayerFactoryHelper
All Implemented Interfaces:
ILayerFactoryHelper, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class LayerFactoryHelper
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, ILayerFactoryHelper

Helper class to create layers from names.

Description

Provides a helper method to iterate the Layer Factory component category to find a layer factory object that is used to create one or more layer objects.

Remarks

The CreateLayersFromName method is of limited use to ArcGIS Engine and ArcGIS for Server developers because there is only a small subset of layer factories present and registered in the 'Layer Factory' component category. The CreateLayersFromName method internally iterates the objects in the "Layer Factory" component category and uses the ILayerFactory::CanCreate and ILayerFactory::Create methods.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
LayerFactoryHelper()
          Constructs a LayerFactoryHelper using ArcGIS Engine.
LayerFactoryHelper(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
LayerFactoryHelper theLayerFactoryHelper = (LayerFactoryHelper) obj;
 
Method Summary
 IEnumLayer createLayersFromName(IName name)
          Given a name attempts to open it using the layer factories, if successful returns a layers enumerator.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 int hashCode()
          the hashcode for this object
 
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

LayerFactoryHelper

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

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

LayerFactoryHelper

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

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

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

createLayersFromName

public IEnumLayer createLayersFromName(IName name)
                                throws IOException,
                                       AutomationException
Given a name attempts to open it using the layer factories, if successful returns a layers enumerator.

Description

Use this method to create a data Layer or Layers from an IName object. Each IName instance is passed to CreateLayersFromName to return an enumerator of layers containing a new instance of each layer.

This is typically used for drag and drop. For example, if a feature layer is dragged from an ArcCatalog application and dropped onto the MapControl or PageLayoutControl, objects implementing IName can be extracted from the drop using the IName DataObjectHelper.

Remarks

The CreateLayersFromName method is of limited use to ArcGIS Engine and ArcGIS for Server developers because there is only a small subset of layer factories present and registered in the 'Layer Factory' component category. The CreateLayersFromName method internally iterates the objects in the "Layer Factory" component category and uses the ILayerFactory::CanCreate and ILayerFactory::Create methods.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
createLayersFromName in interface ILayerFactoryHelper
Parameters:
name - A reference to a com.esri.arcgis.system.IName (in)
Returns:
A reference to a com.esri.arcgis.carto.IEnumLayer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.