/* * Created on February 11, 2007 * * Copyright (c) 2007 Jens Gulden * * http://www.frinika.com * * This file is part of Frinika. * * Frinika is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * Frinika is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with Frinika; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package com.frinika.sequencer.gui.menu.midi; import javax.swing.JPanel; /** * GUI-component for setting options of a MidiTimeStretchAction. * * (Created with NetBeans 5.5 gui-editor, see corresponding .form file.) * * @see MidiTimeStretchAction * @author Jens Gulden */ public class MidiTimeStretchActionEditor extends JPanel { private MidiTimeStretchAction action; /** * Creates new form MidiTimeStretchActionEditor */ public MidiTimeStretchActionEditor(MidiTimeStretchAction action) { this.action = action; initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; jLabel1 = new javax.swing.JLabel(); fSpinner = new javax.swing.JSpinner(); jPanel1 = new javax.swing.JPanel(); startsCheckBox = new javax.swing.JCheckBox(); durationsCheckBox = new javax.swing.JCheckBox(); setLayout(new java.awt.GridBagLayout()); jLabel1.setText("Accelerate / slow down by"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3); add(jLabel1, gridBagConstraints); fSpinner.setModel(new javax.swing.SpinnerNumberModel(action.f, 0.1, 100.0, 0.1)); fSpinner.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { fSpinnerStateChanged(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3); add(fSpinner, gridBagConstraints); jPanel1.setLayout(new java.awt.GridBagLayout()); startsCheckBox.setSelected(action.starts); startsCheckBox.setText("Starting times"); startsCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); startsCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); startsCheckBox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { startsCheckBoxStateChanged(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(2, 0, 0, 10); jPanel1.add(startsCheckBox, gridBagConstraints); durationsCheckBox.setSelected(action.durations); durationsCheckBox.setText("Durations"); durationsCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); durationsCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); durationsCheckBox.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { durationsCheckBoxStateChanged(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.insets = new java.awt.Insets(2, 0, 0, 10); jPanel1.add(durationsCheckBox, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3); add(jPanel1, gridBagConstraints); }// </editor-fold>//GEN-END:initComponents private void fSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fSpinnerStateChanged action.f = (Double)fSpinner.getValue(); }//GEN-LAST:event_fSpinnerStateChanged private void startsCheckBoxStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_startsCheckBoxStateChanged action.durations = startsCheckBox.isSelected(); }//GEN-LAST:event_startsCheckBoxStateChanged private void durationsCheckBoxStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_durationsCheckBoxStateChanged action.durations = durationsCheckBox.isSelected(); }//GEN-LAST:event_durationsCheckBoxStateChanged // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JCheckBox durationsCheckBox; private javax.swing.JSpinner fSpinner; private javax.swing.JLabel jLabel1; private javax.swing.JPanel jPanel1; private javax.swing.JCheckBox startsCheckBox; // End of variables declaration//GEN-END:variables }