/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MosaicControl.java
 *
 * Created on 2010-01-15, 01:51:51
 */

package webcamstudio.sources.effects.controls;

import webcamstudio.sources.effects.Mosaic;

/**
 *
 * @author pballeux
 */
public class MosaicControl extends javax.swing.JPanel {

    Mosaic effect = null;
    /** Creates new form MosaicControl
     * @param effect */
    public MosaicControl(Mosaic effect) {
        initComponents();
        this.effect=effect;
        slideSplitBox.setValue(effect.getSplitValue());
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lblSplitBox = new javax.swing.JLabel();
        slideSplitBox = new javax.swing.JSlider();

        setPreferredSize(new java.awt.Dimension(250, 44));

        lblSplitBox.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("webcamstudio/Languages"); // NOI18N
        lblSplitBox.setText(bundle.getString("MOSAICSPLITBOX")); // NOI18N
        lblSplitBox.setName("lblSplitBox"); // NOI18N

        slideSplitBox.setMaximum(8);
        slideSplitBox.setMinimum(2);
        slideSplitBox.setMinorTickSpacing(1);
        slideSplitBox.setPaintLabels(true);
        slideSplitBox.setPaintTicks(true);
        slideSplitBox.setValue(3);
        slideSplitBox.setName("slideSplitBox"); // NOI18N
        slideSplitBox.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                slideSplitBoxStateChanged(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblSplitBox)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(slideSplitBox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblSplitBox)
                    .addComponent(slideSplitBox, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(6, 6, 6))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void slideSplitBoxStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_slideSplitBoxStateChanged
        effect.setSplitValue(slideSplitBox.getValue());
    }//GEN-LAST:event_slideSplitBoxStateChanged


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel lblSplitBox;
    private javax.swing.JSlider slideSplitBox;
    // End of variables declaration//GEN-END:variables

}
