]> source.dussan.org Git - poi.git/commitdiff
Some changes to record generation
authorGlen Stampoultzis <glens@apache.org>
Wed, 9 Oct 2002 00:05:55 +0000 (00:05 +0000)
committerGlen Stampoultzis <glens@apache.org>
Wed, 9 Oct 2002 00:05:55 +0000 (00:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352885 13f79535-47bb-0310-9956-ffa450edef68

83 files changed:
src/contrib/src/org/apache/poi/hssf/usermodel/contrib/HSSFCellUtil.java
src/documentation/xdocs/hssf/record-generator.xml
src/java/org/apache/poi/hssf/model/FormulaParser.java
src/java/org/apache/poi/hssf/record/AreaFormatRecord.java
src/java/org/apache/poi/hssf/record/AreaRecord.java
src/java/org/apache/poi/hssf/record/AxisLineFormatRecord.java
src/java/org/apache/poi/hssf/record/AxisOptionsRecord.java
src/java/org/apache/poi/hssf/record/AxisParentRecord.java
src/java/org/apache/poi/hssf/record/AxisRecord.java
src/java/org/apache/poi/hssf/record/AxisUsedRecord.java
src/java/org/apache/poi/hssf/record/BarRecord.java
src/java/org/apache/poi/hssf/record/CategorySeriesAxisRecord.java
src/java/org/apache/poi/hssf/record/ChartRecord.java
src/java/org/apache/poi/hssf/record/CustomField.java [new file with mode: 0644]
src/java/org/apache/poi/hssf/record/DatRecord.java
src/java/org/apache/poi/hssf/record/DataFormatRecord.java
src/java/org/apache/poi/hssf/record/DefaultDataLabelTextPropertiesRecord.java
src/java/org/apache/poi/hssf/record/FontBasisRecord.java
src/java/org/apache/poi/hssf/record/FontIndexRecord.java
src/java/org/apache/poi/hssf/record/FrameRecord.java
src/java/org/apache/poi/hssf/record/LegendRecord.java
src/java/org/apache/poi/hssf/record/LineFormatRecord.java
src/java/org/apache/poi/hssf/record/LinkedDataFormulaField.java [new file with mode: 0644]
src/java/org/apache/poi/hssf/record/LinkedDataRecord.java
src/java/org/apache/poi/hssf/record/NumberFormatIndexRecord.java
src/java/org/apache/poi/hssf/record/ObjectLinkRecord.java
src/java/org/apache/poi/hssf/record/PlotAreaRecord.java
src/java/org/apache/poi/hssf/record/PlotGrowthRecord.java
src/java/org/apache/poi/hssf/record/SCLRecord.java
src/java/org/apache/poi/hssf/record/SeriesChartGroupIndexRecord.java
src/java/org/apache/poi/hssf/record/SeriesIndexRecord.java
src/java/org/apache/poi/hssf/record/SeriesLabelsRecord.java
src/java/org/apache/poi/hssf/record/SeriesListRecord.java
src/java/org/apache/poi/hssf/record/SeriesRecord.java
src/java/org/apache/poi/hssf/record/SeriesTextRecord.java
src/java/org/apache/poi/hssf/record/SeriesToChartGroupRecord.java
src/java/org/apache/poi/hssf/record/SheetPropertiesRecord.java
src/java/org/apache/poi/hssf/record/TextRecord.java
src/java/org/apache/poi/hssf/record/TickRecord.java
src/java/org/apache/poi/hssf/record/UnitsRecord.java
src/java/org/apache/poi/hssf/record/ValueRangeRecord.java
src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java
src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
src/records/definitions/area_format_record.xml
src/records/definitions/area_record.xml
src/records/definitions/attached_label_record.xml
src/records/definitions/axes_used_record.xml
src/records/definitions/axis_line_format_record.xml
src/records/definitions/axis_options_record.xml
src/records/definitions/axis_parent_record.xml
src/records/definitions/axis_record.xml
src/records/definitions/bar_record.xml
src/records/definitions/category_series_axis_record.xml
src/records/definitions/chart_record.xml
src/records/definitions/dat_record.xml
src/records/definitions/dataformat_record.xml
src/records/definitions/default_data_label_text_properties_record.xml
src/records/definitions/font_basis_record.xml
src/records/definitions/font_example.xml
src/records/definitions/font_index_record.xml
src/records/definitions/frame_record.xml
src/records/definitions/legend_record.xml
src/records/definitions/line_format_record.xml
src/records/definitions/linked_data_record.xml
src/records/definitions/number_format_index_record.xml
src/records/definitions/object_link_record.xml
src/records/definitions/plot_area_record.xml
src/records/definitions/plotgrowth_record.xml
src/records/definitions/series_chart_group_record.xml
src/records/definitions/series_index_record.xml
src/records/definitions/series_list_record.xml
src/records/definitions/series_record.xml
src/records/definitions/series_text_record.xml
src/records/definitions/sheet_properties_record.xml
src/records/definitions/text_record.xml
src/records/definitions/tick_record.xml
src/records/definitions/units_record.xml
src/records/definitions/value_range_record.xml
src/records/styles/record.xsl
src/scratchpad/src/org/apache/poi/generator/FieldIterator.java
src/scratchpad/src/org/apache/poi/generator/RecordUtil.java
src/testcases/org/apache/poi/hssf/record/TestLinkedDataRecord.java
src/testcases/org/apache/poi/hssf/usermodel/TestNamedRange.java

index 40e83c4087f67c1e7df5145a714a079647ccb888..294fb4657b0d610e0e8cada2f426953514b6e83b 100644 (file)
@@ -164,6 +164,8 @@ public class HSSFCellUtil
      *@param  workbook               The workbook that is being worked with.
      *@param  align  the column alignment to use.
      *@exception  NestableException  Thrown if an error happens.
+     *
+     * @see HSSFCellStyle for alignment options
      */
     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
      *@exception  NestableException  Thrown if an error happens.
      */
-
     public static void setCellStyleProperty( HSSFCell cell, HSSFWorkbook workbook, String propertyName, Object propertyValue )
             throws NestableException
     {
index 503a1599c1e909a3afaf9ec2ea08c34d842b13eb..df5b95f6b6ed613ae1c1c94f937d71f13bdd0cd5 100644 (file)
@@ -1,5 +1,5 @@
 <?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>
   <header>
         </p>
         <p>
         A utility was needed to take the defintition of what a
-        record looked like and do all the boring stuff.  Thus the
-        record generator was born.
+        record looked like and do all the boring and repetitive work.
         </p>
     </section>
 
     <section title="Capabilities">
     <p>
-        The record generator takes XML as input and produced the following
+        The record generator takes XML as input and produces the following
         output:
         <ul>
             <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
-                for ensuring the record operates as designed.</li>
+            <li>A test class that provides a fill-in-the-blanks implementation
+                of a test case for ensuring the record operates as
+                designed.</li>
         </ul>
     </p>
     </section>
     <section title="Usage">
         <p>
-            The record generator is invoked as an Ant target (generate-records).  It goes
-            through looking for all files in src/records/defintitions ending with _record.xml.
-            It then creates two files; the Java record definition and the Java test case template.
+            The record generator is invoked as an Ant target
+            (generate-records).  It goes through looking for all files in
+            <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>
             The records themselves have the following general layout:
         </p>
         <source><![CDATA[
-<record id="0x1032" name="Frame" package="org.apache.poi.hssf.record">
-    <description>The frame record indicates whether there is a border 
+<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
                  around the displayed text of a chart.</description>
     <author>Glen Stampoultzis (glens at apache.org)</author>
     <fields>
             <const name="shadow" value="1" description="rectangle with shadow"/>
         </field>
         <field type="int" size="2" name="options">
-            <bit number="0" name="auto size" 
+            <bit number="0" name="auto size"
                description="excel calculates the size automatically if true"/>
-            <bit number="1" name="auto position" 
+            <bit number="1" name="auto position"
                description="excel calculates the position automatically"/>
         </field>
     </fields>
 </record>
         ]]></source>
         <p>
-            Currently the type can be of type int, float or string.  The 'int' 
-            type covers bytes, shorts and integers which is selected using a 
-            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'.
+            The following table details the allowable types and sizes for
+            the fields.
         </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>
             The Java records are regenerated each time the record generator is 
             run, however the test stubs are only created if the test stub does 
             stubs but not the generated records.
         </p>
     </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">
         <p>
             The record generation works by taking an XML file and styling it 
             See record.xsl, record_test.xsl, FieldIterator.java, 
             RecordUtil.java, RecordGenerator.java
         </p>
-    </section>
-    <section title="Limitations">
         <p>
-            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
-            the records manually.  The main point of this thing is to  make the 
-            easy stuff simple.
+            There is a corresponding &quot;type&quot; generator for HDF.
+            See the HDF documentation for details.
         </p>
+    </section>
+    <section title="Limitations">
         <p>
-            Currently the record generator is optimized to create Excel records.  
-            It could be adapted to create Word records with a little poking 
-            around.
+            The record generator does not handle all possible record types and
+            goes not intend to perform this function.  When dealing with a
+            non-standard record sometimes the cost-benifit of coding the
+            record by hand will be greater than attempting modify the
+            generator.  The main point of the record generator is to save
+            time, so keep that in mind.
         </p>
         <p>
             Currently the the XSL file that generates the record calls out to 
-            Java objects.  This would have been better done as Javascript inside 
-            the XSL file itself.  The Java code for the record generation is
+            Java objects.  The Java code for the record generation is
             currently quite messy with minimal comments.  
         </p>
     </section>
index f5d7670bb54d37e69e89b0278529e4b0ab469f5c..06c28c9f5d85e6bdfbb2a619c95c1f3452e575f9 100644 (file)
 
 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.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 CR = '\n';
     
-   private char Look;              // Lookahead Character 
+   private char look;              // Lookahead Character
    
    private Workbook book;
     
@@ -115,7 +111,7 @@ public class FormulaParser {
         formulaString = formula;
         pointer=0;
         this.book = book;
-       formulaLength = formulaString.length();
+       formulaLength = formulaString.length();
     }
     
 
@@ -125,10 +121,10 @@ public class FormulaParser {
        // Just return if so and reset Look to smoething to keep 
        // SkipWhitespace from spinning
         if (pointer == formulaLength) {
-            Look = (char)0;
+            look = (char)0;
            return;
        }
-        Look=formulaString.charAt(pointer++);
+        look=formulaString.charAt(pointer++);
         //System.out.println("Got char: "+Look);
     }
     
@@ -193,7 +189,7 @@ public class FormulaParser {
 
     /** Skip Over Leading White Space */
     private void SkipWhite() {
-        while (IsWhite(Look)) {
+        while (IsWhite(look)) {
             GetChar();
         }
     }
@@ -202,7 +198,7 @@ public class FormulaParser {
 
     /** Match a Specific Input Character */
     private void Match(char x) {
-        if (Look != x) {
+        if (look != x) {
             Expected("" + x + "");
         }else {
             GetChar();
@@ -213,11 +209,11 @@ public class FormulaParser {
     /** Get an Identifier */
     private String GetName() {
         StringBuffer Token = new StringBuffer();
-        if (!IsAlpha(Look)) {
+        if (!IsAlpha(look)) {
             Expected("Name");
         }
-        while (IsAlNum(Look)) {
-            Token = Token.append(Character.toUpperCase(Look));
+        while (IsAlNum(look)) {
+            Token = Token.append(Character.toUpperCase(look));
             GetChar();
         }
         SkipWhite();
@@ -228,11 +224,11 @@ public class FormulaParser {
        converting to uppercase; used for literals */
     private String GetNameAsIs() {
         StringBuffer Token = new StringBuffer();
-        if (!IsAlpha(Look)) {
+        if (!IsAlpha(look)) {
             Expected("Name");
         }
-        while (IsAlNum(Look) || IsWhite(Look)) {
-            Token = Token.append(Look);
+        while (IsAlNum(look) || IsWhite(look)) {
+            Token = Token.append(look);
             GetChar();
         }
         return Token.toString();
@@ -242,9 +238,9 @@ public class FormulaParser {
     /** Get a Number */
     private String GetNum() {
         String Value ="";
-        if  (!IsDigit(Look)) Expected("Integer");
-        while (IsDigit(Look)){
-            Value = Value + Look;
+        if  (!IsDigit(look)) Expected("Integer");
+        while (IsDigit(look)){
+            Value = Value + look;
             GetChar();
         }
         SkipWhite();
@@ -266,20 +262,20 @@ public class FormulaParser {
     private void Ident() {
         String name;
         name = GetName();
-        if (Look == '('){
+        if (look == '('){
             //This is a function
             function(name);
-        } else if (Look == ':') { // this is a AreaReference
+        } else if (look == ':') { // this is a AreaReference
             String first = name;
             Match(':');
             String second = GetName();
             tokens.add(new AreaPtg(first+":"+second));
-        } else if (Look == '!') {
+        } else if (look == '!') {
             Match('!');
             String sheetName = name;
             String first = GetName();
             short externIdx = book.checkExternSheet(book.getSheetIndex(sheetName));
-            if (Look == ':') {
+            if (look == ':') {
                 Match(':');
                 String second=GetName();
                 
@@ -326,12 +322,12 @@ public class FormulaParser {
     /** get arguments to a function */
     private int Arguments() {
         int numArgs = 0;
-        if (Look != ')')  {
+        if (look != ')')  {
             numArgs++; 
             Expression();
         }
-        while (Look == ','  || Look == ';') { //TODO handle EmptyArgs
-            if(Look == ',') {
+        while (look == ','  || look == ';') { //TODO handle EmptyArgs
+            if(look == ',') {
               Match(',');
             }
             else {
@@ -345,23 +341,23 @@ public class FormulaParser {
 
    /** Parse and Translate a Math Factor  */
     private void Factor() {
-        if (Look == '(' ) {
+        if (look == '(' ) {
             Match('(');
             Expression();
             Match(')');
             tokens.add(new ParenthesisPtg());
             return;
-        } else if (IsAlpha(Look)){
+        } else if (IsAlpha(look)){
             Ident();
-        } else if(Look == '"') {
+        } else if(look == '"') {
            StringLiteral();
         } else {
              
             String number = GetNum();
-            if (Look=='.') { 
+            if (look=='.') {
                 Match('.');
                 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));
             } 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!
@@ -397,13 +393,13 @@ public class FormulaParser {
     /** Parse and Translate a Math Term */
     private void  Term(){
         Factor();
-        while (Look == '*' || Look == '/' || Look == '^' || Look == '&' || Look == '=' ) {
+        while (look == '*' || look == '/' || look == '^' || look == '&' || look == '=' ) {
             ///TODO do we need to do anything here??
-            if (Look == '*') Multiply();
-            if (Look == '/') Divide();
-            if (Look == '^') Power();
-            if (Look == '&') Concat();
-            if (Look == '=') Equal();
+            if (look == '*') Multiply();
+            if (look == '/') Divide();
+            if (look == '^') Power();
+            if (look == '&') Concat();
+            if (look == '=') Equal();
         }
     }
     
@@ -444,16 +440,16 @@ public class FormulaParser {
     
     /** Parse and Translate an Expression */
     private void Expression() {
-        if (IsAddop(Look)) {
+        if (IsAddop(look)) {
             EmitLn("CLR D0");  //unaryAdd ptg???
         } else {
             Term();
         }
-        while (IsAddop(Look)) {
-            if ( Look == '+' )  Add();
-            if (Look == '-') Subtract();
-            if (Look == '*') Multiply();
-            if (Look == '/') Divide();
+        while (IsAddop(look)) {
+            if ( look == '+' )  Add();
+            if (look == '-') Subtract();
+            if (look == '*') Multiply();
+            if (look == '/') Divide();
         }
     }
     
index 2ae1bc6daa085a4db32bca4b44359757982ce48d..9938b0636c148da1752a6636e572ec6f0f18768f 100644 (file)
@@ -98,6 +98,7 @@ public class AreaFormatRecord
     public AreaFormatRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -113,6 +114,7 @@ public class AreaFormatRecord
     public AreaFormatRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -130,12 +132,14 @@ public class AreaFormatRecord
 
     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);
-        field_3_pattern                 = LittleEndian.getShort(data, 0x8 + offset);
-        field_4_formatFlags             = LittleEndian.getShort(data, 0xa + offset);
-        field_5_forecolorIndex          = LittleEndian.getShort(data, 0xc + offset);
-        field_6_backcolorIndex          = LittleEndian.getShort(data, 0xe + offset);
+
+        int pos = 0;
+        field_1_foregroundColor        = LittleEndian.getInt(data, pos + 0x0 + offset);
+        field_2_backgroundColor        = LittleEndian.getInt(data, pos + 0x4 + offset);
+        field_3_pattern                = LittleEndian.getShort(data, pos + 0x8 + 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();
 
-        buffer.append("[AreaFormat]\n");
-
+        buffer.append("[AREAFORMAT]\n");
         buffer.append("    .foregroundColor      = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getForegroundColor()))
-            .append(" (").append(getForegroundColor()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getForegroundColor ()))
+            .append(" (").append( getForegroundColor() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .backgroundColor      = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getBackgroundColor()))
-            .append(" (").append(getBackgroundColor()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getBackgroundColor ()))
+            .append(" (").append( getBackgroundColor() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .pattern              = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getPattern()))
-            .append(" (").append(getPattern()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getPattern ()))
+            .append(" (").append( getPattern() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .formatFlags          = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getFormatFlags()))
-            .append(" (").append(getFormatFlags()).append(" )\n");
-        buffer.append("         .automatic                = ").append(isAutomatic           ()).append('\n');
-        buffer.append("         .invert                   = ").append(isInvert              ()).append('\n');
-
+            .append("0x").append(HexDump.toHex(  getFormatFlags ()))
+            .append(" (").append( getFormatFlags() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .automatic                = ").append(isAutomatic()).append('\n'); 
+        buffer.append("         .invert                   = ").append(isInvert()).append('\n'); 
         buffer.append("    .forecolorIndex       = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getForecolorIndex()))
-            .append(" (").append(getForecolorIndex()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getForecolorIndex ()))
+            .append(" (").append( getForecolorIndex() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .backcolorIndex       = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getBackcolorIndex()))
-            .append(" (").append(getBackcolorIndex()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getBackcolorIndex ()))
+            .append(" (").append( getBackcolorIndex() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/AreaFormat]\n");
+        buffer.append("[/AREAFORMAT]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putInt(data, 4 + offset, field_1_foregroundColor);
-        LittleEndian.putInt(data, 8 + offset, field_2_backgroundColor);
-        LittleEndian.putShort(data, 12 + offset, field_3_pattern);
-        LittleEndian.putShort(data, 14 + offset, field_4_formatFlags);
-        LittleEndian.putShort(data, 16 + offset, field_5_forecolorIndex);
-        LittleEndian.putShort(data, 18 + offset, field_6_backcolorIndex);
+        LittleEndian.putInt(data, 4 + offset + pos, field_1_foregroundColor);
+        LittleEndian.putInt(data, 8 + offset + pos, field_2_backgroundColor);
+        LittleEndian.putShort(data, 12 + offset + pos, field_3_pattern);
+        LittleEndian.putShort(data, 14 + offset + pos, field_4_formatFlags);
+        LittleEndian.putShort(data, 16 + offset + pos, field_5_forecolorIndex);
+        LittleEndian.putShort(data, 18 + offset + pos, field_6_backcolorIndex);
 
         return getRecordSize();
     }
@@ -201,7 +201,7 @@ public class AreaFormatRecord
      */
     public int getRecordSize()
     {
-        return 4 + 4 + 4 + 2 + 2 + 2 + 2;
+        return 4  + 4 + 4 + 2 + 2 + 2 + 2;
     }
 
     public short getSid()
@@ -210,19 +210,20 @@ public class AreaFormatRecord
     }
 
     public Object clone() {
-      AreaFormatRecord rec = new AreaFormatRecord();
-      
-      rec.field_1_foregroundColor = field_1_foregroundColor;
-      rec.field_2_backgroundColor = field_2_backgroundColor;
-      rec.field_3_pattern = field_3_pattern;
-      rec.field_4_formatFlags = field_4_formatFlags;
-      rec.field_5_forecolorIndex = field_5_forecolorIndex;
-      rec.field_6_backcolorIndex = field_6_backcolorIndex;
-
-      return rec;
+        AreaFormatRecord rec = new AreaFormatRecord();
+    
+        rec.field_1_foregroundColor = field_1_foregroundColor;
+        rec.field_2_backgroundColor = field_2_backgroundColor;
+        rec.field_3_pattern = field_3_pattern;
+        rec.field_4_formatFlags = field_4_formatFlags;
+        rec.field_5_forecolorIndex = field_5_forecolorIndex;
+        rec.field_6_backcolorIndex = field_6_backcolorIndex;
+        return rec;
     }
 
 
+
+
     /**
      * Get the foreground color field for the AreaFormat record.
      */
index d8aac6f2ddab757d1b5b405a8063d2295f10eb9d..12ebbceb3d764ca77164a1c5cc96d9161de6eb4f 100644 (file)
@@ -94,6 +94,7 @@ public class AreaRecord
     public AreaRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -109,6 +110,7 @@ public class AreaRecord
     public AreaRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -126,7 +128,9 @@ public class AreaRecord
 
     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();
 
-        buffer.append("[Area]\n");
-
+        buffer.append("[AREA]\n");
         buffer.append("    .formatFlags          = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getFormatFlags()))
-            .append(" (").append(getFormatFlags()).append(" )\n");
-        buffer.append("         .stacked                  = ").append(isStacked             ()).append('\n');
-        buffer.append("         .displayAsPercentage      = ").append(isDisplayAsPercentage ()).append('\n');
-        buffer.append("         .shadow                   = ").append(isShadow              ()).append('\n');
-
-        buffer.append("[/Area]\n");
+            .append("0x").append(HexDump.toHex(  getFormatFlags ()))
+            .append(" (").append( getFormatFlags() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .stacked                  = ").append(isStacked()).append('\n'); 
+        buffer.append("         .displayAsPercentage      = ").append(isDisplayAsPercentage()).append('\n'); 
+        buffer.append("         .shadow                   = ").append(isShadow()).append('\n'); 
+
+        buffer.append("[/AREA]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_formatFlags);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_formatFlags);
 
         return getRecordSize();
     }
@@ -163,7 +168,7 @@ public class AreaRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2;
+        return 4  + 2;
     }
 
     public short getSid()
@@ -172,14 +177,15 @@ public class AreaRecord
     }
 
     public Object clone() {
-      AreaRecord rec = new AreaRecord();
-      
-      rec.field_1_formatFlags = field_1_formatFlags;
-
-      return rec;
+        AreaRecord rec = new AreaRecord();
+    
+        rec.field_1_formatFlags = field_1_formatFlags;
+        return rec;
     }
 
 
+
+
     /**
      * Get the format flags field for the Area record.
      */
index 79dadd2327fda9f55e9f552d91fa41a8f1d5a67e..5422b786ac06b7dca09eb4bf4506bef56554ab38 100644 (file)
@@ -95,6 +95,7 @@ public class AxisLineFormatRecord
     public AxisLineFormatRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -110,6 +111,7 @@ public class AxisLineFormatRecord
     public AxisLineFormatRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -127,7 +129,9 @@ public class AxisLineFormatRecord
 
     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();
 
-        buffer.append("[AxisLineFormat]\n");
-
+        buffer.append("[AXISLINEFORMAT]\n");
         buffer.append("    .axisType             = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getAxisType()))
-            .append(" (").append(getAxisType()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getAxisType ()))
+            .append(" (").append( getAxisType() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/AxisLineFormat]\n");
+        buffer.append("[/AXISLINEFORMAT]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_axisType);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_axisType);
 
         return getRecordSize();
     }
@@ -161,7 +166,7 @@ public class AxisLineFormatRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2;
+        return 4  + 2;
     }
 
     public short getSid()
@@ -170,14 +175,15 @@ public class AxisLineFormatRecord
     }
 
     public Object clone() {
-      AxisLineFormatRecord rec = new AxisLineFormatRecord();
-      
-      rec.field_1_axisType = field_1_axisType;
-
-      return rec;
+        AxisLineFormatRecord rec = new AxisLineFormatRecord();
+    
+        rec.field_1_axisType = field_1_axisType;
+        return rec;
     }
 
 
+
+
     /**
      * Get the axis type field for the AxisLineFormat record.
      *
index 5bd2565a09235fe4c379ed91c6d7ab8976a77bb9..54fbe41705b6195e6cbac568bcbc2ec58ff5b20d 100644 (file)
@@ -107,6 +107,7 @@ public class AxisOptionsRecord
     public AxisOptionsRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -122,6 +123,7 @@ public class AxisOptionsRecord
     public AxisOptionsRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -139,15 +141,17 @@ public class AxisOptionsRecord
 
     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);
-        field_3_majorUnitValue          = LittleEndian.getShort(data, 0x4 + offset);
-        field_4_majorUnit               = LittleEndian.getShort(data, 0x6 + offset);
-        field_5_minorUnitValue          = LittleEndian.getShort(data, 0x8 + offset);
-        field_6_minorUnit               = LittleEndian.getShort(data, 0xa + offset);
-        field_7_baseUnit                = LittleEndian.getShort(data, 0xc + offset);
-        field_8_crossingPoint           = LittleEndian.getShort(data, 0xe + offset);
-        field_9_options                 = LittleEndian.getShort(data, 0x10 + offset);
+
+        int pos = 0;
+        field_1_minimumCategory        = LittleEndian.getShort(data, pos + 0x0 + offset);
+        field_2_maximumCategory        = LittleEndian.getShort(data, pos + 0x2 + offset);
+        field_3_majorUnitValue         = LittleEndian.getShort(data, pos + 0x4 + offset);
+        field_4_majorUnit              = LittleEndian.getShort(data, pos + 0x6 + offset);
+        field_5_minorUnitValue         = LittleEndian.getShort(data, pos + 0x8 + offset);
+        field_6_minorUnit              = LittleEndian.getShort(data, pos + 0xa + 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,79 +159,72 @@ public class AxisOptionsRecord
     {
         StringBuffer buffer = new StringBuffer();
 
-        buffer.append("[AxisOptions]\n");
-
+        buffer.append("[AXCEXT]\n");
         buffer.append("    .minimumCategory      = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getMinimumCategory()))
-            .append(" (").append(getMinimumCategory()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getMinimumCategory ()))
+            .append(" (").append( getMinimumCategory() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .maximumCategory      = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getMaximumCategory()))
-            .append(" (").append(getMaximumCategory()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getMaximumCategory ()))
+            .append(" (").append( getMaximumCategory() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .majorUnitValue       = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getMajorUnitValue()))
-            .append(" (").append(getMajorUnitValue()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getMajorUnitValue ()))
+            .append(" (").append( getMajorUnitValue() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .majorUnit            = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getMajorUnit()))
-            .append(" (").append(getMajorUnit()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getMajorUnit ()))
+            .append(" (").append( getMajorUnit() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .minorUnitValue       = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getMinorUnitValue()))
-            .append(" (").append(getMinorUnitValue()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getMinorUnitValue ()))
+            .append(" (").append( getMinorUnitValue() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .minorUnit            = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getMinorUnit()))
-            .append(" (").append(getMinorUnit()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getMinorUnit ()))
+            .append(" (").append( getMinorUnit() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .baseUnit             = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getBaseUnit()))
-            .append(" (").append(getBaseUnit()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getBaseUnit ()))
+            .append(" (").append( getBaseUnit() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .crossingPoint        = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getCrossingPoint()))
-            .append(" (").append(getCrossingPoint()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getCrossingPoint ()))
+            .append(" (").append( getCrossingPoint() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .options              = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getOptions()))
-            .append(" (").append(getOptions()).append(" )\n");
-        buffer.append("         .defaultMinimum           = ").append(isDefaultMinimum      ()).append('\n');
-        buffer.append("         .defaultMaximum           = ").append(isDefaultMaximum      ()).append('\n');
-        buffer.append("         .defaultMajor             = ").append(isDefaultMajor        ()).append('\n');
-        buffer.append("         .defaultMinorUnit         = ").append(isDefaultMinorUnit    ()).append('\n');
-        buffer.append("         .isDate                   = ").append(isIsDate              ()).append('\n');
-        buffer.append("         .defaultBase              = ").append(isDefaultBase         ()).append('\n');
-        buffer.append("         .defaultCross             = ").append(isDefaultCross        ()).append('\n');
-        buffer.append("         .defaultDateSettings      = ").append(isDefaultDateSettings ()).append('\n');
-
-        buffer.append("[/AxisOptions]\n");
+            .append("0x").append(HexDump.toHex(  getOptions ()))
+            .append(" (").append( getOptions() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .defaultMinimum           = ").append(isDefaultMinimum()).append('\n'); 
+        buffer.append("         .defaultMaximum           = ").append(isDefaultMaximum()).append('\n'); 
+        buffer.append("         .defaultMajor             = ").append(isDefaultMajor()).append('\n'); 
+        buffer.append("         .defaultMinorUnit         = ").append(isDefaultMinorUnit()).append('\n'); 
+        buffer.append("         .isDate                   = ").append(isIsDate()).append('\n'); 
+        buffer.append("         .defaultBase              = ").append(isDefaultBase()).append('\n'); 
+        buffer.append("         .defaultCross             = ").append(isDefaultCross()).append('\n'); 
+        buffer.append("         .defaultDateSettings      = ").append(isDefaultDateSettings()).append('\n'); 
+
+        buffer.append("[/AXCEXT]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_minimumCategory);
-        LittleEndian.putShort(data, 6 + offset, field_2_maximumCategory);
-        LittleEndian.putShort(data, 8 + offset, field_3_majorUnitValue);
-        LittleEndian.putShort(data, 10 + offset, field_4_majorUnit);
-        LittleEndian.putShort(data, 12 + offset, field_5_minorUnitValue);
-        LittleEndian.putShort(data, 14 + offset, field_6_minorUnit);
-        LittleEndian.putShort(data, 16 + offset, field_7_baseUnit);
-        LittleEndian.putShort(data, 18 + offset, field_8_crossingPoint);
-        LittleEndian.putShort(data, 20 + offset, field_9_options);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_minimumCategory);
+        LittleEndian.putShort(data, 6 + offset + pos, field_2_maximumCategory);
+        LittleEndian.putShort(data, 8 + offset + pos, field_3_majorUnitValue);
+        LittleEndian.putShort(data, 10 + offset + pos, field_4_majorUnit);
+        LittleEndian.putShort(data, 12 + offset + pos, field_5_minorUnitValue);
+        LittleEndian.putShort(data, 14 + offset + pos, field_6_minorUnit);
+        LittleEndian.putShort(data, 16 + offset + pos, field_7_baseUnit);
+        LittleEndian.putShort(data, 18 + offset + pos, field_8_crossingPoint);
+        LittleEndian.putShort(data, 20 + offset + pos, field_9_options);
 
         return getRecordSize();
     }
@@ -237,7 +234,7 @@ public class AxisOptionsRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2;
+        return 4  + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2;
     }
 
     public short getSid()
@@ -246,22 +243,23 @@ public class AxisOptionsRecord
     }
 
     public Object clone() {
-      AxisOptionsRecord rec = new AxisOptionsRecord();
-      
-      rec.field_1_minimumCategory = field_1_minimumCategory;
-      rec.field_2_maximumCategory = field_2_maximumCategory;
-      rec.field_3_majorUnitValue = field_3_majorUnitValue;
-      rec.field_4_majorUnit = field_4_majorUnit;
-      rec.field_5_minorUnitValue = field_5_minorUnitValue;
-      rec.field_6_minorUnit = field_6_minorUnit;
-      rec.field_7_baseUnit = field_7_baseUnit;
-      rec.field_8_crossingPoint = field_8_crossingPoint;
-      rec.field_9_options = field_9_options;
-
-      return rec;
+        AxisOptionsRecord rec = new AxisOptionsRecord();
+    
+        rec.field_1_minimumCategory = field_1_minimumCategory;
+        rec.field_2_maximumCategory = field_2_maximumCategory;
+        rec.field_3_majorUnitValue = field_3_majorUnitValue;
+        rec.field_4_majorUnit = field_4_majorUnit;
+        rec.field_5_minorUnitValue = field_5_minorUnitValue;
+        rec.field_6_minorUnit = field_6_minorUnit;
+        rec.field_7_baseUnit = field_7_baseUnit;
+        rec.field_8_crossingPoint = field_8_crossingPoint;
+        rec.field_9_options = field_9_options;
+        return rec;
     }
 
 
+
+
     /**
      * Get the minimum category field for the AxisOptions record.
      */
index 7f40d61dc31511696ab8b50f4df4c679e521aead..69f20fc23a2e3cb7ce28df6308d9fe2b5fa6df20 100644 (file)
@@ -97,6 +97,7 @@ public class AxisParentRecord
     public AxisParentRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -112,6 +113,7 @@ public class AxisParentRecord
     public AxisParentRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -129,11 +131,13 @@ public class AxisParentRecord
 
     protected void fillFields(byte [] data, short size, int offset)
     {
-        field_1_axisType                = LittleEndian.getShort(data, 0x0 + offset);
-        field_2_x                       = LittleEndian.getInt(data, 0x2 + offset);
-        field_3_y                       = LittleEndian.getInt(data, 0x6 + offset);
-        field_4_width                   = LittleEndian.getInt(data, 0xa + offset);
-        field_5_height                  = LittleEndian.getInt(data, 0xe + offset);
+
+        int pos = 0;
+        field_1_axisType               = LittleEndian.getShort(data, pos + 0x0 + offset);
+        field_2_x                      = LittleEndian.getInt(data, pos + 0x2 + 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();
 
-        buffer.append("[AxisParent]\n");
-
+        buffer.append("[AXISPARENT]\n");
         buffer.append("    .axisType             = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getAxisType()))
-            .append(" (").append(getAxisType()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getAxisType ()))
+            .append(" (").append( getAxisType() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .x                    = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getX()))
-            .append(" (").append(getX()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getX ()))
+            .append(" (").append( getX() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .y                    = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getY()))
-            .append(" (").append(getY()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getY ()))
+            .append(" (").append( getY() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .width                = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getWidth()))
-            .append(" (").append(getWidth()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getWidth ()))
+            .append(" (").append( getWidth() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .height               = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getHeight()))
-            .append(" (").append(getHeight()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getHeight ()))
+            .append(" (").append( getHeight() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/AxisParent]\n");
+        buffer.append("[/AXISPARENT]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_axisType);
-        LittleEndian.putInt(data, 6 + offset, field_2_x);
-        LittleEndian.putInt(data, 10 + offset, field_3_y);
-        LittleEndian.putInt(data, 14 + offset, field_4_width);
-        LittleEndian.putInt(data, 18 + offset, field_5_height);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_axisType);
+        LittleEndian.putInt(data, 6 + offset + pos, field_2_x);
+        LittleEndian.putInt(data, 10 + offset + pos, field_3_y);
+        LittleEndian.putInt(data, 14 + offset + pos, field_4_width);
+        LittleEndian.putInt(data, 18 + offset + pos, field_5_height);
 
         return getRecordSize();
     }
@@ -191,7 +192,7 @@ public class AxisParentRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2 + 4 + 4 + 4 + 4;
+        return 4  + 2 + 4 + 4 + 4 + 4;
     }
 
     public short getSid()
@@ -200,18 +201,19 @@ public class AxisParentRecord
     }
 
     public Object clone() {
-      AxisParentRecord rec = new AxisParentRecord();
-      
-      rec.field_1_axisType = field_1_axisType;
-      rec.field_2_x = field_2_x;
-      rec.field_3_y = field_3_y;
-      rec.field_4_width = field_4_width;
-      rec.field_5_height = field_5_height;
-
-      return rec;
+        AxisParentRecord rec = new AxisParentRecord();
+    
+        rec.field_1_axisType = field_1_axisType;
+        rec.field_2_x = field_2_x;
+        rec.field_3_y = field_3_y;
+        rec.field_4_width = field_4_width;
+        rec.field_5_height = field_5_height;
+        return rec;
     }
 
 
+
+
     /**
      * Get the axis type field for the AxisParent record.
      *
index 432c92e3e40b2435239c778f0149ca613b54c616..314f56a6d698e72ab4ea691a445b43421f2e63e9 100644 (file)
@@ -98,6 +98,7 @@ public class AxisRecord
     public AxisRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -113,6 +114,7 @@ public class AxisRecord
     public AxisRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -130,11 +132,13 @@ public class AxisRecord
 
     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);
-        field_3_reserved2               = LittleEndian.getInt(data, 0x6 + offset);
-        field_4_reserved3               = LittleEndian.getInt(data, 0xa + offset);
-        field_5_reserved4               = LittleEndian.getInt(data, 0xe + offset);
+
+        int pos = 0;
+        field_1_axisType               = LittleEndian.getShort(data, pos + 0x0 + offset);
+        field_2_reserved1              = LittleEndian.getInt(data, pos + 0x2 + 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();
 
-        buffer.append("[Axis]\n");
-
+        buffer.append("[AXIS]\n");
         buffer.append("    .axisType             = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getAxisType()))
-            .append(" (").append(getAxisType()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getAxisType ()))
+            .append(" (").append( getAxisType() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .reserved1            = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getReserved1()))
-            .append(" (").append(getReserved1()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getReserved1 ()))
+            .append(" (").append( getReserved1() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .reserved2            = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getReserved2()))
-            .append(" (").append(getReserved2()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getReserved2 ()))
+            .append(" (").append( getReserved2() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .reserved3            = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getReserved3()))
-            .append(" (").append(getReserved3()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getReserved3 ()))
+            .append(" (").append( getReserved3() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .reserved4            = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getReserved4()))
-            .append(" (").append(getReserved4()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getReserved4 ()))
+            .append(" (").append( getReserved4() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/Axis]\n");
+        buffer.append("[/AXIS]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_axisType);
-        LittleEndian.putInt(data, 6 + offset, field_2_reserved1);
-        LittleEndian.putInt(data, 10 + offset, field_3_reserved2);
-        LittleEndian.putInt(data, 14 + offset, field_4_reserved3);
-        LittleEndian.putInt(data, 18 + offset, field_5_reserved4);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_axisType);
+        LittleEndian.putInt(data, 6 + offset + pos, field_2_reserved1);
+        LittleEndian.putInt(data, 10 + offset + pos, field_3_reserved2);
+        LittleEndian.putInt(data, 14 + offset + pos, field_4_reserved3);
+        LittleEndian.putInt(data, 18 + offset + pos, field_5_reserved4);
 
         return getRecordSize();
     }
@@ -192,7 +193,7 @@ public class AxisRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2 + 4 + 4 + 4 + 4;
+        return 4  + 2 + 4 + 4 + 4 + 4;
     }
 
     public short getSid()
@@ -201,18 +202,19 @@ public class AxisRecord
     }
 
     public Object clone() {
-      AxisRecord rec = new AxisRecord();
-      
-      rec.field_1_axisType = field_1_axisType;
-      rec.field_2_reserved1 = field_2_reserved1;
-      rec.field_3_reserved2 = field_3_reserved2;
-      rec.field_4_reserved3 = field_4_reserved3;
-      rec.field_5_reserved4 = field_5_reserved4;
-
-      return rec;
+        AxisRecord rec = new AxisRecord();
+    
+        rec.field_1_axisType = field_1_axisType;
+        rec.field_2_reserved1 = field_2_reserved1;
+        rec.field_3_reserved2 = field_3_reserved2;
+        rec.field_4_reserved3 = field_4_reserved3;
+        rec.field_5_reserved4 = field_5_reserved4;
+        return rec;
     }
 
 
+
+
     /**
      * Get the axis type field for the Axis record.
      *
index c91b98eeb83269cdb480ee2b47db5570557e781f..632c5c7d28ff716e8b8f8a48c2d78070fbd790dd 100644 (file)
@@ -91,6 +91,7 @@ public class AxisUsedRecord
     public AxisUsedRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -106,6 +107,7 @@ public class AxisUsedRecord
     public AxisUsedRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -123,7 +125,9 @@ public class AxisUsedRecord
 
     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();
 
-        buffer.append("[AxisUsed]\n");
-
+        buffer.append("[AXISUSED]\n");
         buffer.append("    .numAxis              = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getNumAxis()))
-            .append(" (").append(getNumAxis()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getNumAxis ()))
+            .append(" (").append( getNumAxis() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/AxisUsed]\n");
+        buffer.append("[/AXISUSED]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_numAxis);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_numAxis);
 
         return getRecordSize();
     }
@@ -157,7 +162,7 @@ public class AxisUsedRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2;
+        return 4  + 2;
     }
 
     public short getSid()
@@ -166,14 +171,15 @@ public class AxisUsedRecord
     }
 
     public Object clone() {
-      AxisUsedRecord rec = new AxisUsedRecord();
-      
-      rec.field_1_numAxis = field_1_numAxis;
-
-      return rec;
+        AxisUsedRecord rec = new AxisUsedRecord();
+    
+        rec.field_1_numAxis = field_1_numAxis;
+        return rec;
     }
 
 
+
+
     /**
      * Get the num axis field for the AxisUsed record.
      */
index 15af1397135863885d272a816da04487e08bc273..8e36779ee3964f2862037245d84f2fefe3b700d3 100644 (file)
@@ -82,7 +82,6 @@ public class BarRecord
 
     public BarRecord()
     {
-        field_2_categorySpace = 50;
 
     }
 
@@ -98,6 +97,7 @@ public class BarRecord
     public BarRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -113,6 +113,7 @@ public class BarRecord
     public BarRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -130,9 +131,11 @@ public class BarRecord
 
     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);
-        field_3_formatFlags             = LittleEndian.getShort(data, 0x4 + offset);
+
+        int pos = 0;
+        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();
 
-        buffer.append("[Bar]\n");
-
+        buffer.append("[BAR]\n");
         buffer.append("    .barSpace             = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getBarSpace()))
-            .append(" (").append(getBarSpace()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getBarSpace ()))
+            .append(" (").append( getBarSpace() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .categorySpace        = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getCategorySpace()))
-            .append(" (").append(getCategorySpace()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getCategorySpace ()))
+            .append(" (").append( getCategorySpace() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .formatFlags          = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getFormatFlags()))
-            .append(" (").append(getFormatFlags()).append(" )\n");
-        buffer.append("         .horizontal               = ").append(isHorizontal          ()).append('\n');
-        buffer.append("         .stacked                  = ").append(isStacked             ()).append('\n');
-        buffer.append("         .displayAsPercentage      = ").append(isDisplayAsPercentage ()).append('\n');
-        buffer.append("         .shadow                   = ").append(isShadow              ()).append('\n');
-
-        buffer.append("[/Bar]\n");
+            .append("0x").append(HexDump.toHex(  getFormatFlags ()))
+            .append(" (").append( getFormatFlags() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .horizontal               = ").append(isHorizontal()).append('\n'); 
+        buffer.append("         .stacked                  = ").append(isStacked()).append('\n'); 
+        buffer.append("         .displayAsPercentage      = ").append(isDisplayAsPercentage()).append('\n'); 
+        buffer.append("         .shadow                   = ").append(isShadow()).append('\n'); 
+
+        buffer.append("[/BAR]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_barSpace);
-        LittleEndian.putShort(data, 6 + offset, field_2_categorySpace);
-        LittleEndian.putShort(data, 8 + offset, field_3_formatFlags);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_barSpace);
+        LittleEndian.putShort(data, 6 + offset + pos, field_2_categorySpace);
+        LittleEndian.putShort(data, 8 + offset + pos, field_3_formatFlags);
 
         return getRecordSize();
     }
@@ -182,7 +184,7 @@ public class BarRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2 + 2 + 2;
+        return 4  + 2 + 2 + 2;
     }
 
     public short getSid()
@@ -191,16 +193,17 @@ public class BarRecord
     }
 
     public Object clone() {
-      BarRecord rec = new BarRecord();
-      
-      rec.field_1_barSpace = field_1_barSpace;
-      rec.field_2_categorySpace = field_2_categorySpace;
-      rec.field_3_formatFlags = field_3_formatFlags;
-
-      return rec;
+        BarRecord rec = new BarRecord();
+    
+        rec.field_1_barSpace = field_1_barSpace;
+        rec.field_2_categorySpace = field_2_categorySpace;
+        rec.field_3_formatFlags = field_3_formatFlags;
+        return rec;
     }
 
 
+
+
     /**
      * Get the bar space field for the Bar record.
      */
index 9459ffb93ce4a93b1ffd2570b0e73a8d99b258b5..cf26998d7de7ee72e269f4d3bef523b3386804b6 100644 (file)
@@ -97,6 +97,7 @@ public class CategorySeriesAxisRecord
     public CategorySeriesAxisRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -112,6 +113,7 @@ public class CategorySeriesAxisRecord
     public CategorySeriesAxisRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -129,10 +131,12 @@ public class CategorySeriesAxisRecord
 
     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);
-        field_3_tickMarkFrequency       = LittleEndian.getShort(data, 0x4 + offset);
-        field_4_options                 = LittleEndian.getShort(data, 0x6 + offset);
+
+        int pos = 0;
+        field_1_crossingPoint          = LittleEndian.getShort(data, pos + 0x0 + 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();
 
-        buffer.append("[CategorySeriesAxis]\n");
-
+        buffer.append("[CATSERRANGE]\n");
         buffer.append("    .crossingPoint        = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getCrossingPoint()))
-            .append(" (").append(getCrossingPoint()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getCrossingPoint ()))
+            .append(" (").append( getCrossingPoint() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .labelFrequency       = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getLabelFrequency()))
-            .append(" (").append(getLabelFrequency()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getLabelFrequency ()))
+            .append(" (").append( getLabelFrequency() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .tickMarkFrequency    = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getTickMarkFrequency()))
-            .append(" (").append(getTickMarkFrequency()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getTickMarkFrequency ()))
+            .append(" (").append( getTickMarkFrequency() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .options              = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getOptions()))
-            .append(" (").append(getOptions()).append(" )\n");
-        buffer.append("         .valueAxisCrossing        = ").append(isValueAxisCrossing   ()).append('\n');
-        buffer.append("         .crossesFarRight          = ").append(isCrossesFarRight     ()).append('\n');
-        buffer.append("         .reversed                 = ").append(isReversed            ()).append('\n');
-
-        buffer.append("[/CategorySeriesAxis]\n");
+            .append("0x").append(HexDump.toHex(  getOptions ()))
+            .append(" (").append( getOptions() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .valueAxisCrossing        = ").append(isValueAxisCrossing()).append('\n'); 
+        buffer.append("         .crossesFarRight          = ").append(isCrossesFarRight()).append('\n'); 
+        buffer.append("         .reversed                 = ").append(isReversed()).append('\n'); 
+
+        buffer.append("[/CATSERRANGE]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_crossingPoint);
-        LittleEndian.putShort(data, 6 + offset, field_2_labelFrequency);
-        LittleEndian.putShort(data, 8 + offset, field_3_tickMarkFrequency);
-        LittleEndian.putShort(data, 10 + offset, field_4_options);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_crossingPoint);
+        LittleEndian.putShort(data, 6 + offset + pos, field_2_labelFrequency);
+        LittleEndian.putShort(data, 8 + offset + pos, field_3_tickMarkFrequency);
+        LittleEndian.putShort(data, 10 + offset + pos, field_4_options);
 
         return getRecordSize();
     }
@@ -187,7 +189,7 @@ public class CategorySeriesAxisRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2 + 2 + 2 + 2;
+        return 4  + 2 + 2 + 2 + 2;
     }
 
     public short getSid()
@@ -196,17 +198,18 @@ public class CategorySeriesAxisRecord
     }
 
     public Object clone() {
-      CategorySeriesAxisRecord rec = new CategorySeriesAxisRecord();
-      
-      rec.field_1_crossingPoint = field_1_crossingPoint;
-      rec.field_2_labelFrequency = field_2_labelFrequency;
-      rec.field_3_tickMarkFrequency = field_3_tickMarkFrequency;
-      rec.field_4_options = field_4_options;
-
-      return rec;
+        CategorySeriesAxisRecord rec = new CategorySeriesAxisRecord();
+    
+        rec.field_1_crossingPoint = field_1_crossingPoint;
+        rec.field_2_labelFrequency = field_2_labelFrequency;
+        rec.field_3_tickMarkFrequency = field_3_tickMarkFrequency;
+        rec.field_4_options = field_4_options;
+        return rec;
     }
 
 
+
+
     /**
      * Get the crossing point field for the CategorySeriesAxis record.
      */
index 87a876884c5019dcba325f44a16f9a7d1beaa1ee..6ad00e0052da0995d75b734126719e0e220a492f 100644 (file)
@@ -94,6 +94,7 @@ public class ChartRecord
     public ChartRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -109,6 +110,7 @@ public class ChartRecord
     public ChartRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -126,10 +128,12 @@ public class ChartRecord
 
     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);
-        field_3_width                   = LittleEndian.getInt(data, 0x8 + offset);
-        field_4_height                  = LittleEndian.getInt(data, 0xc + offset);
+
+        int pos = 0;
+        field_1_x                      = LittleEndian.getInt(data, pos + 0x0 + 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();
 
-        buffer.append("[Chart]\n");
-
+        buffer.append("[CHART]\n");
         buffer.append("    .x                    = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getX()))
-            .append(" (").append(getX()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getX ()))
+            .append(" (").append( getX() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .y                    = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getY()))
-            .append(" (").append(getY()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getY ()))
+            .append(" (").append( getY() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .width                = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getWidth()))
-            .append(" (").append(getWidth()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getWidth ()))
+            .append(" (").append( getWidth() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .height               = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getHeight()))
-            .append(" (").append(getHeight()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getHeight ()))
+            .append(" (").append( getHeight() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/Chart]\n");
+        buffer.append("[/CHART]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putInt(data, 4 + offset, field_1_x);
-        LittleEndian.putInt(data, 8 + offset, field_2_y);
-        LittleEndian.putInt(data, 12 + offset, field_3_width);
-        LittleEndian.putInt(data, 16 + offset, field_4_height);
+        LittleEndian.putInt(data, 4 + offset + pos, field_1_x);
+        LittleEndian.putInt(data, 8 + offset + pos, field_2_y);
+        LittleEndian.putInt(data, 12 + offset + pos, field_3_width);
+        LittleEndian.putInt(data, 16 + offset + pos, field_4_height);
 
         return getRecordSize();
     }
@@ -181,7 +183,7 @@ public class ChartRecord
      */
     public int getRecordSize()
     {
-        return 4 + 4 + 4 + 4 + 4;
+        return 4  + 4 + 4 + 4 + 4;
     }
 
     public short getSid()
@@ -190,17 +192,18 @@ public class ChartRecord
     }
 
     public Object clone() {
-      ChartRecord rec = new ChartRecord();
-      
-      rec.field_1_x = field_1_x;
-      rec.field_2_y = field_2_y;
-      rec.field_3_width = field_3_width;
-      rec.field_4_height = field_4_height;
-
-      return rec;
+        ChartRecord rec = new ChartRecord();
+    
+        rec.field_1_x = field_1_x;
+        rec.field_2_y = field_2_y;
+        rec.field_3_width = field_3_width;
+        rec.field_4_height = field_4_height;
+        return rec;
     }
 
 
+
+
     /**
      * Get the x field for the Chart record.
      */
diff --git a/src/java/org/apache/poi/hssf/record/CustomField.java b/src/java/org/apache/poi/hssf/record/CustomField.java
new file mode 100644 (file)
index 0000000..58f08d8
--- /dev/null
@@ -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);
+
+
+}
index 9203faae831d75b176b3f658c51f7448d3dfdb4a..7b15a23d377ffed08f516bf4f9c67599243d721a 100644 (file)
@@ -95,6 +95,7 @@ public class DatRecord
     public DatRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -110,6 +111,7 @@ public class DatRecord
     public DatRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -127,7 +129,9 @@ public class DatRecord
 
     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();
 
