[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Line.java, 1.31, 1.32 Rotate.java, 1
Status: Pre-Alpha
Brought to you by:
henryml
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15574/src/net/sourceforge/bprocessor/model Modified Files: Line.java Rotate.java AxisRotate.java Project.java Relation.java CoordinateSystem.java Classification.java Edge.java Vertex.java Material.java ClippingPlane.java Surface.java TransformStack.java Translate.java Camera.java Space.java Scale.java IDTransform.java Point.java Attribute.java Log Message: made get and set attributes generic Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** Edge.java 15 Apr 2007 10:43:40 -0000 1.84 --- Edge.java 16 Apr 2007 15:55:22 -0000 1.85 *************** *** 596,603 **** * @param attributes The attributes to set */ ! public void setAttributes(List attributes) { ! Iterator iter = attributes.iterator(); ! while (iter.hasNext()) { ! Attribute a = (Attribute)iter.next(); if (a.getName().equals("Name")) { continue; --- 596,601 ---- * @param attributes The attributes to set */ ! public void setAttributes(List<Attribute> attributes) { ! for (Attribute a : attributes) { if (a.getName().equals("Name")) { continue; *************** *** 612,617 **** * @return the list of attributes for the object */ ! public List getAttributes() { ! ArrayList res = new ArrayList(); res.add(new Attribute("Name", getName(), false)); res.add(new Attribute("Owner", getOwner(), false)); --- 610,615 ---- * @return the list of attributes for the object */ ! public List<Attribute> getAttributes() { ! ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("Name", getName(), false)); res.add(new Attribute("Owner", getOwner(), false)); Index: Rotate.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Rotate.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Rotate.java 28 Nov 2006 10:06:34 -0000 1.3 --- Rotate.java 16 Apr 2007 15:55:22 -0000 1.4 *************** *** 9,13 **** import java.util.ArrayList; - import java.util.Iterator; import java.util.List; --- 9,12 ---- *************** *** 95,102 **** * @param attributes List */ ! public void setAttributes(List attributes) { ! Iterator iter = attributes.iterator(); ! while (iter.hasNext()) { ! Attribute a = (Attribute)iter.next(); if (a.getName().equals("Rotate X")) { rx(((Double)a.getValue()).doubleValue()); --- 94,99 ---- * @param attributes List */ ! public void setAttributes(List<Attribute> attributes) { ! for (Attribute a : attributes) { if (a.getName().equals("Rotate X")) { rx(((Double)a.getValue()).doubleValue()); *************** *** 115,120 **** * @return List */ ! public List getAttributes() { ! ArrayList res = new ArrayList(); res.add(new Attribute("Rotate X", new Double(rx()))); res.add(new Attribute("Rotate Y", new Double(ry()))); --- 112,117 ---- * @return List */ ! public List<Attribute> getAttributes() { ! ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("Rotate X", new Double(rx()))); res.add(new Attribute("Rotate Y", new Double(ry()))); Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** CoordinateSystem.java 11 Apr 2007 12:19:41 -0000 1.49 --- CoordinateSystem.java 16 Apr 2007 15:55:22 -0000 1.50 *************** *** 502,506 **** /** {@inheritDoc} */ ! public void setAttributes(List attributes) { Vertex orig = new Vertex(0, 0, 0); orig.setX(((Double)(((Attribute)attributes.get(1)).getValue())).doubleValue()); --- 502,506 ---- /** {@inheritDoc} */ ! public void setAttributes(List<Attribute> attributes) { Vertex orig = new Vertex(0, 0, 0); orig.setX(((Double)(((Attribute)attributes.get(1)).getValue())).doubleValue()); *************** *** 540,545 **** /** {@inheritDoc} */ ! public List getAttributes() { ! ArrayList res = new ArrayList(); res.add(new Attribute("Origin", "", false)); res.add(new Attribute("x", new Double(getOrigin().getX()))); --- 540,545 ---- /** {@inheritDoc} */ ! public List<Attribute> getAttributes() { ! ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("Origin", "", false)); res.add(new Attribute("x", new Double(getOrigin().getX()))); Index: Classification.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Classification.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Classification.java 11 Apr 2007 12:13:20 -0000 1.11 --- Classification.java 16 Apr 2007 15:55:22 -0000 1.12 *************** *** 247,252 **** * @return the list of attributes for the object */ ! public List getAttributes() { ! ArrayList res = new ArrayList(); res.add(new Attribute("Name", getName(), false)); res.add(new Attribute("Code", getFullId(null), false)); --- 247,252 ---- * @return the list of attributes for the object */ ! public List<Attribute> getAttributes() { ! ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("Name", getName(), false)); res.add(new Attribute("Code", getFullId(null), false)); *************** *** 269,273 **** * @param attributes The attributes to set */ ! public void setAttributes(List attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { --- 269,273 ---- * @param attributes The attributes to set */ ! public void setAttributes(List<Attribute> attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { Index: Translate.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Translate.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Translate.java 28 Nov 2006 10:06:34 -0000 1.3 --- Translate.java 16 Apr 2007 15:55:22 -0000 1.4 *************** *** 9,13 **** import java.util.ArrayList; - import java.util.Iterator; import java.util.List; --- 9,12 ---- *************** *** 96,103 **** * @param attributes List */ ! public void setAttributes(List attributes) { ! Iterator iter = attributes.iterator(); ! while (iter.hasNext()) { ! Attribute a = (Attribute)iter.next(); if (a.getName().equals("Translate X")) { tx(((Double)a.getValue()).doubleValue()); --- 95,100 ---- * @param attributes List */ ! public void setAttributes(List<Attribute> attributes) { ! for (Attribute a : attributes) { if (a.getName().equals("Translate X")) { tx(((Double)a.getValue()).doubleValue()); Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Camera.java 6 Mar 2007 14:11:35 -0000 1.39 --- Camera.java 16 Apr 2007 15:55:22 -0000 1.40 *************** *** 545,549 **** * @param attributes The attributes to set */ ! public void setAttributes(List attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { --- 545,549 ---- * @param attributes The attributes to set */ ! public void setAttributes(List<Attribute> attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { *************** *** 585,589 **** * @return the list of attributes for the object */ ! public List getAttributes() { ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("Name", getName())); --- 585,589 ---- * @return the list of attributes for the object */ ! public List<Attribute> getAttributes() { ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("Name", getName())); Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.156 retrieving revision 1.157 diff -C2 -d -r1.156 -r1.157 *** Surface.java 15 Apr 2007 10:45:21 -0000 1.156 --- Surface.java 16 Apr 2007 15:55:22 -0000 1.157 *************** *** 1694,1701 **** * @param attributes The attributes to set */ ! public void setAttributes(List attributes) { ! Iterator iter = attributes.iterator(); ! while (iter.hasNext()) { ! Attribute a = (Attribute)iter.next(); if (a.getName().equals("Name")) { continue; --- 1694,1699 ---- * @param attributes The attributes to set */ ! public void setAttributes(List<Attribute> attributes) { ! for (Attribute a : attributes) { if (a.getName().equals("Name")) { continue; *************** *** 1737,1742 **** * @return the list of attributes for the object */ ! public List getAttributes() { ! ArrayList res = new ArrayList(); res.add(new Attribute("Name", getName(), false)); if (getOwner() == Project.getInstance().world()) { --- 1735,1740 ---- * @return the list of attributes for the object */ ! public List<Attribute> getAttributes() { ! ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("Name", getName(), false)); if (getOwner() == Project.getInstance().world()) { Index: Material.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Material.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Material.java 15 May 2006 09:20:46 -0000 1.8 --- Material.java 16 Apr 2007 15:55:22 -0000 1.9 *************** *** 7,10 **** --- 7,12 ---- package net.sourceforge.bprocessor.model; + import java.io.Serializable; + /** * The Material of a Surface *************** *** 15,19 **** * usage="read-write" */ ! public class Material { /** The name of the material */ --- 17,21 ---- * usage="read-write" */ ! public class Material implements Serializable { /** The name of the material */ *************** *** 30,33 **** --- 32,36 ---- */ public Material() { + setColor(0, 0, 0); } *************** *** 39,43 **** public Material(String name, float[] color3fv) { setName(name); ! setColor(color3fv); } --- 42,50 ---- public Material(String name, float[] color3fv) { setName(name); ! if (color3fv != null) { ! setColor(color3fv); ! } else { ! setColor(0, 0, 0); ! } } *************** *** 84,88 **** */ public void setColor(float[] color3fv) { ! this.color = color3fv; } --- 91,112 ---- */ public void setColor(float[] color3fv) { ! if (color3fv.length >= 3) { ! setColor(color3fv[0], color3fv[1], color3fv[2]); ! } ! } ! ! /** ! * Set the color array to the given floats ! * @param r the red component ! * @param g the green component ! * @param b the blue component ! */ ! public void setColor(float r, float g, float b) { ! if (this.color == null) { ! this.color = new float[3]; ! } ! this.color[0] = r; ! this.color[1] = g; ! this.color[2] = b; } *************** *** 93,97 **** */ public float[] getColor() { ! return color; } } --- 117,121 ---- */ public float[] getColor() { ! return (float[]) color.clone(); } } Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ClippingPlane.java 19 Feb 2007 15:50:14 -0000 1.18 --- ClippingPlane.java 16 Apr 2007 15:55:22 -0000 1.19 *************** *** 331,336 **** /** {@inheritDoc} */ ! public List getAttributes() { ! ArrayList res = new ArrayList(); if (isActive()) { res.add(new Attribute("isActive", Boolean.TRUE)); --- 331,336 ---- /** {@inheritDoc} */ ! public List<Attribute> getAttributes() { ! ArrayList<Attribute> res = new ArrayList<Attribute>(); if (isActive()) { res.add(new Attribute("isActive", Boolean.TRUE)); *************** *** 360,364 **** /** {@inheritDoc} */ ! public void setAttributes(List attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { --- 360,364 ---- /** {@inheritDoc} */ ! public void setAttributes(List<Attribute> attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { Index: Point.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Point.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Point.java 13 Mar 2007 15:21:24 -0000 1.15 --- Point.java 16 Apr 2007 15:55:22 -0000 1.16 *************** *** 45,49 **** /** {@inheritDoc} */ ! public void setAttributes(List attributes) { Vertex orig = getOrigin(); orig.setX(((Double)(((Attribute)attributes.get(0)).getValue())).doubleValue()); --- 45,49 ---- /** {@inheritDoc} */ ! public void setAttributes(List<Attribute> attributes) { Vertex orig = getOrigin(); orig.setX(((Double)(((Attribute)attributes.get(0)).getValue())).doubleValue()); *************** *** 53,58 **** /** {@inheritDoc} */ ! 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()))); --- 53,58 ---- /** {@inheritDoc} */ ! public List<Attribute> getAttributes() { ! ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("X", new Double(getOrigin().getX()))); res.add(new Attribute("Y", new Double(getOrigin().getY()))); Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** Project.java 14 Apr 2007 15:00:47 -0000 1.118 --- Project.java 16 Apr 2007 15:55:22 -0000 1.119 *************** *** 770,774 **** * @param attributes The attributes to set */ ! public void setAttributes(List attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { --- 770,774 ---- * @param attributes The attributes to set */ ! public void setAttributes(List<Attribute> attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { *************** *** 787,792 **** * @return the list of attributes for the object */ ! public List getAttributes() { ! ArrayList res = new ArrayList(); res.add(new Attribute("Name", getName())); //res.add(new Attribute("Energyloss", new Double(EnergyCalc.energyLoss()), false)); --- 787,792 ---- * @return the list of attributes for the object */ ! public List<Attribute> getAttributes() { ! ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("Name", getName())); //res.add(new Attribute("Energyloss", new Double(EnergyCalc.energyLoss()), false)); Index: Attribute.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Attribute.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Attribute.java 12 Mar 2007 08:32:47 -0000 1.18 --- Attribute.java 16 Apr 2007 15:55:22 -0000 1.19 *************** *** 182,186 **** * @param attributes List of attribute */ ! public void setAttributes(List attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { --- 182,186 ---- * @param attributes List of attribute */ ! public void setAttributes(List<Attribute> attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { *************** *** 205,210 **** * @return List of attributes */ ! public List getAttributes() { ! List attributes = new LinkedList(); attributes.add(new Attribute("Name", name)); attributes.add(new Attribute("Value", value)); --- 205,210 ---- * @return List of attributes */ ! public List<Attribute> getAttributes() { ! List<Attribute> attributes = new LinkedList<Attribute>(); attributes.add(new Attribute("Name", name)); attributes.add(new Attribute("Value", value)); Index: TransformStack.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/TransformStack.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TransformStack.java 11 Oct 2006 14:05:16 -0000 1.3 --- TransformStack.java 16 Apr 2007 15:55:22 -0000 1.4 *************** *** 83,87 **** * @param attributes List of attributes */ ! public void setAttributes(List attributes) { } --- 83,87 ---- * @param attributes List of attributes */ ! public void setAttributes(List<Attribute> attributes) { } *************** *** 89,93 **** * @return List of Attributes */ ! public List getAttributes() { return null; } --- 89,93 ---- * @return List of Attributes */ ! public List<Attribute> getAttributes() { return null; } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.134 retrieving revision 1.135 diff -C2 -d -r1.134 -r1.135 *** Space.java 15 Apr 2007 11:12:04 -0000 1.134 --- Space.java 16 Apr 2007 15:55:22 -0000 1.135 *************** *** 1495,1499 **** * @param attributes The attributes to set */ ! public void setAttributes(List attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { --- 1495,1499 ---- * @param attributes The attributes to set */ ! public void setAttributes(List<Attribute> attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Line.java 13 Mar 2007 15:21:24 -0000 1.31 --- Line.java 16 Apr 2007 15:55:22 -0000 1.32 *************** *** 120,124 **** /** {@inheritDoc} */ ! public void setAttributes(List attributes) { Vertex orig = new Vertex(0, 0, 0); --- 120,124 ---- /** {@inheritDoc} */ ! public void setAttributes(List<Attribute> attributes) { Vertex orig = new Vertex(0, 0, 0); *************** *** 140,145 **** /** {@inheritDoc} */ ! public List getAttributes() { ! ArrayList res = new ArrayList(); res.add(new Attribute("name", "Origin", false)); res.add(new Attribute("X", new Double(getOrigin().getX()))); --- 140,145 ---- /** {@inheritDoc} */ ! public List<Attribute> getAttributes() { ! ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("name", "Origin", false)); res.add(new Attribute("X", new Double(getOrigin().getX()))); Index: AxisRotate.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/AxisRotate.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AxisRotate.java 28 Nov 2006 10:06:34 -0000 1.3 --- AxisRotate.java 16 Apr 2007 15:55:22 -0000 1.4 *************** *** 9,13 **** import java.util.ArrayList; - import java.util.Iterator; import java.util.List; --- 9,12 ---- *************** *** 117,124 **** * @param attributes List */ ! public void setAttributes(List attributes) { ! Iterator iter = attributes.iterator(); ! while (iter.hasNext()) { ! Attribute a = (Attribute)iter.next(); if (a.getName().equals("Axis X")) { rx(((Double)a.getValue()).doubleValue()); --- 116,121 ---- * @param attributes List */ ! public void setAttributes(List<Attribute> attributes) { ! for (Attribute a : attributes) { if (a.getName().equals("Axis X")) { rx(((Double)a.getValue()).doubleValue()); *************** *** 139,144 **** * @return List */ ! public List getAttributes() { ! ArrayList res = new ArrayList(); res.add(new Attribute("Axis X", new Double(rx()))); res.add(new Attribute("Axis Y", new Double(ry()))); --- 136,141 ---- * @return List */ ! public List<Attribute> getAttributes() { ! ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("Axis X", new Double(rx()))); res.add(new Attribute("Axis Y", new Double(ry()))); Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** Vertex.java 14 Apr 2007 15:00:47 -0000 1.58 --- Vertex.java 16 Apr 2007 15:55:22 -0000 1.59 *************** *** 435,442 **** * @param attributes The attributes to set */ ! public void setAttributes(List attributes) { ! Iterator iter = attributes.iterator(); ! while (iter.hasNext()) { ! Attribute a = (Attribute)iter.next(); if (a.getName().equals("Name")) { continue; --- 435,440 ---- * @param attributes The attributes to set */ ! public void setAttributes(List<Attribute> attributes) { ! for (Attribute a : attributes) { if (a.getName().equals("Name")) { continue; *************** *** 455,460 **** * @return the list of attributes for the object */ ! public List getAttributes() { ! ArrayList res = new ArrayList(); res.add(new Attribute("Name", getName(), false)); res.add(new Attribute("Owner", getOwner(), false)); --- 453,458 ---- * @return the list of attributes for the object */ ! public List<Attribute> getAttributes() { ! ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("Name", getName(), false)); res.add(new Attribute("Owner", getOwner(), false)); Index: IDTransform.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/IDTransform.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IDTransform.java 11 Oct 2006 14:05:16 -0000 1.1 --- IDTransform.java 16 Apr 2007 15:55:22 -0000 1.2 *************** *** 33,37 **** * @param attributes List */ ! public void setAttributes(List attributes) { } --- 33,37 ---- * @param attributes List */ ! public void setAttributes(List<Attribute> attributes) { } *************** *** 39,43 **** * @return List */ ! public List getAttributes() { return null; } --- 39,43 ---- * @return List */ ! public List<Attribute> getAttributes() { return null; } Index: Scale.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Scale.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Scale.java 28 Nov 2006 10:06:34 -0000 1.4 --- Scale.java 16 Apr 2007 15:55:22 -0000 1.5 *************** *** 9,13 **** import java.util.ArrayList; - import java.util.Iterator; import java.util.List; --- 9,12 ---- *************** *** 95,102 **** * @param attributes List */ ! public void setAttributes(List attributes) { ! Iterator iter = attributes.iterator(); ! while (iter.hasNext()) { ! Attribute a = (Attribute)iter.next(); if (a.getName().equals("Scale X")) { sx(((Double)a.getValue()).doubleValue()); --- 94,99 ---- * @param attributes List */ ! public void setAttributes(List<Attribute> attributes) { ! for (Attribute a : attributes) { if (a.getName().equals("Scale X")) { sx(((Double)a.getValue()).doubleValue()); *************** *** 115,120 **** * @return List */ ! public List getAttributes() { ! ArrayList res = new ArrayList(); res.add(new Attribute("Scale X", new Double(sx()))); res.add(new Attribute("Scale Y", new Double(sy()))); --- 112,117 ---- * @return List */ ! public List<Attribute> getAttributes() { ! ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("Scale X", new Double(sx()))); res.add(new Attribute("Scale Y", new Double(sy()))); Index: Relation.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Relation.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Relation.java 13 Mar 2007 09:56:50 -0000 1.7 --- Relation.java 16 Apr 2007 15:55:22 -0000 1.8 *************** *** 12,16 **** import java.util.Collection; import java.util.HashMap; - import java.util.Iterator; import java.util.LinkedList; import java.util.List; --- 12,15 ---- *************** *** 48,53 **** /** {@inheritDoc} */ ! public List getAttributes() { ! LinkedList attributes = new LinkedList(); attributes.add(new Attribute("Object", geometric)); attributes.add(new Attribute("Offset", offset)); --- 47,52 ---- /** {@inheritDoc} */ ! public List<Attribute> getAttributes() { ! LinkedList<Attribute> attributes = new LinkedList<Attribute>(); attributes.add(new Attribute("Object", geometric)); attributes.add(new Attribute("Offset", offset)); *************** *** 123,130 **** /** {@inheritDoc} */ ! public void setAttributes(List attributes) { ! Iterator iter = attributes.iterator(); ! while (iter.hasNext()) { ! Attribute current = (Attribute) iter.next(); if (current.getName().equals("Offset")) { this.offset = (String) current.getValue(); --- 122,127 ---- /** {@inheritDoc} */ ! public void setAttributes(List<Attribute> attributes) { ! for (Attribute current : attributes) { if (current.getName().equals("Offset")) { this.offset = (String) current.getValue(); |