Methods Summary |
---|
public java.lang.Object | clone()
AreaFormatRecord rec = new AreaFormatRecord();
rec.field_1_foregroundColor = field_1_foregroundColor;
rec.field_2_backgroundColor = field_2_backgroundColor;
rec.field_3_pattern = field_3_pattern;
rec.field_4_formatFlags = field_4_formatFlags;
rec.field_5_forecolorIndex = field_5_forecolorIndex;
rec.field_6_backcolorIndex = field_6_backcolorIndex;
return rec;
|
protected void | fillFields(org.apache.poi.hssf.record.RecordInputStream in)
field_1_foregroundColor = in.readInt();
field_2_backgroundColor = in.readInt();
field_3_pattern = in.readShort();
field_4_formatFlags = in.readShort();
field_5_forecolorIndex = in.readShort();
field_6_backcolorIndex = in.readShort();
|
public short | getBackcolorIndex()Get the backcolor index field for the AreaFormat record.
return field_6_backcolorIndex;
|
public int | getBackgroundColor()Get the background color field for the AreaFormat record.
return field_2_backgroundColor;
|
public short | getForecolorIndex()Get the forecolor index field for the AreaFormat record.
return field_5_forecolorIndex;
|
public int | getForegroundColor()Get the foreground color field for the AreaFormat record.
return field_1_foregroundColor;
|
public short | getFormatFlags()Get the format flags field for the AreaFormat record.
return field_4_formatFlags;
|
public short | getPattern()Get the pattern field for the AreaFormat record.
return field_3_pattern;
|
public int | getRecordSize()Size of record (exluding 4 byte header)
return 4 + 4 + 4 + 2 + 2 + 2 + 2;
|
public short | getSid()
return sid;
|
public boolean | isAutomatic()automatic formatting
return automatic.isSet(field_4_formatFlags);
|
public boolean | isInvert()swap foreground and background colours when data is negative
return invert.isSet(field_4_formatFlags);
|
public int | serialize(int offset, byte[] data)
int pos = 0;
LittleEndian.putShort(data, 0 + offset, sid);
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
LittleEndian.putInt(data, 4 + offset + pos, field_1_foregroundColor);
LittleEndian.putInt(data, 8 + offset + pos, field_2_backgroundColor);
LittleEndian.putShort(data, 12 + offset + pos, field_3_pattern);
LittleEndian.putShort(data, 14 + offset + pos, field_4_formatFlags);
LittleEndian.putShort(data, 16 + offset + pos, field_5_forecolorIndex);
LittleEndian.putShort(data, 18 + offset + pos, field_6_backcolorIndex);
return getRecordSize();
|
public void | setAutomatic(boolean value)Sets the automatic field value.
automatic formatting
field_4_formatFlags = automatic.setShortBoolean(field_4_formatFlags, value);
|
public void | setBackcolorIndex(short field_6_backcolorIndex)Set the backcolor index field for the AreaFormat record.
this.field_6_backcolorIndex = field_6_backcolorIndex;
|
public void | setBackgroundColor(int field_2_backgroundColor)Set the background color field for the AreaFormat record.
this.field_2_backgroundColor = field_2_backgroundColor;
|
public void | setForecolorIndex(short field_5_forecolorIndex)Set the forecolor index field for the AreaFormat record.
this.field_5_forecolorIndex = field_5_forecolorIndex;
|
public void | setForegroundColor(int field_1_foregroundColor)Set the foreground color field for the AreaFormat record.
this.field_1_foregroundColor = field_1_foregroundColor;
|
public void | setFormatFlags(short field_4_formatFlags)Set the format flags field for the AreaFormat record.
this.field_4_formatFlags = field_4_formatFlags;
|
public void | setInvert(boolean value)Sets the invert field value.
swap foreground and background colours when data is negative
field_4_formatFlags = invert.setShortBoolean(field_4_formatFlags, value);
|
public void | setPattern(short field_3_pattern)Set the pattern field for the AreaFormat record.
this.field_3_pattern = field_3_pattern;
|
public java.lang.String | toString()
StringBuffer buffer = new StringBuffer();
buffer.append("[AREAFORMAT]\n");
buffer.append(" .foregroundColor = ")
.append("0x").append(HexDump.toHex( getForegroundColor ()))
.append(" (").append( getForegroundColor() ).append(" )");
buffer.append(System.getProperty("line.separator"));
buffer.append(" .backgroundColor = ")
.append("0x").append(HexDump.toHex( getBackgroundColor ()))
.append(" (").append( getBackgroundColor() ).append(" )");
buffer.append(System.getProperty("line.separator"));
buffer.append(" .pattern = ")
.append("0x").append(HexDump.toHex( getPattern ()))
.append(" (").append( getPattern() ).append(" )");
buffer.append(System.getProperty("line.separator"));
buffer.append(" .formatFlags = ")
.append("0x").append(HexDump.toHex( getFormatFlags ()))
.append(" (").append( getFormatFlags() ).append(" )");
buffer.append(System.getProperty("line.separator"));
buffer.append(" .automatic = ").append(isAutomatic()).append('\n");
buffer.append(" .invert = ").append(isInvert()).append('\n");
buffer.append(" .forecolorIndex = ")
.append("0x").append(HexDump.toHex( getForecolorIndex ()))
.append(" (").append( getForecolorIndex() ).append(" )");
buffer.append(System.getProperty("line.separator"));
buffer.append(" .backcolorIndex = ")
.append("0x").append(HexDump.toHex( getBackcolorIndex ()))
.append(" (").append( getBackcolorIndex() ).append(" )");
buffer.append(System.getProperty("line.separator"));
buffer.append("[/AREAFORMAT]\n");
return buffer.toString();
|
protected void | validateSid(short id)Checks the sid matches the expected side for this record
if (id != sid)
{
throw new RecordFormatException("Not a AreaFormat record");
}
|