Package bibliothek.gui.dock.common
Class CGridArea
java.lang.Object
bibliothek.gui.dock.common.intern.AbstractCDockable
bibliothek.gui.dock.common.intern.AbstractDockableCStation<CSplitDockStation>
bibliothek.gui.dock.common.CGridArea
- All Implemented Interfaces:
CStation<CSplitDockStation>,CDockable,SingleCDockable
- Direct Known Subclasses:
CWorkingArea,ExternalizingCGridArea
public class CGridArea
extends AbstractDockableCStation<CSplitDockStation>
implements SingleCDockable
In a
CGridArea normalized CDockable can be shown. Clients
should use getComponent() to gain access to a JComponent that
represents this area.- Author:
- Benjamin Sigg
-
Field Summary
FieldsFields inherited from class bibliothek.gui.dock.common.intern.AbstractCDockable
listenerCollectionFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CommonDockableCreates theCommonDockablethat is associated with this dockable, called the first time theCommonDockableis required for an operation.Returns a newCStationPerspectivethat representsthisstation.protected CSplitDockStationHandlecreateSplitDockStationHandle(CControl control) voidExchanges all theCDockables on this area with the elements ofgrid.Gets theJComponentwhich represents this station.protected CSplitDockStationHandleGets the internal representation of thisCStation.Gets a location which represents directlyCStation.getStation().Gets the icon that is shown in the title.Gets the text that is shown as title.Gets a unique path denoting the type of this station.Gets a unique and constant identifier for this stationprotected voidInitializes the fields of this area.protected voidinstall(CControlAccess access) Called when this station is added to aCControl.booleanTells whether thisCDockablecan be closed by the user.booleanTells whether thisCDockablecan be externalized by the user.booleanTells whether thisCDockablecan be maximized by the user.booleanTells whether children of this area remain children when maximized or not.booleanTells whether thisCDockablecan be minimized by the user.protected booleanTells whether all children of this area are considered to be normalized.booleanTells whether thisCDockablecan be combined with anotherDockableto create a stack.booleanTells whether this station is a special working area or not.voidsetMaximizingArea(boolean maximize) Sets whether this area is also used as maximizing area.voidsetTitleIcon(Icon icon) Sets the icon that is shown in the title of thisCDockable.voidsetTitleText(String text) Sets the text that is shown as title.protected booleansuppressTitle(DockTitleVersion version) Checks whether the title created byversionshould be suppressed.protected voiduninstall(CControlAccess access) Called when this station is removed from aCControl.Methods inherited from class bibliothek.gui.dock.common.intern.AbstractDockableCStation
asStation, getDropLocation, init, setControlAccess, toStringMethods 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, toFrontMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 Details
-
TYPE_ID
The result ofgetTypeId()
-
-
Constructor Details
-
CGridArea
Creates a new area.- Parameters:
control- the owner of this stationuniqueId- a unique identifier
-
CGridArea
protected CGridArea()Creates a new grid area but does not yet initialize its fields. Subclasses must callinit(CControl, String)to complete initialization
-
-
Method Details
-
init
Initializes the fields of this area.- Parameters:
control- the owner of this stationuniqueId- a unique identifier
-
createSplitDockStationHandle
- Parameters:
control- the control in whose realm this area is used- Returns:
- the new handle, not
null
-
createCommonDockable
Description copied from class:AbstractCDockableCreates theCommonDockablethat is associated with this dockable, called the first time theCommonDockableis required for an operation.- Overrides:
createCommonDockablein classAbstractDockableCStation<CSplitDockStation>- Returns:
- the new dockable
-
deploy
Exchanges all theCDockables on this area with the elements ofgrid.- Parameters:
grid- a grid containing some newDockables
-
getStation
Description copied from interface:CStationGets the internal representation of thisCStation.- Specified by:
getStationin interfaceCStation<CSplitDockStation>- Overrides:
getStationin classAbstractDockableCStation<CSplitDockStation>- Returns:
- the internal representation
-
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<CSplitDockStation>- Overrides:
asDockablein classAbstractDockableCStation<CSplitDockStation>- Returns:
- this as dockable or
null
-
createPerspective
Description copied from interface:CStationReturns 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.- Specified by:
createPerspectivein interfaceCStation<CSplitDockStation>- Returns:
- the new, empty perspective
- See Also:
-
getComponent
Gets theJComponentwhich represents this station.- Returns:
- the component
-
getStationLocation
Description copied from interface:CStationGets a location which represents directlyCStation.getStation().- Specified by:
getStationLocationin interfaceCStation<CSplitDockStation>- Overrides:
getStationLocationin classAbstractDockableCStation<CSplitDockStation>- Returns:
- the location that will always represent the
station
-
getTypeId
Description copied from interface:CStationGets a unique path denoting the type of this station. This path will be given toMissingPerspectiveStrategy.createStation(String, Path)when loading a layout as aCPerspective.- Specified by:
getTypeIdin interfaceCStation<CSplitDockStation>- Returns:
- the type of this station. Paths starting with "dock." are reserved for the
framework. A value of
nullwill just be ignored.
-
setTitleText
Sets the text that is shown as title.- Parameters:
text- the title
-
getTitleText
Gets the text that is shown as title.- Returns:
- the title
-
setTitleIcon
Sets the icon that is shown in the title of thisCDockable.- Parameters:
icon- the title-icon
-
getTitleIcon
Gets the icon that is shown in the title.- Returns:
- the title-icon, might be
null
-
setMaximizingArea
public void setMaximizingArea(boolean maximize) Sets whether this area is also used as maximizing area. If so then pressing the "maximize"-button of a child of this area will have the effect that the child is maximized only within this area. Otherwise it takes more space.- Parameters:
maximize-trueif children should be maximized to this area,falseif not.
-
isMaximizingArea
public boolean isMaximizingArea()Tells whether children of this area remain children when maximized or not.- Returns:
trueif children remain children- See Also:
-
isNormalizingArea
Tells whether all children of this area are considered to be normalized. Clients should not override this method.
Note that if this method returnsfalse, then the defaultCSplitDockStationHandlereturned bygetModeManagerHandle()will fail, clients must provide a custom implementation ofCSplitDockStationHandleif they override this method.- Returns:
- whether the children are normalized per default
-
getModeManagerHandle
- Returns:
- a representation of
thisas area
-
install
Description copied from class:AbstractDockableCStationCalled when this station is added to aCControl.- Specified by:
installin classAbstractDockableCStation<CSplitDockStation>- Parameters:
access- access to the internals of the new owner
-
uninstall
Description copied from class:AbstractDockableCStationCalled when this station is removed from aCControl.- Specified by:
uninstallin classAbstractDockableCStation<CSplitDockStation>- Parameters:
access- access to the internals of the old owner
-
isCloseable
public boolean isCloseable()Description copied from interface:CDockableTells whether thisCDockablecan be closed by the user. A close-button has to be provided by theCDockableitself. The best way to do that is to instantiate aCloseActionSourceand include this source in the array that is returned byCommonDockable.getSources().- Specified by:
isCloseablein interfaceCDockable- Returns:
trueif this element can be closed
-
getUniqueId
Description copied from interface:CStationGets a unique and constant identifier for this station- Specified by:
getUniqueIdin interfaceCStation<CSplitDockStation>- Specified by:
getUniqueIdin interfaceSingleCDockable- Overrides:
getUniqueIdin classAbstractDockableCStation<CSplitDockStation>- Returns:
- the unique identifier
-
isExternalizable
public boolean isExternalizable()Description copied from interface:CDockableTells whether thisCDockablecan be externalized by the user.- Specified by:
isExternalizablein interfaceCDockable- Returns:
trueif this element can be externalized
-
isMaximizable
public boolean isMaximizable()Description copied from interface:CDockableTells whether thisCDockablecan be maximized by the user.- Specified by:
isMaximizablein interfaceCDockable- Returns:
trueif this element can be maximized
-
isMinimizable
public boolean isMinimizable()Description copied from interface:CDockableTells whether thisCDockablecan be minimized by the user.- Specified by:
isMinimizablein interfaceCDockable- Returns:
trueif this element can be minimized
-
isStackable
public boolean isStackable()Description copied from interface:CDockableTells whether thisCDockablecan be combined with anotherDockableto create a stack.- Specified by:
isStackablein interfaceCDockable- Returns:
trueif this element can be combined with anotherDockable, normallytrueshould be the answer.
-
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<CSplitDockStation>- Overrides:
isWorkingAreain classAbstractDockableCStation<CSplitDockStation>- Returns:
trueif this is a working area,falseotherwise
-
suppressTitle
Checks whether the title created byversionshould be suppressed.- Parameters:
version- the version of the title- Returns:
trueif noDockTitleshould be created
-