Example usage for javax.swing SpinnerNumberModel SpinnerNumberModel

List of usage examples for javax.swing SpinnerNumberModel SpinnerNumberModel

Introduction

In this page you can find the example usage for javax.swing SpinnerNumberModel SpinnerNumberModel.

Prototype

public SpinnerNumberModel(double value, double minimum, double maximum, double stepSize) 

Source Link

Document

Constructs a SpinnerNumberModel with the specified value, minimum/maximum bounds, and stepSize.

Usage

From source file:org.fhaes.fhsamplesize.view.FHSampleSize.java

/**
 * Initialize GUI components.//w w  w.jav  a2  s  . c om
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
private void initGUI() {

    App.init();

    // setBounds(100, 100, 972, 439);
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    setIconImage(Builder.getApplicationIcon());
    setTitle("Sample Size Analysis");
    getContentPane().setLayout(new MigLayout("", "[1136px,grow,fill]", "[30px][405px,grow]"));

    JToolBar toolBar = new JToolBar();
    toolBar.setFloatable(false);
    getContentPane().add(toolBar, "cell 0 0,growx,aligny top");

    JToolBarButton btnOpen = new JToolBarButton(actionBrowse);
    btnOpen.setIcon(Builder.getImageIcon("fileopen.png"));
    toolBar.add(btnOpen);

    JToolBarButton btnSave = new JToolBarButton(actionSaveTable);
    btnSave.setIcon(Builder.getImageIcon("save.png"));
    toolBar.add(btnSave);

    JToolBarButton btnExportPDF = new JToolBarButton(actionExportPDF);
    btnExportPDF.setIcon(Builder.getImageIcon("pdf.png"));
    toolBar.add(btnExportPDF);

    JToolBarButton btnExportPNG = new JToolBarButton(actionExportPNG);
    btnExportPNG.setIcon(Builder.getImageIcon("formatpng.png"));
    toolBar.add(btnExportPNG);

    toolBar.addSeparator();

    JToolBarButton btnRun = new JToolBarButton(actionRun);
    btnRun.setIcon(Builder.getImageIcon("run.png"));
    toolBar.add(btnRun);

    JPanel panelMain = new JPanel();
    getContentPane().add(panelMain, "cell 0 1,grow");
    panelMain.setLayout(new BorderLayout(0, 0));

    JSplitPane splitPaneMain = new JSplitPane();
    splitPaneMain.setOneTouchExpandable(true);
    panelMain.add(splitPaneMain);

    JPanel panelParameters = new JPanel();
    splitPaneMain.setLeftComponent(panelParameters);
    panelParameters.setLayout(new MigLayout("", "[grow,right]", "[][][][193.00,grow,fill][]"));

    JPanel panelInput = new JPanel();
    panelInput.setBorder(new TitledBorder(null, "Input", TitledBorder.LEADING, TitledBorder.TOP, null, null));
    panelParameters.add(panelInput, "cell 0 0,grow");
    panelInput.setLayout(new MigLayout("", "[100px:100px:180px,right][grow,fill][]", "[]"));

    JLabel lblInputFile = new JLabel("Input file:");
    panelInput.add(lblInputFile, "cell 0 0");

    txtInputFile = new JTextField();
    panelInput.add(txtInputFile, "cell 1 0,growx");
    txtInputFile.setActionCommand("NewFileTyped");
    txtInputFile.addActionListener(this);
    txtInputFile.setColumns(10);

    JButton btnBrowse = new JButton("");
    panelInput.add(btnBrowse, "cell 2 0");
    btnBrowse.setAction(actionBrowse);
    btnBrowse.setText("");
    btnBrowse.setIcon(Builder.getImageIcon("fileopen16.png"));
    btnBrowse.setPreferredSize(new Dimension(25, 25));
    btnBrowse.setMaximumSize(new Dimension(25, 25));
    btnBrowse.putClientProperty("JButton.buttonType", "segmentedTextured");
    btnBrowse.putClientProperty("JButton.segmentPosition", "middle");

    JPanel panelAnalysisOptions = new JPanel();
    panelAnalysisOptions.setBorder(new TitledBorder(null, "Analysis and filtering options",
            TitledBorder.LEADING, TitledBorder.TOP, null, null));
    panelParameters.add(panelAnalysisOptions, "cell 0 1,grow");
    panelAnalysisOptions.setLayout(new MigLayout("", "[100px:100px:180px,right][grow][][]", "[][][][][]"));

    JLabel lblEventTypes = new JLabel("Event type:");
    panelAnalysisOptions.add(lblEventTypes, "cell 0 0");

    cboEventType = new JComboBox();
    panelAnalysisOptions.add(cboEventType, "cell 1 0 3 1");
    cboEventType.setModel(new DefaultComboBoxModel(EventTypeToProcess.values()));
    new EventTypeWrapper(cboEventType, PrefKey.EVENT_TYPE_TO_PROCESS, EventTypeToProcess.FIRE_EVENT);

    chkCommonYears = new JCheckBox("<html>Only analyze years all series have in common");
    chkCommonYears.setEnabled(false);
    new CheckBoxWrapper(chkCommonYears, PrefKey.SSIZ_CHK_COMMON_YEARS, false);
    panelAnalysisOptions.add(chkCommonYears, "cell 1 1 3 1");

    chkExcludeSeriesWithNoEvents = new JCheckBox("<html>Exclude series/segments with no events");
    chkExcludeSeriesWithNoEvents.setEnabled(false);
    new CheckBoxWrapper(chkExcludeSeriesWithNoEvents, PrefKey.SSIZ_CHK_EXCLUDE_SERIES_WITH_NO_EVENTS, false);
    panelAnalysisOptions.add(chkExcludeSeriesWithNoEvents, "cell 1 2 3 1");

    JLabel lblThresholdType = new JLabel("Threshold:");
    panelAnalysisOptions.add(lblThresholdType, "cell 0 3");

    cboThresholdType = new JComboBox();
    panelAnalysisOptions.add(cboThresholdType, "cell 1 3");
    cboThresholdType.setModel(new DefaultComboBoxModel(FireFilterType.values()));
    new FireFilterTypeWrapper(cboThresholdType, PrefKey.COMPOSITE_FILTER_TYPE_WITH_ALL_TREES,
            FireFilterType.NUMBER_OF_EVENTS);

    JLabel label = new JLabel(">=");
    panelAnalysisOptions.add(label, "flowx,cell 2 3");

    spnThresholdValueGT = new JSpinner();
    panelAnalysisOptions.add(spnThresholdValueGT, "cell 3 3");
    spnThresholdValueGT.setModel(new SpinnerNumberModel(1, 1, 999, 1));
    new SpinnerWrapper(spnThresholdValueGT, PrefKey.COMPOSITE_FILTER_VALUE, 1);

    chkEnableLessThan = new JCheckBox("");
    chkEnableLessThan.setActionCommand("LessThanThresholdStatus");
    chkEnableLessThan.addActionListener(this);
    panelAnalysisOptions.add(chkEnableLessThan, "flowx,cell 1 4,alignx right");

    lblLessThan = new JLabel("<=");
    lblLessThan.setEnabled(false);
    panelAnalysisOptions.add(lblLessThan, "cell 2 4");

    spnThresholdValueLT = new JSpinner();
    spnThresholdValueLT.setEnabled(false);
    spnThresholdValueLT.setModel(new SpinnerNumberModel(1, 1, 999, 1));
    panelAnalysisOptions.add(spnThresholdValueLT, "cell 3 4");

    lblAnd = new JLabel("and");
    panelAnalysisOptions.add(lblAnd, "cell 1 4");

    JPanel panelSimulations = new JPanel();
    panelSimulations.setBorder(
            new TitledBorder(null, "Simulations", TitledBorder.LEADING, TitledBorder.TOP, null, null));
    panelParameters.add(panelSimulations, "cell 0 2,grow");
    panelSimulations.setLayout(new MigLayout("", "[100px:100px:180px,right][fill]", "[][][]"));

    JLabel lblSimulations = new JLabel("Simulations:");
    panelSimulations.add(lblSimulations, "cell 0 0");

    spnSimulations = new JSpinner();
    panelSimulations.add(spnSimulations, "cell 1 0");
    spnSimulations.setModel(new SpinnerNumberModel(new Integer(1000), new Integer(1), null, new Integer(1)));
    new SpinnerWrapper(spnSimulations, PrefKey.SSIZ_SIMULATION_COUNT, 1000);

    JLabel lblSeedNumber = new JLabel("Seed number:");
    panelSimulations.add(lblSeedNumber, "cell 0 1");

    spnSeed = new JSpinner();
    panelSimulations.add(spnSeed, "cell 1 1");
    spnSeed.setModel(new SpinnerNumberModel(new Integer(30188), null, null, new Integer(1)));
    new SpinnerWrapper(spnSeed, PrefKey.SSIZ_SEED_NUMBER, 30188);

    JLabel lblResampling = new JLabel("Resampling:");
    panelSimulations.add(lblResampling, "cell 0 2");

    cboResampling = new JComboBox();
    panelSimulations.add(cboResampling, "cell 1 2");
    cboResampling
            .setModel(new DefaultComboBoxModel(new String[] { "With replacement", "Without replacement" }));
    new ResamplingTypeWrapper(cboResampling, PrefKey.SSIZ_RESAMPLING_TYPE, ResamplingType.WITH_REPLACEMENT);

    segmentationPanel = new SegmentationPanel();
    segmentationPanel.chkSegmentation.setText("Process subset or segments of dataset?");
    segmentationPanel.chkSegmentation.setEnabled(false);
    panelParameters.add(segmentationPanel, "cell 0 3,growx");

    JPanel panel_3 = new JPanel();
    panelParameters.add(panel_3, "cell 0 4,grow");
    panel_3.setLayout(new MigLayout("", "[left][grow][right]", "[]"));

    JButton btnReset = new JButton("Reset");
    btnReset.setActionCommand("Reset");
    btnReset.addActionListener(this);
    panel_3.add(btnReset, "cell 0 0,grow");

    JButton btnRunAnalysis = new JButton("Run Analysis");
    btnRunAnalysis.setAction(actionRun);
    panel_3.add(btnRunAnalysis, "cell 2 0,grow");

    JPanel panelResults = new JPanel();
    splitPaneMain.setRightComponent(panelResults);
    panelResults.setLayout(new BorderLayout(0, 0));

    splitPaneResults = new JSplitPane();
    splitPaneResults.setResizeWeight(0.5);
    splitPaneResults.setOneTouchExpandable(true);
    splitPaneResults.setDividerLocation(0.5d);
    panelResults.add(splitPaneResults, BorderLayout.CENTER);
    splitPaneResults.setOrientation(JSplitPane.VERTICAL_SPLIT);

    JPanel panelResultsTop = new JPanel();
    splitPaneResults.setLeftComponent(panelResultsTop);
    panelResultsTop.setLayout(new BorderLayout(0, 0));

    JPanel panelChartOptions = new JPanel();
    panelChartOptions.setBackground(Color.WHITE);
    panelResultsTop.add(panelChartOptions, BorderLayout.SOUTH);
    panelChartOptions.setLayout(new MigLayout("", "[][][][][][grow][grow]", "[15px,center]"));

    JLabel lblNewLabel = new JLabel("Plot:");
    panelChartOptions.add(lblNewLabel, "cell 0 0,alignx trailing,aligny center");

    cboChartMetric = new JComboBox();
    cboChartMetric.setEnabled(false);
    cboChartMetric.setModel(new DefaultComboBoxModel(MiddleMetric.values()));
    panelChartOptions.add(cboChartMetric, "cell 1 0,growx");
    cboChartMetric.setBackground(Color.WHITE);

    JLabel lblOfSegment = new JLabel("of segment:");
    panelChartOptions.add(lblOfSegment, "cell 2 0,alignx trailing");

    cboSegment = new JComboBox();
    cboSegment.setBackground(Color.WHITE);
    cboSegment.setActionCommand("UpdateChart");
    cboSegment.addActionListener(this);

    panelChartOptions.add(cboSegment, "cell 3 0,growx");
    cboChartMetric.setActionCommand("UpdateChart");

    JLabel lblWithAsymptoteType = new JLabel("with asymptote type:");
    panelChartOptions.add(lblWithAsymptoteType, "cell 4 0,alignx trailing");

    JComboBox comboBox = new JComboBox();
    comboBox.setEnabled(false);
    comboBox.setModel(new DefaultComboBoxModel(new String[] { "none", "Weibull", "Michaelis-Menten",
            "Modified Michaelis-Menten", "Logistic", "Modified exponential" }));
    comboBox.setBackground(Color.WHITE);
    panelChartOptions.add(comboBox, "cell 5 0,growx");
    cboChartMetric.addActionListener(this);

    panelChart = new JPanel();
    panelChart.setMinimumSize(new Dimension(200, 200));
    panelResultsTop.add(panelChart, BorderLayout.CENTER);
    panelChart.setLayout(new BorderLayout(0, 0));
    panelChart.setBackground(Color.WHITE);

    JTabbedPane panelResultsBottom = new JTabbedPane(JTabbedPane.BOTTOM);
    splitPaneResults.setRightComponent(panelResultsBottom);

    simulationsTable = new SSIZResultsTable();
    simulationsTable.setEnabled(false);
    simulationsTable.addMouseListener(new TablePopClickListener());
    simulationsTable.setVisibleRowCount(10);

    adapter = new JTableSpreadsheetByRowAdapter(simulationsTable);

    scrollPaneSimulations = new JScrollPane();
    panelResultsBottom.addTab("Simulations", null, scrollPaneSimulations, null);
    scrollPaneSimulations.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    scrollPaneSimulations.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    scrollPaneSimulations.setViewportView(simulationsTable);

    JPanel panelAsymptote = new JPanel();

    asymptoteTable = new AsymptoteTable();
    asymptoteTable.setEnabled(false);
    // asymptoteTable.addMouseListener(new TablePopClickListener());
    asymptoteTable.setVisibleRowCount(10);

    scrollPaneAsymptote = new JScrollPane();

    scrollPaneAsymptote.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    scrollPaneAsymptote.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    scrollPaneAsymptote.setViewportView(asymptoteTable);
    panelAsymptote.setLayout(new BorderLayout());
    panelAsymptote.add(scrollPaneAsymptote, BorderLayout.CENTER);
    panelResultsBottom.addTab("Asymptote", null, panelAsymptote, null);

    // Disable asymptote tab until it is implemented
    panelResultsBottom.setEnabledAt(1, false);

    panelProgressBar = new JPanel();
    panelProgressBar.setLayout(new BorderLayout());

    btnCancelAnalysis = new JButton("Cancel");
    btnCancelAnalysis.setIcon(Builder.getImageIcon("delete.png"));
    btnCancelAnalysis.setVisible(false);
    btnCancelAnalysis.setActionCommand("CancelAnalysis");
    btnCancelAnalysis.addActionListener(this);

    progressBar = new JProgressBar();
    panelProgressBar.add(progressBar, BorderLayout.CENTER);
    panelProgressBar.add(btnCancelAnalysis, BorderLayout.EAST);
    progressBar.setStringPainted(true);

    fileDialogWasUsed = false;
    mouseListenersActive = false;

    this.setGUIForFHFileReader();
    this.setGUIForThresholdStatus();

    pack();
    this.setExtendedState(this.getExtendedState() | JFrame.MAXIMIZED_BOTH);
    setVisible(true);
}

From source file:ru.spbspu.viewer.DataView.java

/**
 * 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 DataView Editor.//from w  ww.j a va 2s.  c o m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    jToolBar1 = new javax.swing.JToolBar();
    fileChooser = new javax.swing.JFileChooser();
    fftOrEnSpectrum = new javax.swing.ButtonGroup();
    scaling = new javax.swing.ButtonGroup();
    transformation = new javax.swing.ButtonGroup();
    v = new javax.swing.ButtonGroup();
    jFileChooser1 = new javax.swing.JFileChooser();
    refresh = new javax.swing.JButton();
    load = new javax.swing.JButton();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    controlPanel = new javax.swing.JPanel();
    frame = new javax.swing.JLabel();
    frameWidthInSecondsTextField = new javax.swing.JTextField();
    spinnerFrameWidth = new javax.swing.JSpinner();
    jLabel3 = new javax.swing.JLabel();
    spinnerDiscretization = new javax.swing.JSpinner();
    chosenFileTextField = new javax.swing.JTextField();
    autoscale = new javax.swing.JRadioButton();
    meanValue = new javax.swing.JRadioButton();
    maxValue = new javax.swing.JRadioButton();
    spectrogramPanel = new javax.swing.JPanel();
    window = new javax.swing.JLabel();
    spinnerWindowWidth = new javax.swing.JSpinner();
    spinnerLimitFreq = new javax.swing.JSpinner();
    jLabel5 = new javax.swing.JLabel();
    sliderSpectrogram = new javax.swing.JSlider();
    jLabel1 = new javax.swing.JLabel();
    fourier = new javax.swing.JRadioButton();
    wavelet = new javax.swing.JRadioButton();
    windowFunction = new javax.swing.JComboBox<>();
    llabelWindowFunction = new javax.swing.JLabel();
    testPanel = new javax.swing.JPanel();
    FourierTest = new javax.swing.JButton();
    WaveletTest = new javax.swing.JButton();
    jButton1 = new javax.swing.JButton();
    LPF = new javax.swing.JCheckBox();
    cropBeginningLabel = new javax.swing.JLabel();
    cropBeginningTextField = new javax.swing.JTextField();
    testDataPanel = new javax.swing.JPanel();
    ampl1Input = new javax.swing.JTextField();
    ampl2Input = new javax.swing.JTextField();
    ampl3Input = new javax.swing.JTextField();
    ampl1Label = new javax.swing.JLabel();
    ampl2Label = new javax.swing.JLabel();
    ampl3Label = new javax.swing.JLabel();
    freq1Label = new javax.swing.JLabel();
    freq2Label = new javax.swing.JLabel();
    freq3Label = new javax.swing.JLabel();
    freq1Input = new javax.swing.JTextField();
    freq2Input = new javax.swing.JTextField();
    freq3Input = new javax.swing.JTextField();
    discrLabel = new javax.swing.JLabel();
    discrInput = new javax.swing.JTextField();
    lengthInput = new javax.swing.JTextField();
    lengthLabel = new javax.swing.JLabel();
    middleWindow = new javax.swing.JPanel();
    showEnergySpectrum = new javax.swing.JRadioButton();
    vAcceleration = new javax.swing.JRadioButton();
    vDisplacement = new javax.swing.JRadioButton();
    jPanel4 = new javax.swing.JPanel();
    fileLengthSec = new javax.swing.JLabel();
    stop = new javax.swing.JButton();
    play = new javax.swing.JButton();
    positionInFileSec = new javax.swing.JLabel();
    fileLengthSecTextFiled = new javax.swing.JTextField();
    positionInFileSecTextField = new javax.swing.JTextField();
    seekSlider = new javax.swing.JSlider();
    jTabbedPane2 = new javax.swing.JTabbedPane();
    jPanel3 = new javax.swing.JPanel();
    jSplitPane1 = new javax.swing.JSplitPane();
    jPanel1 = new javax.swing.JPanel();
    jSplitPane3 = new javax.swing.JSplitPane();
    contrastSpectrogram = new javax.swing.JPanel();
    energy = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    spectrogram = new javax.swing.JPanel();
    labelForFrameScale = new javax.swing.JLabel();
    labelForFrameSpectr = new javax.swing.JLabel();
    cursor = new javax.swing.JProgressBar();
    jPanel6 = new javax.swing.JPanel();
    jSplitPane2 = new javax.swing.JSplitPane();
    fullEnergy = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    fullSpectrogram = new javax.swing.JPanel();
    labelForFullSpectr = new javax.swing.JLabel();
    labelForFullScale = new javax.swing.JLabel();
    jMenuBar1 = new javax.swing.JMenuBar();
    fileMenu = new javax.swing.JMenu();
    openItem = new javax.swing.JMenuItem();
    sliderMenu = new javax.swing.JMenu();
    forward = new javax.swing.JMenuItem();
    backward = new javax.swing.JMenuItem();
    refreshItem = new javax.swing.JMenuItem();
    playItem = new javax.swing.JMenuItem();
    stopItem = new javax.swing.JMenuItem();

    jToolBar1.setRollover(true);

    fileChooser.setDialogTitle(" ");

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setLocationByPlatform(true);
    addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyPressed(java.awt.event.KeyEvent evt) {
            formKeyPressed(evt);
        }

        public void keyReleased(java.awt.event.KeyEvent evt) {
            formKeyReleased(evt);
        }
    });

    refresh.setText("");
    refresh.setEnabled(false);
    refresh.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            refreshActionPerformed(evt);
        }
    });

    load.setText("");
    load.setEnabled(false);
    load.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            loadActionPerformed(evt);
        }
    });

    jTabbedPane1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    frame.setText("?  ?");

    frameWidthInSecondsTextField.setEnabled(false);
    frameWidthInSecondsTextField.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            frameWidthInSecondsTextFieldActionPerformed(evt);
        }
    });

    spinnerFrameWidth.setModel(new javax.swing.SpinnerNumberModel(8192, 256, 262144, 512));
    spinnerFrameWidth.setEnabled(false);
    spinnerFrameWidth.setOpaque(false);
    spinnerFrameWidth.setRequestFocusEnabled(false);
    spinnerFrameWidth.setValue(32768);
    spinnerFrameWidth.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            spinnerFrameWidthStateChanged(evt);
        }
    });

    jLabel3.setLabelFor(spinnerDiscretization);
    jLabel3.setText("? ?, ");

    spinnerDiscretization.setModel(new javax.swing.SpinnerNumberModel(5000, 1, 50000, 1000));
    spinnerDiscretization.setName(""); // NOI18N

    chosenFileTextField.setEnabled(false);
    chosenFileTextField.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            chosenFileTextFieldActionPerformed(evt);
        }
    });

    scaling.add(autoscale);
    autoscale.setSelected(true);
    autoscale.setText("??  ");
    autoscale.setActionCommand("auto");
    autoscale.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            autoscaleActionPerformed(evt);
        }
    });

    scaling.add(meanValue);
    meanValue.setText("?  ?");
    meanValue.setActionCommand("mean");
    meanValue.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            meanValueActionPerformed(evt);
        }
    });

    scaling.add(maxValue);
    maxValue.setText("?  ?");
    maxValue.setActionCommand("max");
    maxValue.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            maxValueActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout controlPanelLayout = new javax.swing.GroupLayout(controlPanel);
    controlPanel.setLayout(controlPanelLayout);
    controlPanelLayout.setHorizontalGroup(controlPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(controlPanelLayout.createSequentialGroup().addContainerGap().addGroup(controlPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(controlPanelLayout.createSequentialGroup().addGroup(controlPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(frame)
                            .addGroup(controlPanelLayout.createSequentialGroup()
                                    .addComponent(spinnerFrameWidth, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18).addComponent(frameWidthInSecondsTextField,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 79,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGap(44, 44, 44)
                            .addGroup(controlPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel3).addComponent(spinnerDiscretization,
                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(10, 101, Short.MAX_VALUE))
                    .addGroup(controlPanelLayout.createSequentialGroup().addComponent(chosenFileTextField)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                    .addGroup(controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(meanValue).addComponent(autoscale).addComponent(maxValue))
                    .addGap(0, 224, Short.MAX_VALUE)));
    controlPanelLayout.setVerticalGroup(controlPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(controlPanelLayout.createSequentialGroup().addGap(2, 2, 2)
                    .addGroup(controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3).addComponent(frame).addComponent(autoscale))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(spinnerFrameWidth, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(spinnerDiscretization, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(frameWidthInSecondsTextField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(meanValue))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(maxValue).addComponent(chosenFileTextField,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jTabbedPane1.addTab("?? ", controlPanel);

    window.setLabelFor(spinnerWindowWidth);
    window.setText("");

    spinnerWindowWidth.setModel(new javax.swing.SpinnerNumberModel(128, 4, 8192, 128));
    spinnerWindowWidth.setEnabled(false);
    spinnerWindowWidth.setValue(256);

    spinnerLimitFreq.setModel(
            new SpinnerNumberModel(getSpinnerFreqLimit(), new Integer(5), new Integer(50000), new Integer(50)));
    spinnerLimitFreq.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            spinnerLimitFreqStateChanged(evt);
        }
    });

    jLabel5.setLabelFor(spinnerLimitFreq);
    jLabel5.setText("? ?");

    sliderSpectrogram.setValue(100);
    sliderSpectrogram.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            sliderSpectrogramStateChanged(evt);
        }
    });
    sliderSpectrogram.addFocusListener(new java.awt.event.FocusAdapter() {
        public void focusGained(java.awt.event.FocusEvent evt) {
            sliderSpectrogramFocusGained(evt);
        }
    });

    jLabel1.setLabelFor(sliderSpectrogram);
    jLabel1.setText("??");
    jLabel1.setToolTipText("");
    jLabel1.setName(""); // NOI18N

    transformation.add(fourier);
    fourier.setSelected(true);
    fourier.setText(" ");
    fourier.setActionCommand("fourier");

    transformation.add(wavelet);
    wavelet.setText(" ");
    wavelet.setActionCommand("wavelet");
    wavelet.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            waveletStateChanged(evt);
        }
    });

    windowFunction.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Hann", "Hamming" }));

    llabelWindowFunction.setLabelFor(windowFunction);
    llabelWindowFunction.setText("? ");

    javax.swing.GroupLayout spectrogramPanelLayout = new javax.swing.GroupLayout(spectrogramPanel);
    spectrogramPanel.setLayout(spectrogramPanelLayout);
    spectrogramPanelLayout.setHorizontalGroup(spectrogramPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(spectrogramPanelLayout.createSequentialGroup().addContainerGap()
                    .addGroup(spectrogramPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(spectrogramPanelLayout.createSequentialGroup()
                                    .addGroup(spectrogramPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(spinnerLimitFreq,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 110,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel5))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(spectrogramPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(spinnerWindowWidth,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 120,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(window))
                                    .addGap(26, 26, 26)
                                    .addGroup(spectrogramPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(wavelet).addComponent(fourier))
                                    .addGap(43, 43, 43)
                                    .addGroup(spectrogramPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                    false)
                                            .addComponent(llabelWindowFunction,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(windowFunction, 0,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                            .addGroup(spectrogramPanelLayout.createSequentialGroup().addComponent(jLabel1)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(sliderSpectrogram, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap(430, Short.MAX_VALUE)));
    spectrogramPanelLayout.setVerticalGroup(spectrogramPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(spectrogramPanelLayout.createSequentialGroup().addContainerGap()
                    .addGroup(spectrogramPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(spectrogramPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(spectrogramPanelLayout.createSequentialGroup()
                                            .addGroup(spectrogramPanelLayout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addGroup(spectrogramPanelLayout.createSequentialGroup()
                                                            .addComponent(window).addGap(5, 5, 5))
                                                    .addGroup(spectrogramPanelLayout.createSequentialGroup()
                                                            .addComponent(llabelWindowFunction).addPreferredGap(
                                                                    javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                                            .addGroup(spectrogramPanelLayout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addComponent(spinnerWindowWidth,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGroup(spectrogramPanelLayout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(wavelet).addComponent(windowFunction,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                    javax.swing.GroupLayout.PREFERRED_SIZE))))
                                    .addGroup(spectrogramPanelLayout.createSequentialGroup()
                                            .addComponent(jLabel5).addGap(5, 5, 5).addComponent(
                                                    spinnerLimitFreq, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(fourier))
                    .addGap(18, 18, 18)
                    .addGroup(spectrogramPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(spectrogramPanelLayout.createSequentialGroup().addComponent(jLabel1)
                                    .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(sliderSpectrogram, javax.swing.GroupLayout.PREFERRED_SIZE, 0,
                                    Short.MAX_VALUE))
                    .addContainerGap()));

    jTabbedPane1.addTab("?? ?", spectrogramPanel);

    FourierTest.setText("Fourire Test");
    FourierTest.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            FourierTestActionPerformed(evt);
        }
    });

    WaveletTest.setText("Wavelet Test");
    WaveletTest.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            WaveletTestActionPerformed(evt);
        }
    });

    jButton1.setText("jButton1");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });

    LPF.setText(" ?");

    cropBeginningLabel.setText(" :");

    cropBeginningTextField.setText("jTextField1");

    javax.swing.GroupLayout testPanelLayout = new javax.swing.GroupLayout(testPanel);
    testPanel.setLayout(testPanelLayout);
    testPanelLayout.setHorizontalGroup(testPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(testPanelLayout.createSequentialGroup().addContainerGap()
                    .addGroup(testPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(FourierTest).addComponent(WaveletTest))
                    .addGap(31, 31, 31)
                    .addGroup(testPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(testPanelLayout.createSequentialGroup().addGap(133, 133, 133)
                                    .addComponent(cropBeginningLabel).addGap(3, 3, 3).addComponent(
                                            cropBeginningTextField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(testPanelLayout.createSequentialGroup().addComponent(jButton1)
                                    .addGap(65, 65, 65).addComponent(LPF)))
                    .addContainerGap(609, Short.MAX_VALUE)));
    testPanelLayout.setVerticalGroup(testPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(testPanelLayout.createSequentialGroup().addContainerGap()
                    .addGroup(testPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(FourierTest).addComponent(jButton1).addComponent(LPF))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(testPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(WaveletTest).addComponent(cropBeginningLabel)
                            .addComponent(cropBeginningTextField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(21, Short.MAX_VALUE)));

    jTabbedPane1.addTab("?", testPanel);

    ampl1Input.setText("10");

    ampl2Input.setText("20");

    ampl3Input.setText("30");

    ampl1Label.setText("?.1");

    ampl2Label.setText("?.2");

    ampl3Label.setText("?.3");

    freq1Label.setText("?.1");

    freq2Label.setText("?.2");

    freq3Label.setText("?.3");

    freq1Input.setText("100");

    freq2Input.setText("200");

    freq3Input.setText("300");

    discrLabel.setText("?.");

    discrInput.setText("5000");

    lengthInput.setText("131072");

    lengthLabel.setText("");

    javax.swing.GroupLayout testDataPanelLayout = new javax.swing.GroupLayout(testDataPanel);
    testDataPanel.setLayout(testDataPanelLayout);
    testDataPanelLayout.setHorizontalGroup(testDataPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(testDataPanelLayout.createSequentialGroup().addContainerGap()
                    .addGroup(testDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(ampl1Label).addComponent(ampl2Label).addComponent(ampl3Label))
                    .addGap(34, 34, 34)
                    .addGroup(testDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(ampl1Input, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(ampl2Input, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(ampl3Input, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(26, 26, 26)
                    .addGroup(testDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(testDataPanelLayout.createSequentialGroup().addComponent(freq3Label)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(freq3Input, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(testDataPanelLayout.createSequentialGroup().addGroup(testDataPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(testDataPanelLayout.createSequentialGroup()
                                            .addComponent(freq1Label)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(freq1Input, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(36, 36, 36).addComponent(discrLabel))
                                    .addGroup(testDataPanelLayout.createSequentialGroup()
                                            .addComponent(freq2Label)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(freq2Input, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(lengthLabel)))
                                    .addGap(18, 18, 18)
                                    .addGroup(testDataPanelLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(lengthInput, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(discrInput, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addContainerGap(704, Short.MAX_VALUE)));
    testDataPanelLayout.setVerticalGroup(testDataPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(testDataPanelLayout.createSequentialGroup().addGap(6, 6, 6).addGroup(testDataPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ampl1Input, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ampl1Label).addComponent(freq1Label)
                    .addComponent(freq1Input, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(discrLabel).addComponent(discrInput, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                            testDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(ampl2Input, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(ampl2Label).addComponent(freq2Label)
                                    .addComponent(freq2Input, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lengthInput, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lengthLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                            testDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(ampl3Input, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(ampl3Label).addComponent(freq3Label).addComponent(freq3Input,
                                            javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jTabbedPane1.addTab("?", testDataPanel);

    v.add(showEnergySpectrum);
    showEnergySpectrum.setText("?");
    showEnergySpectrum.setActionCommand("energy");
    showEnergySpectrum.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            showEnergySpectrumStateChanged(evt);
        }
    });

    v.add(vAcceleration);
    vAcceleration.setText("?");
    vAcceleration.setActionCommand("accel");

    v.add(vDisplacement);
    vDisplacement.setSelected(true);
    vDisplacement.setText("?");
    vDisplacement.setActionCommand("displ");
    vDisplacement.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            vDisplacementStateChanged(evt);
        }
    });

    javax.swing.GroupLayout middleWindowLayout = new javax.swing.GroupLayout(middleWindow);
    middleWindow.setLayout(middleWindowLayout);
    middleWindowLayout.setHorizontalGroup(
            middleWindowLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(middleWindowLayout.createSequentialGroup().addContainerGap()
                            .addComponent(showEnergySpectrum)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(vDisplacement)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(vAcceleration).addContainerGap(697, Short.MAX_VALUE)));
    middleWindowLayout.setVerticalGroup(middleWindowLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(middleWindowLayout.createSequentialGroup().addContainerGap()
                    .addGroup(middleWindowLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(vDisplacement).addComponent(showEnergySpectrum)
                            .addComponent(vAcceleration))
                    .addContainerGap(67, Short.MAX_VALUE)));

    jTabbedPane1.addTab(".", middleWindow);

    jPanel4.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jPanel4.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    fileLengthSec.setLabelFor(fileLengthSecTextFiled);
    fileLengthSec.setText(" , ?");
    jPanel4.add(fileLengthSec, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 10, -1, -1));

    stop.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ru/spbspu/viewer/stop.png"))); // NOI18N
    stop.setEnabled(false);
    stop.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            stopActionPerformed(evt);
        }
    });
    jPanel4.add(stop, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 20, 29, 32));

    play.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ru/spbspu/viewer/playPause.png"))); // NOI18N
    play.setEnabled(false);
    play.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            playActionPerformed(evt);
        }
    });
    jPanel4.add(play, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 80, 29, 32));

    positionInFileSec.setLabelFor(positionInFileSecTextField);
    positionInFileSec.setText("?  , ?");
    jPanel4.add(positionInFileSec, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 70, -1, -1));

    fileLengthSecTextFiled.setEnabled(false);
    jPanel4.add(fileLengthSecTextFiled, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 30, 90, -1));

    positionInFileSecTextField.setFont(new java.awt.Font("MS Reference Sans Serif", 0, 14)); // NOI18N
    positionInFileSecTextField.setCaretColor(new java.awt.Color(240, 240, 240));
    positionInFileSecTextField.setDisabledTextColor(new java.awt.Color(255, 153, 51));
    positionInFileSecTextField.setDoubleBuffered(true);
    positionInFileSecTextField.setEnabled(false);
    positionInFileSecTextField.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            positionInFileSecTextFieldActionPerformed(evt);
        }
    });
    jPanel4.add(positionInFileSecTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 90, 90, -1));

    seekSlider.setPaintLabels(true);
    seekSlider.setValue(0);
    seekSlider.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    seekSlider.setEnabled(false);
    seekSlider.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            seekSliderStateChanged(evt);
        }
    });
    seekSlider.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyPressed(java.awt.event.KeyEvent evt) {
            seekSliderKeyPressed(evt);
        }
    });

    jSplitPane1.setDividerLocation(150);
    jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
    jSplitPane1.setPreferredSize(new java.awt.Dimension(809, 150));

    jSplitPane3.setDividerLocation(75);
    jSplitPane3.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

    contrastSpectrogram.setBackground(new java.awt.Color(204, 255, 204));
    contrastSpectrogram.setLayout(new java.awt.BorderLayout());
    jSplitPane3.setLeftComponent(contrastSpectrogram);

    energy.setBackground(new java.awt.Color(204, 255, 204));
    energy.setLayout(new java.awt.BorderLayout());
    jSplitPane3.setBottomComponent(energy);

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                    .addComponent(jSplitPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 1503, Short.MAX_VALUE)
                    .addGap(0, 0, 0)));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane3, javax.swing.GroupLayout.Alignment.TRAILING,
                    javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE));

    jSplitPane1.setTopComponent(jPanel1);

    spectrogram.setBackground(new java.awt.Color(204, 255, 204));
    spectrogram.setEnabled(false);
    spectrogram.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            spectrogramMouseClicked(evt);
        }
    });
    spectrogram.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
        public void propertyChange(java.beans.PropertyChangeEvent evt) {
            spectrogramPropertyChange(evt);
        }
    });
    spectrogram.setLayout(new java.awt.GridBagLayout());

    labelForFrameScale.setMaximumSize(new java.awt.Dimension(40, 14));
    labelForFrameScale.setMinimumSize(new java.awt.Dimension(40, 14));
    labelForFrameScale.setPreferredSize(new java.awt.Dimension(65, 14));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
    spectrogram.add(labelForFrameScale, gridBagConstraints);

    labelForFrameSpectr.setEnabled(false);
    labelForFrameSpectr.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            labelForFrameSpectrMouseClicked(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    spectrogram.add(labelForFrameSpectr, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    spectrogram.add(cursor, gridBagConstraints);

    jScrollPane1.setViewportView(spectrogram);

    jSplitPane1.setBottomComponent(jScrollPane1);

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout
            .setHorizontalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1503, Short.MAX_VALUE));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 354, Short.MAX_VALUE));

    jTabbedPane2.addTab("", jPanel3);

    jSplitPane2.setDividerLocation(200);
    jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

    fullEnergy.setLayout(new java.awt.BorderLayout());
    jSplitPane2.setLeftComponent(fullEnergy);

    fullSpectrogram.setLayout(new java.awt.BorderLayout());

    labelForFullSpectr.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            labelForFullSpectrMouseClicked(evt);
        }
    });
    fullSpectrogram.add(labelForFullSpectr, java.awt.BorderLayout.CENTER);

    labelForFullScale.setMaximumSize(new java.awt.Dimension(35, 14));
    labelForFullScale.setMinimumSize(new java.awt.Dimension(35, 14));
    labelForFullScale.setPreferredSize(new java.awt.Dimension(65, 14));
    fullSpectrogram.add(labelForFullScale, java.awt.BorderLayout.LINE_START);

    jScrollPane2.setViewportView(fullSpectrogram);

    jSplitPane2.setRightComponent(jScrollPane2);

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(jPanel6Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1503, Short.MAX_VALUE)
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSplitPane2)));
    jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 354, Short.MAX_VALUE).addGroup(jPanel6Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jSplitPane2)));

    jTabbedPane2.addTab("? ?", jPanel6);

    fileMenu.setText("");

    openItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O,
            java.awt.event.InputEvent.CTRL_MASK));
    openItem.setText("");
    openItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            openItemActionPerformed(evt);
        }
    });
    fileMenu.add(openItem);

    jMenuBar1.add(fileMenu);

    sliderMenu.setText("");
    sliderMenu.setEnabled(false);

    forward.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_RIGHT,
            java.awt.event.InputEvent.SHIFT_MASK));
    forward.setText("  ");
    forward.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            forwardActionPerformed(evt);
        }
    });
    sliderMenu.add(forward);

    backward.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_LEFT,
            java.awt.event.InputEvent.SHIFT_MASK));
    backward.setText("?  ");
    backward.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            backwardActionPerformed(evt);
        }
    });
    sliderMenu.add(backward);

    refreshItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, 0));
    refreshItem.setText("");
    refreshItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            refreshItemActionPerformed(evt);
        }
    });
    sliderMenu.add(refreshItem);

    playItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_SPACE, 0));
    playItem.setText("");
    playItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            playItemActionPerformed(evt);
        }
    });
    sliderMenu.add(playItem);

    stopItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, 0));
    stopItem.setText("");
    stopItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            stopItemActionPerformed(evt);
        }
    });
    sliderMenu.add(stopItem);

    jMenuBar1.add(sliderMenu);

    setJMenuBar(jMenuBar1);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(load, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(refresh, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 219,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0,
                                    Short.MAX_VALUE)
                            .addGap(80, 80, 80))
                    .addComponent(jTabbedPane2).addComponent(seekSlider, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))));

    layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] { load, refresh });

    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup().addGap(31, 31, 31).addComponent(load)
                                    .addGap(18, 18, 18).addComponent(refresh))
                            .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 130,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 140,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jTabbedPane2)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(seekSlider, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)));

    layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] { load, refresh });

    pack();
}

From source file:com.ciphertool.zodiacengine.gui.view.SwingUserInterface.java

private void appendMutationRateSpinner(GridBagLayout gridBagLayout, GridBagConstraints constraints,
        JPanel mainPanel) {/*from w  w w  .  j  a v  a 2 s .c om*/
    SpinnerModel mutationRateModel = new SpinnerNumberModel(mutationInitial, MUTATION_MIN, MUTATION_MAX,
            MUTATION_STEP);
    mutationRateSpinner = new JSpinner(mutationRateModel);
    JLabel mutationRateLabel = new JLabel(mutationRateText);
    mutationRateLabel.setLabelFor(mutationRateSpinner);

    constraints.weightx = LAYOUT_LABEL_WEIGHT;
    constraints.gridwidth = GridBagConstraints.RELATIVE;
    gridBagLayout.setConstraints(mutationRateLabel, constraints);
    mainPanel.add(mutationRateLabel);
    constraints.weightx = LAYOUT_INPUT_WEIGHT;
    constraints.gridwidth = GridBagConstraints.REMAINDER;
    gridBagLayout.setConstraints(mutationRateSpinner, constraints);
    mainPanel.add(mutationRateSpinner);
}

