bibliothek.gui.dock.common
Class CWorkingArea

java.lang.Object
  extended by bibliothek.gui.dock.common.intern.AbstractCDockable
      extended by bibliothek.gui.dock.common.intern.AbstractDockableCStation<CSplitDockStation>
          extended by bibliothek.gui.dock.common.CGridArea
              extended by bibliothek.gui.dock.common.CWorkingArea
All Implemented Interfaces:
CStation<CSplitDockStation>, CDockable, SingleCDockable

public class CWorkingArea
extends CGridArea

A working area is an element which is always visible and contains some CDockables which can't be dragged out of it. Also no CDockable can be dropped in a CWorkingArea.
There can be more than one CWorkingArea, and the working areas can be nested.

Author:
Benjamin Sigg

Field Summary
static Path TYPE_ID
          The result of getTypeId()
 
Fields inherited from class bibliothek.gui.dock.common.intern.AbstractCDockable
listenerCollection
 
Fields inherited from interface bibliothek.gui.dock.common.intern.CDockable
ACTION_KEY_CLOSE, ACTION_KEY_EXTERNALIZE, ACTION_KEY_MAXIMIZE, ACTION_KEY_MINIMIZE, ACTION_KEY_MINIMIZE_HOLD, ACTION_KEY_NORMALIZE, ACTION_KEY_UNEXTERNALIZE, ACTION_KEY_UNMAXIMIZE_EXTERNALIZED
 
Constructor Summary
CWorkingArea(CControl control, String uniqueId)
          Creates a new area.
 
Method Summary
<F extends MultipleCDockable>
F
add(F dockable)
          Ensures that this is the parent of dockable and adds dockable to the CControl which is associated with this CWorkingArea.
<F extends SingleCDockable>
F
add(F dockable)
          Ensures that this is the parent of dockable and adds dockable to the CControl which is associated with this CWorkingArea.
 CWorkingPerspective createPerspective()
          Returns a new CStationPerspective that represents this station.
 void deploy(CGrid grid)
          Exchanges all the CDockables on this area with the elements of grid.
 CLocation getStationLocation()
          Gets a location which represents directly CStation.getStation().
 Path getTypeId()
          Gets a unique path denoting the type of this station.
 boolean isWorkingArea()
          Tells whether this station is a special working area or not.
<F extends MultipleCDockable>
F
show(F dockable)
          First adds dockable to the CControl of this CWorkingArea, then makes it visible at a good position.
<F extends SingleCDockable>
F
show(F dockable)
          First adds dockable to the CControl of this CWorkingArea, then makes it visible at a good position.
 
Methods inherited from class bibliothek.gui.dock.common.CGridArea
asDockable, createCommonDockable, createSplitDockStationHandle, getComponent, getModeManagerHandle, getStation, getTitleIcon, getTitleText, getUniqueId, init, install, isCloseable, isExternalizable, isMaximizable, isMaximizingArea, isMinimizable, isNormalizingArea, isStackable, setMaximizingArea, setTitleIcon, setTitleText, suppressTitle, uninstall
 
Methods inherited from class bibliothek.gui.dock.common.intern.AbstractDockableCStation
asStation, getDropLocation, init, setControlAccess, toString
 
Methods inherited from class bibliothek.gui.dock.common.intern.AbstractCDockable
addCDockableLocationListener, addCDockablePropertyListener, addCDockableStateListener, addDoubleClickListener, addFocusListener, addKeyboardListener, addVetoClosingListener, control, getAction, getAndClearResizeRequest, getAutoBaseLocation, getBaseLocation, getClose, getColors, getControl, getControlAccess, getDefaultLocation, getDockableUniqueId, getExtendedMode, getFocusComponent, getFonts, getGrouping, getMinimizedSize, getParentStation, getWorkingArea, hasParent, init, intern, isDockableVisible, isEnabled, isNormalizeable, isResizeLocked, isResizeLockedHorizontally, isResizeLockedVertically, isShowing, isSingleTabShown, isSticky, isStickySwitchable, isTitleShown, isVisible, propertyListeners, putAction, removeCDockableLocationListener, removeCDockablePropertyListener, removeCDockableStateListener, removeDoubleClickListener, removeFocusListener, removeKeyboardListener, removeVetoClosingListener, setDefaultLocation, setEnabled, setExtendedMode, setFocusComponent, setGrouping, setLocation, setLocationsAside, setLocationsAside, setLocationsAsideFocused, setMinimizedSize, setResizeLocked, setResizeLockedHorizontally, setResizeLockedVertically, setResizeRequest, setResizeRequest, setSingleTabShown, setSticky, setStickySwitchable, setTitleShown, setVisible, setWorkingArea, stateListeners, toFront
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.common.intern.CDockable
addCDockableLocationListener, addCDockablePropertyListener, addCDockableStateListener, addDoubleClickListener, addFocusListener, addKeyboardListener, addVetoClosingListener, asStation, getAction, getAndClearResizeRequest, getAutoBaseLocation, getBaseLocation, getColors, getControl, getControlAccess, getExtendedMode, getFocusComponent, getFonts, getGrouping, getMinimizedSize, getParentStation, getWorkingArea, hasParent, intern, isDockableVisible, isEnabled, isNormalizeable, isResizeLockedHorizontally, isResizeLockedVertically, isShowing, isSingleTabShown, isSticky, isStickySwitchable, isTitleShown, isVisible, removeCDockableLocationListener, removeCDockablePropertyListener, removeCDockableStateListener, removeDoubleClickListener, removeFocusListener, removeKeyboardListener, removeVetoClosingListener, setControlAccess, setExtendedMode, setLocation, setLocationsAside, setLocationsAside, setLocationsAsideFocused, setMinimizedSize, setSticky, setStickySwitchable, setVisible, setWorkingArea
 

