Thread: [Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Edge.java,1.39,1.40 Vertex.java,1.29,
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-03-17 18:59:30
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10793/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Surface.java Geometric.java Log Message: Changed nameing for Surface, Edge, Vertex depending on space-level or element-level. Workaround for problem in Surface.getAttributes() and AttributeView Removed hashcode and equals methods for Surface, Edge and Vertex Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** Surface.java 17 Mar 2006 09:30:34 -0000 1.82 --- Surface.java 17 Mar 2006 18:59:24 -0000 1.83 *************** *** 78,86 **** */ public String getName() { ! String name; if (id == null) { ! name = "S"; } else { ! name = "S" + id; } return name; --- 78,86 ---- */ public String getName() { ! String name = super.getName(); if (id == null) { ! name = name + "S"; } else { ! name = name + "S" + id; } return name; *************** *** 887,920 **** return null; } - - /** - * Return the hash code of the object - * @return The hash - */ - public int hashCode() { - if (id == null) { - return super.hashCode(); - } else { - return id.hashCode(); - } - } - - /** - * Indicates whether some other object is equal to this one. - * @param o The other object - * @return True if equal; otherwise false - */ - public boolean equals(Object o) { - if (!(o instanceof Surface)) { - return false; - } - Surface s = (Surface)o; - - if (id == null || s.getId() == null) { - return this == s; - } else { - return this.id.equals(s.getId()); - } - } /** --- 887,890 ---- *************** *** 961,965 **** res.add(new Attribute("Space", "None", false)); } ! res.add(new Attribute("Front Material", getId())); if (getBackDomain() != null) { res.add(new Attribute("Space", getBackDomain(), false)); --- 931,940 ---- res.add(new Attribute("Space", "None", false)); } ! // FIXME The material attribute should be ... a material! ! // The id does not work if this is not a toplevel surface. ! if (getMesh() == Project.getInstance().mesh()) { ! res.add(new Attribute("Front Material", getId())); ! } ! if (getBackDomain() != null) { res.add(new Attribute("Space", getBackDomain(), false)); *************** *** 967,971 **** res.add(new Attribute("Space", "None", false)); } ! res.add(new Attribute("Back Material", getId())); if (isInner()) { res.add(new Attribute("Exterior", getExterior(), false)); --- 942,950 ---- res.add(new Attribute("Space", "None", false)); } ! // FIXME The material attribute should be ... a material! ! // The id does not work if this is not a toplevel surface. ! if (getMesh() == Project.getInstance().mesh()) { ! res.add(new Attribute("Back Material", getId())); ! } if (isInner()) { res.add(new Attribute("Exterior", getExterior(), false)); Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Edge.java 17 Mar 2006 09:30:34 -0000 1.39 --- Edge.java 17 Mar 2006 18:59:24 -0000 1.40 *************** *** 145,153 **** */ public String getName() { ! String name; if (id == null) { ! name = "E"; } else { ! name = "E" + id; } return name; --- 145,154 ---- */ public String getName() { ! String name = super.getName(); ! if (id == null) { ! name = name + "E"; } else { ! name = name + "E" + id; } return name; *************** *** 199,232 **** /** - * Return the hash code of the object - * @return The hash - */ - public int hashCode() { - if (id == null) { - return super.hashCode(); - } else { - return id.hashCode(); - } - } - - /** - * Indicates whether some other object is equal to this one. - * @param o The other object - * @return True if equal; otherwise false - */ - public boolean equals(Object o) { - if (!(o instanceof Edge)) { - return false; - } - Edge e = (Edge)o; - - if (id == null || e.getId() == null) { - return this == e; - } else { - return this.id.equals(e.getId()); - } - } - - /** * Find the intersection between this Edge and the Other. * The intersection is considered to be the shortest Edge --- 200,203 ---- Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Vertex.java 17 Mar 2006 09:30:34 -0000 1.29 --- Vertex.java 17 Mar 2006 18:59:24 -0000 1.30 *************** *** 65,73 **** */ public String getName() { ! String name; if (id != null) { ! name = "V" + id; } else { ! name = "V"; } return name; --- 65,73 ---- */ public String getName() { ! String name = super.getName(); if (id != null) { ! name = name + "V" + id; } else { ! name = name + "V"; } return name; *************** *** 296,329 **** /** - * Return the hash code of the object - * @return The hash - */ - public int hashCode() { - if (id == null) { - return super.hashCode(); - } else { - return id.hashCode(); - } - } - - /** - * Indicates whether some other object is equal to this one. - * @param o The other object - * @return True if equal; otherwise false - */ - public boolean equals(Object o) { - if (!(o instanceof Vertex)) { - return false; - } - Vertex v = (Vertex)o; - - if (id == null || v.getId() == null) { - return this == v; - } else { - return this.id.equals(v.getId()); - } - } - - /** * String representation of the object * @return The string --- 296,299 ---- Index: Geometric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Geometric.java 1 Feb 2006 11:45:25 -0000 1.2 --- Geometric.java 17 Mar 2006 18:59:24 -0000 1.3 *************** *** 31,33 **** --- 31,49 ---- this.mesh = mesh; } + + /** + * Get the name + * @return The name + */ + public String getName() { + String name; + if (getMesh() == Project.getInstance().mesh()) { + name = ""; + } else { + name = "E"; + } + return name; + } + + } |