From source file:com.ciphertool.zodiacengine.gui.view.SwingUserInterface.java

private void appendMaxMutationsPerIndividualSpinner(GridBagLayout gridBagLayout, GridBagConstraints constraints,
        JPanel mainPanel) {//  w w w .ja  va 2s  . c  o  m
    SpinnerModel maxMutationsPerIndividualModel = new SpinnerNumberModel(maxMutationsPerIndividualInitial,
            MAX_MUTATION_MIN, MAX_MUTATION_MAX, MAX_MUTATION_STEP);
    maxMutationsPerIndividualSpinner = new JSpinner(maxMutationsPerIndividualModel);
    JLabel maxMutationsPerIndividualLabel = new JLabel(maxMutationsPerIndividualText);
    maxMutationsPerIndividualLabel.setLabelFor(maxMutationsPerIndividualSpinner);

    constraints.weightx = LAYOUT_LABEL_WEIGHT;
    constraints.gridwidth = GridBagConstraints.RELATIVE;
    gridBagLayout.setConstraints(maxMutationsPerIndividualLabel, constraints);
    mainPanel.add(maxMutationsPerIndividualLabel);
    constraints.weightx = LAYOUT_INPUT_WEIGHT;
    constraints.gridwidth = GridBagConstraints.REMAINDER;
    gridBagLayout.setConstraints(maxMutationsPerIndividualSpinner, constraints);
    mainPanel.add(maxMutationsPerIndividualSpinner);
}

