bibliothek.gui.dock.common.layout
Class FullLockConflictResolver

java.lang.Object
  extended by bibliothek.gui.dock.facile.station.split.DefaultConflictResolver<RequestDimension>
      extended by bibliothek.gui.dock.common.layout.FullLockConflictResolver
All Implemented Interfaces:
ConflictResolver<RequestDimension>

public class FullLockConflictResolver
extends DefaultConflictResolver<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
FullLockConflictResolver()
           
 
Method Summary
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.
 
Methods inherited from class bibliothek.gui.dock.facile.station.split.DefaultConflictResolver
requestHorizontal, requestVertical
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FullLockConflictResolver

public FullLockConflictResolver()
Method Detail

resolveHorizontal

public double resolveHorizontal(ResizeNode<RequestDimension> node,
                                ResizeRequest left,
                                double deltaLeft,
                                ResizeRequest right,
                                double deltaRight)
Description copied from interface: ConflictResolver
Called whenever a node has to grant two resize requests at the same time.

Specified by:
resolveHorizontal in interface ConflictResolver<RequestDimension>
Overrides:
resolveHorizontal in class DefaultConflictResolver<RequestDimension>
Parameters:
node - the node at which a conflict occurred
left - the request from the left child
deltaLeft - how much the left child would move the divider
right - the request from the right child
deltaRight - 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: ConflictResolver
Called whenever a node has to grant two resize requests at the same time.

Specified by:
resolveVertical in interface ConflictResolver<RequestDimension>
Overrides:
resolveVertical in class DefaultConflictResolver<RequestDimension>
Parameters:
node - the node at which a conflict occurred
top - the request from the top child
deltaTop - how much the top child would move the divider
bottom - the request from the bottom child
deltaBottom - how much the bottom child would move the divider
Returns:
how much the divider should be moved

checkHorizontalFullLock

protected boolean checkHorizontalFullLock(ResizeElement<RequestDimension> element)
Checks whether element is fully locked in its horizontal dimension. Fully locked means that:

Parameters:
element - the element to check
Returns:
true if the horizontal dimension has very high priority for this node, false otherwise

checkVerticalFullLock

protected boolean checkVerticalFullLock(ResizeElement<RequestDimension> element)
Checks whether element is fully locked in its vertical dimension. Fully locked means that:

Parameters:
element - the element to check
Returns:
true if the vertical dimension has very high priority for this node, false otherwise