1 31 package org.pdfbox.pdmodel.interactive.annotation; 32 33 import java.io.IOException ; 34 35 import org.pdfbox.cos.COSDictionary; 36 import org.pdfbox.cos.COSName; 37 38 45 public class PDAnnotationPopup extends PDAnnotation 46 { 47 48 51 public static final String SUB_TYPE = "Popup"; 52 53 56 public PDAnnotationPopup() 57 { 58 super(); 59 getDictionary() 60 .setItem( COSName.SUBTYPE, COSName.getPDFName( SUB_TYPE ) ); 61 } 62 63 70 public PDAnnotationPopup( COSDictionary field ) 71 { 72 super( field ); 73 } 74 75 81 public void setOpen( boolean open ) 82 { 83 getDictionary().setBoolean( "Open" , open ); 84 } 85 86 92 public boolean getOpen() 93 { 94 return getDictionary().getBoolean( "Open" , false ); 95 } 96 97 103 public void setParent( PDAnnotationMarkup annot ) 104 { 105 getDictionary().setItem( COSName.PARENT, annot.getDictionary() ); 106 } 107 108 113 public PDAnnotationMarkup getParent() 114 { 115 PDAnnotationMarkup am = null; 116 try 117 { 118 am = (PDAnnotationMarkup) 119 PDAnnotation.createAnnotation( getDictionary().getDictionaryObject( "Parent", "P" ) ); 120 } 121 catch (IOException ioe) 122 { 123 } 125 return am; 126 } 127 128 } | Popular Tags |