-        buffer.append("[Dat]\n");
-
+        buffer.append("[DAT]\n");
         buffer.append("    .options              = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getOptions()))
-            .append(" (").append(getOptions()).append(" )\n");
-        buffer.append("         .horizontalBorder         = ").append(isHorizontalBorder    ()).append('\n');
-        buffer.append("         .verticalBorder           = ").append(isVerticalBorder      ()).append('\n');
-        buffer.append("         .border                   = ").append(isBorder              ()).append('\n');
-        buffer.append("         .showSeriesKey            = ").append(isShowSeriesKey       ()).append('\n');
-
-        buffer.append("[/Dat]\n");
+            .append("0x").append(HexDump.toHex(  getOptions ()))
+            .append(" (").append( getOptions() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .horizontalBorder         = ").append(isHorizontalBorder()).append('\n'); 
+        buffer.append("         .verticalBorder           = ").append(isVerticalBorder()).append('\n'); 
+        buffer.append("         .border                   = ").append(isBorder()).append('\n'); 
+        buffer.append("         .showSeriesKey            = ").append(isShowSeriesKey()).append('\n'); 
+
+        buffer.append("[/DAT]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_options);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_options);
 
         return getRecordSize();
     }
@@ -165,7 +170,7 @@ public class DatRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2;
+        return 4  + 2;
     }
 
     public short getSid()
@@ -174,14 +179,15 @@ public class DatRecord
     }
 
     public Object clone() {
-      DatRecord rec = new DatRecord();
-      
-      rec.field_1_options = field_1_options;
-
-      return rec;
+        DatRecord rec = new DatRecord();
+    
+        rec.field_1_options = field_1_options;
+        return rec;
     }
 
 
