Class LocationModeEvent

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

public class LocationModeEvent extends Object
Information given to a LocationModeListener.
Author:
Benjamin Sigg
  • Constructor Details

    • 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 Details

    • done

      public void done(boolean success)
      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.
      Parameters:
      success - whether the operation was a success
    • isDone

      public boolean isDone()
      Tells whether the mode transition has been done or not.
      Returns:
      true if the transition is over
    • isSuccess

      public boolean isSuccess()
      Assuming 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.
      Returns:
      whether the operation was a success
    • 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, 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 Object getClientObject(LocationModeListener key)
      Gets some object that was stored earlier using key key.
      Parameters:
      key - the key
      Returns:
      the value, may be null