Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

GeneralAttributes1.java

Go to the documentation of this file.
00001 
00058 package com.arcle.rmt.j2se.swing.vc.rqml;
00059 
00060 import javax.swing.*;
00061 import java.awt.BorderLayout;
00062 import java.awt.GridBagLayout;
00063 import java.awt.GridBagConstraints;
00064 import java.awt.Insets;
00065 import java.util.Observable;
00066 
00067 import com.arcle.rmt.rqml.RQMLFirstClass;
00068 
00074 public class GeneralAttributes1 extends FirstClassPanel {
00075     public GeneralAttributes1(RQMLFirstClass fc) {
00076         super(fc);
00077         setName("Basic");
00078     }
00079 
00080     //-------------------------------------------------------------------
00081     // View implementations
00082 
00083 
00084     //-------------------------------------------------------------------
00085     protected void initChildren() {
00086         lbID = createLabel("ID");
00087         lbName = createLabel("Name");
00088         lbDescription = createLabel("Description");
00089         lbRationale = createLabel("Rationale");
00090         lbVersion = createLabel("Version");
00091 
00092         edID = createTextField();
00093         edName = createTextField();
00094         edVersion = createTextField();
00095         edDescription = createTextArea();
00096         edRationale = createTextArea();
00097     }
00098 
00099     protected void layoutChildren() {
00100         JPanel p1, p2, p3;
00101         final int xGap = 4;
00102         final int yGap = 2;
00103         setLayout(new BorderLayout());
00104 
00105         // top row
00106         p1 = new JPanel();
00107             GridBagLayout gbl = new GridBagLayout();
00108             GridBagConstraints gbc = new GridBagConstraints();
00109 
00110             p1.setLayout(gbl);
00111             gbc.gridy = 0;
00112             gbc.weighty = 1.0;
00113 
00114             p2 = new JPanel();
00115                 p2.setLayout(new BorderLayout(xGap, yGap));
00116                 p2.add(lbID, BorderLayout.WEST);
00117                 p2.add(edID, BorderLayout.CENTER);
00118             gbc.gridx = 0;
00119             gbc.weightx = 0.2F;
00120             gbc.fill = gbc.HORIZONTAL;
00121             gbc.insets = new Insets(0, 0, 0, xGap);
00122             p1.add(p2, gbc);
00123 
00124             p2 = new JPanel();
00125                 p2.setLayout(new BorderLayout(xGap, yGap));
00126                 p2.add(lbName, BorderLayout.WEST);
00127                 p2.add(edName, BorderLayout.CENTER);
00128             gbc.gridx = 1;
00129             gbc.weightx = 0.6F;
00130             gbc.fill = gbc.HORIZONTAL;
00131             p1.add(p2, gbc);
00132 
00133             p2 = new JPanel();
00134                 p2.setLayout(new BorderLayout(xGap, yGap));
00135                 p2.add(lbVersion, BorderLayout.WEST);
00136                 p2.add(edVersion, BorderLayout.CENTER);
00137             gbc.gridx = 2;
00138             gbc.weightx = 0.1F;
00139             gbc.fill = gbc.HORIZONTAL;
00140             gbc.insets = new Insets(0, xGap, 0, 0);
00141             p1.add(p2, gbc);
00142         add(p1, BorderLayout.NORTH);
00143 
00144         // middle and bottom rows
00145         p1 = new JPanel();
00146             p1.setLayout(new BoxLayout(p1, BoxLayout.Y_AXIS));
00147 
00148             // middle row
00149             p2 = new JPanel();
00150                 p2.setLayout(new BorderLayout());
00151                 p2.add(lbDescription, BorderLayout.NORTH);
00152                 p2.add(createScrollPane(edDescription), BorderLayout.CENTER);
00153             p1.add(p2);
00154 
00155             // bottom row
00156             p2 = new JPanel();
00157                 p2.setLayout(new BorderLayout());
00158                 p2.add(lbRationale, BorderLayout.NORTH);
00159                 p2.add(createScrollPane(edRationale), BorderLayout.CENTER);
00160             p1.add(p2);
00161         add(p1, BorderLayout.CENTER);
00162 
00163     }
00164 
00165     //-------------------------------------------------------------------
00166 
00167     protected void loadData() {
00168         RQMLFirstClass elem = getElement();
00169         edID.setText(elem.getID());
00170         edVersion.setText(elem.getVersion());
00171         edName.setText(elem.getName().getString());
00172         edDescription.setText(elem.getDescription().getString());
00173         edRationale.setText(elem.getRationale().getString());
00174     }
00175 
00176     protected void saveData() {
00177         RQMLFirstClass elem = getElement();
00178         elem.setID(edID.getText());
00179         elem.setVersion(edVersion.getText());
00180         elem.getName().setString(edName.getText());
00181         elem.getDescription().setString(edDescription.getText());
00182         elem.getRationale().setString(edRationale.getText());
00183     }
00184 
00185     //-------------------------------------------------------------------
00186     // Member Variables
00187 
00188     private JLabel lbID;
00189     private JLabel lbName;
00190     private JLabel lbDescription;
00191     private JLabel lbRationale;
00192     private JLabel lbVersion;
00193 
00194     private JTextField edID;
00195     private JTextField edName;
00196     private JTextArea edDescription;
00197     private JTextArea edRationale;
00198     private JTextField edVersion;
00199 
00200 }

Generated on Fri Jun 18 19:51:21 2004 for Arcle Rambutan by doxygen 1.3.5