D:\NewZebra\JavaApplications\DesignPatternsProject\src\behavior_patterns\command_pattern_nested_menu\CommandPanel.java
  1 /*
  2  * CommandPanel.java
  3  *
  4  * Disclaimer:
  5  * ZebraSoft.com disclaims all warrantees with regard to documents/programs, including 
  6  * all implied warranties. In no event shall ZebraSoft.com be liable for indirect or 
  7  * consequential damages or any damages whatsoever resulting from loss of use, data or 
  8  * profits arising out of the use of documents/programs.
  9  * 
 10  * All content included on this site, such as text, graphics, logos, button icons, 
 11  * images, audio clips, video clips, digital downloads, programs, data compilations, 
 12  * and software, is the property of ZebraSoft.com or its content suppliers and 
 13  * protected by United States and international copyright laws. 
 14  *
 15  * This site or any portion of this site may not be reproduced, duplicated, 
 16  * copied, sold, resold, visited, or otherwise exploited for any commercial 
 17  * purpose without express written consent of ZebraSoft.com.
 18  */
 19 
 20 package behavior_patterns.command_pattern_nested_menu;
 21 
 22 /**
 23  *
 24  * @author Sam Eldin
 25  */
 26 import java.text.*;
 27 import java.util.*;
 28 import java.awt.event.*;
 29 import java.awt.*;
 30 import javax.swing.*;
 31 
 32 public class CommandPanel extends JPanel{
 33     
 34     final String        DISABLE_OPTION         = "Disable"; 
 35     final String        NOT_APPLICABLE_OPTION  = "NA"; 
 36     final String        NESTED_OPTION          = "Nested"; 
 37     final String        SKIP_OPTION            = "Skip"; 
 38     //=========================================    
 39     final int           NAME_INDEX             = 0; 
 40     final int           NESTING_OPTION_INDEX   = 1; 
 41     //=========================================    
 42     //=========================================  
 43     // index for nest menu-items
 44     // nemu         = hundreds (100)
 45     // menu-item    = tens (10)
 46     // sub-menu-item = ones (1..9)
 47     final static int    MENU1_INDEX             = 100; 
 48     final static int    MENU2_INDEX             = 200; 
 49     final static int    MENU3_INDEX             = 300; 
 50     public  String [] mainMenuListingArray  // main menu
 51         = {
 52              "One",
 53              "Two",
 54              "Three"
 55           };
 56     //=========================================    
 57     final static int    MENU1_ITEM1_INDEX             = 110; 
 58     final static int    MENU1_ITEM2_INDEX             = 120; 
 59     final static int    MENU1_ITEM3_INDEX             = 130; 
 60     public static String [][] menuOneListingArray  // One_Items
 61         = {
 62             {"One_Item_1",  "NA"},
 63             {"One_Item_2",  "NA"},
 64             {"One_Item_3",  "NA"}
 65           };       
 66     final static int    MENU2_ITEM1_INDEX             = 210; 
 67     final static int    MENU2_ITEM2_INDEX             = 220; 
 68     final static int    MENU2_ITEM3_INDEX             = 230; 
 69     public static String [][] menuTwoListingArray  // Two_Items
 70         = {
 71             {"Two_Nested_type_1",  "Nested"},
 72             {"Two_Item_2",  "NA"},
 73             {"Two_Nested_Type_2",  "NA"}
 74           };
 75     final static int    MENU3_ITEM1_INDEX             = 310; 
 76     final static int    MENU3_ITEM2_INDEX             = 320; 
 77     final static int    MENU3_ITEM3_INDEX             = 330; 
 78     public static String [][] menuThreeListingArray  // Three_Items
 79         = {
 80             {"Three_Item_1",  "Disable"},
 81             {"Three_Item_2",  "NA"},
 82             {"Three_Item_3",  "Skip"}
 83           };
 84     //=========================================    
 85     final static int    MENU2_ITEM1_SUB1__INDEX             = 211; 
 86     final static int    MENU2_ITEM1_SUB2__INDEX             = 212; 
 87     final static int    MENU2_ITEM1_SUB3__INDEX             = 213; 
 88     public static String [][] menuTwoSubItem_1_ListingArray  // SubTwoMenu-_Items_1
 89         = {
 90             {"Two_Item_1_1",  "NA"},
 91             {"Two_Item_1_2",  "NA"},
 92             {"Two_Item_1_3",  "NA"}
 93           };
 94     final static int    MENU2_ITEM3_SUB1__INDEX             = 231; 
 95     final static int    MENU2_ITEM3_SUB2__INDEX             = 232; 
 96     final static int    MENU2_ITEM3_SUB3__INDEX             = 233; 
 97     public static String [][] menuTwoSubItem_3_ListingArray  // SubTwoMenu-_Items_3
 98         = {
 99             {"Two_Item_3_1",  "NA"},
100             {"Two_Item_3_2",  "NA"},
101             {"Two_Item_3_3",  "NA"}
102           };
103           
104     /** Creates a new instance of CommandPanel */
105     public CommandPanel() {
106     }
107 }
108 
109