/[classpath]/classpath/javax/swing/ToolTipManager.java
ViewVC logotype

Diff of /classpath/javax/swing/ToolTipManager.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5.2.5 by gnu_andrew, Tue Aug 2 20:12:37 2005 UTC revision 1.5.2.6 by gnu_andrew, Tue Sep 20 18:46:32 2005 UTC
# Line 129  public class ToolTipManager extends Mous Line 129  public class ToolTipManager extends Mous
129      public void actionPerformed(ActionEvent event)      public void actionPerformed(ActionEvent event)
130      {      {
131        showTip();        showTip();
       if (insideTimer != null)  
         insideTimer.start();  
132      }      }
133    }    }
134    
# Line 183  public class ToolTipManager extends Mous Line 181  public class ToolTipManager extends Mous
181     * The window used when the tooltip doesn't fit inside the current     * The window used when the tooltip doesn't fit inside the current
182     * container.     * container.
183     */     */
184    private static JWindow tooltipWindow;    private static JDialog tooltipWindow;
185    
186    /**    /**
187     * Creates a new ToolTipManager and sets up the timers.     * Creates a new ToolTipManager and sets up the timers.
# Line 373  public class ToolTipManager extends Mous Line 371  public class ToolTipManager extends Mous
371      if (exitTimer.isRunning())      if (exitTimer.isRunning())
372        {        {
373          exitTimer.stop();          exitTimer.stop();
         showTip();  
374          insideTimer.start();          insideTimer.start();
375          return;          return;
376        }        }
# Line 474  public class ToolTipManager extends Mous Line 471  public class ToolTipManager extends Mous
471     */     */
472    void showTip()    void showTip()
473    {    {
474      if (! enabled || currentComponent == null)      if (! enabled || currentComponent == null ||
475            (currentTip != null && currentTip.isVisible()))
476        return;        return;
477    
478      if (currentTip == null      if (currentTip == null
479          || currentTip.getComponent() != currentComponent          || currentTip.getComponent() != currentComponent
480          && currentComponent instanceof JComponent)          && currentComponent instanceof JComponent)
481        currentTip = ((JComponent) currentComponent).createToolTip();        currentTip = ((JComponent) currentComponent).createToolTip();
482      
483      Point p = currentPoint;      Point p = currentPoint;
484      Dimension dims = currentTip.getPreferredSize();      Dimension dims = currentTip.getPreferredSize();
485      if (canToolTipFit(currentTip))      if (canToolTipFit(currentTip))
# Line 526  public class ToolTipManager extends Mous Line 525  public class ToolTipManager extends Mous
525        }        }
526      else      else
527        {        {
528          SwingUtilities.convertPointToScreen(p, currentComponent);          if (currentComponent.isShowing())
529          tooltipWindow = new JWindow();            {
530          tooltipWindow.getContentPane().add(currentTip);              SwingUtilities.convertPointToScreen(p, currentComponent);
531          tooltipWindow.setFocusable(false);              tooltipWindow = new JDialog();
532          tooltipWindow.pack();              tooltipWindow.getContentPane().add(currentTip);
533          tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height);              tooltipWindow.setUndecorated(true);
534          tooltipWindow.show();              tooltipWindow.getRootPane().
535                          setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
536                tooltipWindow.setFocusable(false);
537                tooltipWindow.pack();
538                tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height);
539                tooltipWindow.show();
540              }
541        }        }
542      currentTip.setVisible(true);      currentTip.setVisible(true);
543    }    }

Legend:
Removed from v.1.5.2.5  
changed lines
  Added in v.1.5.2.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26