int stringsSize = 0;
IHex mhex = null;
// first, we have to determine how much text we are going to have
// are we on a hex?
final Coords mcoords = getCoordsAt(point);
if (GUIPreferences.getInstance().getShowMapHexPopup()
&& game.getBoard().contains(mcoords)) {
mhex = game.getBoard().getHex(mcoords);
stringsSize += 1;
}
// check if it's on any entities
for (EntitySprite eSprite : entitySprites) {
if (eSprite.isInside(point)) {
stringsSize += 3;
}
}
// check if it's on any attacks
for (AttackSprite aSprite : attackSprites) {
if (aSprite.isInside(point)) {
stringsSize += 1 + aSprite.weaponDescs.size();
}
}
// If the hex contains a building, make more space.
// Also if it contains other displayable terrain.
if (mhex != null) {
stringsSize += mhex.displayableTerrainsPresent();
if (mhex.containsTerrain(Terrains.BUILDING)) {
stringsSize++;
}
if (mhex.containsTerrain(Terrains.FUEL_TANK)) {
stringsSize++;
}
if (mhex.containsTerrain(Terrains.BRIDGE)) {
stringsSize++;
}
}
stringsSize += game.getNbrMinefields(mcoords);
// Artillery
final ArrayList<ArtilleryAttackAction> artilleryAttacks = getArtilleryAttacksAtLocation(mcoords);
stringsSize += artilleryAttacks.size();
// Artillery fire adjustment
final Mounted curWeapon = getSelectedArtilleryWeapon();
if (curWeapon != null) {
stringsSize++;
}
/*
* Eventaul replacemtn for the artilery popup.
*
final Collection<SpecialHexDisplay> specials = game.getBoard().getSpecialHexDisplay(mcoords);
if(specials != null)
stringsSize += specials.size();
// if the size is zip, you must a'quit
if (stringsSize == 0) {
return null;
}*/
// now we can allocate an array of strings
String[] strings = new String[stringsSize];
int stringsIndex = 0;
// are we on a hex?
if (mhex != null) {
strings[stringsIndex] = Messages.getString("BoardView1.Hex") + mcoords.getBoardNum() //$NON-NLS-1$
+ Messages.getString("BoardView1.level") + mhex.getElevation(); //$NON-NLS-1$
stringsIndex += 1;
//cycle through the terrains and report types found
//this will skip buildings and other constructed units