bibliothek.gui.dock.station.split
Class SplitDockPlaceholderMapping

java.lang.Object
  extended by bibliothek.gui.dock.station.split.SplitDockPlaceholderMapping
All Implemented Interfaces:
PlaceholderMapping

public class SplitDockPlaceholderMapping
extends Object
implements PlaceholderMapping

A PlaceholderMapping representing the placeholders on a SplitDockStation.

Author:
Benjamin Sigg

Constructor Summary
SplitDockPlaceholderMapping(SplitDockStation station)
          Creates a new mapping for station.
 
Method Summary
 void addPlaceholder(Dockable dockable, Path placeholder)
          First searches the location of dockable, then adds placeholder to that location.
 Dockable getDockableAt(Path placeholder)
          Searches for the placeholder placeholder and gets the Dockable that is currently sitting at the location described by placeholder.
 DockableProperty getLocationAt(Path placeholder)
          Gets a DockableProperty that describes the location of placeholder.
 SplitDockStation getStation()
          Gets the DockStation which created this mapping in its DockStation.getPlaceholderMapping().
 boolean hasPlaceholder(Path placeholder)
          Tells whether the station has any reference to placeholder.
 void removePlaceholder(Path placeholder)
          Removes all occurrences of placeholder from this station.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SplitDockPlaceholderMapping

public SplitDockPlaceholderMapping(SplitDockStation station)
Creates a new mapping for station. Clients should not call this method, instead they should call SplitDockStation.getPlaceholderMapping().

Parameters:
station - the source of the mapping
Method Detail

getStation

public SplitDockStation getStation()
Description copied from interface: PlaceholderMapping
Gets the DockStation which created this mapping in its DockStation.getPlaceholderMapping().

Specified by:
getStation in interface PlaceholderMapping
Returns:
the creator and owner of this mapping

addPlaceholder

public void addPlaceholder(Dockable dockable,
                           Path placeholder)
Description copied from interface: PlaceholderMapping
First searches the location of dockable, then adds placeholder to that location. If another dockable is dropped on this station, and that item is associated with placeholder, then it will be put at the same position as dockable. This method will remove placeholder from any other position on the station.

Specified by:
addPlaceholder in interface PlaceholderMapping
Parameters:
dockable - a child of this station, must not be null
placeholder - the placeholder to add, must not be null

removePlaceholder

public void removePlaceholder(Path placeholder)
Description copied from interface: PlaceholderMapping
Removes all occurrences of placeholder from this station.

Specified by:
removePlaceholder in interface PlaceholderMapping
Parameters:
placeholder - the placeholder to remove, must not be null

getDockableAt

public Dockable getDockableAt(Path placeholder)
Description copied from interface: PlaceholderMapping
Searches for the placeholder placeholder and gets the Dockable that is currently sitting at the location described by placeholder.

Specified by:
getDockableAt in interface PlaceholderMapping
Parameters:
placeholder - the placeholder to search
Returns:
the dockable at placeholder, or null either because placeholder could not be found, or because placeholder describes a position that does currently not contain a Dockable

getLocationAt

public DockableProperty getLocationAt(Path placeholder)
Description copied from interface: PlaceholderMapping
Gets a DockableProperty that describes the location of placeholder. The result of this method is undefined if placeholder is not found.

Specified by:
getLocationAt in interface PlaceholderMapping
Parameters:
placeholder - the placeholder whose location is searched
Returns:
the location, may be null if placeholder is not found

hasPlaceholder

public boolean hasPlaceholder(Path placeholder)
Description copied from interface: PlaceholderMapping
Tells whether the station has any reference to placeholder.

Specified by:
hasPlaceholder in interface PlaceholderMapping
Parameters:
placeholder - the placeholder to search
Returns:
true if placeholder was found