+
+
     /**
      * Get the options field for the Dat record.
      */
index ddd6a558dde12809bee84a38834915d46b1f6d71..96e2d10385399024dfa1f43cd4c0aa5a0a26d194 100644 (file)
@@ -95,6 +95,7 @@ public class DataFormatRecord
     public DataFormatRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -110,6 +111,7 @@ public class DataFormatRecord
     public DataFormatRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -127,10 +129,12 @@ public class DataFormatRecord
 
     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);
-        field_3_seriesNumber            = LittleEndian.getShort(data, 0x4 + offset);
-        field_4_formatFlags             = LittleEndian.getShort(data, 0x6 + offset);
+
+        int pos = 0;
+        field_1_pointNumber            = LittleEndian.getShort(data, pos + 0x0 + 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();
 
-        buffer.append("[DataFormat]\n");
-
+        buffer.append("[DATAFORMAT]\n");
         buffer.append("    .pointNumber          = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getPointNumber()))
-            .append(" (").append(getPointNumber()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getPointNumber ()))
+            .append(" (").append( getPointNumber() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .seriesIndex          = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getSeriesIndex()))
-            .append(" (").append(getSeriesIndex()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getSeriesIndex ()))
+            .append(" (").append( getSeriesIndex() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .seriesNumber         = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getSeriesNumber()))
-            .append(" (").append(getSeriesNumber()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getSeriesNumber ()))
+            .append(" (").append( getSeriesNumber() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .formatFlags          = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getFormatFlags()))
-            .append(" (").append(getFormatFlags()).append(" )\n");
-        buffer.append("         .useExcel4Colors          = ").append(isUseExcel4Colors     ()).append('\n');
+            .append("0x").append(HexDump.toHex(  getFormatFlags ()))
+            .append(" (").append( getFormatFlags() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .useExcel4Colors          = ").append(isUseExcel4Colors()).append('\n'); 
 
-        buffer.append("[/DataFormat]\n");
+        buffer.append("[/DATAFORMAT]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_pointNumber);
-        LittleEndian.putShort(data, 6 + offset, field_2_seriesIndex);
-        LittleEndian.putShort(data, 8 + offset, field_3_seriesNumber);
-        LittleEndian.putShort(data, 10 + offset, field_4_formatFlags);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_pointNumber);
+        LittleEndian.putShort(data, 6 + offset + pos, field_2_seriesIndex);
+        LittleEndian.putShort(data, 8 + offset + pos, field_3_seriesNumber);
+        LittleEndian.putShort(data, 10 + offset + pos, field_4_formatFlags);
 
         return getRecordSize();
     }
@@ -183,7 +185,7 @@ public class DataFormatRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2 + 2 + 2 + 2;
+        return 4  + 2 + 2 + 2 + 2;
     }
 
     public short getSid()
@@ -192,17 +194,18 @@ public class DataFormatRecord
     }
 
     public Object clone() {
-      DataFormatRecord rec = new DataFormatRecord();
-      
-      rec.field_1_pointNumber = field_1_pointNumber;
-      rec.field_2_seriesIndex = field_2_seriesIndex;
-      rec.field_3_seriesNumber = field_3_seriesNumber;
-      rec.field_4_formatFlags = field_4_formatFlags;
-
-      return rec;
+        DataFormatRecord rec = new DataFormatRecord();
+    
+        rec.field_1_pointNumber = field_1_pointNumber;
+        rec.field_2_seriesIndex = field_2_seriesIndex;
+        rec.field_3_seriesNumber = field_3_seriesNumber;
+        rec.field_4_formatFlags = field_4_formatFlags;
+        return rec;
     }
 
 
+
+
     /**
      * Get the point number field for the DataFormat record.
      */
index 0074ba4d946817b9f3cead7dab5fac9e7a9cd54b..f25f35d6687a9865f6fd6a5334003599c7375afb 100644 (file)
@@ -94,6 +94,7 @@ public class DefaultDataLabelTextPropertiesRecord
     public DefaultDataLabelTextPropertiesRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -109,6 +110,7 @@ public class DefaultDataLabelTextPropertiesRecord
     public DefaultDataLabelTextPropertiesRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -126,7 +128,9 @@ public class DefaultDataLabelTextPropertiesRecord
 
     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();
 
-        buffer.append("[DefaultDataLabelTextProperties]\n");
-
+        buffer.append("[DEFAULTTEXT]\n");
         buffer.append("    .categoryDataType     = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getCategoryDataType()))
-            .append(" (").append(getCategoryDataType()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getCategoryDataType ()))
+            .append(" (").append( getCategoryDataType() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/DefaultDataLabelTextProperties]\n");
+        buffer.append("[/DEFAULTTEXT]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_categoryDataType);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_categoryDataType);
 
         return getRecordSize();
     }
@@ -160,7 +165,7 @@ public class DefaultDataLabelTextPropertiesRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2;
+        return 4  + 2;
     }
 
     public short getSid()
@@ -169,14 +174,15 @@ public class DefaultDataLabelTextPropertiesRecord
     }
 
     public Object clone() {
-      DefaultDataLabelTextPropertiesRecord rec = new DefaultDataLabelTextPropertiesRecord();
-      
-      rec.field_1_categoryDataType = field_1_categoryDataType;
-
-      return rec;
+        DefaultDataLabelTextPropertiesRecord rec = new DefaultDataLabelTextPropertiesRecord();
+    
+        rec.field_1_categoryDataType = field_1_categoryDataType;
+        return rec;
     }
 
 
+
+
     /**
      * Get the category data type field for the DefaultDataLabelTextProperties record.
      *
index 4fce96de141d508b36d973de7cf61e3942d3ddd8..545420744fcfdca832b38ed9722b36ebd07e7457 100644 (file)
@@ -95,6 +95,7 @@ public class FontBasisRecord
     public FontBasisRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -110,6 +111,7 @@ public class FontBasisRecord
     public FontBasisRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -127,11 +129,13 @@ public class FontBasisRecord
 
     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);
-        field_3_heightBasis             = LittleEndian.getShort(data, 0x4 + offset);
-        field_4_scale                   = LittleEndian.getShort(data, 0x6 + offset);
-        field_5_indexToFontTable        = LittleEndian.getShort(data, 0x8 + offset);
+
+        int pos = 0;
+        field_1_xBasis                 = LittleEndian.getShort(data, pos + 0x0 + offset);
+        field_2_yBasis                 = LittleEndian.getShort(data, pos + 0x2 + 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();
 
-        buffer.append("[FontBasis]\n");
-
+        buffer.append("[FBI]\n");
         buffer.append("    .xBasis               = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getXBasis()))
-            .append(" (").append(getXBasis()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getXBasis ()))
+            .append(" (").append( getXBasis() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .yBasis               = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getYBasis()))
-            .append(" (").append(getYBasis()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getYBasis ()))
+            .append(" (").append( getYBasis() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .heightBasis          = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getHeightBasis()))
-            .append(" (").append(getHeightBasis()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getHeightBasis ()))
+            .append(" (").append( getHeightBasis() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .scale                = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getScale()))
-            .append(" (").append(getScale()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getScale ()))
+            .append(" (").append( getScale() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .indexToFontTable     = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getIndexToFontTable()))
-            .append(" (").append(getIndexToFontTable()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getIndexToFontTable ()))
+            .append(" (").append( getIndexToFontTable() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/FontBasis]\n");
+        buffer.append("[/FBI]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_xBasis);
-        LittleEndian.putShort(data, 6 + offset, field_2_yBasis);
-        LittleEndian.putShort(data, 8 + offset, field_3_heightBasis);
-        LittleEndian.putShort(data, 10 + offset, field_4_scale);
-        LittleEndian.putShort(data, 12 + offset, field_5_indexToFontTable);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_xBasis);
+        LittleEndian.putShort(data, 6 + offset + pos, field_2_yBasis);
+        LittleEndian.putShort(data, 8 + offset + pos, field_3_heightBasis);
+        LittleEndian.putShort(data, 10 + offset + pos, field_4_scale);
+        LittleEndian.putShort(data, 12 + offset + pos, field_5_indexToFontTable);
 
         return getRecordSize();
     }
@@ -189,7 +190,7 @@ public class FontBasisRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2 + 2 + 2 + 2 + 2;
+        return 4  + 2 + 2 + 2 + 2 + 2;
     }
 
     public short getSid()
@@ -198,18 +199,19 @@ public class FontBasisRecord
     }
 
     public Object clone() {
-      FontBasisRecord rec = new FontBasisRecord();
-      
-      rec.field_1_xBasis = field_1_xBasis;
-      rec.field_2_yBasis = field_2_yBasis;
-      rec.field_3_heightBasis = field_3_heightBasis;
-      rec.field_4_scale = field_4_scale;
-      rec.field_5_indexToFontTable = field_5_indexToFontTable;
-
-      return rec;
+        FontBasisRecord rec = new FontBasisRecord();
+    
+        rec.field_1_xBasis = field_1_xBasis;
+        rec.field_2_yBasis = field_2_yBasis;
+        rec.field_3_heightBasis = field_3_heightBasis;
+        rec.field_4_scale = field_4_scale;
+        rec.field_5_indexToFontTable = field_5_indexToFontTable;
+        return rec;
     }
 
 
+
+
     /**
      * Get the x Basis field for the FontBasis record.
      */
index f06d9af62939248e17967d456e8a8c7286e4e51e..9ceec5c5adedbd0005ebb0b7dba2c4cea8ecaac9 100644 (file)
@@ -91,6 +91,7 @@ public class FontIndexRecord
     public FontIndexRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -106,6 +107,7 @@ public class FontIndexRecord
     public FontIndexRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -123,7 +125,9 @@ public class FontIndexRecord
 
     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();
 
-        buffer.append("[FontIndex]\n");
-
+        buffer.append("[FONTX]\n");
         buffer.append("    .fontIndex            = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getFontIndex()))
-            .append(" (").append(getFontIndex()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getFontIndex ()))
+            .append(" (").append( getFontIndex() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/FontIndex]\n");
+        buffer.append("[/FONTX]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_fontIndex);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_fontIndex);
 
         return getRecordSize();
     }
@@ -157,7 +162,7 @@ public class FontIndexRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2;
+        return 4  + 2;
     }
 
     public short getSid()
@@ -166,14 +171,15 @@ public class FontIndexRecord
     }
 
     public Object clone() {
-      FontIndexRecord rec = new FontIndexRecord();
-      
-      rec.field_1_fontIndex = field_1_fontIndex;
-
-      return rec;
+        FontIndexRecord rec = new FontIndexRecord();
+    
+        rec.field_1_fontIndex = field_1_fontIndex;
+        return rec;
     }
 
 
+
+
     /**
      * Get the font index field for the FontIndex record.
      */
index 94893f2530796bfe51e82fd0af2e69b806c2ad0f..de4e99786d8b6c9b229d7cf4f2e36bac25f12896 100644 (file)
@@ -96,6 +96,7 @@ public class FrameRecord
     public FrameRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -111,6 +112,7 @@ public class FrameRecord
     public FrameRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -128,8 +130,10 @@ public class FrameRecord
 
     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();
 
