Thread: [Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Line.java, 1.12, 1.13 Point.java, 1.
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-07-21 14:59:51
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23765/src/net/sourceforge/bprocessor/model Modified Files: Line.java Point.java Project.java CoordinateSystem.java Log Message: implemented line and point get and set attribute Index: Point.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Point.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Point.java 6 Jul 2006 10:42:08 -0000 1.3 --- Point.java 21 Jul 2006 14:59:47 -0000 1.4 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.model; + import java.util.ArrayList; import java.util.HashSet; import java.util.List; *************** *** 52,57 **** */ public void setAttributes(List attributes) { ! // TODO Auto-generated method stub ! } --- 53,60 ---- */ public void setAttributes(List attributes) { ! Vertex orig = getOrigin(); ! orig.setX(((Double)(((Attribute)attributes.get(0)).getValue())).doubleValue()); ! orig.setY(((Double)(((Attribute)attributes.get(1)).getValue())).doubleValue()); ! orig.setZ(((Double)(((Attribute)attributes.get(2)).getValue())).doubleValue()); } *************** *** 60,65 **** */ public List getAttributes() { ! // TODO Auto-generated method stub ! return null; } --- 63,71 ---- */ public List getAttributes() { ! ArrayList res = new ArrayList(); ! res.add(new Attribute("X", new Double(getOrigin().getX()))); ! res.add(new Attribute("Y", new Double(getOrigin().getY()))); ! res.add(new Attribute("Z", new Double(getOrigin().getZ()))); ! return res; } Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** CoordinateSystem.java 21 Jul 2006 10:44:53 -0000 1.15 --- CoordinateSystem.java 21 Jul 2006 14:59:47 -0000 1.16 *************** *** 258,262 **** public List getAttributes() { // TODO Auto-generated method stub ! return null; } --- 258,263 ---- public List getAttributes() { // TODO Auto-generated method stub ! ArrayList res = new ArrayList(); ! return res; } Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Line.java 21 Jul 2006 10:45:43 -0000 1.12 --- Line.java 21 Jul 2006 14:59:47 -0000 1.13 *************** *** 54,58 **** */ public Vertex getDirection() { ! return dir.copy(); } --- 54,58 ---- */ public Vertex getDirection() { ! return dir; } *************** *** 95,99 **** */ public void setAttributes(List attributes) { ! //TODO implement method } --- 95,113 ---- */ public void setAttributes(List attributes) { ! Vertex orig = new Vertex(0, 0, 0); ! ! orig.setX(((Double)(((Attribute)attributes.get(1)).getValue())).doubleValue()); ! orig.setY(((Double)(((Attribute)attributes.get(2)).getValue())).doubleValue()); ! orig.setZ(((Double)(((Attribute)attributes.get(3)).getValue())).doubleValue()); ! setOrigin(orig); ! Vertex dir = new Vertex(0, 0, 0); ! dir.setX(((Double)(((Attribute)attributes.get(5)).getValue())).doubleValue()); ! dir.setY(((Double)(((Attribute)attributes.get(6)).getValue())).doubleValue()); ! dir.setZ(((Double)(((Attribute)attributes.get(7)).getValue())).doubleValue()); ! if (dir.length() != 0) { ! //TODO give some kind of warning ! setDirection(dir); ! } ! setActive(((Boolean)(((Attribute)attributes.get(10)).getValue())).booleanValue()); } *************** *** 102,110 **** */ public List getAttributes() { - //FIXME finish the method ArrayList res = new ArrayList(); ! ! res.add(new Attribute("Origin", getOrigin())); ! res.add(new Attribute("Direction", getDirection())); return res; } --- 116,135 ---- */ public List getAttributes() { ArrayList res = new ArrayList(); ! res.add(new Attribute("name", "Origin", false)); ! res.add(new Attribute("X", new Double(getOrigin().getX()))); ! res.add(new Attribute("Y", new Double(getOrigin().getY()))); ! res.add(new Attribute("Z", new Double(getOrigin().getZ()))); ! res.add(new Attribute("name", "Direction", false)); ! res.add(new Attribute("X", new Double(getDirection().getX()))); ! res.add(new Attribute("Y", new Double(getDirection().getY()))); ! res.add(new Attribute("Z", new Double(getDirection().getZ()))); ! res.add(new Attribute("Degrees-Y", new Double(degreesAboutY()), false)); ! res.add(new Attribute("Degrees-Z", new Double(degreesAboutZ()), false)); ! if (isActive()) { ! res.add(new Attribute("Active", Boolean.TRUE)); ! } else { ! res.add(new Attribute("Active", Boolean.FALSE)); ! } return res; } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Project.java 21 Jul 2006 10:46:27 -0000 1.63 --- Project.java 21 Jul 2006 14:59:47 -0000 1.64 *************** *** 880,882 **** --- 880,897 ---- this.activeCoordinateSystem = activeCoordinateSystem; } + + /** + * find all constructors + * @return The constructors + */ + public Collection getConstructors() { + Collection res = new HashSet(); + Collection spaces = getSpaces(); + Iterator iter = spaces.iterator(); + while (iter.hasNext()) { + res.addAll(((Space)iter.next()).getConstructors()); + } + res.addAll(world.getConstructors()); + return res; + } } |