summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-06-11 11:00:13 +0000
committerPaul Buetow <paul@buetow.org>2008-06-11 11:00:13 +0000
commit4f9a13071e3aba7291711a62358ab83374321433 (patch)
tree0c4c70866c7389694876121643cb533d8dc2e558
parent371b00f2c8bd3944d636e81ed0cb422b3d011ee3 (diff)
added color copy constructor in VSPrefs.
-rw-r--r--ROADMAP1
-rw-r--r--sources/core/VSTask.java6
-rw-r--r--sources/prefs/VSPrefs.java7
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));
+ }
}
/**