Source Code Cross Referenced for BasicSQLViewFactory.java in  » IDE-Netbeans » etl.project » org » netbeans » modules » sql » framework » ui » view » graph » 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 » IDE Netbeans » etl.project » org.netbeans.modules.sql.framework.ui.view.graph 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.netbeans.modules.sql.framework.ui.view.graph;
002:
003:        import java.util.ArrayList;
004:        import java.util.List;
005:
006:        import javax.swing.undo.UndoManager;
007:
008:        import org.netbeans.modules.sql.framework.ui.graph.IGraphController;
009:        import org.netbeans.modules.sql.framework.ui.graph.IGraphView;
010:        import org.netbeans.modules.sql.framework.ui.graph.IOperatorXmlInfoModel;
011:        import org.netbeans.modules.sql.framework.ui.graph.IToolBar;
012:        import org.netbeans.modules.sql.framework.ui.graph.actions.AutoLayoutAction;
013:        import org.netbeans.modules.sql.framework.ui.graph.actions.CollapseAllAction;
014:        import org.netbeans.modules.sql.framework.ui.graph.actions.ExpandAllAction;
015:        import org.netbeans.modules.sql.framework.ui.graph.actions.GraphAction;
016:        import org.netbeans.modules.sql.framework.ui.graph.actions.ZoomAction;
017:        import org.netbeans.modules.sql.framework.ui.graph.impl.OperatorXmlInfoModel;
018:        import org.netbeans.modules.sql.framework.ui.graph.view.impl.SQLToolBar;
019:        import org.netbeans.modules.sql.framework.ui.model.SQLUIModel;
020:        import org.netbeans.modules.sql.framework.ui.undo.SQLUndoManager;
021:        import org.netbeans.modules.sql.framework.ui.view.IGraphViewContainer;
022:
023:        public final class BasicSQLViewFactory extends AbstractSQLViewFactory {
024:            private IOperatorXmlInfoModel operatorModel;
025:            private SQLUIModel sqlModel;
026:            private IGraphViewContainer gViewContainer;
027:            private IGraphView gView;
028:            private IToolBar toolBar;
029:            private List graphActions;
030:            private List toolBarActions;
031:
032:            public BasicSQLViewFactory(SQLUIModel model,
033:                    IGraphViewContainer gContainer, List gActions, List tActions) {
034:                this .sqlModel = model;
035:                this .gViewContainer = gContainer;
036:                this .graphActions = gActions;
037:                this .toolBarActions = tActions;
038:
039:                // This has to be created only once
040:                operatorModel = OperatorXmlInfoModel
041:                        .getInstance(this .gViewContainer.getOperatorFolder());
042:                this .toolbarType = IOperatorXmlInfoModel.CATEGORY_TRANSFORM;
043:                super .setUp();
044:            }
045:
046:            /**
047:             * create a graph view
048:             * 
049:             * @return graph view
050:             */
051:            public IGraphView createGraphView() {
052:                SQLGraphView gv = new SQLGraphView();
053:                this .gView = gv;
054:                BasicGraphFactory graphFactory = new BasicGraphFactory(
055:                        this .gViewContainer.getOperatorFolder());
056:                gv.setGraphFactory(graphFactory);
057:                //set up model
058:                sqlModel.addSQLDataListener(gv);
059:
060:                UndoManager undoManager = sqlModel.getUndoManager();
061:                if (undoManager instanceof  SQLUndoManager) {
062:                    ((SQLUndoManager) undoManager).addUndoableEditListener(gv);
063:                }
064:
065:                return gv;
066:            }
067:
068:            /**
069:             * create a tool bar
070:             * 
071:             * @return tool bar
072:             */
073:            // XXX: Already created in Editor Multiview Element 
074:            public IToolBar createToolBar() {
075:                if (toolBar == null) {
076:                    toolBar = new SQLToolBar(this );
077:                }
078:                return toolBar;
079:            }
080:
081:            /**
082:             * create a graph controller
083:             * 
084:             * @return
085:             */
086:            public IGraphController createGraphController() {
087:                IGraphController graphController = new BasicSQLGraphController();
088:                return graphController;
089:            }
090:
091:            /**
092:             * get sql model
093:             * 
094:             * @return sql model
095:             */
096:            public SQLUIModel getSQLModel() {
097:                return this .sqlModel;
098:            }
099:
100:            /**
101:             * get graph view container
102:             * 
103:             * @return graph view container
104:             */
105:            public Object getGraphViewContainer() {
106:                return this .gViewContainer;
107:            }
108:
109:            /**
110:             * get graph view pop up actions
111:             * 
112:             * @return actions
113:             */
114:            public List getGraphActions() {
115:                if (graphActions != null) {
116:                    return graphActions;
117:                }
118:                ArrayList actions = new ArrayList();
119:                //While right clicking
120:                /*actions.add(SystemAction.get(UndoAction.class));
121:                actions.add(SystemAction.get(RedoAction.class));*/
122:                //actions.add(GraphAction.getAction(PrintAction.class));
123:                return actions;
124:            }
125:
126:            /**
127:             * return toolbar actions
128:             * 
129:             * @return toolbar actions
130:             */
131:            public List getToolBarActions() {
132:                if (toolBarActions != null) {
133:                    return toolBarActions;
134:                }
135:
136:                ArrayList actions = new ArrayList();
137:
138:                //Commented the snippet for undo,redo fix
139:
140:                //undo action are not static (because they are used in condition builder also)
141:                // so we create it using constructor
142:                /* UndoAction undoAction = new UndoAction();
143:                RedoAction redoAction = new RedoAction();
144:
145:                //undo redo action should not about each other so they can enable/disable each
146:                // other
147:                undoAction.setRedoAction(redoAction);
148:                redoAction.setUndoAction(undoAction);
149:                actions.add(undoAction);
150:                actions.add(redoAction);
151:                actions.add(null);*/
152:                actions.add(GraphAction.getAction(ExpandAllAction.class));
153:                actions.add(GraphAction.getAction(CollapseAllAction.class));
154:                actions.add(GraphAction.getAction(AutoLayoutAction.class));
155:                //actions.add(GraphAction.getAction(PrintAction.class));
156:                actions.add(GraphAction.getAction(ZoomAction.class));
157:
158:                return actions;
159:            }
160:
161:            /**
162:             * get operator xml info model which is defined in netbeans layer.xml file
163:             * 
164:             * @return operator xml info model
165:             */
166:            public IOperatorXmlInfoModel getOperatorXmlInfoModel() {
167:                return operatorModel;
168:            }
169:
170:            /**
171:             * Gets operator view (toolbar) currently associated with this manager.
172:             * 
173:             * @return current instance of IToolBar
174:             */
175:            public IToolBar getOperatorView() {
176:                return toolBar;
177:            }
178:
179:            /**
180:             * Gets graph view currently associated with this manager.
181:             * 
182:             * @return current instance of IGraphView
183:             */
184:            public IGraphView getGraphView() {
185:                return gView;
186:            }
187:        }
w___ww._j_a__va_2__s__.___com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.