From source file:userinterface.graph.Histogram.java

/**
 * Generates the property dialog for a Histogram. Allows the user to select either a new or an exisitng Histogram
 * to plot data on//  ww w. j  av  a2s . c  o m
 * 
 * @param defaultSeriesName
 * @param handler instance of {@link GUIGraphHandler}
 * @param minVal the min value in data cache
 * @param maxVal the max value in data cache
 * @return Either a new instance of a Histogram or an old one depending on what the user selects
 */

public static Pair<Histogram, SeriesKey> showPropertiesDialog(String defaultSeriesName, GUIGraphHandler handler,
        double minVal, double maxVal) {

    // make sure that the probabilities are valid
    if (maxVal > 1.0)
        maxVal = 1.0;
    if (minVal < 0.0)
        minVal = 0.0;

    // set properties for the dialog
    JDialog dialog = new JDialog(GUIPrism.getGUI(), "Histogram properties", true);
    dialog.setLayout(new BorderLayout());

    JPanel p1 = new JPanel(new FlowLayout());
    p1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED),
            "Number of buckets"));

    JPanel p2 = new JPanel(new FlowLayout());
    p2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED),
            "Series name"));

    JSpinner buckets = new JSpinner(new SpinnerNumberModel(10, 5, Integer.MAX_VALUE, 1));
    buckets.setToolTipText("Select the number of buckets for this Histogram");

    // provides the ability to select a new or an old histogram to plot the series on
    JTextField seriesName = new JTextField(defaultSeriesName);
    JRadioButton newSeries = new JRadioButton("New Histogram");
    JRadioButton existing = new JRadioButton("Existing Histogram");
    newSeries.setSelected(true);
    JPanel seriesSelectPanel = new JPanel();
    seriesSelectPanel.setLayout(new BoxLayout(seriesSelectPanel, BoxLayout.Y_AXIS));
    JPanel seriesTypeSelect = new JPanel(new FlowLayout());
    JPanel seriesOptionsPanel = new JPanel(new FlowLayout());
    seriesTypeSelect.add(newSeries);
    seriesTypeSelect.add(existing);
    JComboBox<String> seriesOptions = new JComboBox<>();
    seriesOptionsPanel.add(seriesOptions);
    seriesSelectPanel.add(seriesTypeSelect);
    seriesSelectPanel.add(seriesOptionsPanel);
    seriesSelectPanel.setBorder(BorderFactory
            .createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Add series to"));

    // provides ability to select the min/max range of the plot
    JLabel minValsLabel = new JLabel("Min range:");
    JSpinner minVals = new JSpinner(new SpinnerNumberModel(0.0, 0.0, minVal, 0.01));
    minVals.setToolTipText("Does not allow value more than the min value in the probabilities");
    JLabel maxValsLabel = new JLabel("Max range:");
    JSpinner maxVals = new JSpinner(new SpinnerNumberModel(1.0, maxVal, 1.0, 0.01));
    maxVals.setToolTipText("Does not allow value less than the max value in the probabilities");
    JPanel minMaxPanel = new JPanel();
    minMaxPanel.setLayout(new BoxLayout(minMaxPanel, BoxLayout.X_AXIS));
    JPanel leftValsPanel = new JPanel(new BorderLayout());
    JPanel rightValsPanel = new JPanel(new BorderLayout());
    minMaxPanel.setBorder(
            BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Range"));
    leftValsPanel.add(minValsLabel, BorderLayout.WEST);
    leftValsPanel.add(minVals, BorderLayout.CENTER);
    rightValsPanel.add(maxValsLabel, BorderLayout.WEST);
    rightValsPanel.add(maxVals, BorderLayout.CENTER);
    minMaxPanel.add(leftValsPanel);
    minMaxPanel.add(rightValsPanel);

    // fill the old histograms in the property dialog

    boolean found = false;
    for (int i = 0; i < handler.getNumModels(); i++) {

        if (handler.getModel(i) instanceof Histogram) {

            seriesOptions.addItem(handler.getGraphName(i));
            found = true;
        }

    }

    existing.setEnabled(found);
    seriesOptions.setEnabled(false);

    // the bottom panel
    JPanel options = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    JButton ok = new JButton("Plot");
    JButton cancel = new JButton("Cancel");

    // bind keyboard keys to plot and cancel buttons to improve usability

    ok.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "ok");
    ok.getActionMap().put("ok", new AbstractAction() {

        private static final long serialVersionUID = -7324877661936685228L;

        @Override
        public void actionPerformed(ActionEvent e) {

            ok.doClick();

        }
    });

    cancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
            "ok");
    cancel.getActionMap().put("ok", new AbstractAction() {

        private static final long serialVersionUID = 2642213543774356676L;

        @Override
        public void actionPerformed(ActionEvent e) {

            cancel.doClick();

        }
    });

    //Action listener for the new series radio button
    newSeries.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (newSeries.isSelected()) {

                existing.setSelected(false);
                seriesOptions.setEnabled(false);
                buckets.setEnabled(true);
                buckets.setToolTipText("Select the number of buckets for this Histogram");
                minVals.setEnabled(true);
                maxVals.setEnabled(true);
            }
        }
    });

    //Action listener for the existing series radio button
    existing.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {

            if (existing.isSelected()) {

                newSeries.setSelected(false);
                seriesOptions.setEnabled(true);
                buckets.setEnabled(false);
                minVals.setEnabled(false);
                maxVals.setEnabled(false);
                buckets.setToolTipText("Number of buckets can't be changed on an existing Histogram");
            }

        }
    });

    //Action listener for the plot button
    ok.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {

            dialog.dispose();

            if (newSeries.isSelected()) {

                hist = new Histogram();
                hist.setNumOfBuckets((int) buckets.getValue());
                hist.setIsNew(true);

            } else if (existing.isSelected()) {

                String HistName = (String) seriesOptions.getSelectedItem();
                hist = (Histogram) handler.getModel(HistName);
                hist.setIsNew(false);

            }

            key = hist.addSeries(seriesName.getText());

            if (minVals.isEnabled() && maxVals.isEnabled()) {

                hist.setMinProb((double) minVals.getValue());
                hist.setMaxProb((double) maxVals.getValue());

            }
        }
    });

    //Action listener for the cancel button
    cancel.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            dialog.dispose();
            hist = null;
        }
    });

    dialog.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosed(WindowEvent e) {

            hist = null;
        }
    });

    p1.add(buckets, BorderLayout.CENTER);

    p2.add(seriesName, BorderLayout.CENTER);

    options.add(ok);
    options.add(cancel);

    // add everything to the main panel of the dialog
    JPanel mainPanel = new JPanel();
    mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
    mainPanel.add(seriesSelectPanel);
    mainPanel.add(p1);
    mainPanel.add(p2);
    mainPanel.add(minMaxPanel);

    // add main panel to the dialog
    dialog.add(mainPanel, BorderLayout.CENTER);
    dialog.add(options, BorderLayout.SOUTH);

    // set dialog properties
    dialog.setSize(320, 290);
    dialog.setLocationRelativeTo(GUIPrism.getGUI());
    dialog.setVisible(true);

    // return the user selected Histogram with the properties set
    return new Pair<Histogram, SeriesKey>(hist, key);
}

