1 24 25 package org.objectweb.cjdbc.console.wizard.tab; 26 27 import java.awt.GridBagConstraints ; 28 import java.awt.GridBagLayout ; 29 30 import javax.swing.BorderFactory ; 31 import javax.swing.JComboBox ; 32 import javax.swing.JLabel ; 33 import javax.swing.JPanel ; 34 import javax.swing.JSlider ; 35 import javax.swing.JTextField ; 36 37 import org.objectweb.cjdbc.common.i18n.WizardTranslate; 38 import org.objectweb.cjdbc.console.wizard.WizardConstants; 39 import org.objectweb.cjdbc.console.wizard.WizardTab; 40 import org.objectweb.cjdbc.console.wizard.WizardTabs; 41 42 49 public class DistributionTab extends WizardTab 50 { 51 52 public JSlider castTimeout; 53 54 public JComboBox macroClock; 55 56 public JTextField groupName; 57 58 63 public DistributionTab(WizardTabs tabs) 64 { 65 super(tabs, WizardConstants.TAB_DISTRIBUTION); 66 this.setVisible(false); 67 68 JPanel general = new JPanel (); 70 general.setBorder(BorderFactory.createTitledBorder(WizardTranslate 71 .get("label.distribution.general"))); 72 general.setLayout(new GridBagLayout ()); 73 constraints.fill = GridBagConstraints.HORIZONTAL; 74 this.add(general, constraints); 75 76 GridBagConstraints localconstraints = new GridBagConstraints (); 78 localconstraints.fill = GridBagConstraints.HORIZONTAL; 79 localconstraints.weightx = 1.0; 80 localconstraints.gridy = 0; 81 82 localconstraints.gridy = ++localconstraints.gridy; 84 groupName = new JTextField (""); 85 localconstraints.gridx = 0; 86 general.add(new JLabel (WizardTranslate.get("label.groupName")), 87 localconstraints); 88 localconstraints.gridx = 1; 89 general.add(groupName, localconstraints); 90 91 localconstraints.gridy = ++localconstraints.gridy; 93 macroClock = new JComboBox (WizardConstants.MACRO_CLOCK); 94 macroClock.setSelectedIndex(0); 95 localconstraints.gridx = 0; 96 general.add(new JLabel (WizardTranslate.get("label.macroClock")), 97 localconstraints); 98 localconstraints.gridx = 1; 99 general.add(macroClock, localconstraints); 100 101 localconstraints.gridy = ++localconstraints.gridy; 103 castTimeout = new JSlider (JSlider.HORIZONTAL, 0, 2000, 0); 104 castTimeout.setPaintTicks(true); 105 castTimeout.setPaintLabels(true); 106 castTimeout.setMajorTickSpacing(500); 107 localconstraints.gridx = 0; 108 general.add(new JLabel (WizardTranslate.get("label.castTimeout")), 109 localconstraints); 110 localconstraints.gridx = 1; 111 general.add(castTimeout, localconstraints); 112 113 } 114 115 } | Popular Tags |