protected void anchorBorder(int type, Line line){ Rectangle cellAnchor = GetAnchor(); Rectangle lineAnchor = new Rectangle(); switch(type){ case Table.BORDER_TOP: lineAnchor.x = cellAnchor.x; lineAnchor.y = cellAnchor.y; lineAnchor.width = cellAnchor.width; lineAnchor.height = 0; break; case Table.BORDER_RIGHT: lineAnchor.x = cellAnchor.x + cellAnchor.width; lineAnchor.y = cellAnchor.y; lineAnchor.width = 0; lineAnchor.height = cellAnchor.height; break; case Table.BORDER_BOTTOM: lineAnchor.x = cellAnchor.x; lineAnchor.y = cellAnchor.y + cellAnchor.height; lineAnchor.width = cellAnchor.width; lineAnchor.height = 0; break; case Table.BORDER_LEFT: lineAnchor.x = cellAnchor.x; lineAnchor.y = cellAnchor.y; lineAnchor.width = 0; lineAnchor.height = cellAnchor.height; break; default: throw new ArgumentException("Unknown border type: " + type); } line.SetAnchor(lineAnchor); }