Modified priority display to flow left to right and to sort by category

within priority rather than complexity.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1339 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2003-12-10 19:39:26 +00:00
parent 09f0f28705
commit 919377e18a
2 changed files with 19 additions and 25 deletions
@@ -1,5 +1,5 @@
//
// $Id: tasks.java,v 1.1 2003/11/15 22:55:32 mdb Exp $
// $Id: tasks.java,v 1.2 2003/12/10 19:39:26 mdb Exp $
package com.samskivert.twodue.logic;
@@ -51,7 +51,7 @@ public class tasks extends UserLogic
}
// sort the tasks by priority, then complexity
Collections.sort(tasks, OPEN_PARATOR);
Collections.sort(tasks, TASK_PARATOR);
CatList[] xtasks = categorize(tasks, new Categorizer() {
public String category (Task task) {
@@ -111,26 +111,22 @@ public class tasks extends UserLogic
return ctasks;
}
protected static final Comparator OPEN_PARATOR = new Comparator() {
protected static final Comparator TASK_PARATOR = new Comparator() {
public int compare (Object o1, Object o2) {
Task t1 = (Task)o1, t2 = (Task)o2;
// sort first by reverse priority, then by complexity
// sort first by reverse priority, then by category, then complexity
if (t1.priority == t2.priority) {
return t1.getComplexityValue() - t2.getComplexityValue();
if (t1.category.equals(t2.category)) {
return t1.getComplexityValue() - t2.getComplexityValue();
} else {
return t1.category.compareTo(t2.category);
}
} else {
return t2.priority - t1.priority;
}
}
};
protected static final Comparator OWNED_PARATOR = new Comparator() {
public int compare (Object o1, Object o2) {
Task t1 = (Task)o1, t2 = (Task)o2;
// sort by complexity
return t1.getComplexityValue() - t2.getComplexityValue();
}
};
// used to easy category generation in UI
public static class CategoryTool
{