Class PopupMenuLayout

  • All Implemented Interfaces:
    java.awt.LayoutManager, java.awt.LayoutManager2, java.io.Serializable, javax.swing.plaf.UIResource

    public final class PopupMenuLayout
    extends javax.swing.BoxLayout
    implements javax.swing.plaf.UIResource
    The JGoodies implementation of a layout manager for Popup menus. In comparison to the JDK's implementation it flushes the values of the client properties maxTextWidth and maxAccWidth in the method invalidateLayout(Container) and not in the method BoxLayout.preferredLayoutSize(Container).
    Version:
    $Revision: 1.8 $
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class javax.swing.BoxLayout

        LINE_AXIS, PAGE_AXIS, X_AXIS, Y_AXIS
    • Constructor Summary

      Constructors 
      Constructor Description
      PopupMenuLayout​(java.awt.Container target, int axis)
      Creates a layout manager that will lay out components along the given axis.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void invalidateLayout​(java.awt.Container target)
      Indicates that a child has changed its layout related information, and thus any cached calculations should be flushed.
      • Methods inherited from class javax.swing.BoxLayout

        addLayoutComponent, addLayoutComponent, getAxis, getLayoutAlignmentX, getLayoutAlignmentY, getTarget, layoutContainer, maximumLayoutSize, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PopupMenuLayout

        public PopupMenuLayout​(java.awt.Container target,
                               int axis)
        Creates a layout manager that will lay out components along the given axis.
        Parameters:
        target - the container that needs to be laid out
        axis - the axis to lay out components along
    • Method Detail

      • invalidateLayout

        public void invalidateLayout​(java.awt.Container target)
        Indicates that a child has changed its layout related information, and thus any cached calculations should be flushed.

        In case the target is an instance of JPopupMenu it flushes the values of the client properties maxTextWidth and maxAccWidth.

        Specified by:
        invalidateLayout in interface java.awt.LayoutManager2
        Overrides:
        invalidateLayout in class javax.swing.BoxLayout
        Parameters:
        target - the affected container