Top Description Inners Fields Constructors Methods
org.apache.poi.hssf.record

public final Class PaletteRecord

extends StandardRecord
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .Map, java.util.function.Supplier, org.apache.poi.common.usermodel.GenericRecord, org.apache.poi.util.GenericRecordUtil, .LittleEndianOutput

Supports custom palettes.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
PaletteRecord.PColor

PColor - element in the list of colors

Field Summary

Modifier and TypeField and Description
private final ArrayList<PaletteRecord.PColor>
private static final int[]
public static final short
FIRST_COLOR_INDEX

The byte index of the first color

public static final short
public static final byte
STANDARD_PALETTE_SIZE

The standard size of an XLS palette

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public PaletteRecord
public byte[]

Returns:

the RGB triplet for the color, or null if the specified index does not exist
getColor
(int
palette index, must be >= 0x8
byteIndex
)

Returns the color value at a given index

protected int
public Map<String, Supplier<?>>
public HSSFRecordTypes
public short
getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

public void
serialize(LittleEndianOutput
the output object
out
)

Implements abstract org.apache.poi.hssf.record.StandardRecord.serialize.

Write the data content of this BIFF record.

public void
setColor(short
the index to set; if this index is less than 0x8 or greater than 0x40, then no modification is made
byteIndex
,
byte
the red color part
red
,
byte
the green color part
green
,
byte
the blue color part
blue
)

Sets the color value at a given index If the given index is greater than the current last color index, then black is inserted at every index required to make the palette continuous.

Inherited from org.apache.poi.hssf.record.StandardRecord:
getRecordSizeserialize

Field Detail

_colorsback to summary
private final ArrayList<PaletteRecord.PColor> _colors
DEFAULT_COLORSback to summary
private static final int[] DEFAULT_COLORS
FIRST_COLOR_INDEXback to summary
public static final short FIRST_COLOR_INDEX

The byte index of the first color

sidback to summary
public static final short sid
STANDARD_PALETTE_SIZEback to summary
public static final byte STANDARD_PALETTE_SIZE

The standard size of an XLS palette

Constructor Detail

PaletteRecordback to summary
public PaletteRecord()
PaletteRecordback to summary
public PaletteRecord(PaletteRecord other)
PaletteRecordback to summary
public PaletteRecord(RecordInputStream in)

Method Detail

copyback to summary
public PaletteRecord copy()

Implements abstract org.apache.poi.hssf.record.StandardRecord.copy.

Implements org.apache.poi.common.Duplicatable.copy.

Returns:PaletteRecord

Doc from org.apache.poi.common.Duplicatable.copy.

a deep copy of the implementing class / instance

Annotations
@Override
getColorback to summary
public byte[] getColor(int byteIndex)

Returns the color value at a given index

Parameters
byteIndex:int

palette index, must be >= 0x8

Returns:byte[]

the RGB triplet for the color, or null if the specified index does not exist

getDataSizeback to summary
protected int getDataSize()

Implements abstract org.apache.poi.hssf.record.StandardRecord.getDataSize.

Annotations
@Override
getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

Implements org.apache.poi.common.usermodel.GenericRecord.getGenericProperties.

Annotations
@Override
getGenericRecordTypeback to summary
public HSSFRecordTypes getGenericRecordType()

Overrides default org.apache.poi.common.usermodel.GenericRecord.getGenericRecordType.

Implements abstract org.apache.poi.hssf.record.Record.getGenericRecordType.

Annotations
@Override
getSidback to summary
public short getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

Doc from org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

Returns:short

he id for this record

Annotations
@Override
serializeback to summary
public void serialize(LittleEndianOutput out)

Implements abstract org.apache.poi.hssf.record.StandardRecord.serialize.

Doc from org.apache.poi.hssf.record.StandardRecord.serialize.

Write the data content of this BIFF record. The 'ushort sid' and 'ushort size' header fields have already been written by the superclass.

The number of bytes written must equal the record size reported by org.apache.poi.hssf.record.Record#getRecordSize()} minus four ( record header consisting of a 'ushort sid' and 'ushort reclength' has already been written by their superclass).

Parameters
out:LittleEndianOutput

the output object

Annotations
@Override
setColorback to summary
public void setColor(short byteIndex, byte red, byte green, byte blue)

Sets the color value at a given index If the given index is greater than the current last color index, then black is inserted at every index required to make the palette continuous.

Parameters
byteIndex:short

the index to set; if this index is less than 0x8 or greater than 0x40, then no modification is made

red:byte

the red color part

green:byte

the green color part

blue:byte

the blue color part

org.apache.poi.hssf.record back to summary

private final Class PaletteRecord.PColor

extends Object
implements GenericRecord
Class Inheritance
All Implemented Interfaces
org.apache.poi.common.usermodel.GenericRecord

PColor - element in the list of colors

Field Summary

Modifier and TypeField and Description
private final int
private final int
private final int
public static final short

Constructor Summary

AccessConstructor and Description
pack-priv
PColor(int rgb)

pack-priv
PColor(int red, int green, int blue)

pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Map<String, Supplier<?>>
pack-priv byte[]
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_blueback to summary
private final int _blue
_greenback to summary
private final int _green
_redback to summary
private final int _red
ENCODED_SIZEback to summary
public static final short ENCODED_SIZE

Constructor Detail

PColorback to summary
pack-priv PColor(int rgb)
PColorback to summary
pack-priv PColor(int red, int green, int blue)
PColorback to summary
pack-priv PColor(PaletteRecord.PColor other)
PColorback to summary
pack-priv PColor(RecordInputStream in)

Method Detail

getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

Implements org.apache.poi.common.usermodel.GenericRecord.getGenericProperties.

Annotations
@Override
getTripletback to summary
pack-priv byte[] getTriplet()
serializeback to summary
pack-priv void serialize(LittleEndianOutput out)