D:\NewZebra\JavaApplications\DesignPatternsProject\src\behavior_patterns\command_pattern_nested_menu\DummyObject.java
 1 /* 
 2  * DummyObject.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 
27 import java.text.*;
28 import java.util.*;
29 import java.awt.event.*;
30 import java.awt.*;
31 import javax.swing.*;
32 
33 
34 public class DummyObject implements Command {
35     
36     /** Creates a new instance of DummyObject */
37     public DummyObject() {
38     }
39     /*
40      *
41      */
42     public void execute(CommandPanel passedCommandPanel){
43         if(passedCommandPanel != null) {
44             passedCommandPanel.removeAll();
45             passedCommandPanel.setBackground(Color.red);
46             //--------------------------------------------
47             JLabel aJLabel = new JLabel("DummyObject");
48             aJLabel.setFont(new Font("TimesRoman", Font.BOLD, 20));
49             aJLabel.setBounds(200, 200, 250,30);
50             aJLabel.setForeground(Color.black);
51             passedCommandPanel.add(aJLabel);            
52         }
53         else
54             reportError();
55     }
56     /*
57      *
58      */
59     public void reportError(){
60             JOptionPane.showMessageDialog(null, "DummyObject ", "Field Error", JOptionPane.ERROR_MESSAGE);        
61     }
62 }
63 
64