00001 00058 package com.arcle.rmt.j2se.swing.vc.rqml; 00059 00060 import javax.swing.*; 00061 import java.awt.BorderLayout; 00062 import java.awt.Insets; 00063 import java.util.Observable; 00064 00065 import com.arcle.rmt.rqml.RQMLFirstClass; 00066 import com.arcle.rmt.rqml.Project; 00067 00077 public class ProjectAttributes2 extends FirstClassPanel { 00078 public ProjectAttributes2(RQMLFirstClass fc) { 00079 super(fc); 00080 setName("Scope & Vision"); 00081 } 00082 00083 //------------------------------------------------------------------- 00084 // View implementations 00085 00086 00087 //------------------------------------------------------------------- 00088 protected void initChildren() { 00089 lbScope = createLabel("Scope"); 00090 lbVision = createLabel("Vision"); 00091 00092 edScope = createTextArea(); 00093 edVision = createTextArea(); 00094 } 00095 00096 protected void layoutChildren() { 00097 JPanel p1, p2, p3; 00098 setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); 00099 00100 // row 1 00101 p1 = new JPanel(); 00102 p1.setLayout(new BorderLayout()); 00103 p1.add(lbVision, BorderLayout.NORTH); 00104 p1.add(createScrollPane(edVision), BorderLayout.CENTER); 00105 add(p1); 00106 00107 // row 2 00108 p1 = new JPanel(); 00109 p1.setLayout(new BorderLayout()); 00110 p1.add(lbScope, BorderLayout.NORTH); 00111 p1.add(createScrollPane(edScope), BorderLayout.CENTER); 00112 add(p1); 00113 } 00114 00115 //------------------------------------------------------------------- 00116 00117 protected void loadData() { 00118 RQMLFirstClass elem = getElement(); 00119 if (elem instanceof Project) { 00120 Project prj = (Project) elem; 00121 edScope.setText(prj.getScope().getString()); 00122 edVision.setText(prj.getVision().getString()); 00123 } 00124 } 00125 00126 protected void saveData() { 00127 RQMLFirstClass elem = getElement(); 00128 if (elem instanceof Project) { 00129 Project prj = (Project) elem; 00130 prj.getScope().setString(edScope.getText()); 00131 prj.getVision().setString(edVision.getText()); 00132 } 00133 } 00134 00135 //------------------------------------------------------------------- 00136 // Member Variables 00137 00138 private JLabel lbScope; 00139 private JLabel lbVision; 00140 private JTextArea edScope; 00141 private JTextArea edVision; 00142 }