Package megamek.common

Examples of megamek.common.MechFileParser


    public void actionPerformed(ActionEvent ev) {
        if (ev.getSource().equals(m_bOK)) {
            for (MechSummary ms : army) {
                try {
                    Entity e = new MechFileParser(ms.getSourceFile(), ms
                            .getEntryName()).getEntity();
                    Client c = null;
                    if (m_chPlayer.getSelectedIndex() > 0) {
                        String name = (String) m_chPlayer.getSelectedItem();
                        c = m_clientgui.getBots().get(name);
View Full Code Here


    public void actionPerformed(ActionEvent ev) {
        if (ev.getSource().equals(m_bOK)) {
            for (MechSummary ms : army) {
                try {
                    Entity e = new MechFileParser(ms.getSourceFile(), ms
                            .getEntryName()).getEntity();
                    Client c = null;
                    if (m_chPlayer.getSelectedIndex() > 0) {
                        String name = m_chPlayer.getSelectedItem();
                        c = m_clientgui.getBots().get(name);
View Full Code Here

        }

        ArrayList<MechSummary> vMatches = new ArrayList<MechSummary>();
        for (MechSummary ms : m_mechsCurrent) {
            try {
                Entity entity = new MechFileParser(ms.getSourceFile(), ms
                        .getEntryName()).getEntity();
                if (isMatch(entity)) {
                    vMatches.add(ms);
                }
            } catch (EntityLoadingException ex) {
View Full Code Here

            if (x == -1) {
                return;
            }
            MechSummary ms = m_mechsCurrent[m_mechList.getSelectedIndex()];
            try {
                Entity e = new MechFileParser(ms.getSourceFile(), ms
                        .getEntryName()).getEntity();
                Client c = null;
                if (m_chPlayer.getSelectedIndex() > 0) {
                    String name = (String) m_chPlayer.getSelectedItem();
                    c = m_clientgui.getBots().get(name);
                }
                if (c == null) {
                    c = m_client;
                }
                autoSetSkills(e);
                e.setOwner(c.getLocalPlayer());
                c.sendAddEntity(e);
            } catch (EntityLoadingException ex) {
                System.out
                        .println("Unable to load mech: " + ms.getSourceFile() + ": " + ms.getEntryName() + ": " + ex.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                ex.printStackTrace();
                return;
            }
            if (ae.getSource().equals(m_bPickClose)) {
                setVisible(false);
            }
        } else if (ae.getSource().equals(m_bSearch)) {
            advancedSearch();
        } else if (ae.getSource().equals(m_bReset)) {
            resetSearch();
        } else if (ae.getSource().equals(m_bToggleAdvanced)) {
            toggleAdvanced();
        } else if (ae.getSource().equals(m_bShowBV)) {
            JEditorPane tEditorPane = new JEditorPane();
            tEditorPane.setContentType("text/html");
            tEditorPane.setEditable(false);
            MechSummary ms = m_mechsCurrent[m_mechList.getSelectedIndex()];
            try {
                Entity e = new MechFileParser(ms.getSourceFile(), ms
                        .getEntryName()).getEntity();
                e.calculateBattleValue();
                tEditorPane.setText(e.getBVText());
            } catch (Exception e) {
            }
View Full Code Here

                clearMechPreview();
                return;
            }
            MechSummary ms = m_mechsCurrent[selected];
            try {
                Entity entity = new MechFileParser(ms.getSourceFile(), ms
                        .getEntryName()).getEntity();
                previewMech(entity);
            } catch (EntityLoadingException ex) {
                System.out
                        .println("Unable to load mech: " + ms.getSourceFile() + ": " + ms.getEntryName() + ": " + ex.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
View Full Code Here

        Vector<MechSummary> vMatches = new Vector<MechSummary>();
        for (int i = 0; i < m_mechsCurrent.length; i++) {
            MechSummary ms = m_mechsCurrent[i];
            try {
                Entity entity = new MechFileParser(ms.getSourceFile(), ms
                        .getEntryName()).getEntity();
                if (isMatch(entity)) {
                    vMatches.addElement(ms);
                }
            } catch (EntityLoadingException ex) {
View Full Code Here

            if (x == -1) {
                return;
            }
            MechSummary ms = m_mechsCurrent[m_mechList.getSelectedIndex()];
            try {
                Entity e = new MechFileParser(ms.getSourceFile(), ms
                        .getEntryName()).getEntity();
                Client c = null;
                if (m_chPlayer.getSelectedIndex() > 0) {
                    String name = m_chPlayer.getSelectedItem();
                    c = m_clientgui.getBots().get(name);
View Full Code Here

                clearMechPreview();
                return;
            }
            MechSummary ms = m_mechsCurrent[selected];
            try {
                Entity entity = new MechFileParser(ms.getSourceFile(), ms
                        .getEntryName()).getEntity();
                previewMech(entity);
            } catch (EntityLoadingException ex) {
                System.out
                        .println("Unable to load mech: " + ms.getSourceFile() + ": " + ms.getEntryName() + ": " + ex.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
View Full Code Here

                    System.err
                            .println(filename
                                    + " not found try using \"chassis model\" for input.");
                } else {
                    try {
                        Entity entity = new MechFileParser(ms.getSourceFile(),
                                ms.getEntryName()).getEntity();
                        System.err.println("Validating Entity: "
                                + entity.getShortNameRaw());
                        EntityVerifier entityVerifier = new EntityVerifier(
                                new File(
View Full Code Here

TOP

Related Classes of megamek.common.MechFileParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.