[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Space.java, 1.65, 1.66 Project.java,
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-09-26 09:52:27
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19081/src/net/sourceforge/bprocessor/model Modified Files: Space.java Project.java Persistence.java Log Message: added levels to space and added union as a boolean, now the entire program uses that change Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Persistence.java 17 Sep 2006 21:58:27 -0000 1.8 --- Persistence.java 26 Sep 2006 09:52:24 -0000 1.9 *************** *** 130,136 **** Collection elements = new LinkedList(); int type = xml.getType(); long empty = xml.getVoidref(); boolean container = (empty != 0); ! Space space = new Space(name, type, container); space.setId(new Long(xml.getProgid())); space.setDescription(xml.getDescription()); --- 130,137 ---- Collection elements = new LinkedList(); int type = xml.getType(); + int level = xml.getLevel(); long empty = xml.getVoidref(); boolean container = (empty != 0); ! Space space = new Space(name, type, level, container); space.setId(new Long(xml.getProgid())); space.setDescription(xml.getDescription()); *************** *** 539,542 **** --- 540,544 ---- xml.setName(space.getName()); xml.setType(space.getType()); + xml.setLevel(space.getLevel()); xml.setDescription(space.getDescription().toString()); xml.setClassification(space.getClassification().toString()); Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** Space.java 19 Sep 2006 10:00:09 -0000 1.65 --- Space.java 26 Sep 2006 09:52:24 -0000 1.66 *************** *** 41,47 **** public static final int CONSTRUCTION = 0; ! /** Functional Type */ public static final int FUNCTIONAL = 1; /** The logger */ private static Logger log = Logger.getLogger(Space.class); --- 41,62 ---- public static final int CONSTRUCTION = 0; ! /** functional Type */ public static final int FUNCTIONAL = 1; + /** project level */ + public static final int PROJECT_LEVEL = 2; + + /** Space level */ + public static final int SPACE_LEVEL = 3; + + /** Element level */ + public static final int ELEMENT_LEVEL = 4; + + /** part level */ + public static final int PART_LEVEL = 5; + + /** part Functional Type */ + private boolean isUnion = false; + /** The logger */ private static Logger log = Logger.getLogger(Space.class); *************** *** 75,78 **** --- 90,94 ---- /** The elements (a list of spaces) */ private HashMap elements; + /** The next element id */ private long nextElementId; *************** *** 140,146 **** --- 156,166 ---- /** The modellor */ private Modellor modellor; + /** type */ private int type; + /** level Space element or part */ + private int level; + /** *************** *** 154,163 **** * @param name The name * @param type The type * @param container The container flag */ ! public Space(String name, int type, boolean container) { super(); setName(name); setType(type); setTransparent(false); setClassification("None"); --- 174,185 ---- * @param name The name * @param type The type + * @param level The level * @param container The container flag */ ! public Space(String name, int type, int level, boolean container) { super(); setName(name); setType(type); + this.level = level; setTransparent(false); setClassification("None"); *************** *** 179,183 **** constructors = new HashMap(); nextConstructorId = 1; ! empty = new Space("Void", FUNCTIONAL, false); this.add(empty); } --- 201,205 ---- constructors = new HashMap(); nextConstructorId = 1; ! empty = new Space("Void", FUNCTIONAL, level + 1, false); this.add(empty); } *************** *** 188,194 **** * @param name The name * @return The space */ ! public static Space createConstructionSpace(String name) { ! return new Space(name, Space.CONSTRUCTION, true); } --- 210,229 ---- * @param name The name * @return The space + * @throws Exception If a part is being extended */ ! public Space createConstructionSpace(String name) throws Exception { ! if (this.level == PART_LEVEL) { ! throw new Exception("Not leagal to make further levels of detail, max level is PART"); ! } ! if (this.level == ELEMENT_LEVEL) { ! return new Space(name, Space.CONSTRUCTION, PART_LEVEL, false); ! } ! if (this.level == SPACE_LEVEL) { ! return new Space(name, Space.CONSTRUCTION, ELEMENT_LEVEL, true); ! } ! if (this.level == PROJECT_LEVEL) { ! return new Space(name, Space.CONSTRUCTION, SPACE_LEVEL, true); ! } ! return null; } *************** *** 197,203 **** * @param name The name * @return The space */ ! public static Space createFunctionalSpace(String name) { ! return new Space(name, Space.FUNCTIONAL, true); } --- 232,251 ---- * @param name The name * @return The space + * @throws Exception If a part is being extended */ ! public Space createFunctionalSpace(String name) throws Exception { ! if (this.level == PART_LEVEL) { ! throw new Exception("Not leagal to make further levels of detail, max level is PART"); ! } ! if (this.level == ELEMENT_LEVEL) { ! return new Space(name, Space.FUNCTIONAL, PART_LEVEL, true); ! } ! if (this.level == SPACE_LEVEL) { ! return new Space(name, Space.FUNCTIONAL, ELEMENT_LEVEL, true); ! } ! if (this.level == PROJECT_LEVEL) { ! return new Space(name, Space.FUNCTIONAL, SPACE_LEVEL, true); ! } ! return null; } *************** *** 339,343 **** constructors.clear(); nextConstructorId = 1; ! empty = new Space("Void", FUNCTIONAL, false); this.add(empty); } --- 387,391 ---- constructors.clear(); nextConstructorId = 1; ! empty = new Space("Void", FUNCTIONAL, this.level, false); this.add(empty); } *************** *** 1202,1209 **** } if (getOwner().getModellor() != null) { ! Project.info("owner has modellor"); Parametric parameters = getOwner().getModellor().get(this); if (parameters != null) { ! Project.info("owner has parameters"); res.add(new Attribute(parameters.getGeneralName(), parameters)); } --- 1250,1257 ---- } if (getOwner().getModellor() != null) { ! log.info("owner has modellor"); Parametric parameters = getOwner().getModellor().get(this); if (parameters != null) { ! log.info("owner has parameters"); res.add(new Attribute(parameters.getGeneralName(), parameters)); } *************** *** 1221,1231 **** */ public String getGeneralName() { ! if (isConstructionSpace()) { ! return "Construction Space"; } ! if (isFunctionalSpace()) { ! return "Functional Space"; } ! return "Space"; } --- 1269,1299 ---- */ public String getGeneralName() { ! if (proto != null) { ! return "Instance"; } ! String res = ""; ! switch (type) { ! case CONSTRUCTION: ! res = res.concat("Constructional "); ! break; ! case FUNCTIONAL: ! res = res.concat("Functional "); ! 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; ! } ! if (isUnion()) { ! res = res.concat("(Union)"); ! } ! return res; } *************** *** 1325,1330 **** --- 1393,1400 ---- Space copy = new Space("", this.getType(), + this.getLevel(), this.isContainer()); copy.setName(this.getName()); + copy.setUnion(this.isUnion()); Set envelopeCopy = copyEnvelope(copiedVertices, copiedEdges, *************** *** 1929,1931 **** --- 1999,2022 ---- return true; } + + /** + * @return Returns the isUnion. + */ + public boolean isUnion() { + return isUnion; + } + + /** + * @param isUnion The isUnion to set. + */ + public void setUnion(boolean isUnion) { + this.isUnion = isUnion; + } + + /** + * @return Returns the level. + */ + public int getLevel() { + return level; + } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** Project.java 17 Sep 2006 22:00:02 -0000 1.74 --- Project.java 26 Sep 2006 09:52:24 -0000 1.75 *************** *** 114,118 **** addCams(); observers = new LinkedList(); ! world = new Space("Project", Space.FUNCTIONAL, true); world.setId(new Long(0)); activeCoordinateSystem = new CoordinateSystem(new Vertex(1, 0, 0), new Vertex(0, 1, 0), --- 114,118 ---- addCams(); observers = new LinkedList(); ! world = new Space("Project", Space.FUNCTIONAL, Space.PROJECT_LEVEL, true); world.setId(new Long(0)); activeCoordinateSystem = new CoordinateSystem(new Vertex(1, 0, 0), new Vertex(0, 1, 0), *************** *** 881,892 **** setSavePath(null); } - - /** - * Attribute Info - * @param info String - */ - public static void info(Object info) { - log.info(info); - } /** --- 881,884 ---- |