Source Code Cross Referenced for PdfPageObjects.java in  » PDF » pjx » com » etymon » pjx » util » 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 » pjx » com.etymon.pjx.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.etymon.pjx.util;
002:
003:        import java.io.*;
004:        import java.util.*;
005:        import com.etymon.pjx.*;
006:
007:        /**
008:         Examines a specified page dictionary and returns the set of all
009:         objects it references that are required for the page to be
010:         extracted from the document.  This class is synchronized.
011:         @author Nassib Nassar
012:         */
013:        public class PdfPageObjects extends PdfReferencedObjects {
014:
015:            /**
016:               The manager to use for resolving references.
017:             */
018:            protected PdfManager _mgr;
019:
020:            /**
021:               Constructs a <code>PdfPageObjects</code> instance.
022:               @param manager the manager associated with the document.
023:             */
024:            public PdfPageObjects(PdfManager manager) {
025:                super (manager);
026:                _mgr = manager;
027:            }
028:
029:            /**
030:               Returns the set of all objects referenced by the specified
031:               page object that are required for the page to be extracted
032:               from the document.
033:               @param obj the object to examine.
034:               @throws PdfFormatException
035:             */
036:            public Set getReferenced(PdfObject obj) throws IOException,
037:                    PdfFormatException {
038:                synchronized (this ) {
039:                    synchronized (_mgr) {
040:
041:                        return super .getReferenced(obj);
042:
043:                    }
044:                }
045:            }
046:
047:            /**
048:                   A <code>PdfName</code> object representing the name
049:                   <code>Annot</code>.
050:             */
051:            protected static final PdfName PDFNAME_ANNOT = new PdfName("Annot");
052:
053:            /**
054:                   A <code>PdfName</code> object representing the name
055:                   <code>P</code>.
056:             */
057:            protected static final PdfName PDFNAME_P = new PdfName("P");
058:
059:            /**
060:                   A <code>PdfName</code> object representing the name
061:                   <code>Page</code>.
062:             */
063:            protected static final PdfName PDFNAME_PAGE = new PdfName("Page");
064:
065:            /**
066:                   A <code>PdfName</code> object representing the name
067:                   <code>Parent</code>.
068:             */
069:            protected static final PdfName PDFNAME_PARENT = new PdfName(
070:                    "Parent");
071:
072:            /**
073:                   A <code>PdfName</code> object representing the name
074:                   <code>Type</code>.
075:             */
076:            protected static final PdfName PDFNAME_TYPE = new PdfName("Type");
077:
078:            /**
079:               This method is used by {@link #getReferenced(PdfObject)
080:               getReferenced(PdfObject)} and <b>should not be called
081:               externally</b>.  (It is not synchronized.)
082:               @param obj the object to filter.
083:               @return the filtered object.
084:               @throws PdfFormatException
085:             */
086:            public PdfObject preFilter(PdfObject obj) throws PdfFormatException {
087:
088:                // check if it is a dictionary
089:                if (obj instanceof  PdfDictionary) {
090:
091:                    Map map = ((PdfDictionary) obj).getMap();
092:
093:                    // check if it is a page dictionary
094:                    Object j = map.get(PDFNAME_TYPE);
095:                    if ((PdfNull.isNull(j) == false) && (j instanceof  PdfName)
096:                            && (((PdfName) j).equals(PDFNAME_PAGE))) {
097:
098:                        Map newMap = new HashMap(map);
099:                        newMap.remove(PDFNAME_PARENT);
100:                        return new PdfDictionary(newMap);
101:                    }
102:
103:                    // check if it is an annotation dictionary
104:                    j = map.get(PDFNAME_TYPE);
105:                    if ((PdfNull.isNull(j) == false) && (j instanceof  PdfName)
106:                            && (((PdfName) j).equals(PDFNAME_ANNOT))) {
107:
108:                        Map newMap = new HashMap(map);
109:                        newMap.remove(PDFNAME_P);
110:                        return new PdfDictionary(newMap);
111:                    }
112:
113:                }
114:
115:                return obj;
116:            }
117:
118:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.