code: protected boolean validateLayout(Dimension dim)
      {
          if (majorAxis == X_AXIS)
          {
              majorRequest = getRequirements(X_AXIS, majorRequest);
              minorRequest = getRequirements(Y_AXIS, minorRequest);
              oldDimension.setSize(majorRequest.preferred, minorRequest.preferred);
          }
          else
          {
              majorRequest = getRequirements(Y_AXIS, majorRequest);
              minorRequest = getRequirements(X_AXIS, minorRequest);
              oldDimension.setSize(minorRequest.preferred, majorRequest.preferred);
          }
  
          majorReqValid = true;
          minorReqValid = true;
          majorAllocValid = true;
          minorAllocValid = true;
          return false;
      }
docs: Validates layout.
  
  @param dim
  the new dimension of valid area. Validation run against this
  @return true, if layout during validation process has been changed.