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;
22 public enum RigidShapeType {
32 private static final ResourceBundle.Control NOFALLBACK;
33 private static final String FAMILY_NAME =
34 "jp.sfjp.mikutoga.pmd.resources.RigidShapeTypeName";
37 List<String> rbforms = ResourceBundle.Control.FORMAT_DEFAULT;
38 NOFALLBACK = ResourceBundle.Control.getNoFallbackControl(rbforms);
40 String name = SPHERE.getClass().getPackage().getName();
41 assert FAMILY_NAME.startsWith(name);
45 private final byte encoded;
51 RigidShapeType(int code){
58 * @param code 符号化byte値
60 RigidShapeType(byte code){
68 * @return デコードされた列挙子。該当するものがなければnull
70 public static RigidShapeType decode(byte code){
71 RigidShapeType result = null;
73 for(RigidShapeType 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);