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

TickRecord

public class TickRecord extends Record
The Tick record defines how tick marks and label positioning/formatting NOTE: This source is automatically generated please do not modify this file. Either subclass or remove the record in src/records/definitions.
author
Andrew C. Oliver(acoliver at apache.org)

Fields Summary
public static final short
sid
private byte
field_1_majorTickType
private byte
field_2_minorTickType
private byte
field_3_labelPosition
private byte
field_4_background
private int
field_5_labelColorRgb
private int
field_6_zero1
private int
field_7_zero2
private int
field_8_zero3
private int
field_9_zero4
private short
field_10_options
private BitField
autoTextColor
private BitField
autoTextBackground
private BitField
rotation
private BitField
autorotate
private short
field_11_tickColor
private short
field_12_zero5
Constructors Summary
public TickRecord()



     
    

    
public TickRecord(RecordInputStream in)
Constructs a Tick record and sets its fields appropriately.

param
id id must be 0x101e 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()

        TickRecord rec = new TickRecord();
    
        rec.field_1_majorTickType = field_1_majorTickType;
        rec.field_2_minorTickType = field_2_minorTickType;
        rec.field_3_labelPosition = field_3_labelPosition;
        rec.field_4_background = field_4_background;
        rec.field_5_labelColorRgb = field_5_labelColorRgb;
        rec.field_6_zero1 = field_6_zero1;
        rec.field_7_zero2 = field_7_zero2;
        rec.field_8_zero3 = field_8_zero3;
        rec.field_9_zero4 = field_9_zero4;
        rec.field_10_options = field_10_options;
        rec.field_11_tickColor = field_11_tickColor;
        rec.field_12_zero5 = field_12_zero5;
        return rec;
    
protected voidfillFields(org.apache.poi.hssf.record.RecordInputStream in)


        field_1_majorTickType          = in.readByte();
        field_2_minorTickType          = in.readByte();
        field_3_labelPosition          = in.readByte();
        field_4_background             = in.readByte();
        field_5_labelColorRgb          = in.readInt();
        field_6_zero1                  = in.readInt();
        field_7_zero2                  = in.readInt();
        field_8_zero3                  = in.readInt();
        field_9_zero4                  = in.readInt();
        
        field_10_options                = in.readShort();
        field_11_tickColor              = in.readShort();
        field_12_zero5                 = in.readShort();
    
public bytegetBackground()
Get the background field for the Tick record.

        return field_4_background;
    
public intgetLabelColorRgb()
Get the label color rgb field for the Tick record.

        return field_5_labelColorRgb;
    
public bytegetLabelPosition()
Get the label position field for the Tick record.

        return field_3_labelPosition;
    
public bytegetMajorTickType()
Get the major tick type field for the Tick record.

        return field_1_majorTickType;
    
public bytegetMinorTickType()
Get the minor tick type field for the Tick record.

        return field_2_minorTickType;
    
public shortgetOptions()
Get the options field for the Tick record.

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

        return 4  + 1 + 1 + 1 + 1 + 4 + 8 + 8 + 2 + 2 + 2;
    
public shortgetRotation()
rotate text (0=none, 1=normal, 2=90 degrees counterclockwise, 3=90 degrees clockwise)

return
the rotation field value.

        return rotation.getShortValue(field_10_options);
    
public shortgetSid()

        return sid;
    
public shortgetTickColor()
Get the tick color field for the Tick record.

        return field_11_tickColor;
    
public intgetZero1()
Get the zero 1 field for the Tick record.

        return field_6_zero1;
    
public intgetZero2()
Get the zero 2 field for the Tick record.

        return field_7_zero2;
    
public shortgetZero3()
Get the zero 3 field for the Tick record.

        return field_12_zero5;
    
public booleanisAutoTextBackground()
use the quote unquote automatic color for text background

return
the auto text background field value.

        return autoTextBackground.isSet(field_10_options);
    
public booleanisAutoTextColor()
use the quote unquote automatic color for text

return
the auto text color field value.

        return autoTextColor.isSet(field_10_options);
    
public booleanisAutorotate()
automatically rotate the text

return
the autorotate field value.

        return autorotate.isSet(field_10_options);
    
public intserialize(int offset, byte[] data)

        int pos = 0;

        LittleEndian.putShort(data, 0 + offset, sid);
        LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));

        data[ 4 + offset + pos ] = field_1_majorTickType;
        data[ 5 + offset + pos ] = field_2_minorTickType;
        data[ 6 + offset + pos ] = field_3_labelPosition;
        data[ 7 + offset + pos ] = field_4_background;
        LittleEndian.putInt(data, 8 + offset + pos, field_5_labelColorRgb);
        LittleEndian.putInt(data, 12 + offset + pos, field_6_zero1);
        LittleEndian.putInt(data, 16 + offset + pos, field_7_zero2);
        LittleEndian.putInt(data, 20 + offset + pos, field_8_zero3);
        LittleEndian.putInt(data, 24 + offset + pos, field_9_zero4);        
        LittleEndian.putShort(data, 28 + offset + pos, field_10_options);
        LittleEndian.putShort(data, 30 + offset + pos, field_11_tickColor);
        LittleEndian.putShort(data, 32 + offset + pos, field_12_zero5);

        return getRecordSize();
    
