Package bibliothek.gui.dock.common
Interface CStation<S extends CommonDockStation<?,?>>
- Type Parameters:
S- what kind of internal implementation this station uses
- All Known Implementing Classes:
AbstractCStation,AbstractDockableCStation,CExternalizeArea,CGridArea,CMinimizeArea,CWorkingArea,ExternalizingCGridArea
public interface CStation<S extends CommonDockStation<?,?>>
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.addStation(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
Modifier and TypeMethodDescriptionReturns a newCStationPerspectivethat representsthisstation.Gets the internal representation of thisCStation.Gets a location which represents directlygetStation().Gets a unique path denoting the type of this station.Gets a unique and constant identifier for this stationbooleanTells whether this station is a special working area or not.voidsetControlAccess(CControlAccess access)
-
Method Details
-
getStation
S getStation()Gets the internal representation of thisCStation.- Returns:
- the internal representation
-
asDockable
CDockable asDockable()If this station is aCDockableas well, then this method returns the representation of this station asCDockable.- Returns:
- this as dockable or
null
-
createPerspective
CStationPerspective createPerspective()Returns a newCStationPerspectivethat representsthisstation. This method does not need to set any content of the new perspective. Basically this method just needs to tell the framework what type ofCStationPerspectiveis needed, not what its content is.- Returns:
- the new, empty perspective
- See Also:
-
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 (seeCControl.addStation(CStation, boolean)) or must be aSingleCDockable.- Returns:
trueif this is a working area,falseotherwise
-
getUniqueId
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 toMissingPerspectiveStrategy.createStation(String, Path)when loading a layout as aCPerspective.- Returns:
- the type of this station. Paths starting with "dock." are reserved for the
framework. A value of
nullwill just be ignored.
-
getStationLocation
CLocation getStationLocation()Gets a location which represents directlygetStation().- Returns:
- the location that will always represent the
station
-
getDropLocation
CLocation getDropLocation()Creates aCLocationthat can be used to drop a newCDockableon this station or one of its children stations. This method returns the "optimal spot", where the definition of "optimal spot" is up to the station itself. The default implementations however callCLocationModeManager.getDropLocation(CStation).- Returns:
- the optimal spot for dropping a new
CDockableornullif this station is not able to calculate the optimal spot (e.g. because the station is not visible) - See Also:
-
setControlAccess
Called byCControlwhen thisCStationis added or removed. There are two actions which most stations might want to do:
- Call one of the
addmethods forModeAreas accessible through theCLocationModeManager. That will ensure that the station can be used as minimize/normalize/... area. - Add a
ResizeRequestListenertoCControlin order to be informed when resize requests are to be handled.
- Parameters:
access- access to the internals of theCControlthat uses this station ornullto remove all ties from a control
- Call one of the
-