Source Code Cross Referenced for JSplitPaneExtended.java in  » XML-UI » gui4j » org » gui4j » core » 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 » gui4j » org.gui4j.core.swing 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This class has been derived from work done by Karsten Lentzsch in his
003:         * examples for the JGoodies looks package. Modifications: Copyright (c) 2005
004:         * beck et al. projects GmbH
005:         */
006:
007:        /*
008:         * Copyright (c) 2001-2004 JGoodies Karsten Lentzsch. All Rights Reserved.
009:         * 
010:         * Redistribution and use in source and binary forms, with or without
011:         * modification, are permitted provided that the following conditions are met:
012:         * 
013:         * o Redistributions of source code must retain the above copyright notice, this
014:         * list of conditions and the following disclaimer.
015:         * 
016:         * o Redistributions in binary form must reproduce the above copyright notice,
017:         * this list of conditions and the following disclaimer in the documentation
018:         * and/or other materials provided with the distribution.
019:         * 
020:         * o Neither the name of JGoodies Karsten Lentzsch nor the names of its
021:         * contributors may be used to endorse or promote products derived from this
022:         * software without specific prior written permission.
023:         * 
024:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
025:         * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
026:         * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
027:         * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
028:         * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
029:         * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
030:         * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
031:         * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
032:         * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
033:         * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
034:         * POSSIBILITY OF SUCH DAMAGE.
035:         */
036:
037:        package org.gui4j.core.swing;
038:
039:        import java.awt.Component;
040:
041:        import javax.swing.JSplitPane;
042:        import javax.swing.border.Border;
043:        import javax.swing.border.EmptyBorder;
044:        import javax.swing.plaf.SplitPaneUI;
045:        import javax.swing.plaf.basic.BasicSplitPaneUI;
046:
047:        /**
048:         * A <code>JSplitPane</code> subclass that can try to remove the divider
049:         * border. Useful if the splitted components render their own borders. Note that
050:         * this feature is not supported by all look&amp;feels. Some look&amp;feel
051:         * implementation will always show a divider border, and conversely, others will
052:         * never show a divider border.
053:         * 
054:         * @author Karsten Lentzsch
055:         * @author Kay Krüger-Barvels
056:         * 
057:         * @see javax.swing.plaf.basic.BasicSplitPaneUI
058:         */
059:        public class JSplitPaneExtended extends JSplitPane {
060:
061:            /**
062:             * Holds an empty border that is reused for the split pane itself and the
063:             * divider.
064:             */
065:            private static final Border EMPTY_BORDER = new EmptyBorder(0, 0, 0,
066:                    0);
067:
068:            /**
069:             * Determines whether the divider border shall be removed when the UI is
070:             * updated.
071:             * 
072:             * @see #setDividerBorderVisible(boolean)
073:             */
074:            private Boolean dividerBorderVisible;
075:
076:            public JSplitPaneExtended(int newOrientation,
077:                    Component newLeftComponent, Component newRightComponent) {
078:                super (newOrientation, newLeftComponent, newRightComponent);
079:            }
080:
081:            /**
082:             * Checks and answers whether the divider border shall be visible or
083:             * invisible. Note that this feature is not supported by all look&amp;feels.
084:             * Some look&amp;feel implementation will always show a divider border, and
085:             * conversely, others will never show a divider border.
086:             * 
087:             * @return the desired (but potentially inaccurate) divider border visiblity
088:             */
089:            private Boolean isDividerBorderVisible() {
090:                return dividerBorderVisible;
091:            }
092:
093:            /**
094:             * Makes the divider border visible or invisible. Note that this feature is
095:             * not supported by all look&amp;feels. Some look&amp;feel implementation
096:             * will always show a divider border, and conversely, others will never show
097:             * a divider border.
098:             * 
099:             * @param newVisibility
100:             *            true for visible, false for invisible
101:             */
102:            public void setDividerBorderVisible(boolean newVisibility) {
103:                if (isDividerBorderVisible() == null
104:                        || isDividerBorderVisible().booleanValue() != newVisibility) {
105:                    dividerBorderVisible = new Boolean(newVisibility);
106:                    updateUI();
107:                }
108:            }
109:
110:            /**
111:             * Updates the UI and sets an empty divider border. The divider border may
112:             * be restored by a L&F at UI installation time. And so, we try to reset it
113:             * each time the UI is changed.
114:             */
115:            public void updateUI() {
116:                super .updateUI();
117:                if (isDividerBorderVisible() != null
118:                        && !(isDividerBorderVisible().booleanValue()))
119:                    setEmptyDividerBorder();
120:            }
121:
122:            /**
123:             * Sets an empty divider border if and only if the UI is an instance of
124:             * <code>BasicSplitPaneUI</code>.
125:             */
126:            private void setEmptyDividerBorder() {
127:                SplitPaneUI splitPaneUI = getUI();
128:                if (splitPaneUI instanceof  BasicSplitPaneUI) {
129:                    BasicSplitPaneUI basicUI = (BasicSplitPaneUI) splitPaneUI;
130:                    basicUI.getDivider().setBorder(EMPTY_BORDER);
131:                }
132:            }
133:
134:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.