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


001:        /* 
002:         * $Id: JGraphpadDialog.java,v 1.1.1.1 2005/08/04 11:21:58 gaudenz Exp $
003:         * Copyright (c) 2001-2005, Gaudenz Alder
004:         * 
005:         * All rights reserved.
006:         * 
007:         * See LICENSE file for license details. If you are unable to locate
008:         * this file please contact info (at) jgraph (dot) com.
009:         */
010:        package com.jgraph.pad.dialog;
011:
012:        import java.awt.BorderLayout;
013:        import java.awt.Color;
014:        import java.awt.Component;
015:        import java.awt.FlowLayout;
016:
017:        import javax.swing.BorderFactory;
018:        import javax.swing.ImageIcon;
019:        import javax.swing.JButton;
020:        import javax.swing.JComponent;
021:        import javax.swing.JDialog;
022:        import javax.swing.JPanel;
023:
024:        /**
025:         * Basic dialog class for JGraphpad consisting of the header with a title,
026:         * subtitle and icon, the content, and the button panel with a set of buttons.
027:         */
028:        public class JGraphpadDialog extends JDialog {
029:
030:            /**
031:             * Holds the button panel.
032:             */
033:            protected JPanel buttonPanel;
034:
035:            /**
036:             * Constructs a new dialog using the specified title.
037:             * 
038:             * @param title
039:             *            The title to use for the dialog and header.
040:             */
041:            public JGraphpadDialog(String title) {
042:                this (title, null, null);
043:
044:            }
045:
046:            /**
047:             * Constructs a new dialog using the specified title. The title is used in
048:             * the dialog and also in the header. The header is only displayed if either
049:             * an icon or subtitle is specified.
050:             * 
051:             * @param title
052:             *            The title to use for the dialog and header.
053:             * @param subtitle
054:             *            The subtitle to display in the header.
055:             * @param icon
056:             *            The icon to display in the header.
057:             */
058:            public JGraphpadDialog(String title, String subtitle, ImageIcon icon) {
059:                getContentPane().setLayout(new BorderLayout());
060:                setTitle(title);
061:
062:                // Adds the header panel
063:                if (subtitle != null || icon != null) {
064:                    JGraphpadHeaderPanel header = new JGraphpadHeaderPanel(
065:                            icon, title, subtitle);
066:                    getContentPane().add(header, BorderLayout.NORTH);
067:                }
068:
069:                // Adds the button panel
070:                buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
071:                buttonPanel.setBorder(BorderFactory
072:                        .createCompoundBorder(BorderFactory.createMatteBorder(
073:                                1, 0, 0, 0, Color.GRAY), BorderFactory
074:                                .createEmptyBorder(16, 8, 8, 8)));
075:                getContentPane().add(buttonPanel, BorderLayout.SOUTH);
076:                setContent(createContent());
077:            }
078:
079:            /**
080:             * Hook for subclassers to create the content of the dialog. The value
081:             * returned by this method is passed to {@link #setContent(Component)}
082:             * within the constructor.
083:             * 
084:             * @return Returns the content of the dialog.
085:             */
086:            protected JComponent createContent() {
087:                return null;
088:            }
089:
090:            /**
091:             * Adds the specified component to the component hierarchy of the dialog.
092:             * 
093:             * @param content
094:             *            The component to add to the hierarchy.
095:             */
096:            public void setContent(Component content) {
097:                if (content != null)
098:                    getContentPane().add(content, BorderLayout.CENTER);
099:            }
100:
101:            /**
102:             * Adds the specified buttons to the button panel.
103:             * 
104:             * @param buttons
105:             *            The buttons to be added to the button panel.
106:             */
107:            public void addButtons(JButton[] buttons) {
108:                for (int i = 0; i < buttons.length; i++)
109:                    buttonPanel.add(buttons[i]);
110:                buttonPanel.invalidate();
111:            }
112:
113:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.