strobe.spectroscopy.StrobeSpectroscopy.java Source code

Java tutorial

Introduction

Here is the source code for strobe.spectroscopy.StrobeSpectroscopy.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package strobe.spectroscopy;

import gnu.io.CommPortIdentifier;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.ValueMarker;
import org.jfree.data.general.DatasetChangeEvent;
import strobe.controller.Speed;
import strobe.controller.Stepper;
import strobe.data.Data;
import strobe.utils.DataUtils;
import strobe.utils.fileFilter;

import java.awt.*;
import java.io.File;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Enumeration;
import javax.swing.*;
import javax.swing.filechooser.FileFilter;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
import org.jfree.data.xy.XYDataset;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;

/**
 *
 * @author 
 */
public class StrobeSpectroscopy extends javax.swing.JFrame {
    //Buffer collection for data
    //    private ArrayList<Data> dataList = new ArrayList<>();

    //Date
    private final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
    private final LocalDateTime now = LocalDateTime.now();

    // FreeChart objects
    private final XYSeries dataGraphList = new XYSeries("");
    private final XYSeriesCollection dataSet = new XYSeriesCollection();
    private final XYLineAndShapeRenderer chartRenderer = new XYLineAndShapeRenderer();

    private final JFreeChart graphChart = ChartFactory.createXYLineChart(dtf.format(now), "Wavelength",
            "Signal intensity", setData(), PlotOrientation.VERTICAL, true, true, false);
    private ChartPanel chartPanel = new ChartPanel(graphChart);
    private ValueMarker marker = new ValueMarker(0);
    private final XYPlot plot = graphChart.getXYPlot();

    //Stepper drive instances
    private Stepper stepper = new Stepper(this::updateNewData);

    //Constants and UI labels
    private static final String TXT_NM_SPEED = " nm/s";
    private static final String OPTION_PANE_TEXT = "Close window to photomultiplier and press OK, then you can open the window";
    private static String[] boxSpeedItems = { "Slow", "Medium", "Fast" };
    private static String[] boxResolutionItems = { "0.2 nm", "0.5 nm", "1.0 nm", "2.0 nm", "5.0 nm" };
    private static double darkCurrent = 0;

    //Boolean flags
    private static boolean IS_START_PRESSED = false;
    private static boolean IS_PAUSE_PRESSED = false;

    public StrobeSpectroscopy() {
        initComponents();
        setFileFilter();
        comboBoxSettings();
    }

