158a159,164 > * Remembers the current tool tip location in order to support > * tool tips for a figure. > */ > private Point toolTipLocation; > > /** 1127a1134,1136 > * the user can't modify it using mouse or keyboard > * actions. Yet, it can still be modified from inside the > * program. 1127,1127c1133,1133 < * Asks whether the drawing view is in read-only mode. If so, the user can't --- > * Asks whether the drawing view is in read-only mode. If so, 1128,1129d1133 < * modify it using mouse or keyboard actions. Yet, it can still be modified < * from inside the program. 1136a1144,1145 > * mode. If so, the user can't modify it using mouse or > * keyboard actions. Yet, it can still be modified from inside 1136,1136c1143,1143 < * Determines whether the drawing view is in read-only mode. If so, the user can't --- > * Determines whether the drawing view is in read-only 1137,1137d1143 < * modify it using mouse or keyboard actions. Yet, it can still be modified 1138,1138c1146,1146 < * from inside the program. --- > * the program. 1181a1190,1202 > /** > * Return the location of the tool tip to Swing > */ > public Point getToolTipLocation(MouseEvent event) { > return toolTipLocation; > } > /** > * Works along with setToolTipText() and when both are called, a > * tool tip is shown at the Point p until clearToolTip() is called > */ > public void setToolTipLocation(Point p) { > toolTipLocation = p; > } 1182a1204,1228 > /** > * Calls setToolTipLocation(Point p) with a standard position > * relative to the given figure. > */ > public void setToolTipFigure(Figure f) { > Rectangle r = f.displayBox(); > /* Show tool tip 10 below the figure's bottom left > * corner... */ > Point p = new Point (r.x, r.y + r.height + 10); > setToolTipLocation(p); > } > > /** > * Call this to ensure that the tool tip is no longer shown. > */ > public void clearToolTip() { > if (getToolTipText() != null) { > setToolTipText(null); > /* According to javadoc for JComponent calling > * setToolTipText(null) should be enough to > * clear the tool tip, but at least for > * 1.4.2-b28 that is not sufficient... */ > setToolTipLocation(null); > } > }