1 19 20 package jxl.format; 21 22 26 public final class PaperSize 27 { 28 private static final int LAST_PAPER_SIZE = 89; 29 32 private int val; 33 34 37 private static PaperSize[] paperSizes = new PaperSize[LAST_PAPER_SIZE + 1]; 38 39 42 private PaperSize(int v, boolean growArray) 43 { 44 val = v; 45 46 if (v >= paperSizes.length && growArray) 47 { 48 PaperSize[] newarray = new PaperSize[v + 1]; 50 System.arraycopy(paperSizes, 0, newarray, 0, paperSizes.length); 51 paperSizes = newarray; 52 } 53 if (v < paperSizes.length) 54 { 55 paperSizes[v] = this; 56 } 57 } 58 59 62 private PaperSize(int v) 63 { 64 this(v, true); 65 } 66 67 72 public int getValue() 73 { 74 return val; 75 } 76 77 83 public static PaperSize getPaperSize(int val) 84 { 85 PaperSize p = val > paperSizes.length - 1 ? null : paperSizes[val]; 86 return p == null ? new PaperSize(val, false) : p; 87 } 88 89 90 public static final PaperSize UNDEFINED = new PaperSize(0); 91 92 93 public static final PaperSize LETTER = new PaperSize(1); 94 95 96 public static final PaperSize LETTER_SMALL = new PaperSize(2); 97 98 99 public static final PaperSize TABLOID = new PaperSize(3); 100 101 102 public static final PaperSize LEDGER = new PaperSize(4); 103 104 105 public static final PaperSize LEGAL = new PaperSize(5); 106 107 108 public static final PaperSize STATEMENT = new PaperSize(6); 109 110 111 public static final PaperSize EXECUTIVE = new PaperSize(7); 112 113 114 public static final PaperSize A3 = new PaperSize(8); 115 116 117 public static final PaperSize A4 = new PaperSize(9); 118 119 120 public static final PaperSize A4_SMALL = new PaperSize(10); 121 122 123 public static final PaperSize A5 = new PaperSize(11); 124 125 126 public static final PaperSize B4 = new PaperSize(12); 127 128 129 public static final PaperSize B5 = new PaperSize(13); 130 131 132 public static final PaperSize FOLIO = new PaperSize(14); 133 134 135 public static final PaperSize QUARTO = new PaperSize(15); 136 137 138 public static final PaperSize SIZE_10x14 = new PaperSize(16); 139 140 141 public static final PaperSize SIZE_10x17 = new PaperSize(17); 142 143 144 public static final PaperSize NOTE = new PaperSize(18); 145 146 147 public static final PaperSize ENVELOPE_9 = new PaperSize(19); 148 149 150 public static final PaperSize ENVELOPE_10 = new PaperSize(20); 151 152 153 public static final PaperSize ENVELOPE_11 = new PaperSize(21); 154 155 156 public static final PaperSize ENVELOPE_12 = new PaperSize(22); 157 158 159 public static final PaperSize ENVELOPE_14 = new PaperSize(23); 160 161 162 public static final PaperSize C = new PaperSize(24); 163 164 165 public static final PaperSize D = new PaperSize(25); 166 167 168 public static final PaperSize E = new PaperSize(26); 169 170 171 public static final PaperSize ENVELOPE_DL = new PaperSize(27); 172 173 174 public static final PaperSize ENVELOPE_C5 = new PaperSize(28); 175 176 177 public static final PaperSize ENVELOPE_C3 = new PaperSize(29); 178 179 180 public static final PaperSize ENVELOPE_C4 = new PaperSize(30); 181 182 183 public static final PaperSize ENVELOPE_C6 = new PaperSize(31); 184 185 186 public static final PaperSize ENVELOPE_C6_C5 = new PaperSize(32); 187 188 189 public static final PaperSize B4_ISO = new PaperSize(33); 190 191 192 public static final PaperSize B5_ISO = new PaperSize(34); 193 194 195 public static final PaperSize B6_ISO = new PaperSize(35); 196 197 198 public static final PaperSize ENVELOPE_ITALY = new PaperSize(36); 199 200 201 public static final PaperSize ENVELOPE_MONARCH = new PaperSize(37); 202 203 204 public static final PaperSize ENVELOPE_6_75 = new PaperSize(38); 205 206 207 public static final PaperSize US_FANFOLD = new PaperSize(39); 208 209 210 public static final PaperSize GERMAN_FANFOLD = new PaperSize(40); 211 212 213 public static final PaperSize GERMAN_LEGAL_FANFOLD = new PaperSize(41); 214 215 216 public static final PaperSize B4_ISO_2 = new PaperSize(42); 217 218 219 public static final PaperSize JAPANESE_POSTCARD = new PaperSize(43); 220 221 222 public static final PaperSize SIZE_9x11 = new PaperSize(44); 223 224 225 public static final PaperSize SIZE_10x11 = new PaperSize(45); 226 227 228 public static final PaperSize SIZE_15x11 = new PaperSize(46); 229 230 231 public static final PaperSize ENVELOPE_INVITE = new PaperSize(47); 232 233 234 235 236 public static final PaperSize LETTER_EXTRA = new PaperSize(50); 237 238 239 public static final PaperSize LEGAL_EXTRA = new PaperSize(51); 240 241 242 public static final PaperSize TABLOID_EXTRA = new PaperSize(52); 243 244 245 public static final PaperSize A4_EXTRA = new PaperSize(53); 246 247 248 public static final PaperSize LETTER_TRANSVERSE = new PaperSize(54); 249 250 251 public static final PaperSize A4_TRANSVERSE = new PaperSize(55); 252 253 254 public static final PaperSize LETTER_EXTRA_TRANSVERSE = new PaperSize(56); 255 256 257 public static final PaperSize SUPER_A_A4 = new PaperSize(57); 258 259 260 public static final PaperSize SUPER_B_A3 = new PaperSize(58); 261 262 263 public static final PaperSize LETTER_PLUS = new PaperSize(59); 264 265 266 public static final PaperSize A4_PLUS = new PaperSize(60); 267 268 269 public static final PaperSize A5_TRANSVERSE = new PaperSize(61); 270 271 272 public static final PaperSize B5_TRANSVERSE = new PaperSize(62); 273 274 275 public static final PaperSize A3_EXTRA = new PaperSize(63); 276 277 278 public static final PaperSize A5_EXTRA = new PaperSize(64); 279 280 281 public static final PaperSize B5_EXTRA = new PaperSize(65); 282 283 284 public static final PaperSize A2 = new PaperSize(66); 285 286 287 public static final PaperSize A3_TRANSVERSE = new PaperSize(67); 288 289 290 public static final PaperSize A3_EXTRA_TRANSVERSE = new PaperSize(68); 291 292 293 public static final PaperSize DOUBLE_JAPANESE_POSTCARD = new PaperSize(69); 294 295 296 public static final PaperSize A6 = new PaperSize(70); 297 298 299 300 301 public static final PaperSize LETTER_ROTATED = new PaperSize(75); 302 303 304 public static final PaperSize A3_ROTATED = new PaperSize(76); 305 306 307 public static final PaperSize A4_ROTATED = new PaperSize(77); 308 309 310 public static final PaperSize A5_ROTATED = new PaperSize(78); 311 312 313 public static final PaperSize B4_ROTATED = new PaperSize(79); 314 315 316 public static final PaperSize B5_ROTATED = new PaperSize(80); 317 318 319 public static final PaperSize JAPANESE_POSTCARD_ROTATED = new PaperSize(81); 320 321 322 public static final PaperSize DOUBLE_JAPANESE_POSTCARD_ROTATED = new PaperSize(82); 323 324 325 public static final PaperSize A6_ROTATED = new PaperSize(83); 326 327 328 329 330 public static final PaperSize B6 = new PaperSize(88); 331 332 333 public static final PaperSize B6_ROTATED = new PaperSize(89); 334 } 335 | Popular Tags |