docs: private int isCentered(Area area, boolean askBefore, boolean askAfter)
      {
          Area parent = area.getParent();
          if (parent != null)
          {
              int left = area.getX1() - parent.getX1();
              int right = parent.getX2() - area.getX2();
              int limit = (int) (((left + right) / 2.0) * CENTERING_THRESHOLD);
              if (limit == 0) limit = 1; //we always allow +-1px
              //System.out.println(this + " left=" + left + " right=" + right + " limit=" + limit);
              boolean middle = Math.abs(left - right) <= limit; //first guess - check if it is placed in the middle
              boolean fullwidth = left == 0 && right == 0; //centered because of full width
              
              if (!middle && !fullwidth) //not full width and certainly not in the middle
              {
                  return 0; 
              }
              else //may be centered - check the alignment
              {
                  //compare the alignent with the previous and/or the next child
                  Area prev = null;
                  Area next = null;
                  int pc = 2; //previous centered?
                  int nc = 2; //next cenrered?
                  if (askBefore || askAfter)
                  {
                      if (askBefore)
                      {
                          prev = area.getPreviousSibling();
                          while (prev != null && (pc = isCentered(prev, true, false)) == 2)
                              prev = prev.getPreviousSibling();
                      }
                      if (askAfter)
                      {
                          next = area.getNextSibling();
                          while (next != null && (nc = isCentered(next, false, true)) == 2)
                              next = next.getNextSibling();
                      }
                  }
                  
                  if (pc != 2 || nc != 2) //we have something for comparison
                  {
                      if (fullwidth) //cannot guess, compare with others
                      {
                          if (pc != 0 && nc != 0) //something around is centered - probably centered
                              return 1;
                          else
                              return 0;
                      }
                      else //probably centered, if it is not left- or right-aligned with something around
                      {
                          if (prev != null && lrAligned(area, prev) == 1 ||
                              next != null && lrAligned(area, next) == 1)
                              return 0; //aligned, not centered
                          else
                              return 1; //probably centered
                      }
                  }
                  else //nothing to compare, just guess
                  {
                      if (fullwidth)
                          return 2; //cannot guess from anything
                      else
                          return (middle ? 1 : 0); //nothing to compare with - guess from the position
                  }
              }
          }
          else
              return 2; //no parent - we don't know
      }