public class DefaultConflictResolver<T> extends java.lang.Object implements ConflictResolver<T>
Constructor and Description |
---|
DefaultConflictResolver() |
Modifier and Type | Method and Description |
---|---|
ResizeRequest |
requestHorizontal(ResizeRequest left,
ResizeRequest right,
ResizeNode<T> node)
Combines the two request
left and right into
a new request. |
ResizeRequest |
requestVertical(ResizeRequest top,
ResizeRequest bottom,
ResizeNode<T> node)
Combines the two requests
top and bottom into
a new request. |
double |
resolveHorizontal(ResizeNode<T> 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<T> node,
ResizeRequest top,
double deltaTop,
ResizeRequest bottom,
double deltaBottom)
Called whenever a node has to grant two resize requests at the same time.
|
public ResizeRequest requestHorizontal(ResizeRequest left, ResizeRequest right, ResizeNode<T> node)
ConflictResolver
left
and right
into
a new request.requestHorizontal
in interface ConflictResolver<T>
left
- the request from the left, can be null
right
- the request from the right, can be null
node
- the node for which the requests have to be mergedleft
and right
or null
to cancel the requestspublic ResizeRequest requestVertical(ResizeRequest top, ResizeRequest bottom, ResizeNode<T> node)
ConflictResolver
top
and bottom
into
a new request.requestVertical
in interface ConflictResolver<T>
top
- the request from the top, can be null
bottom
- the request from the bottom, can be null
node
- the node for which the requests have to be mergedtop
and bottom
or null
to cancel the requestspublic double resolveHorizontal(ResizeNode<T> node, ResizeRequest left, double deltaLeft, ResizeRequest right, double deltaRight)
ConflictResolver
resolveHorizontal
in interface ConflictResolver<T>
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<T> node, ResizeRequest top, double deltaTop, ResizeRequest bottom, double deltaBottom)
ConflictResolver
resolveVertical
in interface ConflictResolver<T>
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 divider