Package bibliothek.gui.dock.facile.mode
Class LocationModeEvent
java.lang.Object
bibliothek.gui.dock.facile.mode.LocationModeEvent
Information given to a
LocationModeListener.- Author:
- Benjamin Sigg
-
Constructor Summary
ConstructorsConstructorDescriptionLocationModeEvent(LocationMode mode, Location location, Dockable dockable, AffectedSet affected) Creates a new event. -
Method Summary
Modifier and TypeMethodDescriptionvoiddone(boolean success) Marks the mode transition as over.The set of elements that is affected.Gets some object that was stored earlier using keykey.Gets theDockablewhose mode was, or is going to be, changed.Gets the location whichdockableshould have afterapply.getMode()Gets the source of the event, the mode whoseapplymethod was called.booleanisDone()Tells whether the mode transition has been done or not.booleanAssumingisDone()istrue, then this flag tells whether the operation was a success or not.voidsetClientObject(LocationModeListener key, Object value) Storesobjectin a map usinglisteneras key.
-
Constructor Details
-
LocationModeEvent
public LocationModeEvent(LocationMode mode, Location location, Dockable dockable, AffectedSet affected) Creates a new event.- Parameters:
mode- the source of the eventlocation- the new location ofdockable, may benulldockable- the element with the new modeaffected- the affected elements
-
-
Method Details
-
done
public void done(boolean success) Marks the mode transition as over. This method is normally called afterapplyhas finished its job.LocationModeListeners might however prematurely call this method. In this caseapplyis not executed, but all remaining events are sent anyway.- Parameters:
success- whether the operation was a success
-
isDone
public boolean isDone()Tells whether the mode transition has been done or not.- Returns:
trueif the transition is over
-
isSuccess
public boolean isSuccess()AssumingisDone()istrue, then this flag tells whether the operation was a success or not. If the operation was not a success, then thedockablewas not moved at all, or was not moved to the correct location.- Returns:
- whether the operation was a success
-
getMode
Gets the source of the event, the mode whoseapplymethod was called.- Returns:
- the source of the event
-
getLocation
Gets the location whichdockableshould have afterapply. Note: this might not be the actual location the element gets.- Returns:
- the expected location, not
null
-
getDockable
Gets theDockablewhose mode was, or is going to be, changed.- Returns:
- the element
-
getAffected
The set of elements that is affected.- Returns:
- the elements
-
setClientObject
Storesobjectin a map usinglisteneras key. If this method is called byLocationModeListener.applyStarting(LocationModeEvent), then the object is available whenLocationModeListener.applyDone(LocationModeEvent)is called.- Parameters:
key- the key, notnullvalue- the value, may benull
-
getClientObject
Gets some object that was stored earlier using keykey.- Parameters:
key- the key- Returns:
- the value, may be
null
-