128 */ |
128 */ |
129 public Insets insets() { |
129 public Insets insets() { |
130 return getInsets(); |
130 return getInsets(); |
131 } |
131 } |
132 |
132 |
133 /* |
|
134 * This method is called from XWindowPeer.displayChanged, when |
|
135 * the window this Panel is on is moved to the new screen, or |
|
136 * display mode is changed. |
|
137 * |
|
138 * The notification is propagated to the child Canvas components. |
|
139 * Top-level windows and other Panels are notified too as their |
|
140 * peers are subclasses of XCanvasPeer. |
|
141 */ |
|
142 public void displayChanged(int screenNum) { |
|
143 super.displayChanged(screenNum); |
|
144 displayChanged((Container)target, screenNum); |
|
145 } |
|
146 |
|
147 /* |
|
148 * Recursively iterates through all the HW and LW children |
|
149 * of the container and calls displayChanged() for HW peers. |
|
150 * Iteration through children peers only is not enough as the |
|
151 * displayChanged notification may not be propagated to HW |
|
152 * components inside LW containers, see 4452373 for details. |
|
153 */ |
|
154 private static void displayChanged(Container target, int screenNum) { |
|
155 Component children[] = ((Container)target).getComponents(); |
|
156 for (Component child : children) { |
|
157 ComponentPeer cpeer = child.getPeer(); |
|
158 if (cpeer instanceof XCanvasPeer) { |
|
159 ((XCanvasPeer)cpeer).displayChanged(screenNum); |
|
160 } else if (child instanceof Container) { |
|
161 displayChanged((Container)child, screenNum); |
|
162 } |
|
163 } |
|
164 } |
|
165 |
|
166 public void dispose() { |
133 public void dispose() { |
167 if (embedder != null) { |
134 if (embedder != null) { |
168 embedder.deinstall(); |
135 embedder.deinstall(); |
169 } |
136 } |
170 super.dispose(); |
137 super.dispose(); |