Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8836/src/net/sourceforge/bprocessor/model
Modified Files:
Attribute.java
Log Message:
Improved handling of globals
Index: Attribute.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Attribute.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Attribute.java 17 Mar 2006 09:30:34 -0000 1.9
--- Attribute.java 30 May 2006 09:28:57 -0000 1.10
***************
*** 7,10 ****
--- 7,14 ----
package net.sourceforge.bprocessor.model;
+ import java.util.Iterator;
+ import java.util.LinkedList;
+ import java.util.List;
+
import org.apache.log4j.Logger;
***************
*** 13,17 ****
* shown in the attributeview in the gui
*/
! public class Attribute {
/** The logger */
private static Logger log = Logger.getLogger(Attribute.class);
--- 17,21 ----
* shown in the attributeview in the gui
*/
! public class Attribute implements Parametric {
/** The logger */
private static Logger log = Logger.getLogger(Attribute.class);
***************
*** 136,138 ****
--- 140,178 ----
log.info(info);
}
+
+ /**
+ * Set attributes
+ * @param attributes List of attribute
+ */
+ public void setAttributes(List attributes) {
+ Iterator iter = attributes.iterator();
+ while (iter.hasNext()) {
+ Attribute a = (Attribute)iter.next();
+ if (a.getName().equals("Name")) {
+ name = (String) a.getValue();
+ } else if (a.getName().equals("Value")) {
+ value = a.getValue();
+ }
+ }
+ Project.getInstance().changed(this);
+ }
+
+ /**
+ * Get attributes
+ * @return List of attributes
+ */
+ public List getAttributes() {
+ List attributes = new LinkedList();
+ attributes.add(new Attribute("Name", name));
+ attributes.add(new Attribute("Value", value));
+ return attributes;
+ }
+
+ /**
+ * Get general name
+ * @return String
+ */
+ public String getGeneralName() {
+ return "Parameter";
+ }
}
|