public voidsetAutoTextBackground(boolean value)
Sets the auto text background field value. use the quote unquote automatic color for text background

        field_10_options = autoTextBackground.setShortBoolean(field_10_options, value);
    
public voidsetAutoTextColor(boolean value)
Sets the auto text color field value. use the quote unquote automatic color for text

        field_10_options = autoTextColor.setShortBoolean(field_10_options, value);
    
public voidsetAutorotate(boolean value)
Sets the autorotate field value. automatically rotate the text

        field_10_options = autorotate.setShortBoolean(field_10_options, value);
    
public voidsetBackground(byte field_4_background)
Set the background field for the Tick record.

        this.field_4_background = field_4_background;
    
public voidsetLabelColorRgb(int field_5_labelColorRgb)
Set the label color rgb field for the Tick record.

        this.field_5_labelColorRgb = field_5_labelColorRgb;
    
public voidsetLabelPosition(byte field_3_labelPosition)
Set the label position field for the Tick record.

        this.field_3_labelPosition = field_3_labelPosition;
    
public voidsetMajorTickType(byte field_1_majorTickType)
Set the major tick type field for the Tick record.

        this.field_1_majorTickType = field_1_majorTickType;
    
public voidsetMinorTickType(byte field_2_minorTickType)
Set the minor tick type field for the Tick record.

        this.field_2_minorTickType = field_2_minorTickType;
    
public voidsetOptions(short field_10_options)
Set the options field for the Tick record.

        this.field_10_options = field_10_options;
    
public voidsetRotation(short value)
Sets the rotation field value. rotate text (0=none, 1=normal, 2=90 degrees counterclockwise, 3=90 degrees clockwise)

        field_10_options = rotation.setShortValue(field_10_options, value);
    
public voidsetTickColor(short field_11_tickColor)
Set the tick color field for the Tick record.

        this.field_11_tickColor = field_11_tickColor;
    
public voidsetZero1(int field_6_zero1)
Set the zero 1 field for the Tick record.

        this.field_6_zero1 = field_6_zero1;
    
public voidsetZero2(int field_7_zero2)
Set the zero 2 field for the Tick record.

        this.field_7_zero2 = field_7_zero2;
    
public voidsetZero3(short field_12_zero3)
Set the zero 3 field for the Tick record.

        this.field_12_zero5 = field_12_zero3;
    
public java.lang.StringtoString()

        StringBuffer buffer = new StringBuffer();

        buffer.append("[TICK]\n");
        buffer.append("    .majorTickType        = ")
            .append("0x").append(HexDump.toHex(  getMajorTickType ()))
            .append(" (").append( getMajorTickType() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .minorTickType        = ")
            .append("0x").append(HexDump.toHex(  getMinorTickType ()))
            .append(" (").append( getMinorTickType() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .labelPosition        = ")
            .append("0x").append(HexDump.toHex(  getLabelPosition ()))
            .append(" (").append( getLabelPosition() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .background           = ")
            .append("0x").append(HexDump.toHex(  getBackground ()))
            .append(" (").append( getBackground() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .labelColorRgb        = ")
            .append("0x").append(HexDump.toHex(  getLabelColorRgb ()))
            .append(" (").append( getLabelColorRgb() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .zero1                = ")
            .append("0x").append(HexDump.toHex(  getZero1 ()))
            .append(" (").append( getZero1() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .zero2                = ")
            .append("0x").append(HexDump.toHex(  getZero2 ()))
            .append(" (").append( getZero2() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .options              = ")
            .append("0x").append(HexDump.toHex(  getOptions ()))
            .append(" (").append( getOptions() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("         .autoTextColor            = ").append(isAutoTextColor()).append('\n"); 
        buffer.append("         .autoTextBackground       = ").append(isAutoTextBackground()).append('\n"); 
            buffer.append("         .rotation                 = ").append(getRotation()).append('\n"); 
        buffer.append("         .autorotate               = ").append(isAutorotate()).append('\n"); 
        buffer.append("    .tickColor            = ")
            .append("0x").append(HexDump.toHex(  getTickColor ()))
            .append(" (").append( getTickColor() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 
        buffer.append("    .zero3                = ")
            .append("0x").append(HexDump.toHex(  getZero3 ()))
            .append(" (").append( getZero3() ).append(" )");
        buffer.append(System.getProperty("line.separator")); 

        buffer.append("[/TICK]\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 Tick record");
        }