@Override
      public void focusGained(FocusEvent e) {
        if (rulesChanged) {
          rulesChanged = false;
          rulesChanged();
        }
      }
@Override
      public void focusGained(FocusEvent e)