com.swfm.mica.core
Interface MiiDragAndDropBehavior

All Known Implementing Classes:
MiDragAndDropBehavior

public interface MiiDragAndDropBehavior

This is the interface for objects that can be assigned to any part or to the drag and drop manager. It allows any part or container to override what events (usually dragging the mouse with a button held down) are involved in a drag and drop operation. It also allows overriding what effects are visible during drag and drop operations. Drag and drop operations are divided into two basic operations: Drag and Copy - which leaves the part that was 'picked up' where it was after the operation and, Drag and Cut - which deletes the part that was 'picked up' after the operation (i.e. it 'moves' the part).

Version:
%I% %G%
Author:
Michael L. Davis
See Also:
MiPart.setDragAndDropBehavior(com.swfm.mica.core.MiiDragAndDropBehavior), MiPart.getDragAndDropBehavior(), MiDragAndDropManager

Method Summary
 java.lang.Object getDataToExport()
          Gets the data to be exported during the drop operation for parts with this behavior.
 MiEvent getDragAndCopyCancelEvent()
          Gets the event that will cancel a drag-and-copy operation.
 MiEvent getDragAndCopyDragEvent()
          Gets the event that will move a part during a drag-and-copy operation.
 MiEvent getDragAndCopyDropEvent()
          Gets the event that will complete a drag-and-copy operation.
 MiEvent getDragAndCopyPickUpEvent()
          Gets the event that will 'pick up' a part to start a drag-and-copy operation.
 MiEvent getDragAndCutCancelEvent()
          Gets the event that will cancel a drag-and-cut operation.
 MiEvent getDragAndCutDragEvent()
          Gets the event that will move a part during a drag-and-cut operation.
 MiEvent getDragAndCutDropEvent()
          Gets the event that will complete a drag-and-cut operation.
 MiEvent getDragAndCutPickUpEvent()
          Gets the event that will 'pick up' a part to start a drag-and-cut operation.
 MiPart getDraggingLook()
          Gets the appearance to be used during the drag operation for parts with this behavior.
 boolean getDragsReferenceNotCopy()
           
 boolean getKeepLookCompletelyWithinRootWindow()
           
 boolean getSnapLookCenterToCursor()
           
 MiEditor getTargetEditor()
           
 MiParts getValidTargets()
          Gets the valid targets for drag and drop for parts with this behavior.
 boolean isDefaultBehaviorForParts()
           
 boolean isOpaqueDragAndDropTarget()
          Gets whether, if the part with this behavior rejects a drop, the parent of the part can then be inquired as to whether it wants the drop.
 boolean isPartDragAndDropSource(MiPart part)
           
 boolean isPartDragAndDropTarget(MiPart part)
           
 void setValidTargets(MiParts targets)
          Sets the valid targets for drag and drop for parts with this behavior.
 

Method Detail

isDefaultBehaviorForParts

public boolean isDefaultBehaviorForParts()

getDragsReferenceNotCopy

public boolean getDragsReferenceNotCopy()

getSnapLookCenterToCursor

public boolean getSnapLookCenterToCursor()

getKeepLookCompletelyWithinRootWindow

public boolean getKeepLookCompletelyWithinRootWindow()

isPartDragAndDropSource

public boolean isPartDragAndDropSource(MiPart part)

isPartDragAndDropTarget

public boolean isPartDragAndDropTarget(MiPart part)

isOpaqueDragAndDropTarget

public boolean isOpaqueDragAndDropTarget()
Gets whether, if the part with this behavior rejects a drop, the parent of the part can then be inquired as to whether it wants the drop.

Returns:
true if cannot drop on part(s) underneath the part assigned this behavior

getDragAndCopyPickUpEvent

public MiEvent getDragAndCopyPickUpEvent()
Gets the event that will 'pick up' a part to start a drag-and-copy operation.

Returns:
the pickup event

getDragAndCopyDragEvent

public MiEvent getDragAndCopyDragEvent()
Gets the event that will move a part during a drag-and-copy operation.

Returns:
the drag event

getDragAndCopyCancelEvent

public MiEvent getDragAndCopyCancelEvent()
Gets the event that will cancel a drag-and-copy operation.

Returns:
the cancel event

getDragAndCopyDropEvent

public MiEvent getDragAndCopyDropEvent()
Gets the event that will complete a drag-and-copy operation.

Returns:
the drop event

getDragAndCutPickUpEvent

public MiEvent getDragAndCutPickUpEvent()
Gets the event that will 'pick up' a part to start a drag-and-cut operation.

Returns:
the pickup event

getDragAndCutDragEvent

public MiEvent getDragAndCutDragEvent()
Gets the event that will move a part during a drag-and-cut operation.

Returns:
the drag event

getDragAndCutCancelEvent

public MiEvent getDragAndCutCancelEvent()
Gets the event that will cancel a drag-and-cut operation.

Returns:
the cancel event

getDragAndCutDropEvent

public MiEvent getDragAndCutDropEvent()
Gets the event that will complete a drag-and-cut operation.

Returns:
the drop event

setValidTargets

public void setValidTargets(MiParts targets)
Sets the valid targets for drag and drop for parts with this behavior. If null (the default) then all targets are valid.

Parameters:
targets - the valid targets or null

getValidTargets

public MiParts getValidTargets()
Gets the valid targets for drag and drop for parts with this behavior. If null (the default) then all targets are valid.

Returns:
the valid targets or null

getDataToExport

public java.lang.Object getDataToExport()
Gets the data to be exported during the drop operation for parts with this behavior. If null (the default) then the source's doExport method is used to get the data.

Returns:
the export data or null

getDraggingLook

public MiPart getDraggingLook()
Gets the appearance to be used during the drag operation for parts with this behavior. If null (the default) then the source's look is copied.

Returns:
the look or null

getTargetEditor

public MiEditor getTargetEditor()