[Bprocessor-commit] facade/src/net/sourceforge/bprocessor/facade/modellor FacadeModellor.java, 1.2
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-10-14 23:37:49
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9347/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java WindowModellor.java Log Message: implemented get and set content for all 4 modellors Index: WindowModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/WindowModellor.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** WindowModellor.java 10 Oct 2006 14:02:37 -0000 1.13 --- WindowModellor.java 14 Oct 2006 23:37:40 -0000 1.14 *************** *** 245,250 **** /** @see net.sourceforge.bprocessor.model.modellor.Modellor#setContent(Map) */ public void setContent(Map m) { ! // TODO Auto-generated method stub ! } --- 245,254 ---- /** @see net.sourceforge.bprocessor.model.modellor.Modellor#setContent(Map) */ public void setContent(Map m) { ! framewidth = ((Double)m.get("Framewidth")).doubleValue(); ! framedepth = ((Double)m.get("Framedepth")).doubleValue(); ! offset = ((Double)m.get("Offset")).doubleValue(); ! sign = ((Integer)m.get("Sign")).intValue(); ! surface = (Surface)m.get("Surface"); ! space = (Space)m.get("Space"); } *************** *** 252,260 **** public Map getContent() { Map what = new HashMap(); - what.put("name", getName()); what.put("Framewidth", new Double(framewidth)); what.put("Framedepth", new Double(framedepth)); what.put("Offset", new Double(offset)); what.put("Sign", new Integer(sign)); return what; } --- 256,265 ---- public Map getContent() { Map what = new HashMap(); what.put("Framewidth", new Double(framewidth)); what.put("Framedepth", new Double(framedepth)); what.put("Offset", new Double(offset)); what.put("Sign", new Integer(sign)); + what.put("Space", space); + what.put("Surface", surface); return what; } Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** FacadeModellor.java 10 Oct 2006 14:02:37 -0000 1.22 --- FacadeModellor.java 14 Oct 2006 23:37:40 -0000 1.23 *************** *** 196,206 **** public void setAttributes(List attributes) { Iterator it = attributes.iterator(); while (it.hasNext()) { Attribute a = (Attribute)it.next(); if (a.getName().equals("Name")) { - Project.getInstance().checkpoint(); name = (String)a.getValue(); } else if (a.getName().equals("Front")) { - Project.getInstance().checkpoint(); Iterator sit = Project.getInstance().getActiveSpace().getSurfaces().iterator(); while (sit.hasNext()) { --- 196,205 ---- public void setAttributes(List attributes) { Iterator it = attributes.iterator(); + boolean changed = false; while (it.hasNext()) { Attribute a = (Attribute)it.next(); if (a.getName().equals("Name")) { name = (String)a.getValue(); } else if (a.getName().equals("Front")) { Iterator sit = Project.getInstance().getActiveSpace().getSurfaces().iterator(); while (sit.hasNext()) { *************** *** 209,213 **** if (front != s) { front = s; ! createFacade(); } } --- 208,212 ---- if (front != s) { front = s; ! changed = true; } } *************** *** 216,251 **** int n = ((Double)a.getValue()).intValue(); if (n != vertPosts) { ! Project.getInstance().checkpoint(); vertPosts = n; - createFacade(); } } else if (a.getName().equals("H-posts")) { int n = ((Double)a.getValue()).intValue(); if (n != horPosts) { ! Project.getInstance().checkpoint(); horPosts = n; - createFacade(); } } else if (a.getName().equals("V-postwidth")) { double d = ((Double)a.getValue()).doubleValue(); - Project.getInstance().checkpoint(); setVertPostWidth(d); } else if (a.getName().equals("H-postwidth")) { double d = ((Double)a.getValue()).doubleValue(); - Project.getInstance().checkpoint(); setHorPostWidth(d); } else if (a.getName().equals("Frame thickness")) { double n = ((Double)a.getValue()).doubleValue(); if (n != frameThickness) { - Project.getInstance().checkpoint(); frameThickness = n; ! createFacade(); } } else if (a.getName().equals("Depth")) { double n = ((Double)a.getValue()).doubleValue(); if (n != depth) { - Project.getInstance().checkpoint(); depth = n; ! createFacade(); } } else if (a.getName().equals("Single posted")) { --- 215,246 ---- int n = ((Double)a.getValue()).intValue(); if (n != vertPosts) { ! changed = true; vertPosts = n; } } else if (a.getName().equals("H-posts")) { int n = ((Double)a.getValue()).intValue(); if (n != horPosts) { ! changed = true; horPosts = n; } } else if (a.getName().equals("V-postwidth")) { double d = ((Double)a.getValue()).doubleValue(); setVertPostWidth(d); + changed = true; } else if (a.getName().equals("H-postwidth")) { double d = ((Double)a.getValue()).doubleValue(); setHorPostWidth(d); + changed = true; } else if (a.getName().equals("Frame thickness")) { double n = ((Double)a.getValue()).doubleValue(); if (n != frameThickness) { frameThickness = n; ! changed = true; } } else if (a.getName().equals("Depth")) { double n = ((Double)a.getValue()).doubleValue(); if (n != depth) { depth = n; ! changed = true; } } else if (a.getName().equals("Single posted")) { *************** *** 253,258 **** if (b && type != SINGLE_BAR) { type = SINGLE_BAR; ! createFacade(); ! Project.getInstance().changed(this); } if (!b && type == SINGLE_BAR) { --- 248,252 ---- if (b && type != SINGLE_BAR) { type = SINGLE_BAR; ! changed = true; } if (!b && type == SINGLE_BAR) { *************** *** 261,270 **** horPostWidth = 0; frameThickness = 0; ! createFacade(); ! Project.getInstance().changed(this); } } } ! Project.getInstance().changed(space); } /** --- 255,267 ---- horPostWidth = 0; frameThickness = 0; ! changed = true; } } } ! if (changed) { ! createFacade(); ! Project.getInstance().changed(this); ! Project.getInstance().checkpoint(); ! } } /** *************** *** 753,764 **** /** @see net.sourceforge.bprocessor.model.modellor.Modellor#setContent(Map) */ public void setContent(Map m) { ! // TODO Auto-generated method stub ! } /** @see net.sourceforge.bprocessor.model.modellor.Modellor#getContent() */ public Map getContent() { ! ! return null; } } --- 750,787 ---- /** @see net.sourceforge.bprocessor.model.modellor.Modellor#setContent(Map) */ public void setContent(Map m) { ! bottomBound = (Line)m.get("bottomBound"); ! rightBound = (Line)m.get("rightBound"); ! leftBound = (Line)m.get("leftBound"); ! topBound = (Line)m.get("topBound"); ! depth = ((Double)m.get("depth")).doubleValue(); ! frame = (Space)m.get("frame"); ! front = (Surface)m.get("front"); ! frameThickness = ((Double)m.get("frameThickness")).doubleValue(); ! horPosts = ((Integer)m.get("horPosts")).intValue(); ! horPostWidth = ((Double)m.get("horPostWidth")).doubleValue(); ! vertPosts = ((Integer)m.get("vertPosts")).intValue(); ! vertPostWidth = ((Double)m.get("vertPostWidth")).doubleValue(); ! type = ((Integer)m.get("type")).intValue(); ! name = (String)m.get("name"); } /** @see net.sourceforge.bprocessor.model.modellor.Modellor#getContent() */ public Map getContent() { ! Map m = new HashMap(); ! m.put("bottomBound", bottomBound); ! m.put("rightBound", rightBound); ! m.put("leftBound", leftBound); ! m.put("topBound", topBound); ! m.put("depth", new Double(depth)); ! m.put("frame", frame); ! m.put("front", front); ! m.put("frameThickness", new Double(frameThickness)); ! m.put("horPosts", new Integer(horPosts)); ! m.put("horPostWidth", new Double(horPostWidth)); ! m.put("vertPosts", new Integer(vertPosts)); ! m.put("vertPostWidth", new Double(vertPostWidth)); ! m.put("type", new Integer(type)); ! m.put("name", name); ! return m; } } |