Class AbstractCStation<S extends CommonDockStation<?,?>>
java.lang.Object
bibliothek.gui.dock.common.intern.AbstractCStation<S>
- Type Parameters:
S- the kind of station thisCStationis built upon
- All Implemented Interfaces:
CStation<S>
- Direct Known Subclasses:
CExternalizeArea
public abstract class AbstractCStation<S extends CommonDockStation<?,?>>
extends Object
implements CStation<S>
A simple implementation of
CStation. This class adds a
install(CControlAccess) and uninstall(CControlAccess) method,
subclasses do not have to track or store the CControlAccess that
is given in setControlAccess(CControlAccess).- Author:
- Benjamin Sigg
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new station but does not yet initialize its fields.AbstractCStation(S station, String id, CLocation location) Creates a new station. -
Method Summary
Modifier and TypeMethodDescriptionprotected CControlAccessGets the currently usedCControlAccess.Gets the internal representation of thisCStation.Gets a location which represents directlyCStation.getStation().Gets a unique and constant identifier for this stationprotected voidInitializes the fields of this station.protected abstract voidinstall(CControlAccess access) Called when this station is added to aCControl.booleanTells whether this station is a special working area or not.voidsetControlAccess(CControlAccess access) protected abstract voiduninstall(CControlAccess access) Called when this station is removed from aCControl.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface bibliothek.gui.dock.common.CStation
createPerspective, getTypeId
-
Constructor Details
-
AbstractCStation
Creates a new station.- Parameters:
station- the internal representation of this stationid- the unique id of this stationlocation- a location that points directly to this station
-
AbstractCStation
protected AbstractCStation()Creates a new station but does not yet initialize its fields. Subclasses should callinit(CommonDockStation, String, CLocation).
-
-
Method Details
-
init
Initializes the fields of this station.- Parameters:
station- the internal representation of this stationid- the unique id of this stationlocation- a location that points directly to this station
-
getStationLocation
Description copied from interface:CStationGets a location which represents directlyCStation.getStation().- Specified by:
getStationLocationin interfaceCStation<S extends CommonDockStation<?,?>> - Returns:
- the location that will always represent the
station
-
getDropLocation
Description copied from interface:CStationCreates 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).- Specified by:
getDropLocationin interfaceCStation<S extends CommonDockStation<?,?>> - 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:
-
getUniqueId
Description copied from interface:CStationGets a unique and constant identifier for this station- Specified by:
getUniqueIdin interfaceCStation<S extends CommonDockStation<?,?>> - Returns:
- the unique identifier
-
getStation
Description copied from interface:CStationGets the internal representation of thisCStation.- Specified by:
getStationin interfaceCStation<S extends CommonDockStation<?,?>> - Returns:
- the internal representation
-
setControlAccess
Description copied from interface:CStationCalled 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.
- Specified by:
setControlAccessin interfaceCStation<S extends CommonDockStation<?,?>> - Parameters:
access- access to the internals of theCControlthat uses this station ornullto remove all ties from a control
- Call one of the
-
getControl
Gets the currently usedCControlAccess.- Returns:
- access to the current
CControl, can benull
-
isWorkingArea
public boolean isWorkingArea()Description copied from interface:CStationTells 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.- Specified by:
isWorkingAreain interfaceCStation<S extends CommonDockStation<?,?>> - Returns:
trueif this is a working area,falseotherwise
-
asDockable
Description copied from interface:CStationIf this station is aCDockableas well, then this method returns the representation of this station asCDockable.- Specified by:
asDockablein interfaceCStation<S extends CommonDockStation<?,?>> - Returns:
- this as dockable or
null
-
install
Called when this station is added to aCControl.- Parameters:
access- access to the internals of the new owner
-
uninstall
Called when this station is removed from aCControl.- Parameters:
access- access to the internals of the old owner
-