public static class CaseInsensitiveOrder implements Comparator
{
public int compare( Object o1, Object o2 )
{
Category type1 = (Category) o1;
Category type2 = (Category) o2;
int diff = 0;
if ( Parameters.LEGEND_TOPOLOGY_ORDER ) {
diff = TOPOLOGY_ORDER.compare( type1, type2 );
if ( diff != 0 )
return diff;
}
if ( Parameters.LEGEND_PREVIEW_ORDER ) {
diff = PREVIEW_ORDER.compare( type1, type2 );
if ( diff != 0 )
return diff;
}
return type1.getName().compareToIgnoreCase( type2.getName() );
}