[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool AbstractTool.java, 1.123, 1.124 Penci
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2007-06-19 16:11:10
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11909/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java PencilTool.java Tool.java AbstractPencil.java SelectStrategy.java Pencil.java ArcTool.java SelectTool.java RectTool.java Log Message: initial work on adding tips to all tools Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Tool.java 8 May 2007 13:24:04 -0000 1.32 --- Tool.java 19 Jun 2007 16:11:06 -0000 1.33 *************** *** 86,89 **** * Lets the tool clean up after it self before changing tool. */ ! public void cleanUp(); } --- 86,96 ---- * Lets the tool clean up after it self before changing tool. */ ! public void cleanUp(); ! ! /** ! * Gives a tip on how to use the tool ! * @return A short describtion of how to start using the tool ! * imdediately after it is activated ! */ ! public String initialTip(); } Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** SelectTool.java 21 Jun 2006 13:26:18 -0000 1.61 --- SelectTool.java 19 Jun 2007 16:11:06 -0000 1.62 *************** *** 64,66 **** --- 64,72 ---- select.released(e); } + + public String initialTip() { + return "Click objects to select." + + " Hold shift to add to selection." + + " Drag to multi-select."; + } } Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** PencilTool.java 12 Dec 2006 09:33:49 -0000 1.77 --- PencilTool.java 19 Jun 2007 16:11:06 -0000 1.78 *************** *** 149,153 **** Edge edge = new Edge(start.vertex(), current.vertex()); edge = Project.getInstance().getActiveSpace().insert(edge); ! Collection edges = new LinkedList(); edges.add(edge); Space space = Project.getInstance().getActiveSpace(); --- 149,153 ---- Edge edge = new Edge(start.vertex(), current.vertex()); edge = Project.getInstance().getActiveSpace().insert(edge); ! Collection<Edge> edges = new LinkedList<Edge>(); edges.add(edge); Space space = Project.getInstance().getActiveSpace(); *************** *** 167,170 **** --- 167,180 ---- updateFeedback(); glv.repaint(); + setTip(secondClickTip()); + } + + public String initialTip() { + return "Click set the start point of a new edge."; + } + + private String secondClickTip() { + return "Click to set the end point of the current edge or type length." + + " Double-click or press Escape to stop drawing"; } } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** AbstractTool.java 1 Jun 2007 11:52:34 -0000 1.123 --- AbstractTool.java 19 Jun 2007 16:11:06 -0000 1.124 *************** *** 67,71 **** * When canceling tool action escape are called, so override if for canceling cleanup * ! * When a tool finishes, that is when another tool are chosen, cleanUp are called, so * implement it to cleanUp any unfinished business in a tool. REMEMBER TO CALL THE SUPER * IMPLEMENTATION WHEN EXTENDING --- 67,71 ---- * When canceling tool action escape are called, so override if for canceling cleanup * ! * When a tool finishes, that is when another tool is chosen, cleanUp is called, so * implement it to cleanUp any unfinished business in a tool. REMEMBER TO CALL THE SUPER * IMPLEMENTATION WHEN EXTENDING *************** *** 249,256 **** return center; } /** * Set the length-field ! * @param value Douelb */ public void setLength(double value) { --- 249,264 ---- return center; } + + /** + * Sets the tip in the tip-panel + * @param tip the tip + */ + public void setTip(String tip) { + glv.setTip(tip); + } /** * Set the length-field ! * @param value Double */ public void setLength(double value) { *************** *** 268,271 **** --- 276,286 ---- /** + * Clears the tip-panel + */ + public void clearTip() { + glv.setTip(""); + } + + /** * See if surface has become a hole in a surface in * the project. *************** *** 902,904 **** --- 917,923 ---- return null; } + + public String initialTip() { + return "No initial-tip has been written for this tool"; + } } Index: ArcTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ArcTool.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ArcTool.java 7 May 2007 13:29:48 -0000 1.15 --- ArcTool.java 19 Jun 2007 16:11:06 -0000 1.16 *************** *** 203,208 **** --- 203,210 ---- first = current; active = true; + setTip(secondClickTip()); } else { if (end == null) { + setTip(thirdClickTip()); end = current; Vertex between = end.vertex().minus(first.vertex()); *************** *** 237,240 **** --- 239,270 ---- end = null; } + + /** + * Tip on how to set the first click + * @return short describtion of what to do + */ + public String initialTip() { + return "Set first endpoint of the arc"; + } + + /** + * Tip on how to set the second click + * @return short describtion of what to do + */ + private String secondClickTip() { + return "Set the second endpoint of the arc." + + " Use \"length\" to type a specific distance to endpoint" + + " Press Escape to cancel drawing"; + } + + /** + * Tip on how to set the third click + * @return short describtion of what to do + */ + private String thirdClickTip() { + return "Set the radius of the arc." + + "Use \"length\" to type a specific radius." + + " Press Escape to cancel drawing"; + } } Index: Pencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Pencil.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Pencil.java 10 Oct 2006 15:03:01 -0000 1.15 --- Pencil.java 19 Jun 2007 16:11:06 -0000 1.16 *************** *** 42,46 **** if (start != null) { Edge edge = new Edge(start.vertex(), current.vertex()); ! List edges = new LinkedList(); edges.add(edge); feedback(edges); --- 42,46 ---- if (start != null) { Edge edge = new Edge(start.vertex(), current.vertex()); ! List<Edge> edges = new LinkedList<Edge>(); edges.add(edge); feedback(edges); *************** *** 84,88 **** } else { Edge edge = new Edge(start.vertex(), current.vertex()); ! List edges = new LinkedList(); edges.add(edge); hooverEdge = edge; --- 84,88 ---- } else { Edge edge = new Edge(start.vertex(), current.vertex()); ! List<Edge> edges = new LinkedList<Edge>(); edges.add(edge); hooverEdge = edge; *************** *** 104,107 **** --- 104,118 ---- updateFeedback(); glv.repaint(); + setTip(secondClickTip()); + } + + + public String initialTip() { + return "Click set start point of a new edge."; + } + + private String secondClickTip() { + return "Click to set end point of the current edge or type length." + + " Double-click or press Escape to stop drawing"; } } Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** AbstractPencil.java 18 May 2007 09:13:17 -0000 1.80 --- AbstractPencil.java 19 Jun 2007 16:11:06 -0000 1.81 *************** *** 753,756 **** --- 753,757 ---- active = false; dragging = false; + setTip(initialTip()); super.cleanUp(); } Index: SelectStrategy.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectStrategy.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** SelectStrategy.java 4 Jun 2007 20:38:21 -0000 1.13 --- SelectStrategy.java 19 Jun 2007 16:11:06 -0000 1.14 *************** *** 230,233 **** } } - } --- 230,232 ---- Index: RectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RectTool.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** RectTool.java 19 Oct 2006 15:28:46 -0000 1.18 --- RectTool.java 19 Jun 2007 16:11:06 -0000 1.19 *************** *** 29,33 **** /** The edges of the rectangle */ ! private List rectangle; /** The edge that will be moving while making the rectangle */ --- 29,33 ---- /** The edges of the rectangle */ ! private List<Edge> rectangle; /** The edge that will be moving while making the rectangle */ *************** *** 56,60 **** public RectTool(GLView glv, Cursor cursor) { super(glv, cursor); ! rectangle = new LinkedList(); movingEdge = null; baseEdge = null; --- 56,60 ---- public RectTool(GLView glv, Cursor cursor) { super(glv, cursor); ! rectangle = new LinkedList<Edge>(); movingEdge = null; baseEdge = null; *************** *** 70,74 **** if (baseEdge == null) { Edge edge = new Edge(start.vertex(), current.vertex()); ! List edges = new LinkedList(); edges.add(edge); feedback(edges); --- 70,74 ---- if (baseEdge == null) { Edge edge = new Edge(start.vertex(), current.vertex()); ! List<Edge> edges = new LinkedList<Edge>(); edges.add(edge); feedback(edges); *************** *** 116,120 **** */ private void setUpRectangle() { ! rectangle = new LinkedList(); baseEdge = new Edge(start.vertex(), current.vertex()); movingEdge = new Edge(current.vertex().copy(), start.vertex().copy()); --- 116,120 ---- */ private void setUpRectangle() { ! rectangle = new LinkedList<Edge>(); baseEdge = new Edge(start.vertex(), current.vertex()); movingEdge = new Edge(current.vertex().copy(), start.vertex().copy()); *************** *** 156,162 **** lastCurrent = start.vertex(); active = true; } else if (baseEdge == null) { if (start.vertex().distance(current.vertex()) > 0.0) { ! setUpRectangle(); } } else { --- 156,164 ---- lastCurrent = start.vertex(); active = true; + setTip(secondClickTip()); } else if (baseEdge == null) { if (start.vertex().distance(current.vertex()) > 0.0) { ! setTip(thirdClickTip()); ! setUpRectangle(); } } else { *************** *** 177,183 **** movingEdge = null; start = null; ! rectangle = new LinkedList(); dragging = false; super.cleanUp(); } } --- 179,215 ---- movingEdge = null; start = null; ! rectangle = new LinkedList<Edge>(); dragging = false; super.cleanUp(); } + + /** + * Tip on how to set the first click + * @return short describtion of what to do + */ + public String initialTip() { + return "Set first corner of the rectangle"; + } + + /** + * Tip on how to set the second click + * @return short describtion of what to do + */ + private String secondClickTip() { + return "Set the height and direction of the rectangle." + + " Use \"length\" to type a specific height." + + " Press Escape to cancel drawing"; + } + + /** + * Tip on how to set the third click + * @return short describtion of what to do + */ + private String thirdClickTip() { + return "Set the width of the rectangle." + + "Use \"length\" to type a specific width." + + " Press Escape to cancel drawing"; + } + + } |