1. /*
  2. * @(#)DefaultMenuLayout.java 1.7 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.plaf.synth;
  8. import javax.swing.*;
  9. import javax.swing.plaf.UIResource;
  10. import java.awt.Container;
  11. import java.awt.Dimension;
  12. /**
  13. * The default layout manager for Popup menus and menubars. This
  14. * class is an extension of BoxLayout which adds the UIResource tag
  15. * so that plauggable L&Fs can distinguish it from user-installed
  16. * layout managers on menus.
  17. *
  18. * Derived from javax.swing.plaf.basic.DefaultMenuLayout
  19. *
  20. * @version 1.7 12/19/03
  21. * @author Georges Saab
  22. */
  23. class DefaultMenuLayout extends BoxLayout implements UIResource {
  24. public DefaultMenuLayout(Container target, int axis) {
  25. super(target, axis);
  26. }
  27. public void invalidateLayout(Container target) {
  28. if (target instanceof JPopupMenu) {
  29. SynthPopupMenuUI popupUI = (SynthPopupMenuUI)((JPopupMenu)target).
  30. getUI();
  31. popupUI.resetAcceleratorWidths();
  32. }
  33. super.invalidateLayout(target);
  34. }
  35. }