Charting, charting, charting... getting there... bit by bit.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352576 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Glen Stampoultzis 2002-05-01 08:02:19 +00:00
parent 46e32166e4
commit 950559e41a
37 changed files with 1903 additions and 157 deletions

View File

@ -639,6 +639,22 @@ public class BiffViewer
retval = new SheetPropertiesRecord(rectype, size, data);
break;
case DefaultDataLabelTextPropertiesRecord.sid:
retval = new DefaultDataLabelTextPropertiesRecord(rectype, size, data);
break;
case TextRecord.sid:
retval = new TextRecord(rectype, size, data);
break;
case AxisParentRecord.sid:
retval = new AxisParentRecord(rectype, size, data);
break;
case AxisLineFormatRecord.sid:
retval = new AxisLineFormatRecord(rectype, size, data);
break;
default :
retval = new UnknownRecord(rectype, size, data);

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The area format record is used to define the colours and patterns for an area.
@ -78,8 +75,8 @@ public class AreaFormatRecord
private int field_2_backgroundColor;
private short field_3_pattern;
private short field_4_formatFlags;
private BitField automatic = new BitField(0x1);
private BitField invert = new BitField(0x2);
private BitField automatic = new BitField(0x1);
private BitField invert = new BitField(0x2);
private short field_5_forecolorIndex;
private short field_6_backcolorIndex;

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The area record is used to define a area chart.
@ -75,9 +72,9 @@ public class AreaRecord
{
public final static short sid = 0x101A;
private short field_1_formatFlags;
private BitField stacked = new BitField(0x1);
private BitField displayAsPercentage = new BitField(0x2);
private BitField shadow = new BitField(0x4);
private BitField stacked = new BitField(0x1);
private BitField displayAsPercentage = new BitField(0x2);
private BitField shadow = new BitField(0x4);
public AreaRecord()

View File

@ -0,0 +1,207 @@
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache POI" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache POI", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.poi.hssf.record;
import org.apache.poi.util.*;
/**
* The axis line format record defines the axis type details.
* 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)
*/
public class AxisLineFormatRecord
extends Record
{
public final static short sid = 0x1021;
private short field_1_axisType;
public final static short AXIS_TYPE_AXIS_LINE = 0;
public final static short AXIS_TYPE_MAJOR_GRID_LINE = 1;
public final static short AXIS_TYPE_MINOR_GRID_LINE = 2;
public final static short AXIS_TYPE_WALLS_OR_FLOOR = 3;
public AxisLineFormatRecord()
{
}
/**
* Constructs a AxisLineFormat record and sets its fields appropriately.
*
* @param id id must be 0x1021 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)
*/
public AxisLineFormatRecord(short id, short size, byte [] data)
{
super(id, size, data);
}
/**
* Constructs a AxisLineFormat record and sets its fields appropriately.
*
* @param id id must be 0x1021 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)
* @param offset of the record's data
*/
public AxisLineFormatRecord(short id, short size, byte [] data, int offset)
{
super(id, size, data, offset);
}
/**
* Checks the sid matches the expected side for this record
*
* @param id the expected sid.
*/
protected void validateSid(short id)
{
if (id != sid)
{
throw new RecordFormatException("Not a AxisLineFormat record");
}
}
protected void fillFields(byte [] data, short size, int offset)
{
field_1_axisType = LittleEndian.getShort(data, 0x0 + offset);
}
public String toString()
{
StringBuffer buffer = new StringBuffer();
buffer.append("[AxisLineFormat]\n");
buffer.append(" .axisType = ")
.append("0x")
.append(HexDump.toHex((short)getAxisType()))
.append(" (").append(getAxisType()).append(" )\n");
buffer.append("[/AxisLineFormat]\n");
return buffer.toString();
}
public int serialize(int offset, byte[] data)
{
LittleEndian.putShort(data, 0 + offset, sid);
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
LittleEndian.putShort(data, 4 + offset, field_1_axisType);
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2;
}
public short getSid()
{
return this.sid;
}
/**
* Get the axis type field for the AxisLineFormat record.
*
* @return One of
* AXIS_TYPE_AXIS_LINE
* AXIS_TYPE_MAJOR_GRID_LINE
* AXIS_TYPE_MINOR_GRID_LINE
* AXIS_TYPE_WALLS_OR_FLOOR
*/
public short getAxisType()
{
return field_1_axisType;
}
/**
* Set the axis type field for the AxisLineFormat record.
*
* @param field_1_axisType
* One of
* AXIS_TYPE_AXIS_LINE
* AXIS_TYPE_MAJOR_GRID_LINE
* AXIS_TYPE_MINOR_GRID_LINE
* AXIS_TYPE_WALLS_OR_FLOOR
*/
public void setAxisType(short field_1_axisType)
{
this.field_1_axisType = field_1_axisType;
}
} // END OF CLASS

View File

@ -0,0 +1,297 @@
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache POI" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache POI", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.poi.hssf.record;
import org.apache.poi.util.*;
/**
* The axis size and location
* 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)
*/
public class AxisParentRecord
extends Record
{
public final static short sid = 0x1041;
private short field_1_axisType;
public final static short AXIS_TYPE_MAIN = 0;
public final static short AXIS_TYPE_SECONDARY = 1;
private int field_2_x;
private int field_3_y;
private int field_4_width;
private int field_5_height;
public AxisParentRecord()
{
}
/**
* Constructs a AxisParent record and sets its fields appropriately.
*
* @param id id must be 0x1041 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)
*/
public AxisParentRecord(short id, short size, byte [] data)
{
super(id, size, data);
}
/**
* Constructs a AxisParent record and sets its fields appropriately.
*
* @param id id must be 0x1041 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)
* @param offset of the record's data
*/
public AxisParentRecord(short id, short size, byte [] data, int offset)
{
super(id, size, data, offset);
}
/**
* Checks the sid matches the expected side for this record
*
* @param id the expected sid.
*/
protected void validateSid(short id)
{
if (id != sid)
{
throw new RecordFormatException("Not a AxisParent record");
}
}
protected void fillFields(byte [] data, short size, int offset)
{
field_1_axisType = LittleEndian.getShort(data, 0x0 + offset);
field_2_x = LittleEndian.getInt(data, 0x2 + offset);
field_3_y = LittleEndian.getInt(data, 0x6 + offset);
field_4_width = LittleEndian.getInt(data, 0xa + offset);
field_5_height = LittleEndian.getInt(data, 0xe + offset);
}
public String toString()
{
StringBuffer buffer = new StringBuffer();
buffer.append("[AxisParent]\n");
buffer.append(" .axisType = ")
.append("0x")
.append(HexDump.toHex((short)getAxisType()))
.append(" (").append(getAxisType()).append(" )\n");
buffer.append(" .x = ")
.append("0x")
.append(HexDump.toHex((int)getX()))
.append(" (").append(getX()).append(" )\n");
buffer.append(" .y = ")
.append("0x")
.append(HexDump.toHex((int)getY()))
.append(" (").append(getY()).append(" )\n");
buffer.append(" .width = ")
.append("0x")
.append(HexDump.toHex((int)getWidth()))
.append(" (").append(getWidth()).append(" )\n");
buffer.append(" .height = ")
.append("0x")
.append(HexDump.toHex((int)getHeight()))
.append(" (").append(getHeight()).append(" )\n");
buffer.append("[/AxisParent]\n");
return buffer.toString();
}
public int serialize(int offset, byte[] data)
{
LittleEndian.putShort(data, 0 + offset, sid);
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
LittleEndian.putShort(data, 4 + offset, field_1_axisType);
LittleEndian.putInt(data, 6 + offset, field_2_x);
LittleEndian.putInt(data, 10 + offset, field_3_y);
LittleEndian.putInt(data, 14 + offset, field_4_width);
LittleEndian.putInt(data, 18 + offset, field_5_height);
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 2 + 4 + 4 + 4 + 4;
}
public short getSid()
{
return this.sid;
}
/**
* Get the axis type field for the AxisParent record.
*
* @return One of
* AXIS_TYPE_MAIN
* AXIS_TYPE_SECONDARY
*/
public short getAxisType()
{
return field_1_axisType;
}
/**
* Set the axis type field for the AxisParent record.
*
* @param field_1_axisType
* One of
* AXIS_TYPE_MAIN
* AXIS_TYPE_SECONDARY
*/
public void setAxisType(short field_1_axisType)
{
this.field_1_axisType = field_1_axisType;
}
/**
* Get the x field for the AxisParent record.
*/
public int getX()
{
return field_2_x;
}
/**
* Set the x field for the AxisParent record.
*/
public void setX(int field_2_x)
{
this.field_2_x = field_2_x;
}
/**
* Get the y field for the AxisParent record.
*/
public int getY()
{
return field_3_y;
}
/**
* Set the y field for the AxisParent record.
*/
public void setY(int field_3_y)
{
this.field_3_y = field_3_y;
}
/**
* Get the width field for the AxisParent record.
*/
public int getWidth()
{
return field_4_width;
}
/**
* Set the width field for the AxisParent record.
*/
public void setWidth(int field_4_width)
{
this.field_4_width = field_4_width;
}
/**
* Get the height field for the AxisParent record.
*/
public int getHeight()
{
return field_5_height;
}
/**
* Set the height field for the AxisParent record.
*/
public void setHeight(int field_5_height)
{
this.field_5_height = field_5_height;
}
} // END OF CLASS

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The axis record defines the type of an axis.

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The number of axes used on a chart.

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The bar record is used to define a bar chart.
@ -77,10 +74,10 @@ public class BarRecord
private short field_1_barSpace;
private short field_2_categorySpace;
private short field_3_formatFlags;
private BitField horizontal = new BitField(0x1);
private BitField stacked = new BitField(0x2);
private BitField displayAsPercentage = new BitField(0x4);
private BitField shadow = new BitField(0x8);
private BitField horizontal = new BitField(0x1);
private BitField stacked = new BitField(0x2);
private BitField displayAsPercentage = new BitField(0x4);
private BitField shadow = new BitField(0x8);
public BarRecord()

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* This record refers to a category or series axis and is used to specify label/tickmark frequency.
@ -78,9 +75,9 @@ public class CategorySeriesAxisRecord
private short field_2_labelFrequency;
private short field_3_tickMarkFrequency;
private short field_4_options;
private BitField valueAxisCrossing = new BitField(0x1);
private BitField crossesFarRight = new BitField(0x2);
private BitField reversed = new BitField(0x4);
private BitField valueAxisCrossing = new BitField(0x1);
private BitField crossesFarRight = new BitField(0x2);
private BitField reversed = new BitField(0x4);
public CategorySeriesAxisRecord()

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The chart record is used to define the location and size of a chart.

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The dat record is used to store options for the chart.
@ -75,10 +72,10 @@ public class DatRecord
{
public final static short sid = 0x1063;
private short field_1_options;
private BitField horizontalBorder = new BitField(0x1);
private BitField verticalBorder = new BitField(0x2);
private BitField border = new BitField(0x4);
private BitField showSeriesKey = new BitField(0x8);
private BitField horizontalBorder = new BitField(0x1);
private BitField verticalBorder = new BitField(0x2);
private BitField border = new BitField(0x4);
private BitField showSeriesKey = new BitField(0x8);
public DatRecord()

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The data format record is used to index into a series.
@ -78,7 +75,7 @@ public class DataFormatRecord
private short field_2_seriesIndex;
private short field_3_seriesNumber;
private short field_4_formatFlags;
private BitField useExcel4Colors = new BitField(0x1);
private BitField useExcel4Colors = new BitField(0x1);
public DataFormatRecord()

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The default data label text properties record identifies the text characteristics of the preceeding text record.

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The font basis record stores various font metrics.

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The font index record indexes into the font table for the text record.

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The frame record indicates whether there is a border around the displayed text of a chart.
@ -78,8 +75,8 @@ public class FrameRecord
public final static short BORDER_TYPE_REGULAR = 0;
public final static short BORDER_TYPE_SHADOW = 1;
private short field_2_options;
private BitField autoSize = new BitField(0x1);
private BitField autoPosition = new BitField(0x2);
private BitField autoSize = new BitField(0x1);
private BitField autoPosition = new BitField(0x2);
public FrameRecord()

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The legend record specifies the location of legend on a chart and it's overall size.
@ -90,12 +87,12 @@ public class LegendRecord
public final static byte SPACING_MEDIUM = 1;
public final static byte SPACING_OPEN = 2;
private short field_7_options;
private BitField autoPosition = new BitField(0x1);
private BitField autoSeries = new BitField(0x2);
private BitField autoPosX = new BitField(0x4);
private BitField autoPosY = new BitField(0x8);
private BitField vert = new BitField(0x10);
private BitField containsDataTable = new BitField(0x20);
private BitField autoPosition = new BitField(0x1);
private BitField autoSeries = new BitField(0x2);
private BitField autoPosX = new BitField(0x4);
private BitField autoPosY = new BitField(0x8);
private BitField vert = new BitField(0x10);
private BitField containsDataTable = new BitField(0x20);
public LegendRecord()

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* Describes a line format record. The line format record controls how a line on a chart appears.
@ -91,9 +88,9 @@ public class LineFormatRecord
public final static short WEIGHT_MEDIUM = 1;
public final static short WEIGHT_WIDE = 2;
private short field_4_format;
private BitField auto = new BitField(0x1);
private BitField drawTicks = new BitField(0x4);
private BitField unknown = new BitField(0x4);
private BitField auto = new BitField(0x1);
private BitField drawTicks = new BitField(0x4);
private BitField unknown = new BitField(0x4);
private short field_5_colourPaletteIndex;

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* Describes a linked data record. This record referes to the series data or text.
@ -85,7 +82,7 @@ public class LinkedDataRecord
public final static byte REFERENCE_TYPE_NOT_USED = 3;
public final static byte REFERENCE_TYPE_ERROR_REPORTED = 4;
private short field_3_options;
private BitField customNumberFormat = new BitField(0x1);
private BitField customNumberFormat = new BitField(0x1);
private short field_4_indexNumberFmtRecord;
private short field_5_formulaOfLink;

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The number format index record indexes format table. This applies to an axis.

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The plot growth record specifies the scaling factors used when a font is scaled.

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The series chart group index record stores the index to the CHARTFORMAT record (0 based).

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The series label record defines the type of label associated with the data format record.
@ -75,12 +72,12 @@ public class SeriesLabelsRecord
{
public final static short sid = 0x100c;
private short field_1_formatFlags;
private BitField showActual = new BitField(0x1);
private BitField showPercent = new BitField(0x2);
private BitField labelAsPercentage = new BitField(0x4);
private BitField smoothedLine = new BitField(0x8);
private BitField showLabel = new BitField(0x10);
private BitField showBubbleSizes = new BitField(0x20);
private BitField showActual = new BitField(0x1);
private BitField showPercent = new BitField(0x2);
private BitField labelAsPercentage = new BitField(0x4);
private BitField smoothedLine = new BitField(0x8);
private BitField showLabel = new BitField(0x10);
private BitField showBubbleSizes = new BitField(0x20);
public SeriesLabelsRecord()

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The series list record defines the series displayed as an overlay to the main chart record.

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The series record describes the overall data for a series.

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* Describes a chart sheet properties record.
@ -75,11 +72,11 @@ public class SheetPropertiesRecord
{
public final static short sid = 0x1044;
private short field_1_flags;
private BitField chartTypeManuallyFormatted = new BitField(0x1);
private BitField plotVisibleOnly = new BitField(0x2);
private BitField doNotSizeWithWindow = new BitField(0x4);
private BitField defaultPlotDimensions = new BitField(0x8);
private BitField autoPlotArea = new BitField(0x10);
private BitField chartTypeManuallyFormatted = new BitField(0x1);
private BitField plotVisibleOnly = new BitField(0x2);
private BitField doNotSizeWithWindow = new BitField(0x4);
private BitField defaultPlotDimensions = new BitField(0x8);
private BitField autoPlotArea = new BitField(0x10);
private byte field_2_empty;
public final static byte EMPTY_NOT_PLOTTED = 0;
public final static byte EMPTY_ZERO = 1;

View File

@ -0,0 +1,794 @@
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache POI" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache POI", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.poi.hssf.record;
import org.apache.poi.util.*;
/**
* The text record is used to define text stored on a chart.
* 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)
*/
public class TextRecord
extends Record
{
public final static short sid = 0x1025;
private byte field_1_horizontalAlignment;
public final static byte HORIZONTAL_ALIGNMENT_LEFT = 1;
public final static byte HORIZONTAL_ALIGNMENT_CENTER = 2;
public final static byte HORIZONTAL_ALIGNMENT_BOTTOM = 3;
public final static byte HORIZONTAL_ALIGNMENT_JUSTIFY = 4;
private byte field_2_verticalAlignment;
public final static byte VERTICAL_ALIGNMENT_TOP = 1;
public final static byte VERTICAL_ALIGNMENT_CENTER = 2;
public final static byte VERTICAL_ALIGNMENT_BOTTOM = 3;
public final static byte VERTICAL_ALIGNMENT_JUSTIFY = 4;
private short field_3_displayMode;
public final static short DISPLAY_MODE_TRANSPARENT = 1;
public final static short DISPLAY_MODE_OPAQUE = 2;
private int field_4_rgbColor;
private int field_5_x;
private int field_6_y;
private int field_7_width;
private int field_8_height;
private short field_9_options1;
private BitField autoColor = new BitField(0x1);
private BitField showKey = new BitField(0x2);
private BitField showValue = new BitField(0x4);
private BitField vertical = new BitField(0x8);
private BitField autoGeneratedText = new BitField(0x10);
private BitField generated = new BitField(0x20);
private BitField autoLabelDeleted = new BitField(0x40);
private BitField autoBackground = new BitField(0x80);
private BitField rotation = new BitField(0x0700);
public final static short ROTATION_NONE = 0;
public final static short ROTATION_TOP_TO_BOTTOM = 1;
public final static short ROTATION_ROTATED_90_DEGREES = 2;
public final static short ROTATION_ROTATED_90_DEGREES_CLOCKWISE = 3;
private BitField showCategoryLabelAsPercentage = new BitField(0x800);
private BitField showValueAsPercentage = new BitField(0x1000);
private BitField showBubbleSizes = new BitField(0x2000);
private BitField showLabel = new BitField(0x4000);
private short field_10_indexOfColorValue;
private short field_11_options2;
private BitField dataLabelPlacement = new BitField(0x000F);
public final static short DATA_LABEL_PLACEMENT_CHART_DEPENDENT = 0;
public final static short DATA_LABEL_PLACEMENT_OUTSIDE = 1;
public final static short DATA_LABEL_PLACEMENT_INSIDE = 2;
public final static short DATA_LABEL_PLACEMENT_CENTER = 3;
public final static short DATA_LABEL_PLACEMENT_AXIS = 4;
public final static short DATA_LABEL_PLACEMENT_ABOVE = 5;
public final static short DATA_LABEL_PLACEMENT_BELOW = 6;
public final static short DATA_LABEL_PLACEMENT_LEFT = 7;
public final static short DATA_LABEL_PLACEMENT_RIGHT = 8;
public final static short DATA_LABEL_PLACEMENT_AUTO = 9;
public final static short DATA_LABEL_PLACEMENT_USER_MOVED = 10;
private short field_12_textRotation;
public TextRecord()
{
}
/**
* Constructs a Text record and sets its fields appropriately.
*
* @param id id must be 0x1025 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)
*/
public TextRecord(short id, short size, byte [] data)
{
super(id, size, data);
}
/**
* Constructs a Text record and sets its fields appropriately.
*
* @param id id must be 0x1025 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)
* @param offset of the record's data
*/
public TextRecord(short id, short size, byte [] data, int offset)
{
super(id, size, data, offset);
}
/**
* Checks the sid matches the expected side for this record
*
* @param id the expected sid.
*/
protected void validateSid(short id)
{
if (id != sid)
{
throw new RecordFormatException("Not a Text record");
}
}
protected void fillFields(byte [] data, short size, int offset)
{
field_1_horizontalAlignment = data[ 0x0 + offset ];
field_2_verticalAlignment = data[ 0x1 + offset ];
field_3_displayMode = LittleEndian.getShort(data, 0x2 + offset);
field_4_rgbColor = LittleEndian.getInt(data, 0x4 + offset);
field_5_x = LittleEndian.getInt(data, 0x8 + offset);
field_6_y = LittleEndian.getInt(data, 0xc + offset);
field_7_width = LittleEndian.getInt(data, 0x10 + offset);
field_8_height = LittleEndian.getInt(data, 0x14 + offset);
field_9_options1 = LittleEndian.getShort(data, 0x18 + offset);
field_10_indexOfColorValue = LittleEndian.getShort(data, 0x1a + offset);
field_11_options2 = LittleEndian.getShort(data, 0x1c + offset);
field_12_textRotation = LittleEndian.getShort(data, 0x1e + offset);
}
public String toString()
{
StringBuffer buffer = new StringBuffer();
buffer.append("[Text]\n");
buffer.append(" .horizontalAlignment = ")
.append("0x")
.append(HexDump.toHex((byte)getHorizontalAlignment()))
.append(" (").append(getHorizontalAlignment()).append(" )\n");
buffer.append(" .verticalAlignment = ")
.append("0x")
.append(HexDump.toHex((byte)getVerticalAlignment()))
.append(" (").append(getVerticalAlignment()).append(" )\n");
buffer.append(" .displayMode = ")
.append("0x")
.append(HexDump.toHex((short)getDisplayMode()))
.append(" (").append(getDisplayMode()).append(" )\n");
buffer.append(" .rgbColor = ")
.append("0x")
.append(HexDump.toHex((int)getRgbColor()))
.append(" (").append(getRgbColor()).append(" )\n");
buffer.append(" .x = ")
.append("0x")
.append(HexDump.toHex((int)getX()))
.append(" (").append(getX()).append(" )\n");
buffer.append(" .y = ")
.append("0x")
.append(HexDump.toHex((int)getY()))
.append(" (").append(getY()).append(" )\n");
buffer.append(" .width = ")
.append("0x")
.append(HexDump.toHex((int)getWidth()))
.append(" (").append(getWidth()).append(" )\n");
buffer.append(" .height = ")
.append("0x")
.append(HexDump.toHex((int)getHeight()))
.append(" (").append(getHeight()).append(" )\n");
buffer.append(" .options1 = ")
.append("0x")
.append(HexDump.toHex((short)getOptions1()))
.append(" (").append(getOptions1()).append(" )\n");
buffer.append(" .autoColor = ").append(isAutoColor ()).append('\n');
buffer.append(" .showKey = ").append(isShowKey ()).append('\n');
buffer.append(" .showValue = ").append(isShowValue ()).append('\n');
buffer.append(" .vertical = ").append(isVertical ()).append('\n');
buffer.append(" .autoGeneratedText = ").append(isAutoGeneratedText ()).append('\n');
buffer.append(" .generated = ").append(isGenerated ()).append('\n');
buffer.append(" .autoLabelDeleted = ").append(isAutoLabelDeleted ()).append('\n');
buffer.append(" .autoBackground = ").append(isAutoBackground ()).append('\n');
buffer.append(" .rotation = ").append(getRotation ()).append('\n');
buffer.append(" .showCategoryLabelAsPercentage = ").append(isShowCategoryLabelAsPercentage()).append('\n');
buffer.append(" .showValueAsPercentage = ").append(isShowValueAsPercentage()).append('\n');
buffer.append(" .showBubbleSizes = ").append(isShowBubbleSizes ()).append('\n');
buffer.append(" .showLabel = ").append(isShowLabel ()).append('\n');
buffer.append(" .indexOfColorValue = ")
.append("0x")
.append(HexDump.toHex((short)getIndexOfColorValue()))
.append(" (").append(getIndexOfColorValue()).append(" )\n");
buffer.append(" .options2 = ")
.append("0x")
.append(HexDump.toHex((short)getOptions2()))
.append(" (").append(getOptions2()).append(" )\n");
buffer.append(" .dataLabelPlacement = ").append(getDataLabelPlacement ()).append('\n');
buffer.append(" .textRotation = ")
.append("0x")
.append(HexDump.toHex((short)getTextRotation()))
.append(" (").append(getTextRotation()).append(" )\n");
buffer.append("[/Text]\n");
return buffer.toString();
}
public int serialize(int offset, byte[] data)
{
LittleEndian.putShort(data, 0 + offset, sid);
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
data[ 4 + offset ] = field_1_horizontalAlignment;
data[ 5 + offset ] = field_2_verticalAlignment;
LittleEndian.putShort(data, 6 + offset, field_3_displayMode);
LittleEndian.putInt(data, 8 + offset, field_4_rgbColor);
LittleEndian.putInt(data, 12 + offset, field_5_x);
LittleEndian.putInt(data, 16 + offset, field_6_y);
LittleEndian.putInt(data, 20 + offset, field_7_width);
LittleEndian.putInt(data, 24 + offset, field_8_height);
LittleEndian.putShort(data, 28 + offset, field_9_options1);
LittleEndian.putShort(data, 30 + offset, field_10_indexOfColorValue);
LittleEndian.putShort(data, 32 + offset, field_11_options2);
LittleEndian.putShort(data, 34 + offset, field_12_textRotation);
return getRecordSize();
}
/**
* Size of record (exluding 4 byte header)
*/
public int getRecordSize()
{
return 4 + 1 + 1 + 2 + 4 + 4 + 4 + 4 + 4 + 2 + 2 + 2 + 2;
}
public short getSid()
{
return this.sid;
}
/**
* Get the horizontal alignment field for the Text record.
*
* @return One of
* HORIZONTAL_ALIGNMENT_LEFT
* HORIZONTAL_ALIGNMENT_CENTER
* HORIZONTAL_ALIGNMENT_BOTTOM
* HORIZONTAL_ALIGNMENT_JUSTIFY
*/
public byte getHorizontalAlignment()
{
return field_1_horizontalAlignment;
}
/**
* Set the horizontal alignment field for the Text record.
*
* @param field_1_horizontalAlignment
* One of
* HORIZONTAL_ALIGNMENT_LEFT
* HORIZONTAL_ALIGNMENT_CENTER
* HORIZONTAL_ALIGNMENT_BOTTOM
* HORIZONTAL_ALIGNMENT_JUSTIFY
*/
public void setHorizontalAlignment(byte field_1_horizontalAlignment)
{
this.field_1_horizontalAlignment = field_1_horizontalAlignment;
}
/**
* Get the vertical alignment field for the Text record.
*
* @return One of
* VERTICAL_ALIGNMENT_TOP
* VERTICAL_ALIGNMENT_CENTER
* VERTICAL_ALIGNMENT_BOTTOM
* VERTICAL_ALIGNMENT_JUSTIFY
*/
public byte getVerticalAlignment()
{
return field_2_verticalAlignment;
}
/**
* Set the vertical alignment field for the Text record.
*
* @param field_2_verticalAlignment
* One of
* VERTICAL_ALIGNMENT_TOP
* VERTICAL_ALIGNMENT_CENTER
* VERTICAL_ALIGNMENT_BOTTOM
* VERTICAL_ALIGNMENT_JUSTIFY
*/
public void setVerticalAlignment(byte field_2_verticalAlignment)
{
this.field_2_verticalAlignment = field_2_verticalAlignment;
}
/**
* Get the display mode field for the Text record.
*
* @return One of
* DISPLAY_MODE_TRANSPARENT
* DISPLAY_MODE_OPAQUE
*/
public short getDisplayMode()
{
return field_3_displayMode;
}
/**
* Set the display mode field for the Text record.
*
* @param field_3_displayMode
* One of
* DISPLAY_MODE_TRANSPARENT
* DISPLAY_MODE_OPAQUE
*/
public void setDisplayMode(short field_3_displayMode)
{
this.field_3_displayMode = field_3_displayMode;
}
/**
* Get the rgbColor field for the Text record.
*/
public int getRgbColor()
{
return field_4_rgbColor;
}
/**
* Set the rgbColor field for the Text record.
*/
public void setRgbColor(int field_4_rgbColor)
{
this.field_4_rgbColor = field_4_rgbColor;
}
/**
* Get the x field for the Text record.
*/
public int getX()
{
return field_5_x;
}
/**
* Set the x field for the Text record.
*/
public void setX(int field_5_x)
{
this.field_5_x = field_5_x;
}
/**
* Get the y field for the Text record.
*/
public int getY()
{
return field_6_y;
}
/**
* Set the y field for the Text record.
*/
public void setY(int field_6_y)
{
this.field_6_y = field_6_y;
}
/**
* Get the width field for the Text record.
*/
public int getWidth()
{
return field_7_width;
}
/**
* Set the width field for the Text record.
*/
public void setWidth(int field_7_width)
{
this.field_7_width = field_7_width;
}
/**
* Get the height field for the Text record.
*/
public int getHeight()
{
return field_8_height;
}
/**
* Set the height field for the Text record.
*/
public void setHeight(int field_8_height)
{
this.field_8_height = field_8_height;
}
/**
* Get the options1 field for the Text record.
*/
public short getOptions1()
{
return field_9_options1;
}
/**
* Set the options1 field for the Text record.
*/
public void setOptions1(short field_9_options1)
{
this.field_9_options1 = field_9_options1;
}
/**
* Get the index of color value field for the Text record.
*/
public short getIndexOfColorValue()
{
return field_10_indexOfColorValue;
}
/**
* Set the index of color value field for the Text record.
*/
public void setIndexOfColorValue(short field_10_indexOfColorValue)
{
this.field_10_indexOfColorValue = field_10_indexOfColorValue;
}
/**
* Get the options2 field for the Text record.
*/
public short getOptions2()
{
return field_11_options2;
}
/**
* Set the options2 field for the Text record.
*/
public void setOptions2(short field_11_options2)
{
this.field_11_options2 = field_11_options2;
}
/**
* Get the text rotation field for the Text record.
*/
public short getTextRotation()
{
return field_12_textRotation;
}
/**
* Set the text rotation field for the Text record.
*/
public void setTextRotation(short field_12_textRotation)
{
this.field_12_textRotation = field_12_textRotation;
}
/**
* Sets the auto color field value.
* true = automaticly selected colour, false = user-selected
*/
public void setAutoColor(boolean value)
{
field_9_options1 = autoColor.setShortBoolean(field_9_options1, value);
}
/**
* true = automaticly selected colour, false = user-selected
* @return the auto color field value.
*/
public boolean isAutoColor()
{
return autoColor.isSet(field_9_options1);
}
/**
* Sets the show key field value.
* true = draw legend
*/
public void setShowKey(boolean value)
{
field_9_options1 = showKey.setShortBoolean(field_9_options1, value);
}
/**
* true = draw legend
* @return the show key field value.
*/
public boolean isShowKey()
{
return showKey.isSet(field_9_options1);
}
/**
* Sets the show value field value.
* false = text is category label
*/
public void setShowValue(boolean value)
{
field_9_options1 = showValue.setShortBoolean(field_9_options1, value);
}
/**
* false = text is category label
* @return the show value field value.
*/
public boolean isShowValue()
{
return showValue.isSet(field_9_options1);
}
/**
* Sets the vertical field value.
* true = text is vertical
*/
public void setVertical(boolean value)
{
field_9_options1 = vertical.setShortBoolean(field_9_options1, value);
}
/**
* true = text is vertical
* @return the vertical field value.
*/
public boolean isVertical()
{
return vertical.isSet(field_9_options1);
}
/**
* Sets the auto generated text field value.
*
*/
public void setAutoGeneratedText(boolean value)
{
field_9_options1 = autoGeneratedText.setShortBoolean(field_9_options1, value);
}
/**
*
* @return the auto generated text field value.
*/
public boolean isAutoGeneratedText()
{
return autoGeneratedText.isSet(field_9_options1);
}
/**
* Sets the generated field value.
*
*/
public void setGenerated(boolean value)
{
field_9_options1 = generated.setShortBoolean(field_9_options1, value);
}
/**
*
* @return the generated field value.
*/
public boolean isGenerated()
{
return generated.isSet(field_9_options1);
}
/**
* Sets the auto label deleted field value.
*
*/
public void setAutoLabelDeleted(boolean value)
{
field_9_options1 = autoLabelDeleted.setShortBoolean(field_9_options1, value);
}
/**
*
* @return the auto label deleted field value.
*/
public boolean isAutoLabelDeleted()
{
return autoLabelDeleted.isSet(field_9_options1);
}
/**
* Sets the auto background field value.
*
*/
public void setAutoBackground(boolean value)
{
field_9_options1 = autoBackground.setShortBoolean(field_9_options1, value);
}
/**
*
* @return the auto background field value.
*/
public boolean isAutoBackground()
{
return autoBackground.isSet(field_9_options1);
}
/**
* Sets the rotation field value.
*
*/
public void setRotation(short value)
{
field_9_options1 = rotation.setShortValue(field_9_options1, value);
}
/**
*
* @return the rotation field value.
*/
public short getRotation()
{
return rotation.getShortValue(field_9_options1);
}
/**
* Sets the show category label as percentage field value.
*
*/
public void setShowCategoryLabelAsPercentage(boolean value)
{
field_9_options1 = showCategoryLabelAsPercentage.setShortBoolean(field_9_options1, value);
}
/**
*
* @return the show category label as percentage field value.
*/
public boolean isShowCategoryLabelAsPercentage()
{
return showCategoryLabelAsPercentage.isSet(field_9_options1);
}
/**
* Sets the show value as percentage field value.
*
*/
public void setShowValueAsPercentage(boolean value)
{
field_9_options1 = showValueAsPercentage.setShortBoolean(field_9_options1, value);
}
/**
*
* @return the show value as percentage field value.
*/
public boolean isShowValueAsPercentage()
{
return showValueAsPercentage.isSet(field_9_options1);
}
/**
* Sets the show bubble sizes field value.
*
*/
public void setShowBubbleSizes(boolean value)
{
field_9_options1 = showBubbleSizes.setShortBoolean(field_9_options1, value);
}
/**
*
* @return the show bubble sizes field value.
*/
public boolean isShowBubbleSizes()
{
return showBubbleSizes.isSet(field_9_options1);
}
/**
* Sets the show label field value.
*
*/
public void setShowLabel(boolean value)
{
field_9_options1 = showLabel.setShortBoolean(field_9_options1, value);
}
/**
*
* @return the show label field value.
*/
public boolean isShowLabel()
{
return showLabel.isSet(field_9_options1);
}
/**
* Sets the data label placement field value.
*
*/
public void setDataLabelPlacement(short value)
{
field_11_options2 = dataLabelPlacement.setShortValue(field_11_options2, value);
}
/**
*
* @return the data label placement field value.
*/
public short getDataLabelPlacement()
{
return dataLabelPlacement.getShortValue(field_11_options2);
}
} // END OF CLASS

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The units record describes units.

View File

@ -58,10 +58,7 @@ package org.apache.poi.hssf.record;
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* The value range record defines the range of the value axis.
@ -80,15 +77,15 @@ public class ValueRangeRecord
private double field_4_minorIncrement;
private double field_5_categoryAxisCross;
private short field_6_options;
private BitField automaticMinimum = new BitField(0x1);
private BitField automaticMaximum = new BitField(0x2);
private BitField automaticMajor = new BitField(0x4);
private BitField automaticMinor = new BitField(0x8);
private BitField automaticCategoryCrossing = new BitField(0x10);
private BitField logarithmicScale = new BitField(0x20);
private BitField valuesInReverse = new BitField(0x40);
private BitField crossCategoryAxisAtMaximum = new BitField(0x80);
private BitField reserved = new BitField(0x100);
private BitField automaticMinimum = new BitField(0x1);
private BitField automaticMaximum = new BitField(0x2);
private BitField automaticMajor = new BitField(0x4);
private BitField automaticMinor = new BitField(0x8);
private BitField automaticCategoryCrossing = new BitField(0x10);
private BitField logarithmicScale = new BitField(0x20);
private BitField valuesInReverse = new BitField(0x40);
private BitField crossCategoryAxisAtMaximum = new BitField(0x80);
private BitField reserved = new BitField(0x100);
public ValueRangeRecord()

View File

@ -0,0 +1,14 @@
<record id="0x1021" name="AxisLineFormat" package="org.apache.poi.hssf.record">
<suffix>Record</suffix>
<extends>Record</extends>
<description>The axis line format record defines the axis type details.</description>
<author>Glen Stampoultzis (glens at apache.org)</author>
<fields>
<field type="int" size="2" name="axis type">
<const name="axis line" value="0"/>
<const name="major grid line" value="1"/>
<const name="minor grid line" value="2"/>
<const name="walls or floor" value="3"/>
</field>
</fields>
</record>

View File

@ -0,0 +1,16 @@
<record id="0x1041" name="AxisParent" package="org.apache.poi.hssf.record">
<suffix>Record</suffix>
<extends>Record</extends>
<description>The axis size and location</description>
<author>Glen Stampoultzis (glens at apache.org)</author>
<fields>
<field type="int" size="2" name="axis type">
<const name="main" value="0"/>
<const name="secondary" value="1"/>
</field>
<field type="int" size="4" name="x"/>
<field type="int" size="4" name="y"/>
<field type="int" size="4" name="width"/>
<field type="int" size="4" name="height"/>
</fields>
</record>

View File

@ -0,0 +1,66 @@
<record id="0x1025" name="Text" package="org.apache.poi.hssf.record">
<suffix>Record</suffix>
<extends>Record</extends>
<description>The text record is used to define text stored on a chart.</description>
<author>Glen Stampoultzis (glens at apache.org)</author>
<fields>
<field type="int" size="1" name="horizontal alignment">
<const name="left" value="1"/>
<const name="center" value="2"/>
<const name="bottom" value="3"/> <!-- is this correct. maybe it should be right???? -->
<const name="justify" value="4"/>
</field>
<field type="int" size="1" name="vertical alignment">
<const name="top" value="1"/>
<const name="center" value="2"/>
<const name="bottom" value="3"/>
<const name="justify" value="4"/>
</field>
<field type="int" size="2" name="display mode">
<const name="transparent" value="1"/>
<const name="opaque" value="2"/>
</field>
<field type="int" size="4" name="rgbColor" description="RGB color of text, high byte should be 0"/>
<field type="int" size="4" name="x" description="x position of the text in 1/4000th of the chart area"/>
<field type="int" size="4" name="y" description="y position of the text in 1/4000th of the chart area"/>
<field type="int" size="4" name="width" description="width of the text in 1/4000th of the chart area"/>
<field type="int" size="4" name="height" description="width of the text in 1/4000th of the chart area"/>
<field type="bits" size="2" name="options1">
<bit number="0" name="auto color" description="true = automaticly selected colour, false = user-selected"/>
<bit number="1" name="show key" description="true = draw legend"/>
<bit number="2" name="show value" description="false = text is category label"/>
<bit number="3" name="vertical" description="true = text is vertical"/>
<bit number="4" name="auto generated text" description=""/>
<bit number="5" name="generated" description=""/>
<bit number="6" name="auto label deleted" description=""/>
<bit number="7" name="auto background" description=""/>
<bit mask="0x0700" name="rotation" description="">
<const name="none" value="0"/>
<const name="top to bottom" value="1"/>
<const name="rotated 90 degrees" value="2"/>
<const name="rotated 90 degrees clockwise" value="3"/>
</bit>
<bit number="11" name="show category label as percentage" description=""/>
<bit number="12" name="show value as percentage" description=""/>
<bit number="13" name="show bubble sizes" description=""/>
<bit number="14" name="show label" description=""/>
</field>
<field type="int" size="2" name="index of color value" description="the index of the color value for the text"/>
<field type="bits" size="2" name="options2">
<bit mask="0x000F" name="data label placement">
<const name="chart dependent" value="0"/>
<const name="outside" value="1"/>
<const name="inside" value="2"/>
<const name="center" value="3"/>
<const name="axis" value="4"/>
<const name="above" value="5"/>
<const name="below" value="6"/>
<const name="left" value="7"/>
<const name="right" value="8"/>
<const name="auto" value="9"/>
<const name="user moved" value="10"/>
</bit>
</field>
<field type="int" size="2" name="text rotation" description="0 = horizontal, 90 = up, 180 = down, -90 = down"/>
</fields>
</record>

View File

@ -64,10 +64,7 @@ package <xsl:value-of select="@package"/>;
</xsl:if>
import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.*;
/**
* <xsl:value-of select="/record/description"/>
@ -80,7 +77,7 @@ public class <xsl:value-of select="@name"/>Record
{
public final static short sid = <xsl:value-of select="@id"/>;
<xsl:for-each select="//fields/field"> private <xsl:value-of select="recutil:getType(@size,@type,10)"/><xsl:text> </xsl:text><xsl:value-of select="recutil:getFieldName(position(),@name,0)"/>;
<xsl:apply-templates select="./bit|./const"/>
<xsl:apply-templates select="./bit|./const|./bit/const"/>
</xsl:for-each>
public <xsl:value-of select="@name"/>Record()
@ -193,6 +190,7 @@ public class <xsl:value-of select="@name"/>Record
<xsl:template match = "field" mode="bits">
<xsl:variable name="fieldNum" select="position()"/>
<xsl:for-each select="bit">
<xsl:if test="not (@mask)">
/**
* Sets the <xsl:value-of select="@name"/> field value.
* <xsl:value-of select="@description"/>
@ -210,10 +208,32 @@ public class <xsl:value-of select="@name"/>Record
{
return <xsl:value-of select="recutil:getFieldName(@name,0)"/>.isSet(<xsl:value-of select="recutil:getFieldName($fieldNum,../@name,0)"/>);
}
</xsl:if>
<xsl:if test="@mask">
/**
* Sets the <xsl:value-of select="@name"/> field value.
* <xsl:value-of select="@description"/>
*/
public void set<xsl:value-of select="recutil:getFieldName1stCap(@name,0)"/>(short value)
{
<xsl:value-of select="recutil:getFieldName($fieldNum,../@name,0)"/> = <xsl:value-of select="recutil:getFieldName(@name,0)"/>.set<xsl:value-of select="recutil:getType1stCap(../@size,../@type,0)"/>Value(<xsl:value-of select="recutil:getFieldName($fieldNum,../@name,0)"/>, value);
}
/**
* <xsl:value-of select="@description"/>
* @return the <xsl:value-of select="@name"/> field value.
*/
public short get<xsl:value-of select="recutil:getFieldName1stCap(@name,0)"/>()
{
return <xsl:value-of select="recutil:getFieldName(@name,0)"/>.getShortValue(<xsl:value-of select="recutil:getFieldName($fieldNum,../@name,0)"/>);
}
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template match = "bit" > private BitField <xsl:value-of select="recutil:getFieldName(@name,42)"/> = new BitField(<xsl:value-of select="recutil:getMask(@number)"/>);
<xsl:template match = "bit" ><xsl:if test="not (@mask)"> private BitField <xsl:value-of select="recutil:getFieldName(@name,42)"/> = new BitField(<xsl:value-of select="recutil:getMask(@number)"/>);
</xsl:if><xsl:if test="@mask"> private BitField <xsl:value-of select="recutil:getFieldName(@name,42)"/> = new BitField(<xsl:value-of select="@mask"/>);
</xsl:if>
</xsl:template>
<xsl:template match = "const"> public final static <xsl:value-of select="recutil:getType(../@size,../@type,10)"/><xsl:text> </xsl:text><xsl:value-of select="recutil:getConstName(../@name,@name,30)"/> = <xsl:value-of select="@value"/>;
</xsl:template>
@ -253,7 +273,11 @@ public class <xsl:value-of select="@name"/>Record
<xsl:apply-templates select="bit" mode="bittostring"/>
</xsl:template>
<xsl:template match="bit" mode="bittostring"> buffer.append(" .<xsl:value-of select="recutil:getFieldName(@name,20)"/> = ").append(is<xsl:value-of select="recutil:getFieldName1stCap(@name,20)"/>()).append('\n');
<xsl:template match="bit" mode="bittostring">
<xsl:if test="not (@mask)"> buffer.append(" .<xsl:value-of select="recutil:getFieldName(@name,20)"/> = ").append(is<xsl:value-of select="recutil:getFieldName1stCap(@name,20)"/>()).append('\n');
</xsl:if>
<xsl:if test="@mask"> buffer.append(" .<xsl:value-of select="recutil:getFieldName(@name,20)"/> = ").append(get<xsl:value-of select="recutil:getFieldName1stCap(@name,20)"/>()).append('\n');
</xsl:if>
</xsl:template>
<xsl:template match="author">

View File

@ -137,7 +137,7 @@ public class RecordUtil
else if (type.equals("string"))
return pad(new StringBuffer("ExcelString"), padTo).toString();
return "";
return "short"; // if we don't know, default to short
}
public static String getType1stCap(String size, String type, int padTo)

View File

@ -0,0 +1,105 @@
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache POI" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache POI", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.poi.hssf.record;
import junit.framework.TestCase;
/**
* Tests the serialization and deserialization of the AxisLineFormatRecord
* class works correctly. Test data taken directly from a real
* Excel file.
*
* @author Glen Stampoultzis (glens at apache.org)
*/
public class TestAxisLineFormatRecord
extends TestCase
{
byte[] data = new byte[] {
(byte)0x01,(byte)0x00
};
public TestAxisLineFormatRecord(String name)
{
super(name);
}
public void testLoad()
throws Exception
{
AxisLineFormatRecord record = new AxisLineFormatRecord((short)0x1021, (short)data.length, data);
assertEquals( AxisLineFormatRecord.AXIS_TYPE_MAJOR_GRID_LINE, record.getAxisType());
assertEquals( 6, record.getRecordSize() );
record.validateSid((short)0x1021);
}
public void testStore()
{
AxisLineFormatRecord record = new AxisLineFormatRecord();
record.setAxisType( AxisLineFormatRecord.AXIS_TYPE_MAJOR_GRID_LINE );
byte [] recordBytes = record.serialize();
assertEquals(recordBytes.length - 4, data.length);
for (int i = 0; i < data.length; i++)
assertEquals("At offset " + i, data[i], recordBytes[i+4]);
}
}

View File

@ -0,0 +1,116 @@
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache POI" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache POI", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.poi.hssf.record;
import junit.framework.TestCase;
/**
* Tests the serialization and deserialization of the AxisParentRecord
* class works correctly. Test data taken directly from a real
* Excel file.
*
* @author Glen Stampoultzis (glens at apache.org)
*/
public class TestAxisParentRecord
extends TestCase
{
byte[] data = new byte[] {
(byte)0x00,(byte)0x00, // axis type
(byte)0x1D,(byte)0x02,(byte)0x00,(byte)0x00, // x
(byte)0xDD,(byte)0x00,(byte)0x00,(byte)0x00, // y
(byte)0x31,(byte)0x0B,(byte)0x00,(byte)0x00, // width
(byte)0x56,(byte)0x0B,(byte)0x00,(byte)0x00 // height
};
public TestAxisParentRecord(String name)
{
super(name);
}
public void testLoad()
throws Exception
{
AxisParentRecord record = new AxisParentRecord((short)0x1041, (short)data.length, data);
assertEquals( AxisParentRecord.AXIS_TYPE_MAIN, record.getAxisType());
assertEquals( 0x021d, record.getX());
assertEquals( 0xdd, record.getY());
assertEquals( 0x0b31, record.getWidth());
assertEquals( 0x0b56, record.getHeight());
assertEquals( 22, record.getRecordSize() );
record.validateSid((short)0x1041);
}
public void testStore()
{
AxisParentRecord record = new AxisParentRecord();
record.setAxisType( AxisParentRecord.AXIS_TYPE_MAIN );
record.setX( 0x021d );
record.setY( 0xdd );
record.setWidth( 0x0b31 );
record.setHeight( 0x0b56 );
byte [] recordBytes = record.serialize();
assertEquals(recordBytes.length - 4, data.length);
for (int i = 0; i < data.length; i++)
assertEquals("At offset " + i, data[i], recordBytes[i+4]);
}
}

View File

@ -0,0 +1,166 @@
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache POI" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache POI", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.poi.hssf.record;
import junit.framework.TestCase;
/**
* Tests the serialization and deserialization of the TextRecord
* class works correctly. Test data taken directly from a real
* Excel file.
*
* @author Glen Stampoultzis (glens at apache.org)
*/
public class TestTextRecord
extends TestCase
{
byte[] data = new byte[] {
(byte)0x02, // horiz align
(byte)0x02, // vert align
(byte)0x01,(byte)0x00, // display mode
(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, // rgb color
(byte)0xD6,(byte)0xFF,(byte)0xFF,(byte)0xFF, // x
(byte)0xC4,(byte)0xFF,(byte)0xFF,(byte)0xFF, // y
(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, // width
(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, // height
(byte)0xB1,(byte)0x00, // options 1
(byte)0x4D,(byte)0x00, // index of color value
(byte)0x50,(byte)0x2B, // options 2 -- strange upper bits supposed to be 0'd
(byte)0x00,(byte)0x00 // text rotation
};
public TestTextRecord(String name)
{
super(name);
}
public void testLoad()
throws Exception
{
TextRecord record = new TextRecord((short)0x1025, (short)data.length, data);
assertEquals( TextRecord.HORIZONTAL_ALIGNMENT_CENTER, record.getHorizontalAlignment());
assertEquals( TextRecord.VERTICAL_ALIGNMENT_CENTER, record.getVerticalAlignment());
assertEquals( TextRecord.DISPLAY_MODE_TRANSPARENT, record.getDisplayMode());
assertEquals( 0, record.getRgbColor());
assertEquals( -42, record.getX());
assertEquals( -60, record.getY());
assertEquals( 0, record.getWidth());
assertEquals( 0, record.getHeight());
assertEquals( 177, record.getOptions1());
assertEquals( true, record.isAutoColor() );
assertEquals( false, record.isShowKey() );
assertEquals( false, record.isShowValue() );
assertEquals( false, record.isVertical() );
assertEquals( true, record.isAutoGeneratedText() );
assertEquals( true, record.isGenerated() );
assertEquals( false, record.isAutoLabelDeleted() );
assertEquals( true, record.isAutoBackground() );
assertEquals( TextRecord.ROTATION_NONE, record.getRotation() );
assertEquals( false, record.isShowCategoryLabelAsPercentage() );
assertEquals( false, record.isShowValueAsPercentage() );
assertEquals( false, record.isShowBubbleSizes() );
assertEquals( false, record.isShowLabel() );
assertEquals( 77, record.getIndexOfColorValue());
assertEquals( 11088, record.getOptions2());
assertEquals( 0, record.getDataLabelPlacement() );
assertEquals( 0, record.getTextRotation());
assertEquals( 36, record.getRecordSize() );
record.validateSid((short)0x1025);
}
public void testStore()
{
TextRecord record = new TextRecord();
record.setHorizontalAlignment( TextRecord.HORIZONTAL_ALIGNMENT_CENTER );
record.setVerticalAlignment( TextRecord.VERTICAL_ALIGNMENT_CENTER );
record.setDisplayMode( TextRecord.DISPLAY_MODE_TRANSPARENT );
record.setRgbColor( 0 );
record.setX( -42 );
record.setY( -60 );
record.setWidth( 0 );
record.setHeight( 0 );
record.setAutoColor( true );
record.setShowKey( false );
record.setShowValue( false );
record.setVertical( false );
record.setAutoGeneratedText( true );
record.setGenerated( true );
record.setAutoLabelDeleted( false );
record.setAutoBackground( true );
record.setRotation( TextRecord.ROTATION_NONE );
record.setShowCategoryLabelAsPercentage( false );
record.setShowValueAsPercentage( false );
record.setShowBubbleSizes( false );
record.setShowLabel( false );
record.setIndexOfColorValue( (short)77 );
record.setOptions2( (short)0x2b50 );
// record.setDataLabelPlacement( (short)0x2b50 );
record.setTextRotation( (short)0 );
byte [] recordBytes = record.serialize();
assertEquals(recordBytes.length - 4, data.length);
for (int i = 0; i < data.length; i++)
assertEquals("At offset " + i, data[i], recordBytes[i+4]);
}
}