/** * HF Receiver Controller Applet 1.0.0 * @author Robert J Morton YE572246C * @version 25 November 2001, revanped 16 November 2007, Swing Version 31 January 2012, converted to JFrame app Fri 24 Feb 2017 * @copyright Robert J Morton (all rights reserved) This class file contains all the broadcast station data used by the applet. Originally, this data was contained in text files that were included in the applet's own .jar file. The station data was then loaded when needed by opening the data file for read-only and loading in the data. Unfortunately, however, due to a serious flaw in the security logic of the Java system, this would not work if the applet were sandboxed. Consequently, it had to be granted all-permissions, which required rigorous certification that I could not afford. Consequently, the data preparation program now generates this class file as the applet's data source, thereby circumventing the need for all-permissions security level and will operate happily in the sandbox. All a bit frumpy from the point of view of good-practice programming but the flaws in the security thinking oin the Java system does not leave any other option thnat I can readily see. */ class stnData { /* The following String array contains the names of all the stations in alphabetical order. */ private static String[] stations = { "ABC", "AIR", "AIR Bhopal", "AIR Bombay", "AIR Delhi", "AIR Imphal", "AIR Japur", "AIR Kohima", "AIR Lucknow", "AIR Port Blair", "All India Radio", "Arado Alvorada", "AWR Latin America", "Azad Kahmir Radio", "BBC", "BBC African Service", "BBC Russian Service", "BBC World Service", "Caracol Bogata", "CBS", "CFRX Toronto", "Chan. Africa", "Christian Voice", "CPBS", "Deutsche Welle", "Ecos del Torbes", "ELWA Liberia", "Faro del Caribe", "FRCN", "GBC Radio 1", "GBC Radio 2", "Guangxi 2", "Haiti 4VEH", "Hanoi 2", "HJFR Columbia", "Huna 1", "Italian Radio", "KBC", "KGEI", "Kol Israel", "La Voix du Topal", "La Voix du Sahel", "La Voix du Zaire", "LNBS", "NBC", "ORTM", "ORTS","Pakistan BC", "PBS", "Quinghai PBS", "R. Cultura do Para", "R. Internacional", "R. Marajoara", "R. Nac de Columbia", "R. Nac. del", "Paraguay", "R. Tezulutlan", "R.Anhanguera", "R.Clube do Para", "R.Cora del Peru", "R.dif TV Burkina", "R.Nat.N'djamena", "R.SoldeLos Andes", "Radio & TV Guinea", "Radio Apintie", "Radio Australia", "Radio Australia International", "Radio Baghdad", "Radio Bangladesh", "Radio Bangui", "Radio Berlin International", "Radio Botswana", "Radio Brazil Central", "Radio Bucharest", "Radio Budapest", "Radio Cabolcla", "Radio Cairo", "Radio Canada International", "Radio Cancao", "Radio Candip", "Radio Cotonou", "Radio Cultural", "Radio Denmark", "Radio Difusora", "Radio Earth International", "Radio Eco", "Radio El Salvador", "Radio Finland", "Radio France International", "Radio Free Grenada", "Radio Gabon", "Radio Garoua", "Radio Havana Cuba", "Radio Intergracao", "Radio Israel", "Radio Ivory Coast", "Radio Japan", "Radio Jordan", "Radio Kiev", "Radio Korea", "Radio Kuwait", "Radio Lebanon", "Radio Luxembourg", "Radio Macedonia", "Radio Madre de Dios", "Radio Martinique", "Radio Milano International", "Radio Moscow", "Radio Mozambique", "Radio Nac.Amazonas", "Radio Nacional", "Radio National Chile", "Radio National Peru", "Radio Nederland", "Radio Nepal", "Radio New Zealand", "Radio Norway International", "Radio Pakistan", "Radio Parakou", "Radio Peking", "Radio Polonia", "Radio Portugal", "Radio Prauge", "Radio Progesso", "Radio Pyongyang", "Radio Quinto", "Radio Rebelde", "Radio Reloj", "Radio Roraima", "Radio RSA", "Radio Sofia", "Radio Sweden International", "Radio Tachira", "Radio Tahiti", "Radio Tanzania", "Radio Tirana", "Radio Togo", "Radio Tunisia", "Radio TV Algeria", "Radio TV Morocco", "Radio Uganda", "Radio Vilnius", "Radio Yaounde", "Radio Zambia", "Radiobras Brazil", "RFO New Caledonia", "RRI Manado", "RTM", "SABC", "SLBS", "South West Africa R.", "SWABC", "Swiss Radio International", "TGNA Guatemala", "Trans World Radio", "Trans World Radio Manzini", "United Nations Radio", "Vatican Radio", "Voice of America", "Voice of Chile", "Voice of Free China", "Voice of Greece", "Voice of Guatemala", "Voice of Indonesia", "Voice of Iran", "Voice of Nicaragua", "Voice of Nigeria", "Voice of Tomorrow", "Voice of Turkey", "Voice of Vietnam", "Voz del Rio", "Voz del Upano", "WRNO Worldwide", "WYFR Family Radio", "Xinjiang", "ZBC Prog 2", "ZBC Radio" }; /* The following 2-dimensional integer array contains the broadcasting frequencies for each station. The first index is the same as the station names index in the station names array above. The second index is the index number of the frequencies on which that station braodcasts. */ private int[][] frequencies = { // station number, frequency number { 2325, 2485}, { 4800, 4820, 4895, 4940, 5010}, { 3315}, { 4840}, { 3365}, { 4775}, { 3345}, { 4850}, { 3223, 3245}, { 4760}, { 9650, 9705, 11620, 15110, 15125, 15185, 15265, 15320, 21695}, { 4965}, { 5030}, { 4790}, { 5965, 5975, 6005, 6050, 6075, 6110, 6120, 6175, 6195, 7105, 7150, 7185, 7210, 7230, 7325, 9410, 9510, 9575, 9590, 9600, 9640, 9740, 9765, 9825, 9855, 9915,11705,11720,11775,11805, 11820,11835,11860,11870,11900,11910,11935,11955,12095,15070, 15260,15360,15390,15415,15420,15445,17715,17740,17790,17830, 17840,17880,17885,21470,21550,21560,21660,21705,21710}, { 6010, 6140, 6160, 9750,11780,11945,15105,15400}, {15280}, { 3255, 3390, 3915, 3955, 5965, 5970, 5975, 5990, 6005, 6100, 6135, 6175, 6180, 6190, 6195, 7110, 7115, 7145, 7160, 7180, 7325, 9410, 9515, 9580, 9590, 9600, 9605, 9610, 9630, 9740, 9760, 9895, 9915,11680,11730,11750,11760,11765,11780,11835, 11860,11865,11940,11955,12095,15070,15190,15220,15280,15310, 15360,15380,15400,15420,15575,17640,17705,17790,17830,17840, 17885,21470}, { 5075}, { 3335}, { 6070}, { 3220, 3345}, { 3330}, { 4800}, { 3995, 5960, 6040, 6045, 6075, 6085, 6100, 6145, 7225, 7275, 7285, 9545, 9565, 9590, 9605, 9640, 9650, 9690, 9700, 9735, 9765,11705,11765,11785,11795,11865,11905,11965,15105,15135, 15150,15210,15235,15270,15275,15320,15410,17715,17780,17795, 17860,17875,21490,21500,21510,21560,21590,21600,21620,21650}, { 4980}, { 4760,11930}, { 5055}, { 3325, 4770, 4990}, { 4915}, { 3365}, { 5010}, { 9770,11835}, { 4960}, { 6150}, { 4990}, {11800,15245,15330,21650}, { 4885, 4915, 4935}, { 9615,11910,15280,15355}, { 5885, 5915, 7410, 9009, 9435, 9440, 9815,11610,11637,11655, 15105,15200,15585,15587,15615,17585,17630,17815,21495,21675, 21710}, { 5040}, { 5020}, {15245,15349}, { 4800}, { 3380}, { 4845}, { 4890}, { 4895}, { 4865, 4970, 5020, 5060}, { 3950}, { 5045}, { 4931}, { 4955}, { 4955}, { 9734}, { 4835}, { 4915}, { 4885}, { 4914}, { 4815}, { 4905}, { 3230}, {15309,15317}, { 5006}, { 5995, 6045, 6060, 6080, 7205, 9570, 9580, 9640, 9670, 9710, 9760, 9770,11705,11720,11725,11740,11775,11890,11905,11910, 11925,15115,15140,15160,15205,15240,15320,15395,17705,17725, 17795,17860,17890,21525,21570,21575,21630,21650,21680,21740}, { 5995, 6020, 6060, 6080, 6090, 7240, 7330, 9510, 9580, 9615, 9660, 9710, 9850, 9860,11640,11660,11695,11800,11855,11880, 12080,13605,13755,15240,15365,15415,15510,15530,17715,17750, 17795,17860,17880,21725}, { 9615, 9745,21585}, { 4879,17890}, { 5035}, { 9620, 9730,11840,11890,11975,21465,21540}, { 3356, 4820, 4830}, { 4985}, { 5990, 9510, 9570,11825,11840,11940,15335,15390}, { 3955, 9520, 9585, 9835,12000,15220,15455,17710}, { 4845}, { 9455, 9475, 9675, 9740, 9805, 9850,11630,12000,12050,15050, 15255,15475,17690,21465}, { 5960, 6045, 6140, 6195, 9535, 9590, 9625, 9645, 9655, 9730, 9755, 9760,11825,11845,11850,11905,11925,11940,11945,11950, 11960,15150,15160,15190,15235,15260,15265,15285,15325,15440, 17630,17760,17820,17860,17875,21480,21520,21695}, { 4825}, { 5065}, { 4870}, { 3300}, {15165,21595,21700}, { 4945}, { 6185}, { 5097}, { 9553}, {15400,15430,17800,21475}, { 3965, 4890, 6085, 6140, 7280, 9550, 9660, 9715, 9790, 9800, 11965,11995,15135,15155,15180,15200,15205,15300,15315,15360, 15425,17620,17720,17775,17795,17850,17860,17865,21515,21520, 21580,21595,21620,21645,21675,21705}, {15044}, { 4777}, { 5010}, { 5970, 6020, 6060, 6090, 6100, 6140, 7385, 7425, 9525, 9545, 9550, 9655, 9685, 9730, 9740, 9770, 9887,11725,11760,11795, 11920,11930,11950,11970,15150,15155,15230,15300,15340,15470, 15525,17690,17705,17750,17760,17835,17880,17885}, { 4765}, {17685}, { 7215,11920}, { 9505, 9585, 9635,11705,11745,11865,15195,15210,15235,15270, 15300,15325,15435,17725,17755,17810,17825,17880,21610,21640}, { 9560}, { 7150, 7215, 7400, 9735, 9750, 9800,11735,11770,11790,13605, 15240,15275,17870}, { 3975, 9525, 9570, 9870,11810,11965,15575}, {9840, 9880,11665,11675,11990,15495,17650,21545,21640,21685}, {15375}, {15350}, {15050}, { 4950}, {11930}, {15055}, { 5915, 6000, 6115, 6150, 7115, 7175, 7195, 7215, 7240, 7320, 7440, 9450, 9470, 9480, 9490, 9550, 9565, 9580, 9600, 9635, 9640, 9665, 9685, 9700, 9710, 9720, 9735, 9745, 9750, 9755, 9765, 9780, 9795, 9800, 9810,11705,11710,11720,11735,11750, 11755,11770,11780,11790,11810,11820,11840,11845,11860,11870, 11900,11905,11920,11950,11965,11975,11980,11990,12000,12010, 12020,12030,12050,12060,12070,13665,15100,15110,15130,15135, 15140,15150,15175,15180,15200,15210,15220,15240,15245,15265, 15275,15295,15320,15325,15375,15385,15405,15415,15425,15445, 15455,15460,15465,15470,15480,15490,15500,15505,15510,15515, 15520,15525,15535,15540,15550,17700,17720,17765,17775,17785, 17795,17805,17825,17835,17860,17870,17875,17880,17900,21490, 21530,21565,21730,21740,21750}, { 9525}, { 4805}, { 3375, 4950, 5005}, { 9550, 9555,15140,15148}, { 9860}, { 5955, 6020, 6165, 9590, 9630, 9715, 9735, 9770, 9895,11375, 11730,11740,11865,11930,13770,15220,15235,15315,15560,15570, 17605,17695,17810,21480,21640,21685}, { 5005}, {11780,15485,17705}, { 9590, 9645,11870,21705,21730}, {15550,17640,17840,21700}, { 5025}, { 5770, 9290, 9440, 9820, 9860, 9880, 9945, 9955,11575,11600, 11650,11685,11860,11900,11945,11980,15012,15030,15120,15125, 15165,15180,15300,15520,15600,17680,17745,17770,17795,17855}, { 9525, 9690,15120}, { 6025, 6060, 6155, 6185, 9525, 9575, 9600, 9765, 9785,11925, 11935,11960,15125,15170,15240,17880}, { 5930, 6055, 7345, 9490, 9630, 9740,11790,11800,11855,11950, 11990,15185,21520}, { 4945}, { 9420, 9977,15229}, { 4920}, { 5025}, { 4832}, { 4875}, { 5980, 6010, 6020, 6150, 6195, 7270, 9575, 9580, 9585, 9615, 9715,11670,11730,11780,11800,11900,15155,15185,15220,15325, 15385,17745,17775,17780,17790,21535,21695}, { 9530, 9665, 9700, 9705,11720,11750,11765,11840,11920,15135, 15150,15155,15160,15285,15310,15330,21495}, { 9765,11705,11905,15270,15275,15290,15315,15380,17740,21505, 21605,21615}, { 4830}, {11825,15170}, { 4405}, { 6040, 6200, 7065, 7080, 7120, 7300, 9375, 9500, 9750, 9787, 11985}, { 4470}, { 7225,15225}, {17765,21635}, {15595,21735}, { 3340, 5025, 9730,15325}, { 9750,15275}, { 4850}, { 4910}, {11745,11780,15125,15200,15290}, { 5055, 7171}, { 3215}, { 4783, 4835}, { 3230, 3320}, { 3316}, { 9650}, { 3270}, { 3985, 6135, 6165, 9535, 9560, 9635, 9725,11715,12035,15125, 15305,15430,17715,17750,17830,17840,17850,21520,21570,21585, 21695}, { 5980}, { 9730, 3240, 4706}, { 3200}, { 9540,11735,15125,15225,15435}, { 4005, 6015, 6190, 6210, 9605, 9625, 9645,11715,11740,11845, 15120,15405,17705,17725}, { 5995, 6020, 6035, 6040, 6080, 6125, 6130, 6160, 6190, 7120, 7170, 7200, 7220, 7280, 7325, 9455, 9505, 9525, 9530, 9540, 9550, 9555, 9560, 9565, 9575, 9630, 9635, 9640, 9650, 9655, 9660, 9670, 9740, 9755, 9760, 9770, 9840, 9870,11710,11715, 11720,11740,11760,11830,11835,11840,11850,11865,11895,11915, 11925,11930,11950,11960,15115,15120,15140,15150,15160,15175, 15180,15185,15195,15205,15220,15240,15245,15250,15280,15290, 15305,15310,15315,15320,15325,15330,15345,15355,15375,15390, 15395,15400,15410,15415,15425,15430,15445,15580,15600,15652, 17640,17710,17730,17750,17775,17790,17795,17800,17815,17825, 17830,17835,17855,17860,17865,17870,17895,21460,21470,21485, 21490,21500,21540,21550,21575,21590,21595,21610,21660,21670, 21695,21720,21745,21840}, {11890,15300,17800}, { 5985, 7130, 9852,11745,11804,15345,17800}, { 7315, 9420, 9460, 9515, 9650, 9865, 9905,11645,11730,17555, 17565}, { 9760}, {15200}, { 9022,15084}, { 5949, 6015}, { 7255,11770,15120}, {15039}, {11870,11955,15220,15360}, { 6850,10040}, { 4895}, { 5020, 5040}, { 6020, 7355, 9690,11965,15140,17775}, { 5985, 6065, 6070, 7355, 9535, 9575, 9605, 9680, 9705, 9715, 9852,11740,11805,11830,11845,11855,11875,11890,15110,15125, 15130,15160,15170,15215,15225,15365,15375,15440,15565,17805, 17845,17875,21465,21510,21525,21615}, { 4500}, { 3306}, { 4828}, }; /* GET A STATION'S NAME FROM THE STATION'S INDEX NUMBER checking that the presented station number stnNum is within the valid range of the station names array. */ int getNumStns() { return stations.length; } String getStnName(int stnNum) { if(stnNum >= 0 && stnNum < stations.length) return stations[stnNum]; else return null; // signifies a range error } // Find the maximum number of frequencies used by any station. int getNumFrqs() { int X = 0, I = frequencies.length; for(int i = 0; i < I; i++) { int x = frequencies[i].length; if(x > X) X = x; } return X; } // Get the number of frequencies used by a specific station. int getNumFrqsOfStn(int x) { return frequencies[x].length; } /* GET ONE OF A PARTICULAR STATION'S FREQUENCIES FROM THAT STATION'S ROW OF THE 2-DIMENSIONAL FREQUENCIES ARRAY checking that the presented station number stnNum the number of its requested frequency frqNum are within the valid ranges of the frequencies array. */ String getFreq(int stnNum, int frqNum) { if(stnNum >= 0 && stnNum < frequencies.length && frqNum >= 0 && frqNum < frequencies[stnNum].length) { String s = "" + frequencies[stnNum][frqNum]; if(s.length() < 5) s = " " + s; return s; } else return null; // signifies a range error } }