protected int[] getLine( Part fs, Part ts ) { if ( fs == null || ts == null ) { return null; } Point from = fs.getLocation(); Point to = ts.getLocation(); int x1 = from.x + iconsize / 2; int y1 = from.y + iconsize / 2; int x2 = to.x + iconsize / 2; int y2 = to.y + iconsize / 2; return new int[] { x1, y1, x2, y2 }; }