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

GeneralAttributes2.java

Go to the documentation of this file.
00001 
00058 package com.arcle.rmt.j2se.swing.vc.rqml;
00059 
00060 import javax.swing.*;
00061 
00062 import com.arcle.rmt.rqml.RQMLFirstClass;
00063 
00069 public class GeneralAttributes2 extends FirstClassPanel {
00070     public GeneralAttributes2(RQMLFirstClass fc) {
00071         super(fc);
00072         setName("Extended");
00073     }
00074 
00075     protected void initChildren() {
00076         lbPriority = createLabel("Priority");
00077         lbDifficulty = createLabel("Difficulty");
00078         lbStatus =  createLabel("Status");
00079         lbStability = createLabel("Stability");
00080 
00081         cbPriority = createComboBox(THREE_LEVEL);
00082         cbDifficulty = createComboBox(THREE_LEVEL);
00083         cbStability  = createComboBox(THREE_LEVEL);
00084         cbStatus  = createComboBox(STATUSES);
00085     }
00086 
00087     protected void layoutChildren() {
00088         final JComponent[][] components = {
00089             {lbPriority, cbPriority},
00090             {lbDifficulty, cbDifficulty},
00091             {lbStability, cbStability},
00092             {lbStatus, cbStatus}
00093         };
00094         layoutForm(this, components);
00095     }
00096 
00097     //-------------------------------------------------------------------
00098 
00099     protected void loadData() {
00100         RQMLFirstClass elem = getElement();
00101         cbPriority.setSelectedIndex(elem.getPriority() - elem.PRIORITY_LOW);
00102         cbDifficulty.setSelectedIndex(elem.getDifficulty() - elem.DIFFICULTY_LOW);
00103         cbStability.setSelectedIndex(elem.getStability() - elem.STABILITY_LOW);
00104         cbStatus.setSelectedIndex(elem.getStatus());
00105     }
00106 
00107     protected void saveData() {
00108         RQMLFirstClass elem = getElement();
00109         elem.setPriority(cbPriority.getSelectedIndex() + RQMLFirstClass.PRIORITY_LOW);
00110         elem.setDifficulty(cbDifficulty.getSelectedIndex() + RQMLFirstClass.DIFFICULTY_LOW);
00111         elem.setStability(cbStability.getSelectedIndex() + RQMLFirstClass.STABILITY_LOW);
00112         elem.setStatus(cbStatus.getSelectedIndex());
00113     }
00114 
00115     //-------------------------------------------------------------------
00116     // Member Variables
00117 
00118     private JLabel lbPriority;
00119     private JLabel lbDifficulty;
00120     private JLabel lbStatus;
00121     private JLabel lbStability;
00122 
00123     private JComboBox cbPriority;
00124     private JComboBox cbDifficulty;
00125     private JComboBox cbStatus;
00126     private JComboBox cbStability;
00127 
00128     //-----------------------------------------------------------------------
00129     // Factory Methods
00130 
00131 
00132     //-----------------------------------------------------------------------
00133     // Constants
00134 
00135     private static final String[] THREE_LEVEL = new String[]{
00136         "low",
00137         "normal",
00138         "high"
00139     };
00140 
00141 
00142     private static final String[] STATUSES = {
00143         "proposed",
00144         "approved",
00145         "incorporated",
00146         "validated"
00147     };
00148 
00149     //-----------------------------------------------------------------------
00150     // Inner Classes
00151 
00152 }

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