1 56 package org.objectstyle.cayenne.modeler.dialog.pref; 57 58 import java.awt.BorderLayout ; 59 60 import javax.swing.ButtonGroup ; 61 import javax.swing.JComboBox ; 62 import javax.swing.JLabel ; 63 import javax.swing.JPanel ; 64 import javax.swing.JRadioButton ; 65 66 import com.jgoodies.forms.builder.DefaultFormBuilder; 67 import com.jgoodies.forms.layout.FormLayout; 68 69 74 public class EncodingSelectorView extends JPanel { 75 76 protected JRadioButton defaultEncoding; 77 protected JRadioButton otherEncoding; 78 protected JComboBox encodingChoices; 79 protected JLabel defaultEncodingLabel; 80 81 public EncodingSelectorView() { 82 this.defaultEncoding = new JRadioButton (); 83 this.otherEncoding = new JRadioButton (); 84 this.encodingChoices = new JComboBox (); 85 this.defaultEncodingLabel = new JLabel (); 86 87 ButtonGroup group = new ButtonGroup (); 88 group.add(defaultEncoding); 89 group.add(otherEncoding); 90 91 FormLayout layout = new FormLayout("pref, 3dlu, pref", ""); 92 DefaultFormBuilder builder = new DefaultFormBuilder(layout); 93 94 builder.append(defaultEncoding, defaultEncodingLabel); 95 builder.append(otherEncoding, encodingChoices); 96 97 setLayout(new BorderLayout ()); 98 add(builder.getPanel()); 99 } 100 101 public JRadioButton getDefaultEncoding() { 102 return defaultEncoding; 103 } 104 105 public JLabel getDefaultEncodingLabel() { 106 return defaultEncodingLabel; 107 } 108 109 public JComboBox getEncodingChoices() { 110 return encodingChoices; 111 } 112 113 public JRadioButton getOtherEncoding() { 114 return otherEncoding; 115 } 116 } | Popular Tags |