private void addDockingCell(int[] dockInsets, int side, CompWrap cw)
	{
		int r, c, spanx = 1, spany = 1;
		switch (side) {
			case 0:
			case 2:
				r = side == 0 ? dockInsets[0]++ : dockInsets[2]--;
				c = dockInsets[1];
				spanx = dockInsets[3] - dockInsets[1] + 1;  // The +1 is for cell 0.
				colIndexes.add(dockInsets[3]); // Make sure there is a receiving cell
				break;

			case 1:
			case 3:
				c = side == 1 ? dockInsets[1]++ : dockInsets[3]--;
				r = dockInsets[0];
				spany = dockInsets[2] - dockInsets[0] + 1;  // The +1 is for cell 0.
				rowIndexes.add(dockInsets[2]); // Make sure there is a receiving cell
				break;

			default:
				throw new IllegalArgumentException("Internal error 123.");
		}

		rowIndexes.add(r);
		colIndexes.add(c);

		grid.put((r << 16) + c, new Cell(cw, spanx, spany, spanx > 1));
	}