Source Code Cross Referenced for SBorderFactory.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:         * @(#)SBorderFactory.java	1.0 01/01/02
003:         *
004:         * Factory inspired  by javax.swing.BorderFactory
005:         */
006:        package org.wings;
007:
008:        import java.awt.Color;
009:        import java.awt.Font;
010:        import org.wings.SComponent;
011:        import org.wings.border.*;
012:
013:        /**
014:         * Factory class for standard <code>SBorder</code> elements.
015:         */
016:        public class SBorderFactory {
017:
018:            /** We are static */
019:            private SBorderFactory() {
020:            }
021:
022:            //// LineBorder ///////////////////////////////////////////////////////////////
023:
024:            /**
025:             * Creates a line SBorder withe the specified color.
026:             *
027:             * @param color  a <code>Color</code> to use for the line
028:             * @return the <code>SBorder</code> object
029:             */
030:            public static SBorder createSLineBorder(Color color) {
031:                return new SLineBorder(color, 1);
032:            }
033:
034:            /**
035:             * Creates a line SBorder with the specified color
036:             * and width. The width applies to all four sides of the
037:             * SBorder. To specify widths individually for the top,
038:             * bottom, left, and right, use 
039:             * {@link #createSEmptyBorder(int, int, int, int)}. 
040:             *
041:             * @param color  a <code>Color</code> to use for the line
042:             * @param thickness  an integer specifying the width in pixels
043:             * @return the <code>SBorder</code> object
044:             */
045:            public static SBorder createSLineBorder(Color color, int thickness) {
046:                return new SLineBorder(color, thickness);
047:            }
048:
049:            //// BevelBorder /////////////////////////////////////////////////////////////
050:
051:            /**
052:             * Creates a SBorder with a raised beveled edge, using
053:             * brighter shades of the component's current background color
054:             * for highlighting, and darker shading for shadows.
055:             * (In a raised SBorder, highlights are on top and shadows
056:             *  are underneath.)
057:             *
058:             * @return the <code>SBorder</code> object
059:             */
060:            public static SBorder createRaisedSBevelBorder() {
061:                return new SBevelBorder(SBevelBorder.RAISED);
062:            }
063:
064:            /**
065:             * Creates a SBorder with a lowered beveled edge, using
066:             * brighter shades of the component's current background color
067:             * for highlighting, and darker shading for shadows.
068:             * (In a lowered SBorder, shadows are on top and highlights
069:             *  are underneath.)
070:             *
071:             * @return the <code>SBorder</code> object
072:             */
073:            public static SBorder createLoweredSBevelBorder() {
074:                return new SBevelBorder(SBevelBorder.LOWERED);
075:            }
076:
077:            /**
078:             * Creates a beveled SBorder of the specified type, using
079:             * brighter shades of the component's current background color
080:             * for highlighting, and darker shading for shadows.
081:             * (In a lowered SBorder, shadows are on top and highlights
082:             *  are underneath.)
083:             *
084:             * @param type  an integer specifying either
085:             *			<code>BevelBorder.LOWERED</code> or
086:             *              	<code>BevelBorder.RAISED</code>
087:             * @return the <code>SBorder</code> object
088:             */
089:            public static SBorder createSBevelBorder(int type) {
090:                return new SBevelBorder(type);
091:            }
092:
093:            /**
094:             * Creates a beveled SBorder of the specified type, using
095:             * the specified highlighting and shadowing. The outer 
096:             * edge of the highlighted area uses a brighter shade of
097:             * the highlight color. The inner edge of the shadow area
098:             * uses a brighter shade of the shadow color.
099:             * 
100:             * @param type  an integer specifying either 
101:             *			<code>BevelBorder.LOWERED</code> or
102:             *              	<code>BevelBorder.RAISED</code>
103:             * @param highlight  a <code>Color</code> object for highlights
104:             * @param shadow     a <code>Color</code> object for shadows
105:             * @return the <code>SBorder</code> object
106:             */
107:            /*    public static SBorder createSBevelBorder(int type, Color highlight, Color shadow) {
108:             return new SBevelBorder(type, highlight, shadow);
109:             } */
110:
111:            /**
112:             * Creates a beveled SBorder of the specified type, using
113:             * the specified colors for the inner and outer highlight
114:             * and shadow areas. 
115:             * <p>
116:             * Note: The shadow inner and outer colors are
117:             * switched for a lowered bevel SBorder.
118:             * 
119:             * @param type  an integer specifying either 
120:             *		<code>BevelBorder.LOWERED</code> or
121:             *          <code>BevelBorder.RAISED</code>
122:             * @param highlightOuter  a <code>Color</code> object for the
123:             *			outer edge of the highlight area
124:             * @param highlightInner  a <code>Color</code> object for the
125:             *			inner edge of the highlight area
126:             * @param shadowOuter     a <code>Color</code> object for the
127:             *			outer edge of the shadow area
128:             * @param shadowInner     a <code>Color</code> object for the
129:             *			inner edge of the shadow area
130:             * @return the <code>SBorder</code> object
131:             */
132:            /*    public static SBorder createSBevelBorder(int type,
133:             Color highlightOuter, Color highlightInner,
134:             Color shadowOuter, Color shadowInner) {
135:             return new SBevelBorder(type, highlightOuter, highlightInner, 
136:             shadowOuter, shadowInner);
137:             }
138:             */
139:
140:            //// EtchedBorder ///////////////////////////////////////////////////////////
141:            /**
142:             * Creates a SBorder with an "etched" look using
143:             * the component's current background color for 
144:             * highlighting and shading.
145:             *
146:             * @return the <code>SBorder</code> object
147:             */
148:            public static SBorder createSEtchedBorder() {
149:                return new SEtchedBorder();
150:            }
151:
152:            /**
153:             * Creates a SBorder with an "etched" look using
154:             * the specified highlighting and shading colors.
155:             *
156:             * @param etchedType  Raised or Lowered
157:             * @return the <code>SBorder</code> object 
158:             */
159:            public static SBorder createSEtchedBorder(int etchedType) {
160:                return new SEtchedBorder(etchedType);
161:            }
162:
163:            /**
164:             * Creates a SBorder with an "etched" look using
165:             * the specified highlighting and shading colors.
166:             *
167:             * @param type    	one of <code>EtchedBorder.RAISED</code>, or
168:             *			<code>EtchedBorder.LOWERED</code>
169:             * @param highlight  a <code>Color</code> object for the SBorder highlights
170:             * @param shadow     a <code>Color</code> object for the SBorder shadows
171:             * @return the <code>SBorder</code> object 
172:             * @since 1.3
173:             */
174:            /*  public static SBorder createSEtchedBorder(int type, Color highlight,
175:            				    Color shadow)    {
176:                  return new SEtchedBorder(type, highlight, shadow);
177:              }
178:             */
179:
180:            //// EmptyBorder ///////////////////////////////////////////////////////////	
181:            /**
182:             * Creates an empty SBorder that takes up no space. (The width
183:             * of the top, bottom, left, and right sides are all zero.)
184:             *
185:             * @return the <code>SBorder</code> object
186:             */
187:            public static SBorder createSEmptyBorder() {
188:                return new SEmptyBorder(0, 0, 0, 0);
189:            }
190:
191:            /**
192:             * Creates an empty SBorder that takes up space but which does
193:             * no drawing, specifying the width of the top, left, bottom, and
194:             * right sides.
195:             *
196:             * @param top     an integer specifying the width of the top,
197:             *			in pixels
198:             * @param left    an integer specifying the width of the left side,
199:             *			in pixels
200:             * @param bottom  an integer specifying the width of the bottom,
201:             *			in pixels
202:             * @param right   an integer specifying the width of the right side,
203:             *			in pixels
204:             * @return the <code>SBorder</code> object
205:             */
206:            public static SBorder createSEmptyBorder(int top, int left,
207:                    int bottom, int right) {
208:                return new SEmptyBorder(top, left, bottom, right);
209:            }
210:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.