1 26 27 package it.stefanochizzolini.clown.documents.contents; 28 29 import it.stefanochizzolini.clown.documents.contents.fonts.Font; 30 import it.stefanochizzolini.clown.documents.Document; 31 import it.stefanochizzolini.clown.objects.PdfDictionary; 32 import it.stefanochizzolini.clown.objects.PdfDirectObject; 33 import it.stefanochizzolini.clown.objects.PdfIndirectObject; 34 import it.stefanochizzolini.clown.objects.PdfName; 35 import it.stefanochizzolini.clown.objects.PdfObjectWrapper; 36 import it.stefanochizzolini.clown.objects.PdfReference; 37 import it.stefanochizzolini.clown.util.NotImplementedException; 38 39 import java.util.ArrayList ; 40 import java.util.Collection ; 41 import java.util.Map ; 42 import java.util.Set ; 43 44 47 public class Fonts 48 extends PdfObjectWrapper<PdfDictionary> 49 implements Map <PdfName,Font> 50 { 51 public Fonts( 55 Document context 56 ) 57 { 58 super( 59 context.getFile(), 60 new PdfDictionary() 61 ); 62 } 63 64 Fonts( 65 PdfDirectObject baseObject, 66 PdfIndirectObject container 67 ) 68 { 69 super( 70 baseObject, 71 container 72 ); 73 } 74 76 public Object clone( 79 Document context 80 ) 81 {throw new NotImplementedException();} 82 83 86 public PdfName getKey( 87 Font value 88 ) 89 {return getBaseDataObject().getKey(value.getBaseObject());} 90 91 public void clear( 93 ) 94 {getBaseDataObject().clear();} 95 96 public boolean containsKey( 97 Object key 98 ) 99 {return getBaseDataObject().containsKey(key);} 100 101 public boolean containsValue( 102 Object value 103 ) 104 {return getBaseDataObject().containsValue(((Font)value).getBaseObject());} 105 106 public Set <Map.Entry <PdfName,Font>> entrySet( 107 ) 108 {throw new NotImplementedException();} 109 110 public boolean equals( 111 PdfDirectObject object 112 ) 113 {throw new NotImplementedException();} 114 115 public Font get( 116 Object key 117 ) 118 { 119 return Font.wrap( 120 (PdfReference)getBaseDataObject().get(key) 121 ); 122 } 123 124 public int hashCode( 125 ) 126 {throw new NotImplementedException();} 127 128 public boolean isEmpty( 129 ) 130 {return getBaseDataObject().isEmpty();} 131 132 public Set <PdfName> keySet( 133 ) 134 {return getBaseDataObject().keySet();} 135 136 public Font put( 137 PdfName key, 138 Font value 139 ) 140 { 141 return Font.wrap( 142 (PdfReference)getBaseDataObject().put(key,value.getBaseObject()) 143 ); 144 } 145 146 public void putAll( 147 Map <? extends PdfName,? extends Font> entries 148 ) 149 {throw new NotImplementedException();} 150 151 public Font remove( 152 Object key 153 ) 154 { 155 return Font.wrap( 156 (PdfReference)getBaseDataObject().remove(key) 157 ); 158 } 159 160 public int size( 161 ) 162 {return getBaseDataObject().size();} 163 164 public Collection <Font> values( 165 ) 166 { 167 170 Collection <PdfDirectObject> objects = getBaseDataObject().values(); 172 Collection <Font> values = new ArrayList <Font>(objects.size()); 174 for(PdfDirectObject object : objects) 176 {values.add(Font.wrap((PdfReference)object));} 177 178 return values; 179 } 180 } | Popular Tags |