T - the type of the temporary data this manager works withpublic abstract class LockedResizeLayoutManager<T> extends DelegatingSplitLayoutManager
SplitLayoutManager that can lock the size of some Dockables
during resize. This class is intended to be subclassed.| Constructor and Description |
|---|
LockedResizeLayoutManager()
Creates a new manager using the
DefaultSplitLayoutManager
as delegate. |
LockedResizeLayoutManager(SplitLayoutManager delegate)
Creates a new manager.
|
| Modifier and Type | Method and Description |
|---|---|
protected ResizeElement<T> |
asyncToElement(ResizeElement<T> parent,
SplitNode node)
Called by
toElement(ResizeElement, SplitNode), tries to create a ResizeElement out of
node in an environment where race conditions are possible. |
ConflictResolver<T> |
getConflictResolver()
Gets the policy that tells how two
ResizeRequests are merged. |
abstract ResizeRequest |
getRequest(T t,
Leaf leaf)
Gets the size request that changes the size of
leaf such
that it has a valid size again. |
protected boolean |
hasTreeChanged(Root root)
Tells whether the current operation happens because the tree has changed (e.g. a leaf has been added or removed).
|
protected boolean |
isResize(Root root)
Tells whether the current operation is a resize operation.
|
abstract T |
prepareResize(Leaf leaf)
Called before the resize takes place, subclasses might store some
properties.
|
void |
setConflictResolver(ConflictResolver<T> conflictResolver)
Sets the
ConflictResolver that will determine how to merge
ResizeRequests and how to resolve conflicts. |
ResizeElement<T> |
toElement(ResizeElement<T> parent,
SplitNode node)
Transforms a
SplitNode into the matching kind of ResizeElement. |
void |
updateBounds(Root root,
double x,
double y,
double factorW,
double factorH) |
void |
updateBoundsLocked(Root root,
double x,
double y,
double factorW,
double factorH)
Updates the bounds of
root and all its children and does
consider all ResizeRequest. |
calculateDivider, install, prepareDrop, prepareMove, uninstall, validateDivider, validatePutInfo, willMakeFullscreenpublic LockedResizeLayoutManager()
DefaultSplitLayoutManager
as delegate.public LockedResizeLayoutManager(SplitLayoutManager delegate)
delegate - the base functionalitypublic void setConflictResolver(ConflictResolver<T> conflictResolver)
ConflictResolver that will determine how to merge
ResizeRequests and how to resolve conflicts.conflictResolver - the new policy, not nullpublic ConflictResolver<T> getConflictResolver()
ResizeRequests are merged.public void updateBounds(Root root, double x, double y, double factorW, double factorH)
updateBounds in interface SplitLayoutManagerupdateBounds in class DelegatingSplitLayoutManagerprotected boolean isResize(Root root)
root - the item that is going to be updatedprotected boolean hasTreeChanged(Root root)
isResize(Root) already returned false.root - the item that is going to be updatedpublic void updateBoundsLocked(Root root, double x, double y, double factorW, double factorH)
root and all its children and does
consider all ResizeRequest.root - the root element of a tree to updatex - the left coordinate of rooty - the top coordinate of rootfactorW - 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 coordinatespublic abstract ResizeRequest getRequest(T t, Leaf leaf)
leaf such
that it has a valid size again.t - the data that was created in prepareResize(Leaf) or nullleaf - the leaf which size is not yet valid.nullpublic abstract T prepareResize(Leaf leaf)
leaf - some leafgetRequest(Object, Leaf),
can be nullpublic ResizeElement<T> toElement(ResizeElement<T> parent, SplitNode node)
SplitNode into the matching kind of ResizeElement.
The subtree of node is transformed as well.parent - the parent of the new elementnode - some root, node, leaf or nullnullprotected ResizeElement<T> asyncToElement(ResizeElement<T> parent, SplitNode node)
toElement(ResizeElement, SplitNode), tries to create a ResizeElement out of
node in an environment where race conditions are possible. This is a best effort method, callers
should check the result using the method ResizeElement.isValid().parent - the parent of the new elementnode - some root, node, leaf or nullnullCopyright © 2018. All rights reserved.