edu.iastate.metnet.birdseyeview.cellview
Class CentricComparator
java.lang.Object
edu.iastate.metnet.birdseyeview.cellview.CentricComparator
- All Implemented Interfaces:
- java.util.Comparator
public class CentricComparator
- extends java.lang.Object
- implements java.util.Comparator
The CentricComparator Class compares 2 different points based on their distance from the center
point of a given rectangle.
- Author:
- Matt Studham
Created May 24, 2005
|
Constructor Summary |
CentricComparator(java.awt.Rectangle rec,
java.awt.Dimension elementSize)
Constructor. |
|
Method Summary |
int |
compare(java.lang.Object arg0,
java.lang.Object arg1)
|
static void |
main(java.lang.String[] args)
This method tests the CentricComparator class. |
| 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 |
CentricComparator
public CentricComparator(java.awt.Rectangle rec,
java.awt.Dimension elementSize)
- Constructor. Sets the center points. If the comparison will be used to center
elements other than points (e.g. squares) then the offset parameters should
be used so the elements can be properly compared.
- Parameters:
rec - Rectangle whose center will be usedxOffset - Difference between the desired horizontal center and the actual horizontal centeryOffset - Difference between the desired vertical center and the actual vertical centerelementSize - Size of element which will be used to fill the rectangle
compare
public int compare(java.lang.Object arg0,
java.lang.Object arg1)
- Specified by:
compare in interface java.util.Comparator
main
public static void main(java.lang.String[] args)
- This method tests the CentricComparator class.
- Parameters:
args -