Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21721/src/net/sourceforge/bprocessor/facade/modellor
Modified Files:
NetFacadeModellor.java
Log Message:
make it possible to choose between single and double posts.
Index: NetFacadeModellor.java
===================================================================
RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** NetFacadeModellor.java 4 Dec 2006 11:51:29 -0000 1.4
--- NetFacadeModellor.java 5 Dec 2006 15:28:05 -0000 1.5
***************
*** 53,56 ****
--- 53,59 ----
private Surface front;
+ /** Is the facade single posted or not */
+ private boolean single = true;
+
/** The logger */
private static Logger log = Logger.getLogger(NetFacadeModellor.class);
***************
*** 75,82 ****
--- 78,101 ----
content.put("frameWidth", new Double(frameWidth));
content.put("front", front);
+ content.put("single", Boolean.valueOf(single));
+ content.put("frame", frame);
return content;
}
/**
+ * Set the content of the modellor from a map, for persistence
+ * @param m persistence map
+ */
+ public void setContent(Map m) {
+ space = (Space)m.get("space");
+ net = (Net)m.get("net");
+ depth = ((Double)m.get("depth")).doubleValue();
+ frameWidth = ((Double)m.get("frameWidth")).doubleValue();
+ front = (Surface)m.get("front");
+ single = ((Boolean)m.get("single")).booleanValue();
+ frame = (Space)m.get("frame");
+ }
+
+ /**
* get a new instance of the net facade modellor
* @param s the space of the modellor
***************
*** 98,118 ****
/**
- * Set the content of the modellor from a map, for persistence
- * @param m persistence map
- */
- public void setContent(Map m) {
- space = (Space)m.get("space");
- net = (Net)m.get("net");
- depth = ((Double)m.get("depth")).doubleValue();
- frameWidth = ((Double)m.get("frameWidth")).doubleValue();
- front = (Surface)m.get("front");
- }
-
- /**
* Update when an entity changes
* @param entity the changed entity
*/
public void update(Object entity) {
- log.info("update");
regenerate();
}
--- 117,124 ----
***************
*** 134,137 ****
--- 140,145 ----
attributes.add(new Attribute("Framewidth", new Double(frameWidth), true));
attributes.add(new Attribute("Depth", new Double(depth), true));
+ attributes.add(new Attribute("Single", Boolean.valueOf(single), true));
+
return attributes;
}
***************
*** 151,154 ****
--- 159,164 ----
} else if (att.getName().equals("Depth")) {
setDepth(((Double)att.getValue()).doubleValue());
+ } else if (att.getName().equals("Single")) {
+ setSingle(((Boolean)att.getValue()).booleanValue());
}
}
***************
*** 215,220 ****
private void regenerate() {
space.clear();
! space.add(net);
! createSingleFacade(net);
}
--- 225,235 ----
private void regenerate() {
space.clear();
! frame = null;
! space.add(net);
! if (single) {
! createSingleFacade(net);
! } else {
! createDoubleFacade(net);
! }
}
***************
*** 263,267 ****
}
if (!outlineCopies.isEmpty()) {
- log.info("there is a outline");
/* make the shell of the facade */
Surface frameSurface = new Surface(outlineCopies);
--- 278,281 ----
***************
*** 295,299 ****
*/
private List netOutline(Net net) {
- log.info("finding outline");
/*Find outer edges*/
Iterator edges = net.getEdges().iterator();
--- 309,312 ----
***************
*** 304,311 ****
outer.add(current);
}
- Iterator it = current.getSurfaces().iterator();
- while (it.hasNext()) {
- log.info(current + " surface:" + it.next());
- }
}
/*If there are outer edges sort them in order*/
--- 317,320 ----
***************
*** 435,437 ****
--- 444,470 ----
this.depth = depth;
}
+
+ /**
+ * Tells if the facade is single posted
+ * @return single posted boolean
+ */
+ public boolean isSingle() {
+ return single;
+ }
+
+ /**
+ * Sets the facade to single posted or not
+ * @param single if the facade should be single or not
+ */
+ public void setSingle(boolean single) {
+ this.single = single;
+ }
+
+ /**
+ * See getgeneralname
+ * @return the general name
+ */
+ public String getName() {
+ return getGeneralName();
+ }
}
|