X-Git-Url: http://git.osdn.net/view?p=mikutoga%2FTogaGem.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fjp%2Fsourceforge%2Fmikutoga%2Fpmd%2FRigidShapeType.java;h=ed120094b1a5df9c27f23484ec81a98a9881d493;hp=33df15decd870ea6254449d12ec13e5a16365ab2;hb=d68ba6e44800ba2c2f0da1f4b5d6be588b30079f;hpb=22e885262e66e14adb858c35e38f022d86378b13
diff --git a/src/main/java/jp/sourceforge/mikutoga/pmd/RigidShapeType.java b/src/main/java/jp/sourceforge/mikutoga/pmd/RigidShapeType.java
index 33df15d..ed12009 100644
--- a/src/main/java/jp/sourceforge/mikutoga/pmd/RigidShapeType.java
+++ b/src/main/java/jp/sourceforge/mikutoga/pmd/RigidShapeType.java
@@ -1,102 +1,102 @@
-/*
- * rigid shape type
- *
- * License : The MIT License
- * Copyright(c) 2010 MikuToga Partners
- */
-
-package jp.sourceforge.mikutoga.pmd;
-
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-/**
- * åä½ã®å½¢ç¶ç¨®å¥ã
- *
- * - 0x00:ç
- *
- 0x01:ç®±
- *
- 0x02:ã«ãã»ã«
- *
- */
-public enum RigidShapeType {
-
- /** çã */
- SPHERE(0x00),
- /** ç®±ã */
- BOX(0x01),
- /** ã«ãã»ã«ã */
- CAPSULE(0x02),
- ;
-
- private static final String FAMILY_NAME =
- "jp.sourceforge.mikutoga.pmd.resources.RigidShapeTypeName";
-
- private final byte encoded;
-
- /**
- * ã³ã³ã¹ãã©ã¯ã¿ã
- * @param code 符å·åintå¤
- */
- private RigidShapeType(int code){
- this((byte)code);
- return;
- }
-
- /**
- * ã³ã³ã¹ãã©ã¯ã¿ã
- * @param code 符å·åbyteå¤
- */
- private RigidShapeType(byte code){
- this.encoded = code;
- return;
- }
-
- /**
- * byteå¤ãããã³ã¼ãããã
- * @param code byteå¤
- * @return ãã³ã¼ããããåæåã該å½ãããã®ããªããã°null
- */
- public static RigidShapeType decode(byte code){
- RigidShapeType result = null;
-
- for(RigidShapeType type : values()){
- if(type.encode() == code){
- result = type;
- break;
- }
- }
-
- return result;
- }
-
- /**
- * byteå¤ã«ã¨ã³ã³ã¼ãããã
- * @return byteå¤
- */
- public byte encode(){
- return this.encoded;
- }
-
- /**
- * ããã©ã«ããã±ã¼ã«ã§ã®è¡¨ç¤ºåãè¿ãã
- * @return 表示å
- */
- public String getGuiName(){
- Locale locale = Locale.getDefault();
- return getGuiName(locale);
- }
-
- /**
- * ãã±ã¼ã«ã«æºãã表示åãè¿ãã
- * @param locale ãã±ã¼ã«ãnullãªãããã©ã«ããã±ã¼ã«ã¨è§£éãããã
- * @return 表示å
- */
- public String getGuiName(Locale locale){
- if(locale == null) return getGuiName();
- ResourceBundle rb = ResourceBundle.getBundle(FAMILY_NAME, locale);
- String key = name();
- String result = rb.getString(key);
- return result;
- }
-
-}
+/*
+ * rigid shape type
+ *
+ * License : The MIT License
+ * Copyright(c) 2010 MikuToga Partners
+ */
+
+package jp.sourceforge.mikutoga.pmd;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+/**
+ * åä½ã®å½¢ç¶ç¨®å¥ã
+ *
+ * - 0x00:ç
+ *
- 0x01:ç®±
+ *
- 0x02:ã«ãã»ã«
+ *
+ */
+public enum RigidShapeType {
+
+ /** çã */
+ SPHERE(0x00),
+ /** ç®±ã */
+ BOX(0x01),
+ /** ã«ãã»ã«ã */
+ CAPSULE(0x02),
+ ;
+
+ private static final String FAMILY_NAME =
+ "jp.sourceforge.mikutoga.pmd.resources.RigidShapeTypeName";
+
+ private final byte encoded;
+
+ /**
+ * ã³ã³ã¹ãã©ã¯ã¿ã
+ * @param code 符å·åintå¤
+ */
+ private RigidShapeType(int code){
+ this((byte)code);
+ return;
+ }
+
+ /**
+ * ã³ã³ã¹ãã©ã¯ã¿ã
+ * @param code 符å·åbyteå¤
+ */
+ private RigidShapeType(byte code){
+ this.encoded = code;
+ return;
+ }
+
+ /**
+ * byteå¤ãããã³ã¼ãããã
+ * @param code byteå¤
+ * @return ãã³ã¼ããããåæåã該å½ãããã®ããªããã°null
+ */
+ public static RigidShapeType decode(byte code){
+ RigidShapeType result = null;
+
+ for(RigidShapeType type : values()){
+ if(type.encode() == code){
+ result = type;
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * byteå¤ã«ã¨ã³ã³ã¼ãããã
+ * @return byteå¤
+ */
+ public byte encode(){
+ return this.encoded;
+ }
+
+ /**
+ * ããã©ã«ããã±ã¼ã«ã§ã®è¡¨ç¤ºåãè¿ãã
+ * @return 表示å
+ */
+ public String getGuiName(){
+ Locale locale = Locale.getDefault();
+ return getGuiName(locale);
+ }
+
+ /**
+ * ãã±ã¼ã«ã«æºãã表示åãè¿ãã
+ * @param locale ãã±ã¼ã«ãnullãªãããã©ã«ããã±ã¼ã«ã¨è§£éãããã
+ * @return 表示å
+ */
+ public String getGuiName(Locale locale){
+ if(locale == null) return getGuiName();
+ ResourceBundle rb = ResourceBundle.getBundle(FAMILY_NAME, locale);
+ String key = name();
+ String result = rb.getString(key);
+ return result;
+ }
+
+}