Source Code Cross Referenced for PDOutlineItem.java in  » PDF » jPod » de » intarsys » pdf » pd » 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 » jPod » de.intarsys.pdf.pd 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2007, intarsys consulting GmbH
003:         *
004:         * Redistribution and use in source and binary forms, with or without
005:         * modification, are permitted provided that the following conditions are met:
006:         *
007:         * - Redistributions of source code must retain the above copyright notice,
008:         *   this list of conditions and the following disclaimer.
009:         *
010:         * - Redistributions in binary form must reproduce the above copyright notice,
011:         *   this list of conditions and the following disclaimer in the documentation
012:         *   and/or other materials provided with the distribution.
013:         *
014:         * - Neither the name of intarsys nor the names of its contributors may be used
015:         *   to endorse or promote products derived from this software without specific
016:         *   prior written permission.
017:         *
018:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
019:         * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
020:         * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
021:         * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
022:         * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
023:         * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
024:         * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
025:         * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
026:         * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
027:         * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
028:         * POSSIBILITY OF SUCH DAMAGE.
029:         */
030:        package de.intarsys.pdf.pd;
031:
032:        import de.intarsys.pdf.cos.COSArray;
033:        import de.intarsys.pdf.cos.COSBasedObject;
034:        import de.intarsys.pdf.cos.COSDictionary;
035:        import de.intarsys.pdf.cos.COSName;
036:        import de.intarsys.pdf.cos.COSObject;
037:
038:        /**
039:         * A document outline item. This is used to represent all tree elements in a PDF
040:         * outline tree.
041:         */
042:        public class PDOutlineItem extends PDOutlineNode {
043:            /**
044:             * The meta class implementation
045:             */
046:            public static class MetaClass extends PDOutlineNode.MetaClass {
047:                protected MetaClass(Class paramInstanceClass) {
048:                    super (paramInstanceClass);
049:                }
050:
051:                protected COSBasedObject doCreateCOSBasedObject(COSObject object) {
052:                    return new PDOutlineItem(object);
053:                }
054:
055:                protected COSBasedObject.MetaClass doDetermineClass(
056:                        COSObject object) {
057:                    // there are documents around that do not correctly contain 
058:                    // a /Parent reference - so we can't really determine type but from 
059:                    // client context
060:                    if (object instanceof  COSDictionary) {
061:                        return PDOutlineItem.META;
062:                    }
063:                    return super .doDetermineClass(object);
064:                }
065:            }
066:
067:            public static final COSName DK_A = COSName.constant("A"); //$NON-NLS-1$
068:
069:            public static final COSName DK_C = COSName.constant("C"); //$NON-NLS-1$
070:
071:            public static final COSName DK_Dest = COSName.constant("Dest"); //$NON-NLS-1$
072:
073:            public static final COSName DK_F = COSName.constant("F"); //$NON-NLS-1$
074:
075:            public static final COSName DK_Next = COSName.constant("Next"); //$NON-NLS-1$
076:
077:            public static final COSName DK_Parent = COSName.constant("Parent"); //$NON-NLS-1$
078:
079:            public static final COSName DK_Prev = COSName.constant("Prev"); //$NON-NLS-1$
080:
081:            public static final COSName DK_SE = COSName.constant("SE"); //$NON-NLS-1$
082:
083:            public static final COSName DK_Title = COSName.constant("Title"); //$NON-NLS-1$
084:
085:            /** The meta class instance */
086:            public static final MetaClass META = new MetaClass(MetaClass.class
087:                    .getDeclaringClass());
088:
089:            protected PDOutlineItem(COSObject object) {
090:                super (object);
091:            }
092:
093:            /**
094:             * The flags as integer value.
095:             * 
096:             * @return The flags as integer value.
097:             */
098:            public int basicGetFlags() {
099:                return getFieldInt(DK_F, 0);
100:            }
101:
102:            /**
103:             * Assign the flags from an integer value.
104:             * 
105:             * @param value
106:             *            The new flags
107:             */
108:            public void basicSetFlags(int value) {
109:                setFieldInt(DK_F, value);
110:            }
111:
112:            /**
113:             * The color values to be used for this.
114:             * 
115:             * @return The color values to be used for this.
116:             */
117:            public COSArray cosGetColor() {
118:                return cosGetField(DK_C).asArray();
119:            }
120:
121:            /**
122:             * The {@link PDAction} executed when the outline item is activated.
123:             * 
124:             * @return The {@link PDAction} executed when the outline item is activated.
125:             */
126:            public PDAction getAction() {
127:                return (PDAction) PDAction.META
128:                        .createFromCos(cosGetField(DK_A));
129:            }
130:
131:            /**
132:             * The {@link PDDestination} to be displayed when the outline item is
133:             * activated.
134:             * 
135:             * @return The {@link PDDestination} to be displayed when the outline item
136:             *         is activated.
137:             */
138:            public PDDestination getDestination() {
139:                return (PDDestination) PDDestination.META
140:                        .createFromCos(cosGetField(DK_Dest));
141:            }
142:
143:            /**
144:             * The {@link OutlineItemFlags}.
145:             * 
146:             * @return The {@link OutlineItemFlags}.
147:             */
148:            public OutlineItemFlags getFlags() {
149:                return new OutlineItemFlags(this );
150:            }
151:
152:            /**
153:             * The next {@link PDOutlineItem} within the items linked list.
154:             * 
155:             * @return The next {@link PDOutlineItem} within the items linked list.
156:             */
157:            public PDOutlineItem getNext() {
158:                return (PDOutlineItem) PDOutlineItem.META
159:                        .createFromCos(cosGetField(DK_Next));
160:            }
161:
162:            /**
163:             * The parent item.
164:             * 
165:             * @return The parent item.
166:             */
167:            public PDOutlineNode getParent() {
168:                return (PDOutlineNode) PDOutlineNode.META
169:                        .createFromCos(cosGetField(DK_Parent));
170:            }
171:
172:            /**
173:             * The previous {@link PDOutlineItem} within the items linked list.
174:             * 
175:             * @return The previous {@link PDOutlineItem} within the items linked list.
176:             */
177:            public PDOutlineItem getPrev() {
178:                return (PDOutlineItem) PDOutlineItem.META
179:                        .createFromCos(cosGetField(DK_Prev));
180:            }
181:
182:            /**
183:             * The title to be displayed for this.
184:             * 
185:             * @return The title to be displayed for this.
186:             */
187:            public String getTitle() {
188:                return getFieldString(DK_Title, "");
189:            }
190:
191:            /**
192:             * Assign the {@link PDAction} to be executed when the outline is activated.
193:             * 
194:             * @param action
195:             *            The {@link PDAction} to be executed.
196:             */
197:            public void setAction(PDAction action) {
198:                setFieldObject(DK_A, action);
199:            }
200:
201:            /**
202:             * Assign the {@link PDDestination} to be displayed when the outline is
203:             * activated.
204:             * 
205:             * @param destination
206:             *            The {@link PDDestination} to be displayed.
207:             */
208:            public void setDestination(PDDestination destination) {
209:                setFieldObject(DK_Dest, destination);
210:            }
211:
212:            protected void setNext(PDOutlineItem next) {
213:                setFieldObject(DK_Next, next);
214:            }
215:
216:            protected void setParent(PDOutlineNode parent) {
217:                setFieldObject(DK_Parent, parent);
218:            }
219:
220:            protected void setPrev(PDOutlineItem prev) {
221:                setFieldObject(DK_Prev, prev);
222:            }
223:
224:            /**
225:             * Assign the outline title
226:             * 
227:             * @param title
228:             *            The new outline title.
229:             */
230:            public void setTitle(String title) {
231:                setFieldString(DK_Title, title);
232:            }
233:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.