// Path: src/main/java/net/sourceforge/krut/Settings.java
// public class Settings {
// 
//     static {
//     }
// 
//     private static Preferences prefs = Preferences.userNodeForPackage(Run_KRUT.class);
//     public static final String PREF_CAPRECT_X = "PREF_CAPRECT_X";
//     public static final String PREF_CAPRECT_Y = "PREF_CAPRECT_Y";
//     public static final String PREF_CAPRECT_WIDHT = "PREF_CAPRECT_WIDHT";
//     public static final String PREF_CAPRECT_HEIGHT = "PREF_CAPRECT_HEIGHT";
// 
//     /**
//      * The starting value of the capture size.
//      * This is used in the createScreenGrabber() method.
//      * It is also passed on to the KrutSettings constructur
//      * from the init() method.
//      */
//     public static Rectangle getCaptureRect() {
//         return new Rectangle(
//                 prefs.getInt(PREF_CAPRECT_X, 0),
//                 prefs.getInt(PREF_CAPRECT_Y, 0),
//                 prefs.getInt(PREF_CAPRECT_WIDHT, 360),
//                 prefs.getInt(PREF_CAPRECT_HEIGHT, 240)
//         );
//     }
// 
//     public static void setCaptureRect(Rectangle captureRect) {
//         prefs.putInt(PREF_CAPRECT_X, (int) captureRect.getX());
//         prefs.putInt(PREF_CAPRECT_Y, (int) captureRect.getY());
//         prefs.putInt(PREF_CAPRECT_WIDHT, (int) captureRect.getWidth());
//         prefs.putInt(PREF_CAPRECT_HEIGHT, (int) captureRect.getHeight());
//     }
// }


import java.awt.Rectangle;
import net.sourceforge.krut.Settings;
package net.sourceforge.krut.ui;



/**
 * This is a class that is used to display many user interface functions. In
 * earlier versions of the program, most of the user interface functions were
 * handled through free-floating windows. These windows were then collected
 * inside the GUI created by this class. Because of this, there are both user
 * manageable settings for the program handled directly by this class, and also
 * several settings handled by other classes, which in turn are displayed
 * through this class.
 *
 * @since 18. december 2006, 22:52
 * @author Jonas
 */
public class KrutSettings extends javax.swing.JFrame {
    
    /** If the present KrutSettings window is properly initiated,
     *  vCMBItem holds the Record Video checkbox from the main
     *  Krut window Menu. This parameter is used for easy access
     *  in case the Record Video checkbox from the present
     *  KrutSetting window is changed.
     */
    public javax.swing.JCheckBoxMenuItem vCBMItem;
    
    /** If the present KrutSettings window is properly initiated,
     *  aCMBItem holds the Record Audio checkbox from the main
     *  Krut window Menu. This parameter is used for easy access
     *  in case the Record Audio checkbox from the present
     *  KrutSetting window is changed.
     */
    public javax.swing.JCheckBoxMenuItem aCBMItem;

    /** If the present KrutSettings window is properly initiated,
     *  mCMBItem holds the Record Mouse Pointer checkbox from the main
     *  Krut window Menu. This parameter is used for easy access
     *  in case the Record Mouse Pointer checkbox from the present
     *  KrutSetting window is changed.
     */
    public javax.swing.JCheckBoxMenuItem mCBMItem;

    /** How often we sample for the mouse position in ms.
     *  The sampling is done in startMouseTimer. */
    public int mouseSampleDelay = 100;
    
    /** True if the setting window is initiated, false if not
     */
    public boolean isInited = false;
    
    /** Mouse postition in stored here when CTRL is pressed */
    private java.awt.Point mouseStartPos;
    
    /** This is used to store the current mouse position
     *  in startMouseTimer. */
    private java.awt.Point mousePos;

    
    /** This is a flag to keep track of whether the capture size
     *  is being changed. */
    private boolean ctrlDown = false;
        
    /** This is a flag to keep track of whether the capture size
     *  is being changed. */
    private boolean capButtonPressed = false;
    
    /** Times used to track the mouse position for both
     *  the mouse position window, and the capture size
     *  window */
    public javax.swing.Timer mouseTimer;    
    
