Repository navigation
Expand file tree
/
Copy pathLaunchShopriteApp.java
More file actions
2731 lines (2699 loc) · 179 KB
/
Copy pathLaunchShopriteApp.java
File metadata and controls
2731 lines (2699 loc) · 179 KB
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* @author <GregJava@OGS Nig ltd>
*/
package shoprite;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.URL;
import java.util.*;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.HTMLFrameHyperlinkEvent;
public class LaunchShopriteApp {
private static final String appName = "Item Locator";
/**
* @param args represents app runtime arguments
* The main method runs the GUI using the invoke-later argument.
*/
public static void main(String[] args){
/* Schedule a job for the event-dispatching thread: creating and showing this application's GUI. */
javax.swing.SwingUtilities.invokeLater(() -> {
for (Object obj : (System.getProperties()).values()) System.out.println(obj);
createAndShowGUI();
});
}
private static void createAndShowGUI() {
// Create & Set up the app machine.
Window machine = new Window();
}
private static void findAppInstallLoc(String start, String appName) {
boolean fileFound = false; int metFirstFile = 0; boolean firstTime = true;
File file = new File(start);
String firstFileName = appName;
do {
if (metFirstFile>=1) break;
if (file.isDirectory()) {
for (File fil : file.listFiles()){
if (firstTime){
firstFileName = fil.getName(); firstTime=false;
}
if (fil.getAbsolutePath().contains(appName)) {
file = fil; fileFound = true;
// System.err.println(file.getName());
break;
}
System.out.println(fil.getName());
if (fil.getName().equalsIgnoreCase(firstFileName)) metFirstFile++;
}
} else {
if (file.getAbsolutePath().contains(appName)) {
fileFound = true;
// System.err.println(file.getName());
break;
}
}
} while (!fileFound);
if (!fileFound) {
// System.err.println("Shoprite default folder not found...");
} else System.out.println(file.getName());
}
private static class Window extends JFrame implements ActionListener{
private static final ShoppingMall building = new ShoppingMall();
private static final JComboBox categorySelector = new JComboBox();
private static JTextField inputPane;
private static JTextArea infoBoard;
private static JTabbedPane homePane, infoPane;
private static JButton itemFinder;
private static String state, userInput;
private static ArrayList<Color[]> themeColor = new ArrayList<Color[]>();
// holds the application themes and categories
private static ArrayList<String> items = new ArrayList<>(), description = new ArrayList<>(),
theme = new ArrayList<String>(), category = new ArrayList<String>();
// holds the application categories' sublist
private static Map<String, String[]> desc = new HashMap(), itm = new HashMap(); // Holds items and their categories
private static int SCALE = 1, INSET = 30;
private static int THEME;
private static String[] phoneShops = {"Airtel","Best Mobile", "Etisalat","Fine Brothers",
"Glo World","LG","Pointek","Tecno"};
private static String[] computerShops = {"Yudala","Best Mobile", "LG"};
private static String[] electronicShops = {"Fine Brothers","LG", "Marvel"};
private static String[] fabricShops = {"MRP","Button Up", "Identity","Secret View Lingerie",
"Truworths","Audacious"};
private static String[] cosmeticShops = {"Casabella","Essenza", "Pink Sky","Montaigne"};
private static String[] leatherJewelShops = {"Maybrand","Kontessa","Swatch","a! Accessories","Diva"};
private static String[] fastfoodShops = {"Kilmanjaro","Aroma","Chicken Republic"};
private static String[] medShops = {"Medplus","NettPharmacy"};
private static String[] cinemaShops = {"Genesis Deluxe Cinema"};
private static String[] sportsShops = {"Sports World"};
private static String[] shopriteShops = {"Shoprite"};
private static String[] phoneItems = {"Acer","Alcatel", "Amazon","Apple","Blackberry","Dell",
"Google","Htc","Infinix","Iphone","Lg","Microsoft","Motorola","Nokia","Sagem",
"Samsung","Sharp","Sony","Tecno"};
private static String[] computerItems = {"Acer","Apple","Asus","BenQ","Compaq","Dell","Gateway","HP",
"Hewlett-Packard","Hewlett Packard","Hitachi","HTC","IBM","Intel","Lenovo","LG","LiteOn",
"Microsoft","Motorola","NEC","Oracle","Packard Bell","Panasonic","Samsung","Sharp","Sony",
"Toshiba"};
private static String[] electronicItems = {"Apple","Bosch","Dell","General Electronics","HP",
"Hewlett-Packard","Hewlett Packard","Hitachi","IBM","Intel","Lenovo","LG","LiteOn",
"Microsoft","Motorola","NEC","Oracle","Packard Bell","Panasonic","Samsung","Sharp","Sony",
"Toshiba"};
private static String[] fabricItems = {"Traditional","Wear","Suit","Shirt","Trouser", "Socks",
"Pant","Bra","Singlet","Boxers","Undies","Nighties","Sleeveless","Short Sleeve",
"Long Sleeve","Knicker","Shorts","Skirt","Wrapper","Underwear","Gown","Handkerchief","Tie",
"Denim","Jacket","Jeans","Chinos"};
private static String[] cosmeticItems = {"Powder","Foundation","Lipstick","Eye Pencil","Mascara","Wet Lips",
"Skin Care","Cream","Lotion","Hair Color","Dye","Hair Spray","Perfume","Nail Polish","Gel","Toiletories",
"Bath Oil","Bubble Bath","Make Up","Makeup","Make-Up","Waves","Contact Lens","Deodorant","Sanitizer",
"Bath Salt"};
private static String[] leatherJewelItems = {"Shoe","Handbag","Wallet","Ring","Necklace","Studs","Eye glasses",
"Sun glasses","Sun Shades","Cap","Wrist Watch","Earring","Bango","Bracelet","Anklet"};
private static String[] fastfoodItems = {};
private static String[] medItems = {};
private static String[] cinemaItems = {};
private static String[] sportsItems = {};
private static String[] shopriteItems = {"Chi-Exotic","Honeywell","Chicken","Wheat Meal","Flour",
"Yoghurt","Oil","French Fries","Milk","Tea","Oats","Sprite","Coke","Fanta","Soft Drinks","Coca Cola",
"Chicken Franks","Butter","Vita Milk","Teabags","Candy","Sweet","Biscuit","Crackers","Swan",
"Vegetables","Mixed Vegetables","Corn","Semolina","Sugar","Knorr","Ovaltine","Beverage","Short-Bread",
"Short Bread","Shortbread","Water","Juice","Spinach","Green Pea","Fish","Ice Cream","Corn Flakes",
"Cookies","Chocolate","Scones","Cake","Pasta","Sauce","Salad","Lettuce","Tomato","Mince","Pork",
"Roast","Boerewors","Roast","Apple","Peer","Grape","Plum","Baby Powder","Baby Cream","Baby Oil","Baby",
"Johnson's","Johnsons","Johnson","Pampers","Toothpaste","Diapers","Baby wipe","Soap","Hand Wash",
"Sporting Waves","Styling Gel","Shaving Powder","Mouthwash","Antiseptic","Body Spray","Aerosol",
"Body Wash","Hand Wash","Washing Powder","Surface Cleaner","Liquid Wash","Bath Cleaner","Toilet Cleaner",
"Glass Cleaner","Mirror Cleaner","Cleaner","Ciders","Wine","Rum","Brandy","Vodka","Irish Cream","Whisky",
"Beef","Roast","Steak","Pork","Lamb","Goat","Smoked Russians","Sausages"};
private static int searchIndex; // 1=phones,2=computers,3=electronics,4=fabrics,5=cosmetics,
// 6=leather,7=fastfood,8=med,9=cinema,10=sports,11=shoprite
Window(){
setSystemThemes();
setThemeNames();
setDBItems(items);
setCategories(category);
setData(desc);
infoBoard = new JTextArea(12,18);
infoBoard.setFont(new Font("Arial Narrow",4,11));
infoBoard.setBackground(Color.green);
infoBoard.setForeground(Color.black);
infoBoard.setEditable(false);
infoBoard.append("\n\nWelcome to Shoprite Item Finder!"
+ "\n\nThis window will display precise "
+ "\ndetails of your search items and "
+ "\nother important alerts."
+ "\nPlease enter the item you seek "
+ "\nin the search box above."
+ "\n\nWhy Pay More...");
infoPane = new JTabbedPane();
infoPane.add("Wall", infoBoard);
add(new JScrollPane(infoPane), BorderLayout.WEST);
homePane = new JTabbedPane();
HTMLPanel homePanel = new HTMLPanel("http://www.shoprite.com.ng");
homePanel.setToolTipText("http://www.shoprite.com.ng");
homePanel.show();
HTMLPanel specialPanel = new HTMLPanel("http://www.shoprite.com.ng/specials.html");
specialPanel.setToolTipText("http://www.shoprite.com.ng/specials.html");
specialPanel.show();
HTMLPanel storeLocatorPanel = new HTMLPanel("http://www.shoprite.com.ng/store-locator.html");
storeLocatorPanel.setToolTipText("http://www.shoprite.com.ng/store-locator.html");
storeLocatorPanel.show();
building.setToolTipText("Map of item location in Shoprite, Warri");
HTMLPanel newsletterPanel = new HTMLPanel("http://www.shoprite.com.ng/store-locator.html");
newsletterPanel.setToolTipText("http://www.shoprite.com.ng/store-locator.html");
newsletterPanel.show();
HTMLPanel obsPanel = new HTMLPanel("http://www.shoprite.com.ng/store-locator.html");
obsPanel.setToolTipText("http://www.shoprite.com.ng/store-locator.html");
obsPanel.show();
try {
homePane.addTab("Home", new ImageIcon(ImageIO.read(new File("C:/Shoprite/images/about_us_header.jpg")).getScaledInstance(20, 20, 10)), homePanel);
homePane.addTab("Specials", new ImageIcon(ImageIO.read(new File("C:/Shoprite/images/geographical spread.gif")).getScaledInstance(20, 20, 10)), specialPanel);
homePane.addTab("Find a Store", new ImageIcon(ImageIO.read(new File("C:/Shoprite/images/locator.png")).getScaledInstance(20, 20, 10)), storeLocatorPanel);
homePane.addTab("Find Item", new ImageIcon(ImageIO.read(new File("C:/Shoprite/images/locator.png")).getScaledInstance(20, 20, 10)), building);
homePane.addTab("Newsletter", new ImageIcon(ImageIO.read(new File("C:/Shoprite/images/newslettersignup_imagecard_1020x315.jpg")).getScaledInstance(20, 20, 10)), newsletterPanel);
homePane.addTab("Business Online", new ImageIcon(ImageIO.read(new File("C:/Shoprite/images/shoprite_holdings_logo.jpg")).getScaledInstance(20, 20, 10)), obsPanel);
} catch (IOException ex) {
homePane.add("Home", homePanel);
homePane.add("Specials", specialPanel);
homePane.add("Find a Store", storeLocatorPanel);
homePane.add("Find Item", building);
homePane.add("Newsletter", newsletterPanel);
homePane.add("Business Online", obsPanel);
}
add(homePane, BorderLayout.CENTER);
JPanel toolsPanel = new JPanel();
itemFinder = new JButton("Find an Item");
itemFinder.addActionListener(this);
itemFinder.setToolTipText("Start search");
toolsPanel.add(itemFinder);
JLabel blankSpace = new JLabel(" Categories: ");
blankSpace.setSize(getWidth()/5, 40);
toolsPanel.add(blankSpace);
categorySelector.setToolTipText("Search for items by their category");
categorySelector.addItem("Find Item by Category"); // Add drop-down title
for(String item : category) categorySelector.addItem(item);
categorySelector.addActionListener(this);
toolsPanel.add(categorySelector);
JPanel upperPanel = new JPanel();
upperPanel.setLayout(new GridLayout(1,0));
JPanel inputPanel = new JPanel();
inputPanel.setLayout(new GridLayout(0,1));
JLabel inputLabel = new JLabel("What are you buying today?");
inputLabel.setSize(getWidth()/5, getHeight()/5);
inputLabel.setLocation((this.getWidth())-5, this.getHeight()-69);
inputPane = new JTextField("Enter item to search for...");
inputPane.setSize(getWidth()/5, getHeight()/5);
inputPane.setLocation((this.getWidth())-5, this.getHeight()-69);
inputPane.addActionListener(this);
inputPane.setToolTipText("Input box for items to be searched for");
inputPanel.add(inputLabel, BorderLayout.NORTH);
inputPanel.add(inputPane, BorderLayout.SOUTH);
// Add upper panel content
upperPanel.add(inputPanel, BorderLayout.NORTH);
upperPanel.add(toolsPanel, BorderLayout.SOUTH);
add(upperPanel, BorderLayout.NORTH);
state = "Welcome Window"; // switch from default state to operational state
addMenu();
setLocation(200,50);
setPreferredSize(new Dimension(950,450));
setMinimumSize(new Dimension(900,450));
setMaximumSize(new Dimension(WIDTH, HEIGHT));
setTitle(appName);
try {
findAppInstallLoc("C:/", "Shoprite");
setIconImage(ImageIO.read(new File("C:/Shoprite/images/shoprite_logo_2.png")));
} catch (IOException ex) {
System.out.printf("Problem with machine icon loading...\n%1s\n", ex);
}
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pack();
setExtendedState(2);
setVisible(true);
}
private void setData(Map desc){
String entrance1 = " From Entrance 1:"+
"\nWalk in. Take left turn.";
String entrance2 = "\n\nFrom Entrance 2:"+
"\nWalk in. Take right turn.";
String end = "\nYou're there! ";
for (String shop : phoneShops) {
description = new ArrayList<String>();
if (shop.equalsIgnoreCase("airtel")) {
description.add(entrance1 +
"\nFirst store, by your left."+ end);
description.add(entrance2 +
"\nWalk down the hallway to Entrance 1."
+ "\nLast shop, on the right."+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("best mobile")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n4 stores after the Shoprite Superstore, on the right."
+ end);
description.add( entrance2 +
"\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n3 stores after the fastfood junction, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("fine brothers")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n7 stores after the Shoprite Superstore is the fastfood junction. Keep walking."
+ "\nFirst store after the fastfood junction, on the right."
+ end);
description.add( entrance2 +
"\n5 stores ahead, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("tecno")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n7 stores after the Shoprite Superstore is the fastfood junction. Keep walking."
+ "\n2 stores after the fastfood junction, on the right."
+ end);
description.add( entrance2 +
"\n4 stores ahead, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("etisalat")) {
description.add( entrance1
+ "\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\nFirst store after Shoprite Superstore, on the left."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n6 stores ahead, on the right."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("glo world")) {
description.add( entrance1
+ "\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n3 stores after Shoprite Superstore, on the left."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n4 stores ahead, on the right."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("lg")) {
description.add( entrance1
+ "\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n3 stores after the lavatory section, on the left."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore. Keep walking."
+ "\n3 stores ahead, on the right."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("pointek")) {
description.add( entrance1
+ "\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\nFirst store after the lavatory section, on the right."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore. Keep walking."
+ "\n5 stores ahead, on the left."
+ end);
desc.putIfAbsent(shop, description);
}
}
for (String shop : computerShops) {
description = new ArrayList<String>();
if (shop.equalsIgnoreCase("yudala")) {
description.add(entrance1
+ "\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\nFirst store after the lavatory section, on the right."
+ end);
description.add(entrance2
+ "\n3 stores ahead, on the right."+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("best mobile")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n4 stores after the Shoprite Superstore, on the right."
+ end);
description.add( entrance2 +
"\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n3 stores after the fastfood junction, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("lg")) {
description.add( entrance1
+ "\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n3 stores after the lavatory section, on the left."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore. Keep walking."
+ "\n3 stores ahead, on the right."
+ end);
desc.putIfAbsent(shop, description);
}
}
for (String shop : electronicShops) {
description = new ArrayList<String>();
if (shop.equalsIgnoreCase("marvel")) {
description.add( entrance1
+ "\n7 stores ahead, there is a curved bend. Keep walking."
+ "\nAt the curved bend, on the right."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore. Keep walking."
+ "\n6 stores after the Shoprite Superstore is the lavatory. Keep walking."
+ "\n4 stores ahead, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("fine brothers")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n7 stores after the Shoprite Superstore is the fastfood junction. Keep walking."
+ "\nFirst store after the fastfood junction, on the right."
+ end);
description.add( entrance2 +
"\n5 stores ahead, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("lg")) {
description.add( entrance1
+ "\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n3 stores after the lavatory section, on the left."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore. Keep walking."
+ "\n3 stores ahead, on the right."
+ end);
desc.putIfAbsent(shop, description);
}
}
for (String shop : fabricShops) {
description = new ArrayList<String>();
if (shop.equalsIgnoreCase("mrp")) {
description.add(entrance1
+ "\nLast stores ahead, on the right."+ end);
description.add("Shop Description:\nEntrance 2:"+
"\nWalk in. Take left turn."
+ "\nWalk down the hallway to Entrance 1."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("identity")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n2 stores after the lavatory, on the left."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore. Keep walking."
+ "\n4 stores ahead, on the right."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("truworths")) {
description.add( entrance1
+ "\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n5 stores after the curved bend, on the left."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore. Keep walking."
+ "\n6 stores after the Shoprite Superstore is the lavatory. Keep walking."
+ "\n5 stores ahead, on the right."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("button up")) {
description.add( entrance1
+ "\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n3 stores after the curved bend, on the right."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore. Keep walking."
+ "\n6 stores after the Shoprite Superstore is the lavatory. Keep walking."
+ "\nFirst stores after the lavatory, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("secret view lingerie")) {
description.add( entrance1
+ "\n7 stores ahead, there is a curved bend. Keep walking."
+ "\nAt the curved bend, on the right."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore. Keep walking."
+ "\n6 stores after the Shoprite Superstore is the lavatory. Keep walking."
+ "\n4 stores ahead, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("audacious")) {
description.add( entrance1
+ "\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n3 stores after the curved bend, on the left."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore. Keep walking."
+ "\n6 stores after the Shoprite Superstore is the lavatory. Keep walking."
+ "\nFirst stores after the lavatory, on the right."
+ end);
desc.putIfAbsent(shop, description);
}
}
for (String shop : cosmeticShops) {
description = new ArrayList<String>();
if (shop.equalsIgnoreCase("casabella")) {
description.add(entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n7 stores after the Shoprite Superstore is the fastfood junction. Keep walking."
+ "\n6 stores after Shoprite Superstore, on the right."
+ end);
description.add(entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\nFirst store after the fastfood junction, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("essenza")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n2 stores after Shoprite Superstore, on the right."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n5 stores after the fastfood junction, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("pink sky")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\nFirst store after Shoprite Superstore, on the right."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n6 stores after fastfood junction, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("montaigne")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n4 stores after the lavatory section, on the right."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore. Keep walking."
+ "\n2 stores after the Shoprite Superstore, on the left."
+ end);
desc.putIfAbsent(shop, description);
}
}
for (String shop : leatherJewelShops) {
description = new ArrayList<String>();
if (shop.equalsIgnoreCase("maybrand")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n7 stores after the Shoprite Superstore is the fastfood junction. Keep walking."
+ "\n5 stores after the fastfood junction, on the right."
+ end);
description.add( entrance2 +
"\nFirst store, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("kontessa")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n4 stores after the Shoprite Superstore, on the right."
+ end);
description.add( entrance2 +
"\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n3 stores after the fastfood junction, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("swatch")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n3 stores after the Shoprite Superstore, on the right."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n4 stores after fastfood junction, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("a! accessories")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n5 stores after the lavatory section, on the right."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore. Keep walking."
+ "\nFirst store after the Shoprite Superstore, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("diva")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n2 stores after the lavatory section, on the right."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore. Keep walking."
+ "\n4 stores after the Shoprite Superstore, on the left."
+ end);
desc.putIfAbsent(shop, description);
}
}
for (String shop : fastfoodShops) {
description = new ArrayList<String>();
if (shop.equalsIgnoreCase("kilmanjaro")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n7 stores after the Shoprite Superstore is the fastfood junction."
+ "\n3rd store in the fastfood cut-out, on the left."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction."
+ "\nFirst store in the fastfood cut-out, on the right."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("aroma")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n7 stores after the Shoprite Superstore is the fastfood junction."
+ "\n2nd (middle) store in the fastfood cut-out, on the left."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction."
+ "\n2nd (middle) store in the fastfood cut-out, on the right."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("chicken republic")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n7 stores after the Shoprite Superstore is the fastfood junction."
+ "\nFirst store in the fastfood cut-out, on the left."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction."
+ "\n3rd store in the fastfood cut-out, on the right."
+ end);
desc.putIfAbsent(shop, description);
}
}
for (String shop : medShops) {
description = new ArrayList<String>();
if (shop.equalsIgnoreCase("medplus")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n7 stores after the Shoprite Superstore is the fastfood junction. Keep walking."
+ "\n4 stores after the fastfood junction, on the right."
+ end);
description.add( entrance2 +
"\n2nd store, on the left."
+ end);
desc.putIfAbsent(shop, description);
} else if (shop.equalsIgnoreCase("nettpharmacy")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n3 stores after the lavatory section, on the right."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore. Keep walking."
+ "\n3 stores after the Shoprite Superstore, on the left."
+ end);
desc.putIfAbsent(shop, description);
}
}
for (String shop : cinemaShops) {
description = new ArrayList<String>();
if (shop.equalsIgnoreCase("genesis deluxe cinema")) {
description.add( entrance1 +
"\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore. Keep walking."
+ "\n7 stores after the Shoprite Superstore is the fastfood junction. Keep walking."
+ "\n3 stores after the fastfood junction, on the right, is the cinema cut-out."
+ end);
description.add( entrance2 +
"\n3rd store, on the left, is the cinema cut-out."
+ end);
desc.putIfAbsent(shop, description);
}
}
for (String shop : sportsShops) {
description = new ArrayList<String>();
if (shop.equalsIgnoreCase("sports world")) {
description.add( entrance1
+ "\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n2nd stores after the curved bend, on the left."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore. Keep walking."
+ "\n6 stores after the Shoprite Superstore is the lavatory. Keep walking."
+ "\n2nd store after the lavatory, on the right."
+ end);
desc.putIfAbsent(shop, description);
}
}
for (String shop : shopriteShops) {
description = new ArrayList<String>();
if (shop.equalsIgnoreCase("shoprite")) {
description.add( entrance1
+ "\n7 stores ahead, there is a curved bend. Keep walking."
+ "\n4 stores after the curved bend is the lavatory section. Keep walking."
+ "\n6 stores after the lavatory section is the Shoprite Superstore."
+ end);
description.add( entrance2
+ "\n6 stores ahead, there is the fastfood junction. Keep walking."
+ "\n7 stores after the fastfood junction is the Shoprite Superstore."
+ end);
desc.putIfAbsent(shop, description);
}
}
}
private void setCategories(ArrayList<String> category){
category.add("Phones and Tablets");
category.add("Home and Kitchen");
category.add("Beauty, Health and Personal Care");
category.add("Fashion");
category.add("Subscriptions");
category.add("Electronics");
category.add("Computer and Accessories");
category.add("Music and Movies");
category.add("Baby, Kids and Toys");
category.add("Sports and Fitness");
category.add("Books and Stationery");
category.add("Automotive and Industrial");
category.add("Drinks and Groceries");
category.add("Wholesale");
}
private void setThemeNames(){
theme.add("Early Dusk");
theme.add("Night Blues");
theme.add("Blue Haven");
theme.add("Royal Soul");
theme.add("Mettalic Hound");
}
private void setSystemThemes(){
Color[] theme1 = new Color[9], theme2 = new Color[9],
theme3 = new Color[9], theme4 = new Color[9], theme5 = new Color[9];
theme1[0] = Color.black;
theme1[1] = new Color(1.0f,1.0f,0.5f);
theme1[2] = Color.blue;
theme1[3] = Color.gray;
theme1[4] = Color.green;
theme1[5] = Color.white;
theme1[6] = Color.darkGray;
theme1[7] = Color.red;
theme1[8] = new Color(127,0,0); // brown labellings
themeColor.add(theme1);
theme2[0] = Color.black;
theme2[1] = Color.gray;
theme2[2] = Color.blue;
theme2[3] = Color.darkGray;
theme2[4] = Color.green;
theme2[5] = Color.white;
theme2[6] = Color.yellow;
theme2[7] = Color.red;
theme2[8] = Color.white; // white labellings
themeColor.add(theme2);
theme3[0] = Color.black;
theme3[1] = new Color(192,192,192); // ash-colored background
theme3[2] = Color.blue;
theme3[3] = Color.darkGray;
theme3[4] = Color.green; // green toilets
theme3[5] = Color.yellow;
theme3[6] = new Color(0.0f,0.8f,0.0f); // dark-green arrows
theme3[7] = Color.red;
theme3[8] = Color.white; // white labellings
themeColor.add(theme3);
theme4[0] = Color.black;
theme4[1] = Color.orange; // light-yellow background
theme4[2] = new Color(1.0f,0.0f,1.0f); // purple shops
theme4[3] = Color.darkGray;
theme4[4] = Color.green; // green toilets
theme4[5] = Color.yellow;
theme4[6] = new Color(0.4f,0.4f,1.0f); // light-blue arrows
theme4[7] = Color.red;
theme4[8] = new Color(127,255,255); // bluish-green labellings
themeColor.add(theme4);
theme5[0] = Color.cyan;
theme5[1] = Color.black; // black background
theme5[2] = Color.lightGray; // light-gray shops
theme5[3] = Color.darkGray;
theme5[4] = Color.blue; // blue toilets
theme5[5] = Color.white;
theme5[6] = Color.blue; // blue arrows
theme5[7] = Color.red;
theme5[8] = Color.white; // white labellings
themeColor.add(theme5);
}
private static void setFoneData(String[] ipad, String[] google, String[] microsoft,
String[] samsung, String[] sony, String[] others){
ipad[0]= "ipad mini 2";
ipad[1]= "ipad mini 4";
ipad[2]= "ipad pro";
ipad[3]= "ipad air 1";
ipad[4]= "ipad air 2";
google[0]= "google pixel c";
google[1]= "google nexus 7";
google[2]= "google nexus 9";
microsoft[0]= "microsoft surface pro 3";
microsoft[1]= "microsoft surface pro 4";
samsung[0]= "samsung galaxy tab s";
samsung[1]= "samsung galaxy tab s2";
sony[0]= "sony xperia z3";
sony[1]= "sony xperia z4";
others[0]= "dell venue 8 7000";
others[1]= "amazon fire hdx";
}
private static void setElectData(String[] electronics){
electronics[0] = "acer";
electronics[1] = "alcatel";
electronics[2] = "amazon";
electronics[3] = "apple";
electronics[4] = "bb";
electronics[5] = "dell";
electronics[6] = "google";
electronics[7] = "lg";
electronics[8] = "microsoft";
electronics[9] = "motorola";
electronics[10] = "nokia";
electronics[11] = "sagem";
electronics[12] = "samsung";
electronics[13] = "sharp";
electronics[14] = "sony";
electronics[15] = "tecno";
}
private static void setComputersData(String[] computers){
computers[0] = "acer";
computers[1] = "apple";
computers[2] = "asus";
computers[3] = "benq";
computers[4] = "compaq";
computers[5] = "gateway";
computers[6] = "hp";
computers[7] = "hitachi";
computers[8] = "htc";
computers[9] = "ibm";
computers[10] = "intel";
computers[11] = "lenovo";
computers[12] = "lg";
computers[13] = "liteon";
computers[14] = "microsoft";
computers[15] = "motorola";
computers[16] = "nec";
computers[17] = "oracle";
}
private static void setDBItems(ArrayList<String> items){
/* The various phones */
String[] ipad = new String[5], google = new String[3], microsoft = new String[2],
samsung = new String[2], sony = new String[2], others = new String[2],
electronics = new String[16], computers = new String[18];
setFoneData(ipad,google,microsoft,samsung,sony,others);
setElectData(electronics);
setComputersData(computers);
for (String item : ipad) items.add(item);
for (String item : google) items.add(item);
for (String item : microsoft) items.add(item);
for (String item : samsung) items.add(item);
for (String item : sony) items.add(item);
for (String item : others) items.add(item);
for (String item : electronics) items.add(item);
for (String item : computers) items.add(item);
for (String item : phoneItems) items.add(item);
for (String item : electronicItems) items.add(item);
for (String item : computerItems) items.add(item);
for (String item : fabricItems) items.add(item);
for (String item : cosmeticItems) items.add(item);
for (String item : leatherJewelItems) items.add(item);
for (String item : fastfoodItems) items.add(item);
for (String item : medItems) items.add(item);
for (String item : cinemaItems) items.add(item);
for (String item : sportsItems) items.add(item);
for (String item : shopriteItems) items.add(item);
for (int i=0; i<items.size(); i++){
String temp = items.get(i);
for (int j=i+1; j<items.size(); j++) if (temp.equalsIgnoreCase(items.get(j))) items.remove(j);
}
itm.putIfAbsent("Phones and Tablets", phoneItems);
itm.putIfAbsent("Electronics", electronicItems);
itm.putIfAbsent("Computer and Accessories", computerItems);
itm.putIfAbsent("Fashion", fabricItems);
itm.putIfAbsent("Beauty, Health and Personal Care", cosmeticItems);
itm.putIfAbsent("Fashion", leatherJewelItems);
itm.putIfAbsent("Drinks and Groceries", fastfoodItems);
itm.putIfAbsent("Beauty, Health and Personal Care", medItems);
itm.putIfAbsent("Music and Movies", cinemaItems);
itm.putIfAbsent("Sports and Fitness", sportsItems);
itm.putIfAbsent("Baby, Kids and Toys", shopriteItems);
itm.putIfAbsent("Phones and Tablet", ipad);
itm.putIfAbsent("Phones and Tablet", google);
itm.putIfAbsent("Phones and Tablet", microsoft);
itm.putIfAbsent("Phones and Tablet", samsung);
itm.putIfAbsent("Phones and Tablet", sony);
itm.putIfAbsent("Phones and Tablet", others);
itm.putIfAbsent("Phones and Tablet", electronics);
itm.putIfAbsent("Phones and Tablet", computers);
}
private static boolean equalStrings(String str1, String str2){
String temp1="", temp2="";
for (int i=0; i<str1.length(); i++) if (str1.charAt(i)!=' ') temp1+=str1.charAt(i);
for (int i=0; i<str2.length(); i++) if (str2.charAt(i)!=' ') temp2+=str2.charAt(i);
if (temp1.equalsIgnoreCase(temp2)) return true;
return false;
}
@Override
public void actionPerformed(ActionEvent evt){
String action = evt.getActionCommand();
if (evt.getSource()==inputPane || evt.getSource()==itemFinder){
if (!(inputPane.getText().contains("item to search for...")||inputPane.getText()==""
||inputPane.getText().contains("successful")||inputPane.getText().contains("unsuccessful"))){
userInput = inputPane.getText().trim();
boolean itemFound = false;
for (String item : items) if (userInput.equalsIgnoreCase(item)||equalStrings(userInput,item)) {
itemFound = true; break;
}
if (itemFound) {
inputPane.setText("Search for "+inputPane.getText().toUpperCase()+" successful!");
displayLocation(inputPane.getText(), infoBoard);
} else if (!inputPane.getText().equals("")) {
inputPane.setText("Search for "+inputPane.getText().toUpperCase()+" unsuccessful...");
infoBoard.setText("\n\nThe item you searched for, \""+userInput+"\", "
+ "\nwas not found in our database!\n\nSuggestions:\n");
for (String item : items) if (item.contains(userInput)||userInput.contains(item)) {
infoBoard.append(item+"\n");
}
}
} else if (!inputPane.getText().equals("")) {
inputPane.setText("");
}
state = "Find Item";
return;
}
switch(action){
case "Early Dusk":{
THEME = 0;
break;
}
case "Night Blues":{
THEME = 1;
break;
}
case "Blue Haven":{
THEME = 2;
break;
}
case "Royal Soul":{
THEME = 3;
break;
}
case "Mettalic Hound":{
THEME = 4;
break;
}
case "Zoom+ Ctrl+]":{
if(SCALE<2) SCALE++;
break;
}
case "Zoom- Ctrl+[":{
if(SCALE>1) SCALE--;
break;
}
case "New Ctrl+F4":{
createAndShowGUI();
dispose();
break;
}
case "Exit Alt+F4":{
state = null; // change app state to non-operational state
System.exit(0);
break;
}
}
repaint();
}
private void displayLocation(String inputText, JTextArea infoBoard) {
if (inputText.contains("bb")||inputText.contains("Bb")||inputText.contains("BB")){
infoBoard.append("Your Blackberry phone is available at:\n\n");
for (String str : phoneShops) infoBoard.append(str.toUpperCase()+"\n\n***\n"+desc.get(str)+"\n***\n\n");