public class FullLockConflictResolver extends DefaultConflictResolver<RequestDimension>
ConflictResolver
has a alternative strategy how to handle cases
where two requests collide and a satisfying solution is not possible: the
two affected trees are checked for their "fully locked state" and if one
is fully locked but not the other, then the request of the fully locked one
is answered. Fully locked means that each child of some node has a request.Constructor and Description |
---|
FullLockConflictResolver() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkHorizontalFullLock(ResizeElement<RequestDimension> element)
Checks whether
element is fully locked in its horizontal dimension. |
protected boolean |
checkVerticalFullLock(ResizeElement<RequestDimension> element)
Checks whether
element is fully locked in its vertical dimension. |
double |
resolveHorizontal(ResizeNode<RequestDimension> node,
ResizeRequest left,
double deltaLeft,
ResizeRequest right,
double deltaRight)
Called whenever a node has to grant two resize requests at the same time.
|
double |
resolveVertical(ResizeNode<RequestDimension> node,
ResizeRequest top,
double deltaTop,
ResizeRequest bottom,
double deltaBottom)
Called whenever a node has to grant two resize requests at the same time.
|
requestHorizontal, requestVertical
public double resolveHorizontal(ResizeNode<RequestDimension> node, ResizeRequest left, double deltaLeft, ResizeRequest right, double deltaRight)
ConflictResolver
resolveHorizontal
in interface ConflictResolver<RequestDimension>
resolveHorizontal
in class DefaultConflictResolver<RequestDimension>
node
- the node at which a conflict occurredleft
- the request from the left childdeltaLeft
- how much the left child would move the dividerright
- the request from the right childdeltaRight
- how much the right child would move the dividerpublic double resolveVertical(ResizeNode<RequestDimension> node, ResizeRequest top, double deltaTop, ResizeRequest bottom, double deltaBottom)
ConflictResolver
resolveVertical
in interface ConflictResolver<RequestDimension>
resolveVertical
in class DefaultConflictResolver<RequestDimension>
node
- the node at which a conflict occurredtop
- the request from the top childdeltaTop
- how much the top child would move the dividerbottom
- the request from the bottom childdeltaBottom
- how much the bottom child would move the dividerprotected boolean checkHorizontalFullLock(ResizeElement<RequestDimension> element)
element
is fully locked in its horizontal dimension.
Fully locked means that: element
is a node: its children have both requests
for a change in width and its children are also
fully locked
element
is a leaf: it has a resize request for the widthtrue
element
- the element to checktrue
if the horizontal dimension has very high
priority for this node, false
otherwiseprotected boolean checkVerticalFullLock(ResizeElement<RequestDimension> element)
element
is fully locked in its vertical dimension.
Fully locked means that: element
is a node: its children have both requests
for a change in height and its children are also
fully locked
element
is a leaf: it has a resize request for the heighttrue
element
- the element to checktrue
if the vertical dimension has very high
priority for this node, false
otherwise