jxl.biff
Class PaletteRecord
java.lang.Object
|
+--jxl.biff.RecordData
|
+--jxl.biff.WritableRecordData
|
+--jxl.biff.PaletteRecord
- All Implemented Interfaces:
- ByteData
- public class PaletteRecord
- extends WritableRecordData
A record representing the RGB colour palette
Inner Class Summary |
private static class |
PaletteRecord.RGB
The internal RGB structure |
Field Summary |
private boolean |
dirty
A dirty flag indicating that this palette has been tampered with
in some way |
private boolean |
initialized
Initialized flag |
private static int |
numColours
The number of colours in the palette |
private boolean |
read
Flag indicating that the palette was read in |
private PaletteRecord.RGB[] |
rgbColours
The list of bespoke rgb colours used by this sheet |
Method Summary |
byte[] |
getData()
Accessor for the binary data - used when copying |
private void |
initialize()
Initialize the record data |
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 |
private int |
setValueRange(int val,
int min,
int max)
Forces the value passed in to be between the range passed in |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
rgbColours
private PaletteRecord.RGB[] rgbColours
- The list of bespoke rgb colours used by this sheet
dirty
private boolean dirty
- A dirty flag indicating that this palette has been tampered with
in some way
read
private boolean read
- Flag indicating that the palette was read in
initialized
private boolean initialized
- Initialized flag
numColours
private static final int numColours
- The number of colours in the palette
PaletteRecord
public PaletteRecord(Record t)
- Constructor
- Parameters:
t
- the raw bytes
PaletteRecord
public PaletteRecord()
- Default constructor - used when there is no palette specified
getData
public byte[] getData()
- Accessor for the binary data - used when copying
- Overrides:
getData
in class WritableRecordData
- Returns:
- the binary data
initialize
private void initialize()
- Initialize the record 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 overwrittenr
- the red portion to set (0-255)g
- the green portion to set (0-255)b
- the blue portion to set (0-255)
setValueRange
private int setValueRange(int val,
int min,
int max)
- Forces the value passed in to be between the range passed in
- Parameters:
val
- the value to constrainmin
- the minimum acceptable valuemax
- the maximum acceptable value- Returns:
- the constrained value