Source Code Cross Referenced for VisualiserPalette.java in  » XML-UI » xui32 » com » xoetrope » editor » netbeans » visualizer » 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 » XML UI » xui32 » com.xoetrope.editor.netbeans.visualizer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.xoetrope.editor.netbeans.visualizer;
002:
003:        import com.xoetrope.carousel.visualizer.VisualiserContainer;
004:        import com.xoetrope.carousel.visualizer.VisualiserProxy;
005:        import com.xoetrope.data.pojo.XPojoModelEx;
006:        import java.util.Observable;
007:        import java.util.Observer;
008:        import java.util.Vector;
009:        import javax.swing.JOptionPane;
010:        import org.openide.windows.Mode;
011:        import org.openide.windows.TopComponent;
012:        import org.openide.windows.WindowManager;
013:
014:        import java.awt.BorderLayout;
015:        import java.awt.CardLayout;
016:        import java.awt.event.ActionEvent;
017:        import java.awt.event.ActionListener;
018:        import javax.swing.ButtonGroup;
019:        import javax.swing.JPanel;
020:        import javax.swing.JToggleButton;
021:        import javax.swing.JToolBar;
022:        import net.xoetrope.editor.netbeans.project.pages.PagePanel;
023:        import net.xoetrope.editor.project.XEditorProject;
024:        import net.xoetrope.editor.project.pages.events.ComponentSelectListener;
025:        import net.xoetrope.editor.project.pages.IXPagePanel;
026:        import net.xoetrope.editor.project.pages.XComponentSizer;
027:        import net.xoetrope.editor.project.pages.components.ComponentHelper;
028:        import net.xoetrope.editor.project.pages.components.PropertyHelper;
029:        import net.xoetrope.editor.project.pages.PageDesigner;
030:        import net.xoetrope.editor.project.pages.XPagePanel;
031:        import net.xoetrope.editor.project.workspace.ComponentToolBar;
032:        import net.xoetrope.xui.XProject;
033:        import net.xoetrope.xui.XProjectManager;
034:
035:        /**
036:         * A topComponent to support visualization of the data model
037:         * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
038:         * the GNU Public License (GPL), please see license.txt for more details. If
039:         * you make commercial use of this software you must purchase a commercial
040:         * license from Xoetrope.</p>
041:         * <p> $Revision: 1.21 $</p>
042:         */
043:        public class VisualiserPalette extends TopComponent implements 
044:                VisualiserProxy, ComponentSelectListener, ActionListener {
045:            private VisualiserContainer designVisualizerContainer,
046:                    debugVisualiserContainer;
047:            private XProject currentProject;
048:            private Vector activeComponents;
049:            private IXPagePanel activePage;
050:            private JToggleButton designTimeButton, runTimeButton;
051:            private JPanel contentPanel;
052:            private CardLayout panelManager;
053:
054:            public VisualiserPalette() {
055:                currentProject = XProjectManager.getCurrentProject();
056:                setName("Visualizer ("
057:                        + currentProject.getStartupParam("ProjectPath") + ")");
058:
059:                JToolBar toolbar = new ComponentToolBar();
060:
061:                // selection button
062:                ButtonGroup bg = new ButtonGroup();
063:                designTimeButton = new JToggleButton("Design time");
064:                designTimeButton.setActionCommand("Design");
065:                designTimeButton.addActionListener(this );
066:                designTimeButton
067:                        .setToolTipText("Design time view of the data model");
068:                designTimeButton.setSelected(true);
069:                bg.add(designTimeButton);
070:
071:                runTimeButton = new JToggleButton("Run time");
072:                runTimeButton.setActionCommand("Runtime");
073:                runTimeButton.addActionListener(this );
074:                runTimeButton
075:                        .setToolTipText("Run-time/Debug view of the data model");
076:                runTimeButton.setSelected(false);
077:                bg.add(runTimeButton);
078:
079:                toolbar.add(designTimeButton);
080:                toolbar.add(runTimeButton);
081:
082:                Vector customCompSelectListeners = (Vector) currentProject
083:                        .getObject("CustomCompSelectListeners");
084:                if (customCompSelectListeners == null)
085:                    customCompSelectListeners = new Vector();
086:
087:                customCompSelectListeners.add(this );
088:                currentProject.setObject("CustomCompSelectListeners",
089:                        customCompSelectListeners);
090:
091:                debugVisualiserContainer = new VisualiserContainer(
092:                        new NbDebuggerEngine());
093:                debugVisualiserContainer.setVisible(true);
094:
095:                designVisualizerContainer = new VisualiserContainer(null);
096:                designVisualizerContainer.setVisible(true);
097:
098:                contentPanel = new JPanel();
099:                panelManager = new CardLayout();
100:                contentPanel.setLayout(panelManager);
101:
102:                contentPanel.add(designVisualizerContainer, "Design time");
103:                contentPanel.add(debugVisualiserContainer, "Run time");
104:
105:                setLayout(new BorderLayout());
106:                add(toolbar, BorderLayout.NORTH);
107:                add(contentPanel, BorderLayout.CENTER);
108:                //visualiserPanel.setModelTreeListener( this );
109:
110:                setComponentListeners();
111:            }
112:
113:            public void componentActivated() {
114:                debugVisualiserContainer.refresh();
115:            }
116:
117:            public void actionPerformed(ActionEvent e) {
118:                Object o = e.getSource();
119:                String page = (o == designTimeButton ? "Design time"
120:                        : "Run time");
121:                if (page != null)
122:                    panelManager.show(contentPanel, page);
123:            }
124:
125:            private void setComponentListeners() {
126:                if (debugVisualiserContainer != null)
127:                    debugVisualiserContainer.setVisualiserProxy(this );
128:                designVisualizerContainer.setVisualiserProxy(this );
129:                Mode m = WindowManager.getDefault().findMode("editor");
130:                TopComponent[] components = m.getTopComponents();
131:                for (int i = 0; i < components.length; i++) {
132:                    if (components[i] instanceof  PagePanel) {
133:                        PageDesigner pd = ((PagePanel) components[i])
134:                                .getPageDesigner();
135:                        pd.addComponentSelectionListener(this );
136:                    }
137:                }
138:            }
139:
140:            public void nodeDoubleClicked(String path) {
141:                if ((activeComponents != null) && (activeComponents.size() > 0)) {
142:                    XComponentSizer comp = (XComponentSizer) activeComponents
143:                            .get(0);
144:                    if (comp.isValid()) {
145:                        PropertyHelper helper = new ComponentHelper()
146:                                .getPropertyHelper(comp.getTarget());
147:                        helper.setPropertyValue(comp.getPageResource(), comp,
148:                                "Data", path);
149:                        XEditorProject proj = (XEditorProject) currentProject;
150:                        ((XPagePanel) activePage).componentChanged();
151:                        activePage.setModified(true);
152:                    }
153:                }
154:            }
155:
156:            public void open() {
157:                Mode mode = WindowManager.getDefault().findMode("output");
158:                if (mode != null)
159:                    mode.dockInto(this );
160:                super .open();
161:            }
162:
163:            /*public void componentClosed()
164:            {
165:              currentProject.removeComponentSelectionListener( this );
166:            }*/
167:
168:            public void setSelectedComponents(IXPagePanel currentPanel,
169:                    Vector selectedComponents, boolean contentsChanged) {
170:                if (!contentsChanged)
171:                    return;
172:                activeComponents = selectedComponents;
173:                activePage = currentPanel;
174:                if (selectedComponents.size() > 0) {
175:                    XComponentSizer comp = (XComponentSizer) selectedComponents
176:                            .get(0);
177:                    PropertyHelper helper = new ComponentHelper()
178:                            .getPropertyHelper(comp.getTarget());
179:                    String attributeValue = helper.getPropertyValue(comp
180:                            .getPageResource(), comp.getTarget(), "Data");
181:                    if (debugVisualiserContainer != null)
182:                        debugVisualiserContainer
183:                                .setSelectedPath(attributeValue);
184:                    designVisualizerContainer.setSelectedPath(attributeValue);
185:                }
186:            }
187:
188:            public String preferredID() {
189:                return "XuiProDataVisualizer";
190:            }
191:
192:            /**
193:             * @todo When the class has stabilized remove this method and retest the persistence
194:             * @return
195:             */
196:            public int getPersistenceType() {
197:                return PERSISTENCE_NEVER;
198:            }
199:
200:            /*public void loadDatasets()
201:            {
202:              XDataSource modelDataSource = new XDataSource();
203:              try {
204:                String fileName = currentProject.getStartupParam( "ModelData" );
205:                if ( fileName != null ) {
206:                  try {
207:                    modelDataSource.read( currentProject.getBufferedReader( fileName, null ) );
208:                  }
209:                  catch ( Exception ex3 ) {
210:                    if ( BuildProperties.DEBUG )
211:                      DebugLogger.logError( "Could not access file:" + fileName );
212:                  }
213:                }
214:              }
215:              catch ( Exception ex ) {
216:                if ( BuildProperties.DEBUG )
217:                  DebugLogger.logError( "Exception in loadDatasets" );
218:              }
219:            }*/
220:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.