• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

カルネージハートエクサのチームデータ編集ツール JAVAベース


Commit MetaInfo

Revision9 (tree)
Time2015-06-04 22:30:45
Authormanjihq

Log Message

半角全角する文字種を追加

Change Summary

Incremental Difference

--- chexaFormation/trunk/src/chexaformation/cheNameDocument.java (revision 8)
+++ chexaFormation/trunk/src/chexaformation/cheNameDocument.java (revision 9)
@@ -11,10 +11,21 @@
1111 */
1212 public class cheNameDocument extends PlainDocument {
1313
14+ final String alphaList;
15+ final String alphaZenList;
16+
1417 /**
1518 * コンストラクタ
1619 */
1720 public cheNameDocument() {
21+ alphaList = " ABCDEFGHIJKLMNOPQRSTUVWXYZ"
22+ + "abcdefghijklmnopqrstuvwxyz"
23+ + "0123456789!\"#$%&'()-=+*/@.,_"
24+ + "^~|;:[]{}\\`";
25+ alphaZenList = " ABCDEFGHIJKLMNOPQRSTUVWXYZ"
26+ + "abcdefghijklmnopqrstuvwxyz"
27+ + "0123456789!”#$%&’()ー=+*/@.,_"
28+ + "^~|;:[]{}¥‘";
1829 }
1930
2031 @Override
@@ -26,7 +37,12 @@
2637 int i;
2738 char[] wkbuffer = str.toCharArray();
2839 for (i = 0; i < wkbuffer.length; i++) {
29- if ((wkbuffer[i] & 0xff) == wkbuffer[i]) {
40+ int nwk;
41+ nwk = alphaList.indexOf(wkbuffer[i]);
42+ if (nwk >= 0) {
43+ //対応する全角文字へ変換
44+ wkbuffer[i] = alphaZenList.charAt(nwk);
45+ } else if ((wkbuffer[i] & 0xff) == wkbuffer[i]) {
3046 //SJISにするとシングルバイトになるかも
3147 wkbuffer[i] = ' ';
3248 }