com.dlsc.flexgantt.swing.layer.system
Class DragLayerEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.dlsc.flexgantt.swing.layer.system.DragLayerEvent
All Implemented Interfaces:
java.io.Serializable

public class DragLayerEvent
extends java.util.EventObject

An event object that encapsulates the most important information about a drag & drop operation executed in an instance of DragLayer.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
DragLayer.addDragLayerListener(IDragLayerListener), Serialized Form

Nested Class Summary
static class DragLayerEvent.ID
          An enumerator with different identifiers that can be used to distinguish between different types of events.
 
Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DragLayerEvent(DragLayer layer, DragLayerEvent.ID id, java.lang.Object draggedObject, ITimeSpan span, int dropAction)
          Constructs a new event object.
 
Method Summary
 java.lang.Object getDraggedObject()
          Returns the object that is being dragged around (or resized) by the user.
 DragLayer getDragLayer()
          Returns the drag layer where the drag operation takes place.
 int getDropAction()
          Returns the drop action as requested by the user (copy, move).
 DragLayerEvent.ID getId()
          Returns the event ID.
 ITimeSpan getTimeSpan()
          Returns the time span to which the dragged object has been moved (or resized) by the user.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DragLayerEvent

public DragLayerEvent(DragLayer layer,
                      DragLayerEvent.ID id,
                      java.lang.Object draggedObject,
                      ITimeSpan span,
                      int dropAction)
Constructs a new event object.

Parameters:
layer - the drag layer where the event occured
id - the type of event
draggedObject - the object that is being dragged
span - the time span that will be applied to the dragged object
dropAction - the drop action specified by the user: copy or move (possible values are listed in DnDConstants)
Since:
1.0
Method Detail

getId

public DragLayerEvent.ID getId()
Returns the event ID.

Returns:
the event ID
Since:
1.0

getDragLayer

public DragLayer getDragLayer()
Returns the drag layer where the drag operation takes place.

Returns:
the origin / the source of the event
Since:
1.0

getTimeSpan

public ITimeSpan getTimeSpan()
Returns the time span to which the dragged object has been moved (or resized) by the user.

Returns:
the time span that will be applied to the dragged object once the user releases the mouse
Since:
1.0

getDraggedObject

public java.lang.Object getDraggedObject()
Returns the object that is being dragged around (or resized) by the user.

Returns:
the dragged object
Since:
1.0

getDropAction

public int getDropAction()
Returns the drop action as requested by the user (copy, move). Possible values are listed in DnDConstants.

Returns:
the drop action
Since:
1.0