Source Code Cross Referenced for PDViewerPreferences.java in  » PDF » PDFBox-0.7.3 » org » pdfbox » pdmodel » interactive » viewerpreferences » 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 » PDFBox 0.7.3 » org.pdfbox.pdmodel.interactive.viewerpreferences 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright (c) 2003-2005, www.pdfbox.org
003:         * All rights reserved.
004:         *
005:         * Redistribution and use in source and binary forms, with or without
006:         * modification, are permitted provided that the following conditions are met:
007:         *
008:         * 1. Redistributions of source code must retain the above copyright notice,
009:         *    this list of conditions and the following disclaimer.
010:         * 2. 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:         * 3. Neither the name of pdfbox; nor the names of its
014:         *    contributors may be used to endorse or promote products derived from this
015:         *    software without specific prior written permission.
016:         *
017:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
018:         * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
019:         * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
020:         * DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
021:         * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
022:         * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
023:         * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
024:         * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
025:         * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
026:         * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
027:         *
028:         * http://www.pdfbox.org
029:         *
030:         */package org.pdfbox.pdmodel.interactive.viewerpreferences;
031:
032:        import org.pdfbox.cos.COSBase;
033:        import org.pdfbox.cos.COSDictionary;
034:
035:        import org.pdfbox.pdmodel.common.COSObjectable;
036:
037:        /**
038:         * This is the document viewing preferences.
039:         *
040:         * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
041:         * @version $Revision: 1.3 $
042:         */
043:        public class PDViewerPreferences implements  COSObjectable {
044:            /**
045:             * From PDF Reference: "Neither document outline nor thumbnail images visible".
046:             */
047:            public static final String NON_FULL_SCREEN_PAGE_MODE_USE_NONE = "UseNone";
048:            /**
049:             * From PDF Reference: "Document outline visible".
050:             */
051:            public static final String NON_FULL_SCREEN_PAGE_MODE_USE_OUTLINES = "UseOutlines";
052:            /**
053:             * From PDF Reference: "Thumbnail images visible".
054:             */
055:            public static final String NON_FULL_SCREEN_PAGE_MODE_USE_THUMBS = "UseThumbs";
056:            /**
057:             * From PDF Reference: "Optional content group panel visible".
058:             */
059:            public static final String NON_FULL_SCREEN_PAGE_MODE_USE_OPTIONAL_CONTENT = "UseOC";
060:
061:            /**
062:             * Reading direction.
063:             */
064:            public static final String READING_DIRECTION_L2R = "L2R";
065:            /**
066:             * Reading direction.
067:             */
068:            public static final String READING_DIRECTION_R2L = "R2L";
069:
070:            /**
071:             * Boundary constant.
072:             */
073:            public static final String BOUNDARY_MEDIA_BOX = "MediaBox";
074:            /**
075:             * Boundary constant.
076:             */
077:            public static final String BOUNDARY_CROP_BOX = "CropBox";
078:            /**
079:             * Boundary constant.
080:             */
081:            public static final String BOUNDARY_BLEED_BOX = "BleedBox";
082:            /**
083:             * Boundary constant.
084:             */
085:            public static final String BOUNDARY_TRIM_BOX = "TrimBox";
086:            /**
087:             * Boundary constant.
088:             */
089:            public static final String BOUNDARY_ART_BOX = "ArtBox";
090:
091:            private COSDictionary prefs;
092:
093:            /**
094:             * Constructor that is used for a preexisting dictionary.
095:             *
096:             * @param dic The underlying dictionary.
097:             */
098:            public PDViewerPreferences(COSDictionary dic) {
099:                prefs = dic;
100:            }
101:
102:            /**
103:             * This will get the underlying dictionary that this object wraps.
104:             *
105:             * @return The underlying info dictionary.
106:             */
107:            public COSDictionary getDictionary() {
108:                return prefs;
109:            }
110:
111:            /**
112:             * Convert this standard java object to a COS object.
113:             *
114:             * @return The cos object that matches this Java object.
115:             */
116:            public COSBase getCOSObject() {
117:                return prefs;
118:            }
119:
120:            /**
121:             * Get the toolbar preference.
122:             * 
123:             * @return the toolbar preference.
124:             */
125:            public boolean hideToolbar() {
126:                return prefs.getBoolean("HideToolbar", false);
127:            }
128:
129:            /**
130:             * Set the toolbar preference.
131:             * 
132:             * @param value Set the toolbar preference.
133:             */
134:            public void setHideToolbar(boolean value) {
135:                prefs.setBoolean("HideToolbar", value);
136:            }
137:
138:            /**
139:             * Get the menubar preference.
140:             * 
141:             * @return the menubar preference.
142:             */
143:            public boolean hideMenubar() {
144:                return prefs.getBoolean("HideMenubar", false);
145:            }
146:
147:            /**
148:             * Set the menubar preference.
149:             * 
150:             * @param value Set the menubar preference.
151:             */
152:            public void setHideMenubar(boolean value) {
153:                prefs.setBoolean("HideMenubar", value);
154:            }
155:
156:            /**
157:             * Get the window UI preference.
158:             * 
159:             * @return the window UI preference.
160:             */
161:            public boolean hideWindowUI() {
162:                return prefs.getBoolean("HideWindowUI", false);
163:            }
164:
165:            /**
166:             * Set the window UI preference.
167:             * 
168:             * @param value Set the window UI preference.
169:             */
170:            public void setHideWindowUI(boolean value) {
171:                prefs.setBoolean("HideWindowUI", value);
172:            }
173:
174:            /**
175:             * Get the fit window preference.
176:             * 
177:             * @return the fit window preference.
178:             */
179:            public boolean fitWindow() {
180:                return prefs.getBoolean("FitWindow", false);
181:            }
182:
183:            /**
184:             * Set the fit window preference.
185:             * 
186:             * @param value Set the fit window preference.
187:             */
188:            public void setFitWindow(boolean value) {
189:                prefs.setBoolean("FitWindow", value);
190:            }
191:
192:            /**
193:             * Get the center window preference.
194:             * 
195:             * @return the center window preference.
196:             */
197:            public boolean centerWindow() {
198:                return prefs.getBoolean("CenterWindow", false);
199:            }
200:
201:            /**
202:             * Set the center window preference.
203:             * 
204:             * @param value Set the center window preference.
205:             */
206:            public void setCenterWindow(boolean value) {
207:                prefs.setBoolean("CenterWindow", value);
208:            }
209:
210:            /**
211:             * Get the display doc title preference.
212:             * 
213:             * @return the display doc title preference.
214:             */
215:            public boolean displayDocTitle() {
216:                return prefs.getBoolean("DisplayDocTitle", false);
217:            }
218:
219:            /**
220:             * Set the display doc title preference.
221:             * 
222:             * @param value Set the display doc title preference.
223:             */
224:            public void setDisplayDocTitle(boolean value) {
225:                prefs.setBoolean("DisplayDocTitle", value);
226:            }
227:
228:            /**
229:             * Get the non full screen page mode preference.
230:             * 
231:             * @return the non full screen page mode preference.
232:             */
233:            public String getNonFullScreenPageMode() {
234:                return prefs.getNameAsString("NonFullScreenPageMode",
235:                        NON_FULL_SCREEN_PAGE_MODE_USE_NONE);
236:            }
237:
238:            /**
239:             * Set the non full screen page mode preference.
240:             * 
241:             * @param value Set the non full screen page mode preference.
242:             */
243:            public void setNonFullScreenPageMode(String value) {
244:                prefs.setName("NonFullScreenPageMode", value);
245:            }
246:
247:            /**
248:             * Get the reading direction preference.
249:             * 
250:             * @return the reading direction preference.
251:             */
252:            public String getReadingDirection() {
253:                return prefs
254:                        .getNameAsString("Direction", READING_DIRECTION_L2R);
255:            }
256:
257:            /**
258:             * Set the reading direction preference.
259:             * 
260:             * @param value Set the reading direction preference.
261:             */
262:            public void setReadingDirection(String value) {
263:                prefs.setName("Direction", value);
264:            }
265:
266:            /**
267:             * Get the ViewArea preference.  See BOUNDARY_XXX constants.
268:             * 
269:             * @return the ViewArea preference.
270:             */
271:            public String getViewArea() {
272:                return prefs.getNameAsString("ViewArea", BOUNDARY_CROP_BOX);
273:            }
274:
275:            /**
276:             * Set the ViewArea preference.  See BOUNDARY_XXX constants.
277:             * 
278:             * @param value Set the ViewArea preference.
279:             */
280:            public void setViewArea(String value) {
281:                prefs.setName("ViewArea", value);
282:            }
283:
284:            /**
285:             * Get the ViewClip preference.  See BOUNDARY_XXX constants.
286:             * 
287:             * @return the ViewClip preference.
288:             */
289:            public String getViewClip() {
290:                return prefs.getNameAsString("ViewClip", BOUNDARY_CROP_BOX);
291:            }
292:
293:            /**
294:             * Set the ViewClip preference.  See BOUNDARY_XXX constants.
295:             * 
296:             * @param value Set the ViewClip preference.
297:             */
298:            public void setViewClip(String value) {
299:                prefs.setName("ViewClip", value);
300:            }
301:
302:            /**
303:             * Get the PrintArea preference.  See BOUNDARY_XXX constants.
304:             * 
305:             * @return the PrintArea preference.
306:             */
307:            public String getPrintArea() {
308:                return prefs.getNameAsString("PrintArea", BOUNDARY_CROP_BOX);
309:            }
310:
311:            /**
312:             * Set the PrintArea preference.  See BOUNDARY_XXX constants.
313:             * 
314:             * @param value Set the PrintArea preference.
315:             */
316:            public void setPrintArea(String value) {
317:                prefs.setName("PrintArea", value);
318:            }
319:
320:            /**
321:             * Get the PrintClip preference.  See BOUNDARY_XXX constants.
322:             * 
323:             * @return the PrintClip preference.
324:             */
325:            public String getPrintClip() {
326:                return prefs.getNameAsString("PrintClip", BOUNDARY_CROP_BOX);
327:            }
328:
329:            /**
330:             * Set the PrintClip preference.  See BOUNDARY_XXX constants.
331:             * 
332:             * @param value Set the PrintClip preference.
333:             */
334:            public void setPrintClip(String value) {
335:                prefs.setName("PrintClip", value);
336:            }
337:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.