1 19 20 package jxl.write.biff; 21 22 import jxl.biff.IntegerHelper; 23 import jxl.biff.FontRecord; 24 import jxl.biff.FormatRecord; 25 import jxl.biff.XFRecord; 26 import jxl.biff.DisplayFormat; 27 import jxl.format.Alignment; 28 import jxl.format.VerticalAlignment; 29 import jxl.format.BorderLineStyle; 30 import jxl.format.Border; 31 import jxl.format.Colour; 32 import jxl.format.Pattern; 33 import jxl.format.Orientation; 34 import jxl.format.CellFormat; 35 import jxl.write.WriteException; 36 37 40 public class CellXFRecord extends XFRecord 41 { 42 48 protected CellXFRecord(FontRecord fnt, DisplayFormat form ) 49 { 50 super(fnt, form); 51 setXFDetails(XFRecord.cell,0); 52 } 53 54 59 CellXFRecord(XFRecord fmt ) 60 { 61 super(fmt); 62 setXFDetails(XFRecord.cell,0); 63 } 64 65 69 protected CellXFRecord(CellFormat format) 70 { 71 super(format); 72 } 73 74 80 public void setAlignment(Alignment a) throws WriteException 81 { 82 if (isInitialized()) 83 { 84 throw new JxlWriteException(JxlWriteException.formatInitialized); 85 } 86 super.setXFAlignment(a); 87 } 88 89 96 public void setBackground(Colour c, Pattern p) throws WriteException 97 { 98 if (isInitialized()) 99 { 100 throw new JxlWriteException(JxlWriteException.formatInitialized); 101 } 102 super.setXFBackground(c, p); 103 super.setXFCellOptions(0x4000); 104 } 105 106 112 public void setLocked(boolean l) throws WriteException 113 { 114 if (isInitialized()) 115 { 116 throw new JxlWriteException(JxlWriteException.formatInitialized); 117 } 118 super.setXFLocked(l); 119 super.setXFCellOptions(0x8000); 120 } 121 122 127 public void setIndentation(int i) throws WriteException 128 { 129 if (isInitialized()) 130 { 131 throw new JxlWriteException(JxlWriteException.formatInitialized); 132 } 133 super.setXFIndentation(i); 134 } 135 136 141 public void setShrinkToFit(boolean s) throws WriteException 142 { 143 if (isInitialized()) 144 { 145 throw new JxlWriteException(JxlWriteException.formatInitialized); 146 } 147 super.setXFShrinkToFit(s); 148 } 149 150 156 public void setVerticalAlignment(VerticalAlignment va) 157 throws WriteException 158 { 159 if (isInitialized()) 160 { 161 throw new JxlWriteException(JxlWriteException.formatInitialized); 162 } 163 164 super.setXFVerticalAlignment(va); 165 } 166 167 173 public void setOrientation(Orientation o) 174 throws WriteException 175 { 176 if (isInitialized()) 177 { 178 throw new JxlWriteException(JxlWriteException.formatInitialized); 179 } 180 181 super.setXFOrientation(o); 182 } 183 184 192 public void setWrap(boolean w) throws WriteException 193 { 194 if (isInitialized()) 195 { 196 throw new JxlWriteException(JxlWriteException.formatInitialized); 197 } 198 199 super.setXFWrap(w); 200 } 201 202 209 public void setBorder(Border b, BorderLineStyle ls, Colour c) 210 throws WriteException 211 { 212 if (isInitialized()) 213 { 214 throw new JxlWriteException(JxlWriteException.formatInitialized); 215 } 216 217 if (b == Border.ALL) 218 { 219 super.setXFBorder(Border.LEFT, ls, c); 221 super.setXFBorder(Border.RIGHT, ls, c); 222 super.setXFBorder(Border.TOP, ls, c); 223 super.setXFBorder(Border.BOTTOM, ls, c); 224 return; 225 } 226 227 if (b == Border.NONE) 228 { 229 super.setXFBorder(Border.LEFT, BorderLineStyle.NONE, Colour.BLACK); 231 super.setXFBorder(Border.RIGHT, BorderLineStyle.NONE, Colour.BLACK); 232 super.setXFBorder(Border.TOP, BorderLineStyle.NONE, Colour.BLACK); 233 super.setXFBorder(Border.BOTTOM, BorderLineStyle.NONE, Colour.BLACK); 234 return; 235 } 236 237 super.setXFBorder(b, ls, c); 238 } 239 } 240 241 | Popular Tags |