Settings.java
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128: package xeij;
129:
130: import java.awt.*;
131: import java.awt.event.*;
132: import java.io.*;
133: import java.lang.*;
134: import java.net.*;
135: import java.util.*;
136: import java.util.regex.*;
137:
138: import javax.swing.*;
139: import javax.swing.event.*;
140:
141: public class Settings {
142:
143:
144:
145: public static final String SGS_ACM_FRAME_KEY = "acm";
146: public static final String SGS_ATW_FRAME_KEY = "atw";
147: public static final String SGS_BFN_FRAME_KEY = "bfn";
148: public static final String SGS_BLG_FRAME_KEY = "blg";
149: public static final String SGS_DBP_FRAME_KEY = "dbp";
150: public static final String SGS_DDP_FRAME_KEY = "ddp";
151: public static final String SGS_DGT_FRAME_KEY = "dgt";
152: public static final String SGS_DMP_FRAME_KEY = "dmp";
153: public static final String SGS_DRP_FRAME_KEY = "drp";
154: public static final String SGS_FNT_FRAME_KEY = "fnt";
155: public static final String SGS_FRM_FRAME_KEY = "frm";
156: public static final String SGS_GRS_FRAME_KEY = "grs";
157: public static final String SGS_GSA_FRAME_KEY = "gsa";
158: public static final String SGS_KBS_FRAME_KEY = "kbs";
159: public static final String SGS_OLG_FRAME_KEY = "olg";
160: public static final String SGS_PAA_FRAME_KEY = "paa";
161: public static final String SGS_PFF_FRAME_KEY = "pff";
162: public static final String SGS_PFV_FRAME_KEY = "pfv";
163: public static final String SGS_PPI_FRAME_KEY = "ppi";
164: public static final String SGS_PRN_FRAME_KEY = "prn";
165: public static final String SGS_RBP_FRAME_KEY = "rbp";
166: public static final String SGS_RTL_FRAME_KEY = "rtl";
167: public static final String SGS_SMN_FRAME_KEY = "smn";
168: public static final String SGS_SMT_FRAME_KEY = "smt";
169: public static final String SGS_SPV_FRAME_KEY = "spv";
170: public static final String SGS_PLV_FRAME_KEY = "plv";
171: public static final String SGS_TRM_FRAME_KEY = "trm";
172: public static final String[] SGS_FRAME_KEYS = {
173: SGS_ACM_FRAME_KEY,
174: SGS_ATW_FRAME_KEY,
175: SGS_BFN_FRAME_KEY,
176: SGS_BLG_FRAME_KEY,
177: SGS_DBP_FRAME_KEY,
178: SGS_DDP_FRAME_KEY,
179: SGS_DGT_FRAME_KEY,
180: SGS_DMP_FRAME_KEY,
181: SGS_DRP_FRAME_KEY,
182: SGS_FNT_FRAME_KEY,
183: SGS_FRM_FRAME_KEY,
184: SGS_GRS_FRAME_KEY,
185: SGS_GSA_FRAME_KEY,
186: SGS_KBS_FRAME_KEY,
187: SGS_OLG_FRAME_KEY,
188: SGS_PAA_FRAME_KEY,
189: SGS_PFF_FRAME_KEY,
190: SGS_PFV_FRAME_KEY,
191: SGS_PPI_FRAME_KEY,
192: SGS_PRN_FRAME_KEY,
193: SGS_RBP_FRAME_KEY,
194: SGS_RTL_FRAME_KEY,
195: SGS_SMN_FRAME_KEY,
196: SGS_SMT_FRAME_KEY,
197: SGS_SPV_FRAME_KEY,
198: SGS_PLV_FRAME_KEY,
199: SGS_TRM_FRAME_KEY,
200: };
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212: public static final String SGS_DEFAULT_PARAMETERS = (
213:
214: "verbose;on;" +
215:
216:
217: "saveonexit;on;" +
218: "xxxopen;on;" +
219: "config;;" +
220: "lang;en;" +
221: "home;;" +
222: "dir;;" +
223:
224: "hsb;240,240,240,70,50,30,0,50,100;" +
225: "hhssbb;none;" +
226: "fontsize;14;" +
227:
228: "keyboard;standard;" +
229: "hidekeyboard;on;" +
230: "keymapus;off;" +
231: "keymap;;" +
232: "zkeyboard;off;" +
233: "zkeymap;;" +
234:
235: "f11key;fullscreen;" +
236: "shiftf11key;maximized;" +
237: "ctrlf11key;donothing;" +
238: "altf11key;donothing;" +
239: "f12key;seamless;" +
240: "shiftf12key;donothing;" +
241: "ctrlf12key;donothing;" +
242: "altf12key;donothing;" +
243: "wheel;seamless;" +
244: "shiftwheel;donothing;" +
245: "ctrlwheel;donothing;" +
246: "altwheel;donothing;" +
247: "wheelup;trace1;" +
248: "shiftwheelup;trace10;" +
249: "ctrlwheelup;trace100;" +
250: "altwheelup;donothing;" +
251: "wheeldown;step1;" +
252: "shiftwheeldown;step10;" +
253: "ctrlwheeldown;step100;" +
254: "altwheeldown;return;" +
255: "button4;donothing;" +
256: "shiftbutton4;donothing;" +
257: "ctrlbutton4;donothing;" +
258: "altbutton4;donothing;" +
259: "button5;donothing;" +
260: "shiftbutton5;donothing;" +
261: "ctrlbutton5;donothing;" +
262: "altbutton5;donothing;" +
263: "mousewheel;;" +
264:
265: "gifwaitingtime;;" +
266: "gifrecordingtime;10;" +
267: "gifmagnification;100;" +
268: "gifinterpolation;bilinear;" +
269:
270: "flrenabled;off;" +
271: "flrpalette;on;" +
272: "flrcontrast;on;" +
273: "flrscreen;on;" +
274: "flrwavelength;20;" +
275: "flrlimit;13;" +
276: "flrdelay;20;" +
277: "flrinformed;off;" +
278:
279: "scaling;fitinwindow;" +
280: "fixedscale;100;" +
281: "aspectratio256x256;4:3;" +
282: "aspectratio384x256;4:3;" +
283: "aspectratio512x512;4:3;" +
284: "aspectratio640x480;4:3;" +
285: "aspectratio768x512;3:2;" +
286: "aspectratio1024x848;64:53;" +
287: "interpolation;bilinear;" +
288: "refreshrate;none;" +
289: "adjustvsync;off;" +
290: "roundedcornerratio;0;" +
291:
292: "usecanvas;on;" +
293: "rotation;0;" +
294:
295: "seamless;on;" +
296: "followscroll;on;" +
297: "ctrlright;off;" +
298: "edgeaccel;off;" +
299: "mousespeed;;" +
300: "hostspixelunits;off;" +
301:
302: "textcopyarea;display;" +
303: "textcopy;off;" +
304:
305: "model;Hybrid;" +
306: "mpu010;off;" +
307: "mpu;none;" +
308: "clock;none;" +
309: "mhz;200;" +
310: "util;off;" +
311: "ratio;100;" +
312: "waitcycles;on;" +
313:
314: "copro0;2;" +
315: "copro1;2;" +
316: "copro2;2;" +
317: "onchipfpu;7;" +
318:
319: "fefunc;on;" +
320: "rejectfloat;off;" +
321:
322: "himem68000;off;" +
323: "highmemory;;" +
324: "highmemorysave;off;" +
325: "highmemorydata;;" +
326: "highmemory060turbo;off;" +
327: "localmemory;128;" +
328: "localmemorysave;off;" +
329: "localmemorydata;;" +
330: "cutfc2pin;off;" +
331:
332: "memory;12;" +
333: "memorysave;on;" +
334: "memorydata;;" +
335:
336: "pastepipe;off;" +
337: "pipeencoding;sjis;" +
338:
339: "intermittent;0;" +
340: "stereoscopic;off;" +
341: "stereoscopicmethod;nakedeyecrossing;" +
342: "extendedgraphic;off;" +
343: "scanline;medium;" +
344: "dotclock;,,;" +
345: "eleventhbit;off;" +
346: "sphericalscrolling;off;" +
347: "r00bit0zero;off;" +
348:
349: "sprras;32;" +
350: "dblspr;off;" +
351: "numspr;128;" +
352: "sprbank;off;" +
353: "spr768x512;off;" +
354: "spr512bg1;off;" +
355: "sprrcscroll;off;" +
356: "sprfpm;off;" +
357:
358: "sound;on;" +
359: "volume;20;" +
360: "soundinterpolation;linear;" +
361:
362: "opmoutput;on;" +
363:
364: "pcmoutput;on;" +
365: "pcminterpolation;linear;" +
366: "pcmoscfreq;0;" +
367:
368:
369: "fdreadonly;off;" +
370: "fdappreboot;off;" +
371:
372:
373: "sareadonly;off;" +
374: "saappreboot;off;" +
375:
376:
377: "screadonly;off;" +
378: "scappreboot;off;" +
379:
380: "hcddebug;off;" +
381: "hcdconnect;off;" +
382: "hcdscsiid;6;" +
383: "hcdvolume;25;" +
384:
385:
386: "hfreadonly;off;" +
387: "hfappreboot;off;" +
388: "utf8warning;off;" +
389:
390: "joykey;on;" +
391: "joyauto;on;" +
392: "joyblock;on;" +
393: "normal2button1;;" +
394: "normal2button2;;" +
395: "megadrive3button1;;" +
396: "megadrive3button2;;" +
397: "megadrive6button1;;" +
398: "megadrive6button2;;" +
399: "cyberstickdigital1;;" +
400: "cyberstickdigital2;;" +
401: "cyberstickanalog1;;" +
402: "cyberstickanalog2;;" +
403: "shiromadokun1;;" +
404: "shiromadokun2;;" +
405: "joystick1;normal2button1;" +
406: "joystick2;normal2button2;" +
407: "xinput;off;" +
408:
409: "scsiex;off;" +
410:
411: "boot;default;" +
412: "keydly;-1;" +
413: "keyrep;-1;" +
414: "sram;none;" +
415: "sramdata;;" +
416: "sramsize;16;" +
417: "romdb;none;" +
418: "modifymemorysize;on;" +
419: "srambuserror;off;" +
420:
421: "bankdata;;" +
422:
423: "rom;none;" +
424: "cgrom;none;" +
425: "rom30;none;" +
426: "scsiinrom;none;" +
427: "scsiexrom;none;" +
428: "iplrom;none;" +
429: "x68000logo;none;" +
430: "iplrom16style;7;" +
431: "iplrom256k;off;" +
432: "iplrom16;off;" +
433: "omusubi;off;" +
434:
435: "prnauto;off;" +
436: "prnpath;printer;" +
437: "prndipsw;;" +
438: "prnsize;A4;" +
439: "prnorientation;portrait;" +
440: "prntopmargin;11;" +
441: "prnleftmargin;14;" +
442: "prnrightmargin;14;" +
443: "prnbottommargin;11;" +
444: "prnrotation;;" +
445: "prndarkmode;off;" +
446: "prnonline;on;" +
447: "prnsinglecolor;;" +
448: "prnscalefactor;;" +
449:
450: "sccfreq;5000000;" +
451:
452: "spvbank;0;" +
453: "spvblock;-1;" +
454: "spvflip;-1;" +
455: "spvhex;off;" +
456: "spvscale;0;" +
457: "spvsize;-1;" +
458:
459: "plvarrgt;2;" +
460: "plvhex;off;" +
461: "plvscale;0;" +
462:
463: "rs232cconnection;Terminal+%E2%87%94+AUX;" +
464: "terminalsettings;38400/B8/PN/S1/RTS;" +
465: "additionalport;none;" +
466: "tcpiphost;0.0.0.0;" +
467: "tcpipport;54321;" +
468: "tcpiputf8;off;" +
469:
470: "pppaddress;192.168.10.1:192.168.10.2;" +
471: "pppdebug;off;" +
472: "pppdirect;off;" +
473: "ppplog;off;" +
474: "pppserver;off;" +
475:
476: "mercury;off;" +
477: "mercuryoe;on;" +
478:
479: "xt3dipsw;3;" +
480: "xt3memorykb;256;" +
481: "xt3memorydata;;" +
482: "xt3memorysave;off;"
483: );
484:
485: public static final String SGS_APPDATA_FOLDER = "XEiJ";
486: public static final String SGS_INI = "XEiJ.ini";
487:
488: public static final Pattern SGS_BOOT_DEVICE_PATTERN = Pattern.compile ("^(?:default|std|(?:fd|hd|sc|hf)\\d+|r[oa]m\\$[0-9A-Fa-f]+)$", Pattern.CASE_INSENSITIVE);
489:
490: public static String sgsAppDataRoamingFolder;
491: public static String sgsAppDataLocalFolder;
492: public static String sgsHomeDirectory;
493: public static String sgsCurrentDirectory;
494:
495: public static File sgsIniParentDirectory;
496: public static String sgsIniParentPath;
497: public static File sgsIniFile;
498: public static String sgsIniPath;
499:
500: public static boolean sgsSaveOnExit;
501: public static boolean sgsXxxOpen;
502: public static JCheckBoxMenuItem sgsSaveOnExitCheckBox;
503: public static String sgsSaveiconValue;
504: public static String sgsIrbbenchValue;
505:
506: public static HashMap<String,String> sgsDefaultMap;
507: public static HashMap<String,String> sgsStartMap;
508: public static HashMap<String,String> sgsCurrentMap;
509: public static HashMap<String,HashMap<String,String>> sgsRootMap;
510:
511: public static JMenu sgsMenu;
512:
513:
514:
515:
516:
517:
518: public static final Comparator<String> DictionaryComparator = new Comparator<String> () {
519: @Override public int compare (String s1, String s2) {
520: int l1 = s1.length ();
521: int l2 = s2.length ();
522: int b1, b2;
523: int e1, e2;
524: int f = 0;
525: compare:
526: {
527: for (b1 = 0, b2 = 0; b1 < l1 && b2 < l2; b1 = e1, b2 = e2) {
528: int c1, c2;
529:
530: e1 = b1;
531: c1 = s1.charAt (e1);
532: c1 = ('0' - 1) - c1 & c1 - ('9' + 1);
533: for (e1++; e1 < l1; e1++) {
534: c2 = s1.charAt (e1);
535: c2 = ('0' - 1) - c2 & c2 - ('9' + 1);
536: if ((c1 ^ c2) < 0) {
537: break;
538: }
539: c1 = c2;
540: }
541: e2 = b2;
542: c1 = s2.charAt (e2);
543: c1 = ('0' - 1) - c1 & c1 - ('9' + 1);
544: for (e2++; e2 < l2; e2++) {
545: c2 = s2.charAt (e2);
546: c2 = ('0' - 1) - c2 & c2 - ('9' + 1);
547: if ((c1 ^ c2) < 0) {
548: break;
549: }
550: c1 = c2;
551: }
552: c1 = s1.charAt (b1);
553: c2 = s2.charAt (b2);
554: if ((('0' - 1) - c1 & c1 - ('9' + 1) & ('0' - 1) - c2 & c2 - ('9' + 1)) < 0) {
555:
556: for (; b1 < e1 && s1.charAt (b1) == '0'; b1++) {
557: }
558: for (; b2 < e2 && s2.charAt (b2) == '0'; b2++) {
559: }
560:
561: f = (e1 - b1) - (e2 - b2);
562: if (f != 0) {
563: break compare;
564: }
565:
566: for (; b1 < e1 && b2 < e2; b1++, b2++) {
567: f = s1.charAt (b1) - s2.charAt (b2);
568: if (f != 0) {
569: break compare;
570: }
571: }
572: } else {
573:
574:
575: for (; b1 < e1 && b2 < e2; b1++, b2++) {
576: c1 = s1.charAt (b1);
577: c2 = s2.charAt (b2);
578: f = ((c1 + ((('A' - 1) - c1 & c1 - ('Z' + 1)) >> 31 & 'a' - 'A')) -
579: (c2 + ((('A' - 1) - c2 & c2 - ('Z' + 1)) >> 31 & 'a' - 'A')));
580: if (f != 0) {
581: break compare;
582: }
583: }
584: if (b1 < e1 || b2 < e2) {
585:
586:
587:
588:
589: f = (e1 - b1) - (e2 - b2);
590: break compare;
591: }
592: }
593: }
594: f = (l1 - b1) - (l2 - b2);
595:
596: if (f == 0) {
597: for (b1 = 0, b2 = 0; b1 < l1 && b2 < l2; b1++, b2++) {
598: f = s1.charAt (b1) - s2.charAt (b2);
599: if (f != 0) {
600: break compare;
601: }
602: }
603: }
604: }
605: return (f >> 31) - (-f >> 31);
606: }
607: };
608:
609:
610:
611: public static void sgsInit () {
612:
613: sgsAppDataRoamingFolder = null;
614: sgsAppDataLocalFolder = null;
615: sgsHomeDirectory = null;
616: sgsCurrentDirectory = null;
617:
618: sgsIniParentDirectory = null;
619: sgsIniParentPath = null;
620: sgsIniFile = null;
621: sgsIniPath = null;
622:
623: sgsSaveOnExit = true;
624: sgsSaveOnExitCheckBox = null;
625:
626: sgsSaveiconValue = null;
627: sgsIrbbenchValue = null;
628:
629:
630:
631:
632: sgsDefaultMap = new HashMap<String,String> ();
633: {
634: String[] a = SGS_DEFAULT_PARAMETERS.split (";");
635: for (int i = 0, l = a.length; i < l; i += 2) {
636: String key = a[i];
637: String value = i + 1 < l ? a[i + 1] : "";
638: sgsDefaultMap.put (key, value);
639: }
640: }
641:
642:
643:
644:
645:
646:
647:
648:
649: for (int i = 0; i < FDC.FDC_MAX_UNITS; i++) {
650: sgsDefaultMap.put ("fd" + i, "none");
651: }
652: for (int i = 0; i < 16; i++) {
653: sgsDefaultMap.put ("hd" + i, "none");
654: sgsDefaultMap.put ("sa" + i, "none");
655: sgsDefaultMap.put ("sc" + i, "none");
656: }
657: for (int i = 0; i < HFS.HFS_MAX_UNITS; i++) {
658: sgsDefaultMap.put ("hf" + i, "none");
659: }
660:
661: for (int i = 0; i < JFileChooser2.MAXIMUM_HISTORY_COUNT; i++) {
662: sgsDefaultMap.put ("fdhistory" + i, "none");
663: sgsDefaultMap.put ("sahistory" + i, "none");
664: sgsDefaultMap.put ("schistory" + i, "none");
665: sgsDefaultMap.put ("hfhistory" + i, "none");
666: }
667:
668: for (String key : SGS_FRAME_KEYS) {
669: sgsDefaultMap.put (key + "rect", "");
670: sgsDefaultMap.put (key + "stat", "normal");
671: sgsDefaultMap.put (key + "open", "off");
672: }
673:
674:
675:
676:
677: sgsStartMap = new HashMap<String,String> (sgsDefaultMap);
678:
679:
680: sgsStartMap.put ("hf0", sgsHomeDirectory != null ? sgsHomeDirectory : HFS.HFS_DUMMY_UNIT_NAME);
681:
682:
683: sgsStartMap.put ("lang", Multilingual.mlnLang);
684:
685: if (false) {
686:
687: System.out.println ("\n[System.getenv()]");
688: new TreeMap<String,String> (System.getenv ()).forEach ((k, v) -> System.out.println (k + " = " + v));
689: }
690: if (false) {
691:
692: System.out.println ("\n[System.getProperties()]");
693: TreeMap<String,String> m = new TreeMap<String,String> ();
694: System.getProperties ().forEach ((k, v) -> m.put (k.toString (), v.toString ()));
695: m.forEach ((k, v) -> System.out.println (k + " = " + v));
696: }
697:
698:
699: boolean isWindows = System.getProperty ("os.name").indexOf ("Windows") >= 0;
700: sgsAppDataRoamingFolder = isWindows ? System.getenv ("APPDATA") : null;
701: sgsAppDataLocalFolder = isWindows ? System.getenv ("LOCALAPPDATA") : null;
702:
703:
704: sgsHomeDirectory = System.getProperty ("user.home");
705:
706:
707: sgsCurrentDirectory = System.getProperty ("user.dir");
708:
709:
710: if (sgsAppDataRoamingFolder != null) {
711: sgsIniParentPath = new File (sgsAppDataRoamingFolder + File.separator + SGS_APPDATA_FOLDER).getAbsolutePath ();
712: sgsIniParentDirectory = new File (sgsIniParentPath);
713: sgsIniPath = sgsIniParentPath + File.separator + SGS_INI;
714: sgsIniFile = new File (sgsIniPath);
715: } else {
716: sgsIniParentPath = null;
717: sgsIniParentDirectory = null;
718: sgsIniPath = new File ((sgsHomeDirectory != null ? sgsHomeDirectory :
719: sgsCurrentDirectory != null ? sgsCurrentDirectory :
720: ".") + File.separator + SGS_INI).getAbsolutePath ();
721: sgsIniFile = new File (sgsIniPath);
722: }
723:
724:
725:
726:
727: sgsCurrentMap = new HashMap<String,String> (sgsStartMap);
728: sgsCurrentMap.put ("_", "");
729:
730:
731: sgsRootMap = new HashMap<String,HashMap<String,String>> ();
732: sgsRootMap.put ("", sgsCurrentMap);
733:
734:
735:
736: HashMap<String,String> argumentMap = new HashMap<String,String> ();
737: int fdNumber = 0;
738: int hdNumber = 0;
739: int scNumber = 0;
740: int hfNumber = 0;
741: for (int i = 0; i < XEiJ.prgArgs.length; i++) {
742: String key = null;
743: String value = XEiJ.prgArgs[i];
744: arg:
745: {
746: boolean boot = false;
747: if (value.startsWith ("-")) {
748:
749: int k = value.indexOf ('=', 1);
750: if (k >= 0) {
751: key = value.substring (1, k);
752: value = value.substring (k + 1);
753: } else {
754:
755: key = value.substring (1);
756: value = (i + 1 < XEiJ.prgArgs.length && !XEiJ.prgArgs[i + 1].startsWith ("-") ?
757: XEiJ.prgArgs[++i]
758: :
759: "1");
760: }
761: if (!key.equalsIgnoreCase ("boot")) {
762: break arg;
763: }
764: boot = true;
765: }
766:
767: if (SGS_BOOT_DEVICE_PATTERN.matcher (value).matches ()) {
768:
769: key = "boot";
770: break arg;
771: }
772: String valueWithoutColonR = value.endsWith (":R") ? value.substring (0, value.length () - 2) : value;
773: File file = new File (valueWithoutColonR);
774: if (file.isDirectory ()) {
775: key = "hf" + hfNumber++;
776: } else if (file.isFile ()) {
777:
778:
779: if (valueWithoutColonR.toUpperCase ().endsWith (".HDF")) {
780: key = "sa" + hdNumber++;
781: } else if (valueWithoutColonR.toUpperCase ().endsWith (".HDS")) {
782: key = "sc" + scNumber++;
783: } else if (FDMedia.fdmPathToMedia (valueWithoutColonR, null) != null) {
784: key = "fd" + fdNumber++;
785: } else if (HDMedia.hdmPathToMedia (valueWithoutColonR, null) != null) {
786: key = "sa" + hdNumber++;
787: } else {
788: key = "sc" + scNumber++;
789: }
790: } else {
791: String[] zipSplittedName = XEiJ.RSC_ZIP_SEPARATOR.split (valueWithoutColonR, 2);
792: if (zipSplittedName.length == 2 &&
793: new File (zipSplittedName[0]).isFile ()) {
794: if (FDMedia.fdmPathToMedia (valueWithoutColonR, null) != null) {
795: key = "fd" + fdNumber++;
796: } else if (HDMedia.hdmPathToMedia (valueWithoutColonR, null) != null) {
797: key = "sa" + hdNumber++;
798: } else {
799: System.out.println (Multilingual.mlnJapanese ? value + " は不明な起動デバイスです" :
800: value + " is unknown boot device");
801: continue;
802: }
803: } else {
804: System.out.println (Multilingual.mlnJapanese ? value + " は不明な起動デバイスです" :
805: value + " is unknown boot device");
806: continue;
807: }
808: }
809: if (boot) {
810: sgsPutParameter (argumentMap, "boot", key);
811: }
812: }
813:
814: switch (key) {
815: case "ini":
816: sgsIniParentPath = null;
817: sgsIniParentDirectory = null;
818: sgsIniPath = new File (value).getAbsolutePath ();
819: sgsIniFile = new File (sgsIniPath);
820: break;
821: case "saveicon":
822: sgsSaveiconValue = value;
823: break;
824: case "irbbench":
825: sgsIrbbenchValue = value;
826: break;
827: default:
828: sgsPutParameter (argumentMap, key, value);
829: }
830: }
831: System.out.println (Multilingual.mlnJapanese ? "設定ファイルは " + sgsIniPath + " です" :
832: "INI file is " + sgsIniPath);
833:
834:
835: sgsDecodeRootMap (sgsLoadIniFile ());
836:
837:
838: if (argumentMap.containsKey ("config")) {
839: String name = argumentMap.get ("config");
840: if (name.equals ("default")) {
841: sgsCurrentMap.clear ();
842: sgsCurrentMap = new HashMap<String,String> (sgsStartMap);
843: sgsCurrentMap.put ("_", "");
844: sgsRootMap.put ("", sgsCurrentMap);
845: } else if (name.length () != 0 &&
846: sgsRootMap.containsKey (name)) {
847: sgsCurrentMap.clear ();
848: sgsCurrentMap = new HashMap<String,String> (sgsRootMap.get (name));
849: sgsCurrentMap.put ("_", "");
850: sgsRootMap.put ("", sgsCurrentMap);
851: }
852: argumentMap.remove ("config");
853: }
854:
855:
856:
857: for (String key : argumentMap.keySet ()) {
858: sgsCurrentMap.put (key, argumentMap.get (key));
859: }
860:
861:
862: String paramLang = sgsCurrentMap.get ("lang").toLowerCase ();
863: Multilingual.mlnChange (paramLang.equals ("ja") ? "ja" : "en");
864: XEiJ.prgVerbose = sgsGetOnOff ("verbose");
865:
866: sgsSaveOnExit = sgsGetOnOff ("saveonexit");
867: sgsXxxOpen = sgsGetOnOff ("xxxopen");
868:
869:
870:
871:
872:
873:
874:
875:
876:
877: if (CRTC.CRT_ENABLE_INTERMITTENT) {
878: CRTC.crtIntermittentInterval = XEiJ.fmtParseInt (sgsCurrentMap.get ("intermittent"), 0, 0, 4, 0);
879: }
880: if (CRTC.CRT_EXTENDED_GRAPHIC) {
881: CRTC.crtExtendedGraphicRequest = sgsGetOnOff ("extendedgraphic");
882: }
883:
884: SoundSource.sndPlayOn = sgsGetOnOff ("sound");
885: SoundSource.sndVolume = XEiJ.fmtParseInt (sgsCurrentMap.get ("volume"), 0, 0, SoundSource.SND_VOLUME_MAX, SoundSource.SND_VOLUME_DEFAULT);
886: {
887: String s = sgsCurrentMap.get ("soundinterpolation").toLowerCase ();
888: SoundSource.sndRateConverter = (s.equals ("thinning") ? SoundSource.SND_CHANNELS == 1 ? SoundSource.SNDRateConverter.THINNING_MONO : SoundSource.SNDRateConverter.THINNING_STEREO :
889: s.equals ("linear") ? SoundSource.SND_CHANNELS == 1 ? SoundSource.SNDRateConverter.LINEAR_MONO : SoundSource.SNDRateConverter.LINEAR_STEREO :
890: s.equals ("constant-area") ? SoundSource.SNDRateConverter.CONSTANT_AREA_STEREO_48000 :
891: s.equals ("linear-area") ? SoundSource.SNDRateConverter.LINEAR_AREA_STEREO_48000 :
892: SoundSource.SND_CHANNELS == 1 ? SoundSource.SNDRateConverter.LINEAR_MONO : SoundSource.SNDRateConverter.LINEAR_STEREO);
893: }
894:
895: OPM.opmOutputMask = sgsGetOnOff ("opmoutput") ? -1 : 0;
896:
897: {
898: ADPCM.pcmOutputOn = sgsGetOnOff ("pcmoutput");
899: String s = sgsCurrentMap.get ("pcminterpolation").toLowerCase ();
900: ADPCM.pcmInterpolationAlgorithm = (s.equals ("constant") ? ADPCM.PCM_INTERPOLATION_CONSTANT :
901: s.equals ("linear") ? ADPCM.PCM_INTERPOLATION_LINEAR :
902: s.equals ("hermite") ? ADPCM.PCM_INTERPOLATION_HERMITE :
903: ADPCM.PCM_INTERPOLATION_LINEAR);
904: ADPCM.pcmOSCFreqRequest = XEiJ.fmtParseInt (sgsCurrentMap.get ("pcmoscfreq"), 0, 0, 1, 0);
905: }
906:
907:
908:
909:
910:
911:
912:
913:
914:
915:
916:
917:
918:
919:
920:
921: for (String key : SGS_FRAME_KEYS) {
922:
923: int[] rect = sgsGetIntArray (key + "rect", 4, 0);
924:
925: String s = sgsGetString (key + "stat").toLowerCase ();
926: int state = (s.equals ("iconified") ? Frame.ICONIFIED :
927: s.equals ("maximized") ? Frame.MAXIMIZED_BOTH :
928: s.equals ("h-maximized") ? Frame.MAXIMIZED_HORIZ :
929: s.equals ("v-maximized") ? Frame.MAXIMIZED_VERT :
930: Frame.NORMAL);
931:
932: boolean opened = sgsXxxOpen && sgsGetOnOff (key + "open");
933: RestorableFrame.rfmSet (key, rect, state, opened);
934: }
935:
936: if (sgsIrbbenchValue != null) {
937: InstructionBenchmark.irbBench (sgsIrbbenchValue);
938: System.exit (0);
939: }
940:
941: }
942:
943:
944:
945: public static void sgsTini () {
946: if (sgsSaveOnExit) {
947: sgsSaveAllSettings ();
948: }
949: }
950:
951:
952:
953:
954:
955:
956: public static String sgsGetString (String key) {
957: return sgsGetString (key, "");
958: }
959: public static String sgsGetString (String key, String def) {
960: String value = sgsCurrentMap.get (key);
961: if (value == null) {
962: System.err.println ("sgsGetString: undefined key " + key);
963: return def;
964: }
965: value = value.trim ();
966: return value.equalsIgnoreCase ("none") || value.equals ("") ? def : value;
967: }
968:
969:
970:
971: public static void sgsPutString (String key, String value) {
972: if (!sgsCurrentMap.containsKey (key)) {
973: System.err.println ("sgsPutString: undefined key " + key);
974: return;
975: }
976: value = value.trim ();
977: sgsCurrentMap.put (key, value.length () == 0 ? "none" : value);
978: }
979:
980:
981:
982:
983:
984: public static boolean sgsGetOnOff (String key) {
985: return sgsGetOnOff (key, false);
986: }
987: public static boolean sgsGetOnOff (String key, boolean def) {
988: String value = sgsCurrentMap.get (key);
989: if (value == null) {
990: System.err.println ("sgsGetOnOff: undefined key " + key);
991: return false;
992: }
993: value = value.trim ();
994: return (value.equals ("0") ||
995: value.equalsIgnoreCase ("off") ||
996: value.equalsIgnoreCase ("no") ? false :
997: value.equals ("1") ||
998: value.equalsIgnoreCase ("on") ||
999: value.equalsIgnoreCase ("yes") ? true :
1000: def);
1001: }
1002:
1003:
1004:
1005: public static void sgsPutOnOff (String key, boolean b) {
1006: if (!sgsCurrentMap.containsKey (key)) {
1007: System.err.println ("sgsPutOnOff: undefined key " + key);
1008: return;
1009: }
1010: sgsCurrentMap.put (key, b ? "on" : "off");
1011: }
1012:
1013:
1014:
1015:
1016:
1017: public static int sgsGetInt (String key) {
1018: return sgsGetInt (key, 0, Integer.MIN_VALUE, Integer.MAX_VALUE);
1019: }
1020: public static int sgsGetInt (String key, int i0) {
1021: return sgsGetInt (key, i0, Integer.MIN_VALUE, Integer.MAX_VALUE);
1022: }
1023: public static int sgsGetInt (String key, int i0, int min, int max) {
1024: String value = sgsCurrentMap.get (key);
1025: if (value == null) {
1026: System.err.println ("sgsGetInt: undefined key " + key);
1027: return i0;
1028: }
1029: value = value.trim ();
1030: if (value.length () != 0) {
1031: try {
1032: int i = Integer.parseInt (value, 10);
1033: if (min <= i && i <= max) {
1034: return i;
1035: }
1036: } catch (NumberFormatException nfe) {
1037: }
1038: }
1039: return i0;
1040: }
1041:
1042:
1043:
1044:
1045: public static void sgsPutInt (String key, int i) {
1046: sgsPutInt (key, i, 0);
1047: }
1048: public static void sgsPutInt (String key, int i, int i0) {
1049: if (!sgsCurrentMap.containsKey (key)) {
1050: System.err.println ("sgsPutInt: undefined key " + key);
1051: return;
1052: }
1053: sgsCurrentMap.put (key, i == i0 ? "" : String.valueOf (i));
1054: }
1055:
1056:
1057:
1058:
1059:
1060:
1061:
1062: public static int[] sgsGetIntArray (String key) {
1063: return sgsGetIntArray (key, -1, 0);
1064: }
1065: public static int[] sgsGetIntArray (String key, int n) {
1066: return sgsGetIntArray (key, n, 0);
1067: }
1068: public static int[] sgsGetIntArray (String key, int n, int v) {
1069: String value = sgsCurrentMap.get (key);
1070: if (value == null) {
1071: System.err.println ("sgsGetIntArray: undefined key " + key);
1072: value = "";
1073: }
1074: String[] sa = value.length () == 0 ? new String[0] : value.split (",");
1075: if (n < 0) {
1076: n = sa.length;
1077: }
1078: int[] ia = new int[n];
1079: Arrays.fill (ia, v);
1080: for (int i = 0; i < n && i < sa.length; i++) {
1081: String s = sa[i].trim ();
1082: if (s.length () != 0) {
1083: try {
1084: ia[i] = Integer.parseInt (s, 10);
1085: } catch (NumberFormatException nfe) {
1086: }
1087: }
1088: }
1089: return ia;
1090: }
1091:
1092:
1093:
1094:
1095: public static void sgsPutIntArray (String key, int[] ia) {
1096: sgsPutIntArray (key, ia, 0);
1097: }
1098: public static void sgsPutIntArray (String key, int[] ia, int v) {
1099: if (!sgsCurrentMap.containsKey (key)) {
1100: System.err.println ("sgsPutIntArray: undefined key " + key);
1101: return;
1102: }
1103: int n = ia.length;
1104: while (0 < n && ia[n - 1] == v) {
1105: n--;
1106: }
1107: StringBuilder sb = new StringBuilder ();
1108: for (int i = 0; i < n; i++) {
1109: if (i != 0) {
1110: sb.append (',');
1111: }
1112: if (ia[i] != v) {
1113: sb.append (ia[i]);
1114: }
1115: }
1116: sgsCurrentMap.put (key, sb.toString ());
1117: }
1118:
1119:
1120:
1121:
1122: public static byte[] sgsGetData (String key) {
1123: String value = sgsCurrentMap.get (key);
1124: if (value == null) {
1125: System.err.println ("sgsGetData: undefined key " + key);
1126: value = "";
1127: }
1128: return value.length () == 0 ? new byte[0] : ByteArray.byaDecodeGzip (ByteArray.byaDecodeBase64 (value));
1129: }
1130:
1131:
1132:
1133:
1134:
1135:
1136: public static void sgsPutData (String key, byte[] array) {
1137: sgsPutData (key, array, 0, array.length);
1138: }
1139: public static void sgsPutData (String key, byte[] array, int offset, int length) {
1140: if (!sgsCurrentMap.containsKey (key)) {
1141: System.err.println ("sgsPutData: undefined key " + key);
1142: return;
1143: }
1144: String value = "";
1145: for (int i = 0; i < length; i++) {
1146: if (array[offset + i] != 0) {
1147: value = ByteArray.byaEncodeBase64 (ByteArray.byaEncodeGzip (array, offset, length));
1148: break;
1149: }
1150: }
1151: sgsCurrentMap.put (key, value);
1152: }
1153:
1154:
1155:
1156:
1157:
1158: public static void sgsMakeMenu () {
1159:
1160: ActionListener listener = new ActionListener () {
1161: @Override public void actionPerformed (ActionEvent ae) {
1162: Object source = ae.getSource ();
1163: String command = ae.getActionCommand ();
1164: switch (command) {
1165: case "Save settings on exit":
1166: sgsSaveOnExit = ((JCheckBoxMenuItem) ae.getSource ()).isSelected ();
1167: break;
1168: case "Restore windows that were open":
1169: sgsXxxOpen = ((JCheckBoxMenuItem) ae.getSource ()).isSelected ();
1170: break;
1171: case "Delete all settings":
1172: sgsDeleteAllSettings ();
1173: break;
1174: }
1175: }
1176: };
1177:
1178: sgsMenu = Multilingual.mlnText (
1179: ComponentFactory.createMenu (
1180: "Configuration file",
1181: sgsSaveOnExitCheckBox =
1182: Multilingual.mlnText (
1183: ComponentFactory.createCheckBoxMenuItem (sgsSaveOnExit, "Save settings on exit", listener),
1184: "ja", "終了時に設定を保存する"),
1185: Multilingual.mlnText (
1186: ComponentFactory.createCheckBoxMenuItem (sgsXxxOpen, "Restore windows that were open", listener),
1187: "ja", "開いていたウインドウを復元する"),
1188: ComponentFactory.createHorizontalSeparator (),
1189: Multilingual.mlnText (
1190: ComponentFactory.createMenuItem ("Delete all settings", listener),
1191: "ja", "すべての設定を消去する")
1192: ),
1193: "ja", "設定ファイル");
1194: }
1195:
1196:
1197:
1198: public static void sgsSaveAllSettings () {
1199:
1200: sgsCurrentMap.put ("lang", Multilingual.mlnLang);
1201:
1202: sgsCurrentMap.put ("verbose", XEiJ.prgVerbose ? "on" : "off");
1203:
1204: sgsCurrentMap.put ("saveonexit", sgsSaveOnExit ? "on" : "off");
1205: sgsCurrentMap.put ("xxxopen", sgsXxxOpen ? "on" : "off");
1206:
1207:
1208:
1209: sgsCurrentMap.put ("fefunc", FEFunction.fpkOn ? "on" : "off");
1210: sgsCurrentMap.put ("rejectfloat", FEFunction.fpkRejectFloatOn ? "on" : "off");
1211:
1212:
1213: sgsCurrentMap.put ("memory", String.valueOf (MainMemory.mmrMemorySizeRequest >>> 20));
1214: sgsCurrentMap.put ("memorysave", MainMemory.mmrMemorySaveOn ? "on" : "off");
1215: sgsCurrentMap.put ("memorydata", MainMemory.mmrMemorySaveOn ? ByteArray.byaEncodeBase64 (ByteArray.byaEncodeGzip (MainMemory.mmrM8, 0x00000000, MainMemory.mmrMemorySizeCurrent)) : "");
1216:
1217: if (CRTC.CRT_ENABLE_INTERMITTENT) {
1218: sgsCurrentMap.put ("intermittent", String.valueOf (CRTC.crtIntermittentInterval));
1219: }
1220: if (CRTC.CRT_EXTENDED_GRAPHIC) {
1221: sgsCurrentMap.put ("extendedgraphic", CRTC.crtExtendedGraphicRequest ? "on" : "off");
1222: }
1223:
1224: sgsCurrentMap.put ("sound", SoundSource.sndPlayOn ? "on" : "off");
1225: sgsCurrentMap.put ("volume", String.valueOf (SoundSource.sndVolume));
1226: sgsCurrentMap.put ("soundinterpolation",
1227: SoundSource.sndRateConverter == (SoundSource.SND_CHANNELS == 1 ? SoundSource.SNDRateConverter.THINNING_MONO : SoundSource.SNDRateConverter.THINNING_STEREO) ? "thinning" :
1228: SoundSource.sndRateConverter == (SoundSource.SND_CHANNELS == 1 ? SoundSource.SNDRateConverter.LINEAR_MONO : SoundSource.SNDRateConverter.LINEAR_STEREO) ? "linear" :
1229: SoundSource.sndRateConverter == SoundSource.SNDRateConverter.CONSTANT_AREA_STEREO_48000 ? "constant-area" :
1230: SoundSource.sndRateConverter == SoundSource.SNDRateConverter.LINEAR_AREA_STEREO_48000 ? "linear-area" :
1231: "linear");
1232:
1233: sgsCurrentMap.put ("opmoutput", OPM.opmOutputMask != 0 ? "on" : "off");
1234:
1235: sgsCurrentMap.put ("pcmoutput", ADPCM.pcmOutputOn ? "on" : "off");
1236: sgsCurrentMap.put ("pcminterpolation",
1237: ADPCM.pcmInterpolationAlgorithm == ADPCM.PCM_INTERPOLATION_CONSTANT ? "constant" :
1238: ADPCM.pcmInterpolationAlgorithm == ADPCM.PCM_INTERPOLATION_LINEAR ? "linear" :
1239: ADPCM.pcmInterpolationAlgorithm == ADPCM.PCM_INTERPOLATION_HERMITE ? "hermite" :
1240: "linear");
1241: sgsCurrentMap.put ("pcmoscfreq", String.valueOf (ADPCM.pcmOSCFreqRequest));
1242:
1243:
1244:
1245:
1246:
1247:
1248:
1249: for (String key : SGS_FRAME_KEYS) {
1250:
1251: sgsPutIntArray (key + "rect", RestorableFrame.rfmGetRect (key), 0);
1252:
1253: int state = RestorableFrame.rfmGetState (key);
1254: sgsPutString (key + "stat",
1255: (state & Frame.ICONIFIED) == Frame.ICONIFIED ? "iconified" :
1256: (state & Frame.MAXIMIZED_BOTH) == Frame.MAXIMIZED_BOTH ? "maximized" :
1257: (state & Frame.MAXIMIZED_BOTH) == Frame.MAXIMIZED_HORIZ ? "h-maximized" :
1258: (state & Frame.MAXIMIZED_BOTH) == Frame.MAXIMIZED_VERT ? "v-maximized" :
1259: "normal");
1260:
1261: sgsPutOnOff (key + "open", sgsXxxOpen && RestorableFrame.rfmGetOpened (key));
1262: }
1263:
1264:
1265: sgsSaveIniFile (sgsEncodeRootMap ());
1266:
1267: }
1268:
1269:
1270:
1271: public static void sgsDecodeRootMap (String text) {
1272: sgsRootMap.clear ();
1273: sgsCurrentMap.clear ();
1274: sgsCurrentMap = new HashMap<String,String> (sgsStartMap);
1275: sgsCurrentMap.put ("_", "");
1276: sgsRootMap.put ("", sgsCurrentMap);
1277: HashMap<String,String> map = sgsCurrentMap;
1278: for (String line : text.split ("\n")) {
1279: line = line.trim ();
1280: if (line.length () == 0 ||
1281: line.startsWith ("#")) {
1282: continue;
1283: }
1284: int i = line.indexOf ('=');
1285: if (i < 0) {
1286: continue;
1287: }
1288: String key = line.substring (0, i).trim ().toLowerCase ();
1289: String value = line.substring (i + 1).trim ();
1290: if (key.equals ("_")) {
1291: if (sgsRootMap.containsKey (value)) {
1292: if (false) {
1293: map = null;
1294: } else {
1295: map = sgsRootMap.get (value);
1296: }
1297: } else {
1298: map = new HashMap<String,String> (sgsStartMap);
1299: map.put (key, value);
1300: sgsRootMap.put (value, map);
1301: }
1302: continue;
1303: }
1304: if (map == null) {
1305: continue;
1306: }
1307: sgsPutParameter (map, key, value);
1308: }
1309: }
1310:
1311:
1312:
1313: public static ArrayList<String> sgsEncodeRootMap () {
1314: ArrayList<String> strings = new ArrayList<String> ();
1315: String[] nameArray = sgsRootMap.keySet ().toArray (new String[0]);
1316: Arrays.sort (nameArray, DictionaryComparator);
1317: for (String name : nameArray) {
1318: HashMap<String,String> map = sgsRootMap.get (name);
1319: if (map != sgsCurrentMap) {
1320: strings.add ("\n");
1321: }
1322: String[] keyArray = map.keySet ().toArray (new String[0]);
1323: Arrays.sort (keyArray, DictionaryComparator);
1324: for (String key : keyArray) {
1325: String value = map.get (key);
1326: if (!(map == sgsCurrentMap && key.equals ("_")) &&
1327: !key.equals ("config") &&
1328: !value.equals (sgsStartMap.get (key))) {
1329: strings.add (key);
1330: strings.add ("=");
1331: strings.add (value);
1332: strings.add ("\n");
1333: }
1334: }
1335: }
1336: return strings;
1337: }
1338:
1339:
1340:
1341: public static void sgsDeleteAllSettings () {
1342: XEiJ.pnlExitFullScreen (true);
1343: if (JOptionPane.showConfirmDialog (
1344: XEiJ.frmFrame,
1345: Multilingual.mlnJapanese ? "すべての設定を消去しますか?" : "Do you want to delete all settings?",
1346: Multilingual.mlnJapanese ? "確認" : "Confirmation",
1347: JOptionPane.YES_NO_OPTION,
1348: JOptionPane.PLAIN_MESSAGE) == JOptionPane.YES_OPTION) {
1349: sgsDeleteIniFile ();
1350: sgsSaveOnExit = false;
1351: sgsSaveOnExitCheckBox.setSelected (sgsSaveOnExit);
1352: }
1353: }
1354:
1355:
1356:
1357:
1358:
1359: public static void sgsPutParameter (HashMap<String,String> map, String key, String value) {
1360: if (sgsDefaultMap.containsKey (key)) {
1361: String defaultValue = sgsDefaultMap.get (key);
1362: if (defaultValue.equals ("off") || defaultValue.equals ("on")) {
1363: value = (value.equals ("0") ||
1364: value.equalsIgnoreCase ("no") ||
1365: value.equalsIgnoreCase ("off") ? "off" : "on");
1366: }
1367: map.put (key, value);
1368: }
1369: }
1370:
1371:
1372:
1373:
1374:
1375: public static String sgsLoadIniFile () {
1376: return XEiJ.rscGetTextFile (sgsIniPath);
1377: }
1378:
1379:
1380:
1381: public static void sgsSaveIniFile (ArrayList<String> strings) {
1382: XEiJ.rscPutTextFile (sgsIniPath, strings);
1383: }
1384:
1385:
1386:
1387: public static void sgsDeleteIniFile () {
1388: if (sgsIniFile.isFile ()) {
1389: if (sgsIniFile.delete ()) {
1390: System.out.println (sgsIniPath + (Multilingual.mlnJapanese ? " を削除しました" : " was removed"));
1391: } else {
1392: System.out.println (sgsIniPath + (Multilingual.mlnJapanese ? " を削除できません" : " cannot be removed"));
1393: return;
1394: }
1395: }
1396: String bakPath = sgsIniPath + ".bak";
1397: File bakFile = new File (bakPath);
1398: if (bakFile.isFile ()) {
1399: if (bakFile.delete ()) {
1400: System.out.println (bakPath + (Multilingual.mlnJapanese ? " を削除しました" : " was removed"));
1401: } else {
1402: System.out.println (bakPath + (Multilingual.mlnJapanese ? " を削除できません" : " cannot be removed"));
1403: return;
1404: }
1405: }
1406: String tmpPath = sgsIniPath + ".tmp";
1407: File tmpFile = new File (tmpPath);
1408: if (tmpFile.isFile ()) {
1409: if (tmpFile.delete ()) {
1410: System.out.println (tmpPath + (Multilingual.mlnJapanese ? " を削除しました" : " was removed"));
1411: } else {
1412: System.out.println (tmpPath + (Multilingual.mlnJapanese ? " を削除できません" : " cannot be removed"));
1413: return;
1414: }
1415: }
1416: if (sgsIniParentDirectory != null &&
1417: sgsIniParentDirectory.isDirectory ()) {
1418: if (sgsIniParentDirectory.delete ()) {
1419: System.out.println (sgsIniParentPath + (Multilingual.mlnJapanese ? " を削除しました" : " was removed"));
1420: } else {
1421: System.out.println (sgsIniParentPath + (Multilingual.mlnJapanese ? " を削除できません" : " cannot be removed"));
1422: }
1423: }
1424: }
1425:
1426:
1427:
1428: }
1429:
1430:
1431: