Source Code Cross Referenced for PDFBorder.java in  » PDF » gnujpdf » gnu » jpdf » 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 » PDF » gnujpdf » gnu.jpdf 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: PDFBorder.java,v 1.2 2001/11/16 15:26:04 ezb Exp $
003:         *
004:         * $Date: 2001/11/16 15:26:04 $
005:         *
006:         * This library is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU Lesser General Public 
008:         * License as published by the Free Software Foundation; either 
009:         * version 2.1 of the License, or (at your option) any later version. 
010:         * 
011:         * This library is distributed in the hope that it will be useful, 
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of 
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
014:         * Lesser General Public License for more details. 
015:         * 
016:         * You should have received a copy of the GNU Lesser General Public 
017:         * License along with this library; if not, write to the Free Software 
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
019:         */
020:        package gnu.jpdf;
021:
022:        import java.awt.*;
023:        import java.io.*;
024:        import java.util.*;
025:
026:        /**
027:         * <p>A border around an annotation </p>
028:         *
029:         *
030:         * @author Peter T Mount, http://www.retep.org.uk/pdf/
031:         * @author Eric Z. Beard, ericzbeard@hotmail.com
032:         * @author $Author: ezb $
033:         * @version $Revision: 1.2 $
034:         */
035:        public class PDFBorder extends PDFObject {
036:            /*
037:             * NOTE: The original class is the work of Peter T. Mount, who released it 
038:             * in the uk.org.retep.pdf package.  It was modified by Eric Z. Beard as 
039:             * follows: the package name was changed to gnu.pdf.  It is still 
040:             * licensed under the LGPL.
041:             */
042:
043:            /**
044:             * The style of the border
045:             */
046:            private short style;
047:
048:            /**
049:             * The width of the border
050:             */
051:            private double width;
052:
053:            /**
054:             * This array allows the definition of a dotted line for the border
055:             */
056:            private double dash[];
057:
058:            /**
059:             * Creates a border using the predefined styles in PDFAnnot.
060:             * <p>Note: Do not use PDFAnnot.DASHED with this method.
061:             * Use the other constructor.
062:             *
063:             * @param style The style of the border
064:             * @param width The width of the border
065:             * @see PDFAnnot
066:             */
067:            public PDFBorder(short style, double width) {
068:                super ("/Border");
069:                this .style = style;
070:                this .width = width;
071:            }
072:
073:            /**
074:             * Creates a border of style PDFAnnot.DASHED
075:             *
076:             * @param width The width of the border
077:             * @param dash The line pattern definition
078:             */
079:            public PDFBorder(double width, double dash[]) {
080:                super ("/Border");
081:                this .style = PDFAnnot.DASHED;
082:                this .width = width;
083:                this .dash = dash;
084:            }
085:
086:            /**
087:             * @param os OutputStream to send the object to
088:             * @exception IOException on error
089:             */
090:            public void write(OutputStream os) throws IOException {
091:                //writeStart(os);
092:                os.write(Integer.toString(objser).getBytes());
093:                os.write(" 0 obj\n".getBytes());
094:
095:                os.write("[/S /".getBytes());
096:                os.write("SDBIU".substring(style, style + 1).getBytes());
097:                os.write(" /W ".getBytes());
098:                os.write(Double.toString(width).getBytes());
099:                if (dash != null) {
100:                    os.write(" /D [".getBytes());
101:                    os.write(Double.toString(dash[0]).getBytes());
102:                    for (int i = 1; i < dash.length; i++) {
103:                        os.write(" ".getBytes());
104:                        os.write(Double.toString(dash[i]).getBytes());
105:                    }
106:                    os.write("] ".getBytes());
107:                }
108:                os.write("]\n".getBytes());
109:
110:                //writeEnd(os);
111:                os.write("endobj\n".getBytes());
112:            }
113:        } // end class PDFBorder
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.