All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.freedomotic.plugins.gui.ClockForm Maven / Gradle / Ivy

The newest version!
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.freedomotic.plugins.gui;

import com.freedomotic.plugins.Scheduler;

/**
 *
 * @author Enrico
 */
public class ClockForm
        extends javax.swing.JFrame {

    private Scheduler plugin;

    /**
     * Creates new form ClockForm
     * @param plugin
     */
    public ClockForm(Scheduler plugin) {
        this.plugin = plugin;
        initComponents();
        spnResolution.setValue(plugin.getResolution());
    }

    /**
     * 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")
    // //GEN-BEGIN:initComponents
    private void initComponents(  )
    {
        jLabel1 = new javax.swing.JLabel(  );
        spnResolution = new javax.swing.JSpinner(  );

        setDefaultCloseOperation( javax.swing.WindowConstants.DISPOSE_ON_CLOSE );

        jLabel1.setText( "Timer Resolution (millisec):" );

        spnResolution.addChangeListener( new javax.swing.event.ChangeListener(  )
            {
                public void stateChanged( javax.swing.event.ChangeEvent evt )
                {
                    spnResolutionStateChanged( evt );
                }
            } );

        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(  )
                                                          .addComponent( jLabel1 )
                                                          .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED )
                                                          .addComponent( spnResolution,
                                                                         javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                         javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                         javax.swing.GroupLayout.PREFERRED_SIZE )
                                                          .addContainerGap( 231, Short.MAX_VALUE ) ) );
        layout.setVerticalGroup( layout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING )
                                       .addGroup( layout.createSequentialGroup(  ).addContainerGap(  )
                                                        .addGroup( layout.createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE )
                                                                         .addComponent( jLabel1 )
                                                                         .addComponent( spnResolution,
                                                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                        javax.swing.GroupLayout.PREFERRED_SIZE ) )
                                                        .addContainerGap( 269, Short.MAX_VALUE ) ) );

        pack(  );
    } // //GEN-END:initComponents

    private void spnResolutionStateChanged(javax.swing.event.ChangeEvent evt)    {//GEN-FIRST:event_spnResolutionStateChanged
        plugin.setResolution((Integer) spnResolution.getValue());
    }//GEN-LAST:event_spnResolutionStateChanged
      // Variables declaration - do not modify//GEN-BEGIN:variables

    private javax.swing.JLabel jLabel1;
    private javax.swing.JSpinner spnResolution;

    // End of variables declaration//GEN-END:variables
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy