com.vlsolutions.swing.docking.event
Class DockEvent

java.lang.Object
  extended by com.vlsolutions.swing.docking.event.DockEvent
Direct Known Subclasses:
DockDragEvent, DockDropEvent

public abstract class DockEvent
extends java.lang.Object

Abstract superclass of drag and drop docking events.

This class holds a reference to the source of the event and its mouse event.


Field Summary
protected  DockingActionEvent action
          The action corresponding to the drag and drop gesture (actions can be seen as allowed docking gestures)
protected  DockingDesktop desktop
          The docking desktop which is the destination of the drag and drop gesture
protected  java.awt.event.MouseEvent event
          The MouseEvent, in target's coordinates
protected  DockableDragSource source
          The drag source
 
Constructor Summary
DockEvent(DockingDesktop targetDesktop, DockableDragSource source, java.awt.event.MouseEvent event)
          Constructor for dock events.
 
Method Summary
 DockingDesktop getDesktop()
          Returns a reference of the desktop in which the docking event takes place.
 DockingActionEvent getDockingAction()
          Returns the DockingActionEvent corresponding to the drag and drop gesture
 DockableDragSource getDragSource()
          Returns a reference to the drag source of this event.
 java.awt.event.MouseEvent getMouseEvent()
          Returns the MouseEvent which is the cause of this DockEvent.
 void setDockingAction(DockingActionEvent actionEvent)
          Set the docking action corresponding to this drag and drop gesture.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected DockableDragSource source
The drag source


desktop

protected DockingDesktop desktop
The docking desktop which is the destination of the drag and drop gesture


event

protected java.awt.event.MouseEvent event
The MouseEvent, in target's coordinates


action

protected DockingActionEvent action
The action corresponding to the drag and drop gesture (actions can be seen as allowed docking gestures)

Constructor Detail

DockEvent

public DockEvent(DockingDesktop targetDesktop,
                 DockableDragSource source,
                 java.awt.event.MouseEvent event)
Constructor for dock events.

Parameters:
targetDesktop - the desktop which will receive the drop
source - the source of drag operation
event - the mouse event which is the cause of this DockEvent.
Method Detail

getMouseEvent

public java.awt.event.MouseEvent getMouseEvent()
Returns the MouseEvent which is the cause of this DockEvent.

note that mouse coordinates are converted into the target's coordinates.

Returns:
a mouse event

getDragSource

public DockableDragSource getDragSource()
Returns a reference to the drag source of this event.

Returns:
the drag source (the component actually dragged)

getDesktop

public DockingDesktop getDesktop()
Returns a reference of the desktop in which the docking event takes place.

As of version 2.1, this method returns the "target" desktop (the one in which the drop will occur)

To get a reference of the "source" desktop, use the DockableState information provided by the DockingContext.


getDockingAction

public DockingActionEvent getDockingAction()
Returns the DockingActionEvent corresponding to the drag and drop gesture


setDockingAction

public void setDockingAction(DockingActionEvent actionEvent)
Set the docking action corresponding to this drag and drop gesture.



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