Source Code Cross Referenced for MessageBorder.java in  » Mail-Clients » columba-1.4 » org » columba » mail » gui » message » viewer » 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 » Mail Clients » columba 1.4 » org.columba.mail.gui.message.viewer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.columba.mail.gui.message.viewer;
002:
003:        import java.awt.Color;
004:        import java.awt.Component;
005:        import java.awt.Graphics;
006:        import java.awt.Insets;
007:
008:        import javax.swing.border.AbstractBorder;
009:
010:        public class MessageBorder extends AbstractBorder {
011:
012:            protected Color lineColor;
013:
014:            protected int thickness;
015:
016:            protected boolean roundedCorners;
017:
018:            protected int arc = 6;
019:
020:            public MessageBorder(Color lineColor, int thickness,
021:                    boolean roundedCorners) {
022:                super ();
023:
024:                this .lineColor = lineColor;
025:                this .thickness = thickness;
026:                this .roundedCorners = roundedCorners;
027:
028:            }
029:
030:            /**
031:             * Paints the border for the specified component with the specified position
032:             * and size.
033:             * 
034:             * @param c
035:             *            the component for which this border is being painted
036:             * @param g
037:             *            the paint graphics
038:             * @param x
039:             *            the x position of the painted border
040:             * @param y
041:             *            the y position of the painted border
042:             * @param width
043:             *            the width of the painted border
044:             * @param height
045:             *            the height of the painted border
046:             */
047:            public void paintBorder(Component c, Graphics g, int x, int y,
048:                    int width, int height) {
049:                Color oldColor = g.getColor();
050:                int i;
051:
052:                g.setColor(lineColor);
053:                for (i = 0; i < thickness; i++) {
054:                    if (!roundedCorners)
055:                        g.drawRect(x + i, y + i, width - i - i - 1, height - i
056:                                - i - 1);
057:                    else
058:                        g.drawRoundRect(x + i, y + i, width - i - i - 1, height
059:                                - i - i - 1, arc, arc);
060:                }
061:                g.setColor(oldColor);
062:            }
063:
064:            /**
065:             * Returns the insets of the border.
066:             * 
067:             * @param c
068:             *            the component for which this border insets value applies
069:             */
070:            public Insets getBorderInsets(Component c) {
071:                return new Insets(thickness, thickness, thickness, thickness);
072:            }
073:
074:            /**
075:             * Reinitialize the insets parameter with this Border's current Insets.
076:             * 
077:             * @param c
078:             *            the component for which this border insets value applies
079:             * @param insets
080:             *            the object to be reinitialized
081:             */
082:            public Insets getBorderInsets(Component c, Insets insets) {
083:                insets.left = insets.top = insets.right = insets.bottom = thickness;
084:                return insets;
085:            }
086:
087:            /**
088:             * Returns the color of the border.
089:             */
090:            public Color getLineColor() {
091:                return lineColor;
092:            }
093:
094:            /**
095:             * Returns the thickness of the border.
096:             */
097:            public int getThickness() {
098:                return thickness;
099:            }
100:
101:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.