[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Edge.java,1.20,1.21
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2005-11-29 19:06:59
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30036 Modified Files: Edge.java Log Message: added a field to tell if this is a constructor edge, constructor edges will not be split Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Edge.java 28 Nov 2005 22:23:49 -0000 1.20 --- Edge.java 29 Nov 2005 19:06:51 -0000 1.21 *************** *** 39,42 **** --- 39,45 ---- private Vertex to; + /** Constructor */ + private boolean constructor; + /** * Constructor for persistence layer *************** *** 54,57 **** --- 57,61 ---- setFrom(null); setTo(null); + setConstructor(false); } *************** *** 143,146 **** --- 147,167 ---- /** + * Is the edge a constructor + * @return True if constructor; otherwise false + * @hibernate.property + */ + public boolean getConstructor() { + return constructor; + } + + /** + * Set if the edge is a constructor + * @param c True if constructor; otherwise false + */ + public void setConstructor(boolean c) { + constructor = c; + } + + /** * Return the other vertex than the given one, if the given one is one of them * @param v The vertex *************** *** 290,313 **** * TODO to split this edge by the vertex */ ! ! Vertex from = getFrom(); ! Vertex to = getTo(); ! Edge e1 = new Edge("", from, vertex); ! Project.getInstance().intern(e1); ! Edge e2 = new Edge("", vertex, to); ! Project.getInstance().intern(e2); ! ! ! Set surfaces = getSurfaces(); ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! current.replace(this, e1, e2); } - Project.getInstance().remove(this); } ! ! /** ! * String representation of the object * @return The string */ --- 311,335 ---- * TODO to split this edge by the vertex */ ! if (!constructor) { ! Vertex from = getFrom(); ! Vertex to = getTo(); ! Edge e1 = new Edge("", from, vertex); ! Project.getInstance().intern(e1); ! Edge e2 = new Edge("", vertex, to); ! Project.getInstance().intern(e2); ! ! ! Set surfaces = getSurfaces(); ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! current.replace(this, e1, e2); ! } ! Project.getInstance().remove(this); } } ! ! /** ! * String representation of the object * @return The string */ |