BasicRectangle square = new BasicRectangle(160, 80, 80, 80);
square.setStrokePaint(Color.gray);
layer.add(square);
// Create a BoundsGeometry to help get sites
BoundsGeometry _geometry = new BoundsGeometry(square, square
.getBounds());
// Create a set of terminals, one by one
// NORTH
StraightTerminal north = new StraightTerminal(_geometry.getN());
//Site connectNorth = north.getConnectSite();
Blob blobNorth = new Blob();
blobNorth.setSizeUnit(5.0);
north.setEnd(blobNorth);
layer.add(north);
// SOUTH
StraightTerminal south = new StraightTerminal(_geometry.getS());
//Site connectSouth = south.getConnectSite();
Blob blobSouth = new Blob();
blobSouth.setStyle(Blob.BLOB_DIAMOND);
blobSouth.setSizeUnit(5.0);
blobSouth.setFilled(false);
south.setEnd(blobSouth);
layer.add(south);
// WEST
StraightTerminal west = new StraightTerminal(_geometry.getW());
//Site connectWest = west.getConnectSite();
Arrowhead arrowWest = new Arrowhead();
west.setEnd(arrowWest);
layer.add(west);
// EAST
StraightTerminal east = new StraightTerminal(_geometry.getE());
//Site connectEast = east.getConnectSite();
Arrowhead arrowEast = new Arrowhead();
arrowEast.setFlipped(true);
east.setEnd(arrowEast);