Enumeration equip = entity.getMisc(); while ( equip.hasMoreElements() ) { Mounted mount = (Mounted) equip.nextElement();
for(Mounted mount : entity.getMisc()){
    public TriggerAPPodDialog( Frame parent, Entity entity ) {        super(parent, Messages.getString("TriggerAPPodDialog.title"), true); //$NON-NLS-1$        this.entityId = entity.getId();        labMessage = new AdvancedLabel(Messages.getString("TriggerAPPodDialog.selectPodsToTrigger",new Object[]{entity.getDisplayName()})); //$NON-NLS-1$         // AP Pod checkbox panel.        Panel panPods = new Panel();        panPods.setLayout( new GridLayout(0, 1) );        // Walk through the entity's misc equipment, looking for AP Pods.        Enumeration equip = entity.getMisc();        while ( equip.hasMoreElements() ) {            Mounted mount = (Mounted) equip.nextElement();            // Is this an AP Pod?            if ( mount.getType().hasFlag( MiscType.F_AP_POD ) ) {                // Create a checkbox for the pod, and add it to the panel.                StringBuffer message = new StringBuffer();                message.append( entity.getLocationName(mount.getLocation()) )                    .append( " " ) //$NON-NLS-1$                    .append( mount.getName() );                Checkbox pod = new Checkbox( message.toString() );                panPods.add( pod );                // Can the entity fire the pod?                if (mount.canFire()) {                    // Yup.  Add a traker for this pod.                    TriggerPodTracker tracker = new TriggerPodTracker                        ( pod, entity.getEquipmentNum( mount ) );                    trackers.addElement( tracker );                }                else {                    // Nope.  Disable the checkbox.                    pod.setEnabled( false );                }                            } // End found-AP-Pod        } // Look at the next piece of equipment.        // OK button.        butOkay.addActionListener(this);                // layout        GridBagLayout gridbag = new GridBagLayout();        GridBagConstraints c = new GridBagConstraints();        setLayout(gridbag);                    c.fill = GridBagConstraints.BOTH;        c.insets = new Insets(10, 10, 10, 10);        c.weightx = 1.0;    c.weighty = 0.0;        c.gridwidth = GridBagConstraints.REMAINDER;        gridbag.setConstraints(labMessage, c);        add(labMessage);                    gridbag.setConstraints(panPods, c);        add(panPods);        c.weightx = 1.0;    c.weighty = 1.0;        c.fill = GridBagConstraints.VERTICAL;        c.ipadx = 20;    c.ipady = 5;        gridbag.setConstraints(butOkay, c);        add(butOkay);                addWindowListener(new WindowAdapter() {        public void windowClosing(WindowEvent e) { setVisible(false); }    });                pack();        Dimension size = getSize();        boolean updateSize = false;        if ( size.width < GUIPreferences.getInstance().getMinimumSizeWidth()) {            size.width = GUIPreferences.getInstance().getMinimumSizeWidth();        }        if ( size.height < GUIPreferences.getInstance().getMinimumSizeHeight() ) {            size.height = GUIPreferences.getInstance().getMinimumSizeHeight();        }        if ( updateSize ) {            setSize( size );            size = getSize();        }        setResizable(false);        setLocation(parent.getLocation().x + parent.getSize().width/2 - size.width/2,                    parent.getLocation().y + parent.getSize().height/2 - size.height/2);    }