/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Comparator which attempts to sort Components based on their size and
* position. Code adapted from original javax.swing.DefaultFocusManager
* implementation.
*
* @author David Mendenhall
*/
private boolean horizontal = true;
private boolean leftToRight = true;
}
if (a == b) {
return 0;
}
// aren't siblings, then we need to find their most inferior
// ancestors which share a parent. Compute the ancestory lists for
// each Component and then search from the Window down until the
// hierarchy branches.
aAncestory.add(a);
if (a instanceof Window) {
break;
}
}
if (a == null) {
// 'a' is not part of a Window hierarchy. Can't cope.
throw new ClassCastException();
}
bAncestory.add(b);
if (b instanceof Window) {
break;
}
}
if (b == null) {
// 'b' is not part of a Window hierarchy. Can't cope.
throw new ClassCastException();
}
for (ListIterator<Component>
if (aIter.hasPrevious()) {
} else {
// a is an ancestor of b
return -1;
}
if (bIter.hasPrevious()) {
} else {
// b is an ancestor of a
return 1;
}
if (a != b) {
break;
}
}
}
if (horizontal) {
if (leftToRight) {
// LT - Western Europe (optional for Japanese, Chinese, Korean)
} else {
}
} else { // !leftToRight
// RT - Middle East (Arabic, Hebrew)
} else {
}
}
} else { // !horizontal
if (leftToRight) {
// TL - Mongolian
} else {
}
} else { // !leftToRight
// TR - Japanese, Chinese, Korean
} else {
}
}
}
}
}