    /** Creates new form KrutSettings */
    public KrutSettings(int startFps, int startEncQuality,
        boolean startStereo, boolean startSixteen, int startFrequency) {

        initComponents();
        
        soundQuery1.init(startFrequency, startStereo, startSixteen);
        qualitySlider1.init(startEncQuality);
        fPSQuery1.init(startFps);
// Path: src/main/java/net/sourceforge/krut/Settings.java
// public class Settings {
// 
//     static {
//     }
// 
//     private static Preferences prefs = Preferences.userNodeForPackage(Run_KRUT.class);
//     public static final String PREF_CAPRECT_X = "PREF_CAPRECT_X";
//     public static final String PREF_CAPRECT_Y = "PREF_CAPRECT_Y";
//     public static final String PREF_CAPRECT_WIDHT = "PREF_CAPRECT_WIDHT";
//     public static final String PREF_CAPRECT_HEIGHT = "PREF_CAPRECT_HEIGHT";
// 
//     /**
//      * The starting value of the capture size.
//      * This is used in the createScreenGrabber() method.
//      * It is also passed on to the KrutSettings constructur
//      * from the init() method.
//      */
//     public static Rectangle getCaptureRect() {
//         return new Rectangle(
//                 prefs.getInt(PREF_CAPRECT_X, 0),
//                 prefs.getInt(PREF_CAPRECT_Y, 0),
//                 prefs.getInt(PREF_CAPRECT_WIDHT, 360),
//                 prefs.getInt(PREF_CAPRECT_HEIGHT, 240)
//         );
//     }
// 
//     public static void setCaptureRect(Rectangle captureRect) {
//         prefs.putInt(PREF_CAPRECT_X, (int) captureRect.getX());
//         prefs.putInt(PREF_CAPRECT_Y, (int) captureRect.getY());
//         prefs.putInt(PREF_CAPRECT_WIDHT, (int) captureRect.getWidth());
//         prefs.putInt(PREF_CAPRECT_HEIGHT, (int) captureRect.getHeight());
//     }
// }


// Path: src/main/java/net/sourceforge/krut/ui/KrutSettings.java
import java.awt.Rectangle;
import net.sourceforge.krut.Settings;

package net.sourceforge.krut.ui;



/**
 * This is a class that is used to display many user interface functions. In
 * earlier versions of the program, most of the user interface functions were
 * handled through free-floating windows. These windows were then collected
 * inside the GUI created by this class. Because of this, there are both user
 * manageable settings for the program handled directly by this class, and also
 * several settings handled by other classes, which in turn are displayed
 * through this class.
 *
 * @since 18. december 2006, 22:52
 * @author Jonas
 */
public class KrutSettings extends javax.swing.JFrame {
    
    /** If the present KrutSettings window is properly initiated,
     *  vCMBItem holds the Record Video checkbox from the main
     *  Krut window Menu. This parameter is used for easy access
     *  in case the Record Video checkbox from the present
     *  KrutSetting window is changed.
     */
    public javax.swing.JCheckBoxMenuItem vCBMItem;
    
    /** If the present KrutSettings window is properly initiated,
     *  aCMBItem holds the Record Audio checkbox from the main
     *  Krut window Menu. This parameter is used for easy access
     *  in case the Record Audio checkbox from the present
     *  KrutSetting window is changed.
     */
    public javax.swing.JCheckBoxMenuItem aCBMItem;

    /** If the present KrutSettings window is properly initiated,
     *  mCMBItem holds the Record Mouse Pointer checkbox from the main
     *  Krut window Menu. This parameter is used for easy access
     *  in case the Record Mouse Pointer checkbox from the present
     *  KrutSetting window is changed.
     */
    public javax.swing.JCheckBoxMenuItem mCBMItem;

    /** How often we sample for the mouse position in ms.
     *  The sampling is done in startMouseTimer. */
    public int mouseSampleDelay = 100;
    
    /** True if the setting window is initiated, false if not
     */
    public boolean isInited = false;
    
    /** Mouse postition in stored here when CTRL is pressed */
    private java.awt.Point mouseStartPos;
    
    /** This is used to store the current mouse position
     *  in startMouseTimer. */
    private java.awt.Point mousePos;

    
    /** This is a flag to keep track of whether the capture size
     *  is being changed. */
    private boolean ctrlDown = false;
        
    /** This is a flag to keep track of whether the capture size
     *  is being changed. */
    private boolean capButtonPressed = false;
    
    /** Times used to track the mouse position for both
     *  the mouse position window, and the capture size
     *  window */
    public javax.swing.Timer mouseTimer;    
    
    /** Creates new form KrutSettings */
    public KrutSettings(int startFps, int startEncQuality,
        boolean startStereo, boolean startSixteen, int startFrequency) {

        initComponents();
        
        soundQuery1.init(startFrequency, startStereo, startSixteen);
        qualitySlider1.init(startEncQuality);
        fPSQuery1.init(startFps);
        Rectangle capRect = Settings.getCaptureRect();