Revision: 7652
Author: victormote
Date: 2006-06-16 11:59:43 -0700 (Fri, 16 Jun 2006)
ViewCVS: http://svn.sourceforge.net/foray/?rev=7652&view=rev
Log Message:
-----------
Use static variable to avoid creating multiple instances of the same DtColor.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 18:37:46 UTC (rev 7651)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/value/DtColor.java 2006-06-16 18:59:43 UTC (rev 7652)
@@ -287,7 +287,9 @@
return foundColor;
}
/* Otherwise, create a new instance. */
- return new DtColor(color);
+ DtColor newDtColor = new DtColor(color);
+ DtColor.colorsUsed.add(newDtColor);
+ return newDtColor;
}
public static DtColor makeDtColor(float red, float green, float blue,
@@ -300,7 +302,9 @@
}
/* Otherwise, create a new instance. */
Color newColor = new Color(red, green, blue, alpha);
- return new DtColor(newColor);
+ DtColor newDtColor = new DtColor(newColor);
+ DtColor.colorsUsed.add(newDtColor);
+ return newDtColor;
}
/**
@@ -480,8 +484,8 @@
return foundColor;
}
}
- Color newColor = new Color(red, green, blue, alpha);
- return new DtColor(newColor);
+ DtColor dtColor = DtColor.makeDtColor(red, green, blue, alpha);
+ return dtColor;
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|