[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Selection.java, 1.11, 1.12 Construct
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-08-10 13:07:59
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19179/src/net/sourceforge/bprocessor/model Modified Files: Selection.java Constructor.java Log Message: Refactoring selection mechanism Index: Constructor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Constructor.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Constructor.java 31 Jul 2006 11:25:51 -0000 1.7 --- Constructor.java 10 Aug 2006 13:07:57 -0000 1.8 *************** *** 75,78 **** --- 75,86 ---- /** + * A handle for origin + * @return Vertex + */ + public Vertex getOriginHandle() { + return new Handle(origin.getX(), origin.getY(), origin.getZ()); + } + + /** * Setter for origin * @param origin the new origin *************** *** 120,122 **** --- 128,172 ---- getOrigin().add(new Vertex(x, y, z)); } + + /** + * Handle + */ + protected class Handle extends Vertex { + /** */ + private static final long serialVersionUID = 1L; + + /** + * Constructor for Handle + * @param x X + * @param y Y + * @param z Z + */ + public Handle(double x, double y, double z) { + super(x, y, z); + } + + /** + * Update the direction based on the placement of the tip + */ + public void update() { + origin.setX(getX()); + origin.setY(getY()); + origin.setZ(getZ()); + } + + /** + * Return the line + * @return parent + */ + public Geometric parent() { + return Constructor.this; + } + + /** + * @return String + */ + public String toString() { + return "Handle{" + parent() + "}"; + } + } } Index: Selection.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Selection.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Selection.java 9 Aug 2006 15:14:58 -0000 1.11 --- Selection.java 10 Aug 2006 13:07:57 -0000 1.12 *************** *** 264,266 **** --- 264,273 ---- return center; } + + /** + * @return String + */ + public String toString() { + return selection.toString(); + } } |