/** ctor */
  public FormFocusManager(FormComponent fc) {
    /** now set the focusCycleRoot to false for any child forms. */
    disableChildFocusCycleRoots(fc);
    fc.setFocusCycleRoot(true);

    m_form = fc;

    /**
     * First get all valid components from the stored focus policy. This list was created when the
     * developer set the focus policy in the designer and stored the result.
     */
    ArrayList stored_focus_set = buildStoredFocusList(fc);

    /** Now get the default focus policy which is assigned by Swing. */
    LinkedHashSet default_focus_set = buildDefaultFocusPolicy(fc);

    /**
     * Now we want to reconcile what has been stored versus the default policy because the form may
     * have changed since the last time the focus policy was saved.
     */

    /**
     * now remove any elements from the stored policy that are not found in the default focus policy
     */
    Iterator iter = stored_focus_set.iterator();
    while (iter.hasNext()) {
      Component comp = (Component) iter.next();
      if (!default_focus_set.contains(comp)) {
        iter.remove();
      }
    }

    /** used for quick lookups */
    HashSet stored_lookup = new HashSet();
    stored_lookup.addAll(stored_focus_set);

    /**
     * now iterate over the default focus policy. Any components not found in the stored focus
     * policy are added at the default position
     */
    Component prev_comp = null;
    iter = default_focus_set.iterator();
    while (iter.hasNext()) {
      Component comp = (Component) iter.next();
      if (!stored_lookup.contains(comp)) {
        stored_lookup.add(comp);
        if (prev_comp == null) {
          stored_focus_set.add(0, comp);
        } else {
          int pos = stored_focus_set.indexOf(prev_comp);
          assert (pos >= 0);
          if (pos >= 0) {
            stored_focus_set.add(pos + 1, comp);
          }
        }
      }
      prev_comp = comp;
    }

    /** now the stored_focus_set has the correct focus order */
    m_focus_list = stored_focus_set;
  }