Class FullLockConflictResolver
java.lang.Object
bibliothek.gui.dock.facile.station.split.DefaultConflictResolver<RequestDimension>
bibliothek.gui.dock.common.layout.FullLockConflictResolver
- All Implemented Interfaces:
ConflictResolver<RequestDimension>
This
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.- Author:
- Benjamin Sigg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanChecks whetherelementis fully locked in its horizontal dimension.protected booleanChecks whetherelementis fully locked in its vertical dimension.doubleresolveHorizontal(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.doubleresolveVertical(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.Methods inherited from class bibliothek.gui.dock.facile.station.split.DefaultConflictResolver
requestHorizontal, requestVertical
-
Constructor Details
-
FullLockConflictResolver
public FullLockConflictResolver()
-
-
Method Details
-
resolveHorizontal
public double resolveHorizontal(ResizeNode<RequestDimension> 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<RequestDimension>- Overrides:
resolveHorizontalin classDefaultConflictResolver<RequestDimension>- 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<RequestDimension> 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<RequestDimension>- Overrides:
resolveVerticalin classDefaultConflictResolver<RequestDimension>- 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
-
checkHorizontalFullLock
Checks whetherelementis fully locked in its horizontal dimension. Fully locked means that:
- if
elementis a node: its children have both requests for a change in width and its children are alsofully locked - if
elementis a leaf: it has a resize request for the width - in any other case:
true
- Parameters:
element- the element to check- Returns:
trueif the horizontal dimension has very high priority for this node,falseotherwise
- if
-
checkVerticalFullLock
Checks whetherelementis fully locked in its vertical dimension. Fully locked means that:
- if
elementis a node: its children have both requests for a change in height and its children are alsofully locked - if
elementis a leaf: it has a resize request for the height - in any other case:
true
- Parameters:
element- the element to check- Returns:
trueif the vertical dimension has very high priority for this node,falseotherwise
- if
-