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 Details

    • requestHorizontal

      ResizeRequest requestHorizontal(ResizeRequest left, ResizeRequest right, ResizeNode<T> node)
      Combines the two request left and right into a new request.
      Parameters:
      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 merged
      Returns:
      a new request that somehow represents left and right or null to cancel the requests
    • requestVertical

      ResizeRequest requestVertical(ResizeRequest top, ResizeRequest bottom, ResizeNode<T> node)
      Combines the two requests top and bottom into a new request.
      Parameters:
      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 merged
      Returns:
      a new request that somehow represents top and bottom or null to 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 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

      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 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