com.ibm.as400.opnav
Interface DropTargetManager


public interface DropTargetManager

The interface which manages the target of a drag/drop operation. A DropTargetManager implementation provides an indication of the type of actions supported by the drop target, based on the type of object(s) being dropped and the keyboard/mouse button state. It then performs the appropriate action on the source object(s) upon completion of the drop operation.

User interface assumptions:

Implementation assumptions:

Since:
v4r4m0
See Also:
ListManager, ActionsManager

Field Summary
static int ACTION_COPY
          Indicates that the copy action is available during the drag operation.
static int ACTION_MOVE
          Indicates that the move action is available during the drag operation.
static int ACTION_NONE
          Indicates that no actions are available during the drag operation.
static int ACTION_REFERENCE
           
static int ALT_MASK
          Indicates that the Alt key was down during the drag operation.
static int BUTTON1_MASK
          Indicates that mouse button 1 (the left mouse button) was down during the drag operation.
static int BUTTON2_MASK
          Indicates that mouse button 2 (the middle mouse button) was down during the drag operation.
static int BUTTON3_MASK
          Indicates that mouse button 3 (the right mouse button) was down during the drag operation.
static int CTRL_MASK
          Indicates that the Ctrl key was down during the drag operation.
static int SHIFT_MASK
          Indicates that the Shift key was down during the drag operation.
 
Method Summary
 int dragEnter(ObjectName[] sourceObjects, java.awt.Component target, java.awt.Point location, int modifiers, int sourceActions)
          Indicates whether a drop can be accepted, and if so, the action that will take place on the drop.
 void dragExit()
          Called when the user ceases to drag the mouse over the UI representation of the drop target.
 int dragOver(java.awt.Component target, java.awt.Point location, int modifiers, int sourceActions)
          Called while the user continues to drag the mouse over the UI representation of the drop target.
 int drop(ObjectName[] sourceObjects, java.awt.Component target, java.awt.Point location, int modifiers, int sourceActions)
          Called when the user "drops" the objects being dragged by releasing the mouse button.
 void initialize(ObjectName dropTarget, java.awt.Frame dropFrame)
          Identifies the target of the drag/drop operation.
 

Field Detail

SHIFT_MASK

public static final int SHIFT_MASK
Indicates that the Shift key was down during the drag operation.

CTRL_MASK

public static final int CTRL_MASK
Indicates that the Ctrl key was down during the drag operation.

ALT_MASK

public static final int ALT_MASK
Indicates that the Alt key was down during the drag operation.

BUTTON1_MASK

public static final int BUTTON1_MASK
Indicates that mouse button 1 (the left mouse button) was down during the drag operation.

BUTTON2_MASK

public static final int BUTTON2_MASK
Indicates that mouse button 2 (the middle mouse button) was down during the drag operation.

BUTTON3_MASK

public static final int BUTTON3_MASK
Indicates that mouse button 3 (the right mouse button) was down during the drag operation.

ACTION_NONE

public static final int ACTION_NONE
Indicates that no actions are available during the drag operation. This will cause the nodrop cursor to be displayed.

ACTION_COPY

public static final int ACTION_COPY
Indicates that the copy action is available during the drag operation.

ACTION_MOVE

public static final int ACTION_MOVE
Indicates that the move action is available during the drag operation.

ACTION_REFERENCE

public static final int ACTION_REFERENCE
Method Detail

initialize

public void initialize(ObjectName dropTarget,
                       java.awt.Frame dropFrame)
Identifies the target of the drag/drop operation. This method is called immediately after this object is instantiated.
Parameters:
dropTarget - the object name of the drop target.
dropFrame - the frame of the drop target.
Note: This frame should also be passed on to UIServices methods: refreshAll, refreshList, refreshListItems and updateStatusArea
Since:
v4r4m0
See Also:
ObjectName, UIServices

dragEnter

public int dragEnter(ObjectName[] sourceObjects,
                     java.awt.Component target,
                     java.awt.Point location,
                     int modifiers,
                     int sourceActions)
Indicates whether a drop can be accepted, and if so, the action that will take place on the drop.

This method is called the first time the user drags the mouse over the UI representation of the drop target. dragEnter must determine what actions will be accepted, if any, based on the actions supported by the drag source and the state of the modifier keys.

Parameters:
sourceObjects - an array of ObjectNames which identify the objects being dragged.
target - the UI component representing the drop target. (unimplemented)
location - the location of the drag cursor over the drop target. (unimplemented)
modifiers - flags indicating the keyboard/mouse state.
sourceActions - flags indicating which actions the drop source supports.
Returns:
the action flag corresponding to the action desired by the drop target
Since:
v4r4m0
See Also:
ObjectName

dragOver

public int dragOver(java.awt.Component target,
                    java.awt.Point location,
                    int modifiers,
                    int sourceActions)
Called while the user continues to drag the mouse over the UI representation of the drop target. dragOver must determine what actions will be accepted, if any, based on the actions supported by the drag source and the state of the modifier keys.
Parameters:
target - the UI component representing the drop target. (unimplemented)
location - the location of the drag cursor over the drop target. (unimplemented)
modifiers - flags indicating the keyboard/mouse state.
sourceActions - flags indicating which actions the drop source supports.
Returns:
the action flag corresponding to the action desired by the drop target
Since:
v4r4m0
See Also:
ObjectName, dragEnter(com.ibm.as400.opnav.ObjectName[], java.awt.Component, java.awt.Point, int, int)

dragExit

public void dragExit()
Called when the user ceases to drag the mouse over the UI representation of the drop target.
Since:
v4r4m0
See Also:
dragEnter(com.ibm.as400.opnav.ObjectName[], java.awt.Component, java.awt.Point, int, int)

drop

public int drop(ObjectName[] sourceObjects,
                java.awt.Component target,
                java.awt.Point location,
                int modifiers,
                int sourceActions)
Called when the user "drops" the objects being dragged by releasing the mouse button. drop may either reject the drop operation or perform the appropriate action(s) on the drop target, based on the state of the modifier keys.
Parameters:
sourceObjects - an array of ObjectNames which identify the objects being dropped.
target - the UI component representing the drop target. (unimplemented)
location - the location of the drag cursor over the drop target. (unimplemented)
modifiers - flags indicating the keyboard/mouse state.
sourceActions - flags indicating which actions the drop source supports.
Returns:
the action flag corresponding to the action performed by the drop target
Since:
v4r4m0
See Also:
ObjectName