} else if ( entity.isImmobile() && turretLocked ) {  graph.setColor(Color.darkGray); graph.drawString("IMMOBILE", 18, 35); graph.drawString("LOCKED", 22, 48); graph.setColor(Color.red); graph.drawString("IMMOBILE", 17, 34); graph.setColor(Color.yellow); graph.drawString("LOCKED", 21, 47);
        public void prepare() {            // figure out size            String shortName = entity.getShortName();            Font font = new Font("SansSerif", Font.PLAIN, 10);            Rectangle modelRect = 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(modelRect.x, modelRect.y, modelRect.width, modelRect.height);            modelRect.translate(-1, -1);            graph.setColor(bkgd);            graph.fillRect(modelRect.x, modelRect.y, modelRect.width, modelRect.height);            graph.setColor(text);            graph.drawString(shortName, modelRect.x + 1, modelRect.y + modelRect.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)) {                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]);            }            // draw condition strings            if (entity.isImmobile() && !entity.isProne()) {                // draw "IMMOBILE"                graph.setColor(Color.darkGray);                graph.drawString("IMMOBILE", 18, 39);                graph.setColor(Color.red);                graph.drawString("IMMOBILE", 17, 38);            } else if (!entity.isImmobile() && entity.isProne()) {                // draw "PRONE"                graph.setColor(Color.darkGray);                graph.drawString("PRONE", 26, 39);                graph.setColor(Color.yellow);                graph.drawString("PRONE", 25, 38);            } else if (entity.isImmobile() && entity.isProne()) {                // draw "IMMOBILE" and "PRONE"                graph.setColor(Color.darkGray);                graph.drawString("IMMOBILE", 18, 35);                graph.drawString("PRONE", 26, 48);                graph.setColor(Color.red);                graph.drawString("IMMOBILE", 17, 34);                graph.setColor(Color.yellow);                graph.drawString("PRONE", 25, 47);            }            // 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("SWARMED", 17, 22);                graph.setColor(Color.red);                graph.drawString("SWARMED", 16, 21);            }            //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)));        }