102 |
|
|
103 |
1. if DefaultLightWeightPopupEnabled true |
1. if DefaultLightWeightPopupEnabled true |
104 |
(i) use lightweight container if popup feets inside top-level window |
(i) use lightweight container if popup feets inside top-level window |
105 |
(ii) only use heavyweight container (JWindow) if popup doesn't fit. |
(ii) only use heavyweight container (JDialog) if popup doesn't fit. |
106 |
|
|
107 |
2. if DefaultLightWeightPopupEnabled false |
2. if DefaultLightWeightPopupEnabled false |
108 |
(i) if popup fits, use awt.Panel (mediumWeight) |
(i) if popup fits, use awt.Panel (mediumWeight) |
109 |
(ii) if popup doesn't fit, use JWindow (heavyWeight) |
(ii) if popup doesn't fit, use JDialog (heavyWeight) |
110 |
*/ |
*/ |
111 |
private static boolean DefaultLightWeightPopupEnabled = true; |
private static boolean DefaultLightWeightPopupEnabled = true; |
112 |
|
|
1015 |
} |
} |
1016 |
|
|
1017 |
/** |
/** |
1018 |
* HeavyWeightPopup is JWindow that is used to display JPopupMenu menu item's |
* HeavyWeightPopup is JDialog that is used to display JPopupMenu menu item's |
1019 |
* on the screen |
* on the screen |
1020 |
*/ |
*/ |
1021 |
private class HeavyWeightPopup extends JDialog implements Popup |
private class HeavyWeightPopup extends JDialog implements Popup |
1033 |
} |
} |
1034 |
|
|
1035 |
/** |
/** |
1036 |
* Displays JWindow container JPopupMenu's menu items to the screen |
* Displays JDialog container JPopupMenu's menu items to the screen |
1037 |
* |
* |
1038 |
* @param x x-coordinate of JWindow containing menu items |
* @param x x-coordinate of JDialog containing menu items |
1039 |
* @param y y-coordinate of JWindow containing menu items |
* @param y y-coordinate of JDialog containing menu items |
1040 |
* @param width width of the JWindow |
* @param width width of the JDialog |
1041 |
* @param height height of the JWindow |
* @param height height of the JDialog |
1042 |
*/ |
*/ |
1043 |
public void show(int x, int y, int width, int height) |
public void show(int x, int y, int width, int height) |
1044 |
{ |
{ |