Re: [cp-patches] FYI: ToolTip fix

2005-11-16 Thread Lillian Angel
Forgot to take out a call to start the insideTimer (which then shows the
tip when it is fired).

2005-11-16  Lillian Angel  <[EMAIL PROTECTED]>

* javax/swing/ToolTipManager.java
(mouseEntered): No need to start the insideTimer here,
already called showTip.


On Wed, 2005-11-16 at 16:35 -0500, Lillian Angel wrote:
> This fixes tooltips. In the case that a component is exited and
> re-entered, the tooltip should appear right away.
> 
> 2005-11-16  Lillian Angel  <[EMAIL PROTECTED]>
> 
> Fixes PR classpath/
> * javax/swing/ToolTipManager.java
> (mouseEntered): showTip should be called if exitTimer is 
>   running. This means that the mouse has exited and re-entered a 
>   component in less than 500ms.
> (mouseExited): If enterTimer is not running, the exitTimer 
>   should be started no matter what.
> (showTip): Should not show tool tip if the currentComponent is
> not showing.
> 
> ___
> Classpath-patches mailing list
> Classpath-patches@gnu.org
> http://lists.gnu.org/mailman/listinfo/classpath-patches
Index: javax/swing/ToolTipManager.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/ToolTipManager.java,v
retrieving revision 1.30
diff -u -r1.30 ToolTipManager.java
--- javax/swing/ToolTipManager.java	16 Nov 2005 21:34:46 -	1.30
+++ javax/swing/ToolTipManager.java	16 Nov 2005 21:38:54 -
@@ -366,7 +366,6 @@
 if (exitTimer.isRunning())
   {
 exitTimer.stop();
-insideTimer.start();
 showTip();
 return;
   }
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches]: FYI: ToolTip fix

2005-09-21 Thread Lillian Angel

2005-09-21  Lillian Angel  <[EMAIL PROTECTED]>

* javax/swing/ToolTipManager.java
(showTip): Fixed location of tooltip. Sometimes
the ToolTip was being cut off.