From source file:ResultScreen.java

private void initSpinners() {
    dDSpinner.setModel(new SpinnerNumberModel(0, 0, 100000, 1));
    dHSpinner.setModel(new SpinnerNumberModel(500, 0, 100000, 1));
    pDSpinner1.setModel(new SpinnerNumberModel(0, 0, 100000, 1));
    pHSpinner1.setModel(new SpinnerNumberModel(500, 0, 100000, 1));
    dDSpinner.addChangeListener(changeDemoduladora);
    dHSpinner.addChangeListener(changeDemoduladora);
    pDSpinner1.addChangeListener(changeModuladora);
    pHSpinner1.addChangeListener(changeModuladora);
}

From source file:com.ciphertool.zodiacengine.gui.view.SwingUserInterface.java

private void appendCrossoverRateSpinner(GridBagLayout gridBagLayout, GridBagConstraints constraints,
        JPanel mainPanel) {//  w w w.j  a  v  a 2  s. c om
    SpinnerModel crossoverRateModel = new SpinnerNumberModel(crossoverInitial, CROSSOVER_MIN, CROSSOVER_MAX,
            CROSSOVER_STEP);
    crossoverRateSpinner = new JSpinner(crossoverRateModel);
    JLabel crossoverRateLabel = new JLabel(crossoverRateText);
    crossoverRateLabel.setLabelFor(crossoverRateSpinner);

    constraints.weightx = LAYOUT_LABEL_WEIGHT;
    constraints.gridwidth = GridBagConstraints.RELATIVE;
    gridBagLayout.setConstraints(crossoverRateLabel, constraints);
    mainPanel.add(crossoverRateLabel);
    constraints.weightx = LAYOUT_INPUT_WEIGHT;
    constraints.gridwidth = GridBagConstraints.REMAINDER;
    gridBagLayout.setConstraints(crossoverRateSpinner, constraints);
    mainPanel.add(crossoverRateSpinner);
}

