*/
private void determineSiteColors() {
final Vector highlightCandidates = new Vector(); // Stores the sites
// that the cursor
// touches.
final XYPoint convertedHighlightArea[] = new XYPoint[4];
// Cursor coordinates , obtained by dividing preferred width and height
// by 2.
final int cursorX = getPreferredWidth() >> 1;
final int cursorY = getPreferredHeight() >> 1;
// See comments below.
int above, below, right, left;
for (int count = 0; count < _allSites.size(); count++) {
final Coordinates[] highlightableArea =
((MapFieldDemoSite) _allSites.elementAt(count))
.getHighlightableArea();
/*
* The following algorithm dictates that for a site to be deemed
* highlightable, the cursor must be at least over one point, under
* one point, to the left of one point and to the right of one point
*/
above = below = right = left = 0;
for (int side = 0; side < 4; side++) {
convertedHighlightArea[side] = new XYPoint();
convertWorldToField(highlightableArea[side],
convertedHighlightArea[side]);
if (convertedHighlightArea[side].x > cursorX) {
right++;