Source Code Cross Referenced for EditableGroupDemo.java in  » Graphic-Library » jgraph » com » jgraph » example » groupeditor » 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 » Graphic Library » jgraph » com.jgraph.example.groupeditor 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        package com.jgraph.example.groupeditor;
02:
03:        import java.net.URL;
04:
05:        import javax.swing.ImageIcon;
06:        import javax.swing.JFrame;
07:
08:        import org.jgraph.JGraph;
09:        import org.jgraph.graph.VertexView;
10:
11:        import com.jgraph.example.GraphEdX;
12:        import com.jgraph.example.GraphEdXMenuBar;
13:
14:        /**
15:         * A demo based on GraphEdX that demonstrates a simple way of allowing the user
16:         * to edit cells inside groups or the groups themselves. NB: in order to have the
17:         * edit button displayed in the top layer (not shadowed by child cells), we need
18:         * to display them on the border away from the child cells. To do that, we
19:         * assume we groups have larger bounds than the union of their child cells, a
20:         * feauture implemented in GraphEdX in the group method.
21:         * 
22:         * Remark: using a click system rather than this button system wouldn't work
23:         * because the click count is already used to traverse the cell selection.
24:         * 
25:         * @author rvalyi
26:         */
27:        public class EditableGroupDemo extends GraphEdX {
28:
29:            /**
30:             * References the folding manager.
31:             */
32:            protected GroupManager foldingManager;
33:
34:            // Override parent method
35:            protected void installListeners(JGraph graph) {
36:                super .installListeners(graph);
37:                // Adds redirector for group collapse/expand
38:                foldingManager = new GroupManager();
39:                graph.addMouseListener(foldingManager);
40:            }
41:
42:            protected void uninstallListeners(JGraph graph) {
43:                super .uninstallListeners(graph);
44:                graph.removeMouseListener(foldingManager);
45:            }
46:
47:            /**
48:             * Constructs a new application
49:             */
50:            public EditableGroupDemo() {
51:                // Overrides the global vertex renderer
52:                VertexView.renderer = new EditableGroupRenderer();
53:
54:                // Prepares layout actions
55:                setJMenuBar(new GraphEdXMenuBar(this , graphFactory));
56:                // Initializes actions states
57:                valueChanged(null);
58:            }
59:
60:            /**
61:             * Main method
62:             */
63:            public static void main(String[] args) {
64:                try {
65:                    // Construct Frame
66:                    JFrame frame = new JFrame("GraphEdX");
67:                    // Set Close Operation to Exit
68:                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
69:                    // Add an Editor Panel
70:                    GraphEdX app = new EditableGroupDemo();
71:                    frame.getContentPane().add(app);
72:                    // Fetch URL to Icon Resource
73:                    URL jgraphUrl = GraphEdX.class.getClassLoader()
74:                            .getResource(
75:                                    "org/jgraph/example/resources/jgraph.gif");
76:                    // If Valid URL
77:                    if (jgraphUrl != null) {
78:                        // Load Icon
79:                        ImageIcon jgraphIcon = new ImageIcon(jgraphUrl);
80:                        // Use in Window
81:                        frame.setIconImage(jgraphIcon.getImage());
82:                    }
83:                    // Set Default Size
84:                    frame.setSize(640, 480);
85:                    // Show Frame
86:                    frame.setVisible(true);
87:                    app.init();
88:                } catch (Exception e) {
89:                    e.printStackTrace();
90:                }
91:            }
92:
93:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.