[Bprocessor-commit] /model/src/net/sourceforge/bprocessor/model Space.java, 1.145, 1.146
Status: Pre-Alpha
Brought to you by:
henryml
|
From: rimestad <rim...@us...> - 2007-05-24 11:00:15
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18811/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: changed the string printing for the level to be generated only at one point in the code and made i more correct Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** Space.java 20 May 2007 10:28:52 -0000 1.145 --- Space.java 24 May 2007 11:00:11 -0000 1.146 *************** *** 1627,1630 **** --- 1627,1633 ---- return "Instance"; } + if (isUnion()) { + return "Union"; + } String res = ""; switch (type) { *************** *** 1636,1657 **** break; } ! switch (level) { ! case SPACE_LEVEL: ! res = res.concat("Space"); ! break; ! case ELEMENT_LEVEL: ! res = res.concat("Element"); ! break; ! case PART_LEVEL: ! res = res.concat("Part"); ! break; ! case NET_LEVEL: ! res = "B-net"; ! break; ! } ! if (isUnion()) { ! res = res.concat("(Union)"); ! } ! return res; } --- 1639,1643 ---- break; } ! return res.concat(Space.levelToString(level)); } *************** *** 1682,1685 **** --- 1668,1674 ---- break; } + if (isUnion()) { + return res + " Union"; + } if (getClassification() != null) { return getClassification().toString() + " - " + res + id; *************** *** 2650,2669 **** if (isUnion()) { return "Union"; - } - if (getLevel() == Space.PROJECT_LEVEL) { - return "Project"; - } else if (getLevel() == Space.SPACE_LEVEL) { - return "Space"; - } else if (getLevel() == Space.ELEMENT_LEVEL) { - return "Element"; - } else if (getLevel() == Space.PART_LEVEL) { - return "Part"; - } else if (getLevel() == Space.NET_LEVEL) { - return "Net"; - } else if (getLevel() == Space.NET_LEVEL + 1) { - return "Net-void"; } else { ! log.error("Not a valid level"); ! return ""; } } --- 2639,2644 ---- if (isUnion()) { return "Union"; } else { ! return levelToString(getLevel()); } } *************** *** 2941,2950 **** /** * A method the can convert a level of a space to the string rep for it ! * @param level2 the level * @return the sting representation */ ! public static String levelToSting(int level2) { String res = ""; ! switch (level2) { case PROJECT_LEVEL: res += "Project"; --- 2916,2925 ---- /** * A method the can convert a level of a space to the string rep for it ! * @param level the level * @return the sting representation */ ! public static String levelToString(int level) { String res = ""; ! switch (level) { case PROJECT_LEVEL: res += "Project"; *************** *** 2962,2965 **** --- 2937,2943 ---- res += "Net"; break; + case NET_LEVEL + 1: + res += "Net-void"; + break; default: break; |