net.wotonomy.ui.swing.util
Class PositionComparator

java.lang.Object
  extended by net.wotonomy.ui.swing.util.PositionComparator
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator

public class PositionComparator
extends java.lang.Object
implements java.util.Comparator, java.io.Serializable

A Comparator that will sort components in a common container based first on their y-coordinate and then on their x-coordinate, producing a list sorted from top to bottom and left to right. If all components are not in the same container, the resulting sort is undefined.

Version:
$Revision: 904 $
Author:
michael@mpowers.net, $Author: cgruber $
See Also:
Serialized Form

Constructor Summary
PositionComparator(java.awt.Container aContainer)
          Standard constructor to configure the comparator.
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

PositionComparator

public PositionComparator(java.awt.Container aContainer)
Standard constructor to configure the comparator.

Parameters:
aContainer - The common container for all the objects to be compared.
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator


Copyright © 2006 null. All Rights Reserved.