Class DefaultMenuLayout
java.lang.Object
javax.swing.BoxLayout
javax.swing.plaf.basic.DefaultMenuLayout
- All Implemented Interfaces:
LayoutManager, LayoutManager2, Serializable, 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 TypeFieldDescriptionstatic final int
Specifies that components should be laid out in the direction of a line of text as determined by the target container'sComponentOrientation
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'sComponentOrientation
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
ConstructorsConstructorDescriptionDefaultMenuLayout
(Container target, int axis) Constructs a new instance ofDefaultMenuLayout
. -
Method Summary
Methods declared in class BoxLayout
addLayoutComponent, addLayoutComponent, getAxis, getLayoutAlignmentX, getLayoutAlignmentY, getTarget, invalidateLayout, layoutContainer, maximumLayoutSize, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent
Modifier and TypeMethodDescriptionvoid
addLayoutComponent
(Component comp, Object constraints) Not used by this class.void
addLayoutComponent
(String name, Component comp) Not used by this class.final int
getAxis()
Returns the axis that was used to lay out components.float
getLayoutAlignmentX
(Container target) Returns the alignment along the X axis for the container.float
getLayoutAlignmentY
(Container target) Returns the alignment along the Y axis for the container.final Container
Returns the container that uses this layout manager.void
invalidateLayout
(Container target) Indicates that a child has changed its layout related information, and thus any cached calculations should be flushed.void
layoutContainer
(Container target) Called by the AWT when the specified container needs to be laid out.maximumLayoutSize
(Container target) Returns the maximum dimensions the target container can use to lay out the components it contains.minimumLayoutSize
(Container target) Returns the minimum dimensions needed to lay out the components contained in the specified target container.preferredLayoutSize
(Container target) 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 TypeMethodDescriptionprotected Object
clone()
Creates and returns a copy of this object.boolean
Indicates whether some other object is "equal to" this one.protected void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class
<?> getClass()
Returns the runtime class of thisObject
.int
hashCode()
Returns a hash code value for this object.final void
notify()
Wakes up a single thread that is waiting on this object's monitor.final void
Wakes up all threads that are waiting on this object's monitor.toString()
Returns a string representation of the object.final void
wait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final void
wait
(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final void
wait
(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Constructor Details
-
DefaultMenuLayout
Constructs a new instance ofDefaultMenuLayout
.- Parameters:
target
- the container that needs to be laid outaxis
- the axis to lay out components along. Can be one of:BoxLayout.X_AXIS
,BoxLayout.Y_AXIS
,BoxLayout.LINE_AXIS
orBoxLayout.PAGE_AXIS
-