if ( entity.isImmobile() && !entity.isProne() && !turretLocked ) {  graph.setColor(Color.darkGray); graph.drawString(Messages.getString("BoardView1.IMMOBILE"), 18, 39); graph.setColor(Color.red); graph.drawString(Messages.getString("BoardView1.IMMOBILE"), 17, 38); } else if (!entity.isImmobile() && entity.isProne()) {
if (!ge && entity.isImmobile()) { if (entity.isProne()) {  graph.setColor(Color.darkGray); graph.drawString(Messages.getString("BoardView1.IMMOBILE"), 18, 35); graph.drawString(Messages.getString("BoardView1.PRONE"), 26, 48); graph.setColor(Color.red); graph.drawString(Messages.getString("BoardView1.IMMOBILE"), 17, 34); graph.setColor(Color.yellow); graph.drawString(Messages.getString("BoardView1.PRONE"), 25, 47); } else if (turretLocked) {  graph.setColor(Color.darkGray); graph.drawString(Messages.getString("BoardView1.IMMOBILE"), 18, 35); graph.drawString(Messages.getString("BoardView1.LOCKED"), 22, 48); graph.setColor(Color.red); graph.drawString(Messages.getString("BoardView1.IMMOBILE"), 17, 34); graph.setColor(Color.yellow); graph.drawString(Messages.getString("BoardView1.LOCKED"), 21, 47); } else {  graph.setColor(Color.darkGray); graph.drawString(Messages.getString("BoardView1.IMMOBILE"), 18, 39); graph.setColor(Color.red); graph.drawString(Messages.getString("BoardView1.IMMOBILE"), 17, 38); } } else if (entity.isProne()) {
        public void prepare() {            // figure out size            String shortName = entity.getShortName();            if (entity.getMovementMode() == IEntityMovementMode.VTOL) {                shortName = shortName.concat(" (FL: ").concat(Integer.toString(entity.getElevation())).concat(")");            }            if (PreferenceManager.getClientPreferences().getShowUnitId()) {                shortName+=(Messages.getString("BoardView1.ID")+entity.getId()); //$NON-NLS-1$            }            Font font = new Font("SansSerif", Font.PLAIN, 10); //$NON-NLS-1$            Rectangle tempRect =                new Rectangle(47, 55,                              getFontMetrics(font).stringWidth(shortName) + 1,                              getFontMetrics(font).getAscent());            // create image for buffer            Image tempImage;            Graphics graph;            try {                tempImage = createImage(bounds.width, bounds.height);                graph = tempImage.getGraphics();            } catch (NullPointerException ex) {                // argh!  but I want it!                return;            }            // fill with key color            graph.setColor(new Color(TRANSPARENT));            graph.fillRect(0, 0, bounds.width, bounds.height);            // draw entity image            graph.drawImage(tileManager.imageFor(entity), 0, 0, this);            // draw box with shortName            Color text, bkgd, bord;            if (entity.isDone()) {                text = Color.lightGray;                bkgd = Color.darkGray;                bord = Color.black;            } else if (entity.isImmobile()) {                text = Color.darkGray;                bkgd = Color.black;                bord = Color.lightGray;            } else {                text = Color.black;                bkgd = Color.lightGray;                bord = Color.darkGray;            }            graph.setFont(font);            graph.setColor(bord);            graph.fillRect(tempRect.x, tempRect.y,                           tempRect.width, tempRect.height);            tempRect.translate(-1, -1);            graph.setColor(bkgd);            graph.fillRect(tempRect.x, tempRect.y,                           tempRect.width, tempRect.height);            graph.setColor(text);            graph.drawString(shortName, tempRect.x + 1,                             tempRect.y + tempRect.height - 1);            // draw facing            graph.setColor(Color.white);            if (entity.getFacing() != -1) {                graph.drawPolygon(facingPolys[entity.getFacing()]);            }            // determine secondary facing for non-mechs & flipped arms            int secFacing = entity.getFacing();            if (!(entity instanceof Mech || entity instanceof Protomech)) {                secFacing = entity.getSecondaryFacing();            } else if (entity.getArmsFlipped()) {                secFacing = (entity.getFacing() + 3) % 6;            }            // draw red secondary facing arrow if necessary            if (secFacing != -1 && secFacing != entity.getFacing()) {                graph.setColor(Color.red);                graph.drawPolygon(facingPolys[secFacing]);            }            // Determine if the entity is a tank with a locked turret.            boolean turretLocked = false;            if ( entity instanceof Tank &&                 !( (Tank) entity ).hasNoTurret() &&                 !entity.canChangeSecondaryFacing() ) {                turretLocked = true;            }            // draw condition strings            if ( entity.isImmobile() && !entity.isProne() && !turretLocked ) {                // draw "IMMOBILE"                graph.setColor(Color.darkGray);                graph.drawString(Messages.getString("BoardView1.IMMOBILE"), 18, 39); //$NON-NLS-1$                graph.setColor(Color.red);                graph.drawString(Messages.getString("BoardView1.IMMOBILE"), 17, 38); //$NON-NLS-1$            } else if (!entity.isImmobile() && entity.isProne()) {                // draw "PRONE"                graph.setColor(Color.darkGray);                graph.drawString(Messages.getString("BoardView1.PRONE"), 26, 39); //$NON-NLS-1$                graph.setColor(Color.yellow);                graph.drawString(Messages.getString("BoardView1.PRONE"), 25, 38); //$NON-NLS-1$            } else if ( !entity.isImmobile() && turretLocked ) {                // draw "LOCKED"                graph.setColor(Color.darkGray);                graph.drawString(Messages.getString("BoardView1.LOCKED"), 22, 39); //$NON-NLS-1$                graph.setColor(Color.yellow);                graph.drawString(Messages.getString("BoardView1.LOCKED"), 21, 38); //$NON-NLS-1$            } else if (entity.isImmobile() && entity.isProne()) {                // draw "IMMOBILE" and "PRONE"                graph.setColor(Color.darkGray);                graph.drawString(Messages.getString("BoardView1.IMMOBILE"), 18, 35); //$NON-NLS-1$                graph.drawString(Messages.getString("BoardView1.PRONE"), 26, 48); //$NON-NLS-1$                graph.setColor(Color.red);                graph.drawString(Messages.getString("BoardView1.IMMOBILE"), 17, 34); //$NON-NLS-1$                graph.setColor(Color.yellow);                graph.drawString(Messages.getString("BoardView1.PRONE"), 25, 47); //$NON-NLS-1$            } else if ( entity.isImmobile() && turretLocked ) {                // draw "IMMOBILE" and "LOCKED"                graph.setColor(Color.darkGray);                graph.drawString(Messages.getString("BoardView1.IMMOBILE"), 18, 35); //$NON-NLS-1$                graph.drawString(Messages.getString("BoardView1.LOCKED"), 22, 48); //$NON-NLS-1$                graph.setColor(Color.red);                graph.drawString(Messages.getString("BoardView1.IMMOBILE"), 17, 34); //$NON-NLS-1$                graph.setColor(Color.yellow);                graph.drawString(Messages.getString("BoardView1.LOCKED"), 21, 47); //$NON-NLS-1$            }            // If this unit is being swarmed or is swarming another, say so.            if ( Entity.NONE != entity.getSwarmAttackerId() ) {                // draw "SWARMED"                graph.setColor(Color.darkGray);                graph.drawString(Messages.getString("BoardView1.SWARMED"), 17, 22); //$NON-NLS-1$                graph.setColor(Color.red);                graph.drawString(Messages.getString("BoardView1.SWARMED"), 16, 21); //$NON-NLS-1$            }            // If this unit is transporting another, say so.            if ((entity.getLoadedUnits()).size() > 0) {                // draw "T"                graph.setColor(Color.darkGray);                graph.drawString("T", 20, 71); //$NON-NLS-1$                graph.setColor(Color.black);                graph.drawString("T", 19, 70); //$NON-NLS-1$            }                        // If this unit is stuck, say so.            if ((entity.isStuck())) {                graph.setColor(Color.darkGray);                graph.drawString(Messages.getString("BoardView1.STUCK"), 26, 61); //$NON-NLS-1$                graph.setColor(Color.orange);                graph.drawString(Messages.getString("BoardView1.STUCK"), 25, 60); //$NON-NLS-1$                            }            // If this unit is currently unknown to the enemy, say so.            if (trackThisEntitiesVisibilityInfo(entity)) {                if (!entity.isSeenByEnemy()) {                    // draw "U"                    graph.setColor(Color.darkGray);                    graph.drawString("U", 30, 71); //$NON-NLS-1$                    graph.setColor(Color.black);                    graph.drawString("U", 29, 70); //$NON-NLS-1$                } else if (!entity.isVisibleToEnemy() && !GUIPreferences.getInstance().getBoolean(GUIPreferences.ADVANCED_TRANSLUCENT_HIDDEN_UNITS)) {                    // If this unit is currently hidden from the enemy, say so.                    // draw "H"                    graph.setColor(Color.darkGray);                    graph.drawString("H", 30, 71); //$NON-NLS-1$                    graph.setColor(Color.black);                    graph.drawString("H", 29, 70); //$NON-NLS-1$                }            }                        // If hull down, show             if (entity.isHullDown()) {                // draw "D"                graph.setColor(Color.darkGray);                graph.drawString("D", 40, 71); //$NON-NLS-1$                graph.setColor(Color.black);                graph.drawString("D", 39, 70); //$NON-NLS-1$            	            }            //Lets draw our armor and internal status bars            int baseBarLength = 23;            int barLength = 0;            double percentRemaining = 0.00;            percentRemaining = entity.getArmorRemainingPercent();            barLength = (int)(baseBarLength * percentRemaining);            graph.setColor(Color.darkGray);            graph.fillRect(56, 7, 23, 3);            graph.setColor(Color.lightGray);            graph.fillRect(55, 6, 23, 3);            graph.setColor(getStatusBarColor(percentRemaining));            graph.fillRect(55, 6, barLength, 3);            percentRemaining = entity.getInternalRemainingPercent();            barLength = (int)(baseBarLength * percentRemaining);            graph.setColor(Color.darkGray);            graph.fillRect(56, 11, 23, 3);            graph.setColor(Color.lightGray);            graph.fillRect(55, 10, 23, 3);            graph.setColor(getStatusBarColor(percentRemaining));            graph.fillRect(55, 10, barLength, 3);            // create final image            this.image = createImage(new FilteredImageSource(tempImage.getSource(),                                                             new KeyAlphaFilter(TRANSPARENT)));        }