code: private static int origin(Alignment alignment,
              int cellOrigin,
              int cellSize,
              int componentSize) {
          if (alignment == RIGHT || alignment == BOTTOM) {
              return cellOrigin + cellSize - componentSize;
          } else if (alignment == CENTER) {
              return cellOrigin + (cellSize - componentSize) / 2;
          } else {  // left, top, fill
              return cellOrigin;
          }
      }
docs: Computes and returns the component's pixel origin.
  
  @param alignment	the component's alignment
  @param cellOrigin	the origin of the display area
  @param cellSize	the extent of the display area
  @param componentSize the component's size
  @return the component's pixel origin