From source file:com.vladsch.idea.multimarkdown.settings.MultiMarkdownSettingsPanel.java

private void createUIComponents() {
    // TODO: place custom component creation code here
    // create the css themes combobox, make it locale aware
    ArrayList<String> options = new ArrayList<String>(10);
    for (int i = 0;; i++) {
        String message = MultiMarkdownBundle.messageOrBlank("settings.html-theme-" + (i + 1));
        if (message.isEmpty())
            break;
        options.add(message);/*from w  w  w.  ja v a2  s .  c o  m*/
    }

    // we use the list to report but combo box if available
    htmlThemeList = new JBList(options);
    htmlThemeList.setSelectedIndex(2);

    htmlThemeComboBox = new JLabel();
    htmlThemeComboBox.setVisible(false);
    haveCustomizableEditor = false;
    try {
        htmlThemeComboBox = new ComboBox(options.toArray(new String[options.size()]));
        ((JComboBox) htmlThemeComboBox).setSelectedIndex(2);
        htmlThemeList.setVisible(false);
        haveCustomizableEditor = true;
    } catch (NoSuchMethodError e) {
        // does not exist, use list box
    } catch (NoClassDefFoundError e) {
        // does not exist, use list box
    }

    // create the CSS text edit control
    Language language = Language.findLanguageByID("CSS");
    final boolean foundCSS = language != null;

    final FileType fileType = language != null && language.getAssociatedFileType() != null
            ? language.getAssociatedFileType()
            : StdFileTypes.PLAIN_TEXT;

    // Set zoom to 0.1 increments
    final SpinnerNumberModel model = new SpinnerNumberModel(1.0, 0.2, 5.0, 0.01);
    pageZoomSpinner = new JSpinner(model);
    JSpinner.NumberEditor decimalFormat = new JSpinner.NumberEditor(pageZoomSpinner, "0.00");

    CustomizableEditorTextField.EditorCustomizationListener listener = new CustomizableEditorTextField.EditorCustomizationListener() {
        @Override
        public boolean editorCreated(@NotNull EditorEx editor, @NotNull Project project) {
            EditorSettings settings = editor.getSettings();
            settings.setRightMarginShown(true);
            //settings.setRightMargin(-1);
            if (foundCSS)
                settings.setFoldingOutlineShown(true);
            settings.setLineNumbersShown(true);
            if (foundCSS)
                settings.setLineMarkerAreaShown(true);
            settings.setIndentGuidesShown(true);
            settings.setVirtualSpace(true);

            //settings.setWheelFontChangeEnabled(false);
            editor.setHorizontalScrollbarVisible(true);
            editor.setVerticalScrollbarVisible(true);

            FileType fileTypeH = FileTypeManagerEx.getInstanceEx().getFileTypeByExtension(".css");
            FileType highlighterFileType = foundCSS ? fileType : fileTypeH;
            if (highlighterFileType != null && project != null) {
                editor.setHighlighter(HighlighterFactory.createHighlighter(project, highlighterFileType));
            }

            int lineCursorWidth = 2;
            if (haveCustomizableEditor) {
                // get the standard caret width from the registry
                try {
                    RegistryValue value = Registry.get("editor.caret.width");
                    if (value != null) {
                        lineCursorWidth = value.asInteger();
                    }
                } catch (Exception ex) {
                    // ignore
                }

                focusEditorButton
                        .setEnabled(((CustomizableEditorTextField) textCustomCss).haveSavedState(editor));
            }
            settings.setLineCursorWidth(lineCursorWidth);

            return false;
        }
    };

    if (!haveCustomizableEditor) {
        Project project = CustomizableEditorTextField.getAnyProject(null, true);
        Document document = CustomizableEditorTextField.createDocument("", fileType, project,
                new CustomizableEditorTextField.SimpleDocumentCreator());
        textCustomCss = new CustomizableLanguageEditorTextField(document, project, fileType, false, false);
        textCustomCss.setFontInheritedFromLAF(false);
        ((CustomizableLanguageEditorTextField) textCustomCss).registerListener(listener);
        //focusEditorButton.setEnabled(false);
    } else {
        // we pass a null project because we don't have one, the control will grab any project so that
        // undo works properly in the edit control.
        Project project = CustomizableEditorTextField.getAnyProject(null, true);
        textCustomCss = new CustomizableEditorTextField(fileType, project, "", false);
        textCustomCss.setFontInheritedFromLAF(false);
        ((CustomizableEditorTextField) textCustomCss).registerListener(listener);
    }
}

