1 50 51 package com.lowagie.text.pdf; 52 53 58 59 public class PdfBorderDictionary extends PdfDictionary { 60 61 public static final int STYLE_SOLID = 0; 62 public static final int STYLE_DASHED = 1; 63 public static final int STYLE_BEVELED = 2; 64 public static final int STYLE_INSET = 3; 65 public static final int STYLE_UNDERLINE = 4; 66 68 71 72 public PdfBorderDictionary(float borderWidth, int borderStyle, PdfDashPattern dashes) { 73 put(PdfName.W, new PdfNumber(borderWidth)); 74 switch (borderStyle) { 75 case STYLE_SOLID: 76 put(PdfName.S, PdfName.S); 77 break; 78 case STYLE_DASHED: 79 if (dashes != null) 80 put(PdfName.D, dashes); 81 put(PdfName.S, PdfName.D); 82 break; 83 case STYLE_BEVELED: 84 put(PdfName.S, PdfName.B); 85 break; 86 case STYLE_INSET: 87 put(PdfName.S, PdfName.I); 88 break; 89 case STYLE_UNDERLINE: 90 put(PdfName.S, PdfName.U); 91 break; 92 default: 93 throw new IllegalArgumentException ("Invalid border style."); 94 } 95 } 96 97 public PdfBorderDictionary(float borderWidth, int borderStyle) { 98 this(borderWidth, borderStyle, null); 99 } 100 } | Popular Tags |