Some changes to record generation
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352885 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3dc6a403e9
commit
a46e6bdc12
@ -164,6 +164,8 @@ public class HSSFCellUtil
|
|||||||
*@param workbook The workbook that is being worked with.
|
*@param workbook The workbook that is being worked with.
|
||||||
*@param align the column alignment to use.
|
*@param align the column alignment to use.
|
||||||
*@exception NestableException Thrown if an error happens.
|
*@exception NestableException Thrown if an error happens.
|
||||||
|
*
|
||||||
|
* @see HSSFCellStyle for alignment options
|
||||||
*/
|
*/
|
||||||
public static void setAlignment( HSSFCell cell, HSSFWorkbook workbook, short align ) throws NestableException
|
public static void setAlignment( HSSFCell cell, HSSFWorkbook workbook, short align ) throws NestableException
|
||||||
{
|
{
|
||||||
@ -198,7 +200,6 @@ public class HSSFCellUtil
|
|||||||
*@param cell The cell that needs it's style changes
|
*@param cell The cell that needs it's style changes
|
||||||
*@exception NestableException Thrown if an error happens.
|
*@exception NestableException Thrown if an error happens.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static void setCellStyleProperty( HSSFCell cell, HSSFWorkbook workbook, String propertyName, Object propertyValue )
|
public static void setCellStyleProperty( HSSFCell cell, HSSFWorkbook workbook, String propertyName, Object propertyValue )
|
||||||
throws NestableException
|
throws NestableException
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN" "../dtd/document-v11.dtd">
|
<!-- <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN" "../dtd/document-v11.dtd"> -->
|
||||||
|
|
||||||
<document>
|
<document>
|
||||||
<header>
|
<header>
|
||||||
@ -20,33 +20,36 @@
|
|||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
A utility was needed to take the defintition of what a
|
A utility was needed to take the defintition of what a
|
||||||
record looked like and do all the boring stuff. Thus the
|
record looked like and do all the boring and repetitive work.
|
||||||
record generator was born.
|
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section title="Capabilities">
|
<section title="Capabilities">
|
||||||
<p>
|
<p>
|
||||||
The record generator takes XML as input and produced the following
|
The record generator takes XML as input and produces the following
|
||||||
output:
|
output:
|
||||||
<ul>
|
<ul>
|
||||||
<li>A Java file capabile of decoding and encoding the record.</li>
|
<li>A Java file capabile of decoding and encoding the record.</li>
|
||||||
<li>A test class with provides a fill-in-the-blanks implementation of a test case
|
<li>A test class that provides a fill-in-the-blanks implementation
|
||||||
for ensuring the record operates as designed.</li>
|
of a test case for ensuring the record operates as
|
||||||
|
designed.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
<section title="Usage">
|
<section title="Usage">
|
||||||
<p>
|
<p>
|
||||||
The record generator is invoked as an Ant target (generate-records). It goes
|
The record generator is invoked as an Ant target
|
||||||
through looking for all files in src/records/defintitions ending with _record.xml.
|
(generate-records). It goes through looking for all files in
|
||||||
It then creates two files; the Java record definition and the Java test case template.
|
<code>src/records/defintitions</code> ending with _record.xml.
|
||||||
|
It then creates two files; the Java record definition and the
|
||||||
|
Java test case template.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
The records themselves have the following general layout:
|
The records themselves have the following general layout:
|
||||||
</p>
|
</p>
|
||||||
<source><![CDATA[
|
<source><![CDATA[
|
||||||
<record id="0x1032" name="Frame" package="org.apache.poi.hssf.record">
|
<record id="0x1032" name="Frame" package="org.apache.poi.hssf.record"
|
||||||
|
excel-record-id="FRAME">
|
||||||
<description>The frame record indicates whether there is a border
|
<description>The frame record indicates whether there is a border
|
||||||
around the displayed text of a chart.</description>
|
around the displayed text of a chart.</description>
|
||||||
<author>Glen Stampoultzis (glens at apache.org)</author>
|
<author>Glen Stampoultzis (glens at apache.org)</author>
|
||||||
@ -65,13 +68,67 @@
|
|||||||
</record>
|
</record>
|
||||||
]]></source>
|
]]></source>
|
||||||
<p>
|
<p>
|
||||||
Currently the type can be of type int, float or string. The 'int'
|
The following table details the allowable types and sizes for
|
||||||
type covers bytes, shorts and integers which is selected using a
|
the fields.
|
||||||
size of 1, 2 or 4. An additional type called varword is used to
|
|
||||||
represent a array of word values where the first short is the length
|
|
||||||
of the array. The string type generation is only partially
|
|
||||||
implemented. If choosing string you must select a size of 'var'.
|
|
||||||
</p>
|
</p>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Size</th>
|
||||||
|
<th>Java Type</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>int</td>
|
||||||
|
<td>1</td>
|
||||||
|
<td>byte</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>int</td>
|
||||||
|
<td>2</td>
|
||||||
|
<td>short</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>int</td>
|
||||||
|
<td>4</td>
|
||||||
|
<td>int</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>int</td>
|
||||||
|
<td>8</td>
|
||||||
|
<td>long</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>int</td>
|
||||||
|
<td>varword</td>
|
||||||
|
<td>array of shorts</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>bits</td>
|
||||||
|
<td>1</td>
|
||||||
|
<td>A byte comprising of a bits (defined by the bit element)
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>bits</td>
|
||||||
|
<td>2</td>
|
||||||
|
<td>An short comprising of a bits</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>bits</td>
|
||||||
|
<td>4</td>
|
||||||
|
<td>A int comprising of a bits</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>float</td>
|
||||||
|
<td>8</td>
|
||||||
|
<td>double</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>hbstring</td>
|
||||||
|
<td>java expression</td>
|
||||||
|
<td>String</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
<p>
|
<p>
|
||||||
The Java records are regenerated each time the record generator is
|
The Java records are regenerated each time the record generator is
|
||||||
run, however the test stubs are only created if the test stub does
|
run, however the test stubs are only created if the test stub does
|
||||||
@ -79,6 +136,29 @@
|
|||||||
stubs but not the generated records.
|
stubs but not the generated records.
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
<section title="Custom Field Types">
|
||||||
|
<p>
|
||||||
|
Occationally the builtin types are not enough. More control
|
||||||
|
over the encoding and decoding of the streams is required. This
|
||||||
|
can be achieved using a custom type.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
A custom type lets you escape to java to define the way in which
|
||||||
|
the field encodes and decodes. To code a custom type you
|
||||||
|
declare your field like this:
|
||||||
|
</p>
|
||||||
|
<source><![CDATA[
|
||||||
|
<field type="custom:org.apache.poi.hssf.record.LinkedDataFormulaField"
|
||||||
|
size="var" name="formula of link" description="formula"/>
|
||||||
|
]]></source>
|
||||||
|
<p>
|
||||||
|
Where the class name specified after <code>custom:</code> is a
|
||||||
|
class implementing the interface <code>CustomField</code>.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
You can then implement the encoding yourself.
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
<section title="How it Works">
|
<section title="How it Works">
|
||||||
<p>
|
<p>
|
||||||
The record generation works by taking an XML file and styling it
|
The record generation works by taking an XML file and styling it
|
||||||
@ -89,23 +169,23 @@
|
|||||||
See record.xsl, record_test.xsl, FieldIterator.java,
|
See record.xsl, record_test.xsl, FieldIterator.java,
|
||||||
RecordUtil.java, RecordGenerator.java
|
RecordUtil.java, RecordGenerator.java
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
There is a corresponding "type" generator for HDF.
|
||||||
|
See the HDF documentation for details.
|
||||||
|
</p>
|
||||||
</section>
|
</section>
|
||||||
<section title="Limitations">
|
<section title="Limitations">
|
||||||
<p>
|
<p>
|
||||||
The record generator does not handle all possible record types and
|
The record generator does not handle all possible record types and
|
||||||
is not ment to. Sometimes it's going to make more sense to generate
|
goes not intend to perform this function. When dealing with a
|
||||||
the records manually. The main point of this thing is to make the
|
non-standard record sometimes the cost-benifit of coding the
|
||||||
easy stuff simple.
|
record by hand will be greater than attempting modify the
|
||||||
</p>
|
generator. The main point of the record generator is to save
|
||||||
<p>
|
time, so keep that in mind.
|
||||||
Currently the record generator is optimized to create Excel records.
|
|
||||||
It could be adapted to create Word records with a little poking
|
|
||||||
around.
|
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Currently the the XSL file that generates the record calls out to
|
Currently the the XSL file that generates the record calls out to
|
||||||
Java objects. This would have been better done as Javascript inside
|
Java objects. The Java code for the record generation is
|
||||||
the XSL file itself. The Java code for the record generation is
|
|
||||||
currently quite messy with minimal comments.
|
currently quite messy with minimal comments.
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
@ -56,15 +56,11 @@
|
|||||||
|
|
||||||
package org.apache.poi.hssf.model;
|
package org.apache.poi.hssf.model;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Stack;
|
|
||||||
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import org.apache.poi.hssf.util.SheetReferences;
|
|
||||||
import org.apache.poi.hssf.record.formula.*;
|
import org.apache.poi.hssf.record.formula.*;
|
||||||
|
import org.apache.poi.hssf.util.SheetReferences;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -101,7 +97,7 @@ public class FormulaParser {
|
|||||||
private static char TAB = '\t';
|
private static char TAB = '\t';
|
||||||
private static char CR = '\n';
|
private static char CR = '\n';
|
||||||
|
|
||||||
private char Look; // Lookahead Character
|
private char look; // Lookahead Character
|
||||||
|
|
||||||
private Workbook book;
|
private Workbook book;
|
||||||
|
|
||||||
@ -125,10 +121,10 @@ public class FormulaParser {
|
|||||||
// Just return if so and reset Look to smoething to keep
|
// Just return if so and reset Look to smoething to keep
|
||||||
// SkipWhitespace from spinning
|
// SkipWhitespace from spinning
|
||||||
if (pointer == formulaLength) {
|
if (pointer == formulaLength) {
|
||||||
Look = (char)0;
|
look = (char)0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Look=formulaString.charAt(pointer++);
|
look=formulaString.charAt(pointer++);
|
||||||
//System.out.println("Got char: "+Look);
|
//System.out.println("Got char: "+Look);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,7 +189,7 @@ public class FormulaParser {
|
|||||||
|
|
||||||
/** Skip Over Leading White Space */
|
/** Skip Over Leading White Space */
|
||||||
private void SkipWhite() {
|
private void SkipWhite() {
|
||||||
while (IsWhite(Look)) {
|
while (IsWhite(look)) {
|
||||||
GetChar();
|
GetChar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -202,7 +198,7 @@ public class FormulaParser {
|
|||||||
|
|
||||||
/** Match a Specific Input Character */
|
/** Match a Specific Input Character */
|
||||||
private void Match(char x) {
|
private void Match(char x) {
|
||||||
if (Look != x) {
|
if (look != x) {
|
||||||
Expected("" + x + "");
|
Expected("" + x + "");
|
||||||
}else {
|
}else {
|
||||||
GetChar();
|
GetChar();
|
||||||
@ -213,11 +209,11 @@ public class FormulaParser {
|
|||||||
/** Get an Identifier */
|
/** Get an Identifier */
|
||||||
private String GetName() {
|
private String GetName() {
|
||||||
StringBuffer Token = new StringBuffer();
|
StringBuffer Token = new StringBuffer();
|
||||||
if (!IsAlpha(Look)) {
|
if (!IsAlpha(look)) {
|
||||||
Expected("Name");
|
Expected("Name");
|
||||||
}
|
}
|
||||||
while (IsAlNum(Look)) {
|
while (IsAlNum(look)) {
|
||||||
Token = Token.append(Character.toUpperCase(Look));
|
Token = Token.append(Character.toUpperCase(look));
|
||||||
GetChar();
|
GetChar();
|
||||||
}
|
}
|
||||||
SkipWhite();
|
SkipWhite();
|
||||||
@ -228,11 +224,11 @@ public class FormulaParser {
|
|||||||
converting to uppercase; used for literals */
|
converting to uppercase; used for literals */
|
||||||
private String GetNameAsIs() {
|
private String GetNameAsIs() {
|
||||||
StringBuffer Token = new StringBuffer();
|
StringBuffer Token = new StringBuffer();
|
||||||
if (!IsAlpha(Look)) {
|
if (!IsAlpha(look)) {
|
||||||
Expected("Name");
|
Expected("Name");
|
||||||
}
|
}
|
||||||
while (IsAlNum(Look) || IsWhite(Look)) {
|
while (IsAlNum(look) || IsWhite(look)) {
|
||||||
Token = Token.append(Look);
|
Token = Token.append(look);
|
||||||
GetChar();
|
GetChar();
|
||||||
}
|
}
|
||||||
return Token.toString();
|
return Token.toString();
|
||||||
@ -242,9 +238,9 @@ public class FormulaParser {
|
|||||||
/** Get a Number */
|
/** Get a Number */
|
||||||
private String GetNum() {
|
private String GetNum() {
|
||||||
String Value ="";
|
String Value ="";
|
||||||
if (!IsDigit(Look)) Expected("Integer");
|
if (!IsDigit(look)) Expected("Integer");
|
||||||
while (IsDigit(Look)){
|
while (IsDigit(look)){
|
||||||
Value = Value + Look;
|
Value = Value + look;
|
||||||
GetChar();
|
GetChar();
|
||||||
}
|
}
|
||||||
SkipWhite();
|
SkipWhite();
|
||||||
@ -266,20 +262,20 @@ public class FormulaParser {
|
|||||||
private void Ident() {
|
private void Ident() {
|
||||||
String name;
|
String name;
|
||||||
name = GetName();
|
name = GetName();
|
||||||
if (Look == '('){
|
if (look == '('){
|
||||||
//This is a function
|
//This is a function
|
||||||
function(name);
|
function(name);
|
||||||
} else if (Look == ':') { // this is a AreaReference
|
} else if (look == ':') { // this is a AreaReference
|
||||||
String first = name;
|
String first = name;
|
||||||
Match(':');
|
Match(':');
|
||||||
String second = GetName();
|
String second = GetName();
|
||||||
tokens.add(new AreaPtg(first+":"+second));
|
tokens.add(new AreaPtg(first+":"+second));
|
||||||
} else if (Look == '!') {
|
} else if (look == '!') {
|
||||||
Match('!');
|
Match('!');
|
||||||
String sheetName = name;
|
String sheetName = name;
|
||||||
String first = GetName();
|
String first = GetName();
|
||||||
short externIdx = book.checkExternSheet(book.getSheetIndex(sheetName));
|
short externIdx = book.checkExternSheet(book.getSheetIndex(sheetName));
|
||||||
if (Look == ':') {
|
if (look == ':') {
|
||||||
Match(':');
|
Match(':');
|
||||||
String second=GetName();
|
String second=GetName();
|
||||||
|
|
||||||
@ -326,12 +322,12 @@ public class FormulaParser {
|
|||||||
/** get arguments to a function */
|
/** get arguments to a function */
|
||||||
private int Arguments() {
|
private int Arguments() {
|
||||||
int numArgs = 0;
|
int numArgs = 0;
|
||||||
if (Look != ')') {
|
if (look != ')') {
|
||||||
numArgs++;
|
numArgs++;
|
||||||
Expression();
|
Expression();
|
||||||
}
|
}
|
||||||
while (Look == ',' || Look == ';') { //TODO handle EmptyArgs
|
while (look == ',' || look == ';') { //TODO handle EmptyArgs
|
||||||
if(Look == ',') {
|
if(look == ',') {
|
||||||
Match(',');
|
Match(',');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -345,23 +341,23 @@ public class FormulaParser {
|
|||||||
|
|
||||||
/** Parse and Translate a Math Factor */
|
/** Parse and Translate a Math Factor */
|
||||||
private void Factor() {
|
private void Factor() {
|
||||||
if (Look == '(' ) {
|
if (look == '(' ) {
|
||||||
Match('(');
|
Match('(');
|
||||||
Expression();
|
Expression();
|
||||||
Match(')');
|
Match(')');
|
||||||
tokens.add(new ParenthesisPtg());
|
tokens.add(new ParenthesisPtg());
|
||||||
return;
|
return;
|
||||||
} else if (IsAlpha(Look)){
|
} else if (IsAlpha(look)){
|
||||||
Ident();
|
Ident();
|
||||||
} else if(Look == '"') {
|
} else if(look == '"') {
|
||||||
StringLiteral();
|
StringLiteral();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
String number = GetNum();
|
String number = GetNum();
|
||||||
if (Look=='.') {
|
if (look=='.') {
|
||||||
Match('.');
|
Match('.');
|
||||||
String decimalPart = null;
|
String decimalPart = null;
|
||||||
if (IsDigit(Look)) number = number +"."+ GetNum(); //this also takes care of someone entering "1234."
|
if (IsDigit(look)) number = number +"."+ GetNum(); //this also takes care of someone entering "1234."
|
||||||
tokens.add(new NumberPtg(number));
|
tokens.add(new NumberPtg(number));
|
||||||
} else {
|
} else {
|
||||||
tokens.add(new IntPtg(number)); //TODO:what if the number is too big to be a short? ..add factory to return Int or Number!
|
tokens.add(new IntPtg(number)); //TODO:what if the number is too big to be a short? ..add factory to return Int or Number!
|
||||||
@ -397,13 +393,13 @@ public class FormulaParser {
|
|||||||
/** Parse and Translate a Math Term */
|
/** Parse and Translate a Math Term */
|
||||||
private void Term(){
|
private void Term(){
|
||||||
Factor();
|
Factor();
|
||||||
while (Look == '*' || Look == '/' || Look == '^' || Look == '&' || Look == '=' ) {
|
while (look == '*' || look == '/' || look == '^' || look == '&' || look == '=' ) {
|
||||||
///TODO do we need to do anything here??
|
///TODO do we need to do anything here??
|
||||||
if (Look == '*') Multiply();
|
if (look == '*') Multiply();
|
||||||
if (Look == '/') Divide();
|
if (look == '/') Divide();
|
||||||
if (Look == '^') Power();
|
if (look == '^') Power();
|
||||||
if (Look == '&') Concat();
|
if (look == '&') Concat();
|
||||||
if (Look == '=') Equal();
|
if (look == '=') Equal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -444,16 +440,16 @@ public class FormulaParser {
|
|||||||
|
|
||||||
/** Parse and Translate an Expression */
|
/** Parse and Translate an Expression */
|
||||||
private void Expression() {
|
private void Expression() {
|
||||||
if (IsAddop(Look)) {
|
if (IsAddop(look)) {
|
||||||
EmitLn("CLR D0"); //unaryAdd ptg???
|
EmitLn("CLR D0"); //unaryAdd ptg???
|
||||||
} else {
|
} else {
|
||||||
Term();
|
Term();
|
||||||
}
|
}
|
||||||
while (IsAddop(Look)) {
|
while (IsAddop(look)) {
|
||||||
if ( Look == '+' ) Add();
|
if ( look == '+' ) Add();
|
||||||
if (Look == '-') Subtract();
|
if (look == '-') Subtract();
|
||||||
if (Look == '*') Multiply();
|
if (look == '*') Multiply();
|
||||||
if (Look == '/') Divide();
|
if (look == '/') Divide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,6 +98,7 @@ public class AreaFormatRecord
|
|||||||
public AreaFormatRecord(short id, short size, byte [] data)
|
public AreaFormatRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -113,6 +114,7 @@ public class AreaFormatRecord
|
|||||||
public AreaFormatRecord(short id, short size, byte [] data, int offset)
|
public AreaFormatRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -130,12 +132,14 @@ public class AreaFormatRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_foregroundColor = LittleEndian.getInt(data, 0x0 + offset);
|
|
||||||
field_2_backgroundColor = LittleEndian.getInt(data, 0x4 + offset);
|
int pos = 0;
|
||||||
field_3_pattern = LittleEndian.getShort(data, 0x8 + offset);
|
field_1_foregroundColor = LittleEndian.getInt(data, pos + 0x0 + offset);
|
||||||
field_4_formatFlags = LittleEndian.getShort(data, 0xa + offset);
|
field_2_backgroundColor = LittleEndian.getInt(data, pos + 0x4 + offset);
|
||||||
field_5_forecolorIndex = LittleEndian.getShort(data, 0xc + offset);
|
field_3_pattern = LittleEndian.getShort(data, pos + 0x8 + offset);
|
||||||
field_6_backcolorIndex = LittleEndian.getShort(data, 0xe + offset);
|
field_4_formatFlags = LittleEndian.getShort(data, pos + 0xa + offset);
|
||||||
|
field_5_forecolorIndex = LittleEndian.getShort(data, pos + 0xc + offset);
|
||||||
|
field_6_backcolorIndex = LittleEndian.getShort(data, pos + 0xe + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,55 +147,51 @@ public class AreaFormatRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[AreaFormat]\n");
|
buffer.append("[AREAFORMAT]\n");
|
||||||
|
|
||||||
buffer.append(" .foregroundColor = ")
|
buffer.append(" .foregroundColor = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getForegroundColor ()))
|
||||||
.append(HexDump.toHex((int)getForegroundColor()))
|
.append(" (").append( getForegroundColor() ).append(" )");
|
||||||
.append(" (").append(getForegroundColor()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .backgroundColor = ")
|
buffer.append(" .backgroundColor = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getBackgroundColor ()))
|
||||||
.append(HexDump.toHex((int)getBackgroundColor()))
|
.append(" (").append( getBackgroundColor() ).append(" )");
|
||||||
.append(" (").append(getBackgroundColor()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .pattern = ")
|
buffer.append(" .pattern = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getPattern ()))
|
||||||
.append(HexDump.toHex((short)getPattern()))
|
.append(" (").append( getPattern() ).append(" )");
|
||||||
.append(" (").append(getPattern()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .formatFlags = ")
|
buffer.append(" .formatFlags = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getFormatFlags ()))
|
||||||
.append(HexDump.toHex((short)getFormatFlags()))
|
.append(" (").append( getFormatFlags() ).append(" )");
|
||||||
.append(" (").append(getFormatFlags()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .automatic = ").append(isAutomatic()).append('\n');
|
buffer.append(" .automatic = ").append(isAutomatic()).append('\n');
|
||||||
buffer.append(" .invert = ").append(isInvert()).append('\n');
|
buffer.append(" .invert = ").append(isInvert()).append('\n');
|
||||||
|
|
||||||
buffer.append(" .forecolorIndex = ")
|
buffer.append(" .forecolorIndex = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getForecolorIndex ()))
|
||||||
.append(HexDump.toHex((short)getForecolorIndex()))
|
.append(" (").append( getForecolorIndex() ).append(" )");
|
||||||
.append(" (").append(getForecolorIndex()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .backcolorIndex = ")
|
buffer.append(" .backcolorIndex = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getBackcolorIndex ()))
|
||||||
.append(HexDump.toHex((short)getBackcolorIndex()))
|
.append(" (").append( getBackcolorIndex() ).append(" )");
|
||||||
.append(" (").append(getBackcolorIndex()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/AreaFormat]\n");
|
buffer.append("[/AREAFORMAT]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putInt(data, 4 + offset, field_1_foregroundColor);
|
LittleEndian.putInt(data, 4 + offset + pos, field_1_foregroundColor);
|
||||||
LittleEndian.putInt(data, 8 + offset, field_2_backgroundColor);
|
LittleEndian.putInt(data, 8 + offset + pos, field_2_backgroundColor);
|
||||||
LittleEndian.putShort(data, 12 + offset, field_3_pattern);
|
LittleEndian.putShort(data, 12 + offset + pos, field_3_pattern);
|
||||||
LittleEndian.putShort(data, 14 + offset, field_4_formatFlags);
|
LittleEndian.putShort(data, 14 + offset + pos, field_4_formatFlags);
|
||||||
LittleEndian.putShort(data, 16 + offset, field_5_forecolorIndex);
|
LittleEndian.putShort(data, 16 + offset + pos, field_5_forecolorIndex);
|
||||||
LittleEndian.putShort(data, 18 + offset, field_6_backcolorIndex);
|
LittleEndian.putShort(data, 18 + offset + pos, field_6_backcolorIndex);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -218,11 +218,12 @@ public class AreaFormatRecord
|
|||||||
rec.field_4_formatFlags = field_4_formatFlags;
|
rec.field_4_formatFlags = field_4_formatFlags;
|
||||||
rec.field_5_forecolorIndex = field_5_forecolorIndex;
|
rec.field_5_forecolorIndex = field_5_forecolorIndex;
|
||||||
rec.field_6_backcolorIndex = field_6_backcolorIndex;
|
rec.field_6_backcolorIndex = field_6_backcolorIndex;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the foreground color field for the AreaFormat record.
|
* Get the foreground color field for the AreaFormat record.
|
||||||
*/
|
*/
|
||||||
|
@ -94,6 +94,7 @@ public class AreaRecord
|
|||||||
public AreaRecord(short id, short size, byte [] data)
|
public AreaRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -109,6 +110,7 @@ public class AreaRecord
|
|||||||
public AreaRecord(short id, short size, byte [] data, int offset)
|
public AreaRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -126,7 +128,9 @@ public class AreaRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_formatFlags = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
|
int pos = 0;
|
||||||
|
field_1_formatFlags = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,26 +138,27 @@ public class AreaRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[Area]\n");
|
buffer.append("[AREA]\n");
|
||||||
|
|
||||||
buffer.append(" .formatFlags = ")
|
buffer.append(" .formatFlags = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getFormatFlags ()))
|
||||||
.append(HexDump.toHex((short)getFormatFlags()))
|
.append(" (").append( getFormatFlags() ).append(" )");
|
||||||
.append(" (").append(getFormatFlags()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .stacked = ").append(isStacked()).append('\n');
|
buffer.append(" .stacked = ").append(isStacked()).append('\n');
|
||||||
buffer.append(" .displayAsPercentage = ").append(isDisplayAsPercentage()).append('\n');
|
buffer.append(" .displayAsPercentage = ").append(isDisplayAsPercentage()).append('\n');
|
||||||
buffer.append(" .shadow = ").append(isShadow()).append('\n');
|
buffer.append(" .shadow = ").append(isShadow()).append('\n');
|
||||||
|
|
||||||
buffer.append("[/Area]\n");
|
buffer.append("[/AREA]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_formatFlags);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_formatFlags);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -175,11 +180,12 @@ public class AreaRecord
|
|||||||
AreaRecord rec = new AreaRecord();
|
AreaRecord rec = new AreaRecord();
|
||||||
|
|
||||||
rec.field_1_formatFlags = field_1_formatFlags;
|
rec.field_1_formatFlags = field_1_formatFlags;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the format flags field for the Area record.
|
* Get the format flags field for the Area record.
|
||||||
*/
|
*/
|
||||||
|
@ -95,6 +95,7 @@ public class AxisLineFormatRecord
|
|||||||
public AxisLineFormatRecord(short id, short size, byte [] data)
|
public AxisLineFormatRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -110,6 +111,7 @@ public class AxisLineFormatRecord
|
|||||||
public AxisLineFormatRecord(short id, short size, byte [] data, int offset)
|
public AxisLineFormatRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -127,7 +129,9 @@ public class AxisLineFormatRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_axisType = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
|
int pos = 0;
|
||||||
|
field_1_axisType = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,23 +139,24 @@ public class AxisLineFormatRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[AxisLineFormat]\n");
|
buffer.append("[AXISLINEFORMAT]\n");
|
||||||
|
|
||||||
buffer.append(" .axisType = ")
|
buffer.append(" .axisType = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getAxisType ()))
|
||||||
.append(HexDump.toHex((short)getAxisType()))
|
.append(" (").append( getAxisType() ).append(" )");
|
||||||
.append(" (").append(getAxisType()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/AxisLineFormat]\n");
|
buffer.append("[/AXISLINEFORMAT]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_axisType);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_axisType);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -173,11 +178,12 @@ public class AxisLineFormatRecord
|
|||||||
AxisLineFormatRecord rec = new AxisLineFormatRecord();
|
AxisLineFormatRecord rec = new AxisLineFormatRecord();
|
||||||
|
|
||||||
rec.field_1_axisType = field_1_axisType;
|
rec.field_1_axisType = field_1_axisType;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the axis type field for the AxisLineFormat record.
|
* Get the axis type field for the AxisLineFormat record.
|
||||||
*
|
*
|
||||||
|
@ -107,6 +107,7 @@ public class AxisOptionsRecord
|
|||||||
public AxisOptionsRecord(short id, short size, byte [] data)
|
public AxisOptionsRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -122,6 +123,7 @@ public class AxisOptionsRecord
|
|||||||
public AxisOptionsRecord(short id, short size, byte [] data, int offset)
|
public AxisOptionsRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -139,15 +141,17 @@ public class AxisOptionsRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_minimumCategory = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
field_2_maximumCategory = LittleEndian.getShort(data, 0x2 + offset);
|
int pos = 0;
|
||||||
field_3_majorUnitValue = LittleEndian.getShort(data, 0x4 + offset);
|
field_1_minimumCategory = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
field_4_majorUnit = LittleEndian.getShort(data, 0x6 + offset);
|
field_2_maximumCategory = LittleEndian.getShort(data, pos + 0x2 + offset);
|
||||||
field_5_minorUnitValue = LittleEndian.getShort(data, 0x8 + offset);
|
field_3_majorUnitValue = LittleEndian.getShort(data, pos + 0x4 + offset);
|
||||||
field_6_minorUnit = LittleEndian.getShort(data, 0xa + offset);
|
field_4_majorUnit = LittleEndian.getShort(data, pos + 0x6 + offset);
|
||||||
field_7_baseUnit = LittleEndian.getShort(data, 0xc + offset);
|
field_5_minorUnitValue = LittleEndian.getShort(data, pos + 0x8 + offset);
|
||||||
field_8_crossingPoint = LittleEndian.getShort(data, 0xe + offset);
|
field_6_minorUnit = LittleEndian.getShort(data, pos + 0xa + offset);
|
||||||
field_9_options = LittleEndian.getShort(data, 0x10 + offset);
|
field_7_baseUnit = LittleEndian.getShort(data, pos + 0xc + offset);
|
||||||
|
field_8_crossingPoint = LittleEndian.getShort(data, pos + 0xe + offset);
|
||||||
|
field_9_options = LittleEndian.getShort(data, pos + 0x10 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,52 +159,43 @@ public class AxisOptionsRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[AxisOptions]\n");
|
buffer.append("[AXCEXT]\n");
|
||||||
|
|
||||||
buffer.append(" .minimumCategory = ")
|
buffer.append(" .minimumCategory = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getMinimumCategory ()))
|
||||||
.append(HexDump.toHex((short)getMinimumCategory()))
|
.append(" (").append( getMinimumCategory() ).append(" )");
|
||||||
.append(" (").append(getMinimumCategory()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .maximumCategory = ")
|
buffer.append(" .maximumCategory = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getMaximumCategory ()))
|
||||||
.append(HexDump.toHex((short)getMaximumCategory()))
|
.append(" (").append( getMaximumCategory() ).append(" )");
|
||||||
.append(" (").append(getMaximumCategory()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .majorUnitValue = ")
|
buffer.append(" .majorUnitValue = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getMajorUnitValue ()))
|
||||||
.append(HexDump.toHex((short)getMajorUnitValue()))
|
.append(" (").append( getMajorUnitValue() ).append(" )");
|
||||||
.append(" (").append(getMajorUnitValue()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .majorUnit = ")
|
buffer.append(" .majorUnit = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getMajorUnit ()))
|
||||||
.append(HexDump.toHex((short)getMajorUnit()))
|
.append(" (").append( getMajorUnit() ).append(" )");
|
||||||
.append(" (").append(getMajorUnit()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .minorUnitValue = ")
|
buffer.append(" .minorUnitValue = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getMinorUnitValue ()))
|
||||||
.append(HexDump.toHex((short)getMinorUnitValue()))
|
.append(" (").append( getMinorUnitValue() ).append(" )");
|
||||||
.append(" (").append(getMinorUnitValue()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .minorUnit = ")
|
buffer.append(" .minorUnit = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getMinorUnit ()))
|
||||||
.append(HexDump.toHex((short)getMinorUnit()))
|
.append(" (").append( getMinorUnit() ).append(" )");
|
||||||
.append(" (").append(getMinorUnit()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .baseUnit = ")
|
buffer.append(" .baseUnit = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getBaseUnit ()))
|
||||||
.append(HexDump.toHex((short)getBaseUnit()))
|
.append(" (").append( getBaseUnit() ).append(" )");
|
||||||
.append(" (").append(getBaseUnit()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .crossingPoint = ")
|
buffer.append(" .crossingPoint = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getCrossingPoint ()))
|
||||||
.append(HexDump.toHex((short)getCrossingPoint()))
|
.append(" (").append( getCrossingPoint() ).append(" )");
|
||||||
.append(" (").append(getCrossingPoint()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .options = ")
|
buffer.append(" .options = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getOptions ()))
|
||||||
.append(HexDump.toHex((short)getOptions()))
|
.append(" (").append( getOptions() ).append(" )");
|
||||||
.append(" (").append(getOptions()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .defaultMinimum = ").append(isDefaultMinimum()).append('\n');
|
buffer.append(" .defaultMinimum = ").append(isDefaultMinimum()).append('\n');
|
||||||
buffer.append(" .defaultMaximum = ").append(isDefaultMaximum()).append('\n');
|
buffer.append(" .defaultMaximum = ").append(isDefaultMaximum()).append('\n');
|
||||||
buffer.append(" .defaultMajor = ").append(isDefaultMajor()).append('\n');
|
buffer.append(" .defaultMajor = ").append(isDefaultMajor()).append('\n');
|
||||||
@ -210,24 +205,26 @@ public class AxisOptionsRecord
|
|||||||
buffer.append(" .defaultCross = ").append(isDefaultCross()).append('\n');
|
buffer.append(" .defaultCross = ").append(isDefaultCross()).append('\n');
|
||||||
buffer.append(" .defaultDateSettings = ").append(isDefaultDateSettings()).append('\n');
|
buffer.append(" .defaultDateSettings = ").append(isDefaultDateSettings()).append('\n');
|
||||||
|
|
||||||
buffer.append("[/AxisOptions]\n");
|
buffer.append("[/AXCEXT]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_minimumCategory);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_minimumCategory);
|
||||||
LittleEndian.putShort(data, 6 + offset, field_2_maximumCategory);
|
LittleEndian.putShort(data, 6 + offset + pos, field_2_maximumCategory);
|
||||||
LittleEndian.putShort(data, 8 + offset, field_3_majorUnitValue);
|
LittleEndian.putShort(data, 8 + offset + pos, field_3_majorUnitValue);
|
||||||
LittleEndian.putShort(data, 10 + offset, field_4_majorUnit);
|
LittleEndian.putShort(data, 10 + offset + pos, field_4_majorUnit);
|
||||||
LittleEndian.putShort(data, 12 + offset, field_5_minorUnitValue);
|
LittleEndian.putShort(data, 12 + offset + pos, field_5_minorUnitValue);
|
||||||
LittleEndian.putShort(data, 14 + offset, field_6_minorUnit);
|
LittleEndian.putShort(data, 14 + offset + pos, field_6_minorUnit);
|
||||||
LittleEndian.putShort(data, 16 + offset, field_7_baseUnit);
|
LittleEndian.putShort(data, 16 + offset + pos, field_7_baseUnit);
|
||||||
LittleEndian.putShort(data, 18 + offset, field_8_crossingPoint);
|
LittleEndian.putShort(data, 18 + offset + pos, field_8_crossingPoint);
|
||||||
LittleEndian.putShort(data, 20 + offset, field_9_options);
|
LittleEndian.putShort(data, 20 + offset + pos, field_9_options);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -257,11 +254,12 @@ public class AxisOptionsRecord
|
|||||||
rec.field_7_baseUnit = field_7_baseUnit;
|
rec.field_7_baseUnit = field_7_baseUnit;
|
||||||
rec.field_8_crossingPoint = field_8_crossingPoint;
|
rec.field_8_crossingPoint = field_8_crossingPoint;
|
||||||
rec.field_9_options = field_9_options;
|
rec.field_9_options = field_9_options;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the minimum category field for the AxisOptions record.
|
* Get the minimum category field for the AxisOptions record.
|
||||||
*/
|
*/
|
||||||
|
@ -97,6 +97,7 @@ public class AxisParentRecord
|
|||||||
public AxisParentRecord(short id, short size, byte [] data)
|
public AxisParentRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,6 +113,7 @@ public class AxisParentRecord
|
|||||||
public AxisParentRecord(short id, short size, byte [] data, int offset)
|
public AxisParentRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -129,11 +131,13 @@ public class AxisParentRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
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);
|
int pos = 0;
|
||||||
field_3_y = LittleEndian.getInt(data, 0x6 + offset);
|
field_1_axisType = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
field_4_width = LittleEndian.getInt(data, 0xa + offset);
|
field_2_x = LittleEndian.getInt(data, pos + 0x2 + offset);
|
||||||
field_5_height = LittleEndian.getInt(data, 0xe + offset);
|
field_3_y = LittleEndian.getInt(data, pos + 0x6 + offset);
|
||||||
|
field_4_width = LittleEndian.getInt(data, pos + 0xa + offset);
|
||||||
|
field_5_height = LittleEndian.getInt(data, pos + 0xe + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,47 +145,44 @@ public class AxisParentRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[AxisParent]\n");
|
buffer.append("[AXISPARENT]\n");
|
||||||
|
|
||||||
buffer.append(" .axisType = ")
|
buffer.append(" .axisType = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getAxisType ()))
|
||||||
.append(HexDump.toHex((short)getAxisType()))
|
.append(" (").append( getAxisType() ).append(" )");
|
||||||
.append(" (").append(getAxisType()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .x = ")
|
buffer.append(" .x = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getX ()))
|
||||||
.append(HexDump.toHex((int)getX()))
|
.append(" (").append( getX() ).append(" )");
|
||||||
.append(" (").append(getX()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .y = ")
|
buffer.append(" .y = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getY ()))
|
||||||
.append(HexDump.toHex((int)getY()))
|
.append(" (").append( getY() ).append(" )");
|
||||||
.append(" (").append(getY()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .width = ")
|
buffer.append(" .width = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getWidth ()))
|
||||||
.append(HexDump.toHex((int)getWidth()))
|
.append(" (").append( getWidth() ).append(" )");
|
||||||
.append(" (").append(getWidth()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .height = ")
|
buffer.append(" .height = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getHeight ()))
|
||||||
.append(HexDump.toHex((int)getHeight()))
|
.append(" (").append( getHeight() ).append(" )");
|
||||||
.append(" (").append(getHeight()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/AxisParent]\n");
|
buffer.append("[/AXISPARENT]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_axisType);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_axisType);
|
||||||
LittleEndian.putInt(data, 6 + offset, field_2_x);
|
LittleEndian.putInt(data, 6 + offset + pos, field_2_x);
|
||||||
LittleEndian.putInt(data, 10 + offset, field_3_y);
|
LittleEndian.putInt(data, 10 + offset + pos, field_3_y);
|
||||||
LittleEndian.putInt(data, 14 + offset, field_4_width);
|
LittleEndian.putInt(data, 14 + offset + pos, field_4_width);
|
||||||
LittleEndian.putInt(data, 18 + offset, field_5_height);
|
LittleEndian.putInt(data, 18 + offset + pos, field_5_height);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -207,11 +208,12 @@ public class AxisParentRecord
|
|||||||
rec.field_3_y = field_3_y;
|
rec.field_3_y = field_3_y;
|
||||||
rec.field_4_width = field_4_width;
|
rec.field_4_width = field_4_width;
|
||||||
rec.field_5_height = field_5_height;
|
rec.field_5_height = field_5_height;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the axis type field for the AxisParent record.
|
* Get the axis type field for the AxisParent record.
|
||||||
*
|
*
|
||||||
|
@ -98,6 +98,7 @@ public class AxisRecord
|
|||||||
public AxisRecord(short id, short size, byte [] data)
|
public AxisRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -113,6 +114,7 @@ public class AxisRecord
|
|||||||
public AxisRecord(short id, short size, byte [] data, int offset)
|
public AxisRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -130,11 +132,13 @@ public class AxisRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_axisType = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
field_2_reserved1 = LittleEndian.getInt(data, 0x2 + offset);
|
int pos = 0;
|
||||||
field_3_reserved2 = LittleEndian.getInt(data, 0x6 + offset);
|
field_1_axisType = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
field_4_reserved3 = LittleEndian.getInt(data, 0xa + offset);
|
field_2_reserved1 = LittleEndian.getInt(data, pos + 0x2 + offset);
|
||||||
field_5_reserved4 = LittleEndian.getInt(data, 0xe + offset);
|
field_3_reserved2 = LittleEndian.getInt(data, pos + 0x6 + offset);
|
||||||
|
field_4_reserved3 = LittleEndian.getInt(data, pos + 0xa + offset);
|
||||||
|
field_5_reserved4 = LittleEndian.getInt(data, pos + 0xe + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,47 +146,44 @@ public class AxisRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[Axis]\n");
|
buffer.append("[AXIS]\n");
|
||||||
|
|
||||||
buffer.append(" .axisType = ")
|
buffer.append(" .axisType = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getAxisType ()))
|
||||||
.append(HexDump.toHex((short)getAxisType()))
|
.append(" (").append( getAxisType() ).append(" )");
|
||||||
.append(" (").append(getAxisType()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .reserved1 = ")
|
buffer.append(" .reserved1 = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getReserved1 ()))
|
||||||
.append(HexDump.toHex((int)getReserved1()))
|
.append(" (").append( getReserved1() ).append(" )");
|
||||||
.append(" (").append(getReserved1()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .reserved2 = ")
|
buffer.append(" .reserved2 = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getReserved2 ()))
|
||||||
.append(HexDump.toHex((int)getReserved2()))
|
.append(" (").append( getReserved2() ).append(" )");
|
||||||
.append(" (").append(getReserved2()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .reserved3 = ")
|
buffer.append(" .reserved3 = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getReserved3 ()))
|
||||||
.append(HexDump.toHex((int)getReserved3()))
|
.append(" (").append( getReserved3() ).append(" )");
|
||||||
.append(" (").append(getReserved3()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .reserved4 = ")
|
buffer.append(" .reserved4 = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getReserved4 ()))
|
||||||
.append(HexDump.toHex((int)getReserved4()))
|
.append(" (").append( getReserved4() ).append(" )");
|
||||||
.append(" (").append(getReserved4()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/Axis]\n");
|
buffer.append("[/AXIS]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_axisType);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_axisType);
|
||||||
LittleEndian.putInt(data, 6 + offset, field_2_reserved1);
|
LittleEndian.putInt(data, 6 + offset + pos, field_2_reserved1);
|
||||||
LittleEndian.putInt(data, 10 + offset, field_3_reserved2);
|
LittleEndian.putInt(data, 10 + offset + pos, field_3_reserved2);
|
||||||
LittleEndian.putInt(data, 14 + offset, field_4_reserved3);
|
LittleEndian.putInt(data, 14 + offset + pos, field_4_reserved3);
|
||||||
LittleEndian.putInt(data, 18 + offset, field_5_reserved4);
|
LittleEndian.putInt(data, 18 + offset + pos, field_5_reserved4);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -208,11 +209,12 @@ public class AxisRecord
|
|||||||
rec.field_3_reserved2 = field_3_reserved2;
|
rec.field_3_reserved2 = field_3_reserved2;
|
||||||
rec.field_4_reserved3 = field_4_reserved3;
|
rec.field_4_reserved3 = field_4_reserved3;
|
||||||
rec.field_5_reserved4 = field_5_reserved4;
|
rec.field_5_reserved4 = field_5_reserved4;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the axis type field for the Axis record.
|
* Get the axis type field for the Axis record.
|
||||||
*
|
*
|
||||||
|
@ -91,6 +91,7 @@ public class AxisUsedRecord
|
|||||||
public AxisUsedRecord(short id, short size, byte [] data)
|
public AxisUsedRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,6 +107,7 @@ public class AxisUsedRecord
|
|||||||
public AxisUsedRecord(short id, short size, byte [] data, int offset)
|
public AxisUsedRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -123,7 +125,9 @@ public class AxisUsedRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_numAxis = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
|
int pos = 0;
|
||||||
|
field_1_numAxis = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,23 +135,24 @@ public class AxisUsedRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[AxisUsed]\n");
|
buffer.append("[AXISUSED]\n");
|
||||||
|
|
||||||
buffer.append(" .numAxis = ")
|
buffer.append(" .numAxis = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getNumAxis ()))
|
||||||
.append(HexDump.toHex((short)getNumAxis()))
|
.append(" (").append( getNumAxis() ).append(" )");
|
||||||
.append(" (").append(getNumAxis()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/AxisUsed]\n");
|
buffer.append("[/AXISUSED]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_numAxis);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_numAxis);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -169,11 +174,12 @@ public class AxisUsedRecord
|
|||||||
AxisUsedRecord rec = new AxisUsedRecord();
|
AxisUsedRecord rec = new AxisUsedRecord();
|
||||||
|
|
||||||
rec.field_1_numAxis = field_1_numAxis;
|
rec.field_1_numAxis = field_1_numAxis;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the num axis field for the AxisUsed record.
|
* Get the num axis field for the AxisUsed record.
|
||||||
*/
|
*/
|
||||||
|
@ -82,7 +82,6 @@ public class BarRecord
|
|||||||
|
|
||||||
public BarRecord()
|
public BarRecord()
|
||||||
{
|
{
|
||||||
field_2_categorySpace = 50;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,6 +97,7 @@ public class BarRecord
|
|||||||
public BarRecord(short id, short size, byte [] data)
|
public BarRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -113,6 +113,7 @@ public class BarRecord
|
|||||||
public BarRecord(short id, short size, byte [] data, int offset)
|
public BarRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -130,9 +131,11 @@ public class BarRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_barSpace = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
field_2_categorySpace = LittleEndian.getShort(data, 0x2 + offset);
|
int pos = 0;
|
||||||
field_3_formatFlags = LittleEndian.getShort(data, 0x4 + offset);
|
field_1_barSpace = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
field_2_categorySpace = LittleEndian.getShort(data, pos + 0x2 + offset);
|
||||||
|
field_3_formatFlags = LittleEndian.getShort(data, pos + 0x4 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,39 +143,38 @@ public class BarRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[Bar]\n");
|
buffer.append("[BAR]\n");
|
||||||
|
|
||||||
buffer.append(" .barSpace = ")
|
buffer.append(" .barSpace = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getBarSpace ()))
|
||||||
.append(HexDump.toHex((short)getBarSpace()))
|
.append(" (").append( getBarSpace() ).append(" )");
|
||||||
.append(" (").append(getBarSpace()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .categorySpace = ")
|
buffer.append(" .categorySpace = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getCategorySpace ()))
|
||||||
.append(HexDump.toHex((short)getCategorySpace()))
|
.append(" (").append( getCategorySpace() ).append(" )");
|
||||||
.append(" (").append(getCategorySpace()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .formatFlags = ")
|
buffer.append(" .formatFlags = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getFormatFlags ()))
|
||||||
.append(HexDump.toHex((short)getFormatFlags()))
|
.append(" (").append( getFormatFlags() ).append(" )");
|
||||||
.append(" (").append(getFormatFlags()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .horizontal = ").append(isHorizontal()).append('\n');
|
buffer.append(" .horizontal = ").append(isHorizontal()).append('\n');
|
||||||
buffer.append(" .stacked = ").append(isStacked()).append('\n');
|
buffer.append(" .stacked = ").append(isStacked()).append('\n');
|
||||||
buffer.append(" .displayAsPercentage = ").append(isDisplayAsPercentage()).append('\n');
|
buffer.append(" .displayAsPercentage = ").append(isDisplayAsPercentage()).append('\n');
|
||||||
buffer.append(" .shadow = ").append(isShadow()).append('\n');
|
buffer.append(" .shadow = ").append(isShadow()).append('\n');
|
||||||
|
|
||||||
buffer.append("[/Bar]\n");
|
buffer.append("[/BAR]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_barSpace);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_barSpace);
|
||||||
LittleEndian.putShort(data, 6 + offset, field_2_categorySpace);
|
LittleEndian.putShort(data, 6 + offset + pos, field_2_categorySpace);
|
||||||
LittleEndian.putShort(data, 8 + offset, field_3_formatFlags);
|
LittleEndian.putShort(data, 8 + offset + pos, field_3_formatFlags);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -196,11 +198,12 @@ public class BarRecord
|
|||||||
rec.field_1_barSpace = field_1_barSpace;
|
rec.field_1_barSpace = field_1_barSpace;
|
||||||
rec.field_2_categorySpace = field_2_categorySpace;
|
rec.field_2_categorySpace = field_2_categorySpace;
|
||||||
rec.field_3_formatFlags = field_3_formatFlags;
|
rec.field_3_formatFlags = field_3_formatFlags;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the bar space field for the Bar record.
|
* Get the bar space field for the Bar record.
|
||||||
*/
|
*/
|
||||||
|
@ -97,6 +97,7 @@ public class CategorySeriesAxisRecord
|
|||||||
public CategorySeriesAxisRecord(short id, short size, byte [] data)
|
public CategorySeriesAxisRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,6 +113,7 @@ public class CategorySeriesAxisRecord
|
|||||||
public CategorySeriesAxisRecord(short id, short size, byte [] data, int offset)
|
public CategorySeriesAxisRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -129,10 +131,12 @@ public class CategorySeriesAxisRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_crossingPoint = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
field_2_labelFrequency = LittleEndian.getShort(data, 0x2 + offset);
|
int pos = 0;
|
||||||
field_3_tickMarkFrequency = LittleEndian.getShort(data, 0x4 + offset);
|
field_1_crossingPoint = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
field_4_options = LittleEndian.getShort(data, 0x6 + offset);
|
field_2_labelFrequency = LittleEndian.getShort(data, pos + 0x2 + offset);
|
||||||
|
field_3_tickMarkFrequency = LittleEndian.getShort(data, pos + 0x4 + offset);
|
||||||
|
field_4_options = LittleEndian.getShort(data, pos + 0x6 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,44 +144,42 @@ public class CategorySeriesAxisRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[CategorySeriesAxis]\n");
|
buffer.append("[CATSERRANGE]\n");
|
||||||
|
|
||||||
buffer.append(" .crossingPoint = ")
|
buffer.append(" .crossingPoint = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getCrossingPoint ()))
|
||||||
.append(HexDump.toHex((short)getCrossingPoint()))
|
.append(" (").append( getCrossingPoint() ).append(" )");
|
||||||
.append(" (").append(getCrossingPoint()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .labelFrequency = ")
|
buffer.append(" .labelFrequency = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getLabelFrequency ()))
|
||||||
.append(HexDump.toHex((short)getLabelFrequency()))
|
.append(" (").append( getLabelFrequency() ).append(" )");
|
||||||
.append(" (").append(getLabelFrequency()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .tickMarkFrequency = ")
|
buffer.append(" .tickMarkFrequency = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getTickMarkFrequency ()))
|
||||||
.append(HexDump.toHex((short)getTickMarkFrequency()))
|
.append(" (").append( getTickMarkFrequency() ).append(" )");
|
||||||
.append(" (").append(getTickMarkFrequency()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .options = ")
|
buffer.append(" .options = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getOptions ()))
|
||||||
.append(HexDump.toHex((short)getOptions()))
|
.append(" (").append( getOptions() ).append(" )");
|
||||||
.append(" (").append(getOptions()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .valueAxisCrossing = ").append(isValueAxisCrossing()).append('\n');
|
buffer.append(" .valueAxisCrossing = ").append(isValueAxisCrossing()).append('\n');
|
||||||
buffer.append(" .crossesFarRight = ").append(isCrossesFarRight()).append('\n');
|
buffer.append(" .crossesFarRight = ").append(isCrossesFarRight()).append('\n');
|
||||||
buffer.append(" .reversed = ").append(isReversed()).append('\n');
|
buffer.append(" .reversed = ").append(isReversed()).append('\n');
|
||||||
|
|
||||||
buffer.append("[/CategorySeriesAxis]\n");
|
buffer.append("[/CATSERRANGE]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_crossingPoint);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_crossingPoint);
|
||||||
LittleEndian.putShort(data, 6 + offset, field_2_labelFrequency);
|
LittleEndian.putShort(data, 6 + offset + pos, field_2_labelFrequency);
|
||||||
LittleEndian.putShort(data, 8 + offset, field_3_tickMarkFrequency);
|
LittleEndian.putShort(data, 8 + offset + pos, field_3_tickMarkFrequency);
|
||||||
LittleEndian.putShort(data, 10 + offset, field_4_options);
|
LittleEndian.putShort(data, 10 + offset + pos, field_4_options);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -202,11 +204,12 @@ public class CategorySeriesAxisRecord
|
|||||||
rec.field_2_labelFrequency = field_2_labelFrequency;
|
rec.field_2_labelFrequency = field_2_labelFrequency;
|
||||||
rec.field_3_tickMarkFrequency = field_3_tickMarkFrequency;
|
rec.field_3_tickMarkFrequency = field_3_tickMarkFrequency;
|
||||||
rec.field_4_options = field_4_options;
|
rec.field_4_options = field_4_options;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the crossing point field for the CategorySeriesAxis record.
|
* Get the crossing point field for the CategorySeriesAxis record.
|
||||||
*/
|
*/
|
||||||
|
@ -94,6 +94,7 @@ public class ChartRecord
|
|||||||
public ChartRecord(short id, short size, byte [] data)
|
public ChartRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -109,6 +110,7 @@ public class ChartRecord
|
|||||||
public ChartRecord(short id, short size, byte [] data, int offset)
|
public ChartRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -126,10 +128,12 @@ public class ChartRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_x = LittleEndian.getInt(data, 0x0 + offset);
|
|
||||||
field_2_y = LittleEndian.getInt(data, 0x4 + offset);
|
int pos = 0;
|
||||||
field_3_width = LittleEndian.getInt(data, 0x8 + offset);
|
field_1_x = LittleEndian.getInt(data, pos + 0x0 + offset);
|
||||||
field_4_height = LittleEndian.getInt(data, 0xc + offset);
|
field_2_y = LittleEndian.getInt(data, pos + 0x4 + offset);
|
||||||
|
field_3_width = LittleEndian.getInt(data, pos + 0x8 + offset);
|
||||||
|
field_4_height = LittleEndian.getInt(data, pos + 0xc + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,41 +141,39 @@ public class ChartRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[Chart]\n");
|
buffer.append("[CHART]\n");
|
||||||
|
|
||||||
buffer.append(" .x = ")
|
buffer.append(" .x = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getX ()))
|
||||||
.append(HexDump.toHex((int)getX()))
|
.append(" (").append( getX() ).append(" )");
|
||||||
.append(" (").append(getX()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .y = ")
|
buffer.append(" .y = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getY ()))
|
||||||
.append(HexDump.toHex((int)getY()))
|
.append(" (").append( getY() ).append(" )");
|
||||||
.append(" (").append(getY()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .width = ")
|
buffer.append(" .width = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getWidth ()))
|
||||||
.append(HexDump.toHex((int)getWidth()))
|
.append(" (").append( getWidth() ).append(" )");
|
||||||
.append(" (").append(getWidth()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .height = ")
|
buffer.append(" .height = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getHeight ()))
|
||||||
.append(HexDump.toHex((int)getHeight()))
|
.append(" (").append( getHeight() ).append(" )");
|
||||||
.append(" (").append(getHeight()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/Chart]\n");
|
buffer.append("[/CHART]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putInt(data, 4 + offset, field_1_x);
|
LittleEndian.putInt(data, 4 + offset + pos, field_1_x);
|
||||||
LittleEndian.putInt(data, 8 + offset, field_2_y);
|
LittleEndian.putInt(data, 8 + offset + pos, field_2_y);
|
||||||
LittleEndian.putInt(data, 12 + offset, field_3_width);
|
LittleEndian.putInt(data, 12 + offset + pos, field_3_width);
|
||||||
LittleEndian.putInt(data, 16 + offset, field_4_height);
|
LittleEndian.putInt(data, 16 + offset + pos, field_4_height);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -196,11 +198,12 @@ public class ChartRecord
|
|||||||
rec.field_2_y = field_2_y;
|
rec.field_2_y = field_2_y;
|
||||||
rec.field_3_width = field_3_width;
|
rec.field_3_width = field_3_width;
|
||||||
rec.field_4_height = field_4_height;
|
rec.field_4_height = field_4_height;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the x field for the Chart record.
|
* Get the x field for the Chart record.
|
||||||
*/
|
*/
|
||||||
|
38
src/java/org/apache/poi/hssf/record/CustomField.java
Normal file
38
src/java/org/apache/poi/hssf/record/CustomField.java
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
package org.apache.poi.hssf.record;
|
||||||
|
|
||||||
|
public interface CustomField
|
||||||
|
extends Cloneable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @return The size of this field in bytes. This operation is not valid
|
||||||
|
* until after the call to <code>fillField()</code>
|
||||||
|
*/
|
||||||
|
int getSize();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populates this fields data from the byte array passed in.
|
||||||
|
* @param data raw data
|
||||||
|
* @param size size of data
|
||||||
|
* @param offset of the record's data (provided a big array of the file)
|
||||||
|
* @return the number of bytes read.
|
||||||
|
*/
|
||||||
|
int fillField(byte [] data, short size, int offset);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Appends the string representation of this field to the supplied
|
||||||
|
* StringBuffer.
|
||||||
|
*
|
||||||
|
* @param str The string buffer to append to.
|
||||||
|
*/
|
||||||
|
void toString(StringBuffer str);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts this field to it's byte array form.
|
||||||
|
* @param offset The offset into the byte array to start writing to.
|
||||||
|
* @param data The data array to write to.
|
||||||
|
* @return The number of bytes written.
|
||||||
|
*/
|
||||||
|
int serializeField(int offset, byte[] data);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -95,6 +95,7 @@ public class DatRecord
|
|||||||
public DatRecord(short id, short size, byte [] data)
|
public DatRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -110,6 +111,7 @@ public class DatRecord
|
|||||||
public DatRecord(short id, short size, byte [] data, int offset)
|
public DatRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -127,7 +129,9 @@ public class DatRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_options = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
|
int pos = 0;
|
||||||
|
field_1_options = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,27 +139,28 @@ public class DatRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[Dat]\n");
|
buffer.append("[DAT]\n");
|
||||||
|
|
||||||
buffer.append(" .options = ")
|
buffer.append(" .options = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getOptions ()))
|
||||||
.append(HexDump.toHex((short)getOptions()))
|
.append(" (").append( getOptions() ).append(" )");
|
||||||
.append(" (").append(getOptions()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .horizontalBorder = ").append(isHorizontalBorder()).append('\n');
|
buffer.append(" .horizontalBorder = ").append(isHorizontalBorder()).append('\n');
|
||||||
buffer.append(" .verticalBorder = ").append(isVerticalBorder()).append('\n');
|
buffer.append(" .verticalBorder = ").append(isVerticalBorder()).append('\n');
|
||||||
buffer.append(" .border = ").append(isBorder()).append('\n');
|
buffer.append(" .border = ").append(isBorder()).append('\n');
|
||||||
buffer.append(" .showSeriesKey = ").append(isShowSeriesKey()).append('\n');
|
buffer.append(" .showSeriesKey = ").append(isShowSeriesKey()).append('\n');
|
||||||
|
|
||||||
buffer.append("[/Dat]\n");
|
buffer.append("[/DAT]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_options);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_options);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -177,11 +182,12 @@ public class DatRecord
|
|||||||
DatRecord rec = new DatRecord();
|
DatRecord rec = new DatRecord();
|
||||||
|
|
||||||
rec.field_1_options = field_1_options;
|
rec.field_1_options = field_1_options;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the options field for the Dat record.
|
* Get the options field for the Dat record.
|
||||||
*/
|
*/
|
||||||
|
@ -95,6 +95,7 @@ public class DataFormatRecord
|
|||||||
public DataFormatRecord(short id, short size, byte [] data)
|
public DataFormatRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -110,6 +111,7 @@ public class DataFormatRecord
|
|||||||
public DataFormatRecord(short id, short size, byte [] data, int offset)
|
public DataFormatRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -127,10 +129,12 @@ public class DataFormatRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_pointNumber = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
field_2_seriesIndex = LittleEndian.getShort(data, 0x2 + offset);
|
int pos = 0;
|
||||||
field_3_seriesNumber = LittleEndian.getShort(data, 0x4 + offset);
|
field_1_pointNumber = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
field_4_formatFlags = LittleEndian.getShort(data, 0x6 + offset);
|
field_2_seriesIndex = LittleEndian.getShort(data, pos + 0x2 + offset);
|
||||||
|
field_3_seriesNumber = LittleEndian.getShort(data, pos + 0x4 + offset);
|
||||||
|
field_4_formatFlags = LittleEndian.getShort(data, pos + 0x6 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,42 +142,40 @@ public class DataFormatRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[DataFormat]\n");
|
buffer.append("[DATAFORMAT]\n");
|
||||||
|
|
||||||
buffer.append(" .pointNumber = ")
|
buffer.append(" .pointNumber = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getPointNumber ()))
|
||||||
.append(HexDump.toHex((short)getPointNumber()))
|
.append(" (").append( getPointNumber() ).append(" )");
|
||||||
.append(" (").append(getPointNumber()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .seriesIndex = ")
|
buffer.append(" .seriesIndex = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getSeriesIndex ()))
|
||||||
.append(HexDump.toHex((short)getSeriesIndex()))
|
.append(" (").append( getSeriesIndex() ).append(" )");
|
||||||
.append(" (").append(getSeriesIndex()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .seriesNumber = ")
|
buffer.append(" .seriesNumber = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getSeriesNumber ()))
|
||||||
.append(HexDump.toHex((short)getSeriesNumber()))
|
.append(" (").append( getSeriesNumber() ).append(" )");
|
||||||
.append(" (").append(getSeriesNumber()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .formatFlags = ")
|
buffer.append(" .formatFlags = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getFormatFlags ()))
|
||||||
.append(HexDump.toHex((short)getFormatFlags()))
|
.append(" (").append( getFormatFlags() ).append(" )");
|
||||||
.append(" (").append(getFormatFlags()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .useExcel4Colors = ").append(isUseExcel4Colors()).append('\n');
|
buffer.append(" .useExcel4Colors = ").append(isUseExcel4Colors()).append('\n');
|
||||||
|
|
||||||
buffer.append("[/DataFormat]\n");
|
buffer.append("[/DATAFORMAT]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_pointNumber);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_pointNumber);
|
||||||
LittleEndian.putShort(data, 6 + offset, field_2_seriesIndex);
|
LittleEndian.putShort(data, 6 + offset + pos, field_2_seriesIndex);
|
||||||
LittleEndian.putShort(data, 8 + offset, field_3_seriesNumber);
|
LittleEndian.putShort(data, 8 + offset + pos, field_3_seriesNumber);
|
||||||
LittleEndian.putShort(data, 10 + offset, field_4_formatFlags);
|
LittleEndian.putShort(data, 10 + offset + pos, field_4_formatFlags);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -198,11 +200,12 @@ public class DataFormatRecord
|
|||||||
rec.field_2_seriesIndex = field_2_seriesIndex;
|
rec.field_2_seriesIndex = field_2_seriesIndex;
|
||||||
rec.field_3_seriesNumber = field_3_seriesNumber;
|
rec.field_3_seriesNumber = field_3_seriesNumber;
|
||||||
rec.field_4_formatFlags = field_4_formatFlags;
|
rec.field_4_formatFlags = field_4_formatFlags;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the point number field for the DataFormat record.
|
* Get the point number field for the DataFormat record.
|
||||||
*/
|
*/
|
||||||
|
@ -94,6 +94,7 @@ public class DefaultDataLabelTextPropertiesRecord
|
|||||||
public DefaultDataLabelTextPropertiesRecord(short id, short size, byte [] data)
|
public DefaultDataLabelTextPropertiesRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -109,6 +110,7 @@ public class DefaultDataLabelTextPropertiesRecord
|
|||||||
public DefaultDataLabelTextPropertiesRecord(short id, short size, byte [] data, int offset)
|
public DefaultDataLabelTextPropertiesRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -126,7 +128,9 @@ public class DefaultDataLabelTextPropertiesRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_categoryDataType = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
|
int pos = 0;
|
||||||
|
field_1_categoryDataType = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,23 +138,24 @@ public class DefaultDataLabelTextPropertiesRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[DefaultDataLabelTextProperties]\n");
|
buffer.append("[DEFAULTTEXT]\n");
|
||||||
|
|
||||||
buffer.append(" .categoryDataType = ")
|
buffer.append(" .categoryDataType = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getCategoryDataType ()))
|
||||||
.append(HexDump.toHex((short)getCategoryDataType()))
|
.append(" (").append( getCategoryDataType() ).append(" )");
|
||||||
.append(" (").append(getCategoryDataType()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/DefaultDataLabelTextProperties]\n");
|
buffer.append("[/DEFAULTTEXT]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_categoryDataType);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_categoryDataType);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -172,11 +177,12 @@ public class DefaultDataLabelTextPropertiesRecord
|
|||||||
DefaultDataLabelTextPropertiesRecord rec = new DefaultDataLabelTextPropertiesRecord();
|
DefaultDataLabelTextPropertiesRecord rec = new DefaultDataLabelTextPropertiesRecord();
|
||||||
|
|
||||||
rec.field_1_categoryDataType = field_1_categoryDataType;
|
rec.field_1_categoryDataType = field_1_categoryDataType;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the category data type field for the DefaultDataLabelTextProperties record.
|
* Get the category data type field for the DefaultDataLabelTextProperties record.
|
||||||
*
|
*
|
||||||
|
@ -95,6 +95,7 @@ public class FontBasisRecord
|
|||||||
public FontBasisRecord(short id, short size, byte [] data)
|
public FontBasisRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -110,6 +111,7 @@ public class FontBasisRecord
|
|||||||
public FontBasisRecord(short id, short size, byte [] data, int offset)
|
public FontBasisRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -127,11 +129,13 @@ public class FontBasisRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_xBasis = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
field_2_yBasis = LittleEndian.getShort(data, 0x2 + offset);
|
int pos = 0;
|
||||||
field_3_heightBasis = LittleEndian.getShort(data, 0x4 + offset);
|
field_1_xBasis = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
field_4_scale = LittleEndian.getShort(data, 0x6 + offset);
|
field_2_yBasis = LittleEndian.getShort(data, pos + 0x2 + offset);
|
||||||
field_5_indexToFontTable = LittleEndian.getShort(data, 0x8 + offset);
|
field_3_heightBasis = LittleEndian.getShort(data, pos + 0x4 + offset);
|
||||||
|
field_4_scale = LittleEndian.getShort(data, pos + 0x6 + offset);
|
||||||
|
field_5_indexToFontTable = LittleEndian.getShort(data, pos + 0x8 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,47 +143,44 @@ public class FontBasisRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[FontBasis]\n");
|
buffer.append("[FBI]\n");
|
||||||
|
|
||||||
buffer.append(" .xBasis = ")
|
buffer.append(" .xBasis = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getXBasis ()))
|
||||||
.append(HexDump.toHex((short)getXBasis()))
|
.append(" (").append( getXBasis() ).append(" )");
|
||||||
.append(" (").append(getXBasis()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .yBasis = ")
|
buffer.append(" .yBasis = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getYBasis ()))
|
||||||
.append(HexDump.toHex((short)getYBasis()))
|
.append(" (").append( getYBasis() ).append(" )");
|
||||||
.append(" (").append(getYBasis()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .heightBasis = ")
|
buffer.append(" .heightBasis = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getHeightBasis ()))
|
||||||
.append(HexDump.toHex((short)getHeightBasis()))
|
.append(" (").append( getHeightBasis() ).append(" )");
|
||||||
.append(" (").append(getHeightBasis()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .scale = ")
|
buffer.append(" .scale = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getScale ()))
|
||||||
.append(HexDump.toHex((short)getScale()))
|
.append(" (").append( getScale() ).append(" )");
|
||||||
.append(" (").append(getScale()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .indexToFontTable = ")
|
buffer.append(" .indexToFontTable = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getIndexToFontTable ()))
|
||||||
.append(HexDump.toHex((short)getIndexToFontTable()))
|
.append(" (").append( getIndexToFontTable() ).append(" )");
|
||||||
.append(" (").append(getIndexToFontTable()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/FontBasis]\n");
|
buffer.append("[/FBI]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_xBasis);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_xBasis);
|
||||||
LittleEndian.putShort(data, 6 + offset, field_2_yBasis);
|
LittleEndian.putShort(data, 6 + offset + pos, field_2_yBasis);
|
||||||
LittleEndian.putShort(data, 8 + offset, field_3_heightBasis);
|
LittleEndian.putShort(data, 8 + offset + pos, field_3_heightBasis);
|
||||||
LittleEndian.putShort(data, 10 + offset, field_4_scale);
|
LittleEndian.putShort(data, 10 + offset + pos, field_4_scale);
|
||||||
LittleEndian.putShort(data, 12 + offset, field_5_indexToFontTable);
|
LittleEndian.putShort(data, 12 + offset + pos, field_5_indexToFontTable);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -205,11 +206,12 @@ public class FontBasisRecord
|
|||||||
rec.field_3_heightBasis = field_3_heightBasis;
|
rec.field_3_heightBasis = field_3_heightBasis;
|
||||||
rec.field_4_scale = field_4_scale;
|
rec.field_4_scale = field_4_scale;
|
||||||
rec.field_5_indexToFontTable = field_5_indexToFontTable;
|
rec.field_5_indexToFontTable = field_5_indexToFontTable;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the x Basis field for the FontBasis record.
|
* Get the x Basis field for the FontBasis record.
|
||||||
*/
|
*/
|
||||||
|
@ -91,6 +91,7 @@ public class FontIndexRecord
|
|||||||
public FontIndexRecord(short id, short size, byte [] data)
|
public FontIndexRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,6 +107,7 @@ public class FontIndexRecord
|
|||||||
public FontIndexRecord(short id, short size, byte [] data, int offset)
|
public FontIndexRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -123,7 +125,9 @@ public class FontIndexRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_fontIndex = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
|
int pos = 0;
|
||||||
|
field_1_fontIndex = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,23 +135,24 @@ public class FontIndexRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[FontIndex]\n");
|
buffer.append("[FONTX]\n");
|
||||||
|
|
||||||
buffer.append(" .fontIndex = ")
|
buffer.append(" .fontIndex = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getFontIndex ()))
|
||||||
.append(HexDump.toHex((short)getFontIndex()))
|
.append(" (").append( getFontIndex() ).append(" )");
|
||||||
.append(" (").append(getFontIndex()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/FontIndex]\n");
|
buffer.append("[/FONTX]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_fontIndex);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_fontIndex);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -169,11 +174,12 @@ public class FontIndexRecord
|
|||||||
FontIndexRecord rec = new FontIndexRecord();
|
FontIndexRecord rec = new FontIndexRecord();
|
||||||
|
|
||||||
rec.field_1_fontIndex = field_1_fontIndex;
|
rec.field_1_fontIndex = field_1_fontIndex;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the font index field for the FontIndex record.
|
* Get the font index field for the FontIndex record.
|
||||||
*/
|
*/
|
||||||
|
@ -96,6 +96,7 @@ public class FrameRecord
|
|||||||
public FrameRecord(short id, short size, byte [] data)
|
public FrameRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -111,6 +112,7 @@ public class FrameRecord
|
|||||||
public FrameRecord(short id, short size, byte [] data, int offset)
|
public FrameRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -128,8 +130,10 @@ public class FrameRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_borderType = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
field_2_options = LittleEndian.getShort(data, 0x2 + offset);
|
int pos = 0;
|
||||||
|
field_1_borderType = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
field_2_options = LittleEndian.getShort(data, pos + 0x2 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,31 +141,31 @@ public class FrameRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[Frame]\n");
|
buffer.append("[FRAME]\n");
|
||||||
|
|
||||||
buffer.append(" .borderType = ")
|
buffer.append(" .borderType = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getBorderType ()))
|
||||||
.append(HexDump.toHex((short)getBorderType()))
|
.append(" (").append( getBorderType() ).append(" )");
|
||||||
.append(" (").append(getBorderType()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .options = ")
|
buffer.append(" .options = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getOptions ()))
|
||||||
.append(HexDump.toHex((short)getOptions()))
|
.append(" (").append( getOptions() ).append(" )");
|
||||||
.append(" (").append(getOptions()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .autoSize = ").append(isAutoSize()).append('\n');
|
buffer.append(" .autoSize = ").append(isAutoSize()).append('\n');
|
||||||
buffer.append(" .autoPosition = ").append(isAutoPosition()).append('\n');
|
buffer.append(" .autoPosition = ").append(isAutoPosition()).append('\n');
|
||||||
|
|
||||||
buffer.append("[/Frame]\n");
|
buffer.append("[/FRAME]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_borderType);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_borderType);
|
||||||
LittleEndian.putShort(data, 6 + offset, field_2_options);
|
LittleEndian.putShort(data, 6 + offset + pos, field_2_options);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -184,11 +188,12 @@ public class FrameRecord
|
|||||||
|
|
||||||
rec.field_1_borderType = field_1_borderType;
|
rec.field_1_borderType = field_1_borderType;
|
||||||
rec.field_2_options = field_2_options;
|
rec.field_2_options = field_2_options;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the border type field for the Frame record.
|
* Get the border type field for the Frame record.
|
||||||
*
|
*
|
||||||
|
@ -112,6 +112,7 @@ public class LegendRecord
|
|||||||
public LegendRecord(short id, short size, byte [] data)
|
public LegendRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -127,6 +128,7 @@ public class LegendRecord
|
|||||||
public LegendRecord(short id, short size, byte [] data, int offset)
|
public LegendRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -144,13 +146,15 @@ public class LegendRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_xAxisUpperLeft = LittleEndian.getInt(data, 0x0 + offset);
|
|
||||||
field_2_yAxisUpperLeft = LittleEndian.getInt(data, 0x4 + offset);
|
int pos = 0;
|
||||||
field_3_xSize = LittleEndian.getInt(data, 0x8 + offset);
|
field_1_xAxisUpperLeft = LittleEndian.getInt(data, pos + 0x0 + offset);
|
||||||
field_4_ySize = LittleEndian.getInt(data, 0xc + offset);
|
field_2_yAxisUpperLeft = LittleEndian.getInt(data, pos + 0x4 + offset);
|
||||||
field_5_type = data[ 0x10 + offset ];
|
field_3_xSize = LittleEndian.getInt(data, pos + 0x8 + offset);
|
||||||
field_6_spacing = data[ 0x11 + offset ];
|
field_4_ySize = LittleEndian.getInt(data, pos + 0xc + offset);
|
||||||
field_7_options = LittleEndian.getShort(data, 0x12 + offset);
|
field_5_type = data[ pos + 0x10 + offset ];
|
||||||
|
field_6_spacing = data[ pos + 0x11 + offset ];
|
||||||
|
field_7_options = LittleEndian.getShort(data, pos + 0x12 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,42 +162,35 @@ public class LegendRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[Legend]\n");
|
buffer.append("[LEGEND]\n");
|
||||||
|
|
||||||
buffer.append(" .xAxisUpperLeft = ")
|
buffer.append(" .xAxisUpperLeft = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getXAxisUpperLeft ()))
|
||||||
.append(HexDump.toHex((int)getXAxisUpperLeft()))
|
.append(" (").append( getXAxisUpperLeft() ).append(" )");
|
||||||
.append(" (").append(getXAxisUpperLeft()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .yAxisUpperLeft = ")
|
buffer.append(" .yAxisUpperLeft = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getYAxisUpperLeft ()))
|
||||||
.append(HexDump.toHex((int)getYAxisUpperLeft()))
|
.append(" (").append( getYAxisUpperLeft() ).append(" )");
|
||||||
.append(" (").append(getYAxisUpperLeft()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .xSize = ")
|
buffer.append(" .xSize = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getXSize ()))
|
||||||
.append(HexDump.toHex((int)getXSize()))
|
.append(" (").append( getXSize() ).append(" )");
|
||||||
.append(" (").append(getXSize()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .ySize = ")
|
buffer.append(" .ySize = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getYSize ()))
|
||||||
.append(HexDump.toHex((int)getYSize()))
|
.append(" (").append( getYSize() ).append(" )");
|
||||||
.append(" (").append(getYSize()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .type = ")
|
buffer.append(" .type = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getType ()))
|
||||||
.append(HexDump.toHex((byte)getType()))
|
.append(" (").append( getType() ).append(" )");
|
||||||
.append(" (").append(getType()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .spacing = ")
|
buffer.append(" .spacing = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getSpacing ()))
|
||||||
.append(HexDump.toHex((byte)getSpacing()))
|
.append(" (").append( getSpacing() ).append(" )");
|
||||||
.append(" (").append(getSpacing()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .options = ")
|
buffer.append(" .options = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getOptions ()))
|
||||||
.append(HexDump.toHex((short)getOptions()))
|
.append(" (").append( getOptions() ).append(" )");
|
||||||
.append(" (").append(getOptions()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .autoPosition = ").append(isAutoPosition()).append('\n');
|
buffer.append(" .autoPosition = ").append(isAutoPosition()).append('\n');
|
||||||
buffer.append(" .autoSeries = ").append(isAutoSeries()).append('\n');
|
buffer.append(" .autoSeries = ").append(isAutoSeries()).append('\n');
|
||||||
buffer.append(" .autoXPositioning = ").append(isAutoXPositioning()).append('\n');
|
buffer.append(" .autoXPositioning = ").append(isAutoXPositioning()).append('\n');
|
||||||
@ -201,22 +198,24 @@ public class LegendRecord
|
|||||||
buffer.append(" .vertical = ").append(isVertical()).append('\n');
|
buffer.append(" .vertical = ").append(isVertical()).append('\n');
|
||||||
buffer.append(" .dataTable = ").append(isDataTable()).append('\n');
|
buffer.append(" .dataTable = ").append(isDataTable()).append('\n');
|
||||||
|
|
||||||
buffer.append("[/Legend]\n");
|
buffer.append("[/LEGEND]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putInt(data, 4 + offset, field_1_xAxisUpperLeft);
|
LittleEndian.putInt(data, 4 + offset + pos, field_1_xAxisUpperLeft);
|
||||||
LittleEndian.putInt(data, 8 + offset, field_2_yAxisUpperLeft);
|
LittleEndian.putInt(data, 8 + offset + pos, field_2_yAxisUpperLeft);
|
||||||
LittleEndian.putInt(data, 12 + offset, field_3_xSize);
|
LittleEndian.putInt(data, 12 + offset + pos, field_3_xSize);
|
||||||
LittleEndian.putInt(data, 16 + offset, field_4_ySize);
|
LittleEndian.putInt(data, 16 + offset + pos, field_4_ySize);
|
||||||
data[ 20 + offset ] = field_5_type;
|
data[ 20 + offset + pos ] = field_5_type;
|
||||||
data[ 21 + offset ] = field_6_spacing;
|
data[ 21 + offset + pos ] = field_6_spacing;
|
||||||
LittleEndian.putShort(data, 22 + offset, field_7_options);
|
LittleEndian.putShort(data, 22 + offset + pos, field_7_options);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -244,11 +243,12 @@ public class LegendRecord
|
|||||||
rec.field_5_type = field_5_type;
|
rec.field_5_type = field_5_type;
|
||||||
rec.field_6_spacing = field_6_spacing;
|
rec.field_6_spacing = field_6_spacing;
|
||||||
rec.field_7_options = field_7_options;
|
rec.field_7_options = field_7_options;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the x axis upper left field for the Legend record.
|
* Get the x axis upper left field for the Legend record.
|
||||||
*/
|
*/
|
||||||
|
@ -111,6 +111,7 @@ public class LineFormatRecord
|
|||||||
public LineFormatRecord(short id, short size, byte [] data)
|
public LineFormatRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -126,6 +127,7 @@ public class LineFormatRecord
|
|||||||
public LineFormatRecord(short id, short size, byte [] data, int offset)
|
public LineFormatRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -143,11 +145,13 @@ public class LineFormatRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_lineColor = LittleEndian.getInt(data, 0x0 + offset);
|
|
||||||
field_2_linePattern = LittleEndian.getShort(data, 0x4 + offset);
|
int pos = 0;
|
||||||
field_3_weight = LittleEndian.getShort(data, 0x6 + offset);
|
field_1_lineColor = LittleEndian.getInt(data, pos + 0x0 + offset);
|
||||||
field_4_format = LittleEndian.getShort(data, 0x8 + offset);
|
field_2_linePattern = LittleEndian.getShort(data, pos + 0x4 + offset);
|
||||||
field_5_colourPaletteIndex = LittleEndian.getShort(data, 0xa + offset);
|
field_3_weight = LittleEndian.getShort(data, pos + 0x6 + offset);
|
||||||
|
field_4_format = LittleEndian.getShort(data, pos + 0x8 + offset);
|
||||||
|
field_5_colourPaletteIndex = LittleEndian.getShort(data, pos + 0xa + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,50 +159,47 @@ public class LineFormatRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[LineFormat]\n");
|
buffer.append("[LINEFORMAT]\n");
|
||||||
|
|
||||||
buffer.append(" .lineColor = ")
|
buffer.append(" .lineColor = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getLineColor ()))
|
||||||
.append(HexDump.toHex((int)getLineColor()))
|
.append(" (").append( getLineColor() ).append(" )");
|
||||||
.append(" (").append(getLineColor()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .linePattern = ")
|
buffer.append(" .linePattern = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getLinePattern ()))
|
||||||
.append(HexDump.toHex((short)getLinePattern()))
|
.append(" (").append( getLinePattern() ).append(" )");
|
||||||
.append(" (").append(getLinePattern()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .weight = ")
|
buffer.append(" .weight = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getWeight ()))
|
||||||
.append(HexDump.toHex((short)getWeight()))
|
.append(" (").append( getWeight() ).append(" )");
|
||||||
.append(" (").append(getWeight()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .format = ")
|
buffer.append(" .format = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getFormat ()))
|
||||||
.append(HexDump.toHex((short)getFormat()))
|
.append(" (").append( getFormat() ).append(" )");
|
||||||
.append(" (").append(getFormat()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .auto = ").append(isAuto()).append('\n');
|
buffer.append(" .auto = ").append(isAuto()).append('\n');
|
||||||
buffer.append(" .drawTicks = ").append(isDrawTicks()).append('\n');
|
buffer.append(" .drawTicks = ").append(isDrawTicks()).append('\n');
|
||||||
buffer.append(" .unknown = ").append(isUnknown()).append('\n');
|
buffer.append(" .unknown = ").append(isUnknown()).append('\n');
|
||||||
|
|
||||||
buffer.append(" .colourPaletteIndex = ")
|
buffer.append(" .colourPaletteIndex = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getColourPaletteIndex ()))
|
||||||
.append(HexDump.toHex((short)getColourPaletteIndex()))
|
.append(" (").append( getColourPaletteIndex() ).append(" )");
|
||||||
.append(" (").append(getColourPaletteIndex()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/LineFormat]\n");
|
buffer.append("[/LINEFORMAT]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putInt(data, 4 + offset, field_1_lineColor);
|
LittleEndian.putInt(data, 4 + offset + pos, field_1_lineColor);
|
||||||
LittleEndian.putShort(data, 8 + offset, field_2_linePattern);
|
LittleEndian.putShort(data, 8 + offset + pos, field_2_linePattern);
|
||||||
LittleEndian.putShort(data, 10 + offset, field_3_weight);
|
LittleEndian.putShort(data, 10 + offset + pos, field_3_weight);
|
||||||
LittleEndian.putShort(data, 12 + offset, field_4_format);
|
LittleEndian.putShort(data, 12 + offset + pos, field_4_format);
|
||||||
LittleEndian.putShort(data, 14 + offset, field_5_colourPaletteIndex);
|
LittleEndian.putShort(data, 14 + offset + pos, field_5_colourPaletteIndex);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -224,11 +225,12 @@ public class LineFormatRecord
|
|||||||
rec.field_3_weight = field_3_weight;
|
rec.field_3_weight = field_3_weight;
|
||||||
rec.field_4_format = field_4_format;
|
rec.field_4_format = field_4_format;
|
||||||
rec.field_5_colourPaletteIndex = field_5_colourPaletteIndex;
|
rec.field_5_colourPaletteIndex = field_5_colourPaletteIndex;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the line color field for the LineFormat record.
|
* Get the line color field for the LineFormat record.
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,91 @@
|
|||||||
|
/* ====================================================================
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Not implemented yet. May commit it anyway just so people can see
|
||||||
|
* where I'm heading.
|
||||||
|
*
|
||||||
|
* @author Glen Stampoultzis (glens at apache.org)
|
||||||
|
*/
|
||||||
|
public class LinkedDataFormulaField
|
||||||
|
implements CustomField
|
||||||
|
{
|
||||||
|
public int getSize()
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int fillField( byte[] data, short size, int offset )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void toString( StringBuffer str )
|
||||||
|
{
|
||||||
|
str.append("todo");
|
||||||
|
}
|
||||||
|
|
||||||
|
public int serializeField( int offset, byte[] data )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object clone()
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -84,7 +84,7 @@ public class LinkedDataRecord
|
|||||||
private short field_3_options;
|
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_4_indexNumberFmtRecord;
|
||||||
private short field_5_formulaOfLink;
|
private LinkedDataFormulaField field_5_formulaOfLink = new org.apache.poi.hssf.record.LinkedDataFormulaField();
|
||||||
|
|
||||||
|
|
||||||
public LinkedDataRecord()
|
public LinkedDataRecord()
|
||||||
@ -104,6 +104,7 @@ public class LinkedDataRecord
|
|||||||
public LinkedDataRecord(short id, short size, byte [] data)
|
public LinkedDataRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -119,6 +120,7 @@ public class LinkedDataRecord
|
|||||||
public LinkedDataRecord(short id, short size, byte [] data, int offset)
|
public LinkedDataRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -136,11 +138,14 @@ public class LinkedDataRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_linkType = data[ 0x0 + offset ];
|
|
||||||
field_2_referenceType = data[ 0x1 + offset ];
|
int pos = 0;
|
||||||
field_3_options = LittleEndian.getShort(data, 0x2 + offset);
|
field_1_linkType = data[ pos + 0x0 + offset ];
|
||||||
field_4_indexNumberFmtRecord = LittleEndian.getShort(data, 0x4 + offset);
|
field_2_referenceType = data[ pos + 0x1 + offset ];
|
||||||
field_5_formulaOfLink = LittleEndian.getShort(data, 0x6 + offset);
|
field_3_options = LittleEndian.getShort(data, pos + 0x2 + offset);
|
||||||
|
field_4_indexNumberFmtRecord = LittleEndian.getShort(data, pos + 0x4 + offset);
|
||||||
|
field_5_formulaOfLink = new org.apache.poi.hssf.record.LinkedDataFormulaField();
|
||||||
|
pos += field_5_formulaOfLink.fillField(data,size,pos + 6);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,48 +153,44 @@ public class LinkedDataRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[LinkedData]\n");
|
buffer.append("[AI]\n");
|
||||||
|
|
||||||
buffer.append(" .linkType = ")
|
buffer.append(" .linkType = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getLinkType ()))
|
||||||
.append(HexDump.toHex((byte)getLinkType()))
|
.append(" (").append( getLinkType() ).append(" )");
|
||||||
.append(" (").append(getLinkType()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .referenceType = ")
|
buffer.append(" .referenceType = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getReferenceType ()))
|
||||||
.append(HexDump.toHex((byte)getReferenceType()))
|
.append(" (").append( getReferenceType() ).append(" )");
|
||||||
.append(" (").append(getReferenceType()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .options = ")
|
buffer.append(" .options = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getOptions ()))
|
||||||
.append(HexDump.toHex((short)getOptions()))
|
.append(" (").append( getOptions() ).append(" )");
|
||||||
.append(" (").append(getOptions()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .customNumberFormat = ").append(isCustomNumberFormat()).append('\n');
|
buffer.append(" .customNumberFormat = ").append(isCustomNumberFormat()).append('\n');
|
||||||
|
|
||||||
buffer.append(" .indexNumberFmtRecord = ")
|
buffer.append(" .indexNumberFmtRecord = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getIndexNumberFmtRecord ()))
|
||||||
.append(HexDump.toHex((short)getIndexNumberFmtRecord()))
|
.append(" (").append( getIndexNumberFmtRecord() ).append(" )");
|
||||||
.append(" (").append(getIndexNumberFmtRecord()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .formulaOfLink = ")
|
buffer.append(" .formulaOfLink = ")
|
||||||
.append("0x")
|
.append(" (").append( getFormulaOfLink() ).append(" )");
|
||||||
.append(HexDump.toHex((short)getFormulaOfLink()))
|
buffer.append(System.getProperty("line.separator"));
|
||||||
.append(" (").append(getFormulaOfLink()).append(" )\n");
|
|
||||||
|
|
||||||
buffer.append("[/LinkedData]\n");
|
buffer.append("[/AI]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
data[ 4 + offset ] = field_1_linkType;
|
data[ 4 + offset + pos ] = field_1_linkType;
|
||||||
data[ 5 + offset ] = field_2_referenceType;
|
data[ 5 + offset + pos ] = field_2_referenceType;
|
||||||
LittleEndian.putShort(data, 6 + offset, field_3_options);
|
LittleEndian.putShort(data, 6 + offset + pos, field_3_options);
|
||||||
LittleEndian.putShort(data, 8 + offset, field_4_indexNumberFmtRecord);
|
LittleEndian.putShort(data, 8 + offset + pos, field_4_indexNumberFmtRecord);
|
||||||
LittleEndian.putShort(data, 10 + offset, field_5_formulaOfLink);
|
pos += field_5_formulaOfLink.serializeField( pos + offset, data );
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -199,7 +200,7 @@ public class LinkedDataRecord
|
|||||||
*/
|
*/
|
||||||
public int getRecordSize()
|
public int getRecordSize()
|
||||||
{
|
{
|
||||||
return 4 + 1 + 1 + 2 + 2 + 2;
|
return 4 + 1 + 1 + 2 + 2 + field_5_formulaOfLink.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public short getSid()
|
public short getSid()
|
||||||
@ -214,12 +215,13 @@ public class LinkedDataRecord
|
|||||||
rec.field_2_referenceType = field_2_referenceType;
|
rec.field_2_referenceType = field_2_referenceType;
|
||||||
rec.field_3_options = field_3_options;
|
rec.field_3_options = field_3_options;
|
||||||
rec.field_4_indexNumberFmtRecord = field_4_indexNumberFmtRecord;
|
rec.field_4_indexNumberFmtRecord = field_4_indexNumberFmtRecord;
|
||||||
rec.field_5_formulaOfLink = field_5_formulaOfLink;
|
rec.field_5_formulaOfLink = ((org.apache.poi.hssf.record.LinkedDataFormulaField)field_5_formulaOfLink.clone());;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the link type field for the LinkedData record.
|
* Get the link type field for the LinkedData record.
|
||||||
*
|
*
|
||||||
@ -313,7 +315,7 @@ public class LinkedDataRecord
|
|||||||
/**
|
/**
|
||||||
* Get the formula of link field for the LinkedData record.
|
* Get the formula of link field for the LinkedData record.
|
||||||
*/
|
*/
|
||||||
public short getFormulaOfLink()
|
public LinkedDataFormulaField getFormulaOfLink()
|
||||||
{
|
{
|
||||||
return field_5_formulaOfLink;
|
return field_5_formulaOfLink;
|
||||||
}
|
}
|
||||||
@ -321,7 +323,7 @@ public class LinkedDataRecord
|
|||||||
/**
|
/**
|
||||||
* Set the formula of link field for the LinkedData record.
|
* Set the formula of link field for the LinkedData record.
|
||||||
*/
|
*/
|
||||||
public void setFormulaOfLink(short field_5_formulaOfLink)
|
public void setFormulaOfLink(LinkedDataFormulaField field_5_formulaOfLink)
|
||||||
{
|
{
|
||||||
this.field_5_formulaOfLink = field_5_formulaOfLink;
|
this.field_5_formulaOfLink = field_5_formulaOfLink;
|
||||||
}
|
}
|
||||||
|
@ -91,6 +91,7 @@ public class NumberFormatIndexRecord
|
|||||||
public NumberFormatIndexRecord(short id, short size, byte [] data)
|
public NumberFormatIndexRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,6 +107,7 @@ public class NumberFormatIndexRecord
|
|||||||
public NumberFormatIndexRecord(short id, short size, byte [] data, int offset)
|
public NumberFormatIndexRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -123,7 +125,9 @@ public class NumberFormatIndexRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_formatIndex = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
|
int pos = 0;
|
||||||
|
field_1_formatIndex = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,23 +135,24 @@ public class NumberFormatIndexRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[NumberFormatIndex]\n");
|
buffer.append("[IFMT]\n");
|
||||||
|
|
||||||
buffer.append(" .formatIndex = ")
|
buffer.append(" .formatIndex = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getFormatIndex ()))
|
||||||
.append(HexDump.toHex((short)getFormatIndex()))
|
.append(" (").append( getFormatIndex() ).append(" )");
|
||||||
.append(" (").append(getFormatIndex()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/NumberFormatIndex]\n");
|
buffer.append("[/IFMT]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_formatIndex);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_formatIndex);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -169,11 +174,12 @@ public class NumberFormatIndexRecord
|
|||||||
NumberFormatIndexRecord rec = new NumberFormatIndexRecord();
|
NumberFormatIndexRecord rec = new NumberFormatIndexRecord();
|
||||||
|
|
||||||
rec.field_1_formatIndex = field_1_formatIndex;
|
rec.field_1_formatIndex = field_1_formatIndex;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the format index field for the NumberFormatIndex record.
|
* Get the format index field for the NumberFormatIndex record.
|
||||||
*/
|
*/
|
||||||
|
@ -98,6 +98,7 @@ public class ObjectLinkRecord
|
|||||||
public ObjectLinkRecord(short id, short size, byte [] data)
|
public ObjectLinkRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -113,6 +114,7 @@ public class ObjectLinkRecord
|
|||||||
public ObjectLinkRecord(short id, short size, byte [] data, int offset)
|
public ObjectLinkRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -130,9 +132,11 @@ public class ObjectLinkRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_anchorId = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
field_2_link1 = LittleEndian.getShort(data, 0x2 + offset);
|
int pos = 0;
|
||||||
field_3_link2 = LittleEndian.getShort(data, 0x4 + offset);
|
field_1_anchorId = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
field_2_link1 = LittleEndian.getShort(data, pos + 0x2 + offset);
|
||||||
|
field_3_link2 = LittleEndian.getShort(data, pos + 0x4 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,35 +144,34 @@ public class ObjectLinkRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[ObjectLink]\n");
|
buffer.append("[OBJECTLINK]\n");
|
||||||
|
|
||||||
buffer.append(" .anchorId = ")
|
buffer.append(" .anchorId = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getAnchorId ()))
|
||||||
.append(HexDump.toHex((short)getAnchorId()))
|
.append(" (").append( getAnchorId() ).append(" )");
|
||||||
.append(" (").append(getAnchorId()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .link1 = ")
|
buffer.append(" .link1 = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getLink1 ()))
|
||||||
.append(HexDump.toHex((short)getLink1()))
|
.append(" (").append( getLink1() ).append(" )");
|
||||||
.append(" (").append(getLink1()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .link2 = ")
|
buffer.append(" .link2 = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getLink2 ()))
|
||||||
.append(HexDump.toHex((short)getLink2()))
|
.append(" (").append( getLink2() ).append(" )");
|
||||||
.append(" (").append(getLink2()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/ObjectLink]\n");
|
buffer.append("[/OBJECTLINK]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_anchorId);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_anchorId);
|
||||||
LittleEndian.putShort(data, 6 + offset, field_2_link1);
|
LittleEndian.putShort(data, 6 + offset + pos, field_2_link1);
|
||||||
LittleEndian.putShort(data, 8 + offset, field_3_link2);
|
LittleEndian.putShort(data, 8 + offset + pos, field_3_link2);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -192,11 +195,12 @@ public class ObjectLinkRecord
|
|||||||
rec.field_1_anchorId = field_1_anchorId;
|
rec.field_1_anchorId = field_1_anchorId;
|
||||||
rec.field_2_link1 = field_2_link1;
|
rec.field_2_link1 = field_2_link1;
|
||||||
rec.field_3_link2 = field_3_link2;
|
rec.field_3_link2 = field_3_link2;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the anchor id field for the ObjectLink record.
|
* Get the anchor id field for the ObjectLink record.
|
||||||
*
|
*
|
||||||
|
@ -90,6 +90,7 @@ public class PlotAreaRecord
|
|||||||
public PlotAreaRecord(short id, short size, byte [] data)
|
public PlotAreaRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -105,6 +106,7 @@ public class PlotAreaRecord
|
|||||||
public PlotAreaRecord(short id, short size, byte [] data, int offset)
|
public PlotAreaRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -123,20 +125,24 @@ public class PlotAreaRecord
|
|||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[PlotArea]\n");
|
buffer.append("[PLOTAREA]\n");
|
||||||
|
|
||||||
buffer.append("[/PlotArea]\n");
|
buffer.append("[/PLOTAREA]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
@ -160,12 +166,13 @@ public class PlotAreaRecord
|
|||||||
public Object clone() {
|
public Object clone() {
|
||||||
PlotAreaRecord rec = new PlotAreaRecord();
|
PlotAreaRecord rec = new PlotAreaRecord();
|
||||||
|
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // END OF CLASS
|
} // END OF CLASS
|
||||||
|
|
||||||
|
|
||||||
|
@ -92,6 +92,7 @@ public class PlotGrowthRecord
|
|||||||
public PlotGrowthRecord(short id, short size, byte [] data)
|
public PlotGrowthRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -107,6 +108,7 @@ public class PlotGrowthRecord
|
|||||||
public PlotGrowthRecord(short id, short size, byte [] data, int offset)
|
public PlotGrowthRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -124,8 +126,10 @@ public class PlotGrowthRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_horizontalScale = LittleEndian.getInt(data, 0x0 + offset);
|
|
||||||
field_2_verticalScale = LittleEndian.getInt(data, 0x4 + offset);
|
int pos = 0;
|
||||||
|
field_1_horizontalScale = LittleEndian.getInt(data, pos + 0x0 + offset);
|
||||||
|
field_2_verticalScale = LittleEndian.getInt(data, pos + 0x4 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,29 +137,29 @@ public class PlotGrowthRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[PlotGrowth]\n");
|
buffer.append("[PLOTGROWTH]\n");
|
||||||
|
|
||||||
buffer.append(" .horizontalScale = ")
|
buffer.append(" .horizontalScale = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getHorizontalScale ()))
|
||||||
.append(HexDump.toHex((int)getHorizontalScale()))
|
.append(" (").append( getHorizontalScale() ).append(" )");
|
||||||
.append(" (").append(getHorizontalScale()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .verticalScale = ")
|
buffer.append(" .verticalScale = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getVerticalScale ()))
|
||||||
.append(HexDump.toHex((int)getVerticalScale()))
|
.append(" (").append( getVerticalScale() ).append(" )");
|
||||||
.append(" (").append(getVerticalScale()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/PlotGrowth]\n");
|
buffer.append("[/PLOTGROWTH]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putInt(data, 4 + offset, field_1_horizontalScale);
|
LittleEndian.putInt(data, 4 + offset + pos, field_1_horizontalScale);
|
||||||
LittleEndian.putInt(data, 8 + offset, field_2_verticalScale);
|
LittleEndian.putInt(data, 8 + offset + pos, field_2_verticalScale);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -178,11 +182,12 @@ public class PlotGrowthRecord
|
|||||||
|
|
||||||
rec.field_1_horizontalScale = field_1_horizontalScale;
|
rec.field_1_horizontalScale = field_1_horizontalScale;
|
||||||
rec.field_2_verticalScale = field_2_verticalScale;
|
rec.field_2_verticalScale = field_2_verticalScale;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the horizontalScale field for the PlotGrowth record.
|
* Get the horizontalScale field for the PlotGrowth record.
|
||||||
*/
|
*/
|
||||||
|
@ -92,6 +92,7 @@ public class SCLRecord
|
|||||||
public SCLRecord(short id, short size, byte [] data)
|
public SCLRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -107,6 +108,7 @@ public class SCLRecord
|
|||||||
public SCLRecord(short id, short size, byte [] data, int offset)
|
public SCLRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -124,8 +126,10 @@ public class SCLRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_numerator = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
field_2_denominator = LittleEndian.getShort(data, 0x2 + offset);
|
int pos = 0;
|
||||||
|
field_1_numerator = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
field_2_denominator = LittleEndian.getShort(data, pos + 0x2 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,16 +138,14 @@ public class SCLRecord
|
|||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[SCL]\n");
|
buffer.append("[SCL]\n");
|
||||||
|
|
||||||
buffer.append(" .numerator = ")
|
buffer.append(" .numerator = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getNumerator ()))
|
||||||
.append(HexDump.toHex((short)getNumerator()))
|
.append(" (").append( getNumerator() ).append(" )");
|
||||||
.append(" (").append(getNumerator()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .denominator = ")
|
buffer.append(" .denominator = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getDenominator ()))
|
||||||
.append(HexDump.toHex((short)getDenominator()))
|
.append(" (").append( getDenominator() ).append(" )");
|
||||||
.append(" (").append(getDenominator()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/SCL]\n");
|
buffer.append("[/SCL]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
@ -151,11 +153,13 @@ public class SCLRecord
|
|||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_numerator);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_numerator);
|
||||||
LittleEndian.putShort(data, 6 + offset, field_2_denominator);
|
LittleEndian.putShort(data, 6 + offset + pos, field_2_denominator);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -178,11 +182,12 @@ public class SCLRecord
|
|||||||
|
|
||||||
rec.field_1_numerator = field_1_numerator;
|
rec.field_1_numerator = field_1_numerator;
|
||||||
rec.field_2_denominator = field_2_denominator;
|
rec.field_2_denominator = field_2_denominator;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the numerator field for the SCL record.
|
* Get the numerator field for the SCL record.
|
||||||
*/
|
*/
|
||||||
|
@ -91,6 +91,7 @@ public class SeriesChartGroupIndexRecord
|
|||||||
public SeriesChartGroupIndexRecord(short id, short size, byte [] data)
|
public SeriesChartGroupIndexRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,6 +107,7 @@ public class SeriesChartGroupIndexRecord
|
|||||||
public SeriesChartGroupIndexRecord(short id, short size, byte [] data, int offset)
|
public SeriesChartGroupIndexRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -123,7 +125,9 @@ public class SeriesChartGroupIndexRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_chartGroupIndex = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
|
int pos = 0;
|
||||||
|
field_1_chartGroupIndex = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,23 +135,24 @@ public class SeriesChartGroupIndexRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[SeriesChartGroupIndex]\n");
|
buffer.append("[SERTOCRT]\n");
|
||||||
|
|
||||||
buffer.append(" .chartGroupIndex = ")
|
buffer.append(" .chartGroupIndex = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getChartGroupIndex ()))
|
||||||
.append(HexDump.toHex((short)getChartGroupIndex()))
|
.append(" (").append( getChartGroupIndex() ).append(" )");
|
||||||
.append(" (").append(getChartGroupIndex()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/SeriesChartGroupIndex]\n");
|
buffer.append("[/SERTOCRT]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_chartGroupIndex);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_chartGroupIndex);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -169,11 +174,12 @@ public class SeriesChartGroupIndexRecord
|
|||||||
SeriesChartGroupIndexRecord rec = new SeriesChartGroupIndexRecord();
|
SeriesChartGroupIndexRecord rec = new SeriesChartGroupIndexRecord();
|
||||||
|
|
||||||
rec.field_1_chartGroupIndex = field_1_chartGroupIndex;
|
rec.field_1_chartGroupIndex = field_1_chartGroupIndex;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the chart group index field for the SeriesChartGroupIndex record.
|
* Get the chart group index field for the SeriesChartGroupIndex record.
|
||||||
*/
|
*/
|
||||||
|
@ -91,6 +91,7 @@ public class SeriesIndexRecord
|
|||||||
public SeriesIndexRecord(short id, short size, byte [] data)
|
public SeriesIndexRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,6 +107,7 @@ public class SeriesIndexRecord
|
|||||||
public SeriesIndexRecord(short id, short size, byte [] data, int offset)
|
public SeriesIndexRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -123,7 +125,9 @@ public class SeriesIndexRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_index = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
|
int pos = 0;
|
||||||
|
field_1_index = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,23 +135,24 @@ public class SeriesIndexRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[SeriesIndex]\n");
|
buffer.append("[SINDEX]\n");
|
||||||
|
|
||||||
buffer.append(" .index = ")
|
buffer.append(" .index = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getIndex ()))
|
||||||
.append(HexDump.toHex((short)getIndex()))
|
.append(" (").append( getIndex() ).append(" )");
|
||||||
.append(" (").append(getIndex()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/SeriesIndex]\n");
|
buffer.append("[/SINDEX]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_index);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_index);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -169,11 +174,12 @@ public class SeriesIndexRecord
|
|||||||
SeriesIndexRecord rec = new SeriesIndexRecord();
|
SeriesIndexRecord rec = new SeriesIndexRecord();
|
||||||
|
|
||||||
rec.field_1_index = field_1_index;
|
rec.field_1_index = field_1_index;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the index field for the SeriesIndex record.
|
* Get the index field for the SeriesIndex record.
|
||||||
*/
|
*/
|
||||||
|
@ -97,6 +97,7 @@ public class SeriesLabelsRecord
|
|||||||
public SeriesLabelsRecord(short id, short size, byte [] data)
|
public SeriesLabelsRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,6 +113,7 @@ public class SeriesLabelsRecord
|
|||||||
public SeriesLabelsRecord(short id, short size, byte [] data, int offset)
|
public SeriesLabelsRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -129,7 +131,9 @@ public class SeriesLabelsRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_formatFlags = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
|
int pos = 0;
|
||||||
|
field_1_formatFlags = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,12 +141,11 @@ public class SeriesLabelsRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[SeriesLabels]\n");
|
buffer.append("[ATTACHEDLABEL]\n");
|
||||||
|
|
||||||
buffer.append(" .formatFlags = ")
|
buffer.append(" .formatFlags = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getFormatFlags ()))
|
||||||
.append(HexDump.toHex((short)getFormatFlags()))
|
.append(" (").append( getFormatFlags() ).append(" )");
|
||||||
.append(" (").append(getFormatFlags()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .showActual = ").append(isShowActual()).append('\n');
|
buffer.append(" .showActual = ").append(isShowActual()).append('\n');
|
||||||
buffer.append(" .showPercent = ").append(isShowPercent()).append('\n');
|
buffer.append(" .showPercent = ").append(isShowPercent()).append('\n');
|
||||||
buffer.append(" .labelAsPercentage = ").append(isLabelAsPercentage()).append('\n');
|
buffer.append(" .labelAsPercentage = ").append(isLabelAsPercentage()).append('\n');
|
||||||
@ -150,16 +153,18 @@ public class SeriesLabelsRecord
|
|||||||
buffer.append(" .showLabel = ").append(isShowLabel()).append('\n');
|
buffer.append(" .showLabel = ").append(isShowLabel()).append('\n');
|
||||||
buffer.append(" .showBubbleSizes = ").append(isShowBubbleSizes()).append('\n');
|
buffer.append(" .showBubbleSizes = ").append(isShowBubbleSizes()).append('\n');
|
||||||
|
|
||||||
buffer.append("[/SeriesLabels]\n");
|
buffer.append("[/ATTACHEDLABEL]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_formatFlags);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_formatFlags);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -181,11 +186,12 @@ public class SeriesLabelsRecord
|
|||||||
SeriesLabelsRecord rec = new SeriesLabelsRecord();
|
SeriesLabelsRecord rec = new SeriesLabelsRecord();
|
||||||
|
|
||||||
rec.field_1_formatFlags = field_1_formatFlags;
|
rec.field_1_formatFlags = field_1_formatFlags;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the format flags field for the SeriesLabels record.
|
* Get the format flags field for the SeriesLabels record.
|
||||||
*/
|
*/
|
||||||
|
@ -91,6 +91,7 @@ public class SeriesListRecord
|
|||||||
public SeriesListRecord(short id, short size, byte [] data)
|
public SeriesListRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,6 +107,7 @@ public class SeriesListRecord
|
|||||||
public SeriesListRecord(short id, short size, byte [] data, int offset)
|
public SeriesListRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -123,7 +125,9 @@ public class SeriesListRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_seriesNumbers = LittleEndian.getShortArray(data, 0x0 + offset);
|
|
||||||
|
int pos = 0;
|
||||||
|
field_1_seriesNumbers = LittleEndian.getShortArray(data, pos + 0x0 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,21 +135,23 @@ public class SeriesListRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[SeriesList]\n");
|
buffer.append("[SERIESLIST]\n");
|
||||||
|
|
||||||
buffer.append(" .seriesNumbers = ")
|
buffer.append(" .seriesNumbers = ")
|
||||||
.append(" (").append(getSeriesNumbers()).append(" )\n");
|
.append(" (").append( getSeriesNumbers() ).append(" )");
|
||||||
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/SeriesList]\n");
|
buffer.append("[/SERIESLIST]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShortArray(data, 4 + offset, field_1_seriesNumbers);
|
LittleEndian.putShortArray(data, 4 + offset + pos, field_1_seriesNumbers);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -167,11 +173,12 @@ public class SeriesListRecord
|
|||||||
SeriesListRecord rec = new SeriesListRecord();
|
SeriesListRecord rec = new SeriesListRecord();
|
||||||
|
|
||||||
rec.field_1_seriesNumbers = field_1_seriesNumbers;
|
rec.field_1_seriesNumbers = field_1_seriesNumbers;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the series numbers field for the SeriesList record.
|
* Get the series numbers field for the SeriesList record.
|
||||||
*/
|
*/
|
||||||
|
@ -108,6 +108,7 @@ public class SeriesRecord
|
|||||||
public SeriesRecord(short id, short size, byte [] data)
|
public SeriesRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -123,6 +124,7 @@ public class SeriesRecord
|
|||||||
public SeriesRecord(short id, short size, byte [] data, int offset)
|
public SeriesRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -140,12 +142,14 @@ public class SeriesRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_categoryDataType = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
field_2_valuesDataType = LittleEndian.getShort(data, 0x2 + offset);
|
int pos = 0;
|
||||||
field_3_numCategories = LittleEndian.getShort(data, 0x4 + offset);
|
field_1_categoryDataType = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
field_4_numValues = LittleEndian.getShort(data, 0x6 + offset);
|
field_2_valuesDataType = LittleEndian.getShort(data, pos + 0x2 + offset);
|
||||||
field_5_bubbleSeriesType = LittleEndian.getShort(data, 0x8 + offset);
|
field_3_numCategories = LittleEndian.getShort(data, pos + 0x4 + offset);
|
||||||
field_6_numBubbleValues = LittleEndian.getShort(data, 0xa + offset);
|
field_4_numValues = LittleEndian.getShort(data, pos + 0x6 + offset);
|
||||||
|
field_5_bubbleSeriesType = LittleEndian.getShort(data, pos + 0x8 + offset);
|
||||||
|
field_6_numBubbleValues = LittleEndian.getShort(data, pos + 0xa + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,53 +157,49 @@ public class SeriesRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[Series]\n");
|
buffer.append("[SERIES]\n");
|
||||||
|
|
||||||
buffer.append(" .categoryDataType = ")
|
buffer.append(" .categoryDataType = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getCategoryDataType ()))
|
||||||
.append(HexDump.toHex((short)getCategoryDataType()))
|
.append(" (").append( getCategoryDataType() ).append(" )");
|
||||||
.append(" (").append(getCategoryDataType()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .valuesDataType = ")
|
buffer.append(" .valuesDataType = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getValuesDataType ()))
|
||||||
.append(HexDump.toHex((short)getValuesDataType()))
|
.append(" (").append( getValuesDataType() ).append(" )");
|
||||||
.append(" (").append(getValuesDataType()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .numCategories = ")
|
buffer.append(" .numCategories = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getNumCategories ()))
|
||||||
.append(HexDump.toHex((short)getNumCategories()))
|
.append(" (").append( getNumCategories() ).append(" )");
|
||||||
.append(" (").append(getNumCategories()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .numValues = ")
|
buffer.append(" .numValues = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getNumValues ()))
|
||||||
.append(HexDump.toHex((short)getNumValues()))
|
.append(" (").append( getNumValues() ).append(" )");
|
||||||
.append(" (").append(getNumValues()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .bubbleSeriesType = ")
|
buffer.append(" .bubbleSeriesType = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getBubbleSeriesType ()))
|
||||||
.append(HexDump.toHex((short)getBubbleSeriesType()))
|
.append(" (").append( getBubbleSeriesType() ).append(" )");
|
||||||
.append(" (").append(getBubbleSeriesType()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .numBubbleValues = ")
|
buffer.append(" .numBubbleValues = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getNumBubbleValues ()))
|
||||||
.append(HexDump.toHex((short)getNumBubbleValues()))
|
.append(" (").append( getNumBubbleValues() ).append(" )");
|
||||||
.append(" (").append(getNumBubbleValues()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/Series]\n");
|
buffer.append("[/SERIES]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_categoryDataType);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_categoryDataType);
|
||||||
LittleEndian.putShort(data, 6 + offset, field_2_valuesDataType);
|
LittleEndian.putShort(data, 6 + offset + pos, field_2_valuesDataType);
|
||||||
LittleEndian.putShort(data, 8 + offset, field_3_numCategories);
|
LittleEndian.putShort(data, 8 + offset + pos, field_3_numCategories);
|
||||||
LittleEndian.putShort(data, 10 + offset, field_4_numValues);
|
LittleEndian.putShort(data, 10 + offset + pos, field_4_numValues);
|
||||||
LittleEndian.putShort(data, 12 + offset, field_5_bubbleSeriesType);
|
LittleEndian.putShort(data, 12 + offset + pos, field_5_bubbleSeriesType);
|
||||||
LittleEndian.putShort(data, 14 + offset, field_6_numBubbleValues);
|
LittleEndian.putShort(data, 14 + offset + pos, field_6_numBubbleValues);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -226,11 +226,12 @@ public class SeriesRecord
|
|||||||
rec.field_4_numValues = field_4_numValues;
|
rec.field_4_numValues = field_4_numValues;
|
||||||
rec.field_5_bubbleSeriesType = field_5_bubbleSeriesType;
|
rec.field_5_bubbleSeriesType = field_5_bubbleSeriesType;
|
||||||
rec.field_6_numBubbleValues = field_6_numBubbleValues;
|
rec.field_6_numBubbleValues = field_6_numBubbleValues;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the category data type field for the Series record.
|
* Get the category data type field for the Series record.
|
||||||
*
|
*
|
||||||
|
@ -94,6 +94,7 @@ public class SeriesTextRecord
|
|||||||
public SeriesTextRecord(short id, short size, byte [] data)
|
public SeriesTextRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -109,6 +110,7 @@ public class SeriesTextRecord
|
|||||||
public SeriesTextRecord(short id, short size, byte [] data, int offset)
|
public SeriesTextRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -126,10 +128,12 @@ public class SeriesTextRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_id = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
field_2_textLength = data[ 0x2 + offset ];
|
int pos = 0;
|
||||||
field_3_undocumented = data[ 0x3 + offset ];
|
field_1_id = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
field_4_text = StringUtil.getFromUnicodeHigh(data, 0x4 + offset, ((field_2_textLength *2)/2));
|
field_2_textLength = data[ pos + 0x2 + offset ];
|
||||||
|
field_3_undocumented = data[ pos + 0x3 + offset ];
|
||||||
|
field_4_text = StringUtil.getFromUnicodeHigh(data, pos + 0x4 + offset, ((field_2_textLength *2)/2));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,39 +141,38 @@ public class SeriesTextRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[SeriesText]\n");
|
buffer.append("[SERIESTEXT]\n");
|
||||||
|
|
||||||
buffer.append(" .id = ")
|
buffer.append(" .id = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getId ()))
|
||||||
.append(HexDump.toHex((short)getId()))
|
.append(" (").append( getId() ).append(" )");
|
||||||
.append(" (").append(getId()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .textLength = ")
|
buffer.append(" .textLength = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getTextLength ()))
|
||||||
.append(HexDump.toHex((byte)getTextLength()))
|
.append(" (").append( getTextLength() ).append(" )");
|
||||||
.append(" (").append(getTextLength()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .undocumented = ")
|
buffer.append(" .undocumented = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getUndocumented ()))
|
||||||
.append(HexDump.toHex((byte)getUndocumented()))
|
.append(" (").append( getUndocumented() ).append(" )");
|
||||||
.append(" (").append(getUndocumented()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .text = ")
|
buffer.append(" .text = ")
|
||||||
.append(" (").append(getText()).append(" )\n");
|
.append(" (").append( getText() ).append(" )");
|
||||||
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/SeriesText]\n");
|
buffer.append("[/SERIESTEXT]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_id);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_id);
|
||||||
data[ 6 + offset ] = field_2_textLength;
|
data[ 6 + offset + pos ] = field_2_textLength;
|
||||||
data[ 7 + offset ] = field_3_undocumented;
|
data[ 7 + offset + pos ] = field_3_undocumented;
|
||||||
StringUtil.putUncompressedUnicodeHigh(field_4_text, data, 8 + offset);
|
StringUtil.putUncompressedUnicodeHigh(field_4_text, data, 8 + offset + pos);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -194,11 +197,12 @@ public class SeriesTextRecord
|
|||||||
rec.field_2_textLength = field_2_textLength;
|
rec.field_2_textLength = field_2_textLength;
|
||||||
rec.field_3_undocumented = field_3_undocumented;
|
rec.field_3_undocumented = field_3_undocumented;
|
||||||
rec.field_4_text = field_4_text;
|
rec.field_4_text = field_4_text;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the id field for the SeriesText record.
|
* Get the id field for the SeriesText record.
|
||||||
*/
|
*/
|
||||||
|
@ -91,6 +91,7 @@ public class SeriesToChartGroupRecord
|
|||||||
public SeriesToChartGroupRecord(short id, short size, byte [] data)
|
public SeriesToChartGroupRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,6 +107,7 @@ public class SeriesToChartGroupRecord
|
|||||||
public SeriesToChartGroupRecord(short id, short size, byte [] data, int offset)
|
public SeriesToChartGroupRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -123,7 +125,9 @@ public class SeriesToChartGroupRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_chartGroupIndex = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
|
int pos = 0;
|
||||||
|
field_1_chartGroupIndex = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,11 +136,10 @@ public class SeriesToChartGroupRecord
|
|||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[SeriesToChartGroup]\n");
|
buffer.append("[SeriesToChartGroup]\n");
|
||||||
|
|
||||||
buffer.append(" .chartGroupIndex = ")
|
buffer.append(" .chartGroupIndex = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getChartGroupIndex ()))
|
||||||
.append(HexDump.toHex((short)getChartGroupIndex()))
|
.append(" (").append( getChartGroupIndex() ).append(" )");
|
||||||
.append(" (").append(getChartGroupIndex()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/SeriesToChartGroup]\n");
|
buffer.append("[/SeriesToChartGroup]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
@ -144,10 +147,12 @@ public class SeriesToChartGroupRecord
|
|||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_chartGroupIndex);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_chartGroupIndex);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -169,11 +174,12 @@ public class SeriesToChartGroupRecord
|
|||||||
SeriesToChartGroupRecord rec = new SeriesToChartGroupRecord();
|
SeriesToChartGroupRecord rec = new SeriesToChartGroupRecord();
|
||||||
|
|
||||||
rec.field_1_chartGroupIndex = field_1_chartGroupIndex;
|
rec.field_1_chartGroupIndex = field_1_chartGroupIndex;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the chart group index field for the SeriesToChartGroup record.
|
* Get the chart group index field for the SeriesToChartGroup record.
|
||||||
*/
|
*/
|
||||||
|
@ -100,6 +100,7 @@ public class SheetPropertiesRecord
|
|||||||
public SheetPropertiesRecord(short id, short size, byte [] data)
|
public SheetPropertiesRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -115,6 +116,7 @@ public class SheetPropertiesRecord
|
|||||||
public SheetPropertiesRecord(short id, short size, byte [] data, int offset)
|
public SheetPropertiesRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -132,8 +134,10 @@ public class SheetPropertiesRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_flags = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
field_2_empty = data[ 0x2 + offset ];
|
int pos = 0;
|
||||||
|
field_1_flags = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
field_2_empty = data[ pos + 0x2 + offset ];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,34 +145,34 @@ public class SheetPropertiesRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[SheetProperties]\n");
|
buffer.append("[SHTPROPS]\n");
|
||||||
|
|
||||||
buffer.append(" .flags = ")
|
buffer.append(" .flags = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getFlags ()))
|
||||||
.append(HexDump.toHex((short)getFlags()))
|
.append(" (").append( getFlags() ).append(" )");
|
||||||
.append(" (").append(getFlags()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .chartTypeManuallyFormatted = ").append(isChartTypeManuallyFormatted()).append('\n');
|
buffer.append(" .chartTypeManuallyFormatted = ").append(isChartTypeManuallyFormatted()).append('\n');
|
||||||
buffer.append(" .plotVisibleOnly = ").append(isPlotVisibleOnly()).append('\n');
|
buffer.append(" .plotVisibleOnly = ").append(isPlotVisibleOnly()).append('\n');
|
||||||
buffer.append(" .doNotSizeWithWindow = ").append(isDoNotSizeWithWindow()).append('\n');
|
buffer.append(" .doNotSizeWithWindow = ").append(isDoNotSizeWithWindow()).append('\n');
|
||||||
buffer.append(" .defaultPlotDimensions = ").append(isDefaultPlotDimensions()).append('\n');
|
buffer.append(" .defaultPlotDimensions = ").append(isDefaultPlotDimensions()).append('\n');
|
||||||
buffer.append(" .autoPlotArea = ").append(isAutoPlotArea()).append('\n');
|
buffer.append(" .autoPlotArea = ").append(isAutoPlotArea()).append('\n');
|
||||||
|
|
||||||
buffer.append(" .empty = ")
|
buffer.append(" .empty = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getEmpty ()))
|
||||||
.append(HexDump.toHex((byte)getEmpty()))
|
.append(" (").append( getEmpty() ).append(" )");
|
||||||
.append(" (").append(getEmpty()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/SheetProperties]\n");
|
buffer.append("[/SHTPROPS]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_flags);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_flags);
|
||||||
data[ 6 + offset ] = field_2_empty;
|
data[ 6 + offset + pos ] = field_2_empty;
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -191,11 +195,12 @@ public class SheetPropertiesRecord
|
|||||||
|
|
||||||
rec.field_1_flags = field_1_flags;
|
rec.field_1_flags = field_1_flags;
|
||||||
rec.field_2_empty = field_2_empty;
|
rec.field_2_empty = field_2_empty;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the flags field for the SheetProperties record.
|
* Get the flags field for the SheetProperties record.
|
||||||
*/
|
*/
|
||||||
|
@ -141,6 +141,7 @@ public class TextRecord
|
|||||||
public TextRecord(short id, short size, byte [] data)
|
public TextRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -156,6 +157,7 @@ public class TextRecord
|
|||||||
public TextRecord(short id, short size, byte [] data, int offset)
|
public TextRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -173,18 +175,20 @@ public class TextRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_horizontalAlignment = data[ 0x0 + offset ];
|
|
||||||
field_2_verticalAlignment = data[ 0x1 + offset ];
|
int pos = 0;
|
||||||
field_3_displayMode = LittleEndian.getShort(data, 0x2 + offset);
|
field_1_horizontalAlignment = data[ pos + 0x0 + offset ];
|
||||||
field_4_rgbColor = LittleEndian.getInt(data, 0x4 + offset);
|
field_2_verticalAlignment = data[ pos + 0x1 + offset ];
|
||||||
field_5_x = LittleEndian.getInt(data, 0x8 + offset);
|
field_3_displayMode = LittleEndian.getShort(data, pos + 0x2 + offset);
|
||||||
field_6_y = LittleEndian.getInt(data, 0xc + offset);
|
field_4_rgbColor = LittleEndian.getInt(data, pos + 0x4 + offset);
|
||||||
field_7_width = LittleEndian.getInt(data, 0x10 + offset);
|
field_5_x = LittleEndian.getInt(data, pos + 0x8 + offset);
|
||||||
field_8_height = LittleEndian.getInt(data, 0x14 + offset);
|
field_6_y = LittleEndian.getInt(data, pos + 0xc + offset);
|
||||||
field_9_options1 = LittleEndian.getShort(data, 0x18 + offset);
|
field_7_width = LittleEndian.getInt(data, pos + 0x10 + offset);
|
||||||
field_10_indexOfColorValue = LittleEndian.getShort(data, 0x1a + offset);
|
field_8_height = LittleEndian.getInt(data, pos + 0x14 + offset);
|
||||||
field_11_options2 = LittleEndian.getShort(data, 0x1c + offset);
|
field_9_options1 = LittleEndian.getShort(data, pos + 0x18 + offset);
|
||||||
field_12_textRotation = LittleEndian.getShort(data, 0x1e + offset);
|
field_10_indexOfColorValue = LittleEndian.getShort(data, pos + 0x1a + offset);
|
||||||
|
field_11_options2 = LittleEndian.getShort(data, pos + 0x1c + offset);
|
||||||
|
field_12_textRotation = LittleEndian.getShort(data, pos + 0x1e + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,52 +196,43 @@ public class TextRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[Text]\n");
|
buffer.append("[TEXT]\n");
|
||||||
|
|
||||||
buffer.append(" .horizontalAlignment = ")
|
buffer.append(" .horizontalAlignment = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getHorizontalAlignment ()))
|
||||||
.append(HexDump.toHex((byte)getHorizontalAlignment()))
|
.append(" (").append( getHorizontalAlignment() ).append(" )");
|
||||||
.append(" (").append(getHorizontalAlignment()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .verticalAlignment = ")
|
buffer.append(" .verticalAlignment = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getVerticalAlignment ()))
|
||||||
.append(HexDump.toHex((byte)getVerticalAlignment()))
|
.append(" (").append( getVerticalAlignment() ).append(" )");
|
||||||
.append(" (").append(getVerticalAlignment()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .displayMode = ")
|
buffer.append(" .displayMode = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getDisplayMode ()))
|
||||||
.append(HexDump.toHex((short)getDisplayMode()))
|
.append(" (").append( getDisplayMode() ).append(" )");
|
||||||
.append(" (").append(getDisplayMode()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .rgbColor = ")
|
buffer.append(" .rgbColor = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getRgbColor ()))
|
||||||
.append(HexDump.toHex((int)getRgbColor()))
|
.append(" (").append( getRgbColor() ).append(" )");
|
||||||
.append(" (").append(getRgbColor()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .x = ")
|
buffer.append(" .x = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getX ()))
|
||||||
.append(HexDump.toHex((int)getX()))
|
.append(" (").append( getX() ).append(" )");
|
||||||
.append(" (").append(getX()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .y = ")
|
buffer.append(" .y = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getY ()))
|
||||||
.append(HexDump.toHex((int)getY()))
|
.append(" (").append( getY() ).append(" )");
|
||||||
.append(" (").append(getY()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .width = ")
|
buffer.append(" .width = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getWidth ()))
|
||||||
.append(HexDump.toHex((int)getWidth()))
|
.append(" (").append( getWidth() ).append(" )");
|
||||||
.append(" (").append(getWidth()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .height = ")
|
buffer.append(" .height = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getHeight ()))
|
||||||
.append(HexDump.toHex((int)getHeight()))
|
.append(" (").append( getHeight() ).append(" )");
|
||||||
.append(" (").append(getHeight()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .options1 = ")
|
buffer.append(" .options1 = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getOptions1 ()))
|
||||||
.append(HexDump.toHex((short)getOptions1()))
|
.append(" (").append( getOptions1() ).append(" )");
|
||||||
.append(" (").append(getOptions1()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .autoColor = ").append(isAutoColor()).append('\n');
|
buffer.append(" .autoColor = ").append(isAutoColor()).append('\n');
|
||||||
buffer.append(" .showKey = ").append(isShowKey()).append('\n');
|
buffer.append(" .showKey = ").append(isShowKey()).append('\n');
|
||||||
buffer.append(" .showValue = ").append(isShowValue()).append('\n');
|
buffer.append(" .showValue = ").append(isShowValue()).append('\n');
|
||||||
@ -251,44 +246,43 @@ public class TextRecord
|
|||||||
buffer.append(" .showValueAsPercentage = ").append(isShowValueAsPercentage()).append('\n');
|
buffer.append(" .showValueAsPercentage = ").append(isShowValueAsPercentage()).append('\n');
|
||||||
buffer.append(" .showBubbleSizes = ").append(isShowBubbleSizes()).append('\n');
|
buffer.append(" .showBubbleSizes = ").append(isShowBubbleSizes()).append('\n');
|
||||||
buffer.append(" .showLabel = ").append(isShowLabel()).append('\n');
|
buffer.append(" .showLabel = ").append(isShowLabel()).append('\n');
|
||||||
|
|
||||||
buffer.append(" .indexOfColorValue = ")
|
buffer.append(" .indexOfColorValue = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getIndexOfColorValue ()))
|
||||||
.append(HexDump.toHex((short)getIndexOfColorValue()))
|
.append(" (").append( getIndexOfColorValue() ).append(" )");
|
||||||
.append(" (").append(getIndexOfColorValue()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .options2 = ")
|
buffer.append(" .options2 = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getOptions2 ()))
|
||||||
.append(HexDump.toHex((short)getOptions2()))
|
.append(" (").append( getOptions2() ).append(" )");
|
||||||
.append(" (").append(getOptions2()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .dataLabelPlacement = ").append(getDataLabelPlacement()).append('\n');
|
buffer.append(" .dataLabelPlacement = ").append(getDataLabelPlacement()).append('\n');
|
||||||
|
|
||||||
buffer.append(" .textRotation = ")
|
buffer.append(" .textRotation = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getTextRotation ()))
|
||||||
.append(HexDump.toHex((short)getTextRotation()))
|
.append(" (").append( getTextRotation() ).append(" )");
|
||||||
.append(" (").append(getTextRotation()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/Text]\n");
|
buffer.append("[/TEXT]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
data[ 4 + offset ] = field_1_horizontalAlignment;
|
data[ 4 + offset + pos ] = field_1_horizontalAlignment;
|
||||||
data[ 5 + offset ] = field_2_verticalAlignment;
|
data[ 5 + offset + pos ] = field_2_verticalAlignment;
|
||||||
LittleEndian.putShort(data, 6 + offset, field_3_displayMode);
|
LittleEndian.putShort(data, 6 + offset + pos, field_3_displayMode);
|
||||||
LittleEndian.putInt(data, 8 + offset, field_4_rgbColor);
|
LittleEndian.putInt(data, 8 + offset + pos, field_4_rgbColor);
|
||||||
LittleEndian.putInt(data, 12 + offset, field_5_x);
|
LittleEndian.putInt(data, 12 + offset + pos, field_5_x);
|
||||||
LittleEndian.putInt(data, 16 + offset, field_6_y);
|
LittleEndian.putInt(data, 16 + offset + pos, field_6_y);
|
||||||
LittleEndian.putInt(data, 20 + offset, field_7_width);
|
LittleEndian.putInt(data, 20 + offset + pos, field_7_width);
|
||||||
LittleEndian.putInt(data, 24 + offset, field_8_height);
|
LittleEndian.putInt(data, 24 + offset + pos, field_8_height);
|
||||||
LittleEndian.putShort(data, 28 + offset, field_9_options1);
|
LittleEndian.putShort(data, 28 + offset + pos, field_9_options1);
|
||||||
LittleEndian.putShort(data, 30 + offset, field_10_indexOfColorValue);
|
LittleEndian.putShort(data, 30 + offset + pos, field_10_indexOfColorValue);
|
||||||
LittleEndian.putShort(data, 32 + offset, field_11_options2);
|
LittleEndian.putShort(data, 32 + offset + pos, field_11_options2);
|
||||||
LittleEndian.putShort(data, 34 + offset, field_12_textRotation);
|
LittleEndian.putShort(data, 34 + offset + pos, field_12_textRotation);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -321,11 +315,12 @@ public class TextRecord
|
|||||||
rec.field_10_indexOfColorValue = field_10_indexOfColorValue;
|
rec.field_10_indexOfColorValue = field_10_indexOfColorValue;
|
||||||
rec.field_11_options2 = field_11_options2;
|
rec.field_11_options2 = field_11_options2;
|
||||||
rec.field_12_textRotation = field_12_textRotation;
|
rec.field_12_textRotation = field_12_textRotation;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the horizontal alignment field for the Text record.
|
* Get the horizontal alignment field for the Text record.
|
||||||
*
|
*
|
||||||
|
@ -104,6 +104,7 @@ public class TickRecord
|
|||||||
public TickRecord(short id, short size, byte [] data)
|
public TickRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -119,6 +120,7 @@ public class TickRecord
|
|||||||
public TickRecord(short id, short size, byte [] data, int offset)
|
public TickRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -136,16 +138,18 @@ public class TickRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_majorTickType = data[ 0x0 + offset ];
|
|
||||||
field_2_minorTickType = data[ 0x1 + offset ];
|
int pos = 0;
|
||||||
field_3_labelPosition = data[ 0x2 + offset ];
|
field_1_majorTickType = data[ pos + 0x0 + offset ];
|
||||||
field_4_background = data[ 0x3 + offset ];
|
field_2_minorTickType = data[ pos + 0x1 + offset ];
|
||||||
field_5_labelColorRgb = LittleEndian.getInt(data, 0x4 + offset);
|
field_3_labelPosition = data[ pos + 0x2 + offset ];
|
||||||
field_6_zero1 = LittleEndian.getShort(data, 0x8 + offset);
|
field_4_background = data[ pos + 0x3 + offset ];
|
||||||
field_7_zero2 = LittleEndian.getShort(data, 0x10 + offset);
|
field_5_labelColorRgb = LittleEndian.getInt(data, pos + 0x4 + offset);
|
||||||
field_8_options = LittleEndian.getShort(data, 0x18 + offset);
|
field_6_zero1 = LittleEndian.getShort(data, pos + 0x8 + offset);
|
||||||
field_9_tickColor = LittleEndian.getShort(data, 0x1a + offset);
|
field_7_zero2 = LittleEndian.getShort(data, pos + 0x10 + offset);
|
||||||
field_10_zero3 = LittleEndian.getShort(data, 0x1c + offset);
|
field_8_options = LittleEndian.getShort(data, pos + 0x18 + offset);
|
||||||
|
field_9_tickColor = LittleEndian.getShort(data, pos + 0x1a + offset);
|
||||||
|
field_10_zero3 = LittleEndian.getShort(data, pos + 0x1c + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,81 +157,73 @@ public class TickRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[Tick]\n");
|
buffer.append("[TICK]\n");
|
||||||
|
|
||||||
buffer.append(" .majorTickType = ")
|
buffer.append(" .majorTickType = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getMajorTickType ()))
|
||||||
.append(HexDump.toHex((byte)getMajorTickType()))
|
.append(" (").append( getMajorTickType() ).append(" )");
|
||||||
.append(" (").append(getMajorTickType()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .minorTickType = ")
|
buffer.append(" .minorTickType = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getMinorTickType ()))
|
||||||
.append(HexDump.toHex((byte)getMinorTickType()))
|
.append(" (").append( getMinorTickType() ).append(" )");
|
||||||
.append(" (").append(getMinorTickType()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .labelPosition = ")
|
buffer.append(" .labelPosition = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getLabelPosition ()))
|
||||||
.append(HexDump.toHex((byte)getLabelPosition()))
|
.append(" (").append( getLabelPosition() ).append(" )");
|
||||||
.append(" (").append(getLabelPosition()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .background = ")
|
buffer.append(" .background = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getBackground ()))
|
||||||
.append(HexDump.toHex((byte)getBackground()))
|
.append(" (").append( getBackground() ).append(" )");
|
||||||
.append(" (").append(getBackground()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .labelColorRgb = ")
|
buffer.append(" .labelColorRgb = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getLabelColorRgb ()))
|
||||||
.append(HexDump.toHex((int)getLabelColorRgb()))
|
.append(" (").append( getLabelColorRgb() ).append(" )");
|
||||||
.append(" (").append(getLabelColorRgb()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .zero1 = ")
|
buffer.append(" .zero1 = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getZero1 ()))
|
||||||
.append(HexDump.toHex((short)getZero1()))
|
.append(" (").append( getZero1() ).append(" )");
|
||||||
.append(" (").append(getZero1()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .zero2 = ")
|
buffer.append(" .zero2 = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getZero2 ()))
|
||||||
.append(HexDump.toHex((short)getZero2()))
|
.append(" (").append( getZero2() ).append(" )");
|
||||||
.append(" (").append(getZero2()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .options = ")
|
buffer.append(" .options = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getOptions ()))
|
||||||
.append(HexDump.toHex((short)getOptions()))
|
.append(" (").append( getOptions() ).append(" )");
|
||||||
.append(" (").append(getOptions()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .autoTextColor = ").append(isAutoTextColor()).append('\n');
|
buffer.append(" .autoTextColor = ").append(isAutoTextColor()).append('\n');
|
||||||
buffer.append(" .autoTextBackground = ").append(isAutoTextBackground()).append('\n');
|
buffer.append(" .autoTextBackground = ").append(isAutoTextBackground()).append('\n');
|
||||||
buffer.append(" .rotation = ").append(getRotation()).append('\n');
|
buffer.append(" .rotation = ").append(getRotation()).append('\n');
|
||||||
buffer.append(" .autorotate = ").append(isAutorotate()).append('\n');
|
buffer.append(" .autorotate = ").append(isAutorotate()).append('\n');
|
||||||
|
|
||||||
buffer.append(" .tickColor = ")
|
buffer.append(" .tickColor = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getTickColor ()))
|
||||||
.append(HexDump.toHex((short)getTickColor()))
|
.append(" (").append( getTickColor() ).append(" )");
|
||||||
.append(" (").append(getTickColor()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append(" .zero3 = ")
|
buffer.append(" .zero3 = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getZero3 ()))
|
||||||
.append(HexDump.toHex((short)getZero3()))
|
.append(" (").append( getZero3() ).append(" )");
|
||||||
.append(" (").append(getZero3()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/Tick]\n");
|
buffer.append("[/TICK]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
data[ 4 + offset ] = field_1_majorTickType;
|
data[ 4 + offset + pos ] = field_1_majorTickType;
|
||||||
data[ 5 + offset ] = field_2_minorTickType;
|
data[ 5 + offset + pos ] = field_2_minorTickType;
|
||||||
data[ 6 + offset ] = field_3_labelPosition;
|
data[ 6 + offset + pos ] = field_3_labelPosition;
|
||||||
data[ 7 + offset ] = field_4_background;
|
data[ 7 + offset + pos ] = field_4_background;
|
||||||
LittleEndian.putInt(data, 8 + offset, field_5_labelColorRgb);
|
LittleEndian.putInt(data, 8 + offset + pos, field_5_labelColorRgb);
|
||||||
LittleEndian.putShort(data, 12 + offset, field_6_zero1);
|
LittleEndian.putShort(data, 12 + offset + pos, field_6_zero1);
|
||||||
LittleEndian.putShort(data, 20 + offset, field_7_zero2);
|
LittleEndian.putShort(data, 20 + offset + pos, field_7_zero2);
|
||||||
LittleEndian.putShort(data, 28 + offset, field_8_options);
|
LittleEndian.putShort(data, 28 + offset + pos, field_8_options);
|
||||||
LittleEndian.putShort(data, 30 + offset, field_9_tickColor);
|
LittleEndian.putShort(data, 30 + offset + pos, field_9_tickColor);
|
||||||
LittleEndian.putShort(data, 32 + offset, field_10_zero3);
|
LittleEndian.putShort(data, 32 + offset + pos, field_10_zero3);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -258,11 +254,12 @@ public class TickRecord
|
|||||||
rec.field_8_options = field_8_options;
|
rec.field_8_options = field_8_options;
|
||||||
rec.field_9_tickColor = field_9_tickColor;
|
rec.field_9_tickColor = field_9_tickColor;
|
||||||
rec.field_10_zero3 = field_10_zero3;
|
rec.field_10_zero3 = field_10_zero3;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the major tick type field for the Tick record.
|
* Get the major tick type field for the Tick record.
|
||||||
*/
|
*/
|
||||||
|
@ -91,6 +91,7 @@ public class UnitsRecord
|
|||||||
public UnitsRecord(short id, short size, byte [] data)
|
public UnitsRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,6 +107,7 @@ public class UnitsRecord
|
|||||||
public UnitsRecord(short id, short size, byte [] data, int offset)
|
public UnitsRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -123,7 +125,9 @@ public class UnitsRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_units = LittleEndian.getShort(data, 0x0 + offset);
|
|
||||||
|
int pos = 0;
|
||||||
|
field_1_units = LittleEndian.getShort(data, pos + 0x0 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,23 +135,24 @@ public class UnitsRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[Units]\n");
|
buffer.append("[UNITS]\n");
|
||||||
|
|
||||||
buffer.append(" .units = ")
|
buffer.append(" .units = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getUnits ()))
|
||||||
.append(HexDump.toHex((short)getUnits()))
|
.append(" (").append( getUnits() ).append(" )");
|
||||||
.append(" (").append(getUnits()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
|
|
||||||
buffer.append("[/Units]\n");
|
buffer.append("[/UNITS]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putShort(data, 4 + offset, field_1_units);
|
LittleEndian.putShort(data, 4 + offset + pos, field_1_units);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -169,11 +174,12 @@ public class UnitsRecord
|
|||||||
UnitsRecord rec = new UnitsRecord();
|
UnitsRecord rec = new UnitsRecord();
|
||||||
|
|
||||||
rec.field_1_units = field_1_units;
|
rec.field_1_units = field_1_units;
|
||||||
|
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the units field for the Units record.
|
* Get the units field for the Units record.
|
||||||
*/
|
*/
|
||||||
|
@ -105,6 +105,7 @@ public class ValueRangeRecord
|
|||||||
public ValueRangeRecord(short id, short size, byte [] data)
|
public ValueRangeRecord(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -120,6 +121,7 @@ public class ValueRangeRecord
|
|||||||
public ValueRangeRecord(short id, short size, byte [] data, int offset)
|
public ValueRangeRecord(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -137,12 +139,14 @@ public class ValueRangeRecord
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
field_1_minimumAxisValue = LittleEndian.getDouble(data, 0x0 + offset);
|
|
||||||
field_2_maximumAxisValue = LittleEndian.getDouble(data, 0x8 + offset);
|
int pos = 0;
|
||||||
field_3_majorIncrement = LittleEndian.getDouble(data, 0x10 + offset);
|
field_1_minimumAxisValue = LittleEndian.getDouble(data, pos + 0x0 + offset);
|
||||||
field_4_minorIncrement = LittleEndian.getDouble(data, 0x18 + offset);
|
field_2_maximumAxisValue = LittleEndian.getDouble(data, pos + 0x8 + offset);
|
||||||
field_5_categoryAxisCross = LittleEndian.getDouble(data, 0x20 + offset);
|
field_3_majorIncrement = LittleEndian.getDouble(data, pos + 0x10 + offset);
|
||||||
field_6_options = LittleEndian.getShort(data, 0x28 + offset);
|
field_4_minorIncrement = LittleEndian.getDouble(data, pos + 0x18 + offset);
|
||||||
|
field_5_categoryAxisCross = LittleEndian.getDouble(data, pos + 0x20 + offset);
|
||||||
|
field_6_options = LittleEndian.getShort(data, pos + 0x28 + offset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,27 +154,26 @@ public class ValueRangeRecord
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[ValueRange]\n");
|
buffer.append("[VALUERANGE]\n");
|
||||||
|
|
||||||
buffer.append(" .minimumAxisValue = ")
|
buffer.append(" .minimumAxisValue = ")
|
||||||
.append(" (").append(getMinimumAxisValue()).append(" )\n");
|
.append(" (").append( getMinimumAxisValue() ).append(" )");
|
||||||
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .maximumAxisValue = ")
|
buffer.append(" .maximumAxisValue = ")
|
||||||
.append(" (").append(getMaximumAxisValue()).append(" )\n");
|
.append(" (").append( getMaximumAxisValue() ).append(" )");
|
||||||
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .majorIncrement = ")
|
buffer.append(" .majorIncrement = ")
|
||||||
.append(" (").append(getMajorIncrement()).append(" )\n");
|
.append(" (").append( getMajorIncrement() ).append(" )");
|
||||||
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .minorIncrement = ")
|
buffer.append(" .minorIncrement = ")
|
||||||
.append(" (").append(getMinorIncrement()).append(" )\n");
|
.append(" (").append( getMinorIncrement() ).append(" )");
|
||||||
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .categoryAxisCross = ")
|
buffer.append(" .categoryAxisCross = ")
|
||||||
.append(" (").append(getCategoryAxisCross()).append(" )\n");
|
.append(" (").append( getCategoryAxisCross() ).append(" )");
|
||||||
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .options = ")
|
buffer.append(" .options = ")
|
||||||
.append("0x")
|
.append("0x").append(HexDump.toHex( getOptions ()))
|
||||||
.append(HexDump.toHex((short)getOptions()))
|
.append(" (").append( getOptions() ).append(" )");
|
||||||
.append(" (").append(getOptions()).append(" )\n");
|
buffer.append(System.getProperty("line.separator"));
|
||||||
buffer.append(" .automaticMinimum = ").append(isAutomaticMinimum()).append('\n');
|
buffer.append(" .automaticMinimum = ").append(isAutomaticMinimum()).append('\n');
|
||||||
buffer.append(" .automaticMaximum = ").append(isAutomaticMaximum()).append('\n');
|
buffer.append(" .automaticMaximum = ").append(isAutomaticMaximum()).append('\n');
|
||||||
buffer.append(" .automaticMajor = ").append(isAutomaticMajor()).append('\n');
|
buffer.append(" .automaticMajor = ").append(isAutomaticMajor()).append('\n');
|
||||||
@ -181,21 +184,23 @@ public class ValueRangeRecord
|
|||||||
buffer.append(" .crossCategoryAxisAtMaximum = ").append(isCrossCategoryAxisAtMaximum()).append('\n');
|
buffer.append(" .crossCategoryAxisAtMaximum = ").append(isCrossCategoryAxisAtMaximum()).append('\n');
|
||||||
buffer.append(" .reserved = ").append(isReserved()).append('\n');
|
buffer.append(" .reserved = ").append(isReserved()).append('\n');
|
||||||
|
|
||||||
buffer.append("[/ValueRange]\n");
|
buffer.append("[/VALUERANGE]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
|
|
||||||
LittleEndian.putDouble(data, 4 + offset, field_1_minimumAxisValue);
|
LittleEndian.putDouble(data, 4 + offset + pos, field_1_minimumAxisValue);
|
||||||
LittleEndian.putDouble(data, 12 + offset, field_2_maximumAxisValue);
|
LittleEndian.putDouble(data, 12 + offset + pos, field_2_maximumAxisValue);
|
||||||
LittleEndian.putDouble(data, 20 + offset, field_3_majorIncrement);
|
LittleEndian.putDouble(data, 20 + offset + pos, field_3_majorIncrement);
|
||||||
LittleEndian.putDouble(data, 28 + offset, field_4_minorIncrement);
|
LittleEndian.putDouble(data, 28 + offset + pos, field_4_minorIncrement);
|
||||||
LittleEndian.putDouble(data, 36 + offset, field_5_categoryAxisCross);
|
LittleEndian.putDouble(data, 36 + offset + pos, field_5_categoryAxisCross);
|
||||||
LittleEndian.putShort(data, 44 + offset, field_6_options);
|
LittleEndian.putShort(data, 44 + offset + pos, field_6_options);
|
||||||
|
|
||||||
return getRecordSize();
|
return getRecordSize();
|
||||||
}
|
}
|
||||||
@ -213,6 +218,20 @@ public class ValueRangeRecord
|
|||||||
return this.sid;
|
return this.sid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Object clone() {
|
||||||
|
ValueRangeRecord rec = new ValueRangeRecord();
|
||||||
|
|
||||||
|
rec.field_1_minimumAxisValue = field_1_minimumAxisValue;
|
||||||
|
rec.field_2_maximumAxisValue = field_2_maximumAxisValue;
|
||||||
|
rec.field_3_majorIncrement = field_3_majorIncrement;
|
||||||
|
rec.field_4_minorIncrement = field_4_minorIncrement;
|
||||||
|
rec.field_5_categoryAxisCross = field_5_categoryAxisCross;
|
||||||
|
rec.field_6_options = field_6_options;
|
||||||
|
return rec;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the minimum axis value field for the ValueRange record.
|
* Get the minimum axis value field for the ValueRange record.
|
||||||
|
@ -59,57 +59,56 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.poi.hssf.usermodel;
|
package org.apache.poi.hssf.usermodel;
|
||||||
|
|
||||||
import java.util.Vector;
|
import org.apache.poi.hssf.model.Workbook;
|
||||||
|
import org.apache.poi.hssf.record.FormatRecord;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ListIterator;
|
import java.util.ListIterator;
|
||||||
import java.util.Iterator;
|
import java.util.Vector;
|
||||||
|
|
||||||
import org.apache.poi.hssf.model.Workbook;
|
|
||||||
import org.apache.poi.hssf.record.Record;
|
|
||||||
import org.apache.poi.hssf.record.FormatRecord;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility to identify builin formats. Now can handle user defined data formats also. The following is a list of the formats as
|
* Utility to identify builin formats. Now can handle user defined data formats also. The following is a list of the formats as
|
||||||
* returned by this class.<P>
|
* returned by this class.<P>
|
||||||
*<P>
|
*<P>
|
||||||
* 0, "General"<P>
|
* 0, "General"<br>
|
||||||
* 1, "0"<P>
|
* 1, "0"<br>
|
||||||
* 2, "0.00"<P>
|
* 2, "0.00"<br>
|
||||||
* 3, "#,##0"<P>
|
* 3, "#,##0"<br>
|
||||||
* 4, "#,##0.00"<P>
|
* 4, "#,##0.00"<br>
|
||||||
* 5, "($#,##0_);($#,##0)"<P>
|
* 5, "($#,##0_);($#,##0)"<br>
|
||||||
* 6, "($#,##0_);[Red]($#,##0)"<P>
|
* 6, "($#,##0_);[Red]($#,##0)"<br>
|
||||||
* 7, "($#,##0.00);($#,##0.00)"<P>
|
* 7, "($#,##0.00);($#,##0.00)"<br>
|
||||||
* 8, "($#,##0.00_);[Red]($#,##0.00)"<P>
|
* 8, "($#,##0.00_);[Red]($#,##0.00)"<br>
|
||||||
* 9, "0%"<P>
|
* 9, "0%"<br>
|
||||||
* 0xa, "0.00%"<P>
|
* 0xa, "0.00%"<br>
|
||||||
* 0xb, "0.00E+00"<P>
|
* 0xb, "0.00E+00"<br>
|
||||||
* 0xc, "# ?/?"<P>
|
* 0xc, "# ?/?"<br>
|
||||||
* 0xd, "# ??/??"<P>
|
* 0xd, "# ??/??"<br>
|
||||||
* 0xe, "m/d/yy"<P>
|
* 0xe, "m/d/yy"<br>
|
||||||
* 0xf, "d-mmm-yy"<P>
|
* 0xf, "d-mmm-yy"<br>
|
||||||
* 0x10, "d-mmm"<P>
|
* 0x10, "d-mmm"<br>
|
||||||
* 0x11, "mmm-yy"<P>
|
* 0x11, "mmm-yy"<br>
|
||||||
* 0x12, "h:mm AM/PM"<P>
|
* 0x12, "h:mm AM/PM"<br>
|
||||||
* 0x13, "h:mm:ss AM/PM"<P>
|
* 0x13, "h:mm:ss AM/PM"<br>
|
||||||
* 0x14, "h:mm"<P>
|
* 0x14, "h:mm"<br>
|
||||||
* 0x15, "h:mm:ss"<P>
|
* 0x15, "h:mm:ss"<br>
|
||||||
* 0x16, "m/d/yy h:mm"<P>
|
* 0x16, "m/d/yy h:mm"<br>
|
||||||
*<P>
|
*<P>
|
||||||
* // 0x17 - 0x24 reserved for international and undocumented
|
* // 0x17 - 0x24 reserved for international and undocumented<br>
|
||||||
* 0x25, "(#,##0_);(#,##0)"<P>
|
* 0x25, "(#,##0_);(#,##0)"<br>
|
||||||
* 0x26, "(#,##0_);[Red](#,##0)"<P>
|
* 0x26, "(#,##0_);[Red](#,##0)"<br>
|
||||||
* 0x27, "(#,##0.00_);(#,##0.00)"<P>
|
* 0x27, "(#,##0.00_);(#,##0.00)"<br>
|
||||||
* 0x28, "(#,##0.00_);[Red](#,##0.00)"<P>
|
* 0x28, "(#,##0.00_);[Red](#,##0.00)"<br>
|
||||||
* 0x29, "_(*#,##0_);_(*(#,##0);_(* \"-\"_);_(@_)"<P>
|
* 0x29, "_(*#,##0_);_(*(#,##0);_(* \"-\"_);_(@_)"<br>
|
||||||
* 0x2a, "_($*#,##0_);_($*(#,##0);_($* \"-\"_);_(@_)"<P>
|
* 0x2a, "_($*#,##0_);_($*(#,##0);_($* \"-\"_);_(@_)"<br>
|
||||||
* 0x2b, "_(*#,##0.00_);_(*(#,##0.00);_(*\"-\"??_);_(@_)"<P>
|
* 0x2b, "_(*#,##0.00_);_(*(#,##0.00);_(*\"-\"??_);_(@_)"<br>
|
||||||
* 0x2c, "_($*#,##0.00_);_($*(#,##0.00);_($*\"-\"??_);_(@_)"<P>
|
* 0x2c, "_($*#,##0.00_);_($*(#,##0.00);_($*\"-\"??_);_(@_)"<br>
|
||||||
* 0x2d, "mm:ss"<P>
|
* 0x2d, "mm:ss"<br>
|
||||||
* 0x2e, "[h]:mm:ss"<P>
|
* 0x2e, "[h]:mm:ss"<br>
|
||||||
* 0x2f, "mm:ss.0"<P>
|
* 0x2f, "mm:ss.0"<br>
|
||||||
* 0x30, "##0.0E+0"<P>
|
* 0x30, "##0.0E+0"<br>
|
||||||
* 0x31, "@"<P>
|
* 0x31, "@"<br>
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @author Andrew C. Oliver (acoliver at apache dot org)
|
* @author Andrew C. Oliver (acoliver at apache dot org)
|
||||||
@ -131,13 +130,16 @@ public class HSSFDataFormat
|
|||||||
* access to the workbooks format records.
|
* access to the workbooks format records.
|
||||||
* @param workbook the workbook the formats are tied to.
|
* @param workbook the workbook the formats are tied to.
|
||||||
*/
|
*/
|
||||||
public HSSFDataFormat(Workbook workbook) {
|
public HSSFDataFormat( Workbook workbook )
|
||||||
|
{
|
||||||
this.workbook = workbook;
|
this.workbook = workbook;
|
||||||
if ( builtinFormats == null ) populateBuiltinFormats();
|
if ( builtinFormats == null ) populateBuiltinFormats();
|
||||||
Iterator i = workbook.getFormats().iterator();
|
Iterator i = workbook.getFormats().iterator();
|
||||||
while (i.hasNext()) {
|
while ( i.hasNext() )
|
||||||
|
{
|
||||||
FormatRecord r = (FormatRecord) i.next();
|
FormatRecord r = (FormatRecord) i.next();
|
||||||
if (formats.size() < r.getIndexCode() + 1) {
|
if ( formats.size() < r.getIndexCode() + 1 )
|
||||||
|
{
|
||||||
formats.setSize( r.getIndexCode() + 1 );
|
formats.setSize( r.getIndexCode() + 1 );
|
||||||
}
|
}
|
||||||
formats.set( r.getIndexCode(), r.getFormatString() );
|
formats.set( r.getIndexCode(), r.getFormatString() );
|
||||||
@ -252,16 +254,19 @@ public class HSSFDataFormat
|
|||||||
{
|
{
|
||||||
ListIterator i;
|
ListIterator i;
|
||||||
int ind;
|
int ind;
|
||||||
if (!movedBuiltins) {
|
if ( !movedBuiltins )
|
||||||
|
{
|
||||||
i = builtinFormats.listIterator();
|
i = builtinFormats.listIterator();
|
||||||
while (i.hasNext()) {
|
while ( i.hasNext() )
|
||||||
|
{
|
||||||
ind = i.nextIndex();
|
ind = i.nextIndex();
|
||||||
formats.add( ind, i.next() );
|
formats.add( ind, i.next() );
|
||||||
}
|
}
|
||||||
movedBuiltins = true;
|
movedBuiltins = true;
|
||||||
}
|
}
|
||||||
i = formats.listIterator();
|
i = formats.listIterator();
|
||||||
while (i.hasNext()) {
|
while ( i.hasNext() )
|
||||||
|
{
|
||||||
ind = i.nextIndex();
|
ind = i.nextIndex();
|
||||||
if ( format.equals( i.next() ) )
|
if ( format.equals( i.next() ) )
|
||||||
return (short) ind;
|
return (short) ind;
|
||||||
@ -286,7 +291,9 @@ public class HSSFDataFormat
|
|||||||
if ( movedBuiltins )
|
if ( movedBuiltins )
|
||||||
return (String) formats.get( index );
|
return (String) formats.get( index );
|
||||||
else
|
else
|
||||||
return (String) (builtinFormats.size() > index && builtinFormats.get(index) != null ? builtinFormats.get(index) : formats.get(index));
|
return (String) ( builtinFormats.size() > index
|
||||||
|
&& builtinFormats.get( index ) != null
|
||||||
|
? builtinFormats.get( index ) : formats.get( index ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<record id="0x100a" name="AreaFormat" package="org.apache.poi.hssf.record">
|
<record id="0x100a" name="AreaFormat" excel-record-id="AREAFORMAT" package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The area format record is used to define the colours and patterns for an area.</description>
|
<description>The area format record is used to define the colours and patterns for an area.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x101A" name="Area" package="org.apache.poi.hssf.record">
|
<record id="0x101A" name="Area" excel-record-id="AREA"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The area record is used to define a area chart.</description>
|
<description>The area record is used to define a area chart.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x100c" name="SeriesLabels" package="org.apache.poi.hssf.record">
|
<record id="0x100c" name="SeriesLabels" excel-record-id="ATTACHEDLABEL"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The series label record defines the type of label associated with the data format record.</description>
|
<description>The series label record defines the type of label associated with the data format record.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1046" name="AxisUsed" package="org.apache.poi.hssf.record">
|
<record id="0x1046" name="AxisUsed" excel-record-id="AXISUSED"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The number of axes used on a chart.</description>
|
<description>The number of axes used on a chart.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1021" name="AxisLineFormat" package="org.apache.poi.hssf.record">
|
<record id="0x1021" name="AxisLineFormat" excel-record-id="AXISLINEFORMAT"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The axis line format record defines the axis type details.</description>
|
<description>The axis line format record defines the axis type details.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1062" name="AxisOptions" package="org.apache.poi.hssf.record">
|
<record id="0x1062" name="AxisOptions" excel-record-id="AXCEXT"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The axis options record provides unit information and other various tidbits about the axis.</description>
|
<description>The axis options record provides unit information and other various tidbits about the axis.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1041" name="AxisParent" package="org.apache.poi.hssf.record">
|
<record id="0x1041" name="AxisParent" excel-record-id="AXISPARENT"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The axis size and location</description>
|
<description>The axis size and location</description>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<record id="0x101d" name="Axis" package="org.apache.poi.hssf.record">
|
<record id="0x101d" name="Axis" excel-record-id="AXIS" package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The axis record defines the type of an axis.</description>
|
<description>The axis record defines the type of an axis.</description>
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
<record id="0x1017" name="Bar" package="org.apache.poi.hssf.record">
|
<record id="0x1017" name="Bar" excel-record-id="BAR"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The bar record is used to define a bar chart.</description>
|
<description>The bar record is used to define a bar chart.</description>
|
||||||
<author>Glen Stampoultzis (glens at apache.org)</author>
|
<author>Glen Stampoultzis (glens at apache.org)</author>
|
||||||
<fields>
|
<fields>
|
||||||
<field type="int" size="2" name="bar space" description="space between bars"/>
|
<field type="int" size="2" name="bar space" description="space between bars"/>
|
||||||
<field type="int" size="2" name="category space" default="50" description="space between categories"/>
|
<field type="int" size="2" name="category space" description="space between categories"/>
|
||||||
<field type="int" size="2" name="format flags">
|
<field type="int" size="2" name="format flags">
|
||||||
<bit number="0" name="horizontal" description="true to display horizontal bar charts, false for vertical"/>
|
<bit number="0" name="horizontal" description="true to display horizontal bar charts, false for vertical"/>
|
||||||
<bit number="1" name="stacked" description="stack displayed values"/>
|
<bit number="1" name="stacked" description="stack displayed values"/>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1020" name="CategorySeriesAxis" package="org.apache.poi.hssf.record">
|
<record id="0x1020" name="CategorySeriesAxis" excel-record-id="CATSERRANGE"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>This record refers to a category or series axis and is used to specify label/tickmark frequency.</description>
|
<description>This record refers to a category or series axis and is used to specify label/tickmark frequency.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1002" name="Chart" package="org.apache.poi.hssf.record">
|
<record id="0x1002" name="Chart" excel-record-id="CHART"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The chart record is used to define the location and size of a chart.</description>
|
<description>The chart record is used to define the location and size of a chart.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1063" name="Dat" package="org.apache.poi.hssf.record">
|
<record id="0x1063" name="Dat" excel-record-id="DAT"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The dat record is used to store options for the chart.</description>
|
<description>The dat record is used to store options for the chart.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1006" name="DataFormat" package="org.apache.poi.hssf.record">
|
<record id="0x1006" name="DataFormat" excel-record-id="DATAFORMAT"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The data format record is used to index into a series.</description>
|
<description>The data format record is used to index into a series.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1024" name="DefaultDataLabelTextProperties" package="org.apache.poi.hssf.record">
|
<record id="0x1024" name="DefaultDataLabelTextProperties"
|
||||||
|
excel-record-id="DEFAULTTEXT" package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The default data label text properties record identifies the text characteristics of the preceeding text record.</description>
|
<description>The default data label text properties record identifies the text characteristics of the preceeding text record.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1060" name="FontBasis" package="org.apache.poi.hssf.record">
|
<record id="0x1060" name="FontBasis" excel-record-id="FBI"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The font basis record stores various font metrics.</description>
|
<description>The font basis record stores various font metrics.</description>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<record id="0x31" name="Font" package="org.apache.poi.hssf.records">
|
<record id="0x31" name="Font" excel-record-id="FONT" package="org.apache.poi.hssf.records">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>Describes a font record. In Excel a font belongs in the font table.</description>
|
<description>Describes a font record. In Excel a font belongs in the font table.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1026" name="FontIndex" package="org.apache.poi.hssf.record">
|
<record id="0x1026" name="FontIndex" excel-record-id="FONTX"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The font index record indexes into the font table for the text record.</description>
|
<description>The font index record indexes into the font table for the text record.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1032" name="Frame" package="org.apache.poi.hssf.record">
|
<record id="0x1032" name="Frame" excel-record-id="FRAME"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The frame record indicates whether there is a border around the displayed text of a chart.</description>
|
<description>The frame record indicates whether there is a border around the displayed text of a chart.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1015" name="Legend" package="org.apache.poi.hssf.record">
|
<record id="0x1015" name="Legend" excel-record-id="LEGEND"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>Defines a legend for a chart.</description>
|
<description>Defines a legend for a chart.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1007" name="LineFormat" package="org.apache.poi.hssf.record">
|
<record id="0x1007" name="LineFormat" excel-record-id="LINEFORMAT"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>Describes a line format record. The line format record controls how a line on a chart appears.</description>
|
<description>Describes a line format record. The line format record controls how a line on a chart appears.</description>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<record id="0x1051" name="LinkedData" package="org.apache.poi.hssf.record">
|
<record id="0x1051" name="LinkedData" excel-record-id="AI" package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>Describes a linked data record. This record referes to the series data or text.</description>
|
<description>Describes a linked data record. This record referes to the series data or text.</description>
|
||||||
@ -20,6 +20,7 @@
|
|||||||
<bit number="0" name="custom number format" description="true if this object has a custom number format"/>
|
<bit number="0" name="custom number format" description="true if this object has a custom number format"/>
|
||||||
</field>
|
</field>
|
||||||
<field type="int" size="2" name="index number fmt record"/>
|
<field type="int" size="2" name="index number fmt record"/>
|
||||||
<field type="int" size="2" name="formula of link" description="not supported"/>
|
<field type="custom:org.apache.poi.hssf.record.LinkedDataFormulaField"
|
||||||
|
size="var" name="formula of link" description="formula"/>
|
||||||
</fields>
|
</fields>
|
||||||
</record>
|
</record>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x104e" name="NumberFormatIndex" package="org.apache.poi.hssf.record">
|
<record id="0x104e" name="NumberFormatIndex" excel-record-id="IFMT"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The number format index record indexes format table. This applies to an axis.</description>
|
<description>The number format index record indexes format table. This applies to an axis.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1027" name="ObjectLink" package="org.apache.poi.hssf.record">
|
<record id="0x1027" name="ObjectLink" excel-record-id="OBJECTLINK"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>Links text to an object on the chart or identifies it as the title.</description>
|
<description>Links text to an object on the chart or identifies it as the title.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1035" name="PlotArea" package="org.apache.poi.hssf.record">
|
<record id="0x1035" name="PlotArea" excel-record-id="PLOTAREA"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>preceeds and identifies a frame as belonging to the plot area.</description>
|
<description>preceeds and identifies a frame as belonging to the plot area.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1064" name="PlotGrowth" package="org.apache.poi.hssf.record">
|
<record id="0x1064" name="PlotGrowth" excel-record-id="PLOTGROWTH"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The plot growth record specifies the scaling factors used when a font is scaled.</description>
|
<description>The plot growth record specifies the scaling factors used when a font is scaled.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1045" name="SeriesChartGroupIndex" package="org.apache.poi.hssf.record">
|
<record id="0x1045" name="SeriesChartGroupIndex" excel-record-id="SERTOCRT"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The series chart group index record stores the index to the CHARTFORMAT record (0 based).</description>
|
<description>The series chart group index record stores the index to the CHARTFORMAT record (0 based).</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1065" name="SeriesIndex" package="org.apache.poi.hssf.record">
|
<record id="0x1065" name="SeriesIndex" excel-record-id="SINDEX"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>links a series to its position in the series list.</description>
|
<description>links a series to its position in the series list.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x1016" name="SeriesList" package="org.apache.poi.hssf.record">
|
<record id="0x1016" name="SeriesList" excel-record-id="SERIESLIST"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The series list record defines the series displayed as an overlay to the main chart record.</description>
|
<description>The series list record defines the series displayed as an overlay to the main chart record.</description>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<record id="0x1003" name="Series" package="org.apache.poi.hssf.record">
|
<record id="0x1003" name="Series" excel-record-id="SERIES" package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The series record describes the overall data for a series.</description>
|
<description>The series record describes the overall data for a series.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x100d" name="SeriesText" package="org.apache.poi.hssf.record">
|
<record id="0x100d" name="SeriesText" excel-record-id="SERIESTEXT"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>Defines a series name</description>
|
<description>Defines a series name</description>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<record id="0x1044" name="SheetProperties" package="org.apache.poi.hssf.record">
|
<record id="0x1044" name="SheetProperties" excel-record-id="SHTPROPS" package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>Describes a chart sheet properties record.</description>
|
<description>Describes a chart sheet properties record.</description>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<record id="0x1025" name="Text" package="org.apache.poi.hssf.record">
|
<record id="0x1025" name="Text" excel-record-id="TEXT" package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The text record is used to define text stored on a chart.</description>
|
<description>The text record is used to define text stored on a chart.</description>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<record id="0x101e" name="Tick" package="org.apache.poi.hssf.record">
|
<record id="0x101e" name="Tick" excel-record-id="TICK" package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The Tick record defines how tick marks and label positioning/formatting</description>
|
<description>The Tick record defines how tick marks and label positioning/formatting</description>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<record id="0x1001" name="Units" package="org.apache.poi.hssf.record">
|
<record id="0x1001" name="Units" excel-record-id="UNITS" package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The units record describes units.</description>
|
<description>The units record describes units.</description>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<record id="0x101f" name="ValueRange" package="org.apache.poi.hssf.record">
|
<record id="0x101f" name="ValueRange" excel-record-id="VALUERANGE"
|
||||||
|
package="org.apache.poi.hssf.record">
|
||||||
<suffix>Record</suffix>
|
<suffix>Record</suffix>
|
||||||
<extends>Record</extends>
|
<extends>Record</extends>
|
||||||
<description>The value range record defines the range of the value axis.</description>
|
<description>The value range record defines the range of the value axis.</description>
|
||||||
|
@ -76,7 +76,7 @@ public class <xsl:value-of select="@name"/>Record
|
|||||||
extends Record
|
extends Record
|
||||||
{
|
{
|
||||||
public final static short sid = <xsl:value-of select="@id"/>;
|
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: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:value-of select="recutil:initializeText(@size,@type)"/>;
|
||||||
<xsl:apply-templates select="./bit|./const|./bit/const"/>
|
<xsl:apply-templates select="./bit|./const|./bit/const"/>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
|
|
||||||
@ -100,6 +100,14 @@ public class <xsl:value-of select="@name"/>Record
|
|||||||
public <xsl:value-of select="@name"/>Record(short id, short size, byte [] data)
|
public <xsl:value-of select="@name"/>Record(short id, short size, byte [] data)
|
||||||
{
|
{
|
||||||
super(id, size, data);
|
super(id, size, data);
|
||||||
|
<xsl:for-each select="//fields/field">
|
||||||
|
<xsl:if test="@default">
|
||||||
|
<xsl:text> </xsl:text>
|
||||||
|
<xsl:value-of select="recutil:getFieldName(position(),@name,0)"/> =
|
||||||
|
<xsl:value-of select="@default"/>;
|
||||||
|
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:for-each>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -115,6 +123,14 @@ public class <xsl:value-of select="@name"/>Record
|
|||||||
public <xsl:value-of select="@name"/>Record(short id, short size, byte [] data, int offset)
|
public <xsl:value-of select="@name"/>Record(short id, short size, byte [] data, int offset)
|
||||||
{
|
{
|
||||||
super(id, size, data, offset);
|
super(id, size, data, offset);
|
||||||
|
<xsl:for-each select="//fields/field">
|
||||||
|
<xsl:if test="@default">
|
||||||
|
<xsl:text> </xsl:text>
|
||||||
|
<xsl:value-of select="recutil:getFieldName(position(),@name,0)"/> =
|
||||||
|
<xsl:value-of select="@default"/>;
|
||||||
|
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:for-each>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -132,9 +148,13 @@ public class <xsl:value-of select="@name"/>Record
|
|||||||
|
|
||||||
protected void fillFields(byte [] data, short size, int offset)
|
protected void fillFields(byte [] data, short size, int offset)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
<xsl:text> int pos = 0;
|
||||||
|
</xsl:text>
|
||||||
|
|
||||||
<xsl:variable name="fieldIterator" select="field:new()"/>
|
<xsl:variable name="fieldIterator" select="field:new()"/>
|
||||||
<xsl:for-each select="//fields/field">
|
<xsl:for-each select="//fields/field">
|
||||||
<xsl:text> </xsl:text><xsl:value-of select="recutil:getFieldName(position(),@name,30)"/> = <xsl:value-of select="field:fillDecoder($fieldIterator,@size,@type)"/>;
|
<xsl:text> </xsl:text><xsl:value-of select="field:fillDecoder2($fieldIterator,position(),@name,@size,@type)"/>;
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,14 +162,16 @@ public class <xsl:value-of select="@name"/>Record
|
|||||||
{
|
{
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
|
||||||
buffer.append("[<xsl:value-of select="@name"/>]\n");
|
buffer.append("[<xsl:value-of select="recutil:getRecordId(@name,@excel-record-id)"/>]\n");
|
||||||
<xsl:apply-templates select="//field" mode="tostring"/>
|
<xsl:apply-templates select="//field" mode="tostring"/>
|
||||||
buffer.append("[/<xsl:value-of select="@name"/>]\n");
|
buffer.append("[/<xsl:value-of select="recutil:getRecordId(@name,@excel-record-id)"/>]\n");
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int serialize(int offset, byte[] data)
|
public int serialize(int offset, byte[] data)
|
||||||
{
|
{
|
||||||
|
int pos = 0;
|
||||||
|
|
||||||
LittleEndian.putShort(data, 0 + offset, sid);
|
LittleEndian.putShort(data, 0 + offset, sid);
|
||||||
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
|
||||||
<xsl:variable name="fieldIterator" select="field:new()"/>
|
<xsl:variable name="fieldIterator" select="field:new()"/>
|
||||||
@ -179,9 +201,10 @@ public class <xsl:value-of select="@name"/>Record
|
|||||||
|
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
<xsl:value-of select="@name"/>Record rec = new <xsl:value-of select="@name"/>Record();
|
<xsl:value-of select="@name"/>Record rec = new <xsl:value-of select="@name"/>Record();
|
||||||
|
<xsl:for-each select="//fields/field">
|
||||||
<xsl:for-each select="//fields/field"><xsl:text> rec.</xsl:text><xsl:value-of select="recutil:getFieldName(position(),@name,0)"/><xsl:text> = </xsl:text><xsl:value-of select="recutil:getFieldName(position(),@name,0)"/><xsl:text>;
|
<xsl:text>
|
||||||
</xsl:text></xsl:for-each>
|
</xsl:text><xsl:value-of select="recutil:clone(@name,@type,position())"/><xsl:text>;</xsl:text>
|
||||||
|
</xsl:for-each>
|
||||||
return rec;
|
return rec;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,17 +299,27 @@ public class <xsl:value-of select="@name"/>Record
|
|||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="field" mode="tostring">
|
<xsl:template match="field" mode="tostring">
|
||||||
buffer.append(" .<xsl:value-of select="recutil:getFieldName(@name,20)"/> = ")<xsl:choose><xsl:when test="@type != 'string' and @type != 'hbstring' and @type != 'float' and @size != 'varword'">
|
<xsl:value-of select="recutil:getToString(@name,@type,@size)"/>
|
||||||
.append("0x")
|
<xsl:text>
|
||||||
.append(HexDump.toHex((<xsl:value-of select="recutil:getType(@size,@type,00)"/>)get<xsl:value-of select="recutil:getFieldName1stCap(@name,0)"/>()))</xsl:when></xsl:choose>
|
buffer.append(System.getProperty("line.separator")); </xsl:text>
|
||||||
.append(" (").append(get<xsl:value-of select="recutil:getFieldName1stCap(@name,0)"/>()).append(" )\n");
|
|
||||||
<xsl:apply-templates select="bit" mode="bittostring"/>
|
<xsl:apply-templates select="bit" mode="bittostring"/>
|
||||||
|
<xsl:text> </xsl:text>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="bit" mode="bittostring">
|
<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 test="not (@mask)">
|
||||||
|
<xsl:text> buffer.append(" .</xsl:text>
|
||||||
|
<xsl:value-of select="recutil:getFieldName(@name,20)"/>
|
||||||
|
<xsl:text> = ").append(is</xsl:text>
|
||||||
|
<xsl:value-of select="recutil:getFieldName1stCap(@name,0)"/>
|
||||||
|
<xsl:text>()).append('\n'); </xsl:text>
|
||||||
</xsl:if>
|
</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 test="@mask">
|
||||||
|
<xsl:text> buffer.append(" .</xsl:text>
|
||||||
|
<xsl:value-of select="recutil:getFieldName(@name,20)"/>
|
||||||
|
<xsl:text> = ").append(get</xsl:text>
|
||||||
|
<xsl:value-of select="recutil:getFieldName1stCap(@name,0)"/>
|
||||||
|
<xsl:text>()).append('\n'); </xsl:text>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
package org.apache.poi.generator;
|
package org.apache.poi.generator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For iterating through our fields. Todo: Change this to javascript in the style sheet.
|
* For iterating through our fields.
|
||||||
*
|
*
|
||||||
* @author Glen Stampoultzis (glens at apache.org)
|
* @author Glen Stampoultzis (glens at apache.org)
|
||||||
*/
|
*/
|
||||||
@ -86,19 +86,19 @@ public class FieldIterator
|
|||||||
|
|
||||||
String result = "";
|
String result = "";
|
||||||
if (javaType.equals("short"))
|
if (javaType.equals("short"))
|
||||||
result = "LittleEndian.getShort(data, 0x" + Integer.toHexString(offset) + " + offset)";
|
result = "LittleEndian.getShort(data, pos + 0x" + Integer.toHexString(offset) + " + offset)";
|
||||||
else if (javaType.equals("short[]"))
|
else if (javaType.equals("short[]"))
|
||||||
result = "LittleEndian.getShortArray(data, 0x" + Integer.toHexString(offset) + " + offset)";
|
result = "LittleEndian.getShortArray(data, pos + 0x" + Integer.toHexString(offset) + " + offset)";
|
||||||
else if (javaType.equals("int"))
|
else if (javaType.equals("int"))
|
||||||
result = "LittleEndian.getInt(data, 0x" + Integer.toHexString(offset) + " + offset)";
|
result = "LittleEndian.getInt(data, pos + 0x" + Integer.toHexString(offset) + " + offset)";
|
||||||
else if (javaType.equals("byte"))
|
else if (javaType.equals("byte"))
|
||||||
result = "data[ 0x" + Integer.toHexString(offset) + " + offset ]";
|
result = "data[ pos + 0x" + Integer.toHexString(offset) + " + offset ]";
|
||||||
else if (javaType.equals("double"))
|
else if (javaType.equals("double"))
|
||||||
result = "LittleEndian.getDouble(data, 0x" + Integer.toHexString(offset) + " + offset)";
|
result = "LittleEndian.getDouble(data, pos + 0x" + Integer.toHexString(offset) + " + offset)";
|
||||||
else if (javaType.equals("String") && !type.equals("hbstring"))
|
else if (javaType.equals("String") && !type.equals("hbstring"))
|
||||||
result = "StringUtil.getFromUnicode(data, 0x" + Integer.toHexString(offset) + " + offset,("+ size + "-1)/2)";
|
result = "StringUtil.getFromUnicode(data, pos + 0x" + Integer.toHexString(offset) + " + offset,("+ size + "-1)/2)";
|
||||||
else if (javaType.equals("String") && type.equals("hbstring"))
|
else if (javaType.equals("String") && type.equals("hbstring"))
|
||||||
result = "StringUtil.getFromUnicodeHigh(data, 0x" + Integer.toHexString(offset) + " + offset, ("+ size+"/2))";
|
result = "StringUtil.getFromUnicodeHigh(data, pos + 0x" + Integer.toHexString(offset) + " + offset, ("+ size+"/2))";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -110,6 +110,30 @@ public class FieldIterator
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String fillDecoder2(int position, String name, String size, String type)
|
||||||
|
{
|
||||||
|
if (type.startsWith("custom:"))
|
||||||
|
{
|
||||||
|
StringBuffer result = new StringBuffer();
|
||||||
|
result.append( RecordUtil.getFieldName( position, name, 0 ) );
|
||||||
|
result.append( " = new " );
|
||||||
|
String javaType = type.substring( 7 );
|
||||||
|
result.append(javaType);
|
||||||
|
result.append( "();\n");
|
||||||
|
result.append( " pos += " );
|
||||||
|
result.append(RecordUtil.getFieldName(position, name, 0))
|
||||||
|
.append(".fillField(data,size,pos + ")
|
||||||
|
.append(offset)
|
||||||
|
.append(")");
|
||||||
|
return result.toString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return RecordUtil.getFieldName(position, name, 30) +
|
||||||
|
" = " + fillDecoder(size, type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//position(),@name,@size,@type
|
//position(),@name,@size,@type
|
||||||
public String serialiseEncoder( int fieldNumber, String fieldName, String size, String type)
|
public String serialiseEncoder( int fieldNumber, String fieldName, String size, String type)
|
||||||
@ -118,20 +142,22 @@ public class FieldIterator
|
|||||||
String javaFieldName = RecordUtil.getFieldName(fieldNumber,fieldName,0);
|
String javaFieldName = RecordUtil.getFieldName(fieldNumber,fieldName,0);
|
||||||
|
|
||||||
String result = "";
|
String result = "";
|
||||||
if (javaType.equals("short"))
|
if (type.startsWith("custom:"))
|
||||||
result = "LittleEndian.putShort(data, " + (offset+4) + " + offset, " + javaFieldName + ");";
|
result = "pos += " + javaFieldName + ".serializeField( pos + offset, data );";
|
||||||
|
else if (javaType.equals("short"))
|
||||||
|
result = "LittleEndian.putShort(data, " + (offset+4) + " + offset + pos, " + javaFieldName + ");";
|
||||||
else if (javaType.equals("short[]"))
|
else if (javaType.equals("short[]"))
|
||||||
result = "LittleEndian.putShortArray(data, " + (offset+4) + " + offset, " + javaFieldName + ");";
|
result = "LittleEndian.putShortArray(data, " + (offset+4) + " + offset + pos, " + javaFieldName + ");";
|
||||||
else if (javaType.equals("int"))
|
else if (javaType.equals("int"))
|
||||||
result = "LittleEndian.putInt(data, " + (offset+4) + " + offset, " + javaFieldName + ");";
|
result = "LittleEndian.putInt(data, " + (offset+4) + " + offset + pos, " + javaFieldName + ");";
|
||||||
else if (javaType.equals("byte"))
|
else if (javaType.equals("byte"))
|
||||||
result = "data[ " + (offset+4) + " + offset ] = " + javaFieldName + ";";
|
result = "data[ " + (offset+4) + " + offset + pos ] = " + javaFieldName + ";";
|
||||||
else if (javaType.equals("double"))
|
else if (javaType.equals("double"))
|
||||||
result = "LittleEndian.putDouble(data, " + (offset+4) + " + offset, " + javaFieldName + ");";
|
result = "LittleEndian.putDouble(data, " + (offset+4) + " + offset + pos, " + javaFieldName + ");";
|
||||||
else if (javaType.equals("String") && !type.equals("hbstring"))
|
else if (javaType.equals("String") && !type.equals("hbstring"))
|
||||||
result = "StringUtil.putUncompressedUnicode("+ javaFieldName +", data, offset+4);";
|
result = "StringUtil.putUncompressedUnicode("+ javaFieldName +", data, offset + pos + 4);";
|
||||||
else if (javaType.equals("String") && type.equals("hbstring"))
|
else if (javaType.equals("String") && type.equals("hbstring"))
|
||||||
result = "StringUtil.putUncompressedUnicodeHigh("+ javaFieldName +", data, "+(offset+4)+" + offset);";
|
result = "StringUtil.putUncompressedUnicodeHigh("+ javaFieldName +", data, "+(offset+4)+" + offset + pos);";
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -148,7 +174,12 @@ public class FieldIterator
|
|||||||
public String calcSize( int fieldNumber, String fieldName, String size, String type)
|
public String calcSize( int fieldNumber, String fieldName, String size, String type)
|
||||||
{
|
{
|
||||||
String result = " + ";
|
String result = " + ";
|
||||||
if ("var".equals(size))
|
if (type.startsWith("custom:"))
|
||||||
|
{
|
||||||
|
String javaFieldName = RecordUtil.getFieldName(fieldNumber, fieldName, 0);
|
||||||
|
return result + javaFieldName + ".getSize()";
|
||||||
|
}
|
||||||
|
else if ("var".equals(size))
|
||||||
{
|
{
|
||||||
String javaFieldName = RecordUtil.getFieldName(fieldNumber,fieldName,0);
|
String javaFieldName = RecordUtil.getFieldName(fieldNumber,fieldName,0);
|
||||||
return result + " ("+javaFieldName + ".length() *2)";
|
return result + " ("+javaFieldName + ".length() *2)";
|
||||||
|
@ -64,6 +64,8 @@ import java.util.StringTokenizer;
|
|||||||
*/
|
*/
|
||||||
public class RecordUtil
|
public class RecordUtil
|
||||||
{
|
{
|
||||||
|
private static final String CR = "\n";
|
||||||
|
|
||||||
public static String getFieldName(int position, String name, int padTo)
|
public static String getFieldName(int position, String name, int padTo)
|
||||||
{
|
{
|
||||||
StringBuffer fieldName = new StringBuffer("field_" + position + "_");
|
StringBuffer fieldName = new StringBuffer("field_" + position + "_");
|
||||||
@ -99,6 +101,36 @@ public class RecordUtil
|
|||||||
return fieldName.toString();
|
return fieldName.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String clone(String name, String type, int pos) {
|
||||||
|
StringBuffer fieldName = new StringBuffer();
|
||||||
|
toIdentifier(name, fieldName);
|
||||||
|
|
||||||
|
String javaFieldName = getFieldName(pos, name, 0);
|
||||||
|
|
||||||
|
if (type.startsWith("custom:"))
|
||||||
|
{
|
||||||
|
String javaType = type.substring(7);
|
||||||
|
return "rec." + javaFieldName + " = ((" + javaType + ")" + javaFieldName + ".clone());";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "rec." + javaFieldName + " = " + javaFieldName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String initializeText(String size, String type)
|
||||||
|
{
|
||||||
|
if (type.startsWith("custom:"))
|
||||||
|
{
|
||||||
|
String javaType = type.substring( 7 );
|
||||||
|
return " = new " + javaType + "()";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void toIdentifier(String name, StringBuffer fieldName)
|
private static void toIdentifier(String name, StringBuffer fieldName)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < name.length(); i++)
|
for (int i = 0; i < name.length(); i++)
|
||||||
@ -139,7 +171,12 @@ public class RecordUtil
|
|||||||
return pad(new StringBuffer("String"), padTo).toString();
|
return pad(new StringBuffer("String"), padTo).toString();
|
||||||
else if (type.equals("hbstring"))
|
else if (type.equals("hbstring"))
|
||||||
return pad(new StringBuffer("String"), padTo).toString();
|
return pad(new StringBuffer("String"), padTo).toString();
|
||||||
|
else if (type.startsWith("custom:"))
|
||||||
|
{
|
||||||
|
int pos = type.lastIndexOf('.');
|
||||||
|
return pad(new StringBuffer(type.substring(pos+1)), padTo)
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
|
||||||
return "short"; // if we don't know, default to short
|
return "short"; // if we don't know, default to short
|
||||||
}
|
}
|
||||||
@ -202,4 +239,36 @@ public class RecordUtil
|
|||||||
return retval.toString();
|
return retval.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getToString(String fieldName, String type, String size) {
|
||||||
|
StringBuffer result = new StringBuffer();
|
||||||
|
result.append(" buffer.append(\" .");
|
||||||
|
result.append(getFieldName(fieldName, 20));
|
||||||
|
result.append(" = \")" + CR);
|
||||||
|
if (type.equals("string") == false
|
||||||
|
&& type.equals("hbstring") == false
|
||||||
|
&& type.equals("float") == false
|
||||||
|
// && type.equals("varword") == false
|
||||||
|
&& size.equals("varword") == false
|
||||||
|
&& type.startsWith("custom:") == false)
|
||||||
|
{
|
||||||
|
result.append(" .append(\"0x\")");
|
||||||
|
result.append(".append(HexDump.toHex( ");
|
||||||
|
// result.append(getType(size, type, 0));
|
||||||
|
result.append(" get");
|
||||||
|
result.append(getFieldName1stCap(fieldName, 0));
|
||||||
|
result.append(" ()))" + CR);
|
||||||
|
}
|
||||||
|
result.append(" .append(\" (\").append( get");
|
||||||
|
result.append(getFieldName1stCap(fieldName,0));
|
||||||
|
result.append("() ).append(\" )\");");
|
||||||
|
return result.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getRecordId(String recordName, String excelName)
|
||||||
|
{
|
||||||
|
if (excelName == null || excelName.equals(""))
|
||||||
|
return recordName;
|
||||||
|
else
|
||||||
|
return excelName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,12 +64,88 @@ import junit.framework.TestCase;
|
|||||||
* class works correctly. Test data taken directly from a real
|
* class works correctly. Test data taken directly from a real
|
||||||
* Excel file.
|
* Excel file.
|
||||||
*
|
*
|
||||||
|
|
||||||
* @author Glen Stampoultzis (glens at apache.org)
|
* @author Glen Stampoultzis (glens at apache.org)
|
||||||
*/
|
*/
|
||||||
public class TestLinkedDataRecord
|
public class TestLinkedDataRecord
|
||||||
extends TestCase
|
extends TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/*
|
||||||
|
Records that would appear in a simple bar chart
|
||||||
|
|
||||||
|
The first record links to the series title (linkType = 0). It's
|
||||||
|
reference type is 1 which means that it links directly to data entered
|
||||||
|
into the forumula bar. There seems to be no reference to any data
|
||||||
|
however. The formulaOfLink field contains two 0 bytes.
|
||||||
|
|
||||||
|
============================================
|
||||||
|
Offset 0xf9c (3996)
|
||||||
|
rectype = 0x1051, recsize = 0x8
|
||||||
|
-BEGIN DUMP---------------------------------
|
||||||
|
00000000 00 01 00 00 00 00 00 00 ........
|
||||||
|
-END DUMP-----------------------------------
|
||||||
|
recordid = 0x1051, size =8
|
||||||
|
[AI]
|
||||||
|
.linkType = 0x00 (0 )
|
||||||
|
.referenceType = 0x01 (1 )
|
||||||
|
.options = 0x0000 (0 )
|
||||||
|
.customNumberFormat = false
|
||||||
|
.indexNumberFmtRecord = 0x0000 (0 )
|
||||||
|
.formulaOfLink = (org.apache.poi.hssf.record.LinkedDataFormulaField@95fd19 )
|
||||||
|
[/AI]
|
||||||
|
|
||||||
|
============================================
|
||||||
|
Offset 0xfa8 (4008)
|
||||||
|
rectype = 0x1051, recsize = 0x13
|
||||||
|
-BEGIN DUMP---------------------------------
|
||||||
|
00000000 01 02 00 00 00 00 0B 00 3B 00 00 00 00 1E 00 01 ........;.......
|
||||||
|
00000010 00 01 00 ...
|
||||||
|
-END DUMP-----------------------------------
|
||||||
|
recordid = 0x1051, size =19
|
||||||
|
[AI]
|
||||||
|
.linkType = 0x01 (1 )
|
||||||
|
.referenceType = 0x02 (2 )
|
||||||
|
.options = 0x0000 (0 )
|
||||||
|
.customNumberFormat = false
|
||||||
|
.indexNumberFmtRecord = 0x0000 (0 )
|
||||||
|
.formulaOfLink = (org.apache.poi.hssf.record.LinkedDataFormulaField@11b9fb1 )
|
||||||
|
[/AI]
|
||||||
|
|
||||||
|
============================================
|
||||||
|
Offset 0xfbf (4031)
|
||||||
|
rectype = 0x1051, recsize = 0x13
|
||||||
|
-BEGIN DUMP---------------------------------
|
||||||
|
00000000 02 02 00 00 69 01 0B 00 3B 00 00 00 00 1F 00 00 ....i...;.......
|
||||||
|
00000010 00 00 00 ...
|
||||||
|
-END DUMP-----------------------------------
|
||||||
|
recordid = 0x1051, size =19
|
||||||
|
[AI]
|
||||||
|
.linkType = 0x02 (2 )
|
||||||
|
.referenceType = 0x02 (2 )
|
||||||
|
.options = 0x0000 (0 )
|
||||||
|
.customNumberFormat = false
|
||||||
|
.indexNumberFmtRecord = 0x0169 (361 )
|
||||||
|
.formulaOfLink = (org.apache.poi.hssf.record.LinkedDataFormulaField@913fe2 )
|
||||||
|
[/AI]
|
||||||
|
|
||||||
|
============================================
|
||||||
|
Offset 0xfd6 (4054)
|
||||||
|
rectype = 0x1051, recsize = 0x8
|
||||||
|
-BEGIN DUMP---------------------------------
|
||||||
|
00000000 03 01 00 00 00 00 00 00 ........
|
||||||
|
-END DUMP-----------------------------------
|
||||||
|
recordid = 0x1051, size =8
|
||||||
|
[AI]
|
||||||
|
.linkType = 0x03 (3 )
|
||||||
|
.referenceType = 0x01 (1 )
|
||||||
|
.options = 0x0000 (0 )
|
||||||
|
.customNumberFormat = false
|
||||||
|
.indexNumberFmtRecord = 0x0000 (0 )
|
||||||
|
.formulaOfLink = (org.apache.poi.hssf.record.LinkedDataFormulaField@1f934ad )
|
||||||
|
[/AI]
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
byte[] data = new byte[]{
|
byte[] data = new byte[]{
|
||||||
(byte) 0x00,
|
(byte) 0x00,
|
||||||
(byte) 0x01,
|
(byte) 0x01,
|
||||||
|
@ -62,8 +62,6 @@ public class TestNamedRange
|
|||||||
POIFSFileSystem fs = null;
|
POIFSFileSystem fs = null;
|
||||||
HSSFWorkbook wb = null;
|
HSSFWorkbook wb = null;
|
||||||
|
|
||||||
System.out.println("testTestCase");
|
|
||||||
|
|
||||||
String filename = System.getProperty("HSSF.testdata.path");
|
String filename = System.getProperty("HSSF.testdata.path");
|
||||||
|
|
||||||
filename = filename + "/Simple.xls";
|
filename = filename + "/Simple.xls";
|
||||||
|
Loading…
Reference in New Issue
Block a user