Source Code Cross Referenced for ToggledCVSView.java in  » Source-Control » gruntspud » gruntspud » ui » view » 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 » Source Control » gruntspud » gruntspud.ui.view 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Gruntspud
003:         *
004:         *  Copyright (C) 2002 Brett Smith.
005:         *
006:         *  Written by: Brett Smith <t_magicthize@users.sourceforge.net>
007:         *
008:         *  This program is free software; you can redistribute it and/or
009:         *  modify it under the terms of the GNU Library General Public License
010:         *  as published by the Free Software Foundation; either version 2 of
011:         *  the License, or (at your option) any later version.
012:         *  This program is distributed in the hope that it will be useful,
013:         *  but WITHOUT ANY WARRANTY; without even the implied warranty of
014:         *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
015:         *  GNU Library General Public License for more details.
016:         *
017:         *  You should have received a copy of the GNU Library General Public
018:         *  License along with this program; if not, write to the Free Software
019:         *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
020:         */
021:
022:        package gruntspud.ui.view;
023:
024:        import gruntspud.CVSFileNode;
025:        import gruntspud.Constants;
026:        import gruntspud.GruntspudContext;
027:        import gruntspud.SortCriteria;
028:
029:        import javax.swing.Icon;
030:        import javax.swing.JComponent;
031:
032:        /**
033:         *  Description of the Class
034:         *
035:         *@author     magicthize
036:         *@created    26 May 2002
037:         */
038:        public class ToggledCVSView extends AbstractCVSView implements 
039:                CompoundView {
040:            //
041:            private boolean flat;
042:            private FlatCVSView flatView;
043:            private FileCVSView fileView;
044:            private SortCriteria flatSortCriteria;
045:            private SortCriteria fileSortCriteria;
046:            private GruntspudContext context;
047:
048:            /**
049:             * Creates a new ToggledCVSView object.
050:             *
051:             * @param context DOCUMENT ME!
052:             * @param fileSortCriteria DOCUMENT ME!
053:             * @param flatSortCriteria DOCUMENT ME!
054:             * @param fileTextMask DOCUMENT ME!
055:             * @param flatTextMask DOCUMENT ME!
056:             */
057:            public ToggledCVSView(GruntspudContext context,
058:                    SortCriteria fileSortCriteria,
059:                    SortCriteria flatSortCriteria, String fileTextMask,
060:                    String flatTextMask) {
061:                super ("Toggled", null, "Toggled");
062:
063:                this .context = context;
064:
065:                flatView = new FlatCVSView(flatSortCriteria, flatTextMask);
066:                fileView = new FileCVSView(fileSortCriteria,
067:                        Constants.FILE_TABLE_GEOMETRY, fileTextMask);
068:                flat = false;
069:            }
070:
071:            /**
072:             * DOCUMENT ME!
073:             *
074:             * @param view DOCUMENT ME!
075:             */
076:            public void setSelectedView(View view) {
077:            }
078:
079:            /**
080:             * DOCUMENT ME!
081:             *
082:             * @return DOCUMENT ME!
083:             */
084:            public int getViewCount() {
085:                return 2;
086:            }
087:
088:            /**
089:             * DOCUMENT ME!
090:             *
091:             * @param node DOCUMENT ME!
092:             */
093:            public void refilterAndResort() {
094:                fileView.refilterAndResort();
095:                flatView.refilterAndResort();
096:            }
097:
098:            /**
099:             * DOCUMENT ME!
100:             *
101:             * @param v DOCUMENT ME!
102:             *
103:             * @return DOCUMENT ME!
104:             */
105:            public View getView(int v) {
106:                return (v == 0) ? fileView : ((v == 1) ? flatView : null);
107:            }
108:
109:            /**
110:             * DOCUMENT ME!
111:             *
112:             * @param view DOCUMENT ME!
113:             *
114:             * @return DOCUMENT ME!
115:             */
116:            public boolean containsView(View view) {
117:                return (view == flatView) || (view == fileView);
118:            }
119:
120:            /**
121:             * DOCUMENT ME!
122:             *
123:             * @param view DOCUMENT ME!
124:             *
125:             * @return DOCUMENT ME!
126:             */
127:            public boolean isViewVisible(View view) {
128:                return ((view == flatView) && flat)
129:                        || ((view == fileView) && !flat);
130:            }
131:
132:            /**
133:             * DOCUMENT ME!
134:             *
135:             * @param name DOCUMENT ME!
136:             *
137:             * @return DOCUMENT ME!
138:             */
139:            public boolean containsView(String name) {
140:                View v = getView(name);
141:
142:                return v != null;
143:            }
144:
145:            /**
146:             * DOCUMENT ME!
147:             *
148:             * @param view DOCUMENT ME!
149:             *
150:             * @return DOCUMENT ME!
151:             */
152:            public View getView(String view) {
153:                if (view.equals(flatView.getViewName())) {
154:                    return flatView;
155:                }
156:
157:                if (view.equals(fileView.getViewName())) {
158:                    return fileView;
159:                }
160:
161:                return null;
162:            }
163:
164:            /**
165:             * DOCUMENT ME!
166:             *
167:             * @param l DOCUMENT ME!
168:             */
169:            public void addViewListener(ViewListener l) {
170:                super .addViewListener(l);
171:                flatView.addViewListener(l);
172:                fileView.addViewListener(l);
173:            }
174:
175:            /**
176:             * DOCUMENT ME!
177:             *
178:             * @param l DOCUMENT ME!
179:             */
180:            public void removeViewListener(ViewListener l) {
181:                super .removeViewListener(l);
182:                flatView.removeViewListener(l);
183:                fileView.removeViewListener(l);
184:            }
185:
186:            /**
187:             * DOCUMENT ME!
188:             */
189:            public void toggleFlatMode() {
190:                viewDeselected();
191:                flat = !flat;
192:                viewSelected();
193:                fireViewEvent(new ViewEvent(this , ViewEvent.VIEW_CHANGED, true));
194:            }
195:
196:            /**
197:             * DOCUMENT ME!
198:             *
199:             * @param manager DOCUMENT ME!
200:             */
201:            public void start(ViewManager manager) {
202:                super .start(manager);
203:                flatView.start(manager);
204:                fileView.start(manager);
205:            }
206:
207:            /**
208:             * DOCUMENT ME!
209:             */
210:            public void stop() {
211:                flatView.stop();
212:                fileView.stop();
213:            }
214:
215:            private AbstractCVSView getVisibleView() {
216:                return flat ? flatView : fileView;
217:            }
218:
219:            /**
220:             * DOCUMENT ME!
221:             *
222:             * @return DOCUMENT ME!
223:             */
224:            public String getViewToolTipText() {
225:                return getVisibleView().getViewToolTipText();
226:            }
227:
228:            /**
229:             * DOCUMENT ME!
230:             *
231:             * @return DOCUMENT ME!
232:             */
233:            public JComponent getViewComponent() {
234:                return getVisibleView().getViewComponent();
235:            }
236:
237:            /**
238:             * DOCUMENT ME!
239:             *
240:             * @return DOCUMENT ME!
241:             */
242:            public String getViewName() {
243:                return getVisibleView().getViewName();
244:            }
245:
246:            /**
247:             * DOCUMENT ME!
248:             *
249:             * @return DOCUMENT ME!
250:             */
251:            public Icon getViewIcon() {
252:                return getVisibleView().getViewIcon();
253:            }
254:
255:            /**
256:             * DOCUMENT ME!
257:             *
258:             * @return DOCUMENT ME!
259:             */
260:            public boolean canClose() {
261:                return (((flatView == null) || ((flatView != null) && flatView
262:                        .canClose())) && ((fileView == null) || ((fileView != null) && fileView
263:                        .canClose())));
264:            }
265:
266:            /**
267:             * DOCUMENT ME!
268:             *
269:             * @return DOCUMENT ME!
270:             */
271:            public boolean closing() {
272:                return (((flatView == null) || ((flatView != null) && flatView
273:                        .closing())) && ((fileView == null) || ((fileView != null) && fileView
274:                        .closing())));
275:            }
276:
277:            /**
278:             * DOCUMENT ME!
279:             *
280:             * @param node DOCUMENT ME!
281:             */
282:            public void reload(CVSFileNode node) {
283:                fileView.reload(node);
284:                flatView.reload(node);
285:            }
286:
287:            /**
288:             * DOCUMENT ME!
289:             *
290:             * @param node DOCUMENT ME!
291:             */
292:            public void setRootNode(CVSFileNode node) {
293:                fileView.setRootNode(node);
294:                flatView.setRootNode(node);
295:            }
296:
297:            /**
298:             * DOCUMENT ME!
299:             *
300:             * @param cwdNode DOCUMENT ME!
301:             */
302:            public void setCWDNode(CVSFileNode cwdNode) {
303:                fileView.setCWDNode(cwdNode);
304:                flatView.setCWDNode(cwdNode);
305:            }
306:
307:            /**
308:             * DOCUMENT ME!
309:             *
310:             * @return DOCUMENT ME!
311:             */
312:            public CVSFileNode getCWDNode() {
313:                return getVisibleView().getCWDNode();
314:            }
315:
316:            /**
317:             * DOCUMENT ME!
318:             *
319:             * @param nodes DOCUMENT ME!
320:             */
321:            public void setSelectedNodes(CVSFileNode[] nodes) {
322:                fileView.setSelectedNodes(nodes);
323:                flatView.setSelectedNodes(nodes);
324:            }
325:
326:            /**
327:             * DOCUMENT ME!
328:             *
329:             * @param nodes DOCUMENT ME!
330:             */
331:            public void updateNode(CVSFileNode node) {
332:                fileView.updateNode(node);
333:                flatView.updateNode(node);
334:            }
335:
336:            /**
337:             * DOCUMENT ME!
338:             */
339:            public void viewDeselected() {
340:                getVisibleView().viewDeselected();
341:            }
342:
343:            /**
344:             * DOCUMENT ME!
345:             */
346:            public void viewSelected() {
347:                getVisibleView().viewSelected();
348:            }
349:
350:            /**
351:             * DOCUMENT ME!
352:             *
353:             * @return DOCUMENT ME!
354:             */
355:            public CVSFileNode[] getSelectedNodes() {
356:                return getVisibleView().getSelectedNodes();
357:            }
358:
359:            public void viewEventNotify(ViewEvent evt) {
360:                super .viewEventNotify(evt);
361:                fileView.viewEventNotify(evt);
362:                flatView.viewEventNotify(evt);
363:            }
364:
365:            public boolean isFlatMode() {
366:                return flat;
367:            }
368:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.