Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28510/src/net/sourceforge/bprocessor/model
Modified Files:
Component.java
Log Message:
Created a preview Panel
Index: Component.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Component.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Component.java 19 Nov 2007 10:51:41 -0000 1.3
--- Component.java 19 Nov 2007 17:50:21 -0000 1.4
***************
*** 119,123 ****
List<Attribute> att = new LinkedList<Attribute>();
att.add(new Attribute("name", getName()));
! att.add(new Attribute("levels", new Selector<String>(getLevelStrings())));
att.add(new Attribute("geometry", getSpace()));
att.add(new Attribute("Locked", isLocked()));
--- 119,126 ----
List<Attribute> att = new LinkedList<Attribute>();
att.add(new Attribute("name", getName()));
! att.add(new Attribute("Project", worksAtLevel(Space.PROJECT_LEVEL)));
! att.add(new Attribute("Space", worksAtLevel(Space.SPACE_LEVEL)));
! att.add(new Attribute("Element", worksAtLevel(Space.ELEMENT_LEVEL)));
! att.add(new Attribute("Part", worksAtLevel(Space.PART_LEVEL)));
att.add(new Attribute("geometry", getSpace()));
att.add(new Attribute("Locked", isLocked()));
***************
*** 129,145 ****
att.add(new Attribute("Author", getAuthor()));
att.add(new Attribute("Version", getVersion()));
return att;
}
!
! private List<String> getLevelStrings() {
! List<String> strings = new LinkedList<String>();
! int lvl = Space.SPACE_LEVEL;
! for (int i = 0; i < Space.PART_LEVEL; i++) {
! if ((useableLevels & (1 >> i)) == (1 >> i)) {
! strings.add(Space.levelToString(lvl));
! }
! lvl++;
}
! return strings;
}
--- 132,145 ----
att.add(new Attribute("Author", getAuthor()));
att.add(new Attribute("Version", getVersion()));
+ att.add(new Attribute("Preview", this));
return att;
}
!
! private boolean worksAtLevel(int spaceLevel) {
! int lvl = 1 >> (spaceLevel - Space.PROJECT_LEVEL);
! if ((getUseLevel() & lvl) == lvl) {
! return true;
}
! return false;
}
|