-        buffer.append("[Frame]\n");
-
+        buffer.append("[FRAME]\n");
         buffer.append("    .borderType           = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getBorderType()))
-            .append(" (").append(getBorderType()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getBorderType ()))
+            .append(" (").append( getBorderType() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .options              = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getOptions()))
-            .append(" (").append(getOptions()).append(" )\n");
-        buffer.append("         .autoSize                 = ").append(isAutoSize            ()).append('\n');
-        buffer.append("         .autoPosition             = ").append(isAutoPosition        ()).append('\n');
+            .append("0x").append(HexDump.toHex(  getOptions ()))
+            .append(" (").append( getOptions() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .autoSize                 = ").append(isAutoSize()).append('\n'); 
+        buffer.append("         .autoPosition             = ").append(isAutoPosition()).append('\n'); 
 
-        buffer.append("[/Frame]\n");
+        buffer.append("[/FRAME]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_borderType);
-        LittleEndian.putShort(data, 6 + offset, field_2_options);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_borderType);
+        LittleEndian.putShort(data, 6 + offset + pos, field_2_options);
 
         return getRecordSize();
     }
@@ -171,7 +175,7 @@ public class FrameRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2 + 2;
+        return 4  + 2 + 2;
     }
 
     public short getSid()
@@ -180,15 +184,16 @@ public class FrameRecord
     }
 
     public Object clone() {
-      FrameRecord rec = new FrameRecord();
-      
-      rec.field_1_borderType = field_1_borderType;
-      rec.field_2_options = field_2_options;
-
-      return rec;
+        FrameRecord rec = new FrameRecord();
+    
+        rec.field_1_borderType = field_1_borderType;
+        rec.field_2_options = field_2_options;
+        return rec;
     }
 
 
+
+
     /**
      * Get the border type field for the Frame record.
      *
index 32a0df01a59cf02c484a78e0f715dc53a03ce65c..bbfea5ad21620f504d1a5d1dd73b8c1e911785af 100644 (file)
@@ -112,6 +112,7 @@ public class LegendRecord
     public LegendRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -127,6 +128,7 @@ public class LegendRecord
     public LegendRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -144,13 +146,15 @@ public class LegendRecord
 
     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);
-        field_3_xSize                   = LittleEndian.getInt(data, 0x8 + offset);
-        field_4_ySize                   = LittleEndian.getInt(data, 0xc + offset);
-        field_5_type                    = data[ 0x10 + offset ];
-        field_6_spacing                 = data[ 0x11 + offset ];
-        field_7_options                 = LittleEndian.getShort(data, 0x12 + offset);
+
+        int pos = 0;
+        field_1_xAxisUpperLeft         = LittleEndian.getInt(data, pos + 0x0 + offset);
+        field_2_yAxisUpperLeft         = LittleEndian.getInt(data, pos + 0x4 + offset);
+        field_3_xSize                  = LittleEndian.getInt(data, pos + 0x8 + offset);
+        field_4_ySize                  = LittleEndian.getInt(data, pos + 0xc + 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,65 +162,60 @@ public class LegendRecord
     {
         StringBuffer buffer = new StringBuffer();
 
-        buffer.append("[Legend]\n");
-
+        buffer.append("[LEGEND]\n");
         buffer.append("    .xAxisUpperLeft       = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getXAxisUpperLeft()))
-            .append(" (").append(getXAxisUpperLeft()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getXAxisUpperLeft ()))
+            .append(" (").append( getXAxisUpperLeft() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .yAxisUpperLeft       = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getYAxisUpperLeft()))
-            .append(" (").append(getYAxisUpperLeft()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getYAxisUpperLeft ()))
+            .append(" (").append( getYAxisUpperLeft() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .xSize                = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getXSize()))
-            .append(" (").append(getXSize()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getXSize ()))
+            .append(" (").append( getXSize() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .ySize                = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getYSize()))
-            .append(" (").append(getYSize()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getYSize ()))
+            .append(" (").append( getYSize() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .type                 = ")
-            .append("0x")
-            .append(HexDump.toHex((byte)getType()))
-            .append(" (").append(getType()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getType ()))
+            .append(" (").append( getType() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .spacing              = ")
-            .append("0x")
-            .append(HexDump.toHex((byte)getSpacing()))
-            .append(" (").append(getSpacing()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getSpacing ()))
+            .append(" (").append( getSpacing() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .options              = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getOptions()))
-            .append(" (").append(getOptions()).append(" )\n");
-        buffer.append("         .autoPosition             = ").append(isAutoPosition        ()).append('\n');
-        buffer.append("         .autoSeries               = ").append(isAutoSeries          ()).append('\n');
-        buffer.append("         .autoXPositioning         = ").append(isAutoXPositioning    ()).append('\n');
-        buffer.append("         .autoYPositioning         = ").append(isAutoYPositioning    ()).append('\n');
-        buffer.append("         .vertical                 = ").append(isVertical            ()).append('\n');
-        buffer.append("         .dataTable                = ").append(isDataTable           ()).append('\n');
-
-        buffer.append("[/Legend]\n");
+            .append("0x").append(HexDump.toHex(  getOptions ()))
+            .append(" (").append( getOptions() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .autoPosition             = ").append(isAutoPosition()).append('\n'); 
+        buffer.append("         .autoSeries               = ").append(isAutoSeries()).append('\n'); 
+        buffer.append("         .autoXPositioning         = ").append(isAutoXPositioning()).append('\n'); 
+        buffer.append("         .autoYPositioning         = ").append(isAutoYPositioning()).append('\n'); 
+        buffer.append("         .vertical                 = ").append(isVertical()).append('\n'); 
+        buffer.append("         .dataTable                = ").append(isDataTable()).append('\n'); 
+
+        buffer.append("[/LEGEND]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putInt(data, 4 + offset, field_1_xAxisUpperLeft);
-        LittleEndian.putInt(data, 8 + offset, field_2_yAxisUpperLeft);
-        LittleEndian.putInt(data, 12 + offset, field_3_xSize);
-        LittleEndian.putInt(data, 16 + offset, field_4_ySize);
-        data[ 20 + offset ] = field_5_type;
-        data[ 21 + offset ] = field_6_spacing;
-        LittleEndian.putShort(data, 22 + offset, field_7_options);
+        LittleEndian.putInt(data, 4 + offset + pos, field_1_xAxisUpperLeft);
+        LittleEndian.putInt(data, 8 + offset + pos, field_2_yAxisUpperLeft);
+        LittleEndian.putInt(data, 12 + offset + pos, field_3_xSize);
+        LittleEndian.putInt(data, 16 + offset + pos, field_4_ySize);
+        data[ 20 + offset + pos ] = field_5_type;
+        data[ 21 + offset + pos ] = field_6_spacing;
+        LittleEndian.putShort(data, 22 + offset + pos, field_7_options);
 
         return getRecordSize();
     }
@@ -235,20 +234,21 @@ public class LegendRecord
     }
 
     public Object clone() {
-      LegendRecord rec = new LegendRecord();
-      
-      rec.field_1_xAxisUpperLeft = field_1_xAxisUpperLeft;
-      rec.field_2_yAxisUpperLeft = field_2_yAxisUpperLeft;
-      rec.field_3_xSize = field_3_xSize;
-      rec.field_4_ySize = field_4_ySize;
-      rec.field_5_type = field_5_type;
-      rec.field_6_spacing = field_6_spacing;
-      rec.field_7_options = field_7_options;
-
-      return rec;
+        LegendRecord rec = new LegendRecord();
+    
+        rec.field_1_xAxisUpperLeft = field_1_xAxisUpperLeft;
+        rec.field_2_yAxisUpperLeft = field_2_yAxisUpperLeft;
+        rec.field_3_xSize = field_3_xSize;
+        rec.field_4_ySize = field_4_ySize;
+        rec.field_5_type = field_5_type;
+        rec.field_6_spacing = field_6_spacing;
+        rec.field_7_options = field_7_options;
+        return rec;
     }
 
 
+
+
     /**
      * Get the x axis upper left field for the Legend record.
      */
index 3bbec3859d105514aa96bb370d3bf9621a454a4d..6e4ba8c9b2d24cf8a489562bd941ad1abeb4cfac 100644 (file)
@@ -111,6 +111,7 @@ public class LineFormatRecord
     public LineFormatRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -126,6 +127,7 @@ public class LineFormatRecord
     public LineFormatRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -143,11 +145,13 @@ public class LineFormatRecord
 
     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);
-        field_3_weight                  = LittleEndian.getShort(data, 0x6 + offset);
-        field_4_format                  = LittleEndian.getShort(data, 0x8 + offset);
-        field_5_colourPaletteIndex      = LittleEndian.getShort(data, 0xa + offset);
+
+        int pos = 0;
+        field_1_lineColor              = LittleEndian.getInt(data, pos + 0x0 + offset);
+        field_2_linePattern            = LittleEndian.getShort(data, pos + 0x4 + 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();
 
-        buffer.append("[LineFormat]\n");
-
+        buffer.append("[LINEFORMAT]\n");
         buffer.append("    .lineColor            = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getLineColor()))
-            .append(" (").append(getLineColor()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getLineColor ()))
+            .append(" (").append( getLineColor() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .linePattern          = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getLinePattern()))
-            .append(" (").append(getLinePattern()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getLinePattern ()))
+            .append(" (").append( getLinePattern() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .weight               = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getWeight()))
-            .append(" (").append(getWeight()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getWeight ()))
+            .append(" (").append( getWeight() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .format               = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getFormat()))
-            .append(" (").append(getFormat()).append(" )\n");
-        buffer.append("         .auto                     = ").append(isAuto                ()).append('\n');
-        buffer.append("         .drawTicks                = ").append(isDrawTicks           ()).append('\n');
-        buffer.append("         .unknown                  = ").append(isUnknown             ()).append('\n');
-
+            .append("0x").append(HexDump.toHex(  getFormat ()))
+            .append(" (").append( getFormat() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .auto                     = ").append(isAuto()).append('\n'); 
+        buffer.append("         .drawTicks                = ").append(isDrawTicks()).append('\n'); 
+        buffer.append("         .unknown                  = ").append(isUnknown()).append('\n'); 
         buffer.append("    .colourPaletteIndex   = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getColourPaletteIndex()))
-            .append(" (").append(getColourPaletteIndex()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getColourPaletteIndex ()))
+            .append(" (").append( getColourPaletteIndex() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/LineFormat]\n");
+        buffer.append("[/LINEFORMAT]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putInt(data, 4 + offset, field_1_lineColor);
-        LittleEndian.putShort(data, 8 + offset, field_2_linePattern);
-        LittleEndian.putShort(data, 10 + offset, field_3_weight);
-        LittleEndian.putShort(data, 12 + offset, field_4_format);
-        LittleEndian.putShort(data, 14 + offset, field_5_colourPaletteIndex);
+        LittleEndian.putInt(data, 4 + offset + pos, field_1_lineColor);
+        LittleEndian.putShort(data, 8 + offset + pos, field_2_linePattern);
+        LittleEndian.putShort(data, 10 + offset + pos, field_3_weight);
+        LittleEndian.putShort(data, 12 + offset + pos, field_4_format);
+        LittleEndian.putShort(data, 14 + offset + pos, field_5_colourPaletteIndex);
 
         return getRecordSize();
     }
@@ -208,7 +209,7 @@ public class LineFormatRecord
      */
     public int getRecordSize()
     {
-        return 4 + 4 + 2 + 2 + 2 + 2;
+        return 4  + 4 + 2 + 2 + 2 + 2;
     }
 
     public short getSid()
@@ -217,18 +218,19 @@ public class LineFormatRecord
     }
 
     public Object clone() {
-      LineFormatRecord rec = new LineFormatRecord();
-      
-      rec.field_1_lineColor = field_1_lineColor;
-      rec.field_2_linePattern = field_2_linePattern;
-      rec.field_3_weight = field_3_weight;
-      rec.field_4_format = field_4_format;
-      rec.field_5_colourPaletteIndex = field_5_colourPaletteIndex;
-
-      return rec;
+        LineFormatRecord rec = new LineFormatRecord();
+    
+        rec.field_1_lineColor = field_1_lineColor;
+        rec.field_2_linePattern = field_2_linePattern;
+        rec.field_3_weight = field_3_weight;
+        rec.field_4_format = field_4_format;
+        rec.field_5_colourPaletteIndex = field_5_colourPaletteIndex;
+        return rec;
     }
 
 
+
+
     /**
      * Get the line color field for the LineFormat record.
      */
diff --git a/src/java/org/apache/poi/hssf/record/LinkedDataFormulaField.java b/src/java/org/apache/poi/hssf/record/LinkedDataFormulaField.java
new file mode 100644 (file)
index 0000000..ac3ced6
--- /dev/null
@@ -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;
+    }
+
+}
index 45118d7bc4ae588bf22e207ca27ecd0dc6e8654d..a7a1f95edd05bb972fe146c444dbe124c500dae8 100644 (file)
@@ -84,7 +84,7 @@ public class LinkedDataRecord
     private  short      field_3_options;
     private  BitField   customNumberFormat                          = new BitField(0x1);
     private  short      field_4_indexNumberFmtRecord;
-    private  short      field_5_formulaOfLink;
+    private  LinkedDataFormulaField field_5_formulaOfLink = new org.apache.poi.hssf.record.LinkedDataFormulaField();
 
 
     public LinkedDataRecord()
@@ -104,6 +104,7 @@ public class LinkedDataRecord
     public LinkedDataRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -119,6 +120,7 @@ public class LinkedDataRecord
     public LinkedDataRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -136,11 +138,14 @@ public class LinkedDataRecord
 
     protected void fillFields(byte [] data, short size, int offset)
     {
-        field_1_linkType                = data[ 0x0 + offset ];
-        field_2_referenceType           = data[ 0x1 + offset ];
-        field_3_options                 = LittleEndian.getShort(data, 0x2 + offset);
-        field_4_indexNumberFmtRecord    = LittleEndian.getShort(data, 0x4 + offset);
-        field_5_formulaOfLink           = LittleEndian.getShort(data, 0x6 + offset);
+
+        int pos = 0;
+        field_1_linkType               = data[ pos + 0x0 + offset ];
+        field_2_referenceType          = data[ pos + 0x1 + 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();
 
-        buffer.append("[LinkedData]\n");
-
+        buffer.append("[AI]\n");
         buffer.append("    .linkType             = ")
-            .append("0x")
-            .append(HexDump.toHex((byte)getLinkType()))
-            .append(" (").append(getLinkType()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getLinkType ()))
+            .append(" (").append( getLinkType() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .referenceType        = ")
-            .append("0x")
-            .append(HexDump.toHex((byte)getReferenceType()))
-            .append(" (").append(getReferenceType()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getReferenceType ()))
+            .append(" (").append( getReferenceType() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .options              = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getOptions()))
-            .append(" (").append(getOptions()).append(" )\n");
-        buffer.append("         .customNumberFormat       = ").append(isCustomNumberFormat  ()).append('\n');
-
+            .append("0x").append(HexDump.toHex(  getOptions ()))
+            .append(" (").append( getOptions() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .customNumberFormat       = ").append(isCustomNumberFormat()).append('\n'); 
         buffer.append("    .indexNumberFmtRecord = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getIndexNumberFmtRecord()))
-            .append(" (").append(getIndexNumberFmtRecord()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getIndexNumberFmtRecord ()))
+            .append(" (").append( getIndexNumberFmtRecord() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .formulaOfLink        = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getFormulaOfLink()))
-            .append(" (").append(getFormulaOfLink()).append(" )\n");
+            .append(" (").append( getFormulaOfLink() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/LinkedData]\n");
+        buffer.append("[/AI]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        data[ 4 + offset ] = field_1_linkType;
-        data[ 5 + offset ] = field_2_referenceType;
-        LittleEndian.putShort(data, 6 + offset, field_3_options);
-        LittleEndian.putShort(data, 8 + offset, field_4_indexNumberFmtRecord);
-        LittleEndian.putShort(data, 10 + offset, field_5_formulaOfLink);
+        data[ 4 + offset + pos ] = field_1_linkType;
+        data[ 5 + offset + pos ] = field_2_referenceType;
+        LittleEndian.putShort(data, 6 + offset + pos, field_3_options);
+        LittleEndian.putShort(data, 8 + offset + pos, field_4_indexNumberFmtRecord);
+        pos += field_5_formulaOfLink.serializeField( pos + offset, data );
 
         return getRecordSize();
     }
@@ -199,7 +200,7 @@ public class LinkedDataRecord
      */
     public int getRecordSize()
     {
-        return 4 + 1 + 1 + 2 + 2 + 2;
+        return 4  + 1 + 1 + 2 + 2 + field_5_formulaOfLink.getSize();
     }
 
     public short getSid()
@@ -208,18 +209,19 @@ public class LinkedDataRecord
     }
 
     public Object clone() {
-      LinkedDataRecord rec = new LinkedDataRecord();
-      
-      rec.field_1_linkType = field_1_linkType;
-      rec.field_2_referenceType = field_2_referenceType;
-      rec.field_3_options = field_3_options;
-      rec.field_4_indexNumberFmtRecord = field_4_indexNumberFmtRecord;
-      rec.field_5_formulaOfLink = field_5_formulaOfLink;
-
-      return rec;
+        LinkedDataRecord rec = new LinkedDataRecord();
+    
+        rec.field_1_linkType = field_1_linkType;
+        rec.field_2_referenceType = field_2_referenceType;
+        rec.field_3_options = field_3_options;
+        rec.field_4_indexNumberFmtRecord = field_4_indexNumberFmtRecord;
+        rec.field_5_formulaOfLink = ((org.apache.poi.hssf.record.LinkedDataFormulaField)field_5_formulaOfLink.clone());;
+        return rec;
     }
 
 
+
+
     /**
      * 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.
      */
-    public short getFormulaOfLink()
+    public LinkedDataFormulaField getFormulaOfLink()
     {
         return field_5_formulaOfLink;
     }
@@ -321,7 +323,7 @@ public class LinkedDataRecord
     /**
      * 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;
     }
index eb5c9bfb55d3d99568ef7bf699598d6d43116830..bd814a8b55dd33e723d2731114c8573d4fafd53b 100644 (file)
@@ -91,6 +91,7 @@ public class NumberFormatIndexRecord
     public NumberFormatIndexRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -106,6 +107,7 @@ public class NumberFormatIndexRecord
     public NumberFormatIndexRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -123,7 +125,9 @@ public class NumberFormatIndexRecord
 
     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();
 
-        buffer.append("[NumberFormatIndex]\n");
-
+        buffer.append("[IFMT]\n");
         buffer.append("    .formatIndex          = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getFormatIndex()))
-            .append(" (").append(getFormatIndex()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getFormatIndex ()))
+            .append(" (").append( getFormatIndex() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/NumberFormatIndex]\n");
+        buffer.append("[/IFMT]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_formatIndex);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_formatIndex);
 
         return getRecordSize();
     }
@@ -157,7 +162,7 @@ public class NumberFormatIndexRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2;
+        return 4  + 2;
     }
 
     public short getSid()
@@ -166,14 +171,15 @@ public class NumberFormatIndexRecord
     }
 
     public Object clone() {
-      NumberFormatIndexRecord rec = new NumberFormatIndexRecord();
-      
-      rec.field_1_formatIndex = field_1_formatIndex;
-
-      return rec;
+        NumberFormatIndexRecord rec = new NumberFormatIndexRecord();
+    
+        rec.field_1_formatIndex = field_1_formatIndex;
+        return rec;
     }
 
 
+
+
     /**
      * Get the format index field for the NumberFormatIndex record.
      */
index 07da0a220e7d69d31781b1d6e334d11fa9428566..554274ccade6a3792918b7a8956c928a81de50cf 100644 (file)
@@ -98,6 +98,7 @@ public class ObjectLinkRecord
     public ObjectLinkRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -113,6 +114,7 @@ public class ObjectLinkRecord
     public ObjectLinkRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -130,9 +132,11 @@ public class ObjectLinkRecord
 
     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);
-        field_3_link2                   = LittleEndian.getShort(data, 0x4 + offset);
+
+        int pos = 0;
+        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();
 
-        buffer.append("[ObjectLink]\n");
-
+        buffer.append("[OBJECTLINK]\n");
         buffer.append("    .anchorId             = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getAnchorId()))
-            .append(" (").append(getAnchorId()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getAnchorId ()))
+            .append(" (").append( getAnchorId() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .link1                = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getLink1()))
-            .append(" (").append(getLink1()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getLink1 ()))
+            .append(" (").append( getLink1() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .link2                = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getLink2()))
-            .append(" (").append(getLink2()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getLink2 ()))
+            .append(" (").append( getLink2() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/ObjectLink]\n");
+        buffer.append("[/OBJECTLINK]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_anchorId);
-        LittleEndian.putShort(data, 6 + offset, field_2_link1);
-        LittleEndian.putShort(data, 8 + offset, field_3_link2);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_anchorId);
+        LittleEndian.putShort(data, 6 + offset + pos, field_2_link1);
+        LittleEndian.putShort(data, 8 + offset + pos, field_3_link2);
 
         return getRecordSize();
     }
@@ -187,16 +190,17 @@ public class ObjectLinkRecord
     }
 
     public Object clone() {
-      ObjectLinkRecord rec = new ObjectLinkRecord();
-      
-      rec.field_1_anchorId = field_1_anchorId;
-      rec.field_2_link1 = field_2_link1;
-      rec.field_3_link2 = field_3_link2;
-
-      return rec;
+        ObjectLinkRecord rec = new ObjectLinkRecord();
+    
+        rec.field_1_anchorId = field_1_anchorId;
+        rec.field_2_link1 = field_2_link1;
+        rec.field_3_link2 = field_3_link2;
+        return rec;
     }
 
 
