Interface ConflictResolver<T>
- All Known Implementing Classes:
DefaultConflictResolver,FullLockConflictResolver
public interface ConflictResolver<T>
A
ConflictResolver determines how to merge ResizeRequests
and later how to resolve situations where two requests have to be handled
at the same time.- Author:
- Benjamin Sigg
-
Method Summary
Modifier and TypeMethodDescriptionrequestHorizontal(ResizeRequest left, ResizeRequest right, ResizeNode<T> node) Combines the two requestleftandrightinto a new request.requestVertical(ResizeRequest top, ResizeRequest bottom, ResizeNode<T> node) Combines the two requeststopandbottominto a new request.doubleresolveHorizontal(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.doubleresolveVertical(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.
-
Method Details
-
requestHorizontal
Combines the two requestleftandrightinto a new request.- Parameters:
left- the request from the left, can benullright- the request from the right, can benullnode- the node for which the requests have to be merged- Returns:
- a new request that somehow represents
leftandrightornullto cancel the requests
-
requestVertical
Combines the two requeststopandbottominto a new request.- Parameters:
top- the request from the top, can benullbottom- the request from the bottom, can benullnode- the node for which the requests have to be merged- Returns:
- a new request that somehow represents
topandbottomornullto cancel the requests
-
resolveHorizontal
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.- Parameters:
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 divider- Returns:
- how much the divider should be moved
-
resolveVertical
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.- Parameters:
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- Returns:
- how much the divider should be moved
-