4 * License : The MIT License
5 * Copyright(c) 2010 MikuToga Partners
8 package jp.sfjp.mikutoga.pmd;
10 import java.util.List;
11 import java.util.Locale;
12 import java.util.ResourceBundle;
19 * <li>0x02:物理演算+ボーン位置合わせ
22 public enum RigidBehaviorType {
32 private static final ResourceBundle.Control NOFALLBACK;
33 private static final String FAMILY_NAME =
34 "jp.sfjp.mikutoga.pmd.resources.RigidBehaviorTypeName";
37 List<String> rbforms = ResourceBundle.Control.FORMAT_DEFAULT;
38 NOFALLBACK = ResourceBundle.Control.getNoFallbackControl(rbforms);
40 String name = FOLLOWBONE.getClass().getPackage().getName();
41 assert FAMILY_NAME.startsWith(name);
45 private final byte encoded;
51 private RigidBehaviorType(int code){
58 * @param code 符号化byte値
60 private RigidBehaviorType(byte code){
68 * @return デコードされた列挙子。該当するものがなければnull
70 public static RigidBehaviorType decode(byte code){
71 RigidBehaviorType result = null;
73 for(RigidBehaviorType type : values()){
74 if(type.encode() == code){
95 public String getGuiName(){
96 Locale locale = Locale.getDefault();
97 assert locale != null;
98 return getGuiName(locale);
103 * @param locale ロケール。nullならデフォルトロケールと解釈される。
106 public String getGuiName(Locale locale){
107 if(locale == null) return getGuiName();
109 ResourceBundle.getBundle(FAMILY_NAME, locale, NOFALLBACK);
111 String result = rb.getString(key);