APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing

pack-priv final Class LayoutComparator

extends Object
implements Comparator<Component>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.util.Comparator
Annotations
@SuppressWarnings:serial
Imports
java.util.ArrayList, .Comparator, .ListIterator, java.awt.Component, .ComponentOrientation, .Window

Comparator which attempts to sort Components based on their size and position. Code adapted from original javax.swing.DefaultFocusManager implementation.

Warning

Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package.

Author
David Mendenhall

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private static final int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
compare(Component a, Component b)

Implements java.util.Comparator.compare.

Compares its two arguments for order.

pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

horizontalback to summary
private boolean horizontal
leftToRightback to summary
private boolean leftToRight
ROW_TOLERANCEback to summary
private static final int ROW_TOLERANCE

Constructor Detail

LayoutComparatorback to summary
pack-priv LayoutComparator()

Method Detail

compareback to summary
public int compare(Component a, Component b)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

setComponentOrientationback to summary
pack-priv void setComponentOrientation(ComponentOrientation orientation)