+
+
     /**
      * Get the anchor id field for the ObjectLink record.
      *
index 0aa312dad432105f9e19abf61ae1e90e2f84568d..c5d276d02aa7442c49f21c30a57af9481ccf1786 100644 (file)
@@ -90,6 +90,7 @@ public class PlotAreaRecord
     public PlotAreaRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -105,6 +106,7 @@ public class PlotAreaRecord
     public PlotAreaRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -123,20 +125,24 @@ public class PlotAreaRecord
     protected void fillFields(byte [] data, short size, int offset)
     {
 
+        int pos = 0;
+
     }
 
     public String toString()
     {
         StringBuffer buffer = new StringBuffer();
 
-        buffer.append("[PlotArea]\n");
+        buffer.append("[PLOTAREA]\n");
 
-        buffer.append("[/PlotArea]\n");
+        buffer.append("[/PLOTAREA]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
@@ -158,14 +164,15 @@ public class PlotAreaRecord
     }
 
     public Object clone() {
-      PlotAreaRecord rec = new PlotAreaRecord();
-      
-
-      return rec;
+        PlotAreaRecord rec = new PlotAreaRecord();
+    
+        return rec;
     }
 
 
 
+
+
 }  // END OF CLASS
 
 
index 77ba0e6614e9a087782eab6a877d624888e59169..8aa437e559d3ecc2748a2fc850c17f2c8a438aff 100644 (file)
@@ -92,6 +92,7 @@ public class PlotGrowthRecord
     public PlotGrowthRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -107,6 +108,7 @@ public class PlotGrowthRecord
     public PlotGrowthRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -124,8 +126,10 @@ public class PlotGrowthRecord
 
     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();
 
-        buffer.append("[PlotGrowth]\n");
-
+        buffer.append("[PLOTGROWTH]\n");
         buffer.append("    .horizontalScale      = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getHorizontalScale()))
-            .append(" (").append(getHorizontalScale()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getHorizontalScale ()))
+            .append(" (").append( getHorizontalScale() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .verticalScale        = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getVerticalScale()))
-            .append(" (").append(getVerticalScale()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getVerticalScale ()))
+            .append(" (").append( getVerticalScale() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/PlotGrowth]\n");
+        buffer.append("[/PLOTGROWTH]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putInt(data, 4 + offset, field_1_horizontalScale);
-        LittleEndian.putInt(data, 8 + offset, field_2_verticalScale);
+        LittleEndian.putInt(data, 4 + offset + pos, field_1_horizontalScale);
+        LittleEndian.putInt(data, 8 + offset + pos, field_2_verticalScale);
 
         return getRecordSize();
     }
@@ -165,7 +169,7 @@ public class PlotGrowthRecord
      */
     public int getRecordSize()
     {
-        return 4 + 4 + 4;
+        return 4  + 4 + 4;
     }
 
     public short getSid()
@@ -174,15 +178,16 @@ public class PlotGrowthRecord
     }
 
     public Object clone() {
-      PlotGrowthRecord rec = new PlotGrowthRecord();
-      
-      rec.field_1_horizontalScale = field_1_horizontalScale;
-      rec.field_2_verticalScale = field_2_verticalScale;
-
-      return rec;
+        PlotGrowthRecord rec = new PlotGrowthRecord();
+    
+        rec.field_1_horizontalScale = field_1_horizontalScale;
+        rec.field_2_verticalScale = field_2_verticalScale;
+        return rec;
     }
 
 
+
+
     /**
      * Get the horizontalScale field for the PlotGrowth record.
      */
index cec3a73db937677c64bfe8322ca61edd080278ce..8e59eba5827ede4b5cab271f0e7b533a68b9c8a9 100644 (file)
@@ -92,6 +92,7 @@ public class SCLRecord
     public SCLRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -107,6 +108,7 @@ public class SCLRecord
     public SCLRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -124,8 +126,10 @@ public class SCLRecord
 
     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();
 
         buffer.append("[SCL]\n");
-
         buffer.append("    .numerator            = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getNumerator()))
-            .append(" (").append(getNumerator()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getNumerator ()))
+            .append(" (").append( getNumerator() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .denominator          = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getDenominator()))
-            .append(" (").append(getDenominator()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getDenominator ()))
+            .append(" (").append( getDenominator() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
         buffer.append("[/SCL]\n");
         return buffer.toString();
@@ -151,11 +153,13 @@ public class SCLRecord
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_numerator);
-        LittleEndian.putShort(data, 6 + offset, field_2_denominator);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_numerator);
+        LittleEndian.putShort(data, 6 + offset + pos, field_2_denominator);
 
         return getRecordSize();
     }
@@ -165,7 +169,7 @@ public class SCLRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2 + 2;
+        return 4  + 2 + 2;
     }
 
     public short getSid()
@@ -174,15 +178,16 @@ public class SCLRecord
     }
 
     public Object clone() {
-      SCLRecord rec = new SCLRecord();
-      
-      rec.field_1_numerator = field_1_numerator;
-      rec.field_2_denominator = field_2_denominator;
-
-      return rec;
+        SCLRecord rec = new SCLRecord();
+    
+        rec.field_1_numerator = field_1_numerator;
+        rec.field_2_denominator = field_2_denominator;
+        return rec;
     }
 
 
+
+
     /**
      * Get the numerator field for the SCL record.
      */
index e0414e13722fc5a5fa954e117362d51161bcc31c..4362411f64eb247b76772ec1de5c828e9f2c7d76 100644 (file)
@@ -91,6 +91,7 @@ public class SeriesChartGroupIndexRecord
     public SeriesChartGroupIndexRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -106,6 +107,7 @@ public class SeriesChartGroupIndexRecord
     public SeriesChartGroupIndexRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -123,7 +125,9 @@ public class SeriesChartGroupIndexRecord
 
     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();
 
-        buffer.append("[SeriesChartGroupIndex]\n");
-
+        buffer.append("[SERTOCRT]\n");
         buffer.append("    .chartGroupIndex      = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getChartGroupIndex()))
-            .append(" (").append(getChartGroupIndex()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getChartGroupIndex ()))
+            .append(" (").append( getChartGroupIndex() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/SeriesChartGroupIndex]\n");
+        buffer.append("[/SERTOCRT]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_chartGroupIndex);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_chartGroupIndex);
 
         return getRecordSize();
     }
@@ -157,7 +162,7 @@ public class SeriesChartGroupIndexRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2;
+        return 4  + 2;
     }
 
     public short getSid()
@@ -166,14 +171,15 @@ public class SeriesChartGroupIndexRecord
     }
 
     public Object clone() {
-      SeriesChartGroupIndexRecord rec = new SeriesChartGroupIndexRecord();
-      
-      rec.field_1_chartGroupIndex = field_1_chartGroupIndex;
-
-      return rec;
+        SeriesChartGroupIndexRecord rec = new SeriesChartGroupIndexRecord();
+    
+        rec.field_1_chartGroupIndex = field_1_chartGroupIndex;
+        return rec;
     }
 
 
+
+
     /**
      * Get the chart group index field for the SeriesChartGroupIndex record.
      */
index 6e920b41ff7daf47244b4eba73a879e88d446b6e..49e36f7fa4f240b323c79ed27bba623dc7a8e4a4 100644 (file)
@@ -91,6 +91,7 @@ public class SeriesIndexRecord
     public SeriesIndexRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -106,6 +107,7 @@ public class SeriesIndexRecord
     public SeriesIndexRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -123,7 +125,9 @@ public class SeriesIndexRecord
 
     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();
 
-        buffer.append("[SeriesIndex]\n");
-
+        buffer.append("[SINDEX]\n");
         buffer.append("    .index                = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getIndex()))
-            .append(" (").append(getIndex()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getIndex ()))
+            .append(" (").append( getIndex() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/SeriesIndex]\n");
+        buffer.append("[/SINDEX]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_index);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_index);
 
         return getRecordSize();
     }
@@ -166,14 +171,15 @@ public class SeriesIndexRecord
     }
 
     public Object clone() {
-      SeriesIndexRecord rec = new SeriesIndexRecord();
-      
-      rec.field_1_index = field_1_index;
-
-      return rec;
+        SeriesIndexRecord rec = new SeriesIndexRecord();
+    
+        rec.field_1_index = field_1_index;
+        return rec;
     }
 
 
+
+
     /**
      * Get the index field for the SeriesIndex record.
      */
index da800664cc31298375cd58573b04e596ae24bfde..f17d40d42d81a08b4a65af5a8405ed190c8c3a23 100644 (file)
@@ -97,6 +97,7 @@ public class SeriesLabelsRecord
     public SeriesLabelsRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -112,6 +113,7 @@ public class SeriesLabelsRecord
     public SeriesLabelsRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -129,7 +131,9 @@ public class SeriesLabelsRecord
 
     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,29 +141,30 @@ public class SeriesLabelsRecord
     {
         StringBuffer buffer = new StringBuffer();
 
-        buffer.append("[SeriesLabels]\n");
-
+        buffer.append("[ATTACHEDLABEL]\n");
         buffer.append("    .formatFlags          = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getFormatFlags()))
-            .append(" (").append(getFormatFlags()).append(" )\n");
-        buffer.append("         .showActual               = ").append(isShowActual          ()).append('\n');
-        buffer.append("         .showPercent              = ").append(isShowPercent         ()).append('\n');
-        buffer.append("         .labelAsPercentage        = ").append(isLabelAsPercentage   ()).append('\n');
-        buffer.append("         .smoothedLine             = ").append(isSmoothedLine        ()).append('\n');
-        buffer.append("         .showLabel                = ").append(isShowLabel           ()).append('\n');
-        buffer.append("         .showBubbleSizes          = ").append(isShowBubbleSizes     ()).append('\n');
-
-        buffer.append("[/SeriesLabels]\n");
+            .append("0x").append(HexDump.toHex(  getFormatFlags ()))
+            .append(" (").append( getFormatFlags() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .showActual               = ").append(isShowActual()).append('\n'); 
+        buffer.append("         .showPercent              = ").append(isShowPercent()).append('\n'); 
+        buffer.append("         .labelAsPercentage        = ").append(isLabelAsPercentage()).append('\n'); 
+        buffer.append("         .smoothedLine             = ").append(isSmoothedLine()).append('\n'); 
+        buffer.append("         .showLabel                = ").append(isShowLabel()).append('\n'); 
+        buffer.append("         .showBubbleSizes          = ").append(isShowBubbleSizes()).append('\n'); 
+
+        buffer.append("[/ATTACHEDLABEL]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_formatFlags);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_formatFlags);
 
         return getRecordSize();
     }
@@ -169,7 +174,7 @@ public class SeriesLabelsRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2;
+        return 4  + 2;
     }
 
     public short getSid()
@@ -178,14 +183,15 @@ public class SeriesLabelsRecord
     }
 
     public Object clone() {
-      SeriesLabelsRecord rec = new SeriesLabelsRecord();
-      
-      rec.field_1_formatFlags = field_1_formatFlags;
-
-      return rec;
+        SeriesLabelsRecord rec = new SeriesLabelsRecord();
+    
+        rec.field_1_formatFlags = field_1_formatFlags;
+        return rec;
     }
 
 
+
+
     /**
      * Get the format flags field for the SeriesLabels record.
      */
index 284ad16507125aa7ca2b2004d6a0a55d8cd899cb..03098cea53944e8f27a56da4955d3fae8c7fe49c 100644 (file)
@@ -91,6 +91,7 @@ public class SeriesListRecord
     public SeriesListRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -106,6 +107,7 @@ public class SeriesListRecord
     public SeriesListRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -123,7 +125,9 @@ public class SeriesListRecord
 
     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();
 
-        buffer.append("[SeriesList]\n");
-
+        buffer.append("[SERIESLIST]\n");
         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();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShortArray(data, 4 + offset, field_1_seriesNumbers);
+        LittleEndian.putShortArray(data, 4 + offset + pos, field_1_seriesNumbers);
 
         return getRecordSize();
     }
@@ -155,7 +161,7 @@ public class SeriesListRecord
      */
     public int getRecordSize()
     {
-        return 4 + field_1_seriesNumbers.length * 2 + 2;
+        return 4  + field_1_seriesNumbers.length * 2 + 2;
     }
 
     public short getSid()
@@ -164,14 +170,15 @@ public class SeriesListRecord
     }
 
     public Object clone() {
-      SeriesListRecord rec = new SeriesListRecord();
-      
-      rec.field_1_seriesNumbers = field_1_seriesNumbers;
-
-      return rec;
+        SeriesListRecord rec = new SeriesListRecord();
+    
+        rec.field_1_seriesNumbers = field_1_seriesNumbers;
+        return rec;
     }
 
 
+
+
     /**
      * Get the series numbers field for the SeriesList record.
      */
index 780bf0064caf64155a262c0c2e42a4dcb623c7ba..e00b67833e87116aecaa31db87a8041a7b5270c2 100644 (file)
@@ -108,6 +108,7 @@ public class SeriesRecord
     public SeriesRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -123,6 +124,7 @@ public class SeriesRecord
     public SeriesRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -140,12 +142,14 @@ public class SeriesRecord
 
     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);
-        field_3_numCategories           = LittleEndian.getShort(data, 0x4 + offset);
-        field_4_numValues               = LittleEndian.getShort(data, 0x6 + offset);
-        field_5_bubbleSeriesType        = LittleEndian.getShort(data, 0x8 + offset);
-        field_6_numBubbleValues         = LittleEndian.getShort(data, 0xa + offset);
+
+        int pos = 0;
+        field_1_categoryDataType       = LittleEndian.getShort(data, pos + 0x0 + offset);
+        field_2_valuesDataType         = LittleEndian.getShort(data, pos + 0x2 + offset);
+        field_3_numCategories          = LittleEndian.getShort(data, pos + 0x4 + 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();
 
-        buffer.append("[Series]\n");
-
+        buffer.append("[SERIES]\n");
         buffer.append("    .categoryDataType     = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getCategoryDataType()))
-            .append(" (").append(getCategoryDataType()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getCategoryDataType ()))
+            .append(" (").append( getCategoryDataType() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .valuesDataType       = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getValuesDataType()))
-            .append(" (").append(getValuesDataType()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getValuesDataType ()))
+            .append(" (").append( getValuesDataType() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .numCategories        = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getNumCategories()))
-            .append(" (").append(getNumCategories()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getNumCategories ()))
+            .append(" (").append( getNumCategories() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .numValues            = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getNumValues()))
-            .append(" (").append(getNumValues()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getNumValues ()))
+            .append(" (").append( getNumValues() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .bubbleSeriesType     = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getBubbleSeriesType()))
-            .append(" (").append(getBubbleSeriesType()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getBubbleSeriesType ()))
+            .append(" (").append( getBubbleSeriesType() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .numBubbleValues      = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getNumBubbleValues()))
-            .append(" (").append(getNumBubbleValues()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getNumBubbleValues ()))
+            .append(" (").append( getNumBubbleValues() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/Series]\n");
+        buffer.append("[/SERIES]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_categoryDataType);
-        LittleEndian.putShort(data, 6 + offset, field_2_valuesDataType);
-        LittleEndian.putShort(data, 8 + offset, field_3_numCategories);
-        LittleEndian.putShort(data, 10 + offset, field_4_numValues);
-        LittleEndian.putShort(data, 12 + offset, field_5_bubbleSeriesType);
-        LittleEndian.putShort(data, 14 + offset, field_6_numBubbleValues);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_categoryDataType);
+        LittleEndian.putShort(data, 6 + offset + pos, field_2_valuesDataType);
+        LittleEndian.putShort(data, 8 + offset + pos, field_3_numCategories);
+        LittleEndian.putShort(data, 10 + offset + pos, field_4_numValues);
+        LittleEndian.putShort(data, 12 + offset + pos, field_5_bubbleSeriesType);
+        LittleEndian.putShort(data, 14 + offset + pos, field_6_numBubbleValues);
 
         return getRecordSize();
     }
@@ -209,7 +209,7 @@ public class SeriesRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2 + 2 + 2 + 2 + 2 + 2;
+        return 4  + 2 + 2 + 2 + 2 + 2 + 2;
     }
 
     public short getSid()
@@ -218,19 +218,20 @@ public class SeriesRecord
     }
 
     public Object clone() {
-      SeriesRecord rec = new SeriesRecord();
-      
-      rec.field_1_categoryDataType = field_1_categoryDataType;
-      rec.field_2_valuesDataType = field_2_valuesDataType;
-      rec.field_3_numCategories = field_3_numCategories;
-      rec.field_4_numValues = field_4_numValues;
-      rec.field_5_bubbleSeriesType = field_5_bubbleSeriesType;
-      rec.field_6_numBubbleValues = field_6_numBubbleValues;
-
-      return rec;
+        SeriesRecord rec = new SeriesRecord();
+    
+        rec.field_1_categoryDataType = field_1_categoryDataType;
+        rec.field_2_valuesDataType = field_2_valuesDataType;
+        rec.field_3_numCategories = field_3_numCategories;
+        rec.field_4_numValues = field_4_numValues;
+        rec.field_5_bubbleSeriesType = field_5_bubbleSeriesType;
+        rec.field_6_numBubbleValues = field_6_numBubbleValues;
+        return rec;
     }
 
 
+
+
     /**
      * Get the category data type field for the Series record.
      *
index cf60c6dfdf6af57832399b04e59e49c723dbccff..a9b624cb3728b106f6f025606e5a2ae4962312ac 100644 (file)
@@ -94,6 +94,7 @@ public class SeriesTextRecord
     public SeriesTextRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -109,6 +110,7 @@ public class SeriesTextRecord
     public SeriesTextRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -126,10 +128,12 @@ public class SeriesTextRecord
 
     protected void fillFields(byte [] data, short size, int offset)
     {
-        field_1_id                      = LittleEndian.getShort(data, 0x0 + offset);
-        field_2_textLength              = data[ 0x2 + offset ];
-        field_3_undocumented            = data[ 0x3 + offset ];
-        field_4_text                    = StringUtil.getFromUnicodeHigh(data, 0x4 + offset, ((field_2_textLength *2)/2));
+
+        int pos = 0;
+        field_1_id                     = LittleEndian.getShort(data, pos + 0x0 + offset);
+        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();
 
-        buffer.append("[SeriesText]\n");
-
+        buffer.append("[SERIESTEXT]\n");
         buffer.append("    .id                   = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getId()))
-            .append(" (").append(getId()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getId ()))
+            .append(" (").append( getId() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .textLength           = ")
-            .append("0x")
-            .append(HexDump.toHex((byte)getTextLength()))
-            .append(" (").append(getTextLength()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getTextLength ()))
+            .append(" (").append( getTextLength() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .undocumented         = ")
-            .append("0x")
-            .append(HexDump.toHex((byte)getUndocumented()))
-            .append(" (").append(getUndocumented()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getUndocumented ()))
+            .append(" (").append( getUndocumented() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         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();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_id);
-        data[ 6 + offset ] = field_2_textLength;
-        data[ 7 + offset ] = field_3_undocumented;
-        StringUtil.putUncompressedUnicodeHigh(field_4_text, data, 8 + offset);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_id);
+        data[ 6 + offset + pos ] = field_2_textLength;
+        data[ 7 + offset + pos ] = field_3_undocumented;
+        StringUtil.putUncompressedUnicodeHigh(field_4_text, data, 8 + offset + pos);
 
         return getRecordSize();
     }
@@ -188,17 +191,18 @@ public class SeriesTextRecord
     }
 
     public Object clone() {
-      SeriesTextRecord rec = new SeriesTextRecord();
-      
-      rec.field_1_id = field_1_id;
-      rec.field_2_textLength = field_2_textLength;
-      rec.field_3_undocumented = field_3_undocumented;
-      rec.field_4_text = field_4_text;
-
-      return rec;
+        SeriesTextRecord rec = new SeriesTextRecord();
+    
+        rec.field_1_id = field_1_id;
+        rec.field_2_textLength = field_2_textLength;
+        rec.field_3_undocumented = field_3_undocumented;
+        rec.field_4_text = field_4_text;
+        return rec;
     }
 
 
+
+
     /**
      * Get the id field for the SeriesText record.
      */
index 291240c85b8fcd65a0015030ba05995a68939075..989d3c26f9f7220bbe99a5cd24ddc4872c91ced9 100644 (file)
@@ -91,6 +91,7 @@ public class SeriesToChartGroupRecord
     public SeriesToChartGroupRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -106,6 +107,7 @@ public class SeriesToChartGroupRecord
     public SeriesToChartGroupRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -123,7 +125,9 @@ public class SeriesToChartGroupRecord
 
     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();
 
         buffer.append("[SeriesToChartGroup]\n");
-
         buffer.append("    .chartGroupIndex      = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getChartGroupIndex()))
-            .append(" (").append(getChartGroupIndex()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getChartGroupIndex ()))
+            .append(" (").append( getChartGroupIndex() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
         buffer.append("[/SeriesToChartGroup]\n");
         return buffer.toString();
@@ -144,10 +147,12 @@ public class SeriesToChartGroupRecord
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_chartGroupIndex);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_chartGroupIndex);
 
         return getRecordSize();
     }
@@ -157,7 +162,7 @@ public class SeriesToChartGroupRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2;
+        return 4  + 2;
     }
 
     public short getSid()
