KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > console > wizard > tab > DistributionTab


1 /**
2  * C-JDBC: Clustered JDBC.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: c-jdbc@objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation; either version 2.1 of the License, or any later
10  * version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20  *
21  * Initial developer(s): Nicolas Modrzyk.
22  * Contributor(s): ______________________.
23  */

24
25 package org.objectweb.cjdbc.console.wizard.tab;
26
27 import java.awt.GridBagConstraints JavaDoc;
28 import java.awt.GridBagLayout JavaDoc;
29
30 import javax.swing.BorderFactory JavaDoc;
31 import javax.swing.JComboBox JavaDoc;
32 import javax.swing.JLabel JavaDoc;
33 import javax.swing.JPanel JavaDoc;
34 import javax.swing.JSlider JavaDoc;
35 import javax.swing.JTextField JavaDoc;
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 /**
43  * Distribution tab has the fields for distributed virtual database.
44  *
45  * @see <code>WizardTab</code>
46  * @author <a HREF="mailto:Nicolas.Modrzyk@inria.fr">Nicolas Modrzyk </a>
47  * @version 1.0
48  */

49 public class DistributionTab extends WizardTab
50 {
51   /** Group communication cast timeout */
52   public JSlider JavaDoc castTimeout;
53   /** Macro clock for distributed databases */
54   public JComboBox JavaDoc macroClock;
55   /** Group communication name */
56   public JTextField JavaDoc groupName;
57
58   /**
59    * Creates a new <code>DistributionTab</code> object
60    *
61    * @param tabs the wizard tabs
62    */

63   public DistributionTab(WizardTabs tabs)
64   {
65     super(tabs, WizardConstants.TAB_DISTRIBUTION);
66     this.setVisible(false);
67
68     // panels
69
JPanel JavaDoc general = new JPanel JavaDoc();
70     general.setBorder(BorderFactory.createTitledBorder(WizardTranslate
71         .get("label.distribution.general")));
72     general.setLayout(new GridBagLayout JavaDoc());
73     constraints.fill = GridBagConstraints.HORIZONTAL;
74     this.add(general, constraints);
75
76     // constraints
77
GridBagConstraints JavaDoc localconstraints = new GridBagConstraints JavaDoc();
78     localconstraints.fill = GridBagConstraints.HORIZONTAL;
79     localconstraints.weightx = 1.0;
80     localconstraints.gridy = 0;
81
82     // groupName
83
localconstraints.gridy = ++localconstraints.gridy;
84     groupName = new JTextField JavaDoc("");
85     localconstraints.gridx = 0;
86     general.add(new JLabel JavaDoc(WizardTranslate.get("label.groupName")),
87         localconstraints);
88     localconstraints.gridx = 1;
89     general.add(groupName, localconstraints);
90
91     // macroClock
92
localconstraints.gridy = ++localconstraints.gridy;
93     macroClock = new JComboBox JavaDoc(WizardConstants.MACRO_CLOCK);
94     macroClock.setSelectedIndex(0);
95     localconstraints.gridx = 0;
96     general.add(new JLabel JavaDoc(WizardTranslate.get("label.macroClock")),
97         localconstraints);
98     localconstraints.gridx = 1;
99     general.add(macroClock, localconstraints);
100
101     // castTimeout
102
localconstraints.gridy = ++localconstraints.gridy;
103     castTimeout = new JSlider JavaDoc(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 JavaDoc(WizardTranslate.get("label.castTimeout")),
109         localconstraints);
110     localconstraints.gridx = 1;
111     general.add(castTimeout, localconstraints);
112
113   }
114
115 }
Popular Tags