[Arakhnę-Dev] [407] * Move the color constants to VectorToolkit to Colors. |
[ Thread Index |
Date Index
| More arakhne.org/dev Archives
]
Revision: 407
Author: galland
Date: 2013-04-04 20:23:34 +0200 (Thu, 04 Apr 2013)
Log Message:
-----------
* Move the color constants to VectorToolkit to Colors.
Modified Paths:
--------------
trunk/attrs/src/main/java/org/arakhne/afc/attrs/attr/AttributeType.java
trunk/attrs/src/test/java/org/arakhne/afc/attrs/attr/AttributeTest.java
trunk/attrs/src/test/java/org/arakhne/afc/attrs/attr/AttributeTypeTest.java
trunk/attrs/src/test/java/org/arakhne/afc/attrs/attr/AttributeValueTest.java
Modified: trunk/attrs/src/main/java/org/arakhne/afc/attrs/attr/AttributeType.java
===================================================================
--- trunk/attrs/src/main/java/org/arakhne/afc/attrs/attr/AttributeType.java 2013-04-04 18:23:15 UTC (rev 406)
+++ trunk/attrs/src/main/java/org/arakhne/afc/attrs/attr/AttributeType.java 2013-04-04 18:23:34 UTC (rev 407)
@@ -44,6 +44,7 @@
import org.arakhne.afc.math.generic.Tuple2D;
import org.arakhne.afc.math.generic.Tuple3D;
import org.arakhne.afc.ui.vector.Color;
+import org.arakhne.afc.ui.vector.Colors;
import org.arakhne.afc.ui.vector.Image;
import org.arakhne.afc.ui.vector.VectorToolkit;
import org.arakhne.vmutil.locale.Locale;
@@ -334,7 +335,7 @@
case POINT:
return new Point2f();
case COLOR:
- return VectorToolkit.BLACK;
+ return Colors.BLACK;
case UUID:
return java.util.UUID.fromString("00000000-0000-0000-0000-000000000000"); //$NON-NLS-1$
case URL:
Modified: trunk/attrs/src/test/java/org/arakhne/afc/attrs/attr/AttributeTest.java
===================================================================
--- trunk/attrs/src/test/java/org/arakhne/afc/attrs/attr/AttributeTest.java 2013-04-04 18:23:15 UTC (rev 406)
+++ trunk/attrs/src/test/java/org/arakhne/afc/attrs/attr/AttributeTest.java 2013-04-04 18:23:34 UTC (rev 407)
@@ -43,6 +43,7 @@
import org.arakhne.afc.math.generic.Point2D;
import org.arakhne.afc.math.generic.Point3D;
import org.arakhne.afc.ui.vector.Color;
+import org.arakhne.afc.ui.vector.Colors;
import org.arakhne.afc.ui.vector.Image;
import org.arakhne.afc.ui.vector.VectorToolkit;
@@ -337,7 +338,7 @@
*/
public static void testAttributeImplColor() throws Exception {
String txt = "255;0;0;255"; //$NON-NLS-1$
- Attribute attr = new AttributeImpl(randomString(),VectorToolkit.RED);
+ Attribute attr = new AttributeImpl(randomString(),Colors.RED);
assertEquals(AttributeType.COLOR, attr.getType());
@@ -345,14 +346,14 @@
assertFalse(attr.isBaseType());
assertTrue(attr.isObjectValue());
- assertEquals(VectorToolkit.RED,attr.getValue());
+ assertEquals(Colors.RED,attr.getValue());
assertAttributeException(attr,"getBoolean"); //$NON-NLS-1$
- assertEquals(VectorToolkit.RED,attr.getColor());
+ assertEquals(Colors.RED,attr.getColor());
assertAttributeException(attr,"getDate"); //$NON-NLS-1$
assertAttributeException(attr,"getImage"); //$NON-NLS-1$
- assertEquals(VectorToolkit.RED.getRGB(), attr.getInteger());
- assertEquals((double)VectorToolkit.RED.getRGB(), attr.getReal());
- assertEquals(VectorToolkit.RED.getRGB(), attr.getTimestamp());
+ assertEquals(Colors.RED.getRGB(), attr.getInteger());
+ assertEquals((double)Colors.RED.getRGB(), attr.getReal());
+ assertEquals(Colors.RED.getRGB(), attr.getTimestamp());
assertEquals(txt,attr.getString());
assertEquals(VectorToolkit.color(255,0,0), attr.getJavaObject());
assertEquals(new Point2f(255,0),attr.getPoint());
@@ -742,7 +743,7 @@
* @throws Exception
*/
public static void testAttributeImplString_Color() throws Exception {
- Color c = VectorToolkit.RED;
+ Color c = Colors.RED;
Point2D pt2d = new Point2f(c.getRed(),c.getGreen());
Point2D pt2d2 = new Point2f(c.getBlue(),0);
Point3D pt3d = new Point3f(c.getRed(),c.getGreen(),c.getBlue());
Modified: trunk/attrs/src/test/java/org/arakhne/afc/attrs/attr/AttributeTypeTest.java
===================================================================
--- trunk/attrs/src/test/java/org/arakhne/afc/attrs/attr/AttributeTypeTest.java 2013-04-04 18:23:15 UTC (rev 406)
+++ trunk/attrs/src/test/java/org/arakhne/afc/attrs/attr/AttributeTypeTest.java 2013-04-04 18:23:34 UTC (rev 407)
@@ -44,6 +44,7 @@
import org.arakhne.afc.math.generic.Tuple2D;
import org.arakhne.afc.math.generic.Tuple3D;
import org.arakhne.afc.ui.vector.Color;
+import org.arakhne.afc.ui.vector.Colors;
import org.arakhne.afc.ui.vector.Image;
import org.arakhne.afc.ui.vector.VectorToolkit;
@@ -130,7 +131,7 @@
assertEquals(AttributeType.STRING, AttributeType.fromValue(new StringBuilder()));
assertEquals(AttributeType.DATE, AttributeType.fromValue(Calendar.getInstance()));
assertEquals(AttributeType.DATE, AttributeType.fromValue(new Date()));
- assertEquals(AttributeType.COLOR, AttributeType.fromValue(VectorToolkit.RED));
+ assertEquals(AttributeType.COLOR, AttributeType.fromValue(Colors.RED));
assertEquals(AttributeType.UUID, AttributeType.fromValue(UUID.randomUUID()));
assertEquals(AttributeType.POINT, AttributeType.fromValue(new Point2f(0,0)));
assertEquals(AttributeType.POINT, AttributeType.fromValue(new Point2i(0,0)));
@@ -290,7 +291,7 @@
Date dt = new Date();
Point2f pt2d1 = new Point2f(0,0);
Image img = VectorToolkit.image(1,1,false);
- Color col = VectorToolkit.RED;
+ Color col = Colors.RED;
UUID uuid = UUID.nameUUIDFromBytes("abcd".getBytes()); //$NON-NLS-1$
Point3D pt3d = new Point3f(0,0,0);
Point2D[] tabpt2d1 = new Point2D[0];
Modified: trunk/attrs/src/test/java/org/arakhne/afc/attrs/attr/AttributeValueTest.java
===================================================================
--- trunk/attrs/src/test/java/org/arakhne/afc/attrs/attr/AttributeValueTest.java 2013-04-04 18:23:15 UTC (rev 406)
+++ trunk/attrs/src/test/java/org/arakhne/afc/attrs/attr/AttributeValueTest.java 2013-04-04 18:23:34 UTC (rev 407)
@@ -43,6 +43,7 @@
import org.arakhne.afc.math.generic.Point2D;
import org.arakhne.afc.math.generic.Point3D;
import org.arakhne.afc.ui.vector.Color;
+import org.arakhne.afc.ui.vector.Colors;
import org.arakhne.afc.ui.vector.Image;
import org.arakhne.afc.ui.vector.VectorToolkit;
@@ -338,7 +339,7 @@
*/
public static void testAttributeValueImplColor() throws Exception {
String txt = "255;0;0;255"; //$NON-NLS-1$
- AttributeValue attr = new AttributeValueImpl(VectorToolkit.RED);
+ AttributeValue attr = new AttributeValueImpl(Colors.RED);
assertEquals(AttributeType.COLOR, attr.getType());
@@ -346,16 +347,16 @@
assertFalse(attr.isBaseType());
assertTrue(attr.isObjectValue());
- assertEquals(VectorToolkit.RED,attr.getValue());
+ assertEquals(Colors.RED,attr.getValue());
assertAttributeException(attr,"getBoolean"); //$NON-NLS-1$
- assertEquals(VectorToolkit.RED,attr.getColor());
+ assertEquals(Colors.RED,attr.getColor());
assertAttributeException(attr,"getDate"); //$NON-NLS-1$
assertAttributeException(attr,"getImage"); //$NON-NLS-1$
- assertEquals(VectorToolkit.RED.getRGB(), attr.getInteger());
- assertEquals((double)VectorToolkit.RED.getRGB(), attr.getReal());
- assertEquals(VectorToolkit.RED.getRGB(), attr.getTimestamp());
+ assertEquals(Colors.RED.getRGB(), attr.getInteger());
+ assertEquals((double)Colors.RED.getRGB(), attr.getReal());
+ assertEquals(Colors.RED.getRGB(), attr.getTimestamp());
assertEquals(txt,attr.getString());
- assertEquals(VectorToolkit.RED, attr.getJavaObject());
+ assertEquals(Colors.RED, attr.getJavaObject());
assertEquals(new Point2f(255,0),attr.getPoint());
assertEquals(new Point3f(255,0,0),attr.getPoint3D());
assertAttributeException(attr,"getPolyline"); //$NON-NLS-1$
@@ -740,7 +741,7 @@
* @throws Exception
*/
public static void testAttributeValueImplString_Color() throws Exception {
- Color c = VectorToolkit.RED;
+ Color c = Colors.RED;
Point2D pt2d = new Point2f(c.getRed(),c.getGreen());
Point2D pt2d2 = new Point2f(c.getBlue(),0);
Point3D pt3d = new Point3f(c.getRed(),c.getGreen(),c.getBlue());