Source Code Cross Referenced for SScrollPaneLayout.java in  » Swing-Library » wings3 » org » wings » 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 » Swing Library » wings3 » org.wings 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2005 Your Corporation. All Rights Reserved.
003:         */
004:        package org.wings;
005:
006:        import java.util.HashMap;
007:        import java.util.Iterator;
008:        import java.util.Map;
009:
010:        /**
011:         * Internal layout manager used by {@link SScrollPane}
012:         *
013:         * @author hengels
014:         * @version $Revision: 2994 $
015:         */
016:        public class SScrollPaneLayout extends SAbstractLayoutManager {
017:            public static final String VIEWPORT = "Viewport";
018:            public static final String NORTH = SBorderLayout.NORTH;
019:            public static final String WEST = SBorderLayout.WEST;
020:            public static final String EAST = SBorderLayout.EAST;
021:            public static final String SOUTH = SBorderLayout.SOUTH;
022:
023:            private SComponent viewport;
024:            private SComponent north;
025:            private SComponent west;
026:            private SComponent east;
027:            private SComponent south;
028:
029:            Map components = new HashMap(5);
030:
031:            public SScrollPaneLayout() {
032:            }
033:
034:            /**
035:             * @deprecated Use {@link org.wings.SScrollPane#isPaging()}
036:             */
037:            public boolean isPaging() {
038:                return ((SScrollPane) container).getMode() == SScrollPane.MODE_SCROLLING;
039:            }
040:
041:            /**
042:             * @deprecated Use {@link org.wings.SScrollPane#setPaging(boolean)}
043:             */
044:            public void setPaging(boolean paging) {
045:                if (paging) {
046:                    ((SScrollPane) container)
047:                            .setMode(SScrollPane.MODE_SCROLLING);
048:                } else {
049:                    ((SScrollPane) container)
050:                            .setMode(SScrollPane.MODE_COMPLETE);
051:                }
052:            }
053:
054:            public void addSingletonComponent(SComponent component,
055:                    Object constraint) {
056:                if (VIEWPORT.equals(constraint)) {
057:                    if (viewport != component) {
058:                        container.remove(viewport);
059:                    }
060:                    viewport = component;
061:                } else if (NORTH.equals(constraint)) {
062:                    if (viewport != component) {
063:                        container.remove(north);
064:                    }
065:                    north = component;
066:                } else if (WEST.equals(constraint)) {
067:                    if (viewport != component) {
068:                        container.remove(west);
069:                    }
070:                    west = component;
071:                } else if (EAST.equals(constraint)) {
072:                    if (viewport != component) {
073:                        container.remove(east);
074:                    }
075:                    east = component;
076:                } else if (SOUTH.equals(constraint)) {
077:                    if (viewport != component) {
078:                        container.remove(south);
079:                    }
080:                    south = component;
081:                }
082:            }
083:
084:            public void addComponent(SComponent component, Object constraint,
085:                    int index) {
086:                addSingletonComponent(component, constraint);
087:                components.put(constraint, component);
088:            }
089:
090:            /**
091:             * Removes the component from the layout manager
092:             * @param c the component to be removed
093:             */
094:            public void removeComponent(SComponent c) {
095:                if (c == null) {
096:                    return;
097:                }
098:
099:                String constraint = null;
100:                Iterator iterator = components.entrySet().iterator();
101:                while (iterator.hasNext()) {
102:                    Map.Entry entry = (Map.Entry) iterator.next();
103:                    if (c.equals(entry.getValue())) {
104:                        constraint = (String) entry.getKey();
105:                        break;
106:                    }
107:                }
108:
109:                if (constraint != null) {
110:                    components.remove(constraint);
111:                    removeSingletonComponent(constraint);
112:                }
113:            }
114:
115:            private void removeSingletonComponent(String constraint) {
116:                if (VIEWPORT.equals(constraint)) {
117:                    viewport = null;
118:                } else if (NORTH.equals(constraint)) {
119:                    north = null;
120:                } else if (WEST.equals(constraint)) {
121:                    west = null;
122:                } else if (EAST.equals(constraint)) {
123:                    east = null;
124:                } else if (SOUTH.equals(constraint)) {
125:                    south = null;
126:                }
127:            }
128:
129:            /**
130:             * Returns a map of all components.
131:             * @return the components contained by the layout
132:             */
133:            public Map getComponents() {
134:                return components;
135:            }
136:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.