@@ -166,14 +171,15 @@ public class SeriesToChartGroupRecord
     }
 
     public Object clone() {
-      SeriesToChartGroupRecord rec = new SeriesToChartGroupRecord();
-      
-      rec.field_1_chartGroupIndex = field_1_chartGroupIndex;
-
-      return rec;
+        SeriesToChartGroupRecord rec = new SeriesToChartGroupRecord();
+    
+        rec.field_1_chartGroupIndex = field_1_chartGroupIndex;
+        return rec;
     }
 
 
+
+
     /**
      * Get the chart group index field for the SeriesToChartGroup record.
      */
index 20635089b9ff9917e8b17485a93e420a183ab7e1..c3076aa793f15044724946487a16875e9ed241fd 100644 (file)
@@ -100,6 +100,7 @@ public class SheetPropertiesRecord
     public SheetPropertiesRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -115,6 +116,7 @@ public class SheetPropertiesRecord
     public SheetPropertiesRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -132,8 +134,10 @@ public class SheetPropertiesRecord
 
     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();
 
-        buffer.append("[SheetProperties]\n");
-
+        buffer.append("[SHTPROPS]\n");
         buffer.append("    .flags                = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getFlags()))
-            .append(" (").append(getFlags()).append(" )\n");
-        buffer.append("         .chartTypeManuallyFormatted     = ").append(isChartTypeManuallyFormatted()).append('\n');
-        buffer.append("         .plotVisibleOnly          = ").append(isPlotVisibleOnly     ()).append('\n');
-        buffer.append("         .doNotSizeWithWindow      = ").append(isDoNotSizeWithWindow ()).append('\n');
-        buffer.append("         .defaultPlotDimensions     = ").append(isDefaultPlotDimensions()).append('\n');
-        buffer.append("         .autoPlotArea             = ").append(isAutoPlotArea        ()).append('\n');
-
+            .append("0x").append(HexDump.toHex(  getFlags ()))
+            .append(" (").append( getFlags() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .chartTypeManuallyFormatted     = ").append(isChartTypeManuallyFormatted()).append('\n'); 
+        buffer.append("         .plotVisibleOnly          = ").append(isPlotVisibleOnly()).append('\n'); 
+        buffer.append("         .doNotSizeWithWindow      = ").append(isDoNotSizeWithWindow()).append('\n'); 
+        buffer.append("         .defaultPlotDimensions     = ").append(isDefaultPlotDimensions()).append('\n'); 
+        buffer.append("         .autoPlotArea             = ").append(isAutoPlotArea()).append('\n'); 
         buffer.append("    .empty                = ")
-            .append("0x")
-            .append(HexDump.toHex((byte)getEmpty()))
-            .append(" (").append(getEmpty()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getEmpty ()))
+            .append(" (").append( getEmpty() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/SheetProperties]\n");
+        buffer.append("[/SHTPROPS]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_flags);
-        data[ 6 + offset ] = field_2_empty;
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_flags);
+        data[ 6 + offset + pos ] = field_2_empty;
 
         return getRecordSize();
     }
@@ -178,7 +182,7 @@ public class SheetPropertiesRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2 + 1;
+        return 4  + 2 + 1;
     }
 
     public short getSid()
@@ -187,15 +191,16 @@ public class SheetPropertiesRecord
     }
 
     public Object clone() {
-      SheetPropertiesRecord rec = new SheetPropertiesRecord();
-      
-      rec.field_1_flags = field_1_flags;
-      rec.field_2_empty = field_2_empty;
-
-      return rec;
+        SheetPropertiesRecord rec = new SheetPropertiesRecord();
+    
+        rec.field_1_flags = field_1_flags;
+        rec.field_2_empty = field_2_empty;
+        return rec;
     }
 
 
+
+
     /**
      * Get the flags field for the SheetProperties record.
      */
index 5d827624723f9fe43fafba022fb5ab560a8cd25d..3ee82c76b07719232e09bfef180448b1797f275a 100644 (file)
@@ -141,6 +141,7 @@ public class TextRecord
     public TextRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -156,6 +157,7 @@ public class TextRecord
     public TextRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -173,18 +175,20 @@ public class TextRecord
 
     protected void fillFields(byte [] data, short size, int offset)
     {
-        field_1_horizontalAlignment     = data[ 0x0 + offset ];
-        field_2_verticalAlignment       = data[ 0x1 + offset ];
-        field_3_displayMode             = LittleEndian.getShort(data, 0x2 + offset);
-        field_4_rgbColor                = LittleEndian.getInt(data, 0x4 + offset);
-        field_5_x                       = LittleEndian.getInt(data, 0x8 + offset);
-        field_6_y                       = LittleEndian.getInt(data, 0xc + offset);
-        field_7_width                   = LittleEndian.getInt(data, 0x10 + offset);
-        field_8_height                  = LittleEndian.getInt(data, 0x14 + offset);
-        field_9_options1                = LittleEndian.getShort(data, 0x18 + offset);
-        field_10_indexOfColorValue      = LittleEndian.getShort(data, 0x1a + offset);
-        field_11_options2               = LittleEndian.getShort(data, 0x1c + offset);
-        field_12_textRotation           = LittleEndian.getShort(data, 0x1e + offset);
+
+        int pos = 0;
+        field_1_horizontalAlignment    = data[ pos + 0x0 + offset ];
+        field_2_verticalAlignment      = data[ pos + 0x1 + offset ];
+        field_3_displayMode            = LittleEndian.getShort(data, pos + 0x2 + offset);
+        field_4_rgbColor               = LittleEndian.getInt(data, pos + 0x4 + offset);
+        field_5_x                      = LittleEndian.getInt(data, pos + 0x8 + offset);
+        field_6_y                      = LittleEndian.getInt(data, pos + 0xc + offset);
+        field_7_width                  = LittleEndian.getInt(data, pos + 0x10 + offset);
+        field_8_height                 = LittleEndian.getInt(data, pos + 0x14 + offset);
+        field_9_options1               = LittleEndian.getShort(data, pos + 0x18 + 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,103 +196,93 @@ public class TextRecord
     {
         StringBuffer buffer = new StringBuffer();
 
-        buffer.append("[Text]\n");
-
+        buffer.append("[TEXT]\n");
         buffer.append("    .horizontalAlignment  = ")
-            .append("0x")
-            .append(HexDump.toHex((byte)getHorizontalAlignment()))
-            .append(" (").append(getHorizontalAlignment()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getHorizontalAlignment ()))
+            .append(" (").append( getHorizontalAlignment() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .verticalAlignment    = ")
-            .append("0x")
-            .append(HexDump.toHex((byte)getVerticalAlignment()))
-            .append(" (").append(getVerticalAlignment()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getVerticalAlignment ()))
+            .append(" (").append( getVerticalAlignment() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .displayMode          = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getDisplayMode()))
-            .append(" (").append(getDisplayMode()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getDisplayMode ()))
+            .append(" (").append( getDisplayMode() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .rgbColor             = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getRgbColor()))
-            .append(" (").append(getRgbColor()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getRgbColor ()))
+            .append(" (").append( getRgbColor() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .x                    = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getX()))
-            .append(" (").append(getX()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getX ()))
+            .append(" (").append( getX() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .y                    = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getY()))
-            .append(" (").append(getY()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getY ()))
+            .append(" (").append( getY() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .width                = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getWidth()))
-            .append(" (").append(getWidth()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getWidth ()))
+            .append(" (").append( getWidth() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .height               = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getHeight()))
-            .append(" (").append(getHeight()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getHeight ()))
+            .append(" (").append( getHeight() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .options1             = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getOptions1()))
-            .append(" (").append(getOptions1()).append(" )\n");
-        buffer.append("         .autoColor                = ").append(isAutoColor           ()).append('\n');
-        buffer.append("         .showKey                  = ").append(isShowKey             ()).append('\n');
-        buffer.append("         .showValue                = ").append(isShowValue           ()).append('\n');
-        buffer.append("         .vertical                 = ").append(isVertical            ()).append('\n');
-        buffer.append("         .autoGeneratedText        = ").append(isAutoGeneratedText   ()).append('\n');
-        buffer.append("         .generated                = ").append(isGenerated           ()).append('\n');
-        buffer.append("         .autoLabelDeleted         = ").append(isAutoLabelDeleted    ()).append('\n');
-        buffer.append("         .autoBackground           = ").append(isAutoBackground      ()).append('\n');
-        buffer.append("         .rotation                 = ").append(getRotation            ()).append('\n');
-        buffer.append("         .showCategoryLabelAsPercentage     = ").append(isShowCategoryLabelAsPercentage()).append('\n');
-        buffer.append("         .showValueAsPercentage     = ").append(isShowValueAsPercentage()).append('\n');
-        buffer.append("         .showBubbleSizes          = ").append(isShowBubbleSizes     ()).append('\n');
-        buffer.append("         .showLabel                = ").append(isShowLabel           ()).append('\n');
-
+            .append("0x").append(HexDump.toHex(  getOptions1 ()))
+            .append(" (").append( getOptions1() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .autoColor                = ").append(isAutoColor()).append('\n'); 
+        buffer.append("         .showKey                  = ").append(isShowKey()).append('\n'); 
+        buffer.append("         .showValue                = ").append(isShowValue()).append('\n'); 
+        buffer.append("         .vertical                 = ").append(isVertical()).append('\n'); 
+        buffer.append("         .autoGeneratedText        = ").append(isAutoGeneratedText()).append('\n'); 
+        buffer.append("         .generated                = ").append(isGenerated()).append('\n'); 
+        buffer.append("         .autoLabelDeleted         = ").append(isAutoLabelDeleted()).append('\n'); 
+        buffer.append("         .autoBackground           = ").append(isAutoBackground()).append('\n'); 
+            buffer.append("         .rotation                 = ").append(getRotation()).append('\n'); 
+        buffer.append("         .showCategoryLabelAsPercentage     = ").append(isShowCategoryLabelAsPercentage()).append('\n'); 
+        buffer.append("         .showValueAsPercentage     = ").append(isShowValueAsPercentage()).append('\n'); 
+        buffer.append("         .showBubbleSizes          = ").append(isShowBubbleSizes()).append('\n'); 
+        buffer.append("         .showLabel                = ").append(isShowLabel()).append('\n'); 
         buffer.append("    .indexOfColorValue    = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getIndexOfColorValue()))
-            .append(" (").append(getIndexOfColorValue()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getIndexOfColorValue ()))
+            .append(" (").append( getIndexOfColorValue() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .options2             = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getOptions2()))
-            .append(" (").append(getOptions2()).append(" )\n");
-        buffer.append("         .dataLabelPlacement       = ").append(getDataLabelPlacement  ()).append('\n');
-
+            .append("0x").append(HexDump.toHex(  getOptions2 ()))
+            .append(" (").append( getOptions2() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+            buffer.append("         .dataLabelPlacement       = ").append(getDataLabelPlacement()).append('\n'); 
         buffer.append("    .textRotation         = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getTextRotation()))
-            .append(" (").append(getTextRotation()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getTextRotation ()))
+            .append(" (").append( getTextRotation() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/Text]\n");
+        buffer.append("[/TEXT]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        data[ 4 + offset ] = field_1_horizontalAlignment;
-        data[ 5 + offset ] = field_2_verticalAlignment;
-        LittleEndian.putShort(data, 6 + offset, field_3_displayMode);
-        LittleEndian.putInt(data, 8 + offset, field_4_rgbColor);
-        LittleEndian.putInt(data, 12 + offset, field_5_x);
-        LittleEndian.putInt(data, 16 + offset, field_6_y);
-        LittleEndian.putInt(data, 20 + offset, field_7_width);
-        LittleEndian.putInt(data, 24 + offset, field_8_height);
-        LittleEndian.putShort(data, 28 + offset, field_9_options1);
-        LittleEndian.putShort(data, 30 + offset, field_10_indexOfColorValue);
-        LittleEndian.putShort(data, 32 + offset, field_11_options2);
-        LittleEndian.putShort(data, 34 + offset, field_12_textRotation);
+        data[ 4 + offset + pos ] = field_1_horizontalAlignment;
+        data[ 5 + offset + pos ] = field_2_verticalAlignment;
+        LittleEndian.putShort(data, 6 + offset + pos, field_3_displayMode);
+        LittleEndian.putInt(data, 8 + offset + pos, field_4_rgbColor);
+        LittleEndian.putInt(data, 12 + offset + pos, field_5_x);
+        LittleEndian.putInt(data, 16 + offset + pos, field_6_y);
+        LittleEndian.putInt(data, 20 + offset + pos, field_7_width);
+        LittleEndian.putInt(data, 24 + offset + pos, field_8_height);
+        LittleEndian.putShort(data, 28 + offset + pos, field_9_options1);
+        LittleEndian.putShort(data, 30 + offset + pos, field_10_indexOfColorValue);
+        LittleEndian.putShort(data, 32 + offset + pos, field_11_options2);
+        LittleEndian.putShort(data, 34 + offset + pos, field_12_textRotation);
 
         return getRecordSize();
     }
@@ -298,7 +292,7 @@ public class TextRecord
      */
     public int getRecordSize()
     {
-        return 4 + 1 + 1 + 2 + 4 + 4 + 4 + 4 + 4 + 2 + 2 + 2 + 2;
+        return 4  + 1 + 1 + 2 + 4 + 4 + 4 + 4 + 4 + 2 + 2 + 2 + 2;
     }
 
     public short getSid()
@@ -307,25 +301,26 @@ public class TextRecord
     }
 
     public Object clone() {
-      TextRecord rec = new TextRecord();
-      
-      rec.field_1_horizontalAlignment = field_1_horizontalAlignment;
-      rec.field_2_verticalAlignment = field_2_verticalAlignment;
-      rec.field_3_displayMode = field_3_displayMode;
-      rec.field_4_rgbColor = field_4_rgbColor;
-      rec.field_5_x = field_5_x;
-      rec.field_6_y = field_6_y;
-      rec.field_7_width = field_7_width;
-      rec.field_8_height = field_8_height;
-      rec.field_9_options1 = field_9_options1;
-      rec.field_10_indexOfColorValue = field_10_indexOfColorValue;
-      rec.field_11_options2 = field_11_options2;
-      rec.field_12_textRotation = field_12_textRotation;
-
-      return rec;
+        TextRecord rec = new TextRecord();
+    
+        rec.field_1_horizontalAlignment = field_1_horizontalAlignment;
+        rec.field_2_verticalAlignment = field_2_verticalAlignment;
+        rec.field_3_displayMode = field_3_displayMode;
+        rec.field_4_rgbColor = field_4_rgbColor;
+        rec.field_5_x = field_5_x;
+        rec.field_6_y = field_6_y;
+        rec.field_7_width = field_7_width;
+        rec.field_8_height = field_8_height;
+        rec.field_9_options1 = field_9_options1;
+        rec.field_10_indexOfColorValue = field_10_indexOfColorValue;
+        rec.field_11_options2 = field_11_options2;
+        rec.field_12_textRotation = field_12_textRotation;
+        return rec;
     }
 
 
+
+
     /**
      * Get the horizontal alignment field for the Text record.
      *
index f1359fabc42fee36ae6919785468831fcdf06cd0..482301960b0e97059a149f0e4eee4f550e8ced74 100644 (file)
@@ -104,6 +104,7 @@ public class TickRecord
     public TickRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -119,6 +120,7 @@ public class TickRecord
     public TickRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -136,16 +138,18 @@ public class TickRecord
 
     protected void fillFields(byte [] data, short size, int offset)
     {
-        field_1_majorTickType           = data[ 0x0 + offset ];
-        field_2_minorTickType           = data[ 0x1 + offset ];
-        field_3_labelPosition           = data[ 0x2 + offset ];
-        field_4_background              = data[ 0x3 + offset ];
-        field_5_labelColorRgb           = LittleEndian.getInt(data, 0x4 + offset);
-        field_6_zero1                   = LittleEndian.getShort(data, 0x8 + offset);
-        field_7_zero2                   = LittleEndian.getShort(data, 0x10 + offset);
-        field_8_options                 = LittleEndian.getShort(data, 0x18 + offset);
-        field_9_tickColor               = LittleEndian.getShort(data, 0x1a + offset);
-        field_10_zero3                  = LittleEndian.getShort(data, 0x1c + offset);
+
+        int pos = 0;
+        field_1_majorTickType          = data[ pos + 0x0 + offset ];
+        field_2_minorTickType          = data[ pos + 0x1 + offset ];
+        field_3_labelPosition          = data[ pos + 0x2 + offset ];
+        field_4_background             = data[ pos + 0x3 + offset ];
+        field_5_labelColorRgb          = LittleEndian.getInt(data, pos + 0x4 + offset);
+        field_6_zero1                  = LittleEndian.getShort(data, pos + 0x8 + offset);
+        field_7_zero2                  = LittleEndian.getShort(data, pos + 0x10 + 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();
 
-        buffer.append("[Tick]\n");
-
+        buffer.append("[TICK]\n");
         buffer.append("    .majorTickType        = ")
-            .append("0x")
-            .append(HexDump.toHex((byte)getMajorTickType()))
-            .append(" (").append(getMajorTickType()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getMajorTickType ()))
+            .append(" (").append( getMajorTickType() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .minorTickType        = ")
-            .append("0x")
-            .append(HexDump.toHex((byte)getMinorTickType()))
-            .append(" (").append(getMinorTickType()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getMinorTickType ()))
+            .append(" (").append( getMinorTickType() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .labelPosition        = ")
-            .append("0x")
-            .append(HexDump.toHex((byte)getLabelPosition()))
-            .append(" (").append(getLabelPosition()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getLabelPosition ()))
+            .append(" (").append( getLabelPosition() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .background           = ")
-            .append("0x")
-            .append(HexDump.toHex((byte)getBackground()))
-            .append(" (").append(getBackground()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getBackground ()))
+            .append(" (").append( getBackground() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .labelColorRgb        = ")
-            .append("0x")
-            .append(HexDump.toHex((int)getLabelColorRgb()))
-            .append(" (").append(getLabelColorRgb()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getLabelColorRgb ()))
+            .append(" (").append( getLabelColorRgb() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .zero1                = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getZero1()))
-            .append(" (").append(getZero1()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getZero1 ()))
+            .append(" (").append( getZero1() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .zero2                = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getZero2()))
-            .append(" (").append(getZero2()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getZero2 ()))
+            .append(" (").append( getZero2() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .options              = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getOptions()))
-            .append(" (").append(getOptions()).append(" )\n");
-        buffer.append("         .autoTextColor            = ").append(isAutoTextColor       ()).append('\n');
-        buffer.append("         .autoTextBackground       = ").append(isAutoTextBackground  ()).append('\n');
-        buffer.append("         .rotation                 = ").append(getRotation            ()).append('\n');
-        buffer.append("         .autorotate               = ").append(isAutorotate          ()).append('\n');
-
+            .append("0x").append(HexDump.toHex(  getOptions ()))
+            .append(" (").append( getOptions() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .autoTextColor            = ").append(isAutoTextColor()).append('\n'); 
+        buffer.append("         .autoTextBackground       = ").append(isAutoTextBackground()).append('\n'); 
+            buffer.append("         .rotation                 = ").append(getRotation()).append('\n'); 
+        buffer.append("         .autorotate               = ").append(isAutorotate()).append('\n'); 
         buffer.append("    .tickColor            = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getTickColor()))
-            .append(" (").append(getTickColor()).append(" )\n");
-
+            .append("0x").append(HexDump.toHex(  getTickColor ()))
+            .append(" (").append( getTickColor() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .zero3                = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getZero3()))
-            .append(" (").append(getZero3()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getZero3 ()))
+            .append(" (").append( getZero3() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/Tick]\n");
+        buffer.append("[/TICK]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        data[ 4 + offset ] = field_1_majorTickType;
-        data[ 5 + offset ] = field_2_minorTickType;
-        data[ 6 + offset ] = field_3_labelPosition;
-        data[ 7 + offset ] = field_4_background;
-        LittleEndian.putInt(data, 8 + offset, field_5_labelColorRgb);
-        LittleEndian.putShort(data, 12 + offset, field_6_zero1);
-        LittleEndian.putShort(data, 20 + offset, field_7_zero2);
-        LittleEndian.putShort(data, 28 + offset, field_8_options);
-        LittleEndian.putShort(data, 30 + offset, field_9_tickColor);
-        LittleEndian.putShort(data, 32 + offset, field_10_zero3);
+        data[ 4 + offset + pos ] = field_1_majorTickType;
+        data[ 5 + offset + pos ] = field_2_minorTickType;
+        data[ 6 + offset + pos ] = field_3_labelPosition;
+        data[ 7 + offset + pos ] = field_4_background;
+        LittleEndian.putInt(data, 8 + offset + pos, field_5_labelColorRgb);
+        LittleEndian.putShort(data, 12 + offset + pos, field_6_zero1);
+        LittleEndian.putShort(data, 20 + offset + pos, field_7_zero2);
+        LittleEndian.putShort(data, 28 + offset + pos, field_8_options);
+        LittleEndian.putShort(data, 30 + offset + pos, field_9_tickColor);
+        LittleEndian.putShort(data, 32 + offset + pos, field_10_zero3);
 
         return getRecordSize();
     }
@@ -237,7 +233,7 @@ public class TickRecord
      */
     public int getRecordSize()
     {
-        return 4 + 1 + 1 + 1 + 1 + 4 + 8 + 8 + 2 + 2 + 2;
+        return 4  + 1 + 1 + 1 + 1 + 4 + 8 + 8 + 2 + 2 + 2;
     }
 
     public short getSid()
