if ( Protomech.NUM_PMECH_LOCATIONS == loc ){ sectionLabels[Protomech.NUM_PMECH_LOCATIONS - 1].setVisible(true); armorLabels[Protomech.NUM_PMECH_LOCATIONS - 1].setVisible(true); internalLabels[Protomech.NUM_PMECH_LOCATIONS - 1].setVisible(true); } else{ sectionLabels[Protomech.NUM_PMECH_LOCATIONS - 1].setVisible(false); armorLabels[Protomech.NUM_PMECH_LOCATIONS - 1].setVisible(false); internalLabels[Protomech.NUM_PMECH_LOCATIONS - 1].setVisible(false);
if (loc!=Protomech.NUM_PMECH_LOCATIONS) { armorLabels[5].setVisible(false); internalLabels[5].setVisible(false); sectionLabels[5].setVisible(false); } else { armorLabels[5].setVisible(true); internalLabels[5].setVisible(true); sectionLabels[5].setVisible(true);
    public void setEntity(Entity entity){        Protomech proto = (Protomech) entity;        int armor = 0;        int internal =0;        int loc = proto.locations();        // Not all Protomechs have a Main Gun.        if ( Protomech.NUM_PMECH_LOCATIONS == loc ){            sectionLabels[Protomech.NUM_PMECH_LOCATIONS - 1].setVisible(true);            armorLabels[Protomech.NUM_PMECH_LOCATIONS - 1].setVisible(true);            internalLabels[Protomech.NUM_PMECH_LOCATIONS - 1].setVisible(true);        } else{            sectionLabels[Protomech.NUM_PMECH_LOCATIONS - 1].setVisible(false);            armorLabels[Protomech.NUM_PMECH_LOCATIONS - 1].setVisible(false);            internalLabels[Protomech.NUM_PMECH_LOCATIONS - 1].setVisible(false);        }        // Set the armor and internal labels for each of the sections.        for ( int i = 0; i < loc ; i++ ) {            // Handle ARMOR_NA, ARMOR_DOOMED< and ARMOR_DESTROYED.            armor = proto.getArmor(i, false);            if ( armor < 0 ) {                armor = 0;            }                internal = proto.getInternal(i);            if ( internal < 0 ) {                internal = 0;            }            // Now set the labels.            sectionLabels[i].setValue( proto.getLocationName(i) );            armorLabels[i].setValue( Integer.toString(armor) );                if ( armor + internal == 0 ) {                    internalLabels[i].setValue( Messages.getString("ProtomechMapSet.Destroyed") ); //$NON-NLS-1$                } else {                    internalLabels[i].setValue( Integer.toString(internal) );                }        } // Handle the next location.    }