Field Detail

TYPE_ID

public static final Path TYPE_ID
The result of getTypeId()

Constructor Detail

CWorkingArea

public CWorkingArea(CControl control,
                    String uniqueId)
Creates a new area.

Parameters:
control - the owner of this station
uniqueId - a unique identifier
Method Detail

isWorkingArea

public boolean isWorkingArea()
Description copied from interface: CStation
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.

Specified by:
isWorkingArea in interface CStation<CSplitDockStation>
Overrides:
isWorkingArea in class CGridArea
Returns:
true if this is a working area, false otherwise

getStationLocation

public CLocation getStationLocation()
Description copied from interface: CStation
Gets a location which represents directly CStation.getStation().

Specified by:
getStationLocation in interface CStation<CSplitDockStation>
Overrides:
getStationLocation in class CGridArea
Returns:
the location that will always represent the station

createPerspective

public CWorkingPerspective createPerspective()
Description copied from interface: CStation
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.

Specified by:
createPerspective in interface CStation<CSplitDockStation>
Overrides:
createPerspective in class CGridArea
Returns:
the new, empty perspective
See Also:
CStation.getTypeId()

deploy

public void deploy(CGrid grid)
Exchanges all the CDockables on this area with the elements of grid. This method also calls CDockable.setWorkingArea(CStation) for each dockable in grid.

Overrides:
deploy in class CGridArea
Parameters:
grid - a grid containing some new Dockables

show

public <F extends SingleCDockable> F show(F dockable)
First adds dockable to the CControl of this CWorkingArea, then makes it visible at a good position. A good position is CLocation.aside() the latest focused Dockable that is child of this station.
This method does not force a focus transfer, clients need to call AbstractCDockable.toFront() if the require a focus switch to dockable.

Parameters:
dockable - the element to show
Returns:
dockable

show

public <F extends MultipleCDockable> F show(F dockable)
First adds dockable to the CControl of this CWorkingArea, then makes it visible at a good position. A good position is CLocation.aside() the latest focused Dockable that is child of this station.
This method does not force a focus transfer, clients need to call AbstractCDockable.toFront() if the require a focus switch to dockable.

Parameters:
dockable - the element to show
Returns:
dockable

add

public <F extends SingleCDockable> F add(F dockable)
Ensures that this is the parent of dockable and adds dockable to the CControl which is associated with this CWorkingArea. If there is no CControl, then the dockable is added nowhere.

Type Parameters:
F - the type of element to add
Parameters:
dockable - the new element
Returns:
dockable

add

public <F extends MultipleCDockable> F add(F dockable)
Ensures that this is the parent of dockable and adds dockable to the CControl which is associated with this CWorkingArea. If there is no CControl, then the dockable is added nowhere.

Type Parameters:
F - the type of element to add
Parameters:
dockable - the new element
Returns:
dockable

getTypeId

public Path getTypeId()
Description copied from interface: CStation
Gets a unique path denoting the type of this station. This path will be given to MissingPerspectiveStrategy.createStation(String, Path) when loading a layout as a CPerspective.

Specified by:
getTypeId in interface CStation<CSplitDockStation>
Overrides:
getTypeId in class CGridArea
Returns:
the type of this station. Paths starting with "dock." are reserved for the framework. A value of null will just be ignored.