Source Code Cross Referenced for HBox.java in  » XML-UI » JAXX » jaxx » runtime » swing » 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 » JAXX » jaxx.runtime.swing 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*
02:         * Copyright 2006 Ethan Nicholas. All rights reserved.
03:         * Use is subject to license terms.
04:         */
05:        package jaxx.runtime.swing;
06:
07:        import java.awt.*;
08:        import javax.swing.*;
09:
10:        /** Panel which uses an {@link HBoxLayout} by default.
11:         *
12:         *@author Ethan Nicholas
13:         */
14:        public class HBox extends JPanel {
15:            public static final String SPACING_PROPERTY = "spacing";
16:            public static final String MARGIN_PROPERTY = "margin";
17:            public static final String HORIZONTAL_ALIGNMENT_PROPERTY = "horizontalAlignment";
18:            public static final String VERTICAL_ALIGNMENT_PROPERTY = "verticalAlignment";
19:
20:            private Insets margin;
21:
22:            public HBox() {
23:                super (new HBoxLayout());
24:            }
25:
26:            /** Returns the spacing between components, in pixels.   Spacing is applied between components only,
27:             * not to the top or bottom of the container.
28:             *
29:             * @return spacing between components
30:             */
31:            public int getSpacing() {
32:                return ((HBoxLayout) getLayout()).getSpacing();
33:            }
34:
35:            /** Sets the spacing between components.   Spacing is applied between components only,
36:             * not to the top or bottom of the container.
37:             *
38:             * @param spacing new spacing value
39:             */
40:            public void setSpacing(int spacing) {
41:                int oldValue = getSpacing();
42:                ((HBoxLayout) getLayout()).setSpacing(spacing);
43:                firePropertyChange(SPACING_PROPERTY, oldValue, spacing);
44:                revalidate();
45:            }
46:
47:            public int getHorizontalAlignment() {
48:                return ((HBoxLayout) getLayout()).getHorizontalAlignment();
49:            }
50:
51:            public void setHorizontalAlignment(int horizontalAlignment) {
52:                int oldValue = getHorizontalAlignment();
53:                ((HBoxLayout) getLayout())
54:                        .setHorizontalAlignment(horizontalAlignment);
55:                firePropertyChange(HORIZONTAL_ALIGNMENT_PROPERTY, oldValue,
56:                        horizontalAlignment);
57:                revalidate();
58:            }
59:
60:            public int getVerticalAlignment() {
61:                return ((HBoxLayout) getLayout()).getVerticalAlignment();
62:            }
63:
64:            public void setVerticalAlignment(int verticalAlignment) {
65:                int oldValue = getVerticalAlignment();
66:                ((HBoxLayout) getLayout())
67:                        .setVerticalAlignment(verticalAlignment);
68:                firePropertyChange(VERTICAL_ALIGNMENT_PROPERTY, oldValue,
69:                        verticalAlignment);
70:                revalidate();
71:            }
72:
73:            public Insets getMargin() {
74:                return margin;
75:            }
76:
77:            public void setMargin(Insets margin) {
78:                Insets oldValue = this .margin;
79:                this .margin = (Insets) margin.clone();
80:                firePropertyChange(MARGIN_PROPERTY, oldValue, margin);
81:            }
82:
83:            public Insets getInsets() {
84:                Insets result = super.getInsets();
85:                if (margin != null) {
86:                    result.top += margin.top;
87:                    result.left += margin.left;
88:                    result.right += margin.right;
89:                    result.bottom += margin.bottom;
90:                }
91:                return result;
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.