com.esri.arcgis.systemUI
Class DataObjectHelper

java.lang.Object
  extended by com.esri.arcgis.systemUI.DataObjectHelper
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, ISupportErrorInfo, IDataObjectHelper, Serializable

public class DataObjectHelper
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IDataObjectHelper, ISupportErrorInfo

Helper class for OLE drag and drop.

Description

Provides helper methods and properties for retrieving data from an IDataObject interface. IDataObject is a windows standard interface used for dragging and droping data. This is available directly through the InternalObject property.

Remarks

The DataObjectHelper can be used by the MapControl and PageLayoutControl to control drag-and-drop operations.

The NameFactory class (defined in esriSystem) performs a similar job for Name objects with non-ESRI controls, though the DataObjectHelper handles drag-and-drop for both Name objects and file names.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
DataObjectHelper()
          Constructs a DataObjectHelper using ArcGIS Engine.
DataObjectHelper(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
DataObjectHelper theDataObjectHelper = (DataObjectHelper) obj;
 
Method Summary
 boolean canGetFiles()
          Indicates if files are available in the DataObject.
 boolean canGetNames()
          Indicates if ESRI names are available in the DataObject.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 Object getData(int format)
          If specified DataObject format can be retrieved, returns the data as safe array of bytes.
 Object getFiles()
          If the DataObject format supports files, returns a safe array of strings representing filenames.
 boolean getFormat(int format)
          Indicates if the DataObject supports the specified format.
 Object getInternalObject()
          Provides access to the internal IDataObject pointer.
 IEnumName getNames()
          If the DataObject format supports ESRI names, returns an enumerator of names.
 int hashCode()
          the hashcode for this object
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 void setInternalObjectByRef(Object ppObject)
          Provides access to the internal IDataObject pointer.
 
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

DataObjectHelper

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

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

DataObjectHelper

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

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

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

setInternalObjectByRef

public void setInternalObjectByRef(Object ppObject)
                            throws IOException,
                                   AutomationException
Provides access to the internal IDataObject pointer.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getInternalObject

public Object getInternalObject()
                         throws IOException,
                                AutomationException
Provides access to the internal IDataObject pointer.

Description

The internal DataObject implements the IDataObject interface. The DataObject gets populated before any OleDrop events (IMapControlEvents2::OnOleDrop or the IPageLayoutControlEvents::OnOleDrop) are triggered.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getData

public Object getData(int format)
               throws IOException,
                      AutomationException
If specified DataObject format can be retrieved, returns the data as safe array of bytes.

Description

Returns a safe array of bytes from the DataObject, given the specified format. This safe arrray is not processed in anyway. Typically used when dropping data onto the PageLayoutControl and MapControl from other applications.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getData in interface IDataObjectHelper
Parameters:
format - The format (in)
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFormat

public boolean getFormat(int format)
                  throws IOException,
                         AutomationException
Indicates if the DataObject supports the specified format.

Description

GetFormat returns the DataObject format code. The format code corresponds to a clipboard format that is unqiue to the system and is registered with the windows api function RegisterClipboardFormat. Other standard drag and drop formats are available. For example, 1 is used for text, 2 for a bitmap and 15 is used for a file list.

Use to test if the format of data in the DataObject matches the specified format. Typically used when dropping data onto the PageLayoutControl and MapControl from other applications.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFormat in interface IDataObjectHelper
Parameters:
format - The format (in)
Returns:
The pbFormatSupported
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

canGetFiles

public boolean canGetFiles()
                    throws IOException,
                           AutomationException
Indicates if files are available in the DataObject.

Description

Indicates whether a safe array of filenames can be aquired from the DataObject. Iterate through the array to retrieve a list of filenames. This is typically used when dropping data from Windows Explorer onto the PageLayoutControl or MapControl.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getFiles

public Object getFiles()
                throws IOException,
                       AutomationException
If the DataObject format supports files, returns a safe array of strings representing filenames.

Description

Use this method when CanGetFiles returns true. Iterate through the safe array to retrieve a list of filenames. This is typically used when data is being dropped onto the PageLayoutControl or MapControl from Windows Explorer.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFiles in interface IDataObjectHelper
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

canGetNames

public boolean canGetNames()
                    throws IOException,
                           AutomationException
Indicates if ESRI names are available in the DataObject.

Description

Indicates whether an IEnumName object can be aquired from the DataObject. Use the IEnumName object to enumerate over a set of IName objects. This is typically used when dropping data from ArcCatalog onto the PageLayoutControl or MapControl.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getNames

public IEnumName getNames()
                   throws IOException,
                          AutomationException
If the DataObject format supports ESRI names, returns an enumerator of names.

Description

Use this method when CanGetNames returns true. Use the IEnumName object to enumerate over a set of IName objects. This is typically used when data is being dropped onto the PageLayoutControl or MapControl from ArcCatalog.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getNames in interface IDataObjectHelper
Returns:
A reference to a com.esri.arcgis.system.IEnumName
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.