1 2 17 18 19 package org.apache.poi.hssf.record; 20 21 import org.apache.poi.util.BitField; 22 import org.apache.poi.util.LittleEndian; 23 24 39 40 public class ExtendedFormatRecord 41 extends Record 42 { 43 public final static short sid = 0xE0; 44 45 public final static short NULL = (short)0xfff0; 47 48 public final static short XF_STYLE = 1; 50 public final static short XF_CELL = 0; 51 52 public final static short NONE = 0x0; 54 public final static short THIN = 0x1; 55 public final static short MEDIUM = 0x2; 56 public final static short DASHED = 0x3; 57 public final static short DOTTED = 0x4; 58 public final static short THICK = 0x5; 59 public final static short DOUBLE = 0x6; 60 public final static short HAIR = 0x7; 61 public final static short MEDIUM_DASHED = 0x8; 62 public final static short DASH_DOT = 0x9; 63 public final static short MEDIUM_DASH_DOT = 0xA; 64 public final static short DASH_DOT_DOT = 0xB; 65 public final static short MEDIUM_DASH_DOT_DOT = 0xC; 66 public final static short SLANTED_DASH_DOT = 0xD; 67 68 public final static short GENERAL = 0x0; 70 public final static short LEFT = 0x1; 71 public final static short CENTER = 0x2; 72 public final static short RIGHT = 0x3; 73 public final static short FILL = 0x4; 74 public final static short JUSTIFY = 0x5; 75 public final static short CENTER_SELECTION = 0x6; 76 77 public final static short VERTICAL_TOP = 0x0; 79 public final static short VERTICAL_CENTER = 0x1; 80 public final static short VERTICAL_BOTTOM = 0x2; 81 public final static short VERTICAL_JUSTIFY = 0x3; 82 83 public final static short NO_FILL = 0 ; 85 public final static short SOLID_FILL = 1 ; 86 public final static short FINE_DOTS = 2 ; 87 public final static short ALT_BARS = 3 ; 88 public final static short SPARSE_DOTS = 4 ; 89 public final static short THICK_HORZ_BANDS = 5 ; 90 public final static short THICK_VERT_BANDS = 6 ; 91 public final static short THICK_BACKWARD_DIAG = 7 ; 92 public final static short THICK_FORWARD_DIAG = 8 ; 93 public final static short BIG_SPOTS = 9 ; 94 public final static short BRICKS = 10 ; 95 public final static short THIN_HORZ_BANDS = 11 ; 96 public final static short THIN_VERT_BANDS = 12 ; 97 public final static short THIN_BACKWARD_DIAG = 13 ; 98 public final static short THIN_FORWARD_DIAG = 14 ; 99 public final static short SQUARES = 15 ; 100 public final static short DIAMONDS = 16 ; 101 102 private short field_1_font_index; private short field_2_format_index; 106 static final private BitField _locked = new BitField(0x0001); 108 static final private BitField _hidden = new BitField(0x0002); 109 static final private BitField _xf_type = new BitField(0x0004); 110 static final private BitField _123_prefix = new BitField(0x0008); 111 static final private BitField _parent_index = new BitField(0xFFF0); 112 private short field_3_cell_options; 113 114 static final private BitField _alignment = new BitField(0x0007); 116 static final private BitField _wrap_text = new BitField(0x0008); 117 static final private BitField _vertical_alignment = new BitField(0x0070); 118 static final private BitField _justify_last = new BitField(0x0080); 119 static final private BitField _rotation = new BitField(0xFF00); 120 private short field_4_alignment_options; 121 122 static final private BitField _indent = 124 new BitField(0x000F); 125 static final private BitField _shrink_to_fit = 126 new BitField(0x0010); 127 static final private BitField _merge_cells = 128 new BitField(0x0020); 129 static final private BitField _reading_order = 130 new BitField(0x00C0); 131 132 static final private BitField _indent_not_parent_format = 134 new BitField(0x0400); 135 static final private BitField _indent_not_parent_font = 136 new BitField(0x0800); 137 static final private BitField _indent_not_parent_alignment = 138 new BitField(0x1000); 139 static final private BitField _indent_not_parent_border = 140 new BitField(0x2000); 141 static final private BitField _indent_not_parent_pattern = 142 new BitField(0x4000); 143 static final private BitField _indent_not_parent_cell_options = 144 new BitField(0x8000); 145 private short field_5_indention_options; 146 147 static final private BitField _border_left = new BitField(0x000F); 149 static final private BitField _border_right = new BitField(0x00F0); 150 static final private BitField _border_top = new BitField(0x0F00); 151 static final private BitField _border_bottom = new BitField(0xF000); 152 private short field_6_border_options; 153 154 static final private BitField _left_border_palette_idx = 157 new BitField(0x007F); 158 static final private BitField _right_border_palette_idx = 159 new BitField(0x3F80); 160 static final private BitField _diag = 161 new BitField(0xC000); 162 private short field_7_palette_options; 163 164 static final private BitField _top_border_palette_idx = 166 new BitField(0x0000007F); 167 static final private BitField _bottom_border_palette_idx = 168 new BitField(0x00003F80); 169 static final private BitField _adtl_diag = 170 new BitField(0x001fc000); 171 static final private BitField _adtl_diag_line_style = 172 new BitField(0x01e00000); 173 174 static final private BitField _adtl_fill_pattern = 176 new BitField(0xfc000000); 177 private int field_8_adtl_palette_options; 179 static final private BitField _fill_foreground = new BitField(0x007F); 181 static final private BitField _fill_background = new BitField(0x3f80); 182 183 private short field_9_fill_palette_options; 185 186 191 192 public ExtendedFormatRecord() 193 { 194 } 195 196 203 204 public ExtendedFormatRecord(short id, short size, byte [] data) 205 { 206 super(id, size, data); 207 } 208 209 217 public ExtendedFormatRecord(short id, short size, byte [] data, 218 int offset) 219 { 220 super(id, size, data, offset); 221 } 222 223 protected void validateSid(short id) 224 { 225 if (id != sid) 226 { 227 throw new RecordFormatException("NOT A EXTENDED FORMAT RECORD"); 228 } 229 } 230 231 protected void fillFields(byte [] data, short size, int offset) 232 { 233 field_1_font_index = LittleEndian.getShort(data, 234 0 + offset); 235 field_2_format_index = LittleEndian.getShort(data, 236 2 + offset); 237 field_3_cell_options = LittleEndian.getShort(data, 238 4 + offset); 239 field_4_alignment_options = LittleEndian.getShort(data, 240 6 + offset); 241 field_5_indention_options = LittleEndian.getShort(data, 242 8 + offset); 243 field_6_border_options = LittleEndian.getShort(data, 244 10 + offset); 245 field_7_palette_options = LittleEndian.getShort(data, 246 12 + offset); 247 field_8_adtl_palette_options = LittleEndian.getInt(data, 14 + offset); 248 field_9_fill_palette_options = LittleEndian.getShort(data, 249 18 + offset); 250 } 251 252 259 260 public void setFontIndex(short index) 261 { 262 field_1_font_index = index; 263 } 264 265 272 273 public void setFormatIndex(short index) 274 { 275 field_2_format_index = index; 276 } 277 278 286 287 public void setCellOptions(short options) 288 { 289 field_3_cell_options = options; 290 } 291 292 294 301 302 public void setLocked(boolean locked) 303 { 304 field_3_cell_options = _locked.setShortBoolean(field_3_cell_options, 305 locked); 306 } 307 308 315 316 public void setHidden(boolean hidden) 317 { 318 field_3_cell_options = _hidden.setShortBoolean(field_3_cell_options, 319 hidden); 320 } 321 322 331 332 public void setXFType(short type) 333 { 334 field_3_cell_options = _xf_type.setShortValue(field_3_cell_options, 335 type); 336 } 337 338 345 346 public void set123Prefix(boolean prefix) 347 { 348 field_3_cell_options = 349 _123_prefix.setShortBoolean(field_3_cell_options, prefix); 350 } 351 352 354 362 363 public void setParentIndex(short parent) 364 { 365 field_3_cell_options = 366 _parent_index.setShortValue(field_3_cell_options, parent); 367 } 368 369 371 378 379 public void setAlignmentOptions(short options) 380 { 381 field_4_alignment_options = options; 382 } 383 384 398 399 public void setAlignment(short align) 400 { 401 field_4_alignment_options = 402 _alignment.setShortValue(field_4_alignment_options, align); 403 } 404 405 412 413 public void setWrapText(boolean wrapped) 414 { 415 field_4_alignment_options = 416 _wrap_text.setShortBoolean(field_4_alignment_options, wrapped); 417 } 418 419 431 432 public void setVerticalAlignment(short align) 433 { 434 field_4_alignment_options = 435 _vertical_alignment.setShortValue(field_4_alignment_options, 436 align); 437 } 438 439 447 448 public void setJustifyLast(short justify) 449 { field_4_alignment_options = 451 _justify_last.setShortValue(field_4_alignment_options, justify); 452 } 453 454 461 462 public void setRotation(short rotation) 463 { 464 field_4_alignment_options = 465 _rotation.setShortValue(field_4_alignment_options, rotation); 466 } 467 468 476 477 public void setIndentionOptions(short options) 478 { 479 field_5_indention_options = options; 480 } 481 482 484 490 491 public void setIndent(short indent) 492 { 493 field_5_indention_options = 494 _indent.setShortValue(field_5_indention_options, indent); 495 } 496 497 504 505 public void setShrinkToFit(boolean shrink) 506 { 507 field_5_indention_options = 508 _shrink_to_fit.setShortBoolean(field_5_indention_options, shrink); 509 } 510 511 518 519 public void setMergeCells(boolean merge) 520 { 521 field_5_indention_options = 522 _merge_cells.setShortBoolean(field_5_indention_options, merge); 523 } 524 525 532 533 public void setReadingOrder(short order) 534 { field_5_indention_options = 536 _reading_order.setShortValue(field_5_indention_options, order); 537 } 538 539 547 548 public void setIndentNotParentFormat(boolean parent) 549 { 550 field_5_indention_options = 551 _indent_not_parent_format 552 .setShortBoolean(field_5_indention_options, parent); 553 } 554 555 563 564 public void setIndentNotParentFont(boolean font) 565 { 566 field_5_indention_options = 567 _indent_not_parent_font.setShortBoolean(field_5_indention_options, 568 font); 569 } 570 571 579 580 public void setIndentNotParentAlignment(boolean alignment) 581 { 582 field_5_indention_options = 583 _indent_not_parent_alignment 584 .setShortBoolean(field_5_indention_options, alignment); 585 } 586 587 595 596 public void setIndentNotParentBorder(boolean border) 597 { 598 field_5_indention_options = 599 _indent_not_parent_border 600 .setShortBoolean(field_5_indention_options, border); 601 } 602 603 611 612 public void setIndentNotParentPattern(boolean pattern) 613 { 614 field_5_indention_options = 615 _indent_not_parent_pattern 616 .setShortBoolean(field_5_indention_options, pattern); 617 } 618 619 627 628 public void setIndentNotParentCellOptions(boolean options) 629 { 630 field_5_indention_options = 631 _indent_not_parent_cell_options 632 .setShortBoolean(field_5_indention_options, options); 633 } 634 635 637 644 645 public void setBorderOptions(short options) 646 { 647 field_6_border_options = options; 648 } 649 650 652 673 674 public void setBorderLeft(short border) 675 { 676 field_6_border_options = 677 _border_left.setShortValue(field_6_border_options, border); 678 } 679 680 701 702 public void setBorderRight(short border) 703 { 704 field_6_border_options = 705 _border_right.setShortValue(field_6_border_options, border); 706 } 707 708 729 730 public void setBorderTop(short border) 731 { 732 field_6_border_options = 733 _border_top.setShortValue(field_6_border_options, border); 734 } 735 736 757 758 public void setBorderBottom(short border) 759 { 760 field_6_border_options = 761 _border_bottom.setShortValue(field_6_border_options, border); 762 } 763 764 766 774 775 public void setPaletteOptions(short options) 776 { 777 field_7_palette_options = options; 778 } 779 780 782 789 790 public void setLeftBorderPaletteIdx(short border) 791 { 792 field_7_palette_options = 793 _left_border_palette_idx.setShortValue(field_7_palette_options, 794 border); 795 } 796 797 804 805 public void setRightBorderPaletteIdx(short border) 806 { 807 field_7_palette_options = 808 _right_border_palette_idx.setShortValue(field_7_palette_options, 809 border); 810 } 811 812 815 822 823 public void setDiag(short diag) 824 { 825 field_7_palette_options = _diag.setShortValue(field_7_palette_options, 826 diag); 827 } 828 829 831 839 840 public void setAdtlPaletteOptions(short options) 841 { 842 field_8_adtl_palette_options = options; 843 } 844 845 847 854 855 public void setTopBorderPaletteIdx(short border) 856 { 857 field_8_adtl_palette_options = 858 _top_border_palette_idx.setValue(field_8_adtl_palette_options, 859 border); 860 } 861 862 869 870 public void setBottomBorderPaletteIdx(short border) 871 { 872 field_8_adtl_palette_options = 873 _bottom_border_palette_idx.setValue(field_8_adtl_palette_options, 874 border); 875 } 876 877 885 886 public void setAdtlDiag(short diag) 887 { 888 field_8_adtl_palette_options = 889 _adtl_diag.setValue(field_8_adtl_palette_options, diag); 890 } 891 892 913 914 public void setAdtlDiagLineStyle(short diag) 915 { 916 field_8_adtl_palette_options = 917 _adtl_diag_line_style.setValue(field_8_adtl_palette_options, 918 diag); 919 } 920 921 945 946 public void setAdtlFillPattern(short fill) 947 { 948 field_8_adtl_palette_options = 949 _adtl_fill_pattern.setValue(field_8_adtl_palette_options, fill); 950 } 951 952 954 961 962 public void setFillPaletteOptions(short options) 963 { 964 field_9_fill_palette_options = options; 965 } 966 967 974 975 public void setFillForeground(short color) 976 { 977 field_9_fill_palette_options = 978 _fill_foreground.setShortValue(field_9_fill_palette_options, 979 color); 980 } 981 982 989 990 public void setFillBackground(short color) 991 { 992 field_9_fill_palette_options = 993 _fill_background.setShortValue(field_9_fill_palette_options, 994 color); 995 } 996 997 1004 1005 public short getFontIndex() 1006 { 1007 return field_1_font_index; 1008 } 1009 1010 1017 1018 public short getFormatIndex() 1019 { 1020 return field_2_format_index; 1021 } 1022 1023 1031 1032 public short getCellOptions() 1033 { 1034 return field_3_cell_options; 1035 } 1036 1037 1039 1046 1047 public boolean isLocked() 1048 { 1049 return _locked.isSet(field_3_cell_options); 1050 } 1051 1052 1059 1060 public boolean isHidden() 1061 { 1062 return _hidden.isSet(field_3_cell_options); 1063 } 1064 1065 1074 1075 public short getXFType() 1076 { 1077 return _xf_type.getShortValue(field_3_cell_options); 1078 } 1079 1080 1087 1088 public boolean get123Prefix() 1089 { 1090 return _123_prefix.isSet(field_3_cell_options); 1091 } 1092 1093 1101 1102 public short getParentIndex() 1103 { 1104 return _parent_index.getShortValue(field_3_cell_options); 1105 } 1106 1107 1109 1116 1117 public short getAlignmentOptions() 1118 { 1119 return field_4_alignment_options; 1120 } 1121 1122 1124 1138 1139 public short getAlignment() 1140 { 1141 return _alignment.getShortValue(field_4_alignment_options); 1142 } 1143 1144 1151 1152 public boolean getWrapText() 1153 { 1154 return _wrap_text.isSet(field_4_alignment_options); 1155 } 1156 1157 1169 1170 public short getVerticalAlignment() 1171 { 1172 return _vertical_alignment.getShortValue(field_4_alignment_options); 1173 } 1174 1175 1183 1184 public short getJustifyLast() 1185 { return _justify_last.getShortValue(field_4_alignment_options); 1187 } 1188 1189 1196 1197 public short getRotation() 1198 { 1199 return _rotation.getShortValue(field_4_alignment_options); 1200 } 1201 1202 1204 1212 1213 public short getIndentionOptions() 1214 { 1215 return field_5_indention_options; 1216 } 1217 1218 1220 1226 1227 public short getIndent() 1228 { 1229 return _indent.getShortValue(field_5_indention_options); 1230 } 1231 1232 1239 1240 public boolean getShrinkToFit() 1241 { 1242 return _shrink_to_fit.isSet(field_5_indention_options); 1243 } 1244 1245 1252 1253 public boolean getMergeCells() 1254 { 1255 return _merge_cells.isSet(field_5_indention_options); 1256 } 1257 1258 1265 1266 public short getReadingOrder() 1267 { return _reading_order.getShortValue(field_5_indention_options); 1269 } 1270 1271 1279 1280 public boolean isIndentNotParentFormat() 1281 { 1282 return _indent_not_parent_format.isSet(field_5_indention_options); 1283 } 1284 1285 1293 1294 public boolean isIndentNotParentFont() 1295 { 1296 return _indent_not_parent_font.isSet(field_5_indention_options); 1297 } 1298 1299 1307 1308 public boolean isIndentNotParentAlignment() 1309 { 1310 return _indent_not_parent_alignment.isSet(field_5_indention_options); 1311 } 1312 1313 1321 1322 public boolean isIndentNotParentBorder() 1323 { 1324 return _indent_not_parent_border.isSet(field_5_indention_options); 1325 } 1326 1327 1335 1336 public boolean isIndentNotParentPattern() 1337 { 1338 return _indent_not_parent_pattern.isSet(field_5_indention_options); 1339 } 1340 1341 1349 1350 public boolean isIndentNotParentCellOptions() 1351 { 1352 return _indent_not_parent_cell_options 1353 .isSet(field_5_indention_options); 1354 } 1355 1356 1359 1366 1367 public short getBorderOptions() 1368 { 1369 return field_6_border_options; 1370 } 1371 1372 1374 1395 1396 public short getBorderLeft() 1397 { 1398 return _border_left.getShortValue(field_6_border_options); 1399 } 1400 1401 1422 1423 public short getBorderRight() 1424 { 1425 return _border_right.getShortValue(field_6_border_options); 1426 } 1427 1428 1449 1450 public short getBorderTop() 1451 { 1452 return _border_top.getShortValue(field_6_border_options); 1453 } 1454 1455 1476 1477 public short getBorderBottom() 1478 { 1479 return _border_bottom.getShortValue(field_6_border_options); 1480 } 1481 1482 1484 1492 1493 public short getPaletteOptions() 1494 { 1495 return field_7_palette_options; 1496 } 1497 1498 1500 1507 1508 public short getLeftBorderPaletteIdx() 1509 { 1510 return _left_border_palette_idx 1511 .getShortValue(field_7_palette_options); 1512 } 1513 1514 1521 1522 public short getRightBorderPaletteIdx() 1523 { 1524 return _right_border_palette_idx 1525 .getShortValue(field_7_palette_options); 1526 } 1527 1528 1531 1538 1539 public short getDiag() 1540 { 1541 return _diag.getShortValue(field_7_palette_options); 1542 } 1543 1544 1547 1555 1556 public int getAdtlPaletteOptions() 1557 { 1558 return field_8_adtl_palette_options; 1559 } 1560 1561 1563 1570 1571 public short getTopBorderPaletteIdx() 1572 { 1573 return ( short ) _top_border_palette_idx 1574 .getValue(field_8_adtl_palette_options); 1575 } 1576 1577 1584 1585 public short getBottomBorderPaletteIdx() 1586 { 1587 return ( short ) _bottom_border_palette_idx 1588 .getValue(field_8_adtl_palette_options); 1589 } 1590 1591 1599 1600 public short getAdtlDiag() 1601 { 1602 return ( short ) _adtl_diag.getValue(field_8_adtl_palette_options); 1603 } 1604 1605 1626 1627 public short getAdtlDiagLineStyle() 1628 { 1629 return ( short ) _adtl_diag_line_style 1630 .getValue(field_8_adtl_palette_options); 1631 } 1632 1633 1657 1658 public short getAdtlFillPattern() 1659 { 1660 return ( short ) _adtl_fill_pattern 1661 .getValue(field_8_adtl_palette_options); 1662 } 1663 1664 1667 1674 1675 public short getFillPaletteOptions() 1676 { 1677 return field_9_fill_palette_options; 1678 } 1679 1680 1682 1689 1690 public short getFillForeground() 1691 { 1692 return _fill_foreground.getShortValue(field_9_fill_palette_options); 1693 } 1694 1695 1701 1702 public short getFillBackground() 1703 { 1704 return _fill_background.getShortValue(field_9_fill_palette_options); 1705 } 1706 1707 public String toString() 1708 { 1709 StringBuffer buffer = new StringBuffer (); 1710 1711 buffer.append("[EXTENDEDFORMAT]\n"); 1712 if (getXFType() == XF_STYLE) 1713 { 1714 buffer.append(" STYLE_RECORD_TYPE\n"); 1715 } 1716 else if (getXFType() == XF_CELL) 1717 { 1718 buffer.append(" CELL_RECORD_TYPE\n"); 1719 } 1720 buffer.append(" .fontindex = ") 1721 .append(Integer.toHexString(getFontIndex())).append("\n"); 1722 buffer.append(" .formatindex = ") 1723 .append(Integer.toHexString(getFormatIndex())).append("\n"); 1724 buffer.append(" .celloptions = ") 1725 .append(Integer.toHexString(getCellOptions())).append("\n"); 1726 buffer.append(" .islocked = ").append(isLocked()) 1727 .append("\n"); 1728 buffer.append(" .ishidden = ").append(isHidden()) 1729 .append("\n"); 1730 buffer.append(" .recordtype= ") 1731 .append(Integer.toHexString(getXFType())).append("\n"); 1732 buffer.append(" .parentidx = ") 1733 .append(Integer.toHexString(getParentIndex())).append("\n"); 1734 buffer.append(" .alignmentoptions= ") 1735 .append(Integer.toHexString(getAlignmentOptions())).append("\n"); 1736 buffer.append(" .alignment = ").append(getAlignment()) 1737 .append("\n"); 1738 buffer.append(" .wraptext = ").append(getWrapText()) 1739 .append("\n"); 1740 buffer.append(" .valignment= ") 1741 .append(Integer.toHexString(getVerticalAlignment())).append("\n"); 1742 buffer.append(" .justlast = ") 1743 .append(Integer.toHexString(getJustifyLast())).append("\n"); 1744 buffer.append(" .rotation = ") 1745 .append(Integer.toHexString(getRotation())).append("\n"); 1746 buffer.append(" .indentionoptions= ") 1747 .append(Integer.toHexString(getIndentionOptions())).append("\n"); 1748 buffer.append(" .indent = ") 1749 .append(Integer.toHexString(getIndent())).append("\n"); 1750 buffer.append(" .shrinktoft= ").append(getShrinkToFit()) 1751 .append("\n"); 1752 buffer.append(" .mergecells= ").append(getMergeCells()) 1753 .append("\n"); 1754 buffer.append(" .readngordr= ") 1755 .append(Integer.toHexString(getReadingOrder())).append("\n"); 1756 buffer.append(" .formatflag= ") 1757 .append(isIndentNotParentFormat()).append("\n"); 1758 buffer.append(" .fontflag = ") 1759 .append(isIndentNotParentFont()).append("\n"); 1760 buffer.append(" .prntalgnmt= ") 1761 .append(isIndentNotParentAlignment()).append("\n"); 1762 buffer.append(" .borderflag= ") 1763 .append(isIndentNotParentBorder()).append("\n"); 1764 buffer.append(" .paternflag= ") 1765 .append(isIndentNotParentPattern()).append("\n"); 1766 buffer.append(" .celloption= ") 1767 .append(isIndentNotParentCellOptions()).append("\n"); 1768 buffer.append(" .borderoptns = ") 1769 .append(Integer.toHexString(getBorderOptions())).append("\n"); 1770 buffer.append(" .lftln = ") 1771 .append(Integer.toHexString(getBorderLeft())).append("\n"); 1772 buffer.append(" .rgtln = ") 1773 .append(Integer.toHexString(getBorderRight())).append("\n"); 1774 buffer.append(" .topln = ") 1775 .append(Integer.toHexString(getBorderTop())).append("\n"); 1776 buffer.append(" .btmln = ") 1777 .append(Integer.toHexString(getBorderBottom())).append("\n"); 1778 buffer.append(" .paleteoptns = ") 1779 .append(Integer.toHexString(getPaletteOptions())).append("\n"); 1780 buffer.append(" .leftborder= ") 1781 .append(Integer.toHexString(getLeftBorderPaletteIdx())) 1782 .append("\n"); 1783 buffer.append(" .rghtborder= ") 1784 .append(Integer.toHexString(getRightBorderPaletteIdx())) 1785 .append("\n"); 1786 buffer.append(" .diag = ") 1787 .append(Integer.toHexString(getDiag())).append("\n"); 1788 buffer.append(" .paleteoptn2 = ") 1789 .append(Integer.toHexString(getAdtlPaletteOptions())) 1790 .append("\n"); 1791 buffer.append(" .topborder = ") 1792 .append(Integer.toHexString(getTopBorderPaletteIdx())) 1793 .append("\n"); 1794 buffer.append(" .botmborder= ") 1795 .append(Integer.toHexString(getBottomBorderPaletteIdx())) 1796 .append("\n"); 1797 buffer.append(" .adtldiag = ") 1798 .append(Integer.toHexString(getAdtlDiag())).append("\n"); 1799 buffer.append(" .diaglnstyl= ") 1800 .append(Integer.toHexString(getAdtlDiagLineStyle())).append("\n"); 1801 buffer.append(" .fillpattrn= ") 1802 .append(Integer.toHexString(getAdtlFillPattern())).append("\n"); 1803 buffer.append(" .fillpaloptn = ") 1804 .append(Integer.toHexString(getFillPaletteOptions())) 1805 .append("\n"); 1806 buffer.append(" .foreground= ") 1807 .append(Integer.toHexString(getFillForeground())).append("\n"); 1808 buffer.append(" .background= ") 1809 .append(Integer.toHexString(getFillBackground())).append("\n"); 1810 buffer.append("[/EXTENDEDFORMAT]\n"); 1811 return buffer.toString(); 1812 } 1813 1814 public int serialize(int offset, byte [] data) 1815 { 1816 LittleEndian.putShort(data, 0 + offset, sid); 1817 LittleEndian.putShort(data, 2 + offset, 1818 ( short ) (20)); LittleEndian.putShort(data, 4 + offset, getFontIndex()); 1820 LittleEndian.putShort(data, 6 + offset, getFormatIndex()); 1821 LittleEndian.putShort(data, 8 + offset, getCellOptions()); 1822 LittleEndian.putShort(data, 10 + offset, getAlignmentOptions()); 1823 LittleEndian.putShort(data, 12 + offset, getIndentionOptions()); 1824 LittleEndian.putShort(data, 14 + offset, getBorderOptions()); 1825 LittleEndian.putShort(data, 16 + offset, getPaletteOptions()); 1826 LittleEndian.putInt(data, 18 + offset, getAdtlPaletteOptions()); 1827 LittleEndian.putShort(data, 22 + offset, getFillPaletteOptions()); 1828 return getRecordSize(); 1829 } 1830 1831 public int getRecordSize() 1832 { 1833 return 24; 1834 } 1835 1836 public short getSid() 1837 { 1838 return this.sid; 1839 } 1840} 1841 | Popular Tags |