public class LocationModeEvent
extends java.lang.Object
LocationModeListener
.Constructor and Description |
---|
LocationModeEvent(LocationMode mode,
Location location,
Dockable dockable,
AffectedSet affected)
Creates a new event.
|
Modifier and Type | Method and Description |
---|---|
void |
done(boolean success)
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.
|
boolean |
isSuccess()
Assuming
isDone() is true , then this flag tells whether the operation was a success or not. |
void |
setClientObject(LocationModeListener key,
java.lang.Object value)
Stores
object in a map using listener as key. |
public LocationModeEvent(LocationMode mode, Location location, Dockable dockable, AffectedSet affected)
mode
- the source of the eventlocation
- the new location of dockable
, may be null
dockable
- the element with the new modeaffected
- the affected elementspublic void done(boolean success)
apply
has finished its job.
LocationModeListener
s might however prematurely call this method. In this case
apply
is not executed, but all remaining events are sent anyway.success
- whether the operation was a successpublic boolean isDone()
true
if the transition is overpublic boolean isSuccess()
isDone()
is true
, then this flag tells whether the operation was a success or not.
If the operation was not a success, then the dockable
was not moved at all, or was not
moved to the correct location.public LocationMode getMode()
apply
method was called.public Location getLocation()
dockable
should have after
apply
. Note: this might not be the actual location the element gets.null
public Dockable getDockable()
Dockable
whose mode was, or is going to be, changed.public AffectedSet getAffected()
public void setClientObject(LocationModeListener key, java.lang.Object value)
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.key
- the key, not null
value
- the value, may be null
public java.lang.Object getClientObject(LocationModeListener key)
key
.key
- the keynull