Class LockedResizeLayoutManager<T>
java.lang.Object
bibliothek.gui.dock.facile.station.split.DelegatingSplitLayoutManager
bibliothek.gui.dock.facile.station.split.LockedResizeLayoutManager<T>
- Type Parameters:
T- the type of the temporary data this manager works with
- All Implemented Interfaces:
SplitLayoutManager
- Direct Known Subclasses:
CLockedResizeLayoutManager
A
SplitLayoutManager that can lock the size of some Dockables
during resize. This class is intended to be subclassed.- Author:
- Benjamin Sigg
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new manager using theDefaultSplitLayoutManageras delegate.LockedResizeLayoutManager(SplitLayoutManager delegate) Creates a new manager. -
Method Summary
Modifier and TypeMethodDescriptionprotected ResizeElement<T>asyncToElement(ResizeElement<T> parent, SplitNode node) Called bytoElement(ResizeElement, SplitNode), tries to create aResizeElementout ofnodein an environment where race conditions are possible.Gets the policy that tells how twoResizeRequests are merged.abstract ResizeRequestgetRequest(T t, Leaf leaf) Gets the size request that changes the size ofleafsuch that it has a valid size again.protected booleanhasTreeChanged(Root root) Tells whether the current operation happens because the tree has changed (e.g.protected booleanTells whether the current operation is a resize operation.abstract TprepareResize(Leaf leaf) Called before the resize takes place, subclasses might store some properties.voidsetConflictResolver(ConflictResolver<T> conflictResolver) Sets theConflictResolverthat will determine how to mergeResizeRequests and how to resolve conflicts.toElement(ResizeElement<T> parent, SplitNode node) Transforms aSplitNodeinto the matching kind ofResizeElement.voidupdateBounds(Root root, double x, double y, double factorW, double factorH) voidupdateBoundsLocked(Root root, double x, double y, double factorW, double factorH) Updates the bounds ofrootand all its children and does consider allResizeRequest.Methods inherited from class bibliothek.gui.dock.facile.station.split.DelegatingSplitLayoutManager
calculateDivider, install, prepareDrop, prepareMove, uninstall, validateDivider, validatePutInfo, willMakeFullscreen
-
Constructor Details
-
LockedResizeLayoutManager
public LockedResizeLayoutManager()Creates a new manager using theDefaultSplitLayoutManageras delegate. -
LockedResizeLayoutManager
Creates a new manager.- Parameters:
delegate- the base functionality
-
-
Method Details
-
setConflictResolver
Sets theConflictResolverthat will determine how to mergeResizeRequests and how to resolve conflicts.- Parameters:
conflictResolver- the new policy, notnull
-
getConflictResolver
Gets the policy that tells how twoResizeRequests are merged.- Returns:
- the policy
-
updateBounds
- Specified by:
updateBoundsin interfaceSplitLayoutManager- Overrides:
updateBoundsin classDelegatingSplitLayoutManager
-
isResize
Tells whether the current operation is a resize operation. The locked sizes will only be respected if the operation is a resize operation.- Parameters:
root- the item that is going to be updated- Returns:
- whether a resize operation is in progress
-
hasTreeChanged
Tells whether the current operation happens because the tree has changed (e.g. a leaf has been added or removed). This method is only called ifisResize(Root)already returnedfalse.- Parameters:
root- the item that is going to be updated- Returns:
- whether the tree has changed
-
updateBoundsLocked
Updates the bounds ofrootand all its children and does consider allResizeRequest.- Parameters:
root- the root element of a tree to updatex- the left coordinate ofrooty- the top coordinate ofrootfactorW- a factor all x-coordinates have to be multiplied with in order to get the pixel coordinatesfactorH- a factor all y-coordinates have to be multiplied with in order to get the pixel coordinates
-
getRequest
Gets the size request that changes the size ofleafsuch that it has a valid size again.- Parameters:
t- the data that was created inprepareResize(Leaf)ornullleaf- the leaf which size is not yet valid.- Returns:
- the preferred size or
null
-
prepareResize
Called before the resize takes place, subclasses might store some properties.- Parameters:
leaf- some leaf- Returns:
- some temporary data that gets forwarded to
getRequest(Object, Leaf), can benull
-
toElement
Transforms aSplitNodeinto the matching kind ofResizeElement. The subtree ofnodeis transformed as well.- Parameters:
parent- the parent of the new elementnode- some root, node, leaf ornull- Returns:
- some root, node, leaf or
null
-
asyncToElement
Called bytoElement(ResizeElement, SplitNode), tries to create aResizeElementout ofnodein an environment where race conditions are possible. This is a best effort method, callers should check the result using the methodResizeElement.isValid().- Parameters:
parent- the parent of the new elementnode- some root, node, leaf ornull- Returns:
- some root, node, leaf or
null
-