Class ExternalizedMode<M extends ExternalizedModeArea>

Type Parameters:
M - the areas that are managed by this mode
All Implemented Interfaces:
LocationMode, Mode<Location>, Iterable<M>
Direct Known Subclasses:
CExternalizedMode

public class ExternalizedMode<M extends ExternalizedModeArea> extends DefaultLocationMode<M>
Represents a mode in which dockables are freely floating on the screen.
Author:
Benjamin Sigg
  • Field Details

    • IDENTIFIER

      public static final Path IDENTIFIER
      the unique identifier of this mode
    • ICON_IDENTIFIER

      public static final String ICON_IDENTIFIER
      the key used for the IconManager to read the Icon for the "externalize"-action
      See Also:
  • Constructor Details

    • ExternalizedMode

      protected ExternalizedMode()
      Empty default constructor. Subclasses should call AbstractLocationMode.setActionProvider(LocationModeActionProvider) to complete initialization of this mode.
    • ExternalizedMode

      public ExternalizedMode(CControl control)
      Creates a new mode.
      Parameters:
      control - the control in whose realm this mode works
    • ExternalizedMode

      public ExternalizedMode(DockController controller)
      Creates a new mode.
      Parameters:
      controller - the owner of this mode
  • Method Details

    • getUniqueIdentifier

      public Path getUniqueIdentifier()
      Description copied from interface: Mode
      Gets a unique identifier, only this Mode must have this identifier. Identifiers with the first segment being "dock" are reserved for this framework, clients may choose any other identifiers.
      Returns:
      the identifier, not null, should contain at least one segment.
    • getExtendedMode

      public ExtendedMode getExtendedMode()
      Description copied from interface: LocationMode
      Gets the unique identifier of this mode.
      Returns:
      the unique identifier
    • isDefaultMode

      public boolean isDefaultMode(Dockable dockable)
      Description copied from interface: Mode
      Checks whether this mode is a default mode of dockable. A default mode is a mode that is chosen per default, if no other mode is selected. There should be only one default-mode per Dockable.
      Parameters:
      dockable - some dockable, not null
      Returns:
      whether this is a default mode
    • runApply

      public boolean runApply(Dockable dockable, Location history, AffectedSet set)
      Description copied from class: DefaultLocationMode
      This default implementation uses the DockStation.move(Dockable, DockableProperty) and DockStation.drop(Dockable, DockableProperty) methods to put dockable at its location.
      Overrides:
      runApply in class DefaultLocationMode<M extends ExternalizedModeArea>
      Parameters:
      dockable - the element whose mode becomes this
      history - history information that was returned by this mode when calling Mode.current(Dockable) the last time.
      set - this method has to store all Dockables which might have changed their mode in the set.
      Returns:
      true if dockable was moved, false if the method failed to set the location of dockable for any reason
    • getSettingFactory

      public ModeSettingFactory<Location> getSettingFactory()
      Description copied from interface: Mode
      Gets a factory for creating new ModeSettings.
      Returns:
      the factory, can be null
    • setBehavior

      public void setBehavior(ExternalizedModeBehavior behavior)
      Tells this ExternalizedMode how some algorithms are implemented.
      Parameters:
      behavior - the new behavior, not null
    • getBehavior

      public ExternalizedModeBehavior getBehavior()
      Gets the current implementation of some algorithms of this mode.
      Returns:
      the behavior
    • ensureNotHidden

      public void ensureNotHidden(Dockable dockable)
      Description copied from interface: LocationMode
      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
    • writeSetting

      public void writeSetting(ModeSetting<Location> setting)
      Description copied from interface: Mode
      Gets the current properties of this mode in an independent way.
      Parameters:
      setting - a ModeSetting with the same id as this Mode. This setting was created by a ModeSettingFactory with the same id as this Mode.
    • readSetting

      public void readSetting(ModeSetting<Location> setting)
      Description copied from interface: Mode
      Sets the properties of this mode. This method will only be called with a ModeSetting that has been created by the current ModeSettingFactory
      Parameters:
      setting - the new set of properties, not null