X.XXX.X (20XX-XX-XX)
・逆正接の分母に小さな値が来たときの判定を甘くした。
・パッケージ構成を変更。
+ ・多言語対応に際してのフォールバックを禁止。
2.102.2 (2013-03-17)
・Maven3対応。
static{
double one = 1.0;
- for(int ct=1; ct<=STEP_BELOW; ct++){
+ for(int ct = 1; ct <= STEP_BELOW; ct++){
one = StrictMath.nextAfter(one, 0.0);
}
BELOWONE = one;
package jp.sourceforge.mikutoga.pmd;
+import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
LINKEDROT(0x09),
;
+ private static final ResourceBundle.Control NOFALLBACK;
private static final String FAMILY_NAME =
"jp.sourceforge.mikutoga.pmd.resources.BoneTypeName";
+ static{
+ List<String> rbforms = ResourceBundle.Control.FORMAT_DEFAULT;
+ NOFALLBACK = ResourceBundle.Control.getNoFallbackControl(rbforms);
+
+ String name = ROTATE.getClass().getPackage().getName();
+ assert FAMILY_NAME.startsWith(name);
+ }
+
+
private final byte encoded;
/**
*/
public String getGuiName(){
Locale locale = Locale.getDefault();
+ assert locale != null;
return getGuiName(locale);
}
*/
public String getGuiName(Locale locale){
if(locale == null) return getGuiName();
- ResourceBundle rb = ResourceBundle.getBundle(FAMILY_NAME, locale);
+ ResourceBundle rb =
+ ResourceBundle.getBundle(FAMILY_NAME, locale, NOFALLBACK);
String key = name();
String result = rb.getString(key);
return result;
package jp.sourceforge.mikutoga.pmd;
/**
- * XYZ3軸による回転量(degree)。
+ * XYZ3軸によるジョイント回転量(degree)。
+ * オイラー角か否か詳細は不明。
* radianではなくdegree。(直角は90.0)
*/
public class Deg3d {
package jp.sourceforge.mikutoga.pmd;
+import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
EXTRA(0x04),
;
+ private static final ResourceBundle.Control NOFALLBACK;
private static final String FAMILY_NAME =
"jp.sourceforge.mikutoga.pmd.resources.MorphTypeName";
+ static{
+ List<String> rbforms = ResourceBundle.Control.FORMAT_DEFAULT;
+ NOFALLBACK = ResourceBundle.Control.getNoFallbackControl(rbforms);
+
+ String name = BASE.getClass().getPackage().getName();
+ assert FAMILY_NAME.startsWith(name);
+ }
+
+
private final byte encoded;
/**
*/
public String getGuiName(){
Locale locale = Locale.getDefault();
+ assert locale != null;
return getGuiName(locale);
}
*/
public String getGuiName(Locale locale){
if(locale == null) return getGuiName();
- ResourceBundle rb = ResourceBundle.getBundle(FAMILY_NAME, locale);
+ ResourceBundle rb =
+ ResourceBundle.getBundle(FAMILY_NAME, locale, NOFALLBACK);
String key = name();
String result = rb.getString(key);
return result;
package jp.sourceforge.mikutoga.pmd;
/**
- * XYZ3軸による回転量(radian)。
+ * XYZ3軸によるジョイント回転量(radian)。
+ * オイラー角か否か詳細は不明。
* degereeではなくradian。(直角はΠ/2)
*/
public class Rad3d {
package jp.sourceforge.mikutoga.pmd;
+import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
BONEDDYNAMICS(0x02),
;
+ private static final ResourceBundle.Control NOFALLBACK;
private static final String FAMILY_NAME =
"jp.sourceforge.mikutoga.pmd.resources.RigidBehaviorTypeName";
+ static{
+ List<String> rbforms = ResourceBundle.Control.FORMAT_DEFAULT;
+ NOFALLBACK = ResourceBundle.Control.getNoFallbackControl(rbforms);
+
+ String name = FOLLOWBONE.getClass().getPackage().getName();
+ assert FAMILY_NAME.startsWith(name);
+ }
+
+
private final byte encoded;
/**
*/
public String getGuiName(){
Locale locale = Locale.getDefault();
+ assert locale != null;
return getGuiName(locale);
}
*/
public String getGuiName(Locale locale){
if(locale == null) return getGuiName();
- ResourceBundle rb = ResourceBundle.getBundle(FAMILY_NAME, locale);
+ ResourceBundle rb =
+ ResourceBundle.getBundle(FAMILY_NAME, locale, NOFALLBACK);
String key = name();
String result = rb.getString(key);
return result;
package jp.sourceforge.mikutoga.pmd;
+import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
CAPSULE(0x02),
;
+ private static final ResourceBundle.Control NOFALLBACK;
private static final String FAMILY_NAME =
"jp.sourceforge.mikutoga.pmd.resources.RigidShapeTypeName";
+ static{
+ List<String> rbforms = ResourceBundle.Control.FORMAT_DEFAULT;
+ NOFALLBACK = ResourceBundle.Control.getNoFallbackControl(rbforms);
+
+ String name = SPHERE.getClass().getPackage().getName();
+ assert FAMILY_NAME.startsWith(name);
+ }
+
+
private final byte encoded;
/**
*/
public String getGuiName(){
Locale locale = Locale.getDefault();
+ assert locale != null;
return getGuiName(locale);
}
*/
public String getGuiName(Locale locale){
if(locale == null) return getGuiName();
- ResourceBundle rb = ResourceBundle.getBundle(FAMILY_NAME, locale);
+ ResourceBundle rb =
+ ResourceBundle.getBundle(FAMILY_NAME, locale, NOFALLBACK);
String key = name();
String result = rb.getString(key);
return result;
package jp.sourceforge.mikutoga.pmd;
/**
- * XYZ三組float値の範囲制約。
+ * ジョイント用XYZ三組float値の範囲制約。
*/
public class TripletRange {
*/
/**
- * PMDモデルファイルに相当するオブジェクト各種。
+ * PMDã\83¢ã\83\87ã\83«ã\83\95ã\82¡ã\82¤ã\83«ã\81®æ§\8bæ\88\90è¦\81ç´ ã\81«ç\9b¸å½\93ã\81\99ã\82\8bã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88å\90\84種ã\80\82
*/
package jp.sourceforge.mikutoga.pmd;
--- /dev/null
+/*
+ */
+
+package jp.sourceforge.mikutoga.pmd;
+
+import java.util.Locale;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ *
+ */
+public class BoneTypeTest {
+
+ public BoneTypeTest() {
+ }
+
+ @BeforeClass
+ public static void setUpClass() {
+ }
+
+ @AfterClass
+ public static void tearDownClass() {
+ }
+
+ @Before
+ public void setUp() {
+ }
+
+ @After
+ public void tearDown() {
+ }
+
+ /**
+ * Test of values method, of class BoneType.
+ */
+ @Test
+ public void testValues() {
+ System.out.println("values");
+
+ BoneType[] array = BoneType.values();
+
+ assertEquals(10, array.length);
+
+ assertEquals(BoneType.ROTATE, array[0]);
+ assertEquals(BoneType.ROTMOV, array[1]);
+ assertEquals(BoneType.IK, array[2]);
+ assertEquals(BoneType.UNKNOWN, array[3]);
+ assertEquals(BoneType.UNDERIK, array[4]);
+ assertEquals(BoneType.UNDERROT, array[5]);
+ assertEquals(BoneType.IKCONNECTED, array[6]);
+ assertEquals(BoneType.HIDDEN, array[7]);
+ assertEquals(BoneType.TWIST, array[8]);
+ assertEquals(BoneType.LINKEDROT, array[9]);
+
+ return;
+ }
+
+ /**
+ * Test of decode method, of class BoneType.
+ */
+ @Test
+ public void testDecode() {
+ System.out.println("decode");
+
+ assertEquals(BoneType.ROTATE, BoneType.decode((byte)0x00));
+ assertEquals(BoneType.ROTMOV, BoneType.decode((byte)0x01));
+ assertEquals(BoneType.IK, BoneType.decode((byte)0x02));
+ assertEquals(BoneType.UNKNOWN, BoneType.decode((byte)0x03));
+ assertEquals(BoneType.UNDERIK, BoneType.decode((byte)0x04));
+ assertEquals(BoneType.UNDERROT, BoneType.decode((byte)0x05));
+ assertEquals(BoneType.IKCONNECTED, BoneType.decode((byte)0x06));
+ assertEquals(BoneType.HIDDEN, BoneType.decode((byte)0x07));
+ assertEquals(BoneType.TWIST, BoneType.decode((byte)0x08));
+ assertEquals(BoneType.LINKEDROT, BoneType.decode((byte)0x09));
+
+ assertNull(BoneType.decode((byte)0x0a));
+
+ return;
+ }
+
+ /**
+ * Test of encode method, of class BoneType.
+ */
+ @Test
+ public void testEncode() {
+ System.out.println("encode");
+
+ assertEquals(0x00, BoneType.ROTATE.encode());
+ assertEquals(0x01, BoneType.ROTMOV.encode());
+ assertEquals(0x02, BoneType.IK.encode());
+ assertEquals(0x03, BoneType.UNKNOWN.encode());
+ assertEquals(0x04, BoneType.UNDERIK.encode());
+ assertEquals(0x05, BoneType.UNDERROT.encode());
+ assertEquals(0x06, BoneType.IKCONNECTED.encode());
+ assertEquals(0x07, BoneType.HIDDEN.encode());
+ assertEquals(0x08, BoneType.TWIST.encode());
+ assertEquals(0x09, BoneType.LINKEDROT.encode());
+
+ return;
+ }
+
+ /**
+ * Test of getGuiName method, of class BoneType.
+ */
+ @Test
+ public void testGetGuiName_0args() {
+ System.out.println("getGuiName");
+
+ Locale locale = Locale.getDefault();
+
+ for(BoneType type : BoneType.values()){
+ assertEquals(type.getGuiName(locale), type.getGuiName());
+ }
+
+ return;
+ }
+
+ /**
+ * Test of getGuiName method, of class BoneType.
+ */
+ @Test
+ public void testGetGuiName_Locale() {
+ System.out.println("getGuiName");
+
+ Locale locale;
+
+ locale = Locale.JAPANESE;
+ assertEquals("回転", BoneType.ROTATE.getGuiName(locale));
+ assertEquals("回転/移動", BoneType.ROTMOV.getGuiName(locale));
+ assertEquals("IK", BoneType.IK.getGuiName(locale));
+ assertEquals("不明", BoneType.UNKNOWN.getGuiName(locale));
+ assertEquals("IK影響下(回転)", BoneType.UNDERIK.getGuiName(locale));
+ assertEquals("回転影響下", BoneType.UNDERROT.getGuiName(locale));
+ assertEquals("IK接続先", BoneType.IKCONNECTED.getGuiName(locale));
+ assertEquals("非表示", BoneType.HIDDEN.getGuiName(locale));
+ assertEquals("捩り", BoneType.TWIST.getGuiName(locale));
+ assertEquals("回転連動", BoneType.LINKEDROT.getGuiName(locale));
+
+ locale = Locale.JAPAN;
+ assertEquals("回転", BoneType.ROTATE.getGuiName(locale));
+
+ locale = Locale.ITALY;
+ assertEquals("Rotate", BoneType.ROTATE.getGuiName(locale));
+ assertEquals("Rotate/Move", BoneType.ROTMOV.getGuiName(locale));
+ assertEquals("IK", BoneType.IK.getGuiName(locale));
+ assertEquals("Unknown", BoneType.UNKNOWN.getGuiName(locale));
+ assertEquals("Under IK", BoneType.UNDERIK.getGuiName(locale));
+ assertEquals("Under rotate", BoneType.UNDERROT.getGuiName(locale));
+ assertEquals("IK connected", BoneType.IKCONNECTED.getGuiName(locale));
+ assertEquals("Hidden", BoneType.HIDDEN.getGuiName(locale));
+ assertEquals("Twist", BoneType.TWIST.getGuiName(locale));
+ assertEquals("Linked Rotate", BoneType.LINKEDROT.getGuiName(locale));
+
+ locale = Locale.ENGLISH;
+ assertEquals("Rotate", BoneType.ROTATE.getGuiName(locale));
+
+ locale = Locale.US;
+ assertEquals("Rotate", BoneType.ROTATE.getGuiName(locale));
+
+ return;
+ }
+
+}
--- /dev/null
+/*
+ */
+
+package jp.sourceforge.mikutoga.pmd;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ *
+ */
+public class Deg3dTest {
+
+ public Deg3dTest() {
+ }
+
+ @BeforeClass
+ public static void setUpClass() {
+ }
+
+ @AfterClass
+ public static void tearDownClass() {
+ }
+
+ @Before
+ public void setUp() {
+ }
+
+ @After
+ public void tearDown() {
+ }
+
+ /**
+ * Test of method, of class Deg3d.
+ */
+ @Test
+ public void test() {
+ System.out.println("test Deg3d");
+
+ Deg3d deg = new Deg3d();
+
+ assertEquals(0.0f, deg.getXDeg(), 0);
+ assertEquals(0.0f, deg.getYDeg(), 0);
+ assertEquals(0.0f, deg.getZDeg(), 0);
+
+ deg.setXDeg(1.0f);
+ deg.setYDeg(2.0f);
+ deg.setZDeg(3.0f);
+
+ assertEquals(1.0f, deg.getXDeg(), 0);
+ assertEquals(2.0f, deg.getYDeg(), 0);
+ assertEquals(3.0f, deg.getZDeg(), 0);
+
+ assertEquals("deg=[1.0, 2.0, 3.0]", deg.toString());
+
+ return;
+ }
+
+}
--- /dev/null
+/*
+ */
+
+package jp.sourceforge.mikutoga.pmd;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ *
+ */
+public class IllegalPmdDataExceptionTest {
+
+ public IllegalPmdDataExceptionTest() {
+ }
+
+ @BeforeClass
+ public static void setUpClass() {
+ }
+
+ @AfterClass
+ public static void tearDownClass() {
+ }
+
+ @Before
+ public void setUp() {
+ }
+
+ @After
+ public void tearDown() {
+ }
+
+ @Test
+ public void testSomeMethod() {
+ IllegalPmdDataException ex;
+
+ ex = new IllegalPmdDataException();
+ assertNull(ex.getCause());
+ assertNull(ex.getMessage());
+
+ ex = new IllegalPmdDataException("msg");
+ assertNull(ex.getCause());
+ assertEquals("msg", ex.getMessage());
+
+ Throwable cex = new IllegalArgumentException();
+ ex = new IllegalPmdDataException(cex);
+ assertEquals(cex, ex.getCause());
+ assertEquals(cex.toString(), ex.getMessage());
+
+ return;
+ }
+
+}
import static org.junit.Assert.*;
/**
- *
+ *
*/
public class MorphTypeTest {
assertEquals(5, array.length);
- assertEquals(MorphType.BASE, array[0]);
+ assertEquals(MorphType.BASE, array[0]);
assertEquals(MorphType.EYEBROW, array[1]);
- assertEquals(MorphType.EYE, array[2]);
- assertEquals(MorphType.LIP, array[3]);
- assertEquals(MorphType.EXTRA, array[4]);
+ assertEquals(MorphType.EYE, array[2]);
+ assertEquals(MorphType.LIP, array[3]);
+ assertEquals(MorphType.EXTRA, array[4]);
return;
}
public void testGetGuiName_Locale(){
System.out.println("getGuiName");
- Locale locale = Locale.JAPANESE;
+ Locale locale;
- assertEquals("base", MorphType.BASE.getGuiName(locale));
- assertEquals("まゆ", MorphType.EYEBROW.getGuiName(locale));
- assertEquals("目", MorphType.EYE.getGuiName(locale));
+ locale = Locale.JAPANESE;
+ assertEquals("base", MorphType.BASE.getGuiName(locale));
+ assertEquals("まゆ", MorphType.EYEBROW.getGuiName(locale));
+ assertEquals("目", MorphType.EYE.getGuiName(locale));
assertEquals("リップ", MorphType.LIP.getGuiName(locale));
assertEquals("その他", MorphType.EXTRA.getGuiName(locale));
-
+
+ locale = Locale.JAPAN;
+ assertEquals("まゆ", MorphType.EYEBROW.getGuiName(locale));
+
+ locale = Locale.ITALY;
+ assertEquals("base", MorphType.BASE.getGuiName(locale));
+ assertEquals("brow", MorphType.EYEBROW.getGuiName(locale));
+ assertEquals("eyes", MorphType.EYE.getGuiName(locale));
+ assertEquals("mouse", MorphType.LIP.getGuiName(locale));
+ assertEquals("other", MorphType.EXTRA.getGuiName(locale));
+
+ locale = Locale.ENGLISH;
+ assertEquals("brow", MorphType.EYEBROW.getGuiName(locale));
+
+ locale = Locale.US;
+ assertEquals("brow", MorphType.EYEBROW.getGuiName(locale));
+
+ return;
+ }
+
+ /**
+ * Test of isBase method, of class MorphType.
+ */
+ @Test
+ public void testIsBase(){
+ System.out.println("isBase");
+
+ assertTrue(MorphType.BASE.isBase());
+ assertFalse(MorphType.EYEBROW.isBase());
+ assertFalse(MorphType.EYE.isBase());
+ assertFalse(MorphType.LIP.isBase());
+ assertFalse(MorphType.EXTRA.isBase());
+
return;
}
--- /dev/null
+/*
+ */
+
+package jp.sourceforge.mikutoga.pmd;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ *
+ */
+public class Rad3dTest {
+
+ public Rad3dTest() {
+ }
+
+ @BeforeClass
+ public static void setUpClass() {
+ }
+
+ @AfterClass
+ public static void tearDownClass() {
+ }
+
+ @Before
+ public void setUp() {
+ }
+
+ @After
+ public void tearDown() {
+ }
+
+ /**
+ * Test of method, of class Deg3d.
+ */
+ @Test
+ public void test() {
+ System.out.println("test Rad3d");
+
+ Rad3d rad = new Rad3d();
+
+ assertEquals(0.0f, rad.getXRad(), 0);
+ assertEquals(0.0f, rad.getYRad(), 0);
+ assertEquals(0.0f, rad.getZRad(), 0);
+
+ rad.setXRad(1.0f);
+ rad.setYRad(2.0f);
+ rad.setZRad(3.0f);
+
+ assertEquals(1.0f, rad.getXRad(), 0);
+ assertEquals(2.0f, rad.getYRad(), 0);
+ assertEquals(3.0f, rad.getZRad(), 0);
+
+ assertEquals("rad=[1.0, 2.0, 3.0]", rad.toString());
+
+ return;
+ }
+
+}
--- /dev/null
+/*
+ */
+
+package jp.sourceforge.mikutoga.pmd;
+
+import java.util.Locale;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ *
+ */
+public class RigidBehaviorTypeTest {
+
+ public RigidBehaviorTypeTest() {
+ }
+
+ @BeforeClass
+ public static void setUpClass() {
+ }
+
+ @AfterClass
+ public static void tearDownClass() {
+ }
+
+ @Before
+ public void setUp() {
+ }
+
+ @After
+ public void tearDown() {
+ }
+
+ /**
+ * Test of values method, of class RigidBehaviorType.
+ */
+ @Test
+ public void testValues() {
+ System.out.println("values");
+
+ RigidBehaviorType[] array = RigidBehaviorType.values();
+
+ assertEquals(3, array.length);
+
+ assertEquals(RigidBehaviorType.FOLLOWBONE, array[0]);
+ assertEquals(RigidBehaviorType.ONLYDYNAMICS, array[1]);
+ assertEquals(RigidBehaviorType.BONEDDYNAMICS, array[2]);
+
+ return;
+ }
+
+ /**
+ * Test of decode method, of class RigidBehaviorType.
+ */
+ @Test
+ public void testDecode() {
+ System.out.println("decode");
+
+ assertEquals(RigidBehaviorType.FOLLOWBONE, RigidBehaviorType.decode((byte)0x00));
+ assertEquals(RigidBehaviorType.ONLYDYNAMICS, RigidBehaviorType.decode((byte)0x01));
+ assertEquals(RigidBehaviorType.BONEDDYNAMICS, RigidBehaviorType.decode((byte)0x02));
+
+ assertNull(RigidBehaviorType.decode((byte)0x03));
+
+ return;
+ }
+
+ /**
+ * Test of encode method, of class RigidBehaviorType.
+ */
+ @Test
+ public void testEncode() {
+ System.out.println("encode");
+
+ assertEquals(0x00, RigidBehaviorType.FOLLOWBONE.encode());
+ assertEquals(0x01, RigidBehaviorType.ONLYDYNAMICS.encode());
+ assertEquals(0x02, RigidBehaviorType.BONEDDYNAMICS.encode());
+
+ return;
+ }
+
+ /**
+ * Test of getGuiName method, of class RigidBehaviorType.
+ */
+ @Test
+ public void testGetGuiName_0args() {
+ System.out.println("getGuiName");
+
+ Locale locale = Locale.getDefault();
+
+ for(RigidBehaviorType type : RigidBehaviorType.values()){
+ assertEquals(type.getGuiName(locale), type.getGuiName());
+ }
+
+ return;
+ }
+
+ /**
+ * Test of getGuiName method, of class RigidBehaviorType.
+ */
+ @Test
+ public void testGetGuiName_Locale() {
+ System.out.println("getGuiName");
+
+ Locale locale;
+
+ locale = Locale.JAPANESE;
+ assertEquals("ボーン追従", RigidBehaviorType.FOLLOWBONE.getGuiName(locale));
+ assertEquals("物理演算", RigidBehaviorType.ONLYDYNAMICS.getGuiName(locale));
+ assertEquals("ボーン位置合わせ", RigidBehaviorType.BONEDDYNAMICS.getGuiName(locale));
+
+ locale = Locale.JAPAN;
+ assertEquals("ボーン追従", RigidBehaviorType.FOLLOWBONE.getGuiName(locale));
+
+ locale = Locale.ITALY;
+ assertEquals("static(to bone)", RigidBehaviorType.FOLLOWBONE.getGuiName(locale));
+ assertEquals("dynamic", RigidBehaviorType.ONLYDYNAMICS.getGuiName(locale));
+ assertEquals("bone matching", RigidBehaviorType.BONEDDYNAMICS.getGuiName(locale));
+
+ locale = Locale.ENGLISH;
+ assertEquals("static(to bone)", RigidBehaviorType.FOLLOWBONE.getGuiName(locale));
+
+ locale = Locale.US;
+ assertEquals("static(to bone)", RigidBehaviorType.FOLLOWBONE.getGuiName(locale));
+
+ return;
+ }
+
+}
--- /dev/null
+/*
+ */
+
+package jp.sourceforge.mikutoga.pmd;
+
+import java.util.Locale;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ *
+ */
+public class RigidShapeTypeTest {
+
+ public RigidShapeTypeTest() {
+ }
+
+ @BeforeClass
+ public static void setUpClass() {
+ }
+
+ @AfterClass
+ public static void tearDownClass() {
+ }
+
+ @Before
+ public void setUp() {
+ }
+
+ @After
+ public void tearDown() {
+ }
+
+ /**
+ * Test of values method, of class RigidShapeType.
+ */
+ @Test
+ public void testValues() {
+ System.out.println("values");
+
+ RigidShapeType[] array = RigidShapeType.values();
+
+ assertEquals(3, array.length);
+
+ assertEquals(RigidShapeType.SPHERE, array[0]);
+ assertEquals(RigidShapeType.BOX, array[1]);
+ assertEquals(RigidShapeType.CAPSULE, array[2]);
+
+ return;
+ }
+
+ /**
+ * Test of decode method, of class RigidShapeType.
+ */
+ @Test
+ public void testDecode() {
+ System.out.println("decode");
+
+ assertEquals(RigidShapeType.SPHERE, RigidShapeType.decode((byte)0x00));
+ assertEquals(RigidShapeType.BOX, RigidShapeType.decode((byte)0x01));
+ assertEquals(RigidShapeType.CAPSULE, RigidShapeType.decode((byte)0x02));
+
+ assertNull(RigidShapeType.decode((byte)0x03));
+
+ return;
+ }
+
+ /**
+ * Test of encode method, of class RigidShapeType.
+ */
+ @Test
+ public void testEncode() {
+ System.out.println("encode");
+
+ assertEquals(0x00, RigidShapeType.SPHERE.encode());
+ assertEquals(0x01, RigidShapeType.BOX.encode());
+ assertEquals(0x02, RigidShapeType.CAPSULE.encode());
+
+ return;
+ }
+
+ /**
+ * Test of getGuiName method, of class RigidShapeType.
+ */
+ @Test
+ public void testGetGuiName_0args() {
+ System.out.println("getGuiName");
+
+ Locale locale = Locale.getDefault();
+
+ for(RigidShapeType type : RigidShapeType.values()){
+ assertEquals(type.getGuiName(locale), type.getGuiName());
+ }
+
+ return;
+ }
+
+ /**
+ * Test of getGuiName method, of class RigidShapeType.
+ */
+ @Test
+ public void testGetGuiName_Locale() {
+ System.out.println("getGuiName");
+
+ Locale locale;
+
+ locale = Locale.JAPANESE;
+ assertEquals("球", RigidShapeType.SPHERE.getGuiName(locale));
+ assertEquals("箱", RigidShapeType.BOX.getGuiName(locale));
+ assertEquals("カプセル", RigidShapeType.CAPSULE.getGuiName(locale));
+
+ locale = Locale.JAPAN;
+ assertEquals("球", RigidShapeType.SPHERE.getGuiName(locale));
+
+ locale = Locale.ITALY;
+ assertEquals("sphere", RigidShapeType.SPHERE.getGuiName(locale));
+ assertEquals("box", RigidShapeType.BOX.getGuiName(locale));
+ assertEquals("capsule", RigidShapeType.CAPSULE.getGuiName(locale));
+
+ locale = Locale.ENGLISH;
+ assertEquals("sphere", RigidShapeType.SPHERE.getGuiName(locale));
+
+ locale = Locale.US;
+ assertEquals("sphere", RigidShapeType.SPHERE.getGuiName(locale));
+
+ return;
+ }
+
+}
--- /dev/null
+/*
+ */
+
+package jp.sourceforge.mikutoga.pmd;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ *
+ */
+public class TripletRangeTest {
+
+ public TripletRangeTest() {
+ }
+
+ @BeforeClass
+ public static void setUpClass() {
+ }
+
+ @AfterClass
+ public static void tearDownClass() {
+ }
+
+ @Before
+ public void setUp() {
+ }
+
+ @After
+ public void tearDown() {
+ }
+
+ /**
+ * Test of method, of class TripletRange.
+ */
+ @Test
+ public void test() {
+ System.out.println("test");
+
+ TripletRange range;
+
+ range = new TripletRange();
+ assertEquals(0.0f, range.getXFrom(), 0);
+ assertEquals(0.0f, range.getXTo(), 0);
+ assertEquals(0.0f, range.getYFrom(), 0);
+ assertEquals(0.0f, range.getYTo(), 0);
+ assertEquals(0.0f, range.getZFrom(), 0);
+ assertEquals(0.0f, range.getZTo(), 0);
+
+ range.setXRange(1.0f, 2.0f);
+ assertEquals(1.0f, range.getXFrom(), 0);
+ assertEquals(2.0f, range.getXTo(), 0);
+ range.setXRange(2.0f, 1.0f);
+ assertEquals(1.0f, range.getXFrom(), 0);
+ assertEquals(2.0f, range.getXTo(), 0);
+ assertTrue(range.isValidX(1.0f));
+ assertTrue(range.isValidX(1.5f));
+ assertTrue(range.isValidX(2.0f));
+ assertFalse(range.isValidX(0.5f));
+ assertFalse(range.isValidX(2.5f));
+
+ range.setYRange(3.0f, 4.0f);
+ assertEquals(3.0f, range.getYFrom(), 0);
+ assertEquals(4.0f, range.getYTo(), 0);
+ range.setYRange(4.0f, 3.0f);
+ assertEquals(3.0f, range.getYFrom(), 0);
+ assertEquals(4.0f, range.getYTo(), 0);
+ assertTrue(range.isValidY(3.0f));
+ assertTrue(range.isValidY(3.5f));
+ assertTrue(range.isValidY(4.0f));
+ assertFalse(range.isValidY(2.5f));
+ assertFalse(range.isValidY(4.5f));
+
+ range.setZRange(5.0f, 6.0f);
+ assertEquals(5.0f, range.getZFrom(), 0);
+ assertEquals(6.0f, range.getZTo(), 0);
+ range.setZRange(6.0f, 5.0f);
+ assertEquals(5.0f, range.getZFrom(), 0);
+ assertEquals(6.0f, range.getZTo(), 0);
+ assertTrue(range.isValidZ(5.0f));
+ assertTrue(range.isValidZ(5.5f));
+ assertTrue(range.isValidZ(6.0f));
+ assertFalse(range.isValidZ(4.5f));
+ assertFalse(range.isValidZ(6.5f));
+
+ assertEquals("x=[1.0 - 2.0] y=[3.0 - 4.0] z=[5.0 - 6.0]", range.toString());
+
+ return;
+ }
+
+}