Source Code Cross Referenced for ActionMediator.java in  » Development » Tracelog » net » sourceforge » tracelog » ui » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » Tracelog » net.sourceforge.tracelog.ui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package net.sourceforge.tracelog.ui;
002:
003:        import org.eclipse.swt.widgets.Label;
004:
005:        public class ActionMediator implements  IMediator {
006:            // private static Logger log = Logger.getLogger(ActionMediator.class);
007:
008:            public static final int EVENT_CLEAR_ALL_GROUP_LOGS = 1;
009:            public static final int EVENT_DECREASE_FONT_SIZE = 2;
010:            public static final int EVENT_DISPLAY_ABOUT = 3;
011:            public static final int EVENT_DISPLAY_CHANGE_HISTORY = 4;
012:            public static final int EVENT_DISPLAY_COLOR_CHOOSER = 5;
013:            public static final int EVENT_DISPLAY_MAIN_SHELL = 6;
014:            public static final int EVENT_DISPLAY_OPTIONS = 7;
015:            public static final int EVENT_INCREASE_FONT_SIZE = 8;
016:            public static final int EVENT_REDRAW_LOG_VIEWERS = 9;
017:            public static final int EVENT_START_STOP_ALL_GROUP_LOGS = 10;
018:            public static final int EVENT_UPDATE_GLOBAL_START_STOP_ICON = 11;
019:            public static final int EVENT_UPDATE_LOG_SIZE_HANDLER = 12;
020:
021:            private ShellAbout shellAbout;
022:            private ShellHistory shellHistory;
023:            private ShellMain shellMain;
024:            private ShellMainButtonBar shellMainButtonBar;
025:            private ShellMainLogViewer shellMainLogViewer;
026:            private ShellOption shellOption;
027:            private ShellOptionLogFile shellOptionLogConfig;
028:            private ShellOptionLogFileColorChooser shellOptionLogConfigColorChooser;
029:
030:            ActionMediator() {
031:            }
032:
033:            public void handleEvent(int event) {
034:                switch (event) {
035:                case EVENT_DISPLAY_OPTIONS:
036:                    displayOptionShell();
037:                    break;
038:                case EVENT_DISPLAY_CHANGE_HISTORY:
039:                    displayChangeHistory();
040:                    break;
041:                case EVENT_DISPLAY_ABOUT:
042:                    displayAbout();
043:                    break;
044:                case EVENT_DISPLAY_MAIN_SHELL:
045:                    displayMainShell();
046:                    break;
047:                case EVENT_DISPLAY_COLOR_CHOOSER:
048:                    displayColorChooser();
049:                    break;
050:                case EVENT_UPDATE_LOG_SIZE_HANDLER:
051:                    updateLogSizeHandler();
052:                    break;
053:                case EVENT_INCREASE_FONT_SIZE:
054:                    increaseFontSize();
055:                    break;
056:                case EVENT_DECREASE_FONT_SIZE:
057:                    decreaseFontSize();
058:                    break;
059:                case EVENT_REDRAW_LOG_VIEWERS:
060:                    redrawLogViewers();
061:                    break;
062:                case EVENT_START_STOP_ALL_GROUP_LOGS:
063:                    startStopAllGroupLogs();
064:                    break;
065:                case EVENT_UPDATE_GLOBAL_START_STOP_ICON:
066:                    updateGlobalStartStopIcon();
067:                    break;
068:                case EVENT_CLEAR_ALL_GROUP_LOGS:
069:                    clearAllGroupLogs();
070:                    break;
071:                default:
072:                    break;
073:                }
074:            }
075:
076:            public void register(AbstractWidget widget) {
077:                if (widget instanceof  ShellOptionLogFileColorChooser) {
078:                    shellOptionLogConfigColorChooser = (ShellOptionLogFileColorChooser) widget;
079:                } else if (widget instanceof  ShellMain) {
080:                    shellMain = (ShellMain) widget;
081:                } else if (widget instanceof  ShellAbout) {
082:                    shellAbout = (ShellAbout) widget;
083:                } else if (widget instanceof  ShellHistory) {
084:                    shellHistory = (ShellHistory) widget;
085:                } else if (widget instanceof  ShellOptionLogFile) {
086:                    shellOptionLogConfig = (ShellOptionLogFile) widget;
087:                } else if (widget instanceof  ShellMainLogViewer) {
088:                    shellMainLogViewer = (ShellMainLogViewer) widget;
089:                } else if (widget instanceof  ShellMainMenuBar) {
090:                } else if (widget instanceof  ShellMainButtonBar) {
091:                    shellMainButtonBar = (ShellMainButtonBar) widget;
092:                } else if (widget instanceof  ShellOption) {
093:                    shellOption = (ShellOption) widget;
094:                }
095:            }
096:
097:            private void clearAllGroupLogs() {
098:                shellMainLogViewer.clearAllGroupLogs();
099:            }
100:
101:            private void decreaseFontSize() {
102:                shellMainLogViewer.decreaseLogFont();
103:            }
104:
105:            private void displayAbout() {
106:                shellAbout.run();
107:            }
108:
109:            private void displayChangeHistory() {
110:                shellHistory.run();
111:            }
112:
113:            private void displayColorChooser() {
114:                Label text = shellOptionLogConfig.getColorSelection();
115:                shellOptionLogConfigColorChooser.displayColorChooser(text);
116:            }
117:
118:            private void displayMainShell() {
119:                shellMain.run();
120:            }
121:
122:            private void displayOptionShell() {
123:                shellOption.run();
124:            }
125:
126:            private void increaseFontSize() {
127:                shellMainLogViewer.increaseLogFont();
128:            }
129:
130:            private void redrawLogViewers() {
131:                shellMainLogViewer.destroy();
132:                shellMain.createLogViewer();
133:                shellMainButtonBar.resetStartStopButton();
134:            }
135:
136:            private void startStopAllGroupLogs() {
137:                boolean toStopAllGroupLogs = shellMainButtonBar
138:                        .toStopAllGroupLogs();
139:                shellMainLogViewer
140:                        .toggleStartStopAllGroupLogs(toStopAllGroupLogs);
141:            }
142:
143:            private void updateGlobalStartStopIcon() {
144:                boolean showStartState = shellMainLogViewer.allLogsStopped();
145:                shellMainButtonBar.setupStartStopLogButton(showStartState);
146:            }
147:
148:            private void updateLogSizeHandler() {
149:                int lineThreshold = shellMainButtonBar.getLineThreshold();
150:                int purgePercentage = shellMainButtonBar.getPurgePercentage();
151:                shellMainLogViewer.updateAllLogSizeHandlers(purgePercentage,
152:                        lineThreshold);
153:            }
154:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.