4 * License : The MIT License
5 * Copyright(c) 2010 MikuToga Partners
8 package jp.sourceforge.mikutoga.pmd;
10 import java.util.Locale;
11 import java.util.ResourceBundle;
18 * <li>0x02:物理演算+ボーン位置合わせ
21 public enum RigidBehaviorType {
31 private static final String FAMILY_NAME =
32 "jp.sourceforge.mikutoga.pmd.resources.RigidBehaviorTypeName";
34 private final byte encoded;
40 private RigidBehaviorType(int code){
47 * @param code 符号化byte値
49 private RigidBehaviorType(byte code){
57 * @return デコードされた列挙子。該当するものがなければnull
59 public static RigidBehaviorType decode(byte code){
60 RigidBehaviorType result = null;
62 for(RigidBehaviorType type : values()){
63 if(type.encode() == code){
84 public String getGuiName(){
85 Locale locale = Locale.getDefault();
86 return getGuiName(locale);
91 * @param locale ロケール。nullならデフォルトロケールと解釈される。
94 public String getGuiName(Locale locale){
95 if(locale == null) return getGuiName();
96 ResourceBundle rb = ResourceBundle.getBundle(FAMILY_NAME, locale);
98 String result = rb.getString(key);