@@ -246,23 +242,24 @@ public class TickRecord
     }
 
     public Object clone() {
-      TickRecord rec = new TickRecord();
-      
-      rec.field_1_majorTickType = field_1_majorTickType;
-      rec.field_2_minorTickType = field_2_minorTickType;
-      rec.field_3_labelPosition = field_3_labelPosition;
-      rec.field_4_background = field_4_background;
-      rec.field_5_labelColorRgb = field_5_labelColorRgb;
-      rec.field_6_zero1 = field_6_zero1;
-      rec.field_7_zero2 = field_7_zero2;
-      rec.field_8_options = field_8_options;
-      rec.field_9_tickColor = field_9_tickColor;
-      rec.field_10_zero3 = field_10_zero3;
-
-      return rec;
+        TickRecord rec = new TickRecord();
+    
+        rec.field_1_majorTickType = field_1_majorTickType;
+        rec.field_2_minorTickType = field_2_minorTickType;
+        rec.field_3_labelPosition = field_3_labelPosition;
+        rec.field_4_background = field_4_background;
+        rec.field_5_labelColorRgb = field_5_labelColorRgb;
+        rec.field_6_zero1 = field_6_zero1;
+        rec.field_7_zero2 = field_7_zero2;
+        rec.field_8_options = field_8_options;
+        rec.field_9_tickColor = field_9_tickColor;
+        rec.field_10_zero3 = field_10_zero3;
+        return rec;
     }
 
 
+
+
     /**
      * Get the major tick type field for the Tick record.
      */
index 00710fb29ed6f549d82e05b913d3bee0871ce719..9f8e1bd351914eeb982893964e159287f9c44119 100644 (file)
@@ -91,6 +91,7 @@ public class UnitsRecord
     public UnitsRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -106,6 +107,7 @@ public class UnitsRecord
     public UnitsRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -123,7 +125,9 @@ public class UnitsRecord
 
     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();
 
