• 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

Revision6 (tree)
Time2016-01-27 00:11:06
Authormanjihq

Log Message

メッセージ類をリソースファイルへ分離して日本語化
メインビューでEnterキーを押すとチャットウィンドウへフォーカスを移動するようにした

Change Summary

Incremental Difference

--- trunk/src/hunton/HuntWriteWnd.java (revision 5)
+++ trunk/src/hunton/HuntWriteWnd.java (revision 6)
@@ -39,8 +39,9 @@
3939 if (barticle == true) {
4040 /* post */
4141 if (MesgBox.MessageBox(wnd,
42- "Do you want to post article?",
43- "Post article", null, true) == true) {
42+ Hunt.getBundle().getString("CONFIRM_POST"),
43+ Hunt.getBundle().getString("TITLE_POSTARTICLE"), null,
44+ true) == true) {
4445 /* process to post article */
4546 String subject = wnd.getTitle();
4647 String mesg;
@@ -50,16 +51,17 @@
5051 } else {
5152 /* send mail */
5253 if (MesgBox.MessageBox(wnd,
53- "Do you want to send mail?",
54- "Send mail", null, true) == true) {
54+ Hunt.getBundle().getString("CONFIRM_SEND"),
55+ Hunt.getBundle().getString("TITLE_SENDMAIL"), null,
56+ true) == true) {
5557 /* process to send mail */
5658 String s = wnd.getTitle().substring(8);
5759 StringBuffer work = new StringBuffer();
58- s = Hunt.getToken(s, ">", work);
60+ s = Hunt.getToken(s, ">", work); //NOI18N
5961 if (work.length() > 0) {
6062 String username = work.toString();
6163 String mesg;
62- Hunt.getToken(s, "\n", work);
64+ Hunt.getToken(s, "\n", work); //NOI18N
6365 mesg = wnd.getText();
6466 Hunt.getSendTask().send_one_mail(username,
6567 work.toString(), mesg);
--- trunk/src/hunton/MesgBox.java (revision 5)
+++ trunk/src/hunton/MesgBox.java (revision 6)
@@ -34,12 +34,12 @@
3434 if (ask == true) {
3535 Panel panel = new Panel();
3636 Button button;
37- button = new Button("YES");
38- button.setActionCommand("OK");
37+ button = new Button(Hunt.getBundle().getString("BUTTON_YES"));
38+ button.setActionCommand("OK"); //NOI18N
3939 button.addActionListener(msgevent);
4040 panel.add(button);
41- button = new Button("N O");
42- button.setActionCommand("CANCEL");
41+ button = new Button(Hunt.getBundle().getString("BUTTON_NO"));
42+ button.setActionCommand("CANCEL"); //NOI18N
4343 button.addActionListener(msgevent);
4444 panel.add(button);
4545 dialog.add(panel, BorderLayout.SOUTH);
@@ -46,8 +46,8 @@
4646 } else {
4747 Panel panel = new Panel();
4848 Button button;
49- button = new Button("OK");
50- button.setActionCommand("OK");
49+ button = new Button(Hunt.getBundle().getString("BUTTON_OK"));
50+ button.setActionCommand("OK"); //NOI18N
5151 button.addActionListener(msgevent);
5252 panel.add(button);
5353 dialog.add(panel, BorderLayout.SOUTH);
@@ -78,12 +78,12 @@
7878 dialog.add(panel, BorderLayout.CENTER);
7979 panel = new Panel();
8080 Button button;
81- button = new Button("OK");
82- button.setActionCommand("OK");
81+ button = new Button(Hunt.getBundle().getString("BUTTON_OK"));
82+ button.setActionCommand("OK"); //NOI18N
8383 button.addActionListener(msgevent);
8484 panel.add(button);
85- button = new Button("CANCEL");
86- button.setActionCommand("CANCEL");
85+ button = new Button(Hunt.getBundle().getString("BUTTON_CANCEL"));
86+ button.setActionCommand("CANCEL"); //NOI18N
8787 button.addActionListener(msgevent);
8888 panel.add(button);
8989 dialog.add(panel, BorderLayout.SOUTH);
@@ -116,10 +116,10 @@
116116 @Override
117117 public void actionPerformed(ActionEvent e) {
118118 String cmd = e.getActionCommand();
119- if (cmd.equals("OK") == true) {
119+ if (cmd.equals("OK") == true) { //NOI18N
120120 ok = true;
121121 dialog.dispose();
122- } else if (cmd.equals("CANCEL") == true) {
122+ } else if (cmd.equals("CANCEL") == true) { //NOI18N
123123 dialog.dispose();
124124 }
125125 }
--- trunk/src/hunton/SendTask.java (revision 5)
+++ trunk/src/hunton/SendTask.java (revision 6)
@@ -123,7 +123,7 @@
123123 case 'V':
124124 case 'v': /* print rivision */
125125
126- Hunt.display_message("Version 2.00");
126+ Hunt.display_message("Version 2.00"); //NOI18N
127127 break;
128128
129129 case '?': /* command list */
@@ -133,7 +133,10 @@
133133
134134 default:
135135 MesgBox.MessageBox((Frame) Hunt.getMessageView(),
136- "Invalid command", "Error", null, false);
136+ Hunt.getBundle().
137+ getString("ERRMESG_INVALIDCOMMAND"),
138+ Hunt.getBundle().getString("TITLE_ERROR"),
139+ null, false);
137140 break;
138141 }
139142 break;
@@ -184,7 +187,10 @@
184187
185188 default:
186189 MesgBox.MessageBox((Frame) Hunt.getMessageView(),
187- "Invalid mail command", "Error", null, false);
190+ Hunt.getBundle().
191+ getString("ERRMESG_INVALIDMAILCOMMAND"),
192+ Hunt.getBundle().getString("TITLE_ERROR"),
193+ null, false);
188194 break;
189195 }
190196 break;
@@ -220,7 +226,7 @@
220226 /* say command */
221227 void sayCommand(String s) {
222228 StringBuffer work = new StringBuffer();
223- s = Hunt.getToken(s, " ,", work);
229+ s = Hunt.getToken(s, " ,", work); //NOI18N
224230 if (work.length() > 0) {
225231 if (s.length() > 0) {
226232 doSendMessage(s);
@@ -231,7 +237,7 @@
231237 /* broadcast command */
232238 void broadcastCommand(String s) {
233239 StringBuffer work = new StringBuffer();
234- s = Hunt.getToken(s, " ,", work);
240+ s = Hunt.getToken(s, " ,", work); //NOI18N
235241 if (work.length() > 0) {
236242 if (s.length() > 0) {
237243 doBroadcastMessage(s);
@@ -242,9 +248,9 @@
242248 /* tell command */
243249 void tellCommand(String s) {
244250 StringBuffer work = new StringBuffer();
245- s = Hunt.getToken(s, " ,", work);
251+ s = Hunt.getToken(s, " ,", work); //NOI18N
246252 if (work.length() > 0) {
247- s = Hunt.getToken(s, " ,", work);
253+ s = Hunt.getToken(s, " ,", work); //NOI18N
248254 if (work.length() > 0) {
249255 String username = work.toString();
250256 if (s.length() > 0) {
@@ -264,7 +270,8 @@
264270 buffer[0] = Hunt.HCLIT_LOGOFF;
265271 if (session.send_packet_c(buffer, 0) == false) {
266272 /* errot ? */
267- System.out.println("Can't send packet");
273+ System.out.println(Hunt.getBundle().
274+ getString("ERRMESG_SENDPACKET"));
268275 }
269276 }
270277
@@ -273,7 +280,8 @@
273280 buffer[0] = Hunt.HCLIT_MOVE;
274281 buffer[2] = (byte) n;
275282 if (session.send_packet_c(buffer, 1) == false) {
276- System.out.println("Can't send packet");
283+ System.out.println(Hunt.getBundle().
284+ getString("ERRMESG_SENDPACKET"));
277285 Hunt.abort();
278286 }
279287 }
@@ -283,7 +291,8 @@
283291 buffer[0] = Hunt.HCLIT_CHDIR;
284292 buffer[2] = (byte) n;
285293 if (session.send_packet_c(buffer, 1) == false) {
286- System.out.println("Can't send packet");
294+ System.out.println(Hunt.getBundle().
295+ getString("ERRMESG_SENDPACKET"));
287296 Hunt.abort();
288297 }
289298 }
@@ -293,7 +302,8 @@
293302 buffer[0] = Hunt.HCLIT_FIRE;
294303 buffer[2] = (byte) n;
295304 if (session.send_packet_c(buffer, 1) == false) {
296- System.out.println("Can't send packet");
305+ System.out.println(Hunt.getBundle().
306+ getString("ERRMESG_SENDPACKET"));
297307 Hunt.abort();
298308 }
299309 }
@@ -303,7 +313,8 @@
303313 buffer[0] = Hunt.HCLIT_ITEM;
304314 buffer[2] = (byte) n;
305315 if (session.send_packet_c(buffer, 1) == false) {
306- System.out.println("Can't send packet");
316+ System.out.println(Hunt.getBundle().
317+ getString("ERRMESG_SENDPACKET"));
307318 Hunt.abort();
308319 }
309320 }
@@ -312,7 +323,8 @@
312323 public void doPickUp() {
313324 buffer[0] = Hunt.HCLIT_PICK;
314325 if (session.send_packet_c(buffer, 0) == false) {
315- System.out.println("Can't send packet");
326+ System.out.println(Hunt.getBundle().
327+ getString("ERRMESG_SENDPACKET"));
316328 Hunt.abort();
317329 }
318330 }
@@ -335,7 +347,7 @@
335347 System.arraycopy(p, 0, buffer, 3, nlen);
336348 }
337349 if (session.send_packet_c(buffer, nlen + 1) == false) {
338- System.out.println("Can't send packet");
350+ System.out.println(Hunt.getBundle().getString("ERRMESG_SENDPACKET"));
339351 Hunt.abort();
340352 }
341353 }
@@ -358,7 +370,8 @@
358370 System.arraycopy(p, 0, buffer, 3, nlen);
359371 }
360372 if (session.send_packet_c(buffer, nlen + 1) == false) {
361- System.out.println("Can't send packet");
373+ System.out.println(Hunt.getBundle().
374+ getString("ERRMESG_SENDPACKET"));
362375 Hunt.abort();
363376 }
364377 }
@@ -396,7 +409,8 @@
396409 }
397410 buffer[0] = Hunt.HCLIT_MESG2U;
398411 if (session.send_packet_c(buffer, n - 2) == false) {
399- System.out.println("Can't send packet");
412+ System.out.println(Hunt.getBundle().
413+ getString("ERRMESG_SENDPACKET"));
400414 Hunt.abort();
401415 }
402416 }
@@ -405,7 +419,8 @@
405419 public void doWho() {
406420 buffer[0] = Hunt.HCLIT_WHO;
407421 if (session.send_packet_c(buffer, 0) == false) {
408- System.out.println("Can't send packet");
422+ System.out.println(Hunt.getBundle().
423+ getString("ERRMESG_SENDPACKET"));
409424 Hunt.abort();
410425 }
411426 }
@@ -414,7 +429,8 @@
414429 public void doPay() {
415430 buffer[0] = Hunt.HCLIT_PAY;
416431 if (session.send_packet_c(buffer, 0) == false) {
417- System.out.println("Can't send packet");
432+ System.out.println(Hunt.getBundle().
433+ getString("ERRMESG_SENDPACKET"));
418434 Hunt.abort();
419435 }
420436 }
@@ -422,9 +438,9 @@
422438 /* send buy command */
423439 public void doBuy(String s) {
424440 StringBuffer work = new StringBuffer();
425- s = Hunt.getToken(s, " ,", work);
441+ s = Hunt.getToken(s, " ,", work); //NOI18N
426442 if (work.length() > 0) {
427- s = Hunt.getToken(s, " ,", work);
443+ s = Hunt.getToken(s, " ,", work); //NOI18N
428444 if (work.length() > 0) {
429445 int buytype = 0;
430446 switch (work.charAt(0)) {
@@ -443,7 +459,8 @@
443459 buffer[2] = (byte) (buytype - 1);
444460 buffer[3] = (byte) Integer.parseInt(s);
445461 if (session.send_packet_c(buffer, 2) == false) {
446- System.out.println("Can't send packet");
462+ System.out.println(Hunt.getBundle().
463+ getString("ERRMESG_SENDPACKET"));
447464 Hunt.abort();
448465 }
449466 return;
@@ -450,7 +467,7 @@
450467 }
451468 }
452469 }
453- Hunt.display_message("[Buy command: syntax error]");
470+ Hunt.display_message(Hunt.getBundle().getString("ERRMESG_BUYCOMMAND"));
454471 }
455472
456473 /* request data list */
@@ -457,7 +474,8 @@
457474 public void doRequestList(int n) {
458475 buffer[0] = (n != 0) ? Hunt.HCLIT_REQITEM : Hunt.HCLIT_REQWEAPON;
459476 if (session.send_packet_c(buffer, 0) == false) {
460- System.out.println("Can't send packet");
477+ System.out.println(Hunt.getBundle().
478+ getString("ERRMESG_SENDPACKET"));
461479 Hunt.abort();
462480 }
463481 }
@@ -465,9 +483,9 @@
465483 /* store item */
466484 public void doStoreShop(String s) {
467485 StringBuffer work = new StringBuffer();
468- s = Hunt.getToken(s, " ,", work);
486+ s = Hunt.getToken(s, " ,", work); //NOI18N
469487 if (work.length() > 0) {
470- s = Hunt.getToken(s, " ,", work);
488+ s = Hunt.getToken(s, " ,", work); //NOI18N
471489 if (work.length() > 0) {
472490 int ntype = 0;
473491 switch (work.charAt(0)) {
@@ -486,16 +504,17 @@
486504 buffer[0] = Hunt.HCLIT_STOREANIMAL;
487505 Hunt.htonl(Long.parseLong(s), buffer, 2);
488506 if (session.send_packet_c(buffer, 4) == false) {
489- System.out.println("Can't send packet");
507+ System.out.println(Hunt.getBundle().
508+ getString("ERRMESG_SENDPACKET"));
490509 Hunt.abort();
491510 }
492511 } else if (ntype > 0) {
493512 int parts_no = -1;
494513 long parts_cost = -1;
495- s = Hunt.getToken(s, " ,", work);
514+ s = Hunt.getToken(s, " ,", work); //NOI18N
496515 if (work.length() > 0) {
497516 parts_no = Integer.parseInt(work.toString());
498- Hunt.getToken(s, "\n", work);
517+ Hunt.getToken(s, "\n", work); //NOI18N
499518 if (work.length() > 0) {
500519 parts_cost = Long.parseLong(work.toString());
501520 }
@@ -506,16 +525,19 @@
506525 buffer[3] = (byte) parts_no;
507526 Hunt.htonl(parts_cost, buffer, 4);
508527 if (session.send_packet_c(buffer, 6) == false) {
509- System.out.println("Can't send packet");
528+ System.out.println(Hunt.getBundle().
529+ getString("ERRMESG_SENDPACKET"));
510530 Hunt.abort();
511531 }
512532 }
513533 } else {
514- Hunt.display_message("[Store command: illegal type]");
534+ Hunt.display_message(Hunt.getBundle().
535+ getString("ERRMESG_STORECOMMAND"));
515536 }
516537 }
517538 } else {
518- Hunt.display_message("[Store command: syntax error]");
539+ Hunt.display_message(Hunt.getBundle().
540+ getString("ERRMESG_STORESYNTAX"));
519541 }
520542 }
521543
@@ -522,9 +544,9 @@
522544 /* change my shop name */
523545 public void doChangeShopName(String s) {
524546 StringBuffer work = new StringBuffer();
525- s = Hunt.getToken(s, " ,", work);
547+ s = Hunt.getToken(s, " ,", work); //NOI18N
526548 if (work.length() > 0) {
527- Hunt.getToken(s, "\n", work);
549+ Hunt.getToken(s, "\n", work); //NOI18N
528550 if (work.length() > 0) {
529551 String newname = work.toString();
530552 int n = 2;
@@ -545,12 +567,14 @@
545567 }
546568 buffer[0] = Hunt.HCLIT_CHANGEMYSHOP;
547569 if (session.send_packet_c(buffer, 16) == false) {
548- System.out.println("Can't send packet");
570+ System.out.println(Hunt.getBundle().
571+ getString("ERRMESG_SENDPACKET"));
549572 Hunt.abort();
550573 }
551574 }
552575 } else {
553- Hunt.display_message("[Change shop name command: syntax error]");
576+ Hunt.display_message(Hunt.getBundle().
577+ getString("ERRMESG_CHANGESHOPNAME"));
554578 }
555579 }
556580
@@ -557,9 +581,9 @@
557581 /* discard shop item */
558582 public void doDiscardShopItem(String s) {
559583 StringBuffer work = new StringBuffer();
560- s = Hunt.getToken(s, " ,", work);
584+ s = Hunt.getToken(s, " ,", work); //NOI18N
561585 if (work.length() > 0) {
562- s = Hunt.getToken(s, " ,", work);
586+ s = Hunt.getToken(s, " ,", work); //NOI18N
563587 if (work.length() > 0) {
564588 int ntype = 0;
565589 switch (work.charAt(0)) {
@@ -576,13 +600,15 @@
576600 buffer[2] = (byte) (ntype - 1);
577601 buffer[3] = (byte) Integer.parseInt(s);
578602 if (session.send_packet_c(buffer, 2) == false) {
579- System.out.println("Can't send packet");
603+ System.out.println(Hunt.getBundle().
604+ getString("ERRMESG_SENDPACKET"));
580605 Hunt.abort();
581606 }
582607 }
583608 }
584609 } else {
585- Hunt.display_message("[Discard command: syntax error]");
610+ Hunt.display_message(Hunt.getBundle().
611+ getString("ERRMESG_DISCARDCOMMAND"));
586612 }
587613 }
588614
@@ -590,7 +616,8 @@
590616 public void doDestroyShop() {
591617 buffer[0] = Hunt.HCLIT_DESTROYMYSHOP;
592618 if (session.send_packet_c(buffer, 0) == false) {
593- System.out.println("Can't send packet");
619+ System.out.println(Hunt.getBundle().
620+ getString("ERRMESG_SENDPACKET"));
594621 Hunt.abort();
595622 }
596623 }
@@ -599,7 +626,8 @@
599626 public void doRequestShopList() {
600627 buffer[0] = Hunt.HCLIT_LISTMYSHOP;
601628 if (session.send_packet_c(buffer, 0) == false) {
602- System.out.println("Can't send packet");
629+ System.out.println(Hunt.getBundle().
630+ getString("ERRMESG_SENDPACKET"));
603631 Hunt.abort();
604632 }
605633 }
@@ -608,7 +636,8 @@
608636 public void doRequestAnimalList() {
609637 buffer[0] = Hunt.HCLIT_REQANIMAL;
610638 if (session.send_packet_c(buffer, 0) == false) {
611- System.out.println("Can't send packet");
639+ System.out.println(Hunt.getBundle().
640+ getString("ERRMESG_SENDPACKET"));
612641 Hunt.abort();
613642 }
614643 }
@@ -617,7 +646,8 @@
617646 public void doRequestLiveAnimalList() {
618647 buffer[0] = Hunt.HCLIT_LISTLIVEANIMAL;
619648 if (session.send_packet_c(buffer, 0) == false) {
620- System.out.println("Can't send packet");
649+ System.out.println(Hunt.getBundle().
650+ getString("ERRMESG_SENDPACKET"));
621651 Hunt.abort();
622652 }
623653 }
@@ -625,11 +655,11 @@
625655 /* write message on shop hige */
626656 public void doWriteMessage(String s) {
627657 StringBuffer work = new StringBuffer();
628- s = Hunt.getToken(s, " ,", work);
658+ s = Hunt.getToken(s, " ,", work); //NOI18N
629659 if (work.length() > 0) {
630660 byte[] pmesg = null;
631661 int nlen;
632- Hunt.getToken(s, "\n", work);
662+ Hunt.getToken(s, "\n", work); //NOI18N
633663 if (work.length() > 0) {
634664 String mesg = work.toString();
635665 try {
@@ -650,11 +680,13 @@
650680 System.arraycopy(pmesg, 0, buffer, 3, nlen);
651681 }
652682 if (session.send_packet_c(buffer, nlen + 1) == false) {
653- System.out.println("Can't send packet");
683+ System.out.println(Hunt.getBundle().
684+ getString("ERRMESG_SENDPACKET"));
654685 Hunt.abort();
655686 }
656687 } else {
657- Hunt.display_message("[Write message command: syntax error]");
688+ Hunt.display_message(Hunt.getBundle().
689+ getString("ERRMESG_WRITECOMMAND"));
658690 }
659691 }
660692
@@ -661,9 +693,9 @@
661693 /* dtop obj */
662694 public void doDrop(String s) {
663695 StringBuffer work = new StringBuffer();
664- s = Hunt.getToken(s, " ,", work);
696+ s = Hunt.getToken(s, " ,", work); //NOI18N
665697 if (work.length() > 0) {
666- s = Hunt.getToken(s, " ,", work);
698+ s = Hunt.getToken(s, " ,", work); //NOI18N
667699 if (work.length() > 0) {
668700 int ntype = 0;
669701 switch (work.charAt(0)) {
@@ -677,12 +709,12 @@
677709 }
678710 if (ntype > 0) {
679711 int objno;
680- s = Hunt.getToken(s, " ,", work);
712+ s = Hunt.getToken(s, " ,", work); //NOI18N
681713 if (work.length() > 0) {
682714 byte[] pmesg = null;
683715 int nlen;
684716 objno = Integer.parseInt(work.toString());
685- Hunt.getToken(s, "\n", work);
717+ Hunt.getToken(s, "\n", work); //NOI18N
686718 if (work.length() > 0) {
687719 String mesg = work.toString();
688720 try {
@@ -705,19 +737,22 @@
705737 System.arraycopy(pmesg, 0, buffer, 5, nlen);
706738 }
707739 if (session.send_packet_c(buffer, nlen + 3) == false) {
708- System.out.println("Can't send packet");
740+ System.out.println(Hunt.getBundle().
741+ getString("ERRMESG_SENDPACKET"));
709742 Hunt.abort();
710743 }
711744 } else {
712- Hunt.display_message("[Drop command: "
713- + "no find slot number]");
745+ Hunt.display_message(Hunt.getBundle().
746+ getString("ERRMESG_DROPNOSLOT"));
714747 }
715748 } else {
716- Hunt.display_message("[Drop command: illegal type]");
749+ Hunt.display_message(Hunt.getBundle().
750+ getString("ERRMESG_DROPILLEGALTYPE"));
717751 }
718752 }
719753 } else {
720- Hunt.display_message("[Drop command: syntax error]");
754+ Hunt.display_message(Hunt.getBundle().
755+ getString("ERRMESG_DROPSYNTAX"));
721756 }
722757 }
723758
@@ -724,10 +759,10 @@
724759 /* read mail command */
725760 public void doReadMail(String s) {
726761 StringBuffer work = new StringBuffer();
727- s = Hunt.getToken(s, " ,", work);
762+ s = Hunt.getToken(s, " ,", work); //NOI18N
728763 if (work.length() > 0) {
729764 int num = 0;
730- Hunt.getToken(s, "\n", work);
765+ Hunt.getToken(s, "\n", work); //NOI18N
731766 if (work.length() > 0) {
732767 num = Integer.parseInt(work.toString());
733768 }
@@ -734,7 +769,8 @@
734769 buffer[0] = Hunt.HCLIT_READMAIL;
735770 buffer[2] = (byte) num;
736771 if (session.send_packet_c(buffer, 1) == false) {
737- System.out.println("Can't send packet");
772+ System.out.println(Hunt.getBundle().
773+ getString("ERRMESG_SENDPACKET"));
738774 Hunt.abort();
739775 } else {
740776 HuntReadWnd wnd = new HuntReadWnd(false);
@@ -747,7 +783,8 @@
747783 public void doListMail() {
748784 buffer[0] = Hunt.HCLIT_LISTMAIL;
749785 if (session.send_packet_c(buffer, 0) == false) {
750- System.out.println("Can't send packet");
786+ System.out.println(Hunt.getBundle().
787+ getString("ERRMESG_SENDPACKET"));
751788 Hunt.abort();
752789 }
753790 }
@@ -755,10 +792,10 @@
755792 /* read article */
756793 public void doReadArticle(String s) {
757794 StringBuffer work = new StringBuffer();
758- s = Hunt.getToken(s, " ,", work);
795+ s = Hunt.getToken(s, " ,", work); //NOI18N
759796 if (work.length() > 0) {
760797 int num = 0;
761- Hunt.getToken(s, "\n", work);
798+ Hunt.getToken(s, "\n", work); //NOI18N
762799 if (work.length() > 0) {
763800 num = Integer.parseInt(work.toString());
764801 }
@@ -765,7 +802,8 @@
765802 buffer[0] = Hunt.HCLIT_BBS_READ;
766803 buffer[2] = (byte) num;
767804 if (session.send_packet_c(buffer, 1) == false) {
768- System.out.println("Can't send packet");
805+ System.out.println(Hunt.getBundle().
806+ getString("ERRMESG_SENDPACKET"));
769807 Hunt.abort();
770808 } else {
771809 HuntReadWnd wnd = new HuntReadWnd(true);
@@ -778,7 +816,8 @@
778816 public void doListArticle() {
779817 buffer[0] = Hunt.HCLIT_BBS_LIST;
780818 if (session.send_packet_c(buffer, 0) == false) {
781- System.out.println("Can't send packet");
819+ System.out.println(Hunt.getBundle().
820+ getString("ERRMESG_SENDPACKET"));
782821 Hunt.abort();
783822 }
784823 }
@@ -786,10 +825,10 @@
786825 /* delete mail */
787826 public void doDeleteMail(String s) {
788827 StringBuffer work = new StringBuffer();
789- s = Hunt.getToken(s, " ,", work);
828+ s = Hunt.getToken(s, " ,", work); //NOI18N
790829 if (work.length() > 0) {
791830 int num = 0;
792- Hunt.getToken(s, "\n", work);
831+ Hunt.getToken(s, "\n", work); //NOI18N
793832 if (work.length() > 0) {
794833 num = Integer.parseInt(work.toString());
795834 }
@@ -796,7 +835,8 @@
796835 buffer[0] = Hunt.HCLIT_DELETEMAIL;
797836 buffer[2] = (byte) num;
798837 if (session.send_packet_c(buffer, 1) == false) {
799- System.out.println("Can't send packet");
838+ System.out.println(Hunt.getBundle().
839+ getString("ERRMESG_SENDPACKET"));
800840 Hunt.abort();
801841 }
802842 }
@@ -805,9 +845,9 @@
805845 /* transfer score */
806846 public void doTransferScore(String s) {
807847 StringBuffer work = new StringBuffer();
808- s = Hunt.getToken(s, " ,", work);
848+ s = Hunt.getToken(s, " ,", work); //NOI18N
809849 if (work.length() > 0) {
810- s = Hunt.getToken(s, " ,", work);
850+ s = Hunt.getToken(s, " ,", work); //NOI18N
811851 if (work.length() > 0) {
812852 String username = work.toString();
813853 byte[] pusername;
@@ -817,7 +857,7 @@
817857 return;
818858 }
819859 int nlen = Array.getLength(pusername);
820- Hunt.getToken(s, "\n", work);
860+ Hunt.getToken(s, "\n", work); //NOI18N
821861 if (work.length() > 0) {
822862 int n = 2;
823863 long score = Long.parseLong(work.toString());
@@ -833,7 +873,8 @@
833873 Hunt.htonl(score, buffer, n);
834874 n += 4;
835875 if (session.send_packet_c(buffer, n) == false) {
836- System.out.println("Can't send packet");
876+ System.out.println(Hunt.getBundle().
877+ getString("ERRMESG_SENDPACKET"));
837878 Hunt.abort();
838879 }
839880 }
@@ -844,9 +885,9 @@
844885 /* change animal name */
845886 public void doChangeAnimalName(String s) {
846887 StringBuffer work = new StringBuffer();
847- s = Hunt.getToken(s, " ,", work);
888+ s = Hunt.getToken(s, " ,", work); //NOI18N
848889 if (work.length() > 0) {
849- Hunt.getToken(s, "\n", work);
890+ Hunt.getToken(s, "\n", work); //NOI18N
850891 if (work.length() > 0) {
851892 int n = 2;
852893 String newname = work.toString();
@@ -867,13 +908,14 @@
867908 }
868909 buffer[0] = Hunt.HCLIT_CHANGEANIMAL;
869910 if (session.send_packet_c(buffer, n) == false) {
870- System.out.println("Can't send packet");
911+ System.out.println(Hunt.getBundle().
912+ getString("ERRMESG_SENDPACKET"));
871913 Hunt.abort();
872914 }
873915 }
874916 } else {
875- Hunt.display_message("[Change animal name command:"
876- + " syntax error]");
917+ Hunt.display_message(Hunt.getBundle().
918+ getString("ERRMESG_CHANGEANIMAL"));
877919 }
878920 }
879921
@@ -911,7 +953,8 @@
911953 buffer[n++] = 0;
912954 buffer[n++] = (byte) Hunt.HPROTOCOL_VERSION;
913955 if (session.send_packet_c(buffer, n - 2) == false) {
914- System.out.println("Can't send packet");
956+ System.out.println(Hunt.getBundle().
957+ getString("ERRMESG_SENDPACKET"));
915958 Hunt.abort();
916959 }
917960 }
@@ -966,7 +1009,8 @@
9661009 buffer[n++] = 0;
9671010 }
9681011 if (session.send_packet_c(buffer, n - 2) == false) {
969- System.out.println("Can't send packet");
1012+ System.out.println(Hunt.getBundle().
1013+ getString("ERRMESG_SENDPACKET"));
9701014 Hunt.abort();
9711015 }
9721016 }
@@ -1010,7 +1054,7 @@
10101054 try {
10111055 StringBuffer work = new StringBuffer();
10121056 while (mesg != null) {
1013- mesg = Hunt.getToken(mesg, "\n", work);
1057+ mesg = Hunt.getToken(mesg, "\n", work); //NOI18N
10141058 p = work.toString().getBytes(Hunt.SYSTEM_CHARSET);
10151059 nlen = Array.getLength(p);
10161060 if (nlen > 255) {
@@ -1058,7 +1102,7 @@
10581102 try {
10591103 StringBuffer work = new StringBuffer();
10601104 while (mesg != null) {
1061- mesg = Hunt.getToken(mesg, "\n", work);
1105+ mesg = Hunt.getToken(mesg, "\n", work); //NOI18N
10621106 p = work.toString().getBytes(Hunt.SYSTEM_CHARSET);
10631107 nlen = Array.getLength(p);
10641108 if (nlen > 255) {
--- trunk/src/hunton/HuntStatusView.java (revision 5)
+++ trunk/src/hunton/HuntStatusView.java (revision 6)
@@ -1,7 +1,6 @@
11 package hunton;
22
33 import java.awt.*;
4-import java.io.*;
54 import java.text.*;
65
76 public class HuntStatusView extends Frame {
@@ -9,7 +8,7 @@
98 HuntStatusPanel stat;
109
1110 HuntStatusView() {
12- super("status");
11+ super(Hunt.getBundle().getString("TITLE_STATUSWND"));
1312 stat = new HuntStatusPanel();
1413 add(stat, BorderLayout.CENTER);
1514 }
@@ -21,7 +20,11 @@
2120
2221 class HuntStatusPanel extends Canvas {
2322
24- static final String direction[] = {"N", "W", "E", "S"};
23+ static final String direction[] = {
24+ Hunt.getBundle().getString("DIRECTIONSTR_N"),
25+ Hunt.getBundle().getString("DIRECTIONSTR_W"),
26+ Hunt.getBundle().getString("DIRECTIONSTR_E"),
27+ Hunt.getBundle().getString("DIRECTIONSTR_S")};
2528 static String[] hungryMesg;
2629
2730 static {
@@ -30,25 +33,12 @@
3033
3134 HuntStatusPanel() {
3235 super();
33- int i;
34- try {
35- InputStream fis = getClass().getResourceAsStream("hungry.utf8");
36- InputStreamReader isr = new InputStreamReader(fis, "utf-8");
37- try (BufferedReader fin = new BufferedReader(isr)) {
38- for (i = 0; i < 5; i++) {
39- hungryMesg[i] = fin.readLine();
40- if (hungryMesg[i] == null) {
41- hungryMesg[i] = "?";
42- }
43- }
44- }
45- } catch (IOException e) {
46- hungryMesg[0] = "Near death";
47- hungryMesg[1] = "Very hungry";
48- hungryMesg[2] = "Hungry";
49- hungryMesg[3] = "Good";
50- hungryMesg[4] = "Full";
51- }
36+ hungryMesg[0] = Hunt.getBundle().getString("HUNGRYMESG_0");
37+ hungryMesg[1] = Hunt.getBundle().getString("HUNGRYMESG_1");
38+ hungryMesg[2] = Hunt.getBundle().getString("HUNGRYMESG_2");
39+ hungryMesg[3] = Hunt.getBundle().getString("HUNGRYMESG_3");
40+ hungryMesg[4] = Hunt.getBundle().getString("HUNGRYMESG_4");
41+ setFont(new Font(Font.MONOSPACED, Font.PLAIN, 16));
5242 }
5343
5444 @Override
@@ -69,52 +59,52 @@
6959 /* display status */
7060 int i;
7161 String work;
72- DecimalFormat form = new DecimalFormat("###0");
62+ DecimalFormat form = new DecimalFormat("###0"); //NOI18N
7363 FontMetrics fm = offg.getFontMetrics();
7464 int nheight = fm.getHeight();
7565 int y = nheight;
7666 offg.setColor(Color.white);
7767 if (Hunt.getType() != 0) {
78- work = "[G] HP:";
68+ work = Hunt.getBundle().getString("GUARD_HP");
7969 work += Long.toString(Hunt.getHP());
80- work += " ";
70+ work += " "; //NOI18N
8171 work += hungryMesg[Hunt.getHungry()];
8272 offg.drawString(work, 0, y);
8373 y += nheight;
84- work = "X:";
74+ work = "X:"; //NOI18N
8575 work += form.format(Hunt.getX());
86- work += " Y:";
76+ work += " Y:"; //NOI18N
8777 work += form.format(Hunt.getY());
8878 offg.drawString(work, 0, y);
8979 y += nheight;
90- work = "Score:";
80+ work = Hunt.getBundle().getString("SCOREMESG");
9181 work += Long.toString(Hunt.getScore());
9282 offg.drawString(work, 0, y);
9383 y += nheight;
94- work = "Direction:";
84+ work = Hunt.getBundle().getString("DIRECTIONMESG");
9585 work += direction[Hunt.getDir()];
9686 offg.drawString(work, 0, y);
9787 y += nheight;
9888 } else {
99- work = "[H] HP:";
89+ work = Hunt.getBundle().getString("HUNTER_HP");
10090 work += Long.toString(Hunt.getHP());
101- work += " ";
91+ work += " "; //NOI18N
10292 work += hungryMesg[Hunt.getHungry()];
10393 offg.drawString(work, 0, y);
10494 y += nheight;
105- work = "Crime:";
95+ work = Hunt.getBundle().getString("CRIMEMESG");
10696 work += Long.toString(Hunt.getCrime());
107- work += " X:";
97+ work += " X:"; //NOI18N
10898 work += form.format(Hunt.getX());
109- work += " Y:";
99+ work += " Y:"; //NOI18N
110100 work += form.format(Hunt.getY());
111101 offg.drawString(work, 0, y);
112102 y += nheight;
113- work = "Score:";
103+ work = Hunt.getBundle().getString("SCOREMESG");
114104 work += Long.toString(Hunt.getScore());
115105 offg.drawString(work, 0, y);
116106 y += nheight;
117- work = "Direction:";
107+ work = Hunt.getBundle().getString("DIRECTIONMESG");
118108 work += direction[Hunt.getDir()];
119109 offg.drawString(work, 0, y);
120110 y += nheight;
@@ -121,25 +111,25 @@
121111 }
122112 for (i = 0; i < Hunt.WEAPON_MAX; i++) {
123113 int n = i + 1;
124- work = "W";
114+ work = Hunt.getBundle().getString("WEAPONMESG");
125115 work += Integer.toString(n);
126- work += ":";
116+ work += ":"; //NOI18N
127117 work += Hunt.getWeapon(i);
128- work += "(";
118+ work += "("; //NOI18N
129119 work += Integer.toString(Hunt.getWeaponLeft(i));
130- work += ")";
120+ work += ")"; //NOI18N
131121 offg.drawString(work, 0, y);
132122 y += nheight;
133123 }
134124 for (i = 0; i < Hunt.ITEM_MAX; i++) {
135125 int n = i + 1;
136- work = "I";
126+ work = Hunt.getBundle().getString("ITEMMESG");
137127 work += Integer.toString(n);
138- work += ":";
128+ work += ":"; //NOI18N
139129 work += Hunt.getItem(i);
140- work += "(";
130+ work += "("; //NOI18N
141131 work += Integer.toString(Hunt.getItemLeft(i));
142- work += ")";
132+ work += ")"; //NOI18N
143133 offg.drawString(work, 0, y);
144134 y += nheight;
145135 }
--- trunk/src/hunton/Hunt.java (revision 5)
+++ trunk/src/hunton/Hunt.java (revision 6)
@@ -7,7 +7,7 @@
77
88 public class Hunt {
99
10- public static final String SYSTEM_CHARSET = "UTF-8";
10+ public static final String SYSTEM_CHARSET = "UTF-8"; //NOI18N
1111
1212 /* system const value */
1313 public static final int SENDMAP_CHUNK = 1000;
@@ -162,6 +162,10 @@
162162 static int nowHungry;
163163 static int yourType;
164164
165+ public static final java.util.ResourceBundle getBundle() {
166+ return java.util.ResourceBundle.getBundle("hunton.hunton");
167+ }
168+
165169 public static final int ntohs(byte[] p, int nidx) {
166170 return (((int) p[nidx] & 0xff) << 8) | ((int) p[nidx + 1] & 0xff);
167171 }
@@ -227,7 +231,7 @@
227231
228232 public static final String getWeapon(int n) {
229233 if (nowWeapon[n] == null) {
230- return "?";
234+ return "?"; //NOI18N
231235 } else {
232236 return nowWeapon[n];
233237 }
@@ -235,7 +239,7 @@
235239
236240 public static final String getItem(int n) {
237241 if (nowItem[n] == null) {
238- return "?";
242+ return "?"; //NOI18N
239243 } else {
240244 return nowItem[n];
241245 }
@@ -291,7 +295,7 @@
291295 }
292296 nowWeapon[n] = new String(p, nidx, i + 1, SYSTEM_CHARSET);
293297 } catch (UnsupportedEncodingException e) {
294- nowWeapon[n] = "?";
298+ nowWeapon[n] = "?"; //NOI18N
295299 }
296300 }
297301
@@ -305,7 +309,7 @@
305309 }
306310 nowItem[n] = new String(p, nidx, i + 1, SYSTEM_CHARSET);
307311 } catch (UnsupportedEncodingException e) {
308- nowItem[n] = "?";
312+ nowItem[n] = "?"; //NOI18N
309313 }
310314 }
311315
@@ -492,17 +496,17 @@
492496 /* write mail command */
493497 public static void doWriteMail(String s) {
494498 StringBuffer work = new StringBuffer();
495- s = getToken(s, " ,", work);
499+ s = getToken(s, " ,", work); //NOI18N
496500 if (work.length() > 0) {
497- s = getToken(s, ",", work);
501+ s = getToken(s, ",", work); //NOI18N
498502 if (work.length() > 0) {
499503 String username = work.toString();
500- getToken(s, "\n", work);
504+ getToken(s, "\n", work); //NOI18N
501505 if (work.length() > 0) {
502506 String title;
503- title = "MAIL TO:";
507+ title = Hunt.getBundle().getString("MAILTOMESG");
504508 title += username;
505- title += ">";
509+ title += ">"; //NOI18N
506510 title += work.toString();
507511 HuntWriteWnd wnd = new HuntWriteWnd(title, false);
508512 wnd.setVisible(true);
@@ -515,9 +519,9 @@
515519 /* post article command */
516520 public static void doPostArticle(String s) {
517521 StringBuffer work = new StringBuffer();
518- s = getToken(s, " ,", work);
522+ s = getToken(s, " ,", work); //NOI18N
519523 if (work.length() > 0) {
520- getToken(s, "\n", work);
524+ getToken(s, "\n", work); //NOI18N
521525 if (work.length() > 0) {
522526 HuntWriteWnd wnd = new HuntWriteWnd(work.toString(), true);
523527 wnd.setVisible(true);
@@ -529,7 +533,7 @@
529533 /* reply mail */
530534 public static void reply_mail(String username, String mesg) {
531535 String work;
532- String subject = "";
536+ String subject = ""; //NOI18N
533537 BreakIterator bi = BreakIterator.getLineInstance();
534538 bi.setText(mesg);
535539 int spos = bi.first();
@@ -539,13 +543,15 @@
539543 reserve_line > 0 && epos != BreakIterator.DONE;
540544 reserve_line--, spos = epos, epos = bi.next()) {
541545 work = mesg.substring(spos, epos);
542- if (work.indexOf("Subject: ") == 0) {
546+ if (work.indexOf(Hunt.getBundle().getString("SUBJECTMESG")) == 0) {
543547 subject = work.substring(9);
544548 }
545549 }
546- work = "MAIL TO:" + username + ">Re:";
547- if (subject.indexOf("Re:") == 0 || subject.indexOf("RE:") == 0
548- || subject.indexOf("re:") == 0) {
550+ work = Hunt.getBundle().getString("MAILTOMESG");
551+ work += username;
552+ work += ">Re:"; //NOI18N
553+ if (subject.indexOf("Re:") == 0 || subject.indexOf("RE:") == 0 //NOI18N
554+ || subject.indexOf("re:") == 0) { //NOI18N
549555 work += subject.substring(3);
550556 } else {
551557 work += subject;
@@ -555,9 +561,9 @@
555561 spos = epos, epos = bi.next()) {
556562 work = mesg.substring(spos, epos);
557563 if (work.charAt(0) == '>') {
558- wnd.addText(">" + work);
564+ wnd.addText(">" + work); //NOI18N
559565 } else {
560- wnd.addText("> " + work);
566+ wnd.addText("> " + work); //NOI18N
561567 }
562568 }
563569 wnd.setVisible(true);
@@ -567,7 +573,7 @@
567573 /* reply article */
568574 public static void reply_article(String mesg) {
569575 String work;
570- String subject = "";
576+ String subject = ""; //NOI18N
571577 BreakIterator bi = BreakIterator.getLineInstance();
572578 bi.setText(mesg);
573579 int spos = bi.first();
@@ -577,13 +583,13 @@
577583 reserve_line > 0 && epos != BreakIterator.DONE;
578584 reserve_line--, spos = epos, epos = bi.next()) {
579585 work = mesg.substring(spos, epos);
580- if (work.indexOf("Subject: ") == 0) {
586+ if (work.indexOf(Hunt.getBundle().getString("SUBJECTMESG")) == 0) {
581587 subject = work.substring(9);
582588 }
583589 }
584- work = "Re:";
585- if (subject.indexOf("Re:") == 0 || subject.indexOf("RE:") == 0
586- || subject.indexOf("re:") == 0) {
590+ work = "Re:"; //NOI18N
591+ if (subject.indexOf("Re:") == 0 || subject.indexOf("RE:") == 0 //NOI18N
592+ || subject.indexOf("re:") == 0) { //NOI18N
587593 work += subject.substring(3);
588594 } else {
589595 work += subject;
@@ -593,9 +599,9 @@
593599 spos = epos, epos = bi.next()) {
594600 work = mesg.substring(spos, epos);
595601 if (work.charAt(0) == '>') {
596- wnd.addText(">" + work);
602+ wnd.addText(">" + work); //NOI18N
597603 } else {
598- wnd.addText("> " + work);
604+ wnd.addText("> " + work); //NOI18N
599605 }
600606 }
601607 wnd.setVisible(true);
@@ -607,11 +613,11 @@
607613 public static void view_help(Object obj) {
608614 HuntMessageView hview = (HuntMessageView) messageView;
609615 String wkline;
610- hview.display("==== command list begin ====");
616+ hview.display(Hunt.getBundle().getString("COMMANDLIST_BEGIN"));
611617 try {
612618 InputStream fis
613- = obj.getClass().getResourceAsStream("hunt_help.utf8");
614- InputStreamReader isr = new InputStreamReader(fis, "utf-8");
619+ = obj.getClass().getResourceAsStream("hunt_help.utf8"); //NOI18N
620+ InputStreamReader isr = new InputStreamReader(fis, "utf-8"); //NOI18N
615621 try (BufferedReader fin = new BufferedReader(isr)) {
616622 while ((wkline = fin.readLine()) != null) {
617623 hview.display(wkline);
@@ -618,9 +624,9 @@
618624 }
619625 }
620626 } catch (IOException e) {
621- hview.display("view_help:" + e.getLocalizedMessage());
627+ hview.display("view_help:" + e.getLocalizedMessage()); //NOI18N
622628 }
623- hview.display("==== command list end ====");
629+ hview.display(Hunt.getBundle().getString("COMMANDLIST_END"));
624630 }
625631
626632 /* make session */
@@ -632,9 +638,11 @@
632638 }
633639
634640 /* make client */
641+
635642 static void make_client() {
636643 Rectangle r;
637- mainWnd = new Frame("Hunter-online client [" + UserName + "]");
644+ mainWnd = new Frame(MessageFormat.format(Hunt.getBundle().
645+ getString("CLIENT_TITLEBAR"), new Object[]{UserName}));
638646 mainWnd.setLayout(new FlowLayout());
639647 mainWnd.addWindowListener(new HuntWndEvent());
640648 mainView = new HuntMainView();
@@ -647,7 +655,7 @@
647655
648656 r = mainWnd.getBounds();
649657 statusView = new HuntStatusView();
650- statusView.setSize(220, 300);
658+ statusView.setSize(300, 300);
651659 if (statusViewBounds != null) {
652660 statusView.setBounds(statusViewBounds);
653661 } else {
@@ -708,9 +716,9 @@
708716 try {
709717 if (r != null) {
710718 ofile.write(Integer.toString((int) r.x) + " "
711- + Integer.toString((int) r.y) + " "
719+ + Integer.toString((int) r.y) + " " //NOI18N
712720 + Integer.toString((int) r.width) + " "
713- + Integer.toString((int) r.height));
721+ + Integer.toString((int) r.height)); //NOI18N
714722 }
715723 ofile.newLine();
716724 } catch (IOException e) {
@@ -721,7 +729,7 @@
721729 public static void save() {
722730 try {
723731 try (BufferedWriter ofile
724- = new BufferedWriter(new FileWriter("hunt_setup.def"))) {
732+ = new BufferedWriter(new FileWriter("hunt_setup.def"))) { //NOI18N
725733 ofile.write(HostName);
726734 ofile.newLine();
727735 ofile.write(Integer.toString(HostPort));
@@ -733,7 +741,7 @@
733741 save_rect(ofile, messageViewBounds);
734742 }
735743 } catch (IOException e) {
736- System.out.println("fail to save setup-file!");
744+ System.out.println("fail to save setup-file!"); //NOI18N
737745 }
738746 }
739747
@@ -747,22 +755,22 @@
747755 int width;
748756 int height;
749757 StringBuffer outstr = new StringBuffer();
750- work = getToken(work, " ", outstr);
758+ work = getToken(work, " ", outstr); //NOI18N
751759 if (outstr.length() == 0) {
752760 return null;
753761 }
754762 x = Integer.parseInt(outstr.toString());
755- work = getToken(work, " ", outstr);
763+ work = getToken(work, " ", outstr); //NOI18N
756764 if (outstr.length() == 0) {
757765 return null;
758766 }
759767 y = Integer.parseInt(outstr.toString());
760- work = getToken(work, " ", outstr);
768+ work = getToken(work, " ", outstr); //NOI18N
761769 if (outstr.length() == 0) {
762770 return null;
763771 }
764772 width = Integer.parseInt(outstr.toString());
765- getToken(work, " ", outstr);
773+ getToken(work, " ", outstr); //NOI18N
766774 if (outstr.length() == 0) {
767775 return null;
768776 }
@@ -776,15 +784,15 @@
776784
777785 /* load connection parameters */
778786 public static void load() {
779- HostName = "";
787+ HostName = ""; //NOI18N
780788 HostPort = DEFAULT_PORT;
781- UserName = "";
789+ UserName = ""; //NOI18N
782790 mainWndBounds = null;
783791 statusViewBounds = null;
784792 messageViewBounds = null;
785793 try {
786794 try (BufferedReader ifile
787- = new BufferedReader(new FileReader("hunt_setup.def"))) {
795+ = new BufferedReader(new FileReader("hunt_setup.def"))) { //NOI18N
788796 String work;
789797 work = ifile.readLine();
790798 if (work != null) {
@@ -830,7 +838,7 @@
830838
831839 /* emergency exit */
832840 public static void abort() {
833- System.out.println("Abnormal termination.");
841+ System.out.println("Abnormal termination."); //NOI18N
834842 if (rtask != null) {
835843 rtask.terminate_task();
836844 }
--- trunk/src/hunton/HuntMainView.java (revision 5)
+++ trunk/src/hunton/HuntMainView.java (revision 6)
@@ -759,6 +759,7 @@
759759
760760 @Override
761761 public void keyPressed(KeyEvent e) {
762+ HuntMessageView hview;
762763 switch (e.getKeyCode()) {
763764 case KeyEvent.VK_UP:
764765 case KeyEvent.VK_NUMPAD8:
@@ -820,7 +821,11 @@
820821 Hunt.getSendTask().doFire(2);
821822 break;
822823 case KeyEvent.VK_SLASH:
823- HuntMessageView hview = (HuntMessageView) Hunt.getMessageView();
824+ hview = (HuntMessageView) Hunt.getMessageView();
825+ hview.setFocus("/");
826+ break;
827+ case KeyEvent.VK_ENTER:
828+ hview = (HuntMessageView) Hunt.getMessageView();
824829 hview.setFocus();
825830 break;
826831 }
--- trunk/src/hunton/HuntMessageView.java (revision 5)
+++ trunk/src/hunton/HuntMessageView.java (revision 6)
@@ -10,13 +10,13 @@
1010
1111 @SuppressWarnings("LeakingThisInConstructor")
1212 HuntMessageView() {
13- super("message");
13+ super(Hunt.getBundle().getString("TITLE_MESSAGE"));
1414 messageList = new TextArea(10, 80);
1515 messageList.setEditable(false);
16- messageList.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
16+ messageList.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 16));
1717 add(messageList, BorderLayout.CENTER);
1818 editWnd = new TextField();
19- editWnd.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
19+ editWnd.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 16));
2020 add(editWnd, BorderLayout.SOUTH);
2121 editWnd.addActionListener(this);
2222 setResizable(true);
@@ -25,10 +25,17 @@
2525
2626 public void display(String s) {
2727 messageList.append(s);
28- messageList.append("\n");
28+ messageList.append("\n"); //NOI18N
2929 messageList.setCaretPosition(Integer.MAX_VALUE);
3030 }
3131
32+ public void setFocus(String s) {
33+ toFront();
34+ editWnd.setText(s);
35+ editWnd.setCaretPosition(s.length());
36+ editWnd.requestFocus();
37+ }
38+
3239 public void setFocus() {
3340 toFront();
3441 editWnd.requestFocus();
--- trunk/src/hunton/HuntLoginWnd.java (revision 5)
+++ trunk/src/hunton/HuntLoginWnd.java (revision 6)
@@ -18,7 +18,7 @@
1818
1919 @SuppressWarnings("LeakingThisInConstructor")
2020 HuntLoginWnd() {
21- super("Login");
21+ super(Hunt.getBundle().getString("LOGINTITLE"));
2222 Label label;
2323 Button button;
2424 Panel panel;
@@ -27,10 +27,12 @@
2727 addWindowListener(new HuntLoginWndEvent());
2828 setLayout(layout);
2929
30+ setFont(new Font(Font.MONOSPACED, Font.PLAIN, 16));
31+
3032 gridbag.anchor = GridBagConstraints.WEST;
3133 gridbag.fill = GridBagConstraints.NONE;
3234 gridbag.gridwidth = 1;
33- label = new Label("Host:");
35+ label = new Label(Hunt.getBundle().getString("LOGINHOST"));
3436 layout.setConstraints(label, gridbag);
3537 add(label);
3638
@@ -43,7 +45,7 @@
4345
4446 gridbag.fill = GridBagConstraints.NONE;
4547 gridbag.gridwidth = 1;
46- label = new Label("Port:");
48+ label = new Label(Hunt.getBundle().getString("LOGINPORT"));
4749 layout.setConstraints(label, gridbag);
4850 add(label);
4951
@@ -55,7 +57,7 @@
5557
5658 gridbag.fill = GridBagConstraints.NONE;
5759 gridbag.gridwidth = 1;
58- label = new Label("UserName:");
60+ label = new Label(Hunt.getBundle().getString("LOGINUSERNAME"));
5961 layout.setConstraints(label, gridbag);
6062 add(label);
6163
@@ -66,7 +68,7 @@
6668 add(username);
6769
6870 gridbag.gridwidth = 1;
69- label = new Label("PassWord:");
71+ label = new Label(Hunt.getBundle().getString("LOGINPASSWORD"));
7072 layout.setConstraints(label, gridbag);
7173 add(label);
7274
@@ -78,18 +80,19 @@
7880 password.addActionListener(this);
7981
8082 gridbag.gridwidth = 1;
81- label = new Label("");
83+ label = new Label(""); //NOI18N
8284 layout.setConstraints(label, gridbag);
8385 add(label);
8486
8587 gridbag.gridwidth = GridBagConstraints.REMAINDER;
86- newuser = new Checkbox("Make New User", false);
88+ newuser = new Checkbox(Hunt.getBundle().getString("LOGIN_MAKENEWUSER"),
89+ false);
8790 layout.setConstraints(newuser, gridbag);
8891 add(newuser);
8992 newuser.addItemListener(this);
9093
9194 gridbag.gridwidth = 1;
92- label = new Label("Create Key:");
95+ label = new Label(Hunt.getBundle().getString("LOGINCREATEKEY"));
9396 layout.setConstraints(label, gridbag);
9497 add(label);
9598
@@ -103,47 +106,60 @@
103106
104107 typeselect = new CheckboxGroup();
105108 gridbag.gridwidth = 1;
106- label = new Label("Class:");
109+ label = new Label(Hunt.getBundle().getString("LOGINCLASS"));
107110 layout.setConstraints(label, gridbag);
108111 add(label);
109112
110113 gridbag.gridwidth = GridBagConstraints.REMAINDER;
111- hunterbox = new Checkbox("Animal Hunter", typeselect, true);
114+ hunterbox = new Checkbox(Hunt.getBundle().
115+ getString("CLASS_ANIMALHUNTER"), typeselect, true);
112116 layout.setConstraints(hunterbox, gridbag);
113117 add(hunterbox);
114118 hunterbox.setEnabled(false);
115119
116120 gridbag.gridwidth = 1;
117- label = new Label("");
121+ label = new Label(""); //NOI18N
118122 layout.setConstraints(label, gridbag);
119123 add(label);
120124
121125 gridbag.gridwidth = GridBagConstraints.REMAINDER;
122- guardbox = new Checkbox("Guard of Honor", typeselect, false);
126+ guardbox = new Checkbox(Hunt.getBundle().getString("CLASS_GUARD"),
127+ typeselect, false);
123128 layout.setConstraints(guardbox, gridbag);
124129 add(guardbox);
125130 guardbox.setEnabled(false);
126131
132+ panel = new Panel();
133+ gridbag.fill = GridBagConstraints.BOTH;
134+ layout.setConstraints(panel, gridbag);
135+ add(panel);
136+ layout = new GridBagLayout();
137+ panel.setLayout(layout);
138+
127139 gridbag.anchor = GridBagConstraints.CENTER;
140+ gridbag.insets.set(8, 8, 0, 0);
141+ gridbag.fill = GridBagConstraints.BOTH;
128142 gridbag.gridwidth = 1;
129143 gridbag.weightx = 1.0;
130- button = new Button("Login");
144+ button = new Button(Hunt.getBundle().getString("BUTTONLOGIN"));
131145 layout.setConstraints(button, gridbag);
132- add(button);
133- button.setActionCommand("LOGIN");
146+ panel.add(button);
147+ button.setActionCommand("LOGIN"); //NOI18N
134148 button.addActionListener(this);
135149
136- gridbag.gridwidth = GridBagConstraints.REMAINDER;
137- gridbag.weightx = 0;
138- button = new Button("Close");
150+ button = new Button(Hunt.getBundle().getString("BUTTONCLOSE"));
139151 layout.setConstraints(button, gridbag);
140- add(button);
141- button.setActionCommand("CLOSE");
152+ panel.add(button);
153+ button.setActionCommand("CLOSE"); //NOI18N
142154 button.addActionListener(this);
143155
144- panel = new Panel();
145- layout.setConstraints(panel, gridbag);
146- add(panel);
156+ gridbag.gridwidth = GridBagConstraints.REMAINDER;
157+ gridbag.insets.set(0, 0, 0, 0);
158+ gridbag.fill = GridBagConstraints.NONE;
159+ gridbag.weightx = 0;
160+ label = new Label("");
161+ layout.setConstraints(label, gridbag);
162+ panel.add(label);
147163
148164 pack();
149165
@@ -170,7 +186,7 @@
170186 @Override
171187 public void actionPerformed(ActionEvent e) {
172188 String cmd = e.getActionCommand();
173- if (cmd.compareTo("LOGIN") == 0) {
189+ if (cmd.compareTo("LOGIN") == 0) { //NOI18N
174190 setVisible(false);
175191 Hunt.setHostName(hostaddr.getText());
176192 Hunt.setHostPort(Integer.parseInt(hostport.getText()));
@@ -183,8 +199,9 @@
183199 Hunt.login_server();
184200 }
185201 dispose();
186- } else if (cmd.compareTo("CLOSE") == 0) {
202+ } else if (cmd.compareTo("CLOSE") == 0) { //NOI18N
187203 dispose();
204+ System.exit(0);
188205 } else {
189206 Component cp = (Component) e.getSource();
190207 cp.transferFocus();
@@ -198,6 +215,7 @@
198215 @Override
199216 public void windowClosing(WindowEvent e) {
200217 e.getWindow().dispose();
218+ System.exit(0);
201219 }
202220 }
203221
--- trunk/src/hunton/RecvTask.java (revision 5)
+++ trunk/src/hunton/RecvTask.java (revision 6)
@@ -27,10 +27,10 @@
2727 void doServerResult() {
2828 if (buffer[2] == 0) {
2929 /* OK */
30- System.out.println("success to login.");
30+ System.out.println(Hunt.getBundle().getString("MESG_SUCCESSLOGIN"));
3131 } else {
3232 /* NG */
33- System.out.println("Fail to login server!");
33+ System.out.println(Hunt.getBundle().getString("MESG_FAILLOGIN"));
3434 Hunt.abort();
3535 }
3636 }
@@ -71,17 +71,17 @@
7171 username = new String(buffer, n, Hunt.USERNAME_LEN,
7272 Hunt.SYSTEM_CHARSET);
7373 } catch (UnsupportedEncodingException e) {
74- username = "?";
74+ username = "?"; //NOI18N
7575 }
7676 n += Hunt.USERNAME_LEN;
7777 work = username;
78- work += " tell you,";
78+ work += " tell you,"; //NOI18N
7979 nlen = (int) buffer[n++];
8080 if (nlen > 0) {
8181 try {
8282 message = new String(buffer, n, nlen, Hunt.SYSTEM_CHARSET);
8383 } catch (UnsupportedEncodingException e) {
84- message = "?";
84+ message = "?"; //NOI18N
8585 }
8686 work += message;
8787 }
@@ -98,7 +98,7 @@
9898 try {
9999 message = new String(buffer, n, nlen, Hunt.SYSTEM_CHARSET);
100100 } catch (UnsupportedEncodingException e) {
101- message = "?";
101+ message = "?"; //NOI18N
102102 }
103103 Hunt.display_message(message);
104104 }
@@ -114,26 +114,26 @@
114114 username = new String(buffer, n, Hunt.USERNAME_LEN,
115115 Hunt.SYSTEM_CHARSET);
116116 } catch (UnsupportedEncodingException e) {
117- username = "?";
117+ username = "?"; //NOI18N
118118 }
119119 n += Hunt.USERNAME_LEN;
120120 wk_score = Hunt.ntohl(buffer, n);
121121 n += 4;
122- work = "<";
122+ work = "<"; //NOI18N
123123 if (buffer[n + 1] != 0) {
124- work += "GUARD :";
124+ work += Hunt.getBundle().getString("WHOLIST_GUARD");
125125 } else {
126- work += "HUNTER:";
126+ work += Hunt.getBundle().getString("WHOLIST_HUNTER");
127127 }
128128 work += username;
129- work += " ";
130- DecimalFormat form = new DecimalFormat("#########0");
129+ work += " "; //NOI18N
130+ DecimalFormat form = new DecimalFormat("#########0"); //NOI18N
131131 work += form.format(wk_score);
132- work += "Point ";
132+ work += Hunt.getBundle().getString("LABEL_POINT");
133133 if (buffer[n] != 0) {
134- work += "ON-Line >";
134+ work += Hunt.getBundle().getString("WHOLIST_ONLINE");
135135 } else {
136- work += "Off-Line>";
136+ work += Hunt.getBundle().getString("WHOLIST_OFFLINE");
137137 }
138138 Hunt.display_message(work);
139139 }
@@ -189,39 +189,40 @@
189189 subject = new String(buffer, 2 + Hunt.USERNAME_LEN + 5, n,
190190 Hunt.SYSTEM_CHARSET);
191191 } catch (UnsupportedEncodingException e) {
192- subject = "?";
192+ subject = "?"; //NOI18N
193193 }
194194 } else {
195- subject = "";
195+ subject = ""; //NOI18N
196196 }
197197 try {
198198 username = new String(buffer, 2, Hunt.USERNAME_LEN,
199199 Hunt.SYSTEM_CHARSET);
200200 } catch (UnsupportedEncodingException e) {
201- username = "?";
201+ username = "?"; //NOI18N
202202 }
203203 if (bbsmode != 0) {
204204 /* bbs article */
205- work = "Article [";
205+ work = Hunt.getBundle().getString("HEADER_ARTICLE");
206206 work += username;
207- work += "]";
207+ work += "]"; //NOI18N
208208 work += subject;
209209 } else {
210210 /* mail message */
211- work = "From ";
211+ work = Hunt.getBundle().getString("MAIL_HEADER");
212212 work += username;
213213 }
214214 hreadwnd.setTitle(work);
215- work = "From ";
215+ work = Hunt.getBundle().getString("TITLE_FROM");
216216 work += username;
217- work += "\nDate:";
217+ work += Hunt.getBundle().getString("TITLE_DATE");
218218 DateFormat df
219- = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL);
219+ = DateFormat.getDateTimeInstance(DateFormat.FULL,
220+ DateFormat.FULL);
220221 Date ntime = new Date(Hunt.ntohl(buffer, 2 + Hunt.USERNAME_LEN) * 1000);
221222 work += df.format(ntime);
222- work += "\nSubject: ";
223+ work += Hunt.getBundle().getString("TITLE_SUBJECT");
223224 work += subject;
224- work += "\n\n";
225+ work += "\n\n"; //NOI18N
225226 hreadwnd.addText(work);
226227 }
227228
@@ -234,12 +235,12 @@
234235 try {
235236 work = new String(buffer, 3, nlen, Hunt.SYSTEM_CHARSET);
236237 } catch (UnsupportedEncodingException e) {
237- work = "?";
238+ work = "?"; //NOI18N
238239 }
239240 } else {
240- work = "";
241+ work = ""; //NOI18N
241242 }
242- work += "\n";
243+ work += "\n"; //NOI18N
243244 hreadwnd.addText(work);
244245 }
245246 }
@@ -310,9 +311,10 @@
310311 doMailBodyEnd();
311312 break;
312313 default:
313- System.out.println("What's? ["
314+ System.out.println(Hunt.getBundle().
315+ getString("ERRMESG_WHATPACKET")
314316 + Integer.toHexString((int) buffer[0] & 0xff)
315- + "]");
317+ + "]"); //NOI18N
316318 }
317319 }
318320
@@ -330,7 +332,8 @@
330332 process_response();
331333 }
332334 } else {
333- System.out.println("Connection closed.");
335+ System.out.println(Hunt.getBundle().
336+ getString("MESG_CONNECTIONCLOSE"));
334337 Hunt.shutdown();
335338 break;
336339 }
--- trunk/src/hunton/HuntReadWnd.java (revision 5)
+++ trunk/src/hunton/HuntReadWnd.java (revision 6)
@@ -11,9 +11,12 @@
1111 HuntReadWnd(boolean barticle) {
1212 super();
1313 MenuBar mb = new MenuBar();
14- HuntMenu hm = new HuntMenu((barticle == true) ? "BBS" : "Mail");
14+ HuntMenu hm = new HuntMenu((barticle == true)
15+ ? Hunt.getBundle().getString("TITLE_BBS")
16+ : Hunt.getBundle().getString("TITLE_MAIL"));
1517 hm.addActionListener(this);
16- hm.addMenu("Reply", (barticle == true) ? "ReplyArticle" : "ReplyMail");
18+ hm.addMenu(Hunt.getBundle().getString("MENU_REPLY"),
19+ (barticle == true) ? "ReplyArticle" : "ReplyMail");
1720 mb.add(hm);
1821 setMenuBar(mb);
1922 tarea = new TextArea(25, 80);
@@ -37,12 +40,12 @@
3740 @Override
3841 public void actionPerformed(ActionEvent e) {
3942 String cmd = e.getActionCommand();
40- if (cmd.compareTo("ReplyMail") == 0) {
43+ if (cmd.compareTo("ReplyMail") == 0) { //NOI18N
4144 /* reply mail */
4245 String title = getTitle();
4346 String mesg = tarea.getText();
4447 Hunt.reply_mail(title.substring(5), mesg);
45- } else if (cmd.compareTo("ReplyArticle") == 0) {
48+ } else if (cmd.compareTo("ReplyArticle") == 0) { //NOI18N
4649 /* reply article */
4750 String mesg = tarea.getText();
4851 Hunt.reply_article(mesg);