Interface LocationMode

All Superinterfaces:
Mode<Location>
All Known Subinterfaces:
CLocationMode
All Known Implementing Classes:
AbstractLocationMode, CExternalizedMode, CMaximizedMode, CMinimizedMode, CNormalMode, DefaultLocationMode, ExternalizedMode, MaximizedMode, MinimizedMode, NormalMode

public interface LocationMode extends Mode<Location>
A Mode that is used by the LocationModeManager. A LocationMode represents a state Dockables are in depending on their current location in the tree of DockStations and Dockables. Since DockStations may be nested, most algorithms working with them have to be recursive. Some of the methods of LocationMode have a slightly different semantic than specified in the Mode interface.
  • Method Details

    • setManager

      void setManager(LocationModeManager<?> manager)
      Sets the manager which is using this mode.
      Parameters:
      manager - the manager or null
      Throws:
      IllegalStateException - if manager is not null and another manager is already set
    • setController

      void setController(DockController controller)
      Connects this mode with a controller. It is up to the mode to add or remove listeners if necessary. This mode should also forward the controller to its ModeAreas.
      Parameters:
      controller - the new controller or null
    • aside

      Location aside(AsideRequest request, Location location)
      Calls DockStation.aside(AsideRequest) on a station that matches location.
      Parameters:
      request - the request to forward to a DockStation or to process
      location - the source of the location whose neighbor is searched
      Returns:
      the neighbor or a value of null if the request could not be processed
    • getManager

      LocationModeManager<?> getManager()
      Gets the manager which currently works with this mode.
      Returns:
      the owner or null
    • isCurrentMode

      boolean isCurrentMode(Dockable dockable)
      If this method is not able to clearly find out whether dockable has this mode, it returns false. The LocationModeManager will ask again with the parent station of dockable.
      Specified by:
      isCurrentMode in interface Mode<Location>
      Parameters:
      dockable - some dockable, not null
      Returns:
      whether dockable is in this mode
    • isRepresenting

      boolean isRepresenting(DockStation station)
      Tells whether this mode knows station and represents the mode children of station are in.
      Parameters:
      station - the station which is to be tested
      Returns:
      whether this mode is represented by station
    • getRepresentation

      DockStation getRepresentation(String uniqueId)
      Gets the one DockStation that is known with the root-id uniqueId. The uniqueId is the same id as used returned by Location.getRoot() of Locations issued by this mode.
      Parameters:
      uniqueId - the id of some station
      Returns:
      the station or null
    • getRepresentationIds

      Set<String> getRepresentationIds()
      Gets all the unique identifiers that will yield a non-null result when calling getRepresentation(String).
      Returns:
      the ids of all the available DockStations, the result may not be modifiable
    • addLocationModeListener

      void addLocationModeListener(LocationModeListener listener)
      Adds a listener to this mode. The listener is to be called if apply starts or finishes.
      Parameters:
      listener - the new listener
    • removeLocationModeListener

      void removeLocationModeListener(LocationModeListener listener)
      Removes listener from this mode.
      Parameters:
      listener - the listener to remove
    • getExtendedMode

      ExtendedMode getExtendedMode()
      Gets the unique identifier of this mode.
      Returns:
      the unique identifier
    • ensureNotHidden

      void ensureNotHidden(Dockable dockable)
      Ensures that no Dockable that has this mode hides dockable. Note that dockable may or may not be in this mode.
      Parameters:
      dockable - the element which must not be hidden
    • shouldAutoFocus

      boolean shouldAutoFocus()
      Tells the LocationModeManager whether the focus should be transferred to a Dockable that has this mode.
      Returns:
      whether auto-focus should be enabled or not