bibliothek.gui.dock.common
Interface CStation<S extends DockStation>

Type Parameters:
S - what kind of internal implementation this station uses
All Known Implementing Classes:
AbstractCStation, AbstractDockableCStation, CExternalizeArea, CGridArea, CMinimizeArea, CWorkingArea

public interface CStation<S extends DockStation>

A CStation is an element onto which CDockables can be dropped. Each station can, but does not have to be, a CDockable itself. Stations are added to the CControl through CControl.add(CStation, boolean). A station is either a root-station (meaning that it has no parent) or CDockable. It is possible to use a CDockable as root-station.

Author:
Benjamin Sigg

Method Summary
 CDockable asDockable()
          If this station is a CDockable as well, then this method returns the representation of this station as CDockable.
 CStationPerspective createPerspective()
          Returns a new CStationPerspective that represents this station.
 S getStation()
          Gets the internal representation of this CStation.
 CLocation getStationLocation()
          Gets a location which represents directly getStation().
 Path getTypeId()
          Gets a unique path denoting the type of this station.
 java.lang.String getUniqueId()
          Gets a unique and constant identifier for this station
 boolean isWorkingArea()
          Tells whether this station is a special working area or not.
 void setControl(CControlAccess access)
          Called by CControl when this CStation is added or removed.
 

Method Detail

getStation

S getStation()
Gets the internal representation of this CStation.

Returns:
the internal representation

asDockable

CDockable asDockable()
If this station is a CDockable as well, then this method returns the representation of this station as CDockable.

Returns:
this as dockable or null

createPerspective

CStationPerspective createPerspective()
Returns a new CStationPerspective that represents this station. This method does not need to set any content of the new perspective. Basically this method just needs to tell the framework what type of CStationPerspective is needed, not what its content is.

Returns:
the new, empty perspective
See Also:
getTypeId()

isWorkingArea

boolean isWorkingArea()
Tells whether this station is a special working area or not. It is not possible drag a child from a working area if it is registered there, or to drop a child onto a working area if it is not registered there.
Working areas must either be registered as root-station (see CControl.addStation(CStation, boolean)) or must be a SingleCDockable.

Returns:
true if this is a working area, false otherwise

getUniqueId

java.lang.String getUniqueId()
Gets a unique and constant identifier for this station

Returns:
the unique identifier

getTypeId

Path getTypeId()
Gets a unique path denoting the type of this station. This path will be given to MissingPerspectiveStrategy.createRoot(String, Path) when loading a layout as a CPerspective.

Returns:
the type of this station. Paths starting with "dock." are reserved for the framework. A value of null will just be ignored.

getStationLocation

CLocation getStationLocation()
Gets a location which represents directly getStation().

Returns:
the location that will always represent the station

setControl

void setControl(CControlAccess access)
Called by CControl when this CStation is added or removed. There are two actions which most stations might want to do:

Parameters:
access - access to the internals of the CControl that uses this station or null to remove all ties from a control