001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: /**
043: * Requirement.java
044: *
045: * Created on June 24, 2004, 1:55 PM
046: */package org.netbeans.modules.uml.core.requirementsframework;
047:
048: import org.netbeans.modules.uml.core.support.umlutils.ETArrayList;
049: import org.netbeans.modules.uml.core.support.umlutils.ETList;
050:
051: /**
052: *
053: * @author Trey Spiva
054: */
055: public class Requirement implements IRequirement {
056: // Satisfier of this Requirement.
057: ETList<ISatisfier> m_cpSatisfiers = null;
058:
059: // Collection of sub-Requirements for this Requirement.
060: ETList<IRequirement> m_cpRequirements = null;
061:
062: // A category is a grouping of requirements.
063: boolean m_vbIsCategory = false;
064:
065: // The text of the requirement.
066: String m_cbsName = "";
067: String m_cbsID = "";
068: String m_cbsType = "";
069: String m_cbsModName = "";
070: String m_cbsDescription = "";
071: String m_cbsProviderID = "";
072: String m_cbsSourceID = "";
073:
074: /** Creates a new instance of Requirement */
075: public Requirement() {
076: }
077:
078: public void addSatisfier(ISatisfier pSatisfier) {
079: // This method is not implemented in C++
080: }
081:
082: /**
083: * Get the text of the requirement.
084: *
085: * @return The requirement text.
086: */
087: public String getDescription() {
088: return m_cbsDescription;
089: }
090:
091: /**
092: * Retreives the requirements ID.
093: */
094: public String getID() {
095: return m_cbsID;
096: }
097:
098: public String getModName() {
099: return m_cbsModName;
100: }
101:
102: /**
103: * Retrieves the name of the requirement.
104: */
105: public String getName() {
106: return m_cbsName;
107: }
108:
109: public String getProjectName() {
110: // This method is not implemented in C++
111: return "";
112: }
113:
114: /**
115: * Retrieves the ID of the provider.
116: */
117: public String getProviderID() {
118: return m_cbsProviderID;
119: }
120:
121: /**
122: * Get the ID of the soruce in the provider. The source is the database
123: * that defines the requiremnt.
124: */
125: public String getSourceID() {
126: return m_cbsSourceID;
127: }
128:
129: /**
130: * Retrieves the requirements type.
131: */
132: public String getType() {
133: return m_cbsType;
134: }
135:
136: /**
137: * Sets if the requirment is a category. A category has no requirement text,
138: * but does contain a group of requirements
139: *
140: * @retrun The value of IsCategory Property.
141: */
142: public boolean isCategory() {
143: return m_vbIsCategory;
144: }
145:
146: public void removeSatisfier(ISatisfier pSatisfier) {
147: // This method is not implemented in C++
148: }
149:
150: /**
151: *
152: * Set the text of the requirement.
153: *
154: * @param newVal The requirement text. */
155: public void setDescription(String newVal) {
156: m_cbsDescription = newVal;
157: }
158:
159: /**
160: * Sets the requirements ID.
161: */
162: public void setID(String newVal) {
163: m_cbsID = newVal;
164: }
165:
166: /**
167: * Sets if the requirment is a category. A category has no requirement text,
168: * but does contain a group of requirements
169: *
170: * @param newVal The value of IsCategory Property.
171: */
172: public void setIsCategory(boolean newVal) {
173: m_vbIsCategory = newVal;
174: }
175:
176: public void setModName(String newVal) {
177: m_cbsModName = newVal;
178: }
179:
180: /**
181: * Sets the name of the requriment.
182: */
183: public void setName(String newVal) {
184: m_cbsName = newVal;
185: }
186:
187: public void setProjectName(String newVal) {
188: // This method is not implemented in C++
189: }
190:
191: /**
192: * Set the name of the provider that defines the requirements.
193: */
194: public void setProviderID(String newVal) {
195: m_cbsProviderID = newVal;
196: }
197:
198: /**
199: * Gets if the requirments for a category. A category has no requirement text,
200: * but does contain a group of requirements
201: *
202: * @retrun The categories requirments.
203: */
204: public ETList<IRequirement> getRequirements() {
205: return m_cpRequirements;
206: }
207:
208: /**
209: * Sets if the requirments for a category. A category has no requirement text,
210: * but does contain a group of requirements
211: *
212: * @retrun The categories requirments.
213: */
214: public void setRequirements(ETList<IRequirement> newVal) {
215: m_cpRequirements = newVal;
216: }
217:
218: /**
219: * Retrieves the satisifiers of the requirement.
220: */
221: public ETList<ISatisfier> getSatisfiers() {
222: return m_cpSatisfiers;
223: }
224:
225: /**
226: * Sets the satisifiers of the requirement.
227: */
228: public void setSatisfiers(ETList<ISatisfier> newVal) {
229: m_cpSatisfiers = newVal;
230: }
231:
232: /**
233: * Set the ID of the soruce in the provider. The source is the database
234: * that defines the requiremnt.
235: */
236: public void setSourceID(String newVal) {
237: m_cbsSourceID = newVal;
238: }
239:
240: /**
241: * Sets the requirments type.
242: */
243: public void setType(String newVal) {
244: m_cbsType = newVal;
245: }
246:
247: public ETList<IRequirement> getSubRequirements(
248: IRequirementSource pRequirementSource) {
249: // This method is not implemented in C++
250: return new ETArrayList<IRequirement>();
251: }
252:
253: /** Checks if the node can participate in a drag operation. */
254: public boolean isAllowedToDrag() {
255: return true;
256: }
257:
258: }
|