From source file:jchrest.gui.VisualSearchPane.java

private JPanel constructButtons() {

    Box buttons = Box.createVerticalBox();
    JSpinner numFixations = new JSpinner(new SpinnerNumberModel(20, 1, 1000, 1));

    JPanel labelledSpinner = new JPanel();
    labelledSpinner.setLayout(new GridLayout(1, 2));
    labelledSpinner.add(new JLabel("Number of fixations: "));
    labelledSpinner.add(numFixations);//  ww w. jav a2  s. c o m

    JButton recallButton = new JButton(new RecallAction(numFixations));
    recallButton.setToolTipText("Scan shown scene and display results");

    final JCheckBox showFixations = new JCheckBox("Show fixations", false);
    showFixations.setToolTipText("Show fixations for recalled scene");
    showFixations.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            _sceneDisplay.setShowFixations(showFixations.isSelected());
        }
    });

    buttons.add(Box.createRigidArea(new Dimension(0, 20)));
    buttons.add(labelledSpinner);
    buttons.add(recallButton);
    buttons.add(Box.createRigidArea(new Dimension(0, 20)));
    buttons.add(showFixations);
    buttons.add(Box.createRigidArea(new Dimension(0, 20)));

    // TODO: There must be a better solution to this problem!
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    panel.add(buttons, BorderLayout.NORTH);

    return panel;
}

From source file:jchrest.gui.VisualSearchPane.java

private JPanel analysePanel() {
    _analysisScreen = new JTextArea();

    Box buttons = Box.createVerticalBox();
    buttons.add(new JLabel("Find frequency of nodes used by model when scanning scenes"));

    JSpinner numFixations = new JSpinner(new SpinnerNumberModel(20, 1, 1000, 1));

    JPanel labelledSpinner = new JPanel();
    labelledSpinner.setLayout(new GridLayout(1, 2));
    labelledSpinner.add(new JLabel("Number of fixations: ", SwingConstants.RIGHT));
    labelledSpinner.add(numFixations);/*from   w ww  . j  av a 2  s  . c om*/

    buttons.add(labelledSpinner);
    buttons.add(runAnalysisButtons(numFixations));

    // main panel
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());

    panel.add(buttons, BorderLayout.NORTH);

    panel.add(new JScrollPane(_analysisScreen));

    Box displayButtons = Box.createHorizontalBox();
    displayButtons.add(new JButton(new SaveAction(_analysisScreen)));
    displayButtons.add(new JButton(new ClearAction(_analysisScreen)));
    panel.add(displayButtons, BorderLayout.SOUTH);

    return panel;
}