1 package com.etymon.pj.object; 2 3 import java.io.*; 4 import java.util.*; 5 import com.etymon.pj.*; 6 import com.etymon.pj.exception.*; 7 8 12 public class PjPage 13 extends PjPagesNode { 14 15 18 public PjPage() { 19 super(); 20 _h.put(PjName.TYPE, PjName.PAGE); 21 } 22 23 27 public PjPage(Hashtable h) { 28 super(h); 29 } 30 31 public void setContents(PjArray contents) { 32 _h.put(PjName.CONTENTS, contents); 33 } 34 35 public void setContents(PjReference contents) { 36 _h.put(PjName.CONTENTS, contents); 37 } 38 39 public PjObject getContents() throws InvalidPdfObjectException { 40 return hget(PjName.CONTENTS); 41 } 42 43 public void setThumb(PjReference thumb) { 44 _h.put(PjName.THUMB, thumb); 45 } 46 47 public PjReference getThumb() throws InvalidPdfObjectException { 48 return hgetReference(PjName.THUMB); 49 } 50 51 public void setAnnots(PjArray annots) { 52 _h.put(PjName.ANNOTS, annots); 53 } 54 55 public void setAnnots(PjReference annots) { 56 _h.put(PjName.ANNOTS, annots); 57 } 58 59 public PjObject getAnnots() throws InvalidPdfObjectException { 60 return hget(PjName.ANNOTS); 61 } 62 63 public void setB(PjArray b) { 64 _h.put(PjName.B, b); 65 } 66 67 public void setB(PjReference b) { 68 _h.put(PjName.B, b); 69 } 70 71 public PjObject getB() throws InvalidPdfObjectException { 72 return hget(PjName.B); 73 } 74 75 81 public static boolean isLike(PjDictionary dictionary) { 82 Hashtable h = dictionary.getHashtable(); 83 try { 85 PjName type = (PjName)(h.get(PjName.TYPE)); 86 if (type == null) { 87 return false; 88 } 89 if ( ! type.equals(PjName.PAGE) ) { 90 return false; 91 } 92 } 93 catch (ClassCastException e) { 94 return false; 95 } 96 return true; 97 } 98 99 104 public Object clone() throws CloneNotSupportedException { 105 return new PjPage(cloneHt()); 106 } 107 108 } 109 | Popular Tags |