com.swfm.mica.core
Class MiDataTransferOperation

java.lang.Object
  extended bycom.swfm.mica.core.MiDataTransferOperation

public class MiDataTransferOperation
extends java.lang.Object

This class represents a data transfer operation, usually associated with a drag-and-drop operation or a 'paste from clipboard' operation.

Version:
%I% %G%
Author:
Michael L. Davis

Constructor Summary
MiDataTransferOperation(MiPart source)
          Constructs a new MiDataTransferOperation for the given source part.
 
Method Summary
static java.lang.String getCommonDataFormat(MiiDragAndDropParticipant source, MiiDragAndDropParticipant target)
           
 java.lang.Object getData()
          Get the data to be transferred.
 java.lang.String getDataFormat()
           
 MiPart getLook()
           
 MiBounds getLookTargetBounds()
          Gets the bounds of the graphics that is being dragged in target editor coordinates
 MiPoint getLookTargetPosition()
          Gets the location of the cursor that is dragging the part
 MiPart getSource()
           
 MiPart getTarget()
           
 java.lang.Object getTransferredData()
          Gets the data that was transferred.
 boolean isDragAndCut()
           
 void setData(java.lang.Object data)
          Set the data to be transferred.
 void setDataFormat(java.lang.String flavor)
           
 void setLook(MiPart part)
           
 void setLookTargetBounds(MiBounds b)
          Sets the bounds of the graphics that is being dragged in target editor coordinates
 void setLookTargetPosition(MiPoint pt)
          Sets the location of the cursor that is dragging the part
 void setSource(MiPart src)
          Set the data to be transferred.
 void setTarget(MiPart obj)
           
 void setTransferredData(java.lang.Object data)
          Sets the data that was transferred.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MiDataTransferOperation

public MiDataTransferOperation(MiPart source)
Constructs a new MiDataTransferOperation for the given source part.

Parameters:
source - the source of the data to be transferred
Method Detail

isDragAndCut

public boolean isDragAndCut()

setData

public void setData(java.lang.Object data)
Set the data to be transferred. This overrides the usual process of getting data exported from the source.

Parameters:
data - the data to transfer

getData

public java.lang.Object getData()
Get the data to be transferred.

Returns:
the data in the current format

setTransferredData

public void setTransferredData(java.lang.Object data)
Sets the data that was transferred. This is set when the data was imported so that others can post-processes the data.

Parameters:
data - the data that was transferred

getTransferredData

public java.lang.Object getTransferredData()
Gets the data that was transferred. This is set when the data was imported so that others can post-processes the data.

Returns:
the data that was transferred or null

setSource

public void setSource(MiPart src)
Set the data to be transferred.

Returns:
the data in the current format

getSource

public MiPart getSource()

setDataFormat

public void setDataFormat(java.lang.String flavor)

getDataFormat

public java.lang.String getDataFormat()

setTarget

public void setTarget(MiPart obj)

getTarget

public MiPart getTarget()

setLook

public void setLook(MiPart part)

getLook

public MiPart getLook()

setLookTargetPosition

public void setLookTargetPosition(MiPoint pt)
Sets the location of the cursor that is dragging the part

Parameters:
pt - location of cursor in target editor coordinates
See Also:
getLookTargetPosition(), getLookTargetBounds()

getLookTargetPosition

public MiPoint getLookTargetPosition()
Gets the location of the cursor that is dragging the part

Returns:
location of cursor in target editor coordinates
See Also:
getLookTargetBounds(), setLookTargetPosition(com.swfm.mica.core.MiPoint)

setLookTargetBounds

public void setLookTargetBounds(MiBounds b)
Sets the bounds of the graphics that is being dragged in target editor coordinates

Parameters:
b - bounds of graphics in target editor coordinates
See Also:
getLookTargetPosition(), getLookTargetBounds(), setLookTargetPosition(com.swfm.mica.core.MiPoint)

getLookTargetBounds

public MiBounds getLookTargetBounds()
Gets the bounds of the graphics that is being dragged in target editor coordinates

Returns:
bounds of graphics in target editor coordinates
See Also:
getLookTargetPosition(), setLookTargetBounds(com.swfm.mica.core.MiBounds)

getCommonDataFormat

public static java.lang.String getCommonDataFormat(MiiDragAndDropParticipant source,
                                                   MiiDragAndDropParticipant target)