Class DefaultMenuLayout

java.lang.Object
javax.swing.BoxLayout
javax.swing.plaf.basic.DefaultMenuLayout
All Implemented Interfaces:
LayoutManager, LayoutManager2, Serializable, UIResource

public class DefaultMenuLayout extends BoxLayout implements UIResource
The default layout manager for Popup menus and menubars. This class is an extension of BoxLayout which adds the UIResource tag so that pluggable L&Fs can distinguish it from user-installed layout managers on menus.
  • Field Summary

    Fields declared in class BoxLayout

    LINE_AXIS, PAGE_AXIS, X_AXIS, Y_AXIS
    Modifier and Type
    Field
    Description
    static final int
    Specifies that components should be laid out in the direction of a line of text as determined by the target container's ComponentOrientation property.
    static final int
    Specifies that components should be laid out in the direction that lines flow across a page as determined by the target container's ComponentOrientation property.
    static final int
    Specifies that components should be laid out left to right.
    static final int
    Specifies that components should be laid out top to bottom.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultMenuLayout(Container target, int axis)
    Constructs a new instance of DefaultMenuLayout.
  • Method Summary

    Methods declared in class BoxLayout

    addLayoutComponent, addLayoutComponent, getAxis, getLayoutAlignmentX, getLayoutAlignmentY, getTarget, invalidateLayout, layoutContainer, maximumLayoutSize, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent
    Modifier and Type
    Method
    Description
    void
    addLayoutComponent(Component comp, Object constraints)
    Not used by this class.
    void
    Not used by this class.
    final int
    Returns the axis that was used to lay out components.
    float
    Returns the alignment along the X axis for the container.
    float
    Returns the alignment along the Y axis for the container.
    final Container
    Returns the container that uses this layout manager.
    void
    Indicates that a child has changed its layout related information, and thus any cached calculations should be flushed.
    void
    Called by the AWT when the specified container needs to be laid out.
    Returns the maximum dimensions the target container can use to lay out the components it contains.
    Returns the minimum dimensions needed to lay out the components contained in the specified target container.
    Returns the preferred dimensions for this layout, given the components in the specified target container.
    void
    Not used by this class.

    Methods declared in class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
    Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
    boolean
    Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    May cause performance issues, deadlocks and hangs.
    final Class<? extends Object>
    Answers the unique instance of java.lang.Class which represents the class of the receiver.
    int
    Answers an integer hash code for the receiver.
    final void
    Causes one thread which is waiting on the receiver to be made ready to run.
    final void
    Causes all threads which are waiting on the receiver to be made ready to run.
    Answers a string containing a concise, human-readable description of the receiver.
    final void
    Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated by notify or notifyAll).
    final void
    wait(long time)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
    final void
    wait(long time, int frac)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
  • Constructor Details

    • DefaultMenuLayout

      public DefaultMenuLayout(Container target, int axis)
      Constructs a new instance of DefaultMenuLayout.
      Parameters:
      target - the container that needs to be laid out
      axis - the axis to lay out components along. Can be one of: BoxLayout.X_AXIS, BoxLayout.Y_AXIS, BoxLayout.LINE_AXIS or BoxLayout.PAGE_AXIS