Class DefaultConflictResolver<T>
java.lang.Object
bibliothek.gui.dock.facile.station.split.DefaultConflictResolver<T>
- All Implemented Interfaces:
ConflictResolver<T>
- Direct Known Subclasses:
FullLockConflictResolver
A conflict resolver that tries to distribute space in conflicts
equally to all parties
- Author:
- Benjamin Sigg
-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
DefaultConflictResolver
public DefaultConflictResolver()
-
-
Method Details
-
requestHorizontal
Description copied from interface:ConflictResolverCombines the two requestleftandrightinto a new request.- Specified by:
requestHorizontalin interfaceConflictResolver<T>- 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
Description copied from interface:ConflictResolverCombines the two requeststopandbottominto a new request.- Specified by:
requestVerticalin interfaceConflictResolver<T>- 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
public double resolveHorizontal(ResizeNode<T> node, ResizeRequest left, double deltaLeft, ResizeRequest right, double deltaRight) Description copied from interface:ConflictResolverCalled whenever a node has to grant two resize requests at the same time.- Specified by:
resolveHorizontalin interfaceConflictResolver<T>- 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
public double resolveVertical(ResizeNode<T> node, ResizeRequest top, double deltaTop, ResizeRequest bottom, double deltaBottom) Description copied from interface:ConflictResolverCalled whenever a node has to grant two resize requests at the same time.- Specified by:
resolveVerticalin interfaceConflictResolver<T>- 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
-