1 31 package org.pdfbox.pdmodel.interactive.annotation; 32 33 import org.pdfbox.cos.COSArray; 34 import org.pdfbox.cos.COSDictionary; 35 import org.pdfbox.cos.COSName; 36 import org.pdfbox.pdmodel.graphics.color.PDGamma; 37 import org.pdfbox.pdmodel.common.PDRectangle; 38 39 46 public class PDAnnotationSquareCircle extends PDAnnotationMarkup 47 { 48 49 52 public static final String SUB_TYPE_SQUARE = "Square"; 53 56 public static final String SUB_TYPE_CIRCLE = "Circle"; 57 58 private PDAnnotationSquareCircle() 59 { 60 } 62 63 64 69 public PDAnnotationSquareCircle( String subType ) 70 { 71 super(); 72 setSubtype( subType ); 73 } 74 75 82 public PDAnnotationSquareCircle( COSDictionary field ) 83 { 84 super( field ); 85 } 86 87 88 96 public void setInteriorColour( PDGamma ic ) 97 { 98 getDictionary().setItem( "IC", ic ); 99 } 100 101 109 public PDGamma getInteriorColour() 110 { 111 112 COSArray ic = (COSArray) getDictionary().getItem( 113 COSName.getPDFName( "IC" ) ); 114 if (ic != null) 115 { 116 return new PDGamma( ic ); 117 } 118 else 119 { 120 return null; 121 } 122 } 123 124 125 132 public void setBorderEffect( PDBorderEffectDictionary be ) 133 { 134 getDictionary().setItem( "BE", be ); 135 } 136 137 143 public PDBorderEffectDictionary getBorderEffect() 144 { 145 COSDictionary be = (COSDictionary) getDictionary().getDictionaryObject( "BE" ); 146 if (be != null) 147 { 148 return new PDBorderEffectDictionary( be ); 149 } 150 else 151 { 152 return null; 153 } 154 } 155 156 164 public void setRectDifference( PDRectangle rd ) 165 { 166 getDictionary().setItem( "RD", rd ); 167 } 168 169 176 public PDRectangle getRectDifference() 177 { 178 COSArray rd = (COSArray) getDictionary().getDictionaryObject( "RD" ); 179 if (rd != null) 180 { 181 return new PDRectangle( rd ); 182 } 183 else 184 { 185 return null; 186 } 187 } 188 189 195 public void setSubtype( String subType ) 196 { 197 getDictionary().setName( COSName.SUBTYPE, subType ); 198 } 199 200 206 public String getSubtype() 207 { 208 return getDictionary().getNameAsString( COSName.SUBTYPE); 209 } 210 211 } | Popular Tags |