[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Entity.java, 1.17, 1.18 Classificati
Status: Pre-Alpha
Brought to you by:
henryml
|
From: rimestad <rim...@us...> - 2007-05-08 11:51:12
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16885/src/net/sourceforge/bprocessor/model Modified Files: Entity.java Classification.java Project.java Log Message: refactored DBKtree containers out of genericTreeView to make sorting of nodes based on entitys only be on entitys and get rid of casting in the wild... made some cahanges so that the DBKtree are in deed updated on changes as well. There are still a error when adding own classifacations several times, but I think the error are in persistence not in the tree Index: Classification.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Classification.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Classification.java 7 May 2007 15:40:59 -0000 1.13 --- Classification.java 8 May 2007 11:08:11 -0000 1.14 *************** *** 81,85 **** setName(name); setType(type); ! setId(new String("-1")); setProdukt(""); } --- 81,85 ---- setName(name); setType(type); ! setId("-1"); setProdukt(""); } *************** *** 91,95 **** public Classification(int type) { setName("Classification"); ! setId(new String("0")); setType(type); setProdukt(""); --- 91,95 ---- public Classification(int type) { setName("Classification"); ! setId("0"); setType(type); setProdukt(""); *************** *** 193,197 **** } else { ! while (!par.getName().equalsIgnoreCase("Classification")) { fullId = par.getId() + "." + fullId; par = par.getParent(); --- 193,197 ---- } else { ! while (par != null) { fullId = par.getId() + "." + fullId; par = par.getParent(); Index: Entity.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Entity.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Entity.java 23 Apr 2007 14:48:38 -0000 1.17 --- Entity.java 8 May 2007 11:08:11 -0000 1.18 *************** *** 67,75 **** * @param entities List of entities to be sorted */ ! public static void sort(List< ? > entities) { ! final Comparator<Object> comparator = new Comparator<Object>() { ! public int compare(Object s1, Object s2) { ! Entity ent1 = (Entity) s1; ! Entity ent2 = (Entity) s2; Long id1 = ent1.getId(); Long id2 = ent2.getId(); --- 67,73 ---- * @param entities List of entities to be sorted */ ! public static void sort(List<? extends Entity> entities) { ! final Comparator<Entity> comparator = new Comparator<Entity>() { ! public int compare(Entity ent1, Entity ent2) { Long id1 = ent1.getId(); Long id2 = ent2.getId(); Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** Project.java 23 Apr 2007 14:50:13 -0000 1.121 --- Project.java 8 May 2007 11:08:11 -0000 1.122 *************** *** 59,66 **** /** The classification */ ! private Classification constructionClas = new Classification(0); /** The classification */ ! private Classification functionalClas = new Classification(1); /** The classification */ --- 59,66 ---- /** The classification */ ! private Classification constructionClas = new Classification("Constructional", 0); /** The classification */ ! private Classification functionalClas = new Classification("Functional", 1); /** The classification */ *************** *** 139,146 **** redoStack = new Stack(); copyBuffer = new LinkedList(); ! currentCamera = new Camera("(Current)", ! new double[]{6, 3, 2}, ! new double[]{7, -12, 16}, ! new double[]{0, 0, 1}, Camera.PERSPECTIVE); observers = new LinkedList(); staticObservers = new LinkedList(); --- 139,143 ---- redoStack = new Stack(); copyBuffer = new LinkedList(); ! resetCam(); observers = new LinkedList(); staticObservers = new LinkedList(); *************** *** 176,179 **** --- 173,186 ---- makeClean(); } + + /** + * + */ + public void resetCam() { + currentCamera = new Camera("(Current)", + new double[]{6, 3, 2}, + new double[]{7, -12, 16}, + new double[]{0, 0, 1}, Camera.PERSPECTIVE); + } /** *************** *** 861,865 **** bf = new BufferedReader( new InputStreamReader(new FileInputStream("construction2.txt"), "ISO-8859-1")); ! clas = new Classification(0); parent = new Classification(0); last = new Classification(0); --- 868,872 ---- bf = new BufferedReader( new InputStreamReader(new FileInputStream("construction2.txt"), "ISO-8859-1")); ! clas = new Classification("Constructional", 0); parent = new Classification(0); last = new Classification(0); *************** *** 867,871 **** bf = new BufferedReader( new InputStreamReader(new FileInputStream("functionals.txt"), "ISO-8859-1")); ! clas = new Classification(1); parent = new Classification(1); last = new Classification(1); --- 874,878 ---- bf = new BufferedReader( new InputStreamReader(new FileInputStream("functionals.txt"), "ISO-8859-1")); ! clas = new Classification("Functional", 1); parent = new Classification(1); last = new Classification(1); |