code: private void alignLineHorizontally(LineBox line, boolean isLast)
      {
          final int dif = content.width - line.getLimits() - line.getWidth(); //difference between maximal available and current width
          if (dif > 0)
          {
              if (align == ALIGN_JUSTIFY)
              {
                  if (!isLast)
                      extendInlineChildWidths(dif, line.getStart(), line.getEnd(), true, true);
              }
              else if (align != ALIGN_LEFT)
              {
                  for (int i = line.getStart(); i < line.getEnd(); i++) //all inline boxes on this line
                  {
                      Box subbox = getSubBox(i);
                      if (subbox instanceof Inline)
                      {
                          if (align == ALIGN_RIGHT)
                              subbox.moveRight(dif);
                          else if (align == ALIGN_CENTER)
                              subbox.moveRight(dif/2);
                      }
                  }
              }
          }
      }
docs: Aligns the subboxes in a line according to the selected alignment settings.
  @param line The line box to be aligned