1 47 package com.lowagie.text; 48 49 import com.lowagie.text.factories.GreekNumberFactory; 50 51 57 58 public class GreekList extends List { 59 60 62 65 public GreekList() { 66 super(true); 67 setGreekFont(); 68 } 69 74 public GreekList(int symbolIndent) { 75 super(true, symbolIndent); 76 setGreekFont(); 77 } 78 79 84 public GreekList(boolean greeklower, int symbolIndent) { 85 super(true, symbolIndent); 86 lowercase = greeklower; 87 setGreekFont(); 88 } 89 90 92 95 protected void setGreekFont() { 96 float fontsize = symbol.getFont().getSize(); 97 symbol.setFont(FontFactory.getFont(FontFactory.SYMBOL, fontsize, Font.NORMAL)); 98 } 99 100 102 108 public boolean add(Object o) { 109 if (o instanceof ListItem) { 110 ListItem item = (ListItem) o; 111 Chunk chunk = new Chunk(GreekNumberFactory.getString(first + list.size(), lowercase), symbol.getFont()); 112 chunk.append(". "); 113 item.setListSymbol(chunk); 114 item.setIndentationLeft(symbolIndent, autoindent); 115 item.setIndentationRight(0); 116 list.add(item); 117 } else if (o instanceof List) { 118 List nested = (List) o; 119 nested.setIndentationLeft(nested.getIndentationLeft() + symbolIndent); 120 first--; 121 return list.add(nested); 122 } else if (o instanceof String ) { 123 return this.add(new ListItem((String ) o)); 124 } 125 return false; 126 } 127 128 130 138 public static int[] getGreekValue(int index, boolean lowercase) { 139 byte[] result = GreekNumberFactory.getString(index, lowercase).getBytes(); 140 int n = result.length; 141 int[] r = new int[n]; 142 System.arraycopy(result, 0, r, 0, n); 143 return r; 144 } 145 146 152 public void setGreekLower(boolean greeklower) { 153 setLowercase(greeklower); 154 } 155 156 162 public boolean isGreekLower() { 163 return isLowercase(); 164 } 165 } 166 | Popular Tags |