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 |
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 |
/** |
/** |