-        buffer.append("[Units]\n");
-
+        buffer.append("[UNITS]\n");
         buffer.append("    .units                = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getUnits()))
-            .append(" (").append(getUnits()).append(" )\n");
+            .append("0x").append(HexDump.toHex(  getUnits ()))
+            .append(" (").append( getUnits() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
 
-        buffer.append("[/Units]\n");
+        buffer.append("[/UNITS]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putShort(data, 4 + offset, field_1_units);
+        LittleEndian.putShort(data, 4 + offset + pos, field_1_units);
 
         return getRecordSize();
     }
@@ -157,7 +162,7 @@ public class UnitsRecord
      */
     public int getRecordSize()
     {
-        return 4 + 2;
+        return 4  + 2;
     }
 
     public short getSid()
@@ -166,14 +171,15 @@ public class UnitsRecord
     }
 
     public Object clone() {
-      UnitsRecord rec = new UnitsRecord();
-      
-      rec.field_1_units = field_1_units;
-
-      return rec;
+        UnitsRecord rec = new UnitsRecord();
+    
+        rec.field_1_units = field_1_units;
+        return rec;
     }
 
 
+
+
     /**
      * Get the units field for the Units record.
      */
index 1a05dc546850ac7765ccfb4443547681f3442fcd..4144414b38a54f76a0948686689f74b1e39cf910 100644 (file)
@@ -105,6 +105,7 @@ public class ValueRangeRecord
     public ValueRangeRecord(short id, short size, byte [] data)
     {
         super(id, size, data);
+    
     }
 
     /**
@@ -120,6 +121,7 @@ public class ValueRangeRecord
     public ValueRangeRecord(short id, short size, byte [] data, int offset)
     {
         super(id, size, data, offset);
+    
     }
 
     /**
@@ -137,12 +139,14 @@ public class ValueRangeRecord
 
     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);
-        field_3_majorIncrement          = LittleEndian.getDouble(data, 0x10 + offset);
-        field_4_minorIncrement          = LittleEndian.getDouble(data, 0x18 + offset);
-        field_5_categoryAxisCross       = LittleEndian.getDouble(data, 0x20 + offset);
-        field_6_options                 = LittleEndian.getShort(data, 0x28 + offset);
+
+        int pos = 0;
+        field_1_minimumAxisValue       = LittleEndian.getDouble(data, pos + 0x0 + offset);
+        field_2_maximumAxisValue       = LittleEndian.getDouble(data, pos + 0x8 + offset);
+        field_3_majorIncrement         = LittleEndian.getDouble(data, pos + 0x10 + 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,52 +154,53 @@ public class ValueRangeRecord
     {
         StringBuffer buffer = new StringBuffer();
 
-        buffer.append("[ValueRange]\n");
-
+        buffer.append("[VALUERANGE]\n");
         buffer.append("    .minimumAxisValue     = ")
-            .append(" (").append(getMinimumAxisValue()).append(" )\n");
-
+            .append(" (").append( getMinimumAxisValue() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .maximumAxisValue     = ")
-            .append(" (").append(getMaximumAxisValue()).append(" )\n");
-
+            .append(" (").append( getMaximumAxisValue() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .majorIncrement       = ")
-            .append(" (").append(getMajorIncrement()).append(" )\n");
-
+            .append(" (").append( getMajorIncrement() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .minorIncrement       = ")
-            .append(" (").append(getMinorIncrement()).append(" )\n");
-
+            .append(" (").append( getMinorIncrement() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .categoryAxisCross    = ")
-            .append(" (").append(getCategoryAxisCross()).append(" )\n");
-
+            .append(" (").append( getCategoryAxisCross() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
         buffer.append("    .options              = ")
-            .append("0x")
-            .append(HexDump.toHex((short)getOptions()))
-            .append(" (").append(getOptions()).append(" )\n");
-        buffer.append("         .automaticMinimum         = ").append(isAutomaticMinimum    ()).append('\n');
-        buffer.append("         .automaticMaximum         = ").append(isAutomaticMaximum    ()).append('\n');
-        buffer.append("         .automaticMajor           = ").append(isAutomaticMajor      ()).append('\n');
-        buffer.append("         .automaticMinor           = ").append(isAutomaticMinor      ()).append('\n');
-        buffer.append("         .automaticCategoryCrossing     = ").append(isAutomaticCategoryCrossing()).append('\n');
-        buffer.append("         .logarithmicScale         = ").append(isLogarithmicScale    ()).append('\n');
-        buffer.append("         .valuesInReverse          = ").append(isValuesInReverse     ()).append('\n');
-        buffer.append("         .crossCategoryAxisAtMaximum     = ").append(isCrossCategoryAxisAtMaximum()).append('\n');
-        buffer.append("         .reserved                 = ").append(isReserved            ()).append('\n');
-
-        buffer.append("[/ValueRange]\n");
+            .append("0x").append(HexDump.toHex(  getOptions ()))
+            .append(" (").append( getOptions() ).append(" )");
+        buffer.append(System.getProperty("line.separator")); 
+        buffer.append("         .automaticMinimum         = ").append(isAutomaticMinimum()).append('\n'); 
+        buffer.append("         .automaticMaximum         = ").append(isAutomaticMaximum()).append('\n'); 
+        buffer.append("         .automaticMajor           = ").append(isAutomaticMajor()).append('\n'); 
+        buffer.append("         .automaticMinor           = ").append(isAutomaticMinor()).append('\n'); 
+        buffer.append("         .automaticCategoryCrossing     = ").append(isAutomaticCategoryCrossing()).append('\n'); 
+        buffer.append("         .logarithmicScale         = ").append(isLogarithmicScale()).append('\n'); 
+        buffer.append("         .valuesInReverse          = ").append(isValuesInReverse()).append('\n'); 
+        buffer.append("         .crossCategoryAxisAtMaximum     = ").append(isCrossCategoryAxisAtMaximum()).append('\n'); 
+        buffer.append("         .reserved                 = ").append(isReserved()).append('\n'); 
+
+        buffer.append("[/VALUERANGE]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 
-        LittleEndian.putDouble(data, 4 + offset, field_1_minimumAxisValue);
-        LittleEndian.putDouble(data, 12 + offset, field_2_maximumAxisValue);
-        LittleEndian.putDouble(data, 20 + offset, field_3_majorIncrement);
-        LittleEndian.putDouble(data, 28 + offset, field_4_minorIncrement);
-        LittleEndian.putDouble(data, 36 + offset, field_5_categoryAxisCross);
-        LittleEndian.putShort(data, 44 + offset, field_6_options);
+        LittleEndian.putDouble(data, 4 + offset + pos, field_1_minimumAxisValue);
+        LittleEndian.putDouble(data, 12 + offset + pos, field_2_maximumAxisValue);
+        LittleEndian.putDouble(data, 20 + offset + pos, field_3_majorIncrement);
+        LittleEndian.putDouble(data, 28 + offset + pos, field_4_minorIncrement);
+        LittleEndian.putDouble(data, 36 + offset + pos, field_5_categoryAxisCross);
+        LittleEndian.putShort(data, 44 + offset + pos, field_6_options);
 
         return getRecordSize();
     }
@@ -205,7 +210,7 @@ public class ValueRangeRecord
      */
     public int getRecordSize()
     {
-        return 4 + 8 + 8 + 8 + 8 + 8 + 2;
+        return 4  + 8 + 8 + 8 + 8 + 8 + 2;
     }
 
     public short getSid()
@@ -213,6 +218,20 @@ public class ValueRangeRecord
         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.
index 779dd0f1faca22dc8a9dab1624a1e93b05f80706..b9d3f737c0546a240f6a22047594a9907e5baf0b 100644 (file)
  */
 package org.apache.poi.hssf.usermodel;
 
-import java.util.Vector;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Iterator;
-
 import org.apache.poi.hssf.model.Workbook;
-import org.apache.poi.hssf.record.Record;
 import org.apache.poi.hssf.record.FormatRecord;
 
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Vector;
+
 /**
  * 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>
  *<P>
- *       0, "General"<P>
- *       1, "0"<P>
- *       2, "0.00"<P>
- *       3, "#,##0"<P>
- *       4, "#,##0.00"<P>
- *       5, "($#,##0_);($#,##0)"<P>
- *       6, "($#,##0_);[Red]($#,##0)"<P>
- *       7, "($#,##0.00);($#,##0.00)"<P>
- *       8, "($#,##0.00_);[Red]($#,##0.00)"<P>
- *       9, "0%"<P>
- *       0xa, "0.00%"<P>
- *       0xb, "0.00E+00"<P>
- *       0xc, "# ?/?"<P>
- *       0xd, "# ??/??"<P>
- *       0xe, "m/d/yy"<P>
- *       0xf, "d-mmm-yy"<P>
- *       0x10, "d-mmm"<P>
- *       0x11, "mmm-yy"<P>
- *       0x12, "h:mm AM/PM"<P>
- *       0x13, "h:mm:ss AM/PM"<P>
- *       0x14, "h:mm"<P>
- *       0x15, "h:mm:ss"<P>
- *       0x16, "m/d/yy h:mm"<P>
+ *       0, "General"<br>
+ *       1, "0"<br>
+ *       2, "0.00"<br>
+ *       3, "#,##0"<br>
+ *       4, "#,##0.00"<br>
+ *       5, "($#,##0_);($#,##0)"<br>
+ *       6, "($#,##0_);[Red]($#,##0)"<br>
+ *       7, "($#,##0.00);($#,##0.00)"<br>
+ *       8, "($#,##0.00_);[Red]($#,##0.00)"<br>
+ *       9, "0%"<br>
+ *       0xa, "0.00%"<br>
+ *       0xb, "0.00E+00"<br>
+ *       0xc, "# ?/?"<br>
+ *       0xd, "# ??/??"<br>
+ *       0xe, "m/d/yy"<br>
+ *       0xf, "d-mmm-yy"<br>
+ *       0x10, "d-mmm"<br>
+ *       0x11, "mmm-yy"<br>
+ *       0x12, "h:mm AM/PM"<br>
+ *       0x13, "h:mm:ss AM/PM"<br>
+ *       0x14, "h:mm"<br>
+ *       0x15, "h:mm:ss"<br>
+ *       0x16, "m/d/yy h:mm"<br>
  *<P>
- *       // 0x17 - 0x24 reserved for international and undocumented
- *       0x25, "(#,##0_);(#,##0)"<P>
- *       0x26, "(#,##0_);[Red](#,##0)"<P>
- *       0x27, "(#,##0.00_);(#,##0.00)"<P>
- *       0x28, "(#,##0.00_);[Red](#,##0.00)"<P>
- *       0x29, "_(*#,##0_);_(*(#,##0);_(* \"-\"_);_(@_)"<P>
- *       0x2a, "_($*#,##0_);_($*(#,##0);_($* \"-\"_);_(@_)"<P>
- *       0x2b, "_(*#,##0.00_);_(*(#,##0.00);_(*\"-\"??_);_(@_)"<P>
- *       0x2c, "_($*#,##0.00_);_($*(#,##0.00);_($*\"-\"??_);_(@_)"<P>
- *       0x2d, "mm:ss"<P>
- *       0x2e, "[h]:mm:ss"<P>
- *       0x2f, "mm:ss.0"<P>
- *       0x30, "##0.0E+0"<P>
- *       0x31, "@"<P>
+ *       // 0x17 - 0x24 reserved for international and undocumented<br>
+ *       0x25, "(#,##0_);(#,##0)"<br>
+ *       0x26, "(#,##0_);[Red](#,##0)"<br>
+ *       0x27, "(#,##0.00_);(#,##0.00)"<br>
+ *       0x28, "(#,##0.00_);[Red](#,##0.00)"<br>
+ *       0x29, "_(*#,##0_);_(*(#,##0);_(* \"-\"_);_(@_)"<br>
+ *       0x2a, "_($*#,##0_);_($*(#,##0);_($* \"-\"_);_(@_)"<br>
+ *       0x2b, "_(*#,##0.00_);_(*(#,##0.00);_(*\"-\"??_);_(@_)"<br>
+ *       0x2c, "_($*#,##0.00_);_($*(#,##0.00);_($*\"-\"??_);_(@_)"<br>
+ *       0x2d, "mm:ss"<br>
+ *       0x2e, "[h]:mm:ss"<br>
+ *       0x2f, "mm:ss.0"<br>
+ *       0x30, "##0.0E+0"<br>
+ *       0x31, "@"<br>
  *
  *
  * @author  Andrew C. Oliver (acoliver at apache dot org)
@@ -122,92 +121,95 @@ public class HSSFDataFormat
     private Vector formats = new Vector();
     private Workbook workbook;
     private boolean movedBuiltins = false;  // Flag to see if need to
-                                           // check the built in list
-                                           // or if the regular list
-                                           // has all entries.
+    // check the built in list
+    // or if the regular list
+    // has all entries.
 
-    /** 
+    /**
      * Construncts a new data formatter.  It takes a workbook to have
      * access to the workbooks format records.
      * @param workbook the workbook the formats are tied to.
      */
-    public HSSFDataFormat(Workbook workbook) {
-       this.workbook = workbook;
-       if (builtinFormats == null) populateBuiltinFormats();
-       Iterator i = workbook.getFormats().iterator();
-       while (i.hasNext()) {
-           FormatRecord r = (FormatRecord)i.next();
-           if (formats.size() < r.getIndexCode() + 1) {
-               formats.setSize(r.getIndexCode() + 1);
-           }
-           formats.set(r.getIndexCode(), r.getFormatString());
-       }
+    public HSSFDataFormat( Workbook workbook )
+    {
+        this.workbook = workbook;
+        if ( builtinFormats == null ) populateBuiltinFormats();
+        Iterator i = workbook.getFormats().iterator();
+        while ( i.hasNext() )
+        {
+            FormatRecord r = (FormatRecord) i.next();
+            if ( formats.size() < r.getIndexCode() + 1 )
+            {
+                formats.setSize( r.getIndexCode() + 1 );
+            }
+            formats.set( r.getIndexCode(), r.getFormatString() );
+        }
 
     }
 
     private static synchronized void populateBuiltinFormats()
     {
         builtinFormats = new Vector();
-        builtinFormats.add(0, "General");
-        builtinFormats.add(1, "0");
-        builtinFormats.add(2, "0.00");
-        builtinFormats.add(3, "#,##0");
-        builtinFormats.add(4, "#,##0.00");
-        builtinFormats.add(5, "($#,##0_);($#,##0)");
-        builtinFormats.add(6, "($#,##0_);[Red]($#,##0)");
-        builtinFormats.add(7, "($#,##0.00);($#,##0.00)");
-        builtinFormats.add(8, "($#,##0.00_);[Red]($#,##0.00)");
-        builtinFormats.add(9, "0%");
-        builtinFormats.add(0xa, "0.00%");
-        builtinFormats.add(0xb, "0.00E+00");
-        builtinFormats.add(0xc, "# ?/?");
-        builtinFormats.add(0xd, "# ??/??");
-        builtinFormats.add(0xe, "m/d/yy");
-        builtinFormats.add(0xf, "d-mmm-yy");
-        builtinFormats.add(0x10, "d-mmm");
-        builtinFormats.add(0x11, "mmm-yy");
-        builtinFormats.add(0x12, "h:mm AM/PM");
-        builtinFormats.add(0x13, "h:mm:ss AM/PM");
-        builtinFormats.add(0x14, "h:mm");
-        builtinFormats.add(0x15, "h:mm:ss");
-        builtinFormats.add(0x16, "m/d/yy h:mm");
+        builtinFormats.add( 0, "General" );
+        builtinFormats.add( 1, "0" );
+        builtinFormats.add( 2, "0.00" );
+        builtinFormats.add( 3, "#,##0" );
+        builtinFormats.add( 4, "#,##0.00" );
+        builtinFormats.add( 5, "($#,##0_);($#,##0)" );
+        builtinFormats.add( 6, "($#,##0_);[Red]($#,##0)" );
+        builtinFormats.add( 7, "($#,##0.00);($#,##0.00)" );
+        builtinFormats.add( 8, "($#,##0.00_);[Red]($#,##0.00)" );
+        builtinFormats.add( 9, "0%" );
+        builtinFormats.add( 0xa, "0.00%" );
+        builtinFormats.add( 0xb, "0.00E+00" );
+        builtinFormats.add( 0xc, "# ?/?" );
+        builtinFormats.add( 0xd, "# ??/??" );
+        builtinFormats.add( 0xe, "m/d/yy" );
+        builtinFormats.add( 0xf, "d-mmm-yy" );
+        builtinFormats.add( 0x10, "d-mmm" );
+        builtinFormats.add( 0x11, "mmm-yy" );
+        builtinFormats.add( 0x12, "h:mm AM/PM" );
+        builtinFormats.add( 0x13, "h:mm:ss AM/PM" );
+        builtinFormats.add( 0x14, "h:mm" );
+        builtinFormats.add( 0x15, "h:mm:ss" );
+        builtinFormats.add( 0x16, "m/d/yy h:mm" );
 
         // 0x17 - 0x24 reserved for international and undocumented
-        builtinFormats.add(0x17, "0x17");
-        builtinFormats.add(0x18, "0x18");
-        builtinFormats.add(0x19, "0x19");
-        builtinFormats.add(0x1a, "0x1a");
-        builtinFormats.add(0x1b, "0x1b");
-        builtinFormats.add(0x1c, "0x1c");
-        builtinFormats.add(0x1d, "0x1d");
-        builtinFormats.add(0x1e, "0x1e");
-        builtinFormats.add(0x1f, "0x1f");
-        builtinFormats.add(0x20, "0x20");
-        builtinFormats.add(0x21, "0x21");
-        builtinFormats.add(0x22, "0x22");
-        builtinFormats.add(0x23, "0x23");
-        builtinFormats.add(0x24, "0x24");
+        builtinFormats.add( 0x17, "0x17" );
+        builtinFormats.add( 0x18, "0x18" );
+        builtinFormats.add( 0x19, "0x19" );
+        builtinFormats.add( 0x1a, "0x1a" );
+        builtinFormats.add( 0x1b, "0x1b" );
+        builtinFormats.add( 0x1c, "0x1c" );
+        builtinFormats.add( 0x1d, "0x1d" );
+        builtinFormats.add( 0x1e, "0x1e" );
+        builtinFormats.add( 0x1f, "0x1f" );
+        builtinFormats.add( 0x20, "0x20" );
+        builtinFormats.add( 0x21, "0x21" );
+        builtinFormats.add( 0x22, "0x22" );
+        builtinFormats.add( 0x23, "0x23" );
+        builtinFormats.add( 0x24, "0x24" );
 
         // 0x17 - 0x24 reserved for international and undocumented
-        builtinFormats.add(0x25, "(#,##0_);(#,##0)");
-        builtinFormats.add(0x26, "(#,##0_);[Red](#,##0)");
-        builtinFormats.add(0x27, "(#,##0.00_);(#,##0.00)");
-        builtinFormats.add(0x28, "(#,##0.00_);[Red](#,##0.00)");
-        builtinFormats.add(0x29, "_(*#,##0_);_(*(#,##0);_(* \"-\"_);_(@_)");
-        builtinFormats.add(0x2a, "_($*#,##0_);_($*(#,##0);_($* \"-\"_);_(@_)");
-        builtinFormats.add(0x2b, "_(*#,##0.00_);_(*(#,##0.00);_(*\"-\"??_);_(@_)");
-        builtinFormats.add(0x2c,
-                    "_($*#,##0.00_);_($*(#,##0.00);_($*\"-\"??_);_(@_)");
-        builtinFormats.add(0x2d, "mm:ss");
-        builtinFormats.add(0x2e, "[h]:mm:ss");
-        builtinFormats.add(0x2f, "mm:ss.0");
-        builtinFormats.add(0x30, "##0.0E+0");
-        builtinFormats.add(0x31, "@");
+        builtinFormats.add( 0x25, "(#,##0_);(#,##0)" );
+        builtinFormats.add( 0x26, "(#,##0_);[Red](#,##0)" );
+        builtinFormats.add( 0x27, "(#,##0.00_);(#,##0.00)" );
+        builtinFormats.add( 0x28, "(#,##0.00_);[Red](#,##0.00)" );
+        builtinFormats.add( 0x29, "_(*#,##0_);_(*(#,##0);_(* \"-\"_);_(@_)" );
+        builtinFormats.add( 0x2a, "_($*#,##0_);_($*(#,##0);_($* \"-\"_);_(@_)" );
+        builtinFormats.add( 0x2b, "_(*#,##0.00_);_(*(#,##0.00);_(*\"-\"??_);_(@_)" );
+        builtinFormats.add( 0x2c,
+                "_($*#,##0.00_);_($*(#,##0.00);_($*\"-\"??_);_(@_)" );
+        builtinFormats.add( 0x2d, "mm:ss" );
+        builtinFormats.add( 0x2e, "[h]:mm:ss" );
+        builtinFormats.add( 0x2f, "mm:ss.0" );
+        builtinFormats.add( 0x30, "##0.0E+0" );
+        builtinFormats.add( 0x31, "@" );
     }
 
     public static List getBuiltinFormats()
     {
-        if (builtinFormats == null)
+        if ( builtinFormats == null )
         {
             populateBuiltinFormats();
         }
@@ -220,19 +222,19 @@ public class HSSFDataFormat
      * @return index of format or -1 if undefined.
      */
 
-    public static short getBuiltinFormat(String format)
+    public static short getBuiltinFormat( String format )
     {
-        if (builtinFormats == null)
+        if ( builtinFormats == null )
         {
             populateBuiltinFormats();
         }
         short retval = -1;
 
-        for (short k = 0; k < 0x31; k++)
+        for ( short k = 0; k < 0x31; k++ )
         {
-            String nformat = ( String ) builtinFormats.get(k);
+            String nformat = (String) builtinFormats.get( k );
 
-            if ((nformat != null) && nformat.equals(format))
+            if ( ( nformat != null ) && nformat.equals( format ) )
             {
                 retval = k;
                 break;
@@ -248,31 +250,34 @@ public class HSSFDataFormat
      * @return index of format.
      */
 
-    public short getFormat(String format)
+    public short getFormat( String format )
     {
-       ListIterator i;
-       int ind;
-       if (!movedBuiltins) {
-           i = builtinFormats.listIterator();
-           while (i.hasNext()) {
-               ind = i.nextIndex();
-               formats.add(ind, i.next());
-           }
-           movedBuiltins = true;
-       }
-       i = formats.listIterator();
-       while (i.hasNext()) {
-           ind = i.nextIndex();
-           if (format.equals(i.next())) 
-               return (short)ind;
-       }
-       
-       ind = workbook.getFormat(format, true);
-       if (formats.size() <= ind) 
-           formats.setSize(ind + 1);
-       formats.add(ind, format);
+        ListIterator i;
+        int ind;
+        if ( !movedBuiltins )
+        {
+            i = builtinFormats.listIterator();
+            while ( i.hasNext() )
+            {
+                ind = i.nextIndex();
+                formats.add( ind, i.next() );
+            }
+            movedBuiltins = true;
+        }
+        i = formats.listIterator();
+        while ( i.hasNext() )
+        {
+            ind = i.nextIndex();
+            if ( format.equals( i.next() ) )
+                return (short) ind;
+        }
+
+        ind = workbook.getFormat( format, true );
+        if ( formats.size() <= ind )
+            formats.setSize( ind + 1 );
+        formats.add( ind, format );
 
-        return (short)ind;
+        return (short) ind;
     }
 
     /**
@@ -281,12 +286,14 @@ public class HSSFDataFormat
      * @return string represented at index of format or null if there is not a  format at that index
      */
 
-    public String getFormat(short index)
+    public String getFormat( short index )
     {
-       if (movedBuiltins)
-           return ( String ) formats.get(index);
-       else
-           return (String) (builtinFormats.size() > index && builtinFormats.get(index) != null ? builtinFormats.get(index) : formats.get(index));
+        if ( movedBuiltins )
+            return (String) formats.get( index );
+        else
+            return (String) ( builtinFormats.size() > index
+                    && builtinFormats.get( index ) != null
+                    ? builtinFormats.get( index ) : formats.get( index ) );
     }
 
     /**
@@ -295,13 +302,13 @@ public class HSSFDataFormat
      * @return string represented at index of format or null if there is not a builtin format at that index
      */
 
-    public static String getBuiltinFormat(short index)
+    public static String getBuiltinFormat( short index )
     {
-        if (builtinFormats == null)
+        if ( builtinFormats == null )
         {
             populateBuiltinFormats();
         }
-        return ( String ) builtinFormats.get(index);
+        return (String) builtinFormats.get( index );
     }
 
     /**
@@ -311,7 +318,7 @@ public class HSSFDataFormat
 
     public static int getNumberOfBuiltinBuiltinFormats()
     {
-        if (builtinFormats == null)
+        if ( builtinFormats == null )
         {
             populateBuiltinFormats();
         }
index 3a75604d8c3f6b1e21f2259c27af5a4eb738d471..6532bb6600cd514a266c9fad5a284d3c68b967ca 100644 (file)
@@ -702,14 +702,14 @@ public class HSSFWorkbook
         workbook.removeName(index);        
     }
 
-        /**
+    /**
      * Creates an instance of HSSFDataFormat.
      * @return the HSSFDataFormat object
      * @see org.apache.poi.hssf.record.FormatRecord
      * @see org.apache.poi.hssf.record.Record
      */
     public HSSFDataFormat createDataFormat() {
-       return new HSSFDataFormat(workbook);
+        return new HSSFDataFormat(workbook);
     }
        
     /** remove the named range by his name
index b5cacc34fedb1418e5a47defb4a4b90b2351a077..9259748f4237983b8b4983924ab7040df55bec9a 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The area format record is used to define the colours and patterns for an area.</description>
index bbd29ea0bca5cdd4e738b608d4e8b2e1e9436b7b..b2f6df0455dd6a4d827b9192487079f7e491dbc8 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The area record is used to define a area chart.</description>
index 4adc32419299c7148ad9db0dca275a4ad5586bd9..84a4ebf194d232529199bdf13d290e1bd635256a 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The series label record defines the type of label associated with the data format record.</description>
index 8e6d119eed4b30bf035fbdf5559d988102c0dd11..a53778e524e15b74df8bd648a0bd17d541a3739c 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The number of axes used on a chart.</description>
index 000ff0798755ab26bfb4b07199804898805bb4dc..aefe4f87393430ed80da7ad3f1ca2163c47cba8b 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The axis line format record defines the axis type details.</description>
index b9da271250649a7a2b7c5c38a3b4216098a539d0..c0dc989ec6f343520c28cb1e9d10fc65338cc059 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The axis options record provides unit information and other various tidbits about the axis.</description>
index 0c8a61d57a41a532d6c92ada981403465c470127..0d0b492f037255a0c8ed5bf570f4e564ddb9a890 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The axis size and location</description>
index cfab8b6546745690ece63911edd0175571a772c9..bb9431efb972ecc898fec4ccc030804ec05edfaf 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The axis record defines the type of an axis.</description>
index 6cb91cce8c7b2d94a5967b9473ffd83ec1572753..fae957cfffe62560465aab241cbd78cb8b0dc893 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The bar record is used to define a bar chart.</description>
     <author>Glen Stampoultzis (glens at apache.org)</author>
     <fields>
         <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">
             <bit number="0" name="horizontal" description="true to display horizontal bar charts, false for vertical"/>
             <bit number="1" name="stacked" description="stack displayed values"/>
index d93b28fc8f43015aa7d19f29ab79be174e39d37f..164de04857ad3e4249a04810942aed5c053c190a 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>This record refers to a category or series axis and is used to specify label/tickmark frequency.</description>
index ae00900a815cc054746bc8db3d4e188c57a0c8f3..c7e9e069cdb79d8c87aec698e631c7a275497536 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The chart record is used to define the location and size of a chart.</description>
index 1424809c8a4ed65be89fbf11dcf4565067620228..cd76f222b2df3f3677ed13ffc246b3afaaea0599 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The dat record is used to store options for the chart.</description>
index 48f666c40bfba40f4967f676ac54a2fcfdc251af..dc6d281b9ce36562522ecd79201c143d71501284 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The data format record is used to index into a series.</description>
index c4e90053db73abf34b9516a6372e2843755577ec..9930f38c7fe072b3d02a34d4f8a93aae75af3a29 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The default data label text properties record identifies the text characteristics of the preceeding text record.</description>
index 9d529c3dcd4f502e3a9737bf16482b0c06912068..a557984bd70fd4cd1d573ccfa9d447672d4e05f0 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The font basis record stores various font metrics.</description>
index f6ce083ee8ec9d40a14c540bf307b907fe50ba8f..238a1b6a89a1bc9501a442e438fd608e2ad51a2f 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>Describes a font record.  In Excel a font belongs in the font table.</description>
index f675763f1a10a13348cfa65805301a6e9431dd64..858de98f959ea21d4589ebd5b07d55cb6653974c 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The font index record indexes into the font table for the text record.</description>
index 2561b14cc29d73dfa9657a7b9e2c22892863e430..b41cdc58704480b0f10bf372a32aa4160e5310b1 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The frame record indicates whether there is a border around the displayed text of a chart.</description>
index 81a2cae73454d4277f44c19a1360d5b8d498de33..09c3756403c3b550e700aefea69faf3056a60475 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>Defines a legend for a chart.</description>
index 14fe35e87a2b225997f3c4c90a75805e8f3a4f05..832f03854526d723bce13045241aca1ce125e4a2 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>Describes a line format record.  The line format record controls how a line on a chart appears.</description>
index 35c63bd24d746c223621030fb0c116b1d527b3f4..9417eeeca287a8d1a0f847f882cd527c8cecb63d 100644 (file)
@@ -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>
     <extends>Record</extends>
     <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"/>
         </field>
         <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>
 </record>
index 3bd1ee2463c5bd03cb5decb1f3da7127ea2dfe03..10b62dc8122f135b6056bf0f7dbb93686c823ae4 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The number format index record indexes format table.  This applies to an axis.</description>
index b63a79ead77729a448acefd23e4f32f7fb017965..b11de5d546db301abee148934df2bf2c41d21963 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>Links text to an object on the chart or identifies it as the title.</description>
index 2c883bf32b1f4473749a161e0496d318bc7bfab0..cb8970bf9285f248e470551c396c15b1cd7c5a9f 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>preceeds and identifies a frame as belonging to the plot area.</description>
index 0bfefc21a61ab9c11bd73568da442cb7bd18da5b..ff5f1433a951200200d320949365d8a61e46508d 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The plot growth record specifies the scaling factors used when a font is scaled.</description>
index f7a259536e25fe236effa8ebb0a1c69671be1917..7b04c1e3848c96214207703f5412b20d74b7ec1a 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The series chart group index record stores the index to the CHARTFORMAT record (0 based).</description>
index 72e286c1403d180f98f34ba401e79166b8f64436..eaa512655bed68b9fc9f5edaa983632c95516e3c 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>links a series to its position in the series list.</description>
index 412c8ebfa47ef8d79c8ad70c1d164f05236537e2..07b136c0fe31ce467b691db1621e49bcfb38d9a4 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The series list record defines the series displayed as an overlay to the main chart record.</description>
index 960ba78189c55bfdad75cdd0b236d58c6738327a..e9e19a0963c2c108dd161142b36c82e1b55c881a 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The series record describes the overall data for a series.</description>
index ed527768ef52cef7c675e0342c9700776764e863..4306c3cc04aacb867a64736487c82eb12b54f750 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>Defines a series name</description>
index 65963126406b213b746576aca38e257107d98081..58df542d436c4afcce2266ef4d98c939d1636459 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>Describes a chart sheet properties record.</description>
index 17cf812b9304dc83e74147882dc1a88fb025af29..462c3a6b6047fda19c3503a437a0e6ac79b2433b 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The text record is used to define text stored on a chart.</description>
index 5a69e019ae8ea03aeb2f27fc8668ec6dc2f692a2..09a15ebeefbfaa37627eb8a577e6f758e25d2aa7 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The Tick record defines how tick marks and label positioning/formatting</description>
index 70e250a1fc50b8cc842b437e6f3c70909ba40b96..11e6cb147cdd09f15c3f1b284c70407fd419183a 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The units record describes units.</description>
index fc595efe51d34c0e494cb184178c0e5d49edd6d5..8a911efc207794c2d591e507df14ea7a0197c7fd 100644 (file)
@@ -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>
     <extends>Record</extends>
     <description>The value range record defines the range of the value axis.</description>
index 685af43c729cbee21910b4c18fe1ad9ce8572918..7c6dc48e1129a661def01ed91ee49ec8b3214257 100644 (file)
@@ -76,7 +76,7 @@ public class <xsl:value-of select="@name"/>Record
     extends Record
 {
     public final static short      sid                             = <xsl:value-of select="@id"/>;
-<xsl:for-each select="//fields/field">    private  <xsl:value-of select="recutil:getType(@size,@type,10)"/><xsl:text> </xsl:text><xsl:value-of select="recutil:getFieldName(position(),@name,0)"/>;
+<xsl: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: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)
     {
         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)
     {
         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)
     {
-<xsl:variable name="fieldIterator" select="field:new()"/>
+
+<xsl:text>        int pos = 0;
+</xsl:text>
+
+ <xsl:variable name="fieldIterator" select="field:new()"/>
 <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>
     }
 
@@ -142,14 +162,16 @@ public class <xsl:value-of select="@name"/>Record
     {
         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"/>
-        buffer.append("[/<xsl:value-of select="@name"/>]\n");
+        buffer.append("[/<xsl:value-of select="recutil:getRecordId(@name,@excel-record-id)"/>]\n");
         return buffer.toString();
     }
 
     public int serialize(int offset, byte[] data)
     {
+        int pos = 0;
+
         LittleEndian.putShort(data, 0 + offset, sid);
         LittleEndian.putShort(data, 2 + offset, (short)(getRecordSize() - 4));
 <xsl:variable name="fieldIterator" select="field:new()"/>
@@ -178,11 +200,12 @@ public class <xsl:value-of select="@name"/>Record
     }
 
     public Object clone() {
-      <xsl:value-of select="@name"/>Record rec = new <xsl:value-of select="@name"/>Record();
-
-<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:for-each>
-      return rec;
+        <xsl:value-of select="@name"/>Record rec = new <xsl:value-of select="@name"/>Record();
+    <xsl:for-each select="//fields/field">
+        <xsl:text>
+        </xsl:text><xsl:value-of select="recutil:clone(@name,@type,position())"/><xsl:text>;</xsl:text>
+    </xsl:for-each>
+        return rec;
     }
 
 
@@ -276,19 +299,29 @@ public class <xsl:value-of select="@name"/>Record
 </xsl:template>
 
 <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'">
-            .append("0x")
-            .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>
-            .append(" (").append(get<xsl:value-of select="recutil:getFieldName1stCap(@name,0)"/>()).append(" )\n");
-<xsl:apply-templates select="bit" mode="bittostring"/>
+    <xsl:value-of select="recutil:getToString(@name,@type,@size)"/>
+    <xsl:text>
+        buffer.append(System.getProperty("line.separator")); </xsl:text>
+    <xsl:apply-templates select="bit" mode="bittostring"/>
+    <xsl:text>&#10;</xsl:text>
 </xsl:template>
 
-<xsl:template match="bit" mode="bittostring">
-<xsl:if test="not (@mask)">        buffer.append("         .<xsl:value-of select="recutil:getFieldName(@name,20)"/>     = ").append(is<xsl:value-of select="recutil:getFieldName1stCap(@name,20)"/>()).append('\n');
-</xsl:if>
-<xsl:if test="@mask">        buffer.append("         .<xsl:value-of select="recutil:getFieldName(@name,20)"/>     = ").append(get<xsl:value-of select="recutil:getFieldName1stCap(@name,20)"/>()).append('\n');
-</xsl:if>
-</xsl:template>
+    <xsl:template match="bit" mode="bittostring">
+        <xsl:if test="not (@mask)">
+            <xsl:text>&#10;        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 test="@mask">
+        <xsl:text>&#10;            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:template>
 
 <xsl:template match="author">
  * @author <xsl:value-of select="."/>
index 180872edd750887d443e30e3eae2d7f4cf3dcf09..5e47276b296b9ad2fb6d62ded91e89a271ccc6dd 100644 (file)
@@ -56,7 +56,7 @@
 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)
  */
@@ -74,31 +74,31 @@ public class FieldIterator
         offset = 0;
     }
 
-    /** 
+    /**
      * This utility function returns a fill method entry for a given field
      *
      * @param size - how big of an "int" or the name of the size field for a string
      * @param type - int or string
-     */    
+     */
     public String fillDecoder(String size, String type)
     {
         String javaType = RecordUtil.getType(size, type, 0);
 
         String result = "";
         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[]"))
-            result = "LittleEndian.getShortArray(data, 0x" + Integer.toHexString(offset) + " + offset)";
+            result = "LittleEndian.getShortArray(data, pos + 0x" + Integer.toHexString(offset) + " + offset)";
         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"))
-            result = "data[ 0x" + Integer.toHexString(offset) + " + offset ]";
+            result = "data[ pos + 0x" + Integer.toHexString(offset) + " + offset ]";
         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"))
-            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"))
-            result = "StringUtil.getFromUnicodeHigh(data, 0x" + Integer.toHexString(offset) + " + offset, ("+ size+"/2))";
+            result = "StringUtil.getFromUnicodeHigh(data, pos + 0x" + Integer.toHexString(offset) + " + offset, ("+ size+"/2))";
 
         try
         {
@@ -109,7 +109,31 @@ public class FieldIterator
         }
         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
     public String serialiseEncoder( int fieldNumber, String fieldName, String size, String type)
@@ -118,21 +142,23 @@ public class FieldIterator
         String javaFieldName = RecordUtil.getFieldName(fieldNumber,fieldName,0);
 
         String result = "";
-        if (javaType.equals("short"))
-            result = "LittleEndian.putShort(data, " + (offset+4) + " + offset, " + javaFieldName + ");";
+        if (type.startsWith("custom:"))
+            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[]"))
-            result = "LittleEndian.putShortArray(data, " + (offset+4) + " + offset, " + javaFieldName + ");";
+            result = "LittleEndian.putShortArray(data, " + (offset+4) + " + offset + pos, " + javaFieldName + ");";
         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"))
-            result = "data[ " + (offset+4) + " + offset ] = " + javaFieldName + ";";
+            result = "data[ " + (offset+4) + " + offset + pos ] = " + javaFieldName + ";";
         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"))
-            result = "StringUtil.putUncompressedUnicode("+ javaFieldName +", data, offset+4);";
+            result = "StringUtil.putUncompressedUnicode("+ javaFieldName +", data, offset + pos + 4);";
         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
         {
@@ -148,7 +174,12 @@ public class FieldIterator
     public String calcSize( int fieldNumber, String fieldName, String size, String type)
     {
         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);
             return result + " ("+javaFieldName + ".length() *2)";
@@ -157,12 +188,12 @@ public class FieldIterator
         {
             String javaFieldName = RecordUtil.getFieldName(fieldNumber,fieldName,0);
             return result + javaFieldName + ".length * 2 + 2";
-        } else 
+        } else
         {
             return result + size;
         }
     }
-    
+
 
 }
 
index b5c0a594ce30b4ae15661e35adb872d9a3f44d9f..87c19e49c7462e7180aa9512135e227c294675cd 100644 (file)
@@ -64,6 +64,8 @@ import java.util.StringTokenizer;
  */
 public class RecordUtil
 {
+    private static final String CR = "\n";
+
     public static String getFieldName(int position, String name, int padTo)
     {
         StringBuffer fieldName = new StringBuffer("field_" + position + "_");
@@ -99,6 +101,36 @@ public class RecordUtil
         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)
     {
         for (int i = 0; i < name.length(); i++)
@@ -139,7 +171,12 @@ public class RecordUtil
             return pad(new StringBuffer("String"), padTo).toString();
         else if (type.equals("hbstring"))
             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
     }
@@ -201,5 +238,37 @@ public class RecordUtil
         }
         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;
+    }
 }
index a2e3d7a3b0f6464117b64026a9f9a7476d095417..442f63df58a3bf1ee033b11e140b0baca66462d8 100644 (file)
@@ -64,16 +64,92 @@ import junit.framework.TestCase;
  * class works correctly.  Test data taken directly from a real
  * Excel file.
  *
-
  * @author Glen Stampoultzis (glens at apache.org)
  */
 public class TestLinkedDataRecord
         extends TestCase
 {
-    byte[] data = new byte[] {
-        (byte)0x00,
-        (byte)0x01,
-        (byte)0x00,(byte)0x00,
+
+/*
+    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) 0x00,
+        (byte) 0x01,
+        (byte) 0x00, (byte) 0x00,
         (byte)0x00,(byte)0x00,
         (byte)0x00,(byte)0x00          // not supported
     };
index 597e267c43d5c89b326ed2625c82e044e0ac190a..c55a8518266d4781c79739a533a774cd45f90f36 100644 (file)
@@ -62,8 +62,6 @@ public class TestNamedRange
         POIFSFileSystem fs  = null;
         HSSFWorkbook wb     = null;
         
-        System.out.println("testTestCase");
-        
         String filename = System.getProperty("HSSF.testdata.path");
 
         filename = filename + "/Simple.xls";