Class ExtendedFormatRecord

java.lang.Object
loci.poi.hssf.record.Record
loci.poi.hssf.record.ExtendedFormatRecord

public class ExtendedFormatRecord extends Record
Title: Extended Format Record Description: Probably one of the more complex records. There are two breeds: Style and Cell.

It should be noted that fields in the extended format record are somewhat arbitrary. Almost all of the fields are bit-level, but we name them as best as possible by functional group. In some places this is better than others.

REFERENCE: PG 426 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)

Version:
2.0-pre
Author:
Andrew C. Oliver (acoliver at apache dot org)
  • Field Details

  • Constructor Details

    • ExtendedFormatRecord

      public ExtendedFormatRecord()
      Constructor ExtendedFormatRecord
    • ExtendedFormatRecord

      public ExtendedFormatRecord(RecordInputStream in)
      Constructs an ExtendedFormat record and sets its fields appropriately.
      Parameters:
      in - the RecordInputstream to read the record from
  • Method Details

    • validateSid

      protected void validateSid(short id)
      Description copied from class: Record
      called by constructor, should throw runtime exception in the event of a record passed with a differing ID.
      Specified by:
      validateSid in class Record
      Parameters:
      id - alleged id for this record
    • fillFields

      protected void fillFields(RecordInputStream in)
      Description copied from class: Record
      called by the constructor, should set class level fields. Should throw runtime exception for bad/icomplete data.
      Specified by:
      fillFields in class Record
      Parameters:
      in - the RecordInputstream to read the record from
    • setFontIndex

      public void setFontIndex(short index)
      set the index to the FONT record (which font to use 0 based)
      Parameters:
      index - to the font
      See Also:
    • setFormatIndex

      public void setFormatIndex(short index)
      set the index to the Format record (which FORMAT to use 0-based)
      Parameters:
      index - to the format record
      See Also:
    • setCellOptions

      public void setCellOptions(short options)
      sets the options bitmask - you can also use corresponding option bit setters (see other methods that reference this one)
      Parameters:
      options - bitmask to set
    • setLocked

      public void setLocked(boolean locked)
      set whether the cell is locked or not
      Parameters:
      locked - - if the cell is locked
      See Also:
    • setHidden

      public void setHidden(boolean hidden)
      set whether the cell is hidden or not
      Parameters:
      hidden - - if the cell is hidden
      See Also:
    • setXFType

      public void setXFType(short type)
      set whether the cell is a cell or style XFRecord
      Parameters:
      type - - cell or style (0/1)
      See Also:
    • set123Prefix

      public void set123Prefix(boolean prefix)
      set some old holdover from lotus 123. Who cares, its all over for Lotus. RIP Lotus.
      Parameters:
      prefix - - the lotus thing to set.
      See Also:
    • setParentIndex

      public void setParentIndex(short parent)
      for cell XF types this is the parent style (usually 0/normal). For style this should be NULL.
      Parameters:
      parent - index of parent XF
      See Also:
    • setAlignmentOptions

      public void setAlignmentOptions(short options)
      set the alignment options bitmask. See corresponding bitsetter methods that reference this one.
      Parameters:
      options - - the bitmask to set
    • setAlignment

      public void setAlignment(short align)
      set the horizontal alignment of the cell.
      Parameters:
      align - - how to align the cell (see constants)
      See Also:
    • setWrapText

      public void setWrapText(boolean wrapped)
      set whether to wrap the text in the cell
      Parameters:
      wrapped - - whether or not to wrap the cell text
      See Also:
    • setVerticalAlignment

      public void setVerticalAlignment(short align)
      set the vertical alignment of text in the cell
      Parameters:
      align - where to align the text
      See Also:
    • setJustifyLast

      public void setJustifyLast(short justify)
      Dunno. Docs just say this is for far east versions.. (I'm guessing it justifies for right-to-left read languages)
      Parameters:
      justify -
      See Also:
    • setRotation

      public void setRotation(short rotation)
      set the degree of rotation. (I've not actually seen this used anywhere)
      Parameters:
      rotation - the degree of rotation
      See Also:
    • setIndentionOptions

      public void setIndentionOptions(short options)
      set the indent options bitmask (see corresponding bitmask setters that reference this field)
      Parameters:
      options - bitmask to set.
    • setIndent

      public void setIndent(short indent)
      set indention (not sure of the units, think its spaces)
      Parameters:
      indent - - how far to indent the cell
      See Also:
    • setShrinkToFit

      public void setShrinkToFit(boolean shrink)
      set whether to shrink the text to fit
      Parameters:
      shrink - - shrink to fit or not
      See Also:
    • setMergeCells

      public void setMergeCells(boolean merge)
      set whether to merge cells
      Parameters:
      merge - - merge cells or not
      See Also:
    • setReadingOrder

      public void setReadingOrder(short order)
      set the reading order for far east versions (0 - Context, 1 - Left to right, 2 - right to left) - We could use some help with support for the far east.
      Parameters:
      order - - the reading order (0,1,2)
      See Also:
    • setIndentNotParentFormat

      public void setIndentNotParentFormat(boolean parent)
      set whether or not to use the format in this XF instead of the parent XF.
      Parameters:
      parent - - true if this XF has a different format value than its parent, false otherwise.
      See Also:
    • setIndentNotParentFont

      public void setIndentNotParentFont(boolean font)
      set whether or not to use the font in this XF instead of the parent XF.
      Parameters:
      font - - true if this XF has a different font value than its parent, false otherwise.
      See Also:
    • setIndentNotParentAlignment

      public void setIndentNotParentAlignment(boolean alignment)
      set whether or not to use the alignment in this XF instead of the parent XF.
      Parameters:
      alignment - true if this XF has a different alignment value than its parent, false otherwise.
      See Also:
    • setIndentNotParentBorder

      public void setIndentNotParentBorder(boolean border)
      set whether or not to use the border in this XF instead of the parent XF.
      Parameters:
      border - - true if this XF has a different border value than its parent, false otherwise.
      See Also:
    • setIndentNotParentPattern

      public void setIndentNotParentPattern(boolean pattern)

      Sets whether or not to use the pattern in this XF instead of the parent XF (foreground/background).

      Parameters:
      pattern - true if this XF has a different pattern value than its parent, false otherwise.
      See Also:
    • setIndentNotParentCellOptions

      public void setIndentNotParentCellOptions(boolean options)
      set whether or not to use the locking/hidden in this XF instead of the parent XF.
      Parameters:
      options - true if this XF has a different locking or hidden value than its parent, false otherwise.
      See Also:
    • setBorderOptions

      public void setBorderOptions(short options)
      set the border options bitmask (see the corresponding bitsetter methods that reference back to this one)
      Parameters:
      options - - the bit mask to set
    • setBorderLeft

      public void setBorderLeft(short border)
      set the borderline style for the left border
      Parameters:
      border - - type of border for the left side of the cell
      See Also:
    • setBorderRight

      public void setBorderRight(short border)
      set the border line style for the right border
      Parameters:
      border - - type of border for the right side of the cell
      See Also:
    • setBorderTop

      public void setBorderTop(short border)
      set the border line style for the top border
      Parameters:
      border - - type of border for the top of the cell
      See Also:
    • setBorderBottom

      public void setBorderBottom(short border)
      set the border line style for the bottom border
      Parameters:
      border - - type of border for the bottom of the cell
      See Also:
    • setPaletteOptions

      public void setPaletteOptions(short options)
      set the palette options bitmask (see the individual bitsetter methods that reference this one)
      Parameters:
      options - - the bitmask to set
    • setLeftBorderPaletteIdx

      public void setLeftBorderPaletteIdx(short border)
      set the palette index for the left border color
      Parameters:
      border - - palette index
      See Also:
    • setRightBorderPaletteIdx

      public void setRightBorderPaletteIdx(short border)
      set the palette index for the right border color
      Parameters:
      border - - palette index
      See Also:
    • setDiag

      public void setDiag(short diag)
      Not sure what this is for (maybe fill lines?) 1 = down, 2 = up, 3 = both, 0 for none..
      Parameters:
      diag - - set whatever it is that this is.
      See Also:
    • setAdtlPaletteOptions

      public void setAdtlPaletteOptions(short options)
      set the additional palette options bitmask (see individual bitsetter methods that reference this method)
      Parameters:
      options - - bitmask to set
    • setTopBorderPaletteIdx

      public void setTopBorderPaletteIdx(short border)
      set the palette index for the top border
      Parameters:
      border - - palette index
      See Also:
    • setBottomBorderPaletteIdx

      public void setBottomBorderPaletteIdx(short border)
      set the palette index for the bottom border
      Parameters:
      border - - palette index
      See Also:
    • setAdtlDiag

      public void setAdtlDiag(short diag)
      set for diagonal borders? No idea (its a palette color for the other function we didn't know what was?)
      Parameters:
      diag - - the palette index?
      See Also:
    • setAdtlDiagLineStyle

      public void setAdtlDiagLineStyle(short diag)
      set the diagonal border line style? Who the heck ever heard of a diagonal border?
      Parameters:
      diag - - the line style
      See Also:
    • setAdtlFillPattern

      public void setAdtlFillPattern(short fill)
      set the fill pattern
      Parameters:
      fill - - fill pattern??
      See Also:
    • setFillPaletteOptions

      public void setFillPaletteOptions(short options)
      set the fill palette options bitmask (see
      Parameters:
      options -
    • setFillForeground

      public void setFillForeground(short color)
      set the foreground palette color index
      Parameters:
      color - - palette index
      See Also:
    • setFillBackground

      public void setFillBackground(short color)
      set the background palette color index
      Parameters:
      color - - palette index
      See Also:
    • getFontIndex

      public short getFontIndex()
      get the index to the FONT record (which font to use 0 based)
      Returns:
      index to the font
      See Also:
    • getFormatIndex

      public short getFormatIndex()
      get the index to the Format record (which FORMAT to use 0-based)
      Returns:
      index to the format record
      See Also:
    • getCellOptions

      public short getCellOptions()
      gets the options bitmask - you can also use corresponding option bit getters (see other methods that reference this one)
      Returns:
      options bitmask
    • isLocked

      public boolean isLocked()
      get whether the cell is locked or not
      Returns:
      locked - if the cell is locked
      See Also:
    • isHidden

      public boolean isHidden()
      get whether the cell is hidden or not
      Returns:
      hidden - if the cell is hidden
      See Also:
    • getXFType

      public short getXFType()
      get whether the cell is a cell or style XFRecord
      Returns:
      type - cell or style (0/1)
      See Also:
    • get123Prefix

      public boolean get123Prefix()
      get some old holdover from lotus 123. Who cares, its all over for Lotus. RIP Lotus.
      Returns:
      prefix - the lotus thing
      See Also:
    • getParentIndex

      public short getParentIndex()
      for cell XF types this is the parent style (usually 0/normal). For style this should be NULL.
      Returns:
      index of parent XF
      See Also:
    • getAlignmentOptions

      public short getAlignmentOptions()
      get the alignment options bitmask. See corresponding bitgetter methods that reference this one.
      Returns:
      options - the bitmask
    • getAlignment

      public short getAlignment()
      get the horizontal alignment of the cell.
      Returns:
      align - how to align the cell (see constants)
      See Also:
    • getWrapText

      public boolean getWrapText()
      get whether to wrap the text in the cell
      Returns:
      wrapped - whether or not to wrap the cell text
      See Also:
    • getVerticalAlignment

      public short getVerticalAlignment()
      get the vertical alignment of text in the cell
      Returns:
      where to align the text
      See Also:
    • getJustifyLast

      public short getJustifyLast()
      Dunno. Docs just say this is for far east versions.. (I'm guessing it justifies for right-to-left read languages)
      Returns:
      justify
      See Also:
    • getRotation

      public short getRotation()
      get the degree of rotation. (I've not actually seen this used anywhere)
      Returns:
      rotation - the degree of rotation
      See Also:
    • getIndentionOptions

      public short getIndentionOptions()
      get the indent options bitmask (see corresponding bit getters that reference this field)
      Returns:
      options bitmask
    • getIndent

      public short getIndent()
      get indention (not sure of the units, think its spaces)
      Returns:
      indent - how far to indent the cell
      See Also:
    • getShrinkToFit

      public boolean getShrinkToFit()
      get whether to shrink the text to fit
      Returns:
      shrink - shrink to fit or not
      See Also:
    • getMergeCells

      public boolean getMergeCells()
      get whether to merge cells
      Returns:
      merge - merge cells or not
      See Also:
    • getReadingOrder

      public short getReadingOrder()
      get the reading order for far east versions (0 - Context, 1 - Left to right, 2 - right to left) - We could use some help with support for the far east.
      Returns:
      order - the reading order (0,1,2)
      See Also:
    • isIndentNotParentFormat

      public boolean isIndentNotParentFormat()
      get whether or not to use the format in this XF instead of the parent XF.
      Returns:
      parent - true if this XF has a different format value than its parent, false otherwise.
      See Also:
    • isIndentNotParentFont

      public boolean isIndentNotParentFont()
      get whether or not to use the font in this XF instead of the parent XF.
      Returns:
      font - true if this XF has a different font value than its parent, false otherwise.
      See Also:
    • isIndentNotParentAlignment

      public boolean isIndentNotParentAlignment()
      get whether or not to use the alignment in this XF instead of the parent XF.
      Returns:
      alignment true if this XF has a different alignment value than its parent, false otherwise.
      See Also:
    • isIndentNotParentBorder

      public boolean isIndentNotParentBorder()
      get whether or not to use the border in this XF instead of the parent XF.
      Returns:
      border - true if this XF has a different border value than its parent, false otherwise.
      See Also:
    • isIndentNotParentPattern

      public boolean isIndentNotParentPattern()
      get whether or not to use the pattern in this XF instead of the parent XF. (foregrount/background)
      Returns:
      pattern- true if this XF has a different pattern value than its parent, false otherwise.
      See Also:
    • isIndentNotParentCellOptions

      public boolean isIndentNotParentCellOptions()
      get whether or not to use the locking/hidden in this XF instead of the parent XF.
      Returns:
      options- true if this XF has a different locking or hidden value than its parent, false otherwise.
      See Also:
    • getBorderOptions

      public short getBorderOptions()
      get the border options bitmask (see the corresponding bit getter methods that reference back to this one)
      Returns:
      options - the bit mask to set
    • getBorderLeft

      public short getBorderLeft()
      get the borderline style for the left border
      Returns:
      border - type of border for the left side of the cell
      See Also:
    • getBorderRight

      public short getBorderRight()
      get the borderline style for the right border
      Returns:
      border - type of border for the right side of the cell
      See Also:
    • getBorderTop

      public short getBorderTop()
      get the borderline style for the top border
      Returns:
      border - type of border for the top of the cell
      See Also:
    • getBorderBottom

      public short getBorderBottom()
      get the borderline style for the bottom border
      Returns:
      border - type of border for the bottom of the cell
      See Also:
    • getPaletteOptions

      public short getPaletteOptions()
      get the palette options bitmask (see the individual bit getter methods that reference this one)
      Returns:
      options - the bitmask
    • getLeftBorderPaletteIdx

      public short getLeftBorderPaletteIdx()
      get the palette index for the left border color
      Returns:
      border - palette index
      See Also:
    • getRightBorderPaletteIdx

      public short getRightBorderPaletteIdx()
      get the palette index for the right border color
      Returns:
      border - palette index
      See Also:
    • getDiag

      public short getDiag()
      Not sure what this is for (maybe fill lines?) 1 = down, 2 = up, 3 = both, 0 for none..
      Returns:
      diag - whatever it is that this is.
      See Also:
    • getAdtlPaletteOptions

      public int getAdtlPaletteOptions()
      get the additional palette options bitmask (see individual bit getter methods that reference this method)
      Returns:
      options - bitmask to set
    • getTopBorderPaletteIdx

      public short getTopBorderPaletteIdx()
      get the palette index for the top border
      Returns:
      border - palette index
      See Also:
    • getBottomBorderPaletteIdx

      public short getBottomBorderPaletteIdx()
      get the palette index for the bottom border
      Returns:
      border - palette index
      See Also:
    • getAdtlDiag

      public short getAdtlDiag()
      get for diagonal borders? No idea (its a palette color for the other function we didn't know what was?)
      Returns:
      diag - the palette index?
      See Also:
    • getAdtlDiagLineStyle

      public short getAdtlDiagLineStyle()
      get the diagonal border line style? Who the heck ever heard of a diagonal border?
      Returns:
      diag - the line style
      See Also:
    • getAdtlFillPattern

      public short getAdtlFillPattern()
      get the additional fill pattern
      Returns:
      fill - fill pattern??
      See Also:
    • getFillPaletteOptions

      public short getFillPaletteOptions()
      get the fill palette options bitmask (see indivdual bit getters that reference this method)
      Returns:
      options
    • getFillForeground

      public short getFillForeground()
      get the foreground palette color index
      Returns:
      color - palette index
      See Also:
    • getFillBackground

      public short getFillBackground()
      get the background palette color index
      Returns:
      color palette index
      See Also:
    • toString

      public String toString()
      Description copied from class: Record
      get a string representation of the record (for biffview/debugging)
      Overrides:
      toString in class Record
    • serialize

      public int serialize(int offset, byte[] data)
      Description copied from class: Record
      called by the class that is responsible for writing this sucker. Subclasses should implement this so that their data is passed back in a byte array.
      Specified by:
      serialize in class Record
      Parameters:
      offset - to begin writing at
      data - byte array containing instance data
      Returns:
      number of bytes written
    • getRecordSize

      public int getRecordSize()
      Description copied from class: Record
      gives the current serialized size of the record. Should include the sid and reclength (4 bytes).
      Overrides:
      getRecordSize in class Record
    • getSid

      public short getSid()
      Description copied from class: Record
      return the non static version of the id for this record.
      Specified by:
      getSid in class Record