[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool AbstractPencil.java, 1.83, 1.84
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2007-06-27 00:33:52
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17700/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Added feedback when locked to an edge. Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** AbstractPencil.java 26 Jun 2007 00:40:11 -0000 1.83 --- AbstractPencil.java 27 Jun 2007 00:33:53 -0000 1.84 *************** *** 23,26 **** --- 23,27 ---- import net.sourceforge.bprocessor.gl.GLView; + import net.sourceforge.bprocessor.gl.model.EdgeAttributes; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.Transformation; *************** *** 124,127 **** --- 125,135 ---- protected boolean dragging; + /** An extension of the locking edge when moving + * outside the lockingedge */ + private Edge lockEdgeExtention; + + /** A highlight for the lockingedge */ + private Edge lockHighlightEdge; + /** * Constructor *************** *** 264,268 **** /** ! * Hide feedback */ protected void hideFeedback() { --- 272,276 ---- /** ! * Removes all feedback elements from the view */ protected void hideFeedback() { *************** *** 279,284 **** /** ! * Give feedback ! * @param feed Collection of edges */ protected void feedback(Collection feed) { --- 287,292 ---- /** ! * Sets the collection of feedback elements ! * @param feed Collection feedback elements (edges and constructors) */ protected void feedback(Collection feed) { *************** *** 569,575 **** --- 577,587 ---- Intersection actual = intersection; target = intersection.vertex(); + Vertex targetVertex = intersection.vertex(); float[] targetColor = targetColor(intersection); glv.getView().removeTempVertex(lockSnapVertex); glv.getView().clearColor(lockSnapVertex); + glv.getView().removeTempEdge(lockEdgeExtention); + glv.getView().removeTempEdge(lockHighlightEdge); + glv.getView().clearStyle(lockHighlightEdge); if (intersection.type() == Intersection.LOCK_INTERSECTION) { actual = (Intersection)actual.object(); *************** *** 578,581 **** --- 590,613 ---- glv.getView().addTempVertex(lockSnapVertex); glv.getView().changeColor(lockSnapVertex, targetColor); + if (lockingEdge != null) { + EdgeAttributes ea = new EdgeAttributes(); + ea.setColor(glv.getView().TARGET_COLOR); + ea.setLineWidth(ea.getLineWidth() * 2); + lockHighlightEdge = lockingEdge; + glv.getView().addTempEdge(lockHighlightEdge); + glv.getView().changeEdgeStyle(lockHighlightEdge, ea); + if (!lockingEdge.coincides(targetVertex)) { + Vertex to = lockingEdge.getTo(); + Vertex from = lockingEdge.getFrom(); + if (to.minus(targetVertex).length() < + from.minus(targetVertex).length()) { + lockEdgeExtention = new Edge(targetVertex, to); + } else { + lockEdgeExtention = new Edge(targetVertex, from); + } + lockEdgeExtention.setStrippled(true); + glv.getView().addTempEdge(lockEdgeExtention); + } + } } if (actual.type() == Intersection.PLANE_INTERSECTION) { |