Thread: [Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Space.java, 1.69, 1.70 Project.java,
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-10-03 10:04:13
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11296/src/net/sourceforge/bprocessor/model Modified Files: Space.java Project.java Selection.java Log Message: comit Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** Space.java 29 Sep 2006 14:57:24 -0000 1.69 --- Space.java 3 Oct 2006 10:04:04 -0000 1.70 *************** *** 1225,1229 **** } else { ! if (getOwner().getOwner() == Project.getInstance().world()) { if (isConstructionSpace()) { res.add(new Attribute("Classification", elementConstructionOptions, getClassification())); --- 1225,1229 ---- } else { ! if (getLevel() == Space.ELEMENT_LEVEL) { if (isConstructionSpace()) { res.add(new Attribute("Classification", elementConstructionOptions, getClassification())); *************** *** 1231,1235 **** res.add(new Attribute("Classification", elementFunctionalOptions, getClassification())); } ! } else { if (isConstructionSpace()) { res.add(new Attribute("Classification", partConstructionOptions, getClassification())); --- 1231,1235 ---- res.add(new Attribute("Classification", elementFunctionalOptions, getClassification())); } ! } else if (getLevel() == Space.PART_LEVEL) { if (isConstructionSpace()) { res.add(new Attribute("Classification", partConstructionOptions, getClassification())); *************** *** 1238,1242 **** } } - } if (isConstructionSpace()) { --- 1238,1241 ---- *************** *** 1251,1255 **** res.add(new Attribute("Modellor", getModellor())); } ! if (getOwner().getModellor() != null) { log.info("owner has modellor"); Parametric parameters = getOwner().getModellor().get(this); --- 1250,1254 ---- res.add(new Attribute("Modellor", getModellor())); } ! if (getOwner() != null && getOwner().getModellor() != null) { log.info("owner has modellor"); Parametric parameters = getOwner().getModellor().get(this); Index: Selection.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Selection.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Selection.java 28 Aug 2006 06:51:29 -0000 1.14 --- Selection.java 3 Oct 2006 10:04:04 -0000 1.15 *************** *** 70,73 **** --- 70,76 ---- */ public boolean add(Object object) { + if (object == null) { + return false; + } if (!(object instanceof Geometric)) { throw new Error("Illegal object added to selection " + object.getClass().getName()); *************** *** 99,107 **** /** * Clear the selection */ public void clear() { mark.clear(); selection.clear(); - changed(); } --- 102,119 ---- /** * Clear the selection + * ONLY TO BE USED IF NOTHING IS ADDED TO THE SELECTION */ public void clear() { + clean(); + changed(); + } + + /** + * dont call clean + * + */ + private void clean() { mark.clear(); selection.clear(); } *************** *** 111,117 **** */ public void set(Object object) { ! clear(); add(object); - changed(); } --- 123,128 ---- */ public void set(Object object) { ! clean(); add(object); } *************** *** 203,206 **** --- 214,220 ---- while (iter.hasNext()) { Object current = iter.next(); + if (!(current instanceof Geometric)) { + throw new Error("Illegal object added to selection " + current.getClass().getName()); + } if (mark.add(current)) { selection.add(current); *************** *** 245,251 **** */ public boolean retainAll(Collection objects) { ! clear(); addAll(objects); - changed(); return true; } --- 259,264 ---- */ public boolean retainAll(Collection objects) { ! clean(); addAll(objects); return true; } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** Project.java 2 Oct 2006 06:10:10 -0000 1.77 --- Project.java 3 Oct 2006 10:04:04 -0000 1.78 *************** *** 939,942 **** --- 939,943 ---- } } + changed(this); } *************** *** 984,987 **** --- 985,996 ---- /** + * String representation of the object + * @return The string + */ + public String toString() { + return getName(); + } + + /** * * @param object Object |