Source Code Cross Referenced for SSplitPane.java in  » Swing-Library » Swinglets » com » javelin » swinglets » 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 » Swinglets » com.javelin.swinglets 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright Javelin Software, All rights reserved.
003:         */
004:
005:        package com.javelin.swinglets;
006:
007:        import java.awt.*;
008:        import java.util.*;
009:        import java.io.*;
010:
011:        import javax.servlet.*;
012:
013:        /**
014:         * SSplitPane defines a SplitPane.
015:         * <P>
016:         * This defaults to 100 units.
017:         * @author Robin Sharp
018:         */
019:
020:        public class SSplitPane extends SContainer {
021:            public final static int VERTICAL_SPLIT = 0;
022:            public final static int HORIZONTAL_SPLIT = 1;
023:
024:            public final static String LEFT = "left";
025:            public final static String RIGHT = "right";
026:            public final static String TOP = "top";
027:            public final static String BOTTOM = "bottom";
028:
029:            /**
030:             * Creates a SSplitPane with horizontal orientation.
031:             */
032:            public SSplitPane() {
033:                this (HORIZONTAL_SPLIT);
034:            }
035:
036:            /**
037:             * Creates a SSplitPane with specified orientation.
038:             */
039:            public SSplitPane(int orientation) {
040:                this (orientation, null, null);
041:            }
042:
043:            /**
044:             * Creates a SSplitPane with specified components and orientation.
045:             */
046:            public SSplitPane(int orientation, SComponent component1,
047:                    SComponent component2) {
048:                this .orientation = orientation;
049:                this .component1 = component1;
050:                this .component2 = component2;
051:
052:                super .add(component1);
053:                super .add(component2);
054:            }
055:
056:            /**
057:             * Returns the name of the L&F class that renders this component.
058:             */
059:            public Class getUIClass() {
060:                return SSplitPane.class;
061:            }
062:
063:            /**
064:             * Set the orientation.
065:             */
066:            public SSplitPane setOrientation(int orientation) {
067:                firePropertyChange("orientation", this .orientation,
068:                        this .orientation = orientation);
069:                return this ;
070:            }
071:
072:            /**
073:             * Get the orientation.
074:             */
075:            public int getOrientation() {
076:                return orientation;
077:            }
078:
079:            /**
080:             * Set the left component
081:             */
082:            public SSplitPane setLeftComponent(SComponent leftComponent) {
083:                if (component1 != null)
084:                    super .remove(component1);
085:
086:                firePropertyChange("leftComponent", this .component1,
087:                        this .component1 = leftComponent);
088:
089:                if (component1 != null)
090:                    super .add(component1);
091:
092:                return this ;
093:            }
094:
095:            /**
096:             * Get the left component.
097:             */
098:            public SComponent getLeftComponent() {
099:                return component1;
100:            }
101:
102:            /**
103:             * Set the right component
104:             */
105:            public SSplitPane setRightComponent(SComponent rightComponent) {
106:                if (component2 != null)
107:                    super .remove(component2);
108:
109:                firePropertyChange("rightComponent", this .component2,
110:                        this .component2 = rightComponent);
111:
112:                if (component2 != null)
113:                    super .add(component2);
114:
115:                return this ;
116:            }
117:
118:            /**
119:             * Get the right component.
120:             */
121:            public SComponent getRightComponent() {
122:                return component2;
123:            }
124:
125:            /**
126:             * Set the top component
127:             */
128:            public SSplitPane setTopComponent(SComponent topComponent) {
129:                if (component1 != null)
130:                    super .remove(component1);
131:
132:                firePropertyChange("topComponent", this .component2,
133:                        this .component2 = topComponent);
134:
135:                if (component1 != null)
136:                    super .add(component1);
137:
138:                return this ;
139:            }
140:
141:            /**
142:             * Get the top component.
143:             */
144:            public SComponent getTopComponent() {
145:                return component1;
146:            }
147:
148:            /**
149:             * Set the bottom component
150:             */
151:            public SSplitPane setBottomComponent(SComponent bottomComponent) {
152:                if (component2 != null)
153:                    super .remove(component2);
154:
155:                firePropertyChange("bottomComponent", this .component2,
156:                        this .component2 = bottomComponent);
157:
158:                if (component2 != null)
159:                    super .add(component2);
160:
161:                return this ;
162:            }
163:
164:            /**
165:             * Get the bottom component.
166:             */
167:            public SComponent getBottomComponent() {
168:                return component2;
169:            }
170:
171:            /**
172:             * Sets the size of the divider.
173:             */
174:            public SSplitPane setDividerSize(int dividerSize) {
175:                firePropertyChange("dividerSize", this .dividerSize,
176:                        this .dividerSize = dividerSize);
177:                return this ;
178:            }
179:
180:            /**
181:             * Returns the size of the divider.
182:             */
183:            public int getDividerSize() {
184:                return dividerSize;
185:            }
186:
187:            /**
188:             * Is this SplitPane expandable.
189:             */
190:            public boolean isExpandable() {
191:                return expandable;
192:            }
193:
194:            /**
195:             * Set this SplitPane expandable.
196:             */
197:            public SSplitPane setExpandable(boolean expandable) {
198:                firePropertyChange("expandable", this .expandable,
199:                        this .expandable = expandable);
200:                return this ;
201:            }
202:
203:            /**
204:             * Set the divider location. <br>
205:             * The percentage as a rate. 0>==<1
206:             */
207:            public SSplitPane setDividerLocation(double dividerLocation) {
208:                if (dividerLocation < 0 || dividerLocation > 1) {
209:                    throw new IllegalArgumentException("Value must be 0>==<1");
210:                }
211:
212:                firePropertyChange("dividerLocation", this .dividerLocation,
213:                        this .dividerLocation = dividerLocation);
214:
215:                return this ;
216:            }
217:
218:            /**
219:             * Returns the location of the divider.
220:             */
221:            public double getDividerLocation() {
222:                return dividerLocation;
223:            }
224:
225:            /**
226:             * Remove the specified component
227:             */
228:            public void remove(SComponent component) {
229:                if (component == component1) {
230:                    component1 = null;
231:                } else if (component == component2) {
232:                    component2 = null;
233:                }
234:            }
235:
236:            // PRIVATE ////////////////////////////////////////////////////////////
237:
238:            protected int orientation;
239:            protected SComponent component1;
240:            protected SComponent component2;
241:
242:            protected boolean expandable = true;
243:            protected double dividerLocation = 0.5;
244:            protected int dividerSize = 8;
245:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.