jxl.biff
Class PaletteRecord

java.lang.Object
  extended byjxl.biff.RecordData
      extended byjxl.biff.WritableRecordData
          extended byjxl.biff.PaletteRecord
All Implemented Interfaces:
ByteData

public class PaletteRecord
extends WritableRecordData

A record representing the RGB colour palette


Field Summary
 
Fields inherited from class jxl.biff.WritableRecordData
maxRecordLength
 
Constructor Summary
PaletteRecord()
          Default constructor - used when there is no palette specified
PaletteRecord(Record t)
          Constructor
 
Method Summary
 RGB getColourRGB(Colour c)
          Gets the colour RGB from the palette
 byte[] getData()
          Accessor for the binary data - used when copying
 boolean isDirty()
          Accessor for the dirty flag, which indicates if this palette has been modified
 void setColourRGB(Colour c, int r, int g, int b)
          Sets the RGB value for the specified colour for this workbook
 
Methods inherited from class jxl.biff.WritableRecordData
getBytes
 
Methods inherited from class jxl.biff.RecordData
getCode, getRecord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaletteRecord

public PaletteRecord(Record t)
Constructor

Parameters:
t - the raw bytes

PaletteRecord

public PaletteRecord()
Default constructor - used when there is no palette specified

Method Detail

getData

public byte[] getData()
Accessor for the binary data - used when copying

Specified by:
getData in class WritableRecordData
Returns:
the binary data

isDirty

public boolean isDirty()
Accessor for the dirty flag, which indicates if this palette has been modified

Returns:
TRUE if the palette has been modified, FALSE if it is the default

setColourRGB

public void setColourRGB(Colour c,
                         int r,
                         int g,
                         int b)
Sets the RGB value for the specified colour for this workbook

Parameters:
c - the colour whose RGB value is to be overwritten
r - the red portion to set (0-255)
g - the green portion to set (0-255)
b - the blue portion to set (0-255)

getColourRGB

public RGB getColourRGB(Colour c)
Gets the colour RGB from the palette

Parameters:
c - the colour
Returns:
an RGB structure