From 4f9a13071e3aba7291711a62358ab83374321433 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 11 Jun 2008 11:00:13 +0000 Subject: added color copy constructor in VSPrefs. --- ROADMAP | 1 - sources/core/VSTask.java | 6 ++++++ sources/prefs/VSPrefs.java | 7 +++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ROADMAP b/ROADMAP index 913c04b..e08a6c5 100644 --- a/ROADMAP +++ b/ROADMAP @@ -1,5 +1,4 @@ Must do: - Color copy constructor in prefs.VSPrefs.copyColors Reliable Multicast Helper: Print warning if not activated protocol while doing a protocol request diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java index 9ca04e6..d5e4274 100644 --- a/sources/core/VSTask.java +++ b/sources/core/VSTask.java @@ -317,6 +317,9 @@ public class VSTask implements Comparable, VSSerializable { * @see java.lang.Comparable#compareTo(java.lang.Object) */ public int compareTo(Object object) { + if (object == null) + return 0; + if (object instanceof VSTask) { final VSTask task = (VSTask) object; @@ -328,6 +331,9 @@ public class VSTask implements Comparable, VSSerializable { VSAbstractEvent event2 = task.getEvent(); + if (event2 == null || event == null) + return 0; + /* If it's a recovering, it should get handled very first */ boolean a = event instanceof VSProcessRecoverEvent; boolean b = event2 instanceof VSProcessRecoverEvent; diff --git a/sources/prefs/VSPrefs.java b/sources/prefs/VSPrefs.java index e9ede88..1746e32 100644 --- a/sources/prefs/VSPrefs.java +++ b/sources/prefs/VSPrefs.java @@ -1062,9 +1062,12 @@ public class VSPrefs implements VSSerializable { * @param keys the keys */ public void copyColors(VSPrefs copyInto, String[] keys) { - for (String key : keys) - copyInto.initColor(key, getColor(key), + for (String key : keys) { + Color color = getColor(key); + float comp[] = color.getComponents(null); + copyInto.initColor(key, new Color(comp[0], comp[1], comp[2]), getDescription(COLOR_PREFIX + key)); + } } /** -- cgit v1.2.3