hasText = true; if ( iter.hasMoreElements() ) { carrysR.append( "\n" ); }
carrysR.append( "\n" );
    public void displayMech(Entity en) {        // Clear the "Affected By" list.        narcList.removeAll();        sinks=0;        myMechId = en.getId();        if (clientgui.getClient().getLocalPlayer().getId() != en.getOwnerId()) {            sinks2B.setEnabled(false);            dontChange=true;        } else {            sinks2B.setEnabled(true);            dontChange=false;        }        // Walk through the list of teams.  There        // can't be more teams than players.        StringBuffer buff = null;        Enumeration loop = clientgui.getClient().game.getPlayers();        while ( loop.hasMoreElements() ) {            Player player = (Player) loop.nextElement();            int team = player.getTeam();            if ( en.isNarcedBy( team ) &&                 !player.isObserver()) {                buff = new StringBuffer( Messages.getString("MechDisplay.NARCedBy") ); //$NON-NLS-1$                buff.append( player.getName() );                buff.append( " [" ) //$NON-NLS-1$                    .append( Player.teamNames[team] )                    .append( "]" ); //$NON-NLS-1$                narcList.add( buff.toString() );            }            if ( en.isINarcedBy( team ) &&                    !player.isObserver()) {                   buff = new StringBuffer( Messages.getString("MechDisplay.INarcHoming") ); //$NON-NLS-1$                   buff.append( player.getName() );                   buff.append( " [" ) //$NON-NLS-1$                       .append( Player.teamNames[team] )                       .append( "] ") //$NON-NLS-1$                       .append(Messages.getString("MechDisplay.attached")) //$NON-NLS-1$                       .append("."); //$NON-NLS-1$                   narcList.add( buff.toString() );            }        }        if ( en.isINarcedWith(INarcPod.ECM)) {               buff = new StringBuffer( Messages.getString("MechDisplay.iNarcECMPodAttached") ); //$NON-NLS-1$               narcList.add( buff.toString() );        }        if ( en.isINarcedWith(INarcPod.HAYWIRE)) {               buff = new StringBuffer( Messages.getString("MechDisplay.iNarcHaywirePodAttached") ); //$NON-NLS-1$               narcList.add( buff.toString() );        }        if ( en.isINarcedWith(INarcPod.NEMESIS)) {               buff = new StringBuffer( Messages.getString("MechDisplay.iNarcNemesisPodAttached") ); //$NON-NLS-1$               narcList.add( buff.toString() );        }        // Show inferno track.        if ( en.infernos.isStillBurning() ) {            buff = new StringBuffer( Messages.getString("MechDisplay.InfernoBurnRemaining") ); //$NON-NLS-1$            buff.append( en.infernos.getTurnsLeftToBurn() );            narcList.add( buff.toString() );        }        if( en instanceof Tank && ((Tank)en).isOnFire()) {            narcList.add( Messages.getString("MechDisplay.OnFire"));        }        // Show ECM affect.        Coords pos = en.getPosition();        if (Compute.isAffectedByECM(en, pos, pos)) {            narcList.add(Messages.getString("MechDisplay.InEnemyECMField")); //$NON-NLS-1$        } else if (Compute.isAffectedByAngelECM(en, pos, pos)) {            narcList.add(Messages.getString("MechDisplay.InEnemyAngelECMField")); //$NON-NLS-1$        }        // Show Turret Locked.        if ( en instanceof Tank &&             !( (Tank) en ).hasNoTurret() &&             !en.canChangeSecondaryFacing() ) {            narcList.add( Messages.getString("MechDisplay.Turretlocked") ); //$NON-NLS-1$        }        // Show jammed weapons.        Enumeration weaps = en.getWeapons();        while ( weaps.hasMoreElements() ) {            Mounted weapon = (Mounted) weaps.nextElement();            if ( weapon.isJammed() ) {                buff = new StringBuffer( weapon.getName() );                buff.append( Messages.getString("MechDisplay.isJammed") ); //$NON-NLS-1$                narcList.add( buff.toString() );            }        }        // Show breached locations.        for ( int loc = 0; loc < en.locations(); loc++ ) {            if ( ILocationExposureStatus.BREACHED == en.getLocationStatus(loc) ) {                buff = new StringBuffer( en.getLocationName(loc) );                buff.append( Messages.getString("MechDisplay.Breached") ); //$NON-NLS-1$                narcList.add( buff.toString() );            }        }        // transport values        String unused = en.getUnusedString();        if ( unused.equals("") ) unused = Messages.getString("MechDisplay.None"); //$NON-NLS-1$ //$NON-NLS-2$        this.unusedR.setText( unused );        Enumeration iter = en.getLoadedUnits().elements();        carrysR.setText( null );        boolean hasText = false;        while ( iter.hasMoreElements() ) {            carrysR.append( ((Entity)iter.nextElement()).getShortName() );            hasText = true;            if ( iter.hasMoreElements() ) {                carrysR.append( "\n" ); //$NON-NLS-1$            }        }        // Show club.        Mounted club = Compute.clubMechHas( en );        if ( null != club ) {            if ( hasText ) {                carrysR.append( "\r\n" ); //$NON-NLS-1$            }            carrysR.append( club.getName() );        }        // Show searchlight        if(en.hasSpotlight()) {            if(en.isUsingSpotlight())                carrysR.append(Messages.getString("MechDisplay.SearchlightOn")); //$NON-NLS-1$            else                carrysR.append(Messages.getString("MechDisplay.SearchlightOff")); //$NON-NLS-1$        }        // Show Heat Effects, but only for Mechs.        heatR.setText(""); //$NON-NLS-1$        sinksR.setText("");                if (en instanceof Mech) {            Mech m = (Mech)en;                        sinks2B.setEnabled(!dontChange);            sinks = m.getActiveSinksNextRound();            if (m.hasDoubleHeatSinks()) {                sinksR.append(Messages.getString("MechDisplay.activeSinksTextDouble", new Object[]{new Integer(sinks), new Integer(sinks*2)}));            } else {                sinksR.append(Messages.getString("MechDisplay.activeSinksTextSingle", new Object[]{new Integer(sinks)}));            }                        boolean hasTSM = false;            boolean mtHeat = false;            if (((Mech)en).hasTSM()) hasTSM = true;            if (clientgui.getClient().game.getOptions().booleanOption("maxtech_heat")) {                mtHeat = true;            }            heatR.append(HeatEffects.getHeatEffects(en.heat, mtHeat, hasTSM));        } else {            // Non-Mechs cannot configure their heatsinks            sinks2B.setEnabled(false);        }        targSysL.setText((Messages.getString("MechDisplay.TargSysLabel")).concat(" ").concat(MiscType.getTargetSysName(en.getTargSysType())));    } // End public void displayMech( Entity )