178 }
179
180 private boolean legacySort(List<Component> l, Comparator<? super Component> c) {
181 if (legacyMergeSortMethod == null)
182 return false;
183
184 Object[] a = l.toArray();
185 try {
186 legacyMergeSortMethod.invoke(null, a, c);
187 } catch (IllegalAccessException | InvocationTargetException e) {
188 return false;
189 }
190 ListIterator<Component> i = l.listIterator();
191 for (Object e : a) {
192 i.next();
193 i.set((Component)e);
194 }
195 return true;
196 }
197
198 private void enumerateCycle(Container container, List<Component> cycle) {
199 if (!(container.isVisible() && container.isDisplayable())) {
200 return;
201 }
202
203 cycle.add(container);
204
205 Component[] components = container.getComponents();
206 for (Component comp : components) {
207 if (comp instanceof Container) {
208 Container cont = (Container)comp;
209
210 if (!cont.isFocusCycleRoot() &&
211 !cont.isFocusTraversalPolicyProvider() &&
212 !((cont instanceof JComponent) && ((JComponent)cont).isManagingFocus()))
213 {
214 enumerateCycle(cont, cycle);
215 continue;
216 }
217 }
|
178 }
179
180 private boolean legacySort(List<Component> l, Comparator<? super Component> c) {
181 if (legacyMergeSortMethod == null)
182 return false;
183
184 Object[] a = l.toArray();
185 try {
186 legacyMergeSortMethod.invoke(null, a, c);
187 } catch (IllegalAccessException | InvocationTargetException e) {
188 return false;
189 }
190 ListIterator<Component> i = l.listIterator();
191 for (Object e : a) {
192 i.next();
193 i.set((Component)e);
194 }
195 return true;
196 }
197
198 @SuppressWarnings("deprecation")
199 private void enumerateCycle(Container container, List<Component> cycle) {
200 if (!(container.isVisible() && container.isDisplayable())) {
201 return;
202 }
203
204 cycle.add(container);
205
206 Component[] components = container.getComponents();
207 for (Component comp : components) {
208 if (comp instanceof Container) {
209 Container cont = (Container)comp;
210
211 if (!cont.isFocusCycleRoot() &&
212 !cont.isFocusTraversalPolicyProvider() &&
213 !((cont instanceof JComponent) && ((JComponent)cont).isManagingFocus()))
214 {
215 enumerateCycle(cont, cycle);
216 continue;
217 }
218 }
|