/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * EncodingPanel.java * * Created on 27 mars 2011, 09:51:46 */ package feuille.karaoke.lib; /** * <p>This class is a panel for the choice of an encoding of file.<br /> * Cette classe est un panel pour le choix de l'encodage de fichier.</p> * @author The Wingate 2940 */ public class EncodingPanel extends javax.swing.JPanel { /** <p>Creates new form EncodingPanel<br /> * Crée un nouveau formulaire EncodingPanel.</p> */ public EncodingPanel() { 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. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { bgEncoding = new javax.swing.ButtonGroup(); rbUTF8 = new javax.swing.JRadioButton(); rbUTF16LE = new javax.swing.JRadioButton(); rbUTF32LE = new javax.swing.JRadioButton(); rbLocal = new javax.swing.JRadioButton(); bgEncoding.add(rbUTF8); rbUTF8.setSelected(true); rbUTF8.setText("UTF-8"); bgEncoding.add(rbUTF16LE); rbUTF16LE.setText("UTF-16LE"); bgEncoding.add(rbUTF32LE); rbUTF32LE.setText("UTF-32LE"); bgEncoding.add(rbLocal); rbLocal.setText("Default"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(rbUTF8) .addComponent(rbUTF16LE) .addComponent(rbUTF32LE) .addComponent(rbLocal)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(rbUTF8) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(rbUTF16LE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(rbUTF32LE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(rbLocal) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); }// </editor-fold>//GEN-END:initComponents /** <p>Get the chosen encoding.<br />Obtient l'encodage choisi.</p> */ public String getEncoding(){ if(rbUTF8.isSelected()){ return rbUTF8.getText(); }else if(rbUTF16LE.isSelected()){ return rbUTF16LE.getText(); }else if(rbUTF32LE.isSelected()){ return rbUTF32LE.getText(); }else if(rbLocal.isSelected()){ return ""; }else{ return rbUTF8.getText(); } } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.ButtonGroup bgEncoding; private javax.swing.JRadioButton rbLocal; private javax.swing.JRadioButton rbUTF16LE; private javax.swing.JRadioButton rbUTF32LE; private javax.swing.JRadioButton rbUTF8; // End of variables declaration//GEN-END:variables }