bibliothek.gui.dock.facile.mode
Class LocationModeEvent

java.lang.Object
  extended by bibliothek.gui.dock.facile.mode.LocationModeEvent

public class LocationModeEvent
extends java.lang.Object

Information given to a LocationModeListener.

Author:
Benjamin Sigg

Constructor Summary
LocationModeEvent(LocationMode mode, Location location, Dockable dockable, AffectedSet affected)
          Creates a new event.
 
Method Summary
 void done()
          Marks the mode transition as over.
 AffectedSet getAffected()
          The set of elements that is affected.
 java.lang.Object getClientObject(LocationModeListener key)
          Gets some object that was stored earlier using key key.
 Dockable getDockable()
          Gets the Dockable whose mode was, or is going to be, changed.
 Location getLocation()
          Gets the location which dockable should have after apply.
 LocationMode getMode()
          Gets the source of the event, the mode whose apply method was called.
 boolean isDone()
          Tells whether the mode transition has been done or not.
 void setClientObject(LocationModeListener key, java.lang.Object value)
          Stores object in a map using listener as key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationModeEvent

public LocationModeEvent(LocationMode mode,
                         Location location,
                         Dockable dockable,
                         AffectedSet affected)
Creates a new event.

Parameters:
mode - the source of the event
location - the new location of dockable, may be null
dockable - the element with the new mode
affected - the affected elements
Method Detail

done

public void done()
Marks the mode transition as over. This method is normally called after apply has finished its job. LocationModeListeners might however prematurely call this method. In this case apply is not executed, but all remaining events are sent anyway.


isDone

public boolean isDone()
Tells whether the mode transition has been done or not.

Returns:
true if the transition is over

getMode

public LocationMode getMode()
Gets the source of the event, the mode whose apply method was called.

Returns:
the source of the event

getLocation

public Location getLocation()
Gets the location which dockable should have after apply. Note: this might not be the actual location the element gets.

Returns:
the expected location, not null

getDockable

public Dockable getDockable()
Gets the Dockable whose mode was, or is going to be, changed.

Returns:
the element

getAffected

public AffectedSet getAffected()
The set of elements that is affected.

Returns:
the elements

setClientObject

public void setClientObject(LocationModeListener key,
                            java.lang.Object value)
Stores object in a map using listener as key. If this method is called by LocationModeListener.applyStarting(LocationModeEvent), then the object is available when LocationModeListener.applyDone(LocationModeEvent) is called.

Parameters:
key - the key, not null
value - the value, may be null

getClientObject

public java.lang.Object getClientObject(LocationModeListener key)
Gets some object that was stored earlier using key key.

Parameters:
key - the key
Returns:
the value, may be null