/*
 * This software was developed at the National Institute of Standards and
 * Technology by a guest researcher in the course of his official duties and
 * with the partial support of the Swiss National Science Foundation. Pursuant
 * to title 17 Section 105 of the United States Code this software is not
 * subject to copyright protection and is in the public domain. The
 * Instrument-Control (iC) software is an experimental system. Neither NIST, nor
 * the Swiss National Science Foundation nor any of the authors assumes any
 * responsibility whatsoever for its use by other parties, and makes no
 * guarantees, expressed or implied, about its quality, reliability, or any
 * other characteristic. We would appreciate your citation if the software
 * is used: http://dx.doi.org/10.6028/jres.117.010 .
 *
 * This software can be redistributed and/or modified freely under the terms of
 * the GNU Public Licence and provided that any derivative works bear some
 * notice that they are derived from it, and any modified versions bear some
 * notice that they have been modified.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Public License for more details. http://www.fsf.org
 *
 * This software relies on other open source projects; please see the accompanying
 * _ReadMe_iC.txt for a list of included packages. Thank's very much to those
 * developers !! Without your effort, iC would not have been possible!
 *
 */
package icontrol;

import javax.swing.JComponent;
import javax.swing.JFrame;

/**
 * Mockup View used for JUnit tests. Implements the <code>GUI_Interface</code>
 * which defines all methods that are accessed from the iC-Framework and usually
 * reside in the View class.<p>
 * 
 * It would be nicer if this class were in the test/ directory, but because the
 * <code>TestMockup</code> (which cannot be moved to the test/ directory but
 * needs to reside in the source directory; see comments there) needs to access
 * this class, it is in the source directory and not in the test directory.
 * 
 * @author KPP (Kurt Pernstich: pernstich@alumni.ethz.ch)
 * @version 0.1
 *
 */
// TODO remove JFrame?
public class GUI_InterfaceMockup extends javax.swing.JFrame 
                                implements GUI_Interface {
    
    
    
    public void DisplayStatusMessage(String StatusMessage) {
        
        // just add the text by calling the other DisplayStatusMessage method
        DisplayStatusMessage(StatusMessage, false);
    }

    public void DisplayStatusMessage(String StatusMessage, boolean AddTimeStamp) {
        
        // append the text to the text in the Status Area
        //jStatusText.append(StatusMessage);
        
        System.out.print(StatusMessage);
    }

    public String DisplayStatusLine(String StatusText, boolean FadeOut) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void DoneScripting(boolean Erroroccurred) {
        
        // just display that it's done
        DisplayStatusMessage("Done Scripting.\n");
        
        while(true){}
    }

    public String getFileName(String FileExtension) {
        return "SeqTest";
    }

    public String getProjectPath() {
        return "/Users/kurt/iC test/";
    }

    public boolean isAutoPaused() {
        return false;
    }

    public boolean isPaused(boolean WaitUntilNotPaused) {
        return false;
    }

    public JComponent getTheComponent() {
        return null;
    }

    public JFrame getTheFrame() {
        return null;
    }

    public void Pause() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void Stop() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    

    
    
    
    
    
    

    /** Creates new form GUI_InterfaceMockup */
    public GUI_InterfaceMockup() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jStatusText = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jStatusText.setColumns(20);
        jStatusText.setRows(5);
        jStatusText.setName("jStatusText"); // NOI18N
        jScrollPane1.setViewportView(jStatusText);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 360, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(143, 143, 143)
                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * Shows the Mockup View
     */
    public void Show() {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(GUI_InterfaceMockup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(GUI_InterfaceMockup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(GUI_InterfaceMockup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(GUI_InterfaceMockup.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new GUI_InterfaceMockup().setVisible(true);
            }
        });
    }
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea jStatusText;
    // End of variables declaration//GEN-END:variables

    
}
