bibliothek.gui.dock.common
Interface CStationContainer

All Known Implementing Classes:
CContentArea

public interface CStationContainer

A CStationContainer is a set of root CStations that are somehow combined and ordered on some kind of Component. A container may or may not be mutable.

Author:
Benjamin Sigg

Method Summary
 void addStationContainerListener(CStationContainerListener listener)
          Adds the observer listener to this container.
 Component getComponent()
          Gets a Component whose children are all the CStations of this CStationContainer.
 CStation<?> getDefaultStation()
          Gets the preferred default CStation of this container.
 CStation<?> getDefaultStation(ExtendedMode mode)
          Gets the preferred default CStation of this container for children in mode mode.
 CStation<?> getMatchingStation(CStationContainer container, CStation<?> station)
          Assuming container is a type of CStationContainer that is known to this, and assuming station is a child of container: this method returns one of this children that has the same relative location in respect to this as station has to container.
 CStation<?> getStation(int index)
          Gets the index'th child of this container.
 int getStationCount()
          Gets the number of CStations that are currently in this container.
 String getUniqueId()
          Gets a unique identifier that is used by only this CStationContainer.
 void removeStationContainerListener(CStationContainerListener listener)
          Removes the observer listener from this container.
 

Method Detail

addStationContainerListener

void addStationContainerListener(CStationContainerListener listener)
Adds the observer listener to this container. The listener is to be informed whenever a CStation is added or removed from this container.

Parameters:
listener - the new listener, not null

removeStationContainerListener

void removeStationContainerListener(CStationContainerListener listener)
Removes the observer listener from this container.

Parameters:
listener - the listener to remove

getUniqueId

String getUniqueId()
Gets a unique identifier that is used by only this CStationContainer.

Returns:
the unique identifier, not null

getComponent

Component getComponent()
Gets a Component whose children are all the CStations of this CStationContainer.

Returns:
the parent of all CStations, not null

getStationCount

int getStationCount()
Gets the number of CStations that are currently in this container.

Returns:
the number of stations, at least 0

getStation

CStation<?> getStation(int index)
Gets the index'th child of this container.

Parameters:
index - the index of the child, between 0 and getStationCount()
Returns:
the child, not null

getDefaultStation

CStation<?> getDefaultStation()
Gets the preferred default CStation of this container. Children with no location are usually made visible on such a default station.

Returns:
the default station or null

getDefaultStation

CStation<?> getDefaultStation(ExtendedMode mode)
Gets the preferred default CStation of this container for children in mode mode.

Parameters:
mode - the mode for which a station is searched
Returns:
a child of this CStationContainer that can show Dockables in mode mode, can be null

getMatchingStation

CStation<?> getMatchingStation(CStationContainer container,
                               CStation<?> station)
Assuming container is a type of CStationContainer that is known to this, and assuming station is a child of container: this method returns one of this children that has the same relative location in respect to this as station has to container. For example if station is the center area of a CGridArea, and this is a CGridArea as well, then this method would return the center area of this.

Parameters:
container - some kind of CStationContainer, may be a type that is known to this or not.
station - some child of container
Returns:
a child of this, such that the location of the child in relation to this is equivalent to the location of station in relation to container. A value of null indicates that this method did not find a suitable child. If possible the result of this method and station should be of the same type.