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

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

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

revision 1.21 by langel, Fri Sep 9 14:44:39 2005 UTC revision 1.22 by langel, Mon Sep 12 16:17:14 2005 UTC
# Line 590  public class JPopupMenu extends JCompone Line 590  public class JPopupMenu extends JCompone
590                  JLayeredPane layeredPane;                  JLayeredPane layeredPane;
591                  layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane();                  layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane();
592                  Point p = new Point(popupLocation.x, popupLocation.y);                  Point p = new Point(popupLocation.x, popupLocation.y);
593                  SwingUtilities.convertPointFromScreen(p, layeredPane);                            
594                    if (layeredPane.isShowing())
595                      SwingUtilities.convertPointFromScreen(p, layeredPane);          
596                                    
597                  if (size.width + popupLocation.x > screenSize.width)                  if (size.width + popupLocation.x > screenSize.width)
598                    popupLocation.x -= size.width;                    popupLocation.x -= size.width;
599                  if (size.height + popupLocation.y > screenSize.height)                  if (size.height + popupLocation.y > screenSize.height)
600                    popupLocation.y -= size.height;                    popupLocation.y -= size.height;
601                    
602                  popup.show(p.x, p.y, size.width, size.height);                  popup.show(p.x, p.y, size.width, size.height);
603                }                }
604              else              else
# Line 669  public class JPopupMenu extends JCompone Line 671  public class JPopupMenu extends JCompone
671     */     */
672    public void show(Component component, int x, int y)    public void show(Component component, int x, int y)
673    {    {
674      setInvoker(component);      if (component.isShowing())
675      Point p = new Point(x, y);        {
676      SwingUtilities.convertPointToScreen(p, component);          setInvoker(component);
677      setLocation(p.x, p.y);          Point p = new Point(x, y);
678      setVisible(true);          SwingUtilities.convertPointToScreen(p, component);
679            setLocation(p.x, p.y);
680            setVisible(true);
681          }
682    }    }
683    
684    /**    /**

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

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