KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > plaf > synth > DefaultMenuLayout


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
8 package javax.swing.plaf.synth;
9
10 import javax.swing.*;
11 import javax.swing.plaf.UIResource JavaDoc;
12
13 import java.awt.Container JavaDoc;
14 import java.awt.Dimension JavaDoc;
15
16 /**
17  * The default layout manager for Popup menus and menubars. This
18  * class is an extension of BoxLayout which adds the UIResource tag
19  * so that plauggable L&Fs can distinguish it from user-installed
20  * layout managers on menus.
21  *
22  * Derived from javax.swing.plaf.basic.DefaultMenuLayout
23  *
24  * @version 1.7 12/19/03
25  * @author Georges Saab
26  */

27
28 class DefaultMenuLayout extends BoxLayout implements UIResource JavaDoc {
29     public DefaultMenuLayout(Container JavaDoc target, int axis) {
30     super(target, axis);
31     }
32
33     public void invalidateLayout(Container JavaDoc target) {
34         if (target instanceof JPopupMenu) {
35             SynthPopupMenuUI JavaDoc popupUI = (SynthPopupMenuUI JavaDoc)((JPopupMenu)target).
36                                   getUI();
37
38             popupUI.resetAcceleratorWidths();
39         }
40         super.invalidateLayout(target);
41     }
42 }
43
Popular Tags