Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19310/src/net/sourceforge/bprocessor/model/modellor
Modified Files:
Modellor.java LayerModellor.java
Log Message:
Implemented parameter mechanism in modellor
Index: Modellor.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/Modellor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Modellor.java 10 Aug 2006 13:13:25 -0000 1.1
--- Modellor.java 29 Aug 2006 10:06:18 -0000 1.2
***************
*** 9,13 ****
--- 9,15 ----
import java.util.Collection;
+ import java.util.HashMap;
import java.util.LinkedList;
+ import java.util.Map;
import net.sourceforge.bprocessor.model.Entity;
***************
*** 25,28 ****
--- 27,33 ----
private static LinkedList modellors;
+ /** Parameters for elements */
+ protected Map parameters;
+
static {
modellors = new LinkedList();
***************
*** 30,33 ****
--- 35,46 ----
/**
+ * Constructor for modellor
+ *
+ */
+ public Modellor() {
+ parameters = new HashMap();
+ }
+
+ /**
* Register a modellor to the possible choices of modellors
* @param m The modellor
***************
*** 68,71 ****
--- 81,102 ----
/**
+ * Get parameter block for element
+ * @param element Space
+ * @return Parametric
+ */
+ public Parametric get(Space element) {
+ return (Parametric) parameters.get(element);
+ }
+
+ /**
+ * Set parameter block for element
+ * @param element Space
+ * @param parametric Parametric
+ */
+ public void set(Space element, Parametric parametric) {
+ parameters.put(element, parametric);
+ }
+
+ /**
* @see net.sourceforge.bprocessor.model.Parametric#getGeneralName()
*/
Index: LayerModellor.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/LayerModellor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** LayerModellor.java 29 Aug 2006 08:07:13 -0000 1.3
--- LayerModellor.java 29 Aug 2006 10:06:18 -0000 1.4
***************
*** 15,18 ****
--- 15,19 ----
import net.sourceforge.bprocessor.model.Attribute;
+ import net.sourceforge.bprocessor.model.Parametric;
import net.sourceforge.bprocessor.model.Space;
import net.sourceforge.bprocessor.model.Surface;
***************
*** 60,63 ****
--- 61,65 ----
public void update(Object entity) {
space.clear();
+ parameters.clear();
Surface bottom = surface.copy(space);
if (surface.getBackDomain() == space) {
***************
*** 68,71 ****
--- 70,74 ----
Space layer = Space.createConstructionSpace("Layer " + (i + 1));
space.add(layer);
+ this.set(layer, new Layer());
bottom.setFrontDomain(layer);
Set sides = new HashSet();
***************
*** 150,152 ****
--- 153,187 ----
}
}
+
+ /**
+ * Layer class
+ */
+ private class Layer implements Parametric {
+
+ /**
+ * @param attributes Attributes
+ */
+ public void setAttributes(List attributes) {
+
+ }
+
+ /**
+ * @return List of attributes
+ */
+ public List getAttributes() {
+ LinkedList attributes = new LinkedList();
+ attributes.add(new Attribute("Depth", new Double(0.3)));
+ attributes.add(new Attribute("Top offset", new Double(0.0)));
+ attributes.add(new Attribute("Bottom offset", new Double(0.0)));
+ return attributes;
+ }
+
+ /**
+ * @return General name
+ */
+ public String getGeneralName() {
+ return "Layer";
+ }
+
+ }
}
|