On Wed, 2005-09-21 at 10:21 -0400, Lillian Angel wrote:
> I fixed this so the Tool Tips are painted in a better location.
> 
> 2005-09-21  Lillian Angel  <[EMAIL PROTECTED]>
> 
> * javax/swing/ToolTipManager.java
> (showTip): Added code to move currentPoint to a new place.
> (getGoodPoint): Removed, not needed.
> 
> 
> On Tue, 2005-09-20 at 18:00 -0400, Lillian Angel wrote:
> > 2005-09-20  Lillian Angel  <[EMAIL PROTECTED]>
> > 
> > * javax/swing/JPopupMenu.java
> > (setVisible): If HeavyWeightPopup, setLightWeightPopupEnabled
> > is false.
> > * javax/swing/ToolTipManager.java
> > (showTip): Change so toolTips on lightWeightPopups are
> > added different than those on heavyWeightPopups.
> > (canToolTipFit): Removed. This is not needed/used.
> > 
> > ___
> > Classpath-patches mailing list
> > Classpath-patches@gnu.org
> > http://lists.gnu.org/mailman/listinfo/classpath-patches
> ___
> Classpath-patches mailing list
> Classpath-patches@gnu.org
> http://lists.gnu.org/mailman/listinfo/classpath-patches
Index: javax/swing/ToolTipManager.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/ToolTipManager.java,v
retrieving revision 1.18
diff -u -r1.18 ToolTipManager.java
--- javax/swing/ToolTipManager.java	21 Sep 2005 18:57:45 -	1.18
+++ javax/swing/ToolTipManager.java	21 Sep 2005 21:18:30 -
@@ -456,7 +456,7 @@
*/
   void showTip()
   {
-if (!enabled || currentComponent == null
+if (!enabled || currentComponent == null || !currentComponent.isEnabled()
 || (currentTip != null && currentTip.isVisible()))
   return;
 
@@ -465,18 +465,20 @@
   currentTip = ((JComponent) currentComponent).createToolTip();
 
 Container parent = currentComponent.getParent();
-if (parent instanceof JPopupMenu)
-  setLightWeightPopupEnabled(((JPopupMenu) parent).isLightWeightPopupEnabled());
-
-// Moves currentPoint to an appropriate place
 Point p = currentPoint;
 Dimension dims = currentTip.getPreferredSize();
 Rectangle bounds = currentComponent.getBounds();
-p.x = bounds.width - dims.width;
+p.x += bounds.width - dims.width;
 p.y = bounds.height;
-
+
+if (parent instanceof JPopupMenu)
+setLightWeightPopupEnabled(((JPopupMenu) parent).isLightWeightPopupEnabled());
+   
 if (isLightWeightPopupEnabled())
   {
+if (p.x < parent.getBounds().x)
+  p.x = 0;
+
 JLayeredPane pane = ((JRootPane) SwingUtilities.
 getAncestorOfClass(JRootPane.class, currentComponent)).
 getLayeredPane();
@@ -507,6 +509,10 @@
   }
 else if (currentComponent.isShowing())
   {
+Rectangle b = parent.getBounds();
+if (p.x + dims.width > b.x + b.width)
+  p.x = b.x - dims.width;
+
 SwingUtilities.convertPointToScreen(p, currentComponent);
 tooltipWindow = new JDialog();
 tooltipWindow.setContentPane(currentTip);
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches]: FYI: ToolTip fix

2005-09-21 Thread Lillian Angel
I fixed this so the Tool Tips are painted in a better location.

2005-09-21  Lillian Angel  <[EMAIL PROTECTED]>

* javax/swing/ToolTipManager.java
(showTip): Added code to move currentPoint to a new place.
(getGoodPoint): Removed, not needed.


On Tue, 2005-09-20 at 18:00 -0400, Lillian Angel wrote:
> 2005-09-20  Lillian Angel  <[EMAIL PROTECTED]>
> 
> * javax/swing/JPopupMenu.java
> (setVisible): If HeavyWeightPopup, setLightWeightPopupEnabled
> is false.
> * javax/swing/ToolTipManager.java
> (showTip): Change so toolTips on lightWeightPopups are
> added different than those on heavyWeightPopups.
> (canToolTipFit): Removed. This is not needed/used.
> 
> ___
> Classpath-patches mailing list
> Classpath-patches@gnu.org
> http://lists.gnu.org/mailman/listinfo/classpath-patches
Index: javax/swing/ToolTipManager.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/ToolTipManager.java,v
retrieving revision 1.16
diff -u -r1.16 ToolTipManager.java
--- javax/swing/ToolTipManager.java	20 Sep 2005 22:00:54 -	1.16
+++ javax/swing/ToolTipManager.java	21 Sep 2005 14:19:47 -
@@ -475,8 +475,13 @@
 if (parent instanceof JPopupMenu)
   setLightWeightPopupEnabled(((JPopupMenu) parent).isLightWeightPopupEnabled());
 
+// Moves currentPoint to an appropriate place
 Point p = currentPoint;
 Dimension dims = currentTip.getPreferredSize();
+Rectangle bounds = currentComponent.getBounds();
+p.x = bounds.width - dims.width;
+p.y = bounds.height;
+
 if (isLightWeightPopupEnabled())
   {
 JLayeredPane pane = ((JRootPane) SwingUtilities.
@@ -486,9 +491,9 @@
 // This should never happen, but just in case.
 if (pane == null)
   return;
-
 if (containerPanel != null)
   hideTip();
+
 containerPanel = new Panel();
 JRootPane root = new JRootPane();
 root.getContentPane().add(currentTip);
@@ -502,7 +507,7 @@
 fm.setHgap(0);
   }
 
-p = getGoodPoint(currentPoint, pane, currentTip, dims);
+p = SwingUtilities.convertPoint(currentComponent, p, pane);
 pane.add(containerPanel);
 containerPanel.setBounds(p.x, p.y, dims.width, dims.height);
 currentTip.setBounds(0, 0, dims.width, dims.height);
@@ -558,35 +563,6 @@
 	tooltipWindow.dispose();
 	tooltipWindow = null;
   }
-  }
-
-  /**
-   * This method returns a point in the LayeredPane where the ToolTip can be
-   * shown. The point returned (if the ToolTip is to be displayed at the
-   * preferred dimensions) will always place the ToolTip inside the
-   * currentComponent if possible.
-   *
-   * @param p The last known good point for the mouse.
-   * @param c The JLayeredPane in the first RootPaneContainer up from the
-   *currentComponent.
-   * @param tip The ToolTip to display.
-   * @param dims The ToolTip preferred dimensions (can be null).
-   *
-   * @return A good point to place the ToolTip.
-   */
-  private Point getGoodPoint(Point p, JLayeredPane c, JToolTip tip,
- Dimension dims)
-  {
-if (dims == null)
-  dims = tip.getPreferredSize();
-Rectangle bounds = currentComponent.getBounds();
-if (p.x + dims.width > bounds.width)
-  p.x += bounds.width - dims.width;
-if (p.y + dims.height > bounds.height)
-  p.y += bounds.height;
-
-p = SwingUtilities.convertPoint(currentComponent, p, c);
-return p;
   }
 
   /**
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches