FileDocCategorySizeDatePackage
LineFormatRecord.javaAPI DocApache Poi 3.0.111108Mon Jan 01 12:39:40 GMT 2007org.apache.poi.hssf.record

LineFormatRecord

public class LineFormatRecord extends Record
Describes a line format record. The line format record controls how a line on a chart appears. NOTE: This source is automatically generated please do not modify this file. Either subclass or remove the record in src/records/definitions.
author
Glen Stampoultzis (glens at apache.org)

Fields Summary
public static final short
sid
private int
field_1_lineColor
private short
field_2_linePattern
public static final short
LINE_PATTERN_SOLID
public static final short
LINE_PATTERN_DASH
public static final short
LINE_PATTERN_DOT
public static final short
LINE_PATTERN_DASH_DOT
public static final short
LINE_PATTERN_DASH_DOT_DOT
public static final short
LINE_PATTERN_NONE
public static final short
LINE_PATTERN_DARK_GRAY_PATTERN
public static final short
LINE_PATTERN_MEDIUM_GRAY_PATTERN
public static final short
LINE_PATTERN_LIGHT_GRAY_PATTERN
private short
field_3_weight
public static final short
WEIGHT_HAIRLINE
public static final short
WEIGHT_NARROW
public static final short
WEIGHT_MEDIUM
public static final short
WEIGHT_WIDE
private short
field_4_format
private BitField
auto
private BitField
drawTicks
private BitField
unknown
private short
field_5_colourPaletteIndex
Constructors Summary
public LineFormatRecord()



     
    

    
public LineFormatRecord(RecordInputStream in)
Constructs a LineFormat record and sets its fields appropriately.

param
id id must be 0x1007 or an exception will be throw upon validation
param
size size the size of the data area of the record
param
data data of the record (should not contain sid/len)

        super(in);
    
    
Methods Summary
public java.lang.Objectclone()

        LineFormatRecord rec = new LineFormatRecord();
    
        rec.field_1_lineColor = field_1_lineColor;
        rec.field_2_linePattern = field_2_linePattern;
        rec.field_3_weight = field_3_weight;
        rec.field_4_format = field_4_format;
        rec.field_5_colourPaletteIndex = field_5_colourPaletteIndex;
        return rec;
    
protected voidfillFields(org.apache.poi.hssf.record.RecordInputStream in)

        field_1_lineColor              = in.readInt();
        field_2_linePattern            = in.readShort();
        field_3_weight                 = in.readShort();
        field_4_format                 = in.readShort();
        field_5_colourPaletteIndex     = in.readShort();

    
public shortgetColourPaletteIndex()
Get the colour palette index field for the LineFormat record.

        return field_5_colourPaletteIndex;
    
public shortgetFormat()
Get the format field for the LineFormat record.

        return field_4_format;
    
public intgetLineColor()
Get the line color field for the LineFormat record.

        return field_1_lineColor;
    
public shortgetLinePattern()
Get the line pattern field for the LineFormat record.

return
One of LINE_PATTERN_SOLID LINE_PATTERN_DASH LINE_PATTERN_DOT LINE_PATTERN_DASH_DOT LINE_PATTERN_DASH_DOT_DOT LINE_PATTERN_NONE LINE_PATTERN_DARK_GRAY_PATTERN LINE_PATTERN_MEDIUM_GRAY_PATTERN LINE_PATTERN_LIGHT_GRAY_PATTERN

        return field_2_linePattern;
    
public intgetRecordSize()
Size of record (exluding 4 byte header)

        return 4  + 4 + 2 + 2 + 2 + 2;
    
public shortgetSid()

        return sid;
    
public shortgetWeight()
Get the weight field for the LineFormat record.

return
One of WEIGHT_HAIRLINE WEIGHT_NARROW WEIGHT_MEDIUM WEIGHT_WIDE

        return field_3_weight;
    
public booleanisAuto()
automatic format

return
the auto field value.

        return auto.isSet(field_4_format);
    
public booleanisDrawTicks()
draw tick marks

return
the draw ticks field value.

        return drawTicks.isSet(field_4_format);
    
public booleanisUnknown()
book marks this as reserved = 0 but it seems to do something

return
the unknown field value.

        return unknown.isSet(field_4_format);
    
public intserialize(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_lineColor);
        LittleEndian.putShort(data, 8 + offset + pos, field_2_linePattern);
        LittleEndian.putShort(data, 10 + offset + pos, field_3_weight);
        LittleEndian.putShort(data, 12 + offset + pos, field_4_format);
        LittleEndian.putShort(data, 14 + offset + pos, field_5_colourPaletteIndex);

        return getRecordSize();
    
public voidsetAuto(boolean value)
Sets the auto field value. automatic format

        field_4_format = auto.setShortBoolean(field_4_format, value);
    
public voidsetColourPaletteIndex(short field_5_colourPaletteIndex)
Set the colour palette index field for the LineFormat record.

        this.field_5_colourPaletteIndex = field_5_colourPaletteIndex;
    
public voidsetDrawTicks(boolean value)
Sets the draw ticks field value. draw tick marks

        field_4_format = drawTicks.setShortBoolean(field_4_format, value);
    
public voidsetFormat(short field_4_format)
Set the format field for the LineFormat record.

        this.field_4_format = field_4_format;
    
public voidsetLineColor(int field_1_lineColor)
Set the line color field for the LineFormat record.

        this.field_1_lineColor = field_1_lineColor;
    
public voidsetLinePattern(short field_2_linePattern)
Set the line pattern field for the LineFormat record.

param
field_2_linePattern One of LINE_PATTERN_SOLID LINE_PATTERN_DASH LINE_PATTERN_DOT LINE_PATTERN_DASH_DOT LINE_PATTERN_DASH_DOT_DOT LINE_PATTERN_NONE LINE_PATTERN_DARK_GRAY_PATTERN LINE_PATTERN_MEDIUM_GRAY_PATTERN LINE_PATTERN_LIGHT_GRAY_PATTERN

        this.field_2_linePattern = field_2_linePattern;
    
public voidsetUnknown(boolean value)
Sets the unknown field value. book marks this as reserved = 0 but it seems to do something

        field_4_format = unknown.setShortBoolean(field_4_format, value);
    
public voidsetWeight(short field_3_weight)
Set the weight field for the LineFormat record.

param
field_3_weight One of WEIGHT_HAIRLINE WEIGHT_NARROW WEIGHT_MEDIUM WEIGHT_WIDE

        this.field_3_weight = field_3_weight;
    
public java.lang.StringtoString()

        StringBuffer buffer = new StringBuffer();

        buffer.append("[LINEFORMAT]\n");
        buffer.append("    .lineColor            = ")
            .append("0x").append(HexDump.toHex(  getLineColor ()))
            .append(" (").append( getLineColor() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .linePattern          = ")
            .append("0x").append(HexDump.toHex(  getLinePattern ()))
            .append(" (").append( getLinePattern() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .weight               = ")
            .append("0x").append(HexDump.toHex(  getWeight ()))
            .append(" (").append( getWeight() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .format               = ")
            .append("0x").append(HexDump.toHex(  getFormat ()))
            .append(" (").append( getFormat() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("         .auto                     = ").append(isAuto()).append('\n"); 
        buffer.append("         .drawTicks                = ").append(isDrawTicks()).append('\n"); 
        buffer.append("         .unknown                  = ").append(isUnknown()).append('\n"); 
        buffer.append("    .colourPaletteIndex   = ")
            .append("0x").append(HexDump.toHex(  getColourPaletteIndex ()))
            .append(" (").append( getColourPaletteIndex() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 

        buffer.append("[/LINEFORMAT]\n");
        return buffer.toString();
    
protected voidvalidateSid(short id)
Checks the sid matches the expected side for this record

param
id the expected sid.

        if (id != sid)
        {
            throw new RecordFormatException("Not a LineFormat record");
        }