com.vlsolutions.swing.docking.event
Class DockDragEvent

java.lang.Object
  extended by com.vlsolutions.swing.docking.event.DockEvent
      extended by com.vlsolutions.swing.docking.event.DockDragEvent

public class DockDragEvent
extends DockEvent

An event describing a drag operation occuring for docking purpose.

This event is used by API extenders to manage drag and drop action related to docking. This is not meant to be used by User Applications.

Standard processing of dragging is (ignoring DockableStateChange events) :


Field Summary
 
Fields inherited from class com.vlsolutions.swing.docking.event.DockEvent
action, desktop, event, source
 
Constructor Summary
DockDragEvent(DockingDesktop desktop, DockableDragSource source, java.awt.event.MouseEvent event)
          Creates an event based on a drag source and a mouse event.
 
Method Summary
 void acceptDrag(java.awt.Shape dropShape)
          Used by a DockDropReceiver to indicate that the drag operation is accepted (mouse is over a droppable zone).
 void delegateDrag()
          Rejects the drag, but allows the docking system to search for othet drop receiver in ancestors.
 java.awt.Shape getDropShape()
          Returns the shape to display if drag is accepted.
 boolean isDragAccepted()
          returns true if drag is accepted.
 boolean isDragDelegated()
          If drag is not accepted, this method will be invoked to evaluate a delegating event processing.
 void rejectDrag()
          Used to reject the drag (e.g.
 
Methods inherited from class com.vlsolutions.swing.docking.event.DockEvent
getDesktop, getDockingAction, getDragSource, getMouseEvent, setDockingAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DockDragEvent

public DockDragEvent(DockingDesktop desktop,
                     DockableDragSource source,
                     java.awt.event.MouseEvent event)
Creates an event based on a drag source and a mouse event.

The mouse coordinates are converted into the receiver's coordinates.

Method Detail

isDragAccepted

public boolean isDragAccepted()
returns true if drag is accepted.

Returns:
true if drag is accepted

isDragDelegated

public boolean isDragDelegated()
If drag is not accepted, this method will be invoked to evaluate a delegating event processing.

This is useful for nested DropReceivers (like TabbedDockableContainers)


getDropShape

public java.awt.Shape getDropShape()
Returns the shape to display if drag is accepted.

This method will be invoked only if isDragAccepted returns true

As this method can be called on every mouse drag over a component, it is a good practice to reuse the same shape as lond a possible (do not create a new Shape at every invocation).


acceptDrag

public void acceptDrag(java.awt.Shape dropShape)
Used by a DockDropReceiver to indicate that the drag operation is accepted (mouse is over a droppable zone).

As of version 2.1, please note that you also have to invoke #setDockingAction() to specify the action associated with the drag shape.

Parameters:
dropShape - the shape (in drop component coordinates) showing the drop zone, which will be displayed on the glasspane of the DockingPanel.

rejectDrag

public void rejectDrag()
Used to reject the drag (e.g. when trying to drop a component onto itself)


delegateDrag

public void delegateDrag()
Rejects the drag, but allows the docking system to search for othet drop receiver in ancestors.

for example, a TabbedDockableContainer that doesn't allow drops on its borders can delegates this management to its container.



© Copyright 2004-2007 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications