1 47 package com.lowagie.text; 48 49 56 57 public class ZapfDingbatsList extends List { 58 59 62 protected int zn; 63 64 69 public ZapfDingbatsList(int zn) { 70 super(true); 71 this.zn = zn; 72 float fontsize = symbol.getFont().getSize(); 73 symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL)); 74 } 75 76 82 public ZapfDingbatsList(int zn, int symbolIndent) { 83 super(true, symbolIndent); 84 this.zn = zn; 85 float fontsize = symbol.getFont().getSize(); 86 symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL)); 87 } 88 89 93 public void setCharNumber(int zn) { 94 this.zn = zn; 95 } 96 97 102 public int getCharNumber() { 103 return zn; 104 } 105 106 112 public boolean add(Object o) { 113 if (o instanceof ListItem) { 114 ListItem item = (ListItem) o; 115 Chunk chunk = new Chunk((char)zn, symbol.getFont()); 116 chunk.append(" "); 117 item.setListSymbol(chunk); 118 item.setIndentationLeft(symbolIndent, autoindent); 119 item.setIndentationRight(0); 120 list.add(item); 121 } else if (o instanceof List) { 122 List nested = (List) o; 123 nested.setIndentationLeft(nested.getIndentationLeft() + symbolIndent); 124 first--; 125 return list.add(nested); 126 } else if (o instanceof String ) { 127 return this.add(new ListItem((String ) o)); 128 } 129 return false; 130 } 131 } 132 | Popular Tags |