Source Code Cross Referenced for ContentPane.java in  » Ajax » NextApp-Echo2 » nextapp » echo2 » app » 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 » Ajax » NextApp Echo2 » nextapp.echo2.app 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * This file is part of the Echo Web Application Framework (hereinafter "Echo").
003:         * Copyright (C) 2002-2005 NextApp, Inc.
004:         *
005:         * Version: MPL 1.1/GPL 2.0/LGPL 2.1
006:         *
007:         * The contents of this file are subject to the Mozilla Public License Version
008:         * 1.1 (the "License"); you may not use this file except in compliance with
009:         * the License. You may obtain a copy of the License at
010:         * http://www.mozilla.org/MPL/
011:         *
012:         * Software distributed under the License is distributed on an "AS IS" basis,
013:         * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
014:         * for the specific language governing rights and limitations under the
015:         * License.
016:         *
017:         * Alternatively, the contents of this file may be used under the terms of
018:         * either the GNU General Public License Version 2 or later (the "GPL"), or
019:         * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
020:         * in which case the provisions of the GPL or the LGPL are applicable instead
021:         * of those above. If you wish to allow use of your version of this file only
022:         * under the terms of either the GPL or the LGPL, and not to allow others to
023:         * use your version of this file under the terms of the MPL, indicate your
024:         * decision by deleting the provisions above and replace them with the notice
025:         * and other provisions required by the GPL or the LGPL. If you do not delete
026:         * the provisions above, a recipient may use your version of this file under
027:         * the terms of any one of the MPL, the GPL or the LGPL.
028:         */
029:
030:        package nextapp.echo2.app;
031:
032:        /**
033:         * A content pane is a high-level container/layout object which provides
034:         * layout for a content region and floating <code>WindowPane</code>s.
035:         * <p>
036:         * A <code>ContentPane</code> may only be added to a <code>Component</code> 
037:         * which implements <code>PaneContainer</code>.
038:         * <p>
039:         * At most one <code>Component</code> that does NOT implement 
040:         * <code>FloatingPane</code> may be added to a <code>ContentPane</code>.
041:         * Any number of <code>FloatingPane</code>s may be added as children. 
042:         */
043:        public class ContentPane extends Component implements  Pane,
044:                PaneContainer {
045:
046:            private static final Extent PX_0 = new Extent(0);
047:            private static final Extent SCROLL_BOTTOM = new Extent(-1);
048:
049:            public static final String PROPERTY_BACKGROUND_IMAGE = "backgroundImage";
050:            public static final String PROPERTY_HORIZONTAL_SCROLL = "horizontalScroll";
051:            public static final String PROPERTY_INSETS = "insets";
052:            public static final String PROPERTY_VERTICAL_SCROLL = "verticalScroll";
053:
054:            /**
055:             * Creates a new <code>ContentPane</code>.
056:             */
057:            public ContentPane() {
058:                super ();
059:            }
060:
061:            /**
062:             * Returns the background image.
063:             * 
064:             * @return the background image
065:             */
066:            public FillImage getBackgroundImage() {
067:                return (FillImage) getProperty(PROPERTY_BACKGROUND_IMAGE);
068:            }
069:
070:            /**
071:             * Returns the horizontal scrollbar position.
072:             * 
073:             * @return the horizontal scrollbar position
074:             */
075:            public Extent getHorizontalScroll() {
076:                return (Extent) getProperty(PROPERTY_HORIZONTAL_SCROLL);
077:            }
078:
079:            /**
080:             * Returns the inset margin of the content. 
081:             * Note that <code>FloatingPane</code>s, such as 
082:             * <code>WindowPane</code>s, will NOT be constrained by
083:             * this margin. 
084:             * Values may only be specified in pixel-based units.
085:             * 
086:             * @return newValue the inset margin
087:             */
088:            public Insets getInsets() {
089:                return (Insets) getProperty(PROPERTY_INSETS);
090:            }
091:
092:            /**
093:             * Returns the vertical scrollbar position.
094:             * 
095:             * @return the vertical scrollbar position
096:             */
097:            public Extent getVerticalScroll() {
098:                return (Extent) getProperty(PROPERTY_VERTICAL_SCROLL);
099:            }
100:
101:            /**
102:             * @see nextapp.echo2.app.Component#isValidChild(nextapp.echo2.app.Component)
103:             */
104:            public boolean isValidChild(Component child) {
105:                if (child instanceof  FloatingPane) {
106:                    // Allow addition of any number of FloatingPanes.
107:                    return true;
108:                }
109:
110:                // allow only one Non-FloatingPane child.
111:                int componentCount = getComponentCount();
112:                for (int i = 0; i < componentCount; ++i) {
113:                    if (!(getComponent(i) instanceof  FloatingPane)) {
114:                        return false;
115:                    }
116:                }
117:
118:                return true;
119:            }
120:
121:            /**
122:             * @see nextapp.echo2.app.Component#isValidParent(nextapp.echo2.app.Component)
123:             */
124:            public boolean isValidParent(Component parent) {
125:                return parent instanceof  PaneContainer
126:                        || parent instanceof  Window;
127:            }
128:
129:            /**
130:             * @see nextapp.echo2.app.Component#processInput(java.lang.String, java.lang.Object)
131:             */
132:            public void processInput(String inputName, Object inputValue) {
133:                if (PROPERTY_HORIZONTAL_SCROLL.equals(inputName)) {
134:                    setHorizontalScroll((Extent) inputValue);
135:                } else if (PROPERTY_VERTICAL_SCROLL.equals(inputName)) {
136:                    setVerticalScroll((Extent) inputValue);
137:                }
138:            }
139:
140:            /**
141:             * Sets the background image.
142:             * 
143:             * @param newValue the new background image
144:             */
145:            public void setBackgroundImage(FillImage newValue) {
146:                setProperty(PROPERTY_BACKGROUND_IMAGE, newValue);
147:            }
148:
149:            /**
150:             * Sets the horizontal scrollbar position.
151:             * Values must be in pixel units.
152:             * A value of -1px indicates that the scrollbar should be positioned
153:             * at the end of the range. 
154:             * 
155:             * @param newValue the new horizontal scrollbar position
156:             */
157:            public void setHorizontalScroll(Extent newValue) {
158:                setProperty(PROPERTY_HORIZONTAL_SCROLL, newValue);
159:            }
160:
161:            /**
162:             * Sets the inset margin of the content. 
163:             * Note that <code>FloatingPane</code>s, such as 
164:             * <code>WindowPane</code>s, will NOT be constrained by
165:             * this margin. 
166:             * Values may only be specified in pixel-based units.
167:             * 
168:             * @param newValue the new inset margin
169:             */
170:            public void setInsets(Insets newValue) {
171:                setProperty(PROPERTY_INSETS, newValue);
172:            }
173:
174:            /**
175:             * Sets the vertical scrollbar position.
176:             * Values must be in pixel units.
177:             * A value of -1px indicates that the scrollbar should be positioned
178:             * at the end of the range. 
179:             * 
180:             * @param newValue the new vertical scrollbar position
181:             */
182:            public void setVerticalScroll(Extent newValue) {
183:                if (SCROLL_BOTTOM.equals(newValue)) {
184:                    setProperty(PROPERTY_VERTICAL_SCROLL, PX_0);
185:                }
186:                setProperty(PROPERTY_VERTICAL_SCROLL, newValue);
187:            }
188:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.