Package se.kth.speech.skatta.player

Examples of se.kth.speech.skatta.player.TestPlayer


                   testfile = autotesturl.toURI();*/
            testfile = new File("testdata/test.xml");
        }
        if (testfile != null && testfile.exists()) {
            try {
                TestPlayer player = new TestPlayer(testfile);
                player.exitOnDispose(true);
            } catch (Exception exc) {
                exc.printStackTrace();
            }
        } else {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
View Full Code Here


                CreateMenuForm cmf = new CreateMenuForm(f);
                cmf.addWindowListener(this);*/
            setVisible(false);
        } else if (e.getSource() == runButton) {

            TestPlayer player = null;
            try {
                JFileChooser theChooser1 = new JFileChooser();
                int returnVal = theChooser1.showOpenDialog(this);
                if (returnVal == JFileChooser.APPROVE_OPTION) {
                    player = new TestPlayer(theChooser1.getSelectedFile());
                    player.addWindowListener(this);
                    setVisible(false);
                }
            }
            catch (Exception ex) {
                String outMessage = ex.getMessage();
                if (ex instanceof IndexOutOfBoundsException) {
                    outMessage = "Index out of bounds exception. Check the test file. " + outMessage;
                }
                if (ex instanceof NullPointerException) {
                    outMessage = "Null pointer exception. Check the test file. " + outMessage;
                }

                if (ex instanceof org.xml.sax.SAXException) {
                    outMessage = "Reading failed: " + outMessage;
                }
                if (ex instanceof ParserConfigurationException) {
                    outMessage = "Preparing for reading failed: " + outMessage;
                }
                if (ex instanceof ClassCastException) {
                    outMessage = "Class cast failed: " + outMessage;
                }
                if (ex instanceof TestException) {
                    outMessage = "Something is wrong with the test: " + outMessage;
                }
                if (player != null) player.dispose();
                requestFocus();
                JOptionPane.showMessageDialog(this, outMessage);
            }

        } else if (e.getSource() == editButton) {
View Full Code Here

TOP

Related Classes of se.kth.speech.skatta.player.TestPlayer

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.