Source Code Cross Referenced for BorderUIResource.java in  » Apache-Harmony-Java-SE » javax-package » javax » swing » plaf » 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 » Apache Harmony Java SE » javax package » javax.swing.plaf 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         */
017:
018:        /**
019:         * @author Sergey Burlak
020:         * @version $Revision$
021:         */package javax.swing.plaf;
022:
023:        import java.awt.Color;
024:        import java.awt.Component;
025:        import java.awt.Font;
026:        import java.awt.Graphics;
027:        import java.awt.Insets;
028:        import java.io.Serializable;
029:        import javax.swing.Icon;
030:        import javax.swing.border.BevelBorder;
031:        import javax.swing.border.Border;
032:        import javax.swing.border.CompoundBorder;
033:        import javax.swing.border.EmptyBorder;
034:        import javax.swing.border.EtchedBorder;
035:        import javax.swing.border.LineBorder;
036:        import javax.swing.border.MatteBorder;
037:        import javax.swing.border.TitledBorder;
038:
039:        import org.apache.harmony.x.swing.internal.nls.Messages;
040:
041:        public class BorderUIResource implements  Border, UIResource,
042:                Serializable {
043:            private static Border etched;
044:            private static Border blackLine;
045:            private static Border raisedBevel;
046:            private static Border loweredBevel;
047:
048:            public static class BevelBorderUIResource extends BevelBorder
049:                    implements  UIResource {
050:
051:                public BevelBorderUIResource(final int bevelType,
052:                        final Color highlightOuter, final Color highlightInner,
053:                        final Color shadowOuter, final Color shadowInner) {
054:                    super (bevelType, highlightOuter, highlightInner,
055:                            shadowOuter, shadowInner);
056:                }
057:
058:                public BevelBorderUIResource(final int bevelType,
059:                        final Color highlight, final Color shadow) {
060:                    super (bevelType, highlight, shadow);
061:                }
062:
063:                public BevelBorderUIResource(final int bevelType) {
064:                    super (bevelType);
065:                }
066:
067:            }
068:
069:            public static class CompoundBorderUIResource extends CompoundBorder
070:                    implements  UIResource {
071:
072:                public CompoundBorderUIResource(final Border out,
073:                        final Border in) {
074:                    super (out, in);
075:                }
076:
077:            }
078:
079:            public static class EmptyBorderUIResource extends EmptyBorder
080:                    implements  UIResource {
081:
082:                public EmptyBorderUIResource(final Insets ins) {
083:                    super (ins);
084:                }
085:
086:                public EmptyBorderUIResource(final int top, final int left,
087:                        final int bottom, final int right) {
088:                    super (top, left, bottom, right);
089:                }
090:            }
091:
092:            public static class EtchedBorderUIResource extends EtchedBorder
093:                    implements  UIResource {
094:
095:                public EtchedBorderUIResource(final Color highlight,
096:                        final Color shadow) {
097:                    super (highlight, shadow);
098:                }
099:
100:                public EtchedBorderUIResource(final int etchType,
101:                        final Color highlight, final Color shadow) {
102:                    super (etchType, highlight, shadow);
103:                }
104:
105:                public EtchedBorderUIResource(final int etchType) {
106:                    super (etchType);
107:                }
108:
109:                public EtchedBorderUIResource() {
110:                }
111:
112:            }
113:
114:            public static class LineBorderUIResource extends LineBorder
115:                    implements  UIResource {
116:
117:                public LineBorderUIResource(final Color color, final int thick) {
118:                    super (color, thick);
119:                }
120:
121:                public LineBorderUIResource(final Color color) {
122:                    super (color);
123:                }
124:
125:            }
126:
127:            public static class MatteBorderUIResource extends MatteBorder
128:                    implements  UIResource {
129:
130:                public MatteBorderUIResource(final Icon icon) {
131:                    super (icon);
132:                }
133:
134:                public MatteBorderUIResource(final int top, final int left,
135:                        final int bottom, final int right, final Icon icon) {
136:                    super (top, left, bottom, right, icon);
137:                }
138:
139:                public MatteBorderUIResource(final int top, final int left,
140:                        final int bottom, final int right, final Color color) {
141:                    super (top, left, bottom, right, color);
142:                }
143:
144:            }
145:
146:            public static class TitledBorderUIResource extends TitledBorder
147:                    implements  UIResource {
148:
149:                public TitledBorderUIResource(final Border border,
150:                        final String title, final int justification,
151:                        final int position, final Font font, final Color color) {
152:                    super (border, title, justification, position, font, color);
153:                }
154:
155:                public TitledBorderUIResource(final Border border,
156:                        final String title, final int justification,
157:                        final int position, final Font font) {
158:                    super (border, title, justification, position, font);
159:                }
160:
161:                public TitledBorderUIResource(final Border border,
162:                        final String title, final int justification,
163:                        final int position) {
164:                    super (border, title, justification, position);
165:                }
166:
167:                public TitledBorderUIResource(final Border border,
168:                        final String title) {
169:                    super (border, title);
170:                }
171:
172:                public TitledBorderUIResource(final Border border) {
173:                    super (border);
174:                }
175:
176:                public TitledBorderUIResource(final String title) {
177:                    super (title);
178:                }
179:
180:            }
181:
182:            private Border border;
183:
184:            public BorderUIResource(final Border border) {
185:                if (border == null) {
186:                    throw new IllegalArgumentException(Messages
187:                            .getString("swing.6B")); //$NON-NLS-1$
188:                }
189:                this .border = border;
190:            }
191:
192:            public Insets getBorderInsets(final Component c) {
193:                return border.getBorderInsets(c);
194:            }
195:
196:            public void paintBorder(final Component c, final Graphics g,
197:                    final int x, final int y, final int w, final int h) {
198:                border.paintBorder(c, g, x, y, w, h);
199:            }
200:
201:            public boolean isBorderOpaque() {
202:                return border.isBorderOpaque();
203:            }
204:
205:            /**
206:             * Return raised bevel border
207:             * @return Border result
208:             */
209:            public static Border getRaisedBevelBorderUIResource() {
210:                if (raisedBevel == null) {
211:                    raisedBevel = new BevelBorderUIResource(0);
212:                }
213:                return raisedBevel;
214:            }
215:
216:            /**
217:             * Return lowered bevel border
218:             * @return Border result
219:             */
220:            public static Border getLoweredBevelBorderUIResource() {
221:                if (loweredBevel == null) {
222:                    loweredBevel = new BevelBorderUIResource(1);
223:                }
224:                return loweredBevel;
225:            }
226:
227:            /**
228:             * Return etched border
229:             * @return Border result
230:             */
231:            public static Border getEtchedBorderUIResource() {
232:                if (etched == null) {
233:                    etched = new EtchedBorderUIResource(1);
234:                }
235:                return etched;
236:            }
237:
238:            /**
239:             * Return black line border
240:             * @return Border result
241:             */
242:            public static Border getBlackLineBorderUIResource() {
243:                if (blackLine == null) {
244:                    blackLine = new LineBorderUIResource(Color.black);
245:                }
246:                return blackLine;
247:            }
248:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.