/** For debugging */ public void print() { Iterator iter = m_focus_keys.iterator(); while (iter.hasNext()) { FocusKey fkey = (FocusKey) iter.next(); fkey.print(); if (iter.hasNext()) System.out.print(", "); } }
/** * FocusKey implementation. Iterates over the keys in this composite and recursively locates a * component based on each element */ public Component getComponent(Container c) { Component result = null; if (c == null) return null; Container parent = c; Iterator iter = m_focus_keys.iterator(); while (iter.hasNext()) { FocusKey fkey = (FocusKey) iter.next(); Component comp = fkey.getComponent(parent); if (iter.hasNext()) { if (comp instanceof Container) { parent = (Container) comp; } else { return null; } } else { result = comp; } } return result; }