[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Selection.java, 1.15, 1.16
Status: Pre-Alpha
Brought to you by:
henryml
|
From: rimestad <rim...@us...> - 2006-12-03 17:48:28
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9755/src/net/sourceforge/bprocessor/model Modified Files: Selection.java Log Message: The selection is now only cleared if it contains something and i have added a ratain(object o) method that substitute the selection with a single object. Changed in SelectionStrategy to use retain(obect o) method instead of clear and add => onle one changed event on selection Index: Selection.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Selection.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Selection.java 3 Oct 2006 10:04:04 -0000 1.15 --- Selection.java 3 Dec 2006 17:48:20 -0000 1.16 *************** *** 105,110 **** */ public void clear() { ! clean(); ! changed(); } --- 105,112 ---- */ public void clear() { ! if (size() != 0) { ! clean(); ! changed(); ! } } *************** *** 265,268 **** --- 267,281 ---- /** + * Retain the given elements in collection + * @param object the object + * @return True if changed + */ + public boolean retain(Object object) { + clean(); + add(object); + return true; + } + + /** * Calculate center of selection * @return Center |