* In this comparator, the first stack (the one that this graphics engine
* will be used) will be display mode that has the biggest bits per pixel
* (bpp) and has the biggest but limited to 75Hz frequency (refresh rate).
*/
public int compare(Object o1, Object o2) {
DisplayMode mode1 = (DisplayMode) o1;
DisplayMode mode2 = (DisplayMode) o2;
int removed1 = (mode1.getRefreshRate() > 75) ? 5000 * mode1
.getRefreshRate() : 0;
int removed2 = (mode2.getRefreshRate() > 75) ? 5000 * mode2
.getRefreshRate() : 0;
return ((mode2.getBitDepth() - mode1.getBitDepth()) * 1000)
+ (mode2.getRefreshRate() - mode1.getRefreshRate())
- (removed2 - removed1);
}