    /**
     * 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() {
        //        initListOfCOMports();
        stepper.initSerial();

        fileChooser = new javax.swing.JFileChooser();
        graphPanel = new javax.swing.JPanel();
        controlPanel = new javax.swing.JPanel();
        btnStart = new javax.swing.JButton();
        btnPause = new javax.swing.JButton();
        btnStop = new javax.swing.JButton();
        spr1 = new javax.swing.JSeparator();
        tbtnBackward = new javax.swing.JToggleButton();
        tbtnForward = new javax.swing.JToggleButton();
        spr2 = new javax.swing.JSeparator();
        jPanel1 = new javax.swing.JPanel();
        cBoxSpeed = new javax.swing.JComboBox<>();
        spr4 = new javax.swing.JSeparator();
        cBoxResolution = new javax.swing.JComboBox<>();
        spr3 = new javax.swing.JSeparator();
        cBoxFromWavelength = new javax.swing.JComboBox<>();
        cBoxToWavelength = new javax.swing.JComboBox<>();
        spr5 = new javax.swing.JSeparator();
        btnSetZero = new javax.swing.JButton();
        btnSetMark = new javax.swing.JButton();
        strobeMenuBar = new javax.swing.JMenuBar();
        menuFile = new javax.swing.JMenu();
        menuFileOpen = new javax.swing.JMenuItem();
        menuFileSave = new javax.swing.JMenuItem();
        menuFileExit = new javax.swing.JMenuItem();
        settingMenu = new javax.swing.JMenu();
        menuAbout = new javax.swing.JMenu();
        menuAboutAbout = new javax.swing.JMenuItem();

        fileChooser.setAcceptAllFileFilterUsed(false);

        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setTitle("Strobe-spectroscopy");
        setIconImage(new javax.swing.ImageIcon(getClass().getResource("/icons/iconFrame.png")).getImage());
        setLocationByPlatform(true);
        setMinimumSize(new java.awt.Dimension(800, 550));
        setName("strobeFrame"); // NOI18N
        setPreferredSize(new java.awt.Dimension(800, 550));

        controlPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204)));
        controlPanel.setLayout(new javax.swing.BoxLayout(controlPanel, javax.swing.BoxLayout.X_AXIS));

        btnStart.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/iconStart.png"))); // NOI18N
        btnStart.setToolTipText("Start measurement");
        btnStart.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnStartActionPerformed(evt);
            }
        });
        controlPanel.add(btnStart);

        btnPause.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/iconPause.png"))); // NOI18N
        btnPause.setToolTipText("Pause measurement");
        btnPause.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPauseActionPerformed(evt);
            }
        });
        controlPanel.add(btnPause);

        btnStop.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/iconStop.png"))); // NOI18N
        btnStop.setToolTipText("Stop measurement");
        btnStop.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnStopActionPerformed(evt);
            }
        });
        controlPanel.add(btnStop);

        spr1.setForeground(new java.awt.Color(255, 255, 255));
        spr1.setOrientation(javax.swing.SwingConstants.VERTICAL);
        spr1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        spr1.setMaximumSize(new java.awt.Dimension(5, 0));
        spr1.setPreferredSize(new java.awt.Dimension(5, 0));
        spr1.setRequestFocusEnabled(false);
        controlPanel.add(spr1);
        spr1.getAccessibleContext().setAccessibleDescription("");

        tbtnBackward.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/iconBackward.png"))); // NOI18N
        tbtnBackward.setToolTipText("Backwar spinning of the driver, while pressed.");
        tbtnBackward.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tbtnBackwardActionPerformed(evt);
            }
        });
        controlPanel.add(tbtnBackward);

        tbtnForward.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/iconForward.png"))); // NOI18N
        tbtnForward.setToolTipText("Forward spinning of the drive, while pressed.");
        tbtnForward.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tbtnForwardActionPerformed(evt);
            }
        });
        controlPanel.add(tbtnForward);

        spr2.setForeground(new java.awt.Color(255, 255, 255));
        spr2.setOrientation(javax.swing.SwingConstants.VERTICAL);
        spr2.setAlignmentX(1.0F);
        spr2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        spr2.setMaximumSize(new java.awt.Dimension(5, 0));
        spr2.setPreferredSize(new java.awt.Dimension(5, 0));
        spr2.setRequestFocusEnabled(false);
        controlPanel.add(spr2);

        jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.LINE_AXIS));

        cBoxSpeed.setToolTipText("");
        cBoxSpeed.setMinimumSize(new java.awt.Dimension(50, 20));
        cBoxSpeed.setPreferredSize(new java.awt.Dimension(50, 20));
        jPanel1.add(cBoxSpeed);

        spr4.setForeground(new java.awt.Color(255, 255, 255));
        spr4.setOrientation(javax.swing.SwingConstants.VERTICAL);
        spr4.setAlignmentX(1.0F);
        spr4.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        spr4.setMaximumSize(new java.awt.Dimension(5, 0));
        spr4.setPreferredSize(new java.awt.Dimension(5, 0));
        spr4.setRequestFocusEnabled(false);
        jPanel1.add(spr4);

        cBoxResolution.setAutoscrolls(true);
        cBoxResolution.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        cBoxResolution.setMinimumSize(new java.awt.Dimension(50, 20));
        cBoxResolution.setPreferredSize(new java.awt.Dimension(50, 20));
        cBoxResolution.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cBoxResolutionActionPerformed(evt);
            }
        });
        jPanel1.add(cBoxResolution);

        controlPanel.add(jPanel1);

        spr3.setForeground(new java.awt.Color(255, 255, 255));
        spr3.setOrientation(javax.swing.SwingConstants.VERTICAL);
        spr3.setAlignmentX(1.0F);
        spr3.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        spr3.setMaximumSize(new java.awt.Dimension(5, 0));
        spr3.setPreferredSize(new java.awt.Dimension(5, 0));
        spr3.setRequestFocusEnabled(false);
        controlPanel.add(spr3);

        cBoxFromWavelength.setEditable(true);
        cBoxFromWavelength.setAutoscrolls(true);
        controlPanel.add(cBoxFromWavelength);

        cBoxToWavelength.setEditable(true);
        cBoxToWavelength.setAutoscrolls(true);
        cBoxToWavelength.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cBoxToWavelengthActionPerformed(evt);
            }
        });
        controlPanel.add(cBoxToWavelength);

        spr5.setForeground(new java.awt.Color(255, 255, 255));
        spr5.setOrientation(javax.swing.SwingConstants.VERTICAL);
        spr5.setAlignmentX(1.0F);
        spr5.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        spr5.setMaximumSize(new java.awt.Dimension(5, 0));
        spr5.setPreferredSize(new java.awt.Dimension(5, 0));
        spr5.setRequestFocusEnabled(false);
        controlPanel.add(spr5);

        btnSetZero.setText("Set zero");
        btnSetZero.setToolTipText("Set zero imput signal level to subtract thermal noise");
        btnSetZero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSetZeroActionPerformed(evt);
            }
        });
        controlPanel.add(btnSetZero);

        btnSetMark.setText("Mark");
        btnSetMark.setToolTipText("Set a mark on the input graph");
        btnSetMark.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSetMarkActionPerformed(evt);
            }
        });
        controlPanel.add(btnSetMark);

        getContentPane().add(controlPanel, java.awt.BorderLayout.SOUTH);

        menuFile.setText("File");
        menuFile.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuFileActionPerformed(evt);
            }
        });

        menuFileOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O,
                java.awt.event.InputEvent.CTRL_MASK));
        menuFileOpen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/open.png"))); // NOI18N
        menuFileOpen.setText("Open");
        menuFileOpen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuFileOpenActionPerformed(evt);
            }
        });
        menuFile.add(menuFileOpen);

        menuFileSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S,
                java.awt.event.InputEvent.CTRL_MASK));
        menuFileSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/save.png"))); // NOI18N
        menuFileSave.setText("Save");
        menuFileSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuFileSaveActionPerformed(evt);
            }
        });
        menuFile.add(menuFileSave);

        menuFileExit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W,
                java.awt.event.InputEvent.CTRL_MASK));
        menuFileExit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/close.png"))); // NOI18N
        menuFileExit.setText("Exit");
        menuFileExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuFileExitActionPerformed(evt);
            }
        });
        menuFile.add(menuFileExit);

        strobeMenuBar.add(menuFile);

        settingMenu.setText("Settings");
        strobeMenuBar.add(settingMenu);

        menuAbout.setText("About");

        menuAboutAbout.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/info.png"))); // NOI18N
        menuAboutAbout.setText("About");
        menuAboutAbout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuAboutAboutActionPerformed(evt);
            }
        });
        menuAbout.add(menuAboutAbout);

        //chartPanel.setPreferredSize( new java.awt.Dimension(graphPanel.getMinimumSize()));

        chartPanel.setMaximumSize(new Dimension(3000, 2000));
        graphPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Spectrum"));

        graphPanel.add(chartPanel);
        graphPanel.setLayout(new GridLayout(0, 1));
        getContentPane().add(graphPanel, java.awt.BorderLayout.CENTER);

        chartRenderer.setSeriesPaint(0, Color.RED);
        chartRenderer.setSeriesStroke(0, new BasicStroke(2.0f));
        plot.setRenderer(chartRenderer);
        plot.datasetChanged(new DatasetChangeEvent(graphChart, dataSet));
        marker.setPaint(Color.red);
        plot.addDomainMarker(marker);

        strobeMenuBar.add(menuAbout);

        setJMenuBar(strobeMenuBar);

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

    private void menuAboutAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuAboutAboutActionPerformed
        JOptionPane.showMessageDialog(this,
                "Developed by" + "\n" + "\n" + "Davyd Tabaka and Oleh Kravets" + "\n" + "\n" + "POWERED BY JAVA",
                "About", 3);
    }//GEN-LAST:event_menuAboutAboutActionPerformed

    private void menuFileExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuFileExitActionPerformed
        System.exit(0);
    }//GEN-LAST:event_menuFileExitActionPerformed

    private void btnStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStartActionPerformed
        dataGraphList.clear();
        IS_PAUSE_PRESSED = false;
        IS_START_PRESSED = true;
        stepper.moveStepperToPosAndMeasure(1024, stepper.getSpeed(Speed.MEDIUM), 64);
    }//GEN-LAST:vent_btnStartActionPerformed

    private void menuFileOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuFileOpenActionPerformed
        int result = fileChooser.showOpenDialog(this);

        if (result == JFileChooser.APPROVE_OPTION) {
            File f = fileChooser.getSelectedFile();
            dataGraphList.clear();
            dataGraphList.setKey(f.getName());
            DataUtils.readData(dataGraphList, f.getPath());
        }
    }//GEN-LAST:event_menuFileOpenActionPerformed

    private void btnPauseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPauseActionPerformed
        IS_START_PRESSED = false;
        IS_PAUSE_PRESSED = true;
    }//GEN-LAST:event_btnPauseActionPerformed

    private void btnStopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStopActionPerformed
        IS_PAUSE_PRESSED = false;
        IS_START_PRESSED = false;
        stepper.stopStepper();
    }//GEN-LAST:event_btnStopActionPerformed

    private void tbtnBackwardActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbtnBackwardActionPerformed
        if (tbtnForward.isSelected()) {
            tbtnForward.setSelected(false);
        }
        stepper.moveStepperToPos(0, stepper.getSpeed(getSpeedValue()));
    }//GEN-LAST:event_tbtnBackwardActionPerformed

    private void tbtnForwardActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbtnForwardActionPerformed
        if (tbtnBackward.isSelected()) {
            tbtnBackward.setSelected(false);
        }
        stepper.moveStepperToPos(1024, stepper.getSpeed(getSpeedValue()));
    }//GEN-LAST:event_tbtnForwardActionPerformed

    private void btnSetZeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSetZeroActionPerformed
        int result = JOptionPane.showConfirmDialog(this, OPTION_PANE_TEXT, btnSetZero.getText(),
                JOptionPane.OK_CANCEL_OPTION);

        if (result == JOptionPane.OK_OPTION) {
            //Get a noise current level and assign it to darkCurrent variable
            return;
        }
    }//GEN-LAST:event_btnSetZeroActionPerformed

    private void btnSetMarkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSetMarkActionPerformed

    }//GEN-LAST:event_btnSetMarkActionPerformed

    private void menuFileSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuFileSaveActionPerformed
        int result = fileChooser.showSaveDialog(this);

        if (result == JFileChooser.APPROVE_OPTION) {
            File selectedFile = fileChooser.getSelectedFile();
            if (selectedFile.exists()) {
                int resultOverride = JOptionPane.showConfirmDialog(this, "File is already exists.", "Rewrite file?",
                        JOptionPane.YES_NO_CANCEL_OPTION);

                switch (resultOverride) {
                case JOptionPane.NO_OPTION:
                    menuFileSaveActionPerformed(evt);
                    return;
                case JOptionPane.CANCEL_OPTION:
                    fileChooser.cancelSelection();
                    return;
                }

                fileChooser.approveSelection();
            }
            String name = selectedFile.getName();

            String fileNameForSave = (name.contains(".txt") ? selectedFile.getPath()
                    : selectedFile.getPath() + ".txt");

            if (!dataGraphList.isEmpty()) {
                DataUtils.writeData(dataGraphList, fileNameForSave);
            } else {
                JOptionPane.showMessageDialog(this, "No data to write!");
                fileChooser.cancelSelection();
            }
        }
        dataGraphList.clear();
    }//GEN-LAST:event_menuFileSaveActionPerformed

    private void menuFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuFileActionPerformed
        dataGraphList.clear();
    }//GEN-LAST:event_menuFileActionPerformed

    private void cBoxResolutionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cBoxResolutionActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_cBoxResolutionActionPerformed

    private void cBoxToWavelengthActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cBoxToWavelengthActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_cBoxToWavelengthActionPerformed

    private void setFileFilter() {
        FileFilter[] listOfFilters = fileChooser.getChoosableFileFilters();
        for (int i = 0; i < listOfFilters.length; i++) {
            fileChooser.removeChoosableFileFilter(listOfFilters[i]);
        }
        fileChooser.addChoosableFileFilter(new fileFilter("txt"));
    }

    private void comboBoxSettings() {
        for (int i = 0; i < 1 + ((900 - 300) / 10); i++) {
            cBoxFromWavelength.addItem(300 + 10 * i + " nm");
        }
        for (int i = 0; i < 1 + ((900 - 300) / 10); i++) {
            cBoxToWavelength.addItem(300 + 10 * i + " nm");
        }
        cBoxToWavelength.setSelectedItem("900 nm");

        for (String value : boxSpeedItems) {
            cBoxSpeed.addItem(value);
        }
        for (String value : boxResolutionItems) {
            cBoxResolution.addItem(value);
        }
        cBoxSpeed.setSelectedIndex(1);
        cBoxResolution.setSelectedIndex(2);
        cBoxFromWavelength.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
    }

    private double getResolutionValue() {
        switch (cBoxResolution.getSelectedIndex()) {
        case 0:
            return 0.2;
        case 1:
            return 0.5;
        case 2:
            return 1.0;
        case 3:
            return 2.0;
        case 4:
            return 5.0;
        }
        return 0;
    }

    private Speed getSpeedValue() {
        switch (cBoxSpeed.getSelectedIndex()) {
        case 0:
            return Speed.LOW;
        case 1:
            return Speed.MEDIUM;
        case 2:
            return Speed.FAST;
        }
        return Speed.MEDIUM;
    }

    private double getFromWavelengthValue() {
        String res = (String) cBoxFromWavelength.getModel().getSelectedItem();
        res = res.substring(0, res.indexOf(" "));
        return Integer.parseInt(res);
    }

    private double getToWavelengthValue() {
        String res = (String) cBoxToWavelength.getModel().getSelectedItem();
        res = res.substring(0, res.indexOf(" "));
        return Integer.parseInt(res);
    }

    private void addData(Data data) {
        dataGraphList.add(data.getWavelength(), data.getIntensity() - darkCurrent);
    }

    private XYDataset setData() {
        dataSet.addSeries(dataGraphList);
        return dataSet;
    }

    public void updateNewData(double wave, double intensity) {
        marker.setValue(wave);
        dataGraphList.add(wave, intensity);
    }

    private void initListOfCOMports() {
        Enumeration listOfComPorts = CommPortIdentifier.getPortIdentifiers();
        while (listOfComPorts.hasMoreElements()) {
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* 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 {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(StrobeSpectroscopy.class.getName())
                    .log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(StrobeSpectroscopy.class.getName())
                    .log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(StrobeSpectroscopy.class.getName())
                    .log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(StrobeSpectroscopy.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 StrobeSpectroscopy().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnPause;
    private javax.swing.JButton btnSetMark;
    private javax.swing.JButton btnSetZero;
    private javax.swing.JButton btnStart;
    private javax.swing.JButton btnStop;
    private javax.swing.JComboBox<String> cBoxFromWavelength;
    private javax.swing.JComboBox<String> cBoxResolution;
    private javax.swing.JComboBox<String> cBoxSpeed;
    private javax.swing.JComboBox<String> cBoxToWavelength;
    private javax.swing.JPanel controlPanel;
    private javax.swing.JFileChooser fileChooser;
    private javax.swing.JPanel graphPanel;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JMenu menuAbout;
    private javax.swing.JMenuItem menuAboutAbout;
    private javax.swing.JMenu menuFile;
    private javax.swing.JMenuItem menuFileExit;
    private javax.swing.JMenuItem menuFileOpen;
    private javax.swing.JMenuItem menuFileSave;
    private javax.swing.JMenu settingMenu;
    private javax.swing.JSeparator spr1;
    private javax.swing.JSeparator spr2;
    private javax.swing.JSeparator spr3;
    private javax.swing.JSeparator spr4;
    private javax.swing.JSeparator spr5;
    private javax.swing.JMenuBar strobeMenuBar;
    private javax.swing.JToggleButton tbtnBackward;
    private javax.swing.JToggleButton tbtnForward;
    // End of variables declaration//GEN-END:variables
}