Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4335/src/net/sourceforge/bprocessor/gui/treeview
Modified Files:
DBKTreeView.java
Log Message:
Made the way the attributes are pressented for classification and classificationtype look better and added a types folder to the DBK tree. Made the project hold all the possible types to make it possible to alter them. Space can now hold their own classificationtype parameter values if they are altered there.
Index: DBKTreeView.java
===================================================================
RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/DBKTreeView.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DBKTreeView.java 8 May 2007 12:34:06 -0000 1.4
--- DBKTreeView.java 9 Aug 2007 16:07:48 -0000 1.5
***************
*** 8,14 ****
--- 8,21 ----
package net.sourceforge.bprocessor.gui.treeview;
+ import java.util.ArrayList;
+ import java.util.Collection;
+ import java.util.Collections;
+ import java.util.Comparator;
+ import java.util.List;
+
import javax.swing.ImageIcon;
import net.sourceforge.bprocessor.model.Classification;
+ import net.sourceforge.bprocessor.model.ClassificationType;
import net.sourceforge.bprocessor.model.Project;
***************
*** 29,34 ****
super();
root.removeAllChildren();
! root.add(new ClassificationContainer(Project.getInstance().getConstructionClas()));
! root.add(new ClassificationContainer(Project.getInstance().getFunctionalClas()));
model.nodeStructureChanged(root);
}
--- 36,42 ----
super();
root.removeAllChildren();
! root.add(new ClassificationContainer(Project.getConstructionClas()));
! root.add(new ClassificationContainer(Project.getFunctionalClas()));
! root.add(new ClassificationTypeContainer(Project.getClassificatioTypes()));
model.nodeStructureChanged(root);
}
***************
*** 39,44 ****
public void update() {
if (root.getChildCount() == 2) {
! ((GenericNode)root.getChildAt(0)).update(Project.getInstance().getConstructionClas());
! ((GenericNode)root.getChildAt(1)).update(Project.getInstance().getFunctionalClas());
}
}
--- 47,117 ----
public void update() {
if (root.getChildCount() == 2) {
! ((GenericNode)root.getChildAt(0)).update(Project.getConstructionClas());
! ((GenericNode)root.getChildAt(1)).update(Project.getFunctionalClas());
! ((GenericNode)root.getChildAt(2)).update(Project.getClassificatioTypes());
! }
! }
!
! private class ClassificationTypeComparator implements Comparator<ClassificationType> {
! public int compare(ClassificationType o1, ClassificationType o2) {
! return o1.getName().compareTo(o2.getName());
! }
! }
!
! private class ClassificationTypeContainer extends GenericNode {
! private List<ClassificationType> types;
!
! /**
! * Constructor for ClassificationTypeContainer
! * @param object The classificationType list
! */
! public ClassificationTypeContainer(Object object) {
! super("Types");
! types = new ArrayList((Collection<ClassificationType>)object);
! Collections.sort(types, new ClassificationTypeComparator());
! for (ClassificationType ct : types) {
! this.add(new ClassificationTypeNode(ct));
! }
! }
!
! /**
! * Return icon
! * @return Icon
! */
! public ImageIcon icon() {
! return surfacegroupicon;
! }
!
! /**
! * @param c the object to update with
! */
! public void update(Object c) {
! }
! }
!
! private class ClassificationTypeNode extends GenericNode {
! public ClassificationTypeNode(Object object) {
! super(object);
! if (object instanceof ClassificationType) {
! ClassificationType ct = (ClassificationType)object;
! for (ClassificationType c : ct.getChildren()) {
! this.add(new ClassificationTypeNode(c));
! }
! }
! }
!
! /**
! * Return icon
! * @return Icon
! */
! public ImageIcon icon() {
! return surfacegroupicon;
! }
!
! /**
! * @param c the object to update with
! */
! public void update(Object c) {
!
}
}
|