com.javadocking.event
Class DockingEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.javadocking.event.DockingEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ChildDockEvent, DockableEvent

public class DockingEvent
extends java.util.EventObject

This kind of event is broad-casted when the structure of docks and dockables change in a dock model.

Dockables or child docks can be added, moved or removed. An event will be broad-casted before and after the change.

There are 4 different kinds of docking events:

Author:
Heidi Rakels.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DockingEvent(java.lang.Object source, Dock originDock, Dock destinationDock)
          Constructs a docking event for the given dock.
 
Method Summary
 Dock getDestinationDock()
          Gets the dock to which the dockable or child dock is added or moved.
 Dock getOriginDock()
          Gets the dock from which the dockable or child dock is removed or moved.
 
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

DockingEvent

public DockingEvent(java.lang.Object source,
                    Dock originDock,
                    Dock destinationDock)
Constructs a docking event for the given dock.

Parameters:
source - The object on which the event initially occurred.
originDock - The dock from which the dockable or child dock is removed or moved. Null when the dockable was closed before or the child dock is added.
destinationDock - The dock to which the dockable or child dock is added or moved. Null when the dockable is closed or the child dock is removed.
Throws:
java.lang.IllegalArgumentException - If the dock is null.
Method Detail

getOriginDock

public Dock getOriginDock()
Gets the dock from which the dockable or child dock is removed or moved.

Returns:
The dock from which the dockable or child dock is removed or moved. Null when the dockable was closed before or the child dock is added.

getDestinationDock

public Dock getDestinationDock()
Gets the dock to which the dockable or child dock is added or moved.

Returns:
The dock to which the dockable or child dock is added or moved. Null when the dockable is closed or the child dock is removed.