From a1f4852347225caaa8dfde0333b327e02d823fa8 Mon Sep 17 00:00:00 2001 From: Josh Micich Date: Wed, 6 Aug 2008 06:27:39 +0000 Subject: [PATCH] Partial fix for bug 45570 - Converted instance BitField fields to static git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@683132 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hssf/record/AreaFormatRecord.java | 29 +++--- .../apache/poi/hssf/record/AreaRecord.java | 27 ++---- .../poi/hssf/record/AxisOptionsRecord.java | 59 +++++------- .../org/apache/poi/hssf/record/BarRecord.java | 33 +++---- .../poi/hssf/record/BoundSheetRecord.java | 15 ++- .../apache/poi/hssf/record/CFRuleRecord.java | 3 +- .../hssf/record/CategorySeriesAxisRecord.java | 31 +++--- .../poi/hssf/record/ChartFormatRecord.java | 12 +-- .../record/CommonObjectDataSubRecord.java | 96 +++++++++---------- .../org/apache/poi/hssf/record/DatRecord.java | 33 +++---- .../poi/hssf/record/DataFormatRecord.java | 37 +++---- .../apache/poi/hssf/record/FormulaRecord.java | 21 ++-- .../apache/poi/hssf/record/FrameRecord.java | 29 +++--- .../apache/poi/hssf/record/LegendRecord.java | 37 +++---- .../poi/hssf/record/LineFormatRecord.java | 31 +++--- .../poi/hssf/record/LinkedDataRecord.java | 31 +++--- .../poi/hssf/record/SeriesLabelsRecord.java | 38 +++----- .../hssf/record/SheetPropertiesRecord.java | 35 +++---- .../apache/poi/hssf/record/StyleRecord.java | 17 ++-- .../apache/poi/hssf/record/TableRecord.java | 34 +++---- .../poi/hssf/record/TextObjectBaseRecord.java | 26 ++--- .../apache/poi/hssf/record/TextRecord.java | 53 +++++----- .../apache/poi/hssf/record/TickRecord.java | 33 +++---- .../poi/hssf/record/ValueRangeRecord.java | 43 ++++----- .../poi/hssf/record/WindowTwoRecord.java | 43 ++++----- .../poi/hssf/record/formula/Area3DPtg.java | 7 +- .../poi/hssf/record/formula/Ref3DPtg.java | 6 +- 27 files changed, 354 insertions(+), 505 deletions(-) diff --git a/src/java/org/apache/poi/hssf/record/AreaFormatRecord.java b/src/java/org/apache/poi/hssf/record/AreaFormatRecord.java index 6482112e6f..843128120e 100644 --- a/src/java/org/apache/poi/hssf/record/AreaFormatRecord.java +++ b/src/java/org/apache/poi/hssf/record/AreaFormatRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * The area format record is used to define the colours and patterns for an area. @@ -30,16 +29,16 @@ import org.apache.poi.util.*; * @author Glen Stampoultzis (glens at apache.org) */ -public class AreaFormatRecord - extends Record -{ - public final static short sid = 0x100a; +public final class AreaFormatRecord extends Record { + public final static short sid = 0x100A; + + private static final BitField automatic = BitFieldFactory.getInstance(0x1); + private static final BitField invert = BitFieldFactory.getInstance(0x2); + private int field_1_foregroundColor; private int field_2_backgroundColor; private short field_3_pattern; private short field_4_formatFlags; - private BitField automatic = BitFieldFactory.getInstance(0x1); - private BitField invert = BitFieldFactory.getInstance(0x2); private short field_5_forecolorIndex; private short field_6_backcolorIndex; @@ -297,10 +296,4 @@ public class AreaFormatRecord { return invert.isSet(field_4_formatFlags); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/AreaRecord.java b/src/java/org/apache/poi/hssf/record/AreaRecord.java index 32aa57eed2..fd65289460 100644 --- a/src/java/org/apache/poi/hssf/record/AreaRecord.java +++ b/src/java/org/apache/poi/hssf/record/AreaRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * The area record is used to define a area chart. @@ -30,14 +29,12 @@ import org.apache.poi.util.*; * @author Glen Stampoultzis (glens at apache.org) */ -public class AreaRecord - extends Record -{ +public final class AreaRecord extends Record { public final static short sid = 0x101A; private short field_1_formatFlags; - private BitField stacked = BitFieldFactory.getInstance(0x1); - private BitField displayAsPercentage = BitFieldFactory.getInstance(0x2); - private BitField shadow = BitFieldFactory.getInstance(0x4); + private static final BitField stacked = BitFieldFactory.getInstance(0x1); + private static final BitField displayAsPercentage = BitFieldFactory.getInstance(0x2); + private static final BitField shadow = BitFieldFactory.getInstance(0x4); public AreaRecord() @@ -197,10 +194,4 @@ public class AreaRecord { return shadow.isSet(field_1_formatFlags); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/AxisOptionsRecord.java b/src/java/org/apache/poi/hssf/record/AxisOptionsRecord.java index be359b80a8..8be3f200be 100644 --- a/src/java/org/apache/poi/hssf/record/AxisOptionsRecord.java +++ b/src/java/org/apache/poi/hssf/record/AxisOptionsRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * The axis options record provides unit information and other various tidbits about the axis. @@ -30,27 +29,27 @@ import org.apache.poi.util.*; * @author Andrew C. Oliver(acoliver at apache.org) */ -public class AxisOptionsRecord - extends Record -{ - public final static short sid = 0x1062; - private short field_1_minimumCategory; - private short field_2_maximumCategory; - private short field_3_majorUnitValue; - private short field_4_majorUnit; - private short field_5_minorUnitValue; - private short field_6_minorUnit; - private short field_7_baseUnit; - private short field_8_crossingPoint; - private short field_9_options; - private BitField defaultMinimum = BitFieldFactory.getInstance(0x1); - private BitField defaultMaximum = BitFieldFactory.getInstance(0x2); - private BitField defaultMajor = BitFieldFactory.getInstance(0x4); - private BitField defaultMinorUnit = BitFieldFactory.getInstance(0x8); - private BitField isDate = BitFieldFactory.getInstance(0x10); - private BitField defaultBase = BitFieldFactory.getInstance(0x20); - private BitField defaultCross = BitFieldFactory.getInstance(0x40); - private BitField defaultDateSettings = BitFieldFactory.getInstance(0x80); +public final class AxisOptionsRecord extends Record { + public final static short sid = 0x1062; + + private static final BitField defaultMinimum = BitFieldFactory.getInstance(0x01); + private static final BitField defaultMaximum = BitFieldFactory.getInstance(0x02); + private static final BitField defaultMajor = BitFieldFactory.getInstance(0x04); + private static final BitField defaultMinorUnit = BitFieldFactory.getInstance(0x08); + private static final BitField isDate = BitFieldFactory.getInstance(0x10); + private static final BitField defaultBase = BitFieldFactory.getInstance(0x20); + private static final BitField defaultCross = BitFieldFactory.getInstance(0x40); + private static final BitField defaultDateSettings = BitFieldFactory.getInstance(0x80); + + private short field_1_minimumCategory; + private short field_2_maximumCategory; + private short field_3_majorUnitValue; + private short field_4_majorUnit; + private short field_5_minorUnitValue; + private short field_6_minorUnit; + private short field_7_baseUnit; + private short field_8_crossingPoint; + private short field_9_options; public AxisOptionsRecord() @@ -488,10 +487,4 @@ public class AxisOptionsRecord { return defaultDateSettings.isSet(field_9_options); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/BarRecord.java b/src/java/org/apache/poi/hssf/record/BarRecord.java index 794247e3a4..0c88385ba8 100644 --- a/src/java/org/apache/poi/hssf/record/BarRecord.java +++ b/src/java/org/apache/poi/hssf/record/BarRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * The bar record is used to define a bar chart. @@ -30,17 +29,17 @@ import org.apache.poi.util.*; * @author Glen Stampoultzis (glens at apache.org) */ -public class BarRecord - extends Record -{ - public final static short sid = 0x1017; +public final class BarRecord extends Record { + public final static short sid = 0x1017; + + private static final BitField horizontal = BitFieldFactory.getInstance(0x1); + private static final BitField stacked = BitFieldFactory.getInstance(0x2); + private static final BitField displayAsPercentage = BitFieldFactory.getInstance(0x4); + private static final BitField shadow = BitFieldFactory.getInstance(0x8); + private short field_1_barSpace; private short field_2_categorySpace; private short field_3_formatFlags; - private BitField horizontal = BitFieldFactory.getInstance(0x1); - private BitField stacked = BitFieldFactory.getInstance(0x2); - private BitField displayAsPercentage = BitFieldFactory.getInstance(0x4); - private BitField shadow = BitFieldFactory.getInstance(0x8); public BarRecord() @@ -264,10 +263,4 @@ public class BarRecord { return shadow.isSet(field_3_formatFlags); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/BoundSheetRecord.java b/src/java/org/apache/poi/hssf/record/BoundSheetRecord.java index 78daff2ebb..2ef4c67d2c 100644 --- a/src/java/org/apache/poi/hssf/record/BoundSheetRecord.java +++ b/src/java/org/apache/poi/hssf/record/BoundSheetRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; +import org.apache.poi.util.BitField; import org.apache.poi.util.BitFieldFactory; import org.apache.poi.util.LittleEndian; import org.apache.poi.util.StringUtil; @@ -33,12 +32,10 @@ import org.apache.poi.util.StringUtil; * @author Sergei Kozello (sergeikozello at mail.ru) * @version 2.0-pre */ +public final class BoundSheetRecord extends Record { + public final static short sid = 0x0085; -public class BoundSheetRecord - extends Record -{ - private static final short HIDDEN_FLAG_MASK = 0x01; - public final static short sid = 0x85; + private static final BitField hiddenFlag = BitFieldFactory.getInstance(0x01); private int field_1_position_of_BOF; private short field_2_option_flags; private byte field_3_sheetname_length; @@ -305,10 +302,10 @@ public class BoundSheetRecord } public boolean isHidden() { - return BitFieldFactory.getInstance(HIDDEN_FLAG_MASK).isSet(field_2_option_flags); + return hiddenFlag.isSet(field_2_option_flags); } public void setHidden(boolean hidden) { - field_2_option_flags = BitFieldFactory.getInstance(HIDDEN_FLAG_MASK).setShortBoolean(field_2_option_flags, hidden); + field_2_option_flags = hiddenFlag.setShortBoolean(field_2_option_flags, hidden); } } diff --git a/src/java/org/apache/poi/hssf/record/CFRuleRecord.java b/src/java/org/apache/poi/hssf/record/CFRuleRecord.java index d000b5311d..06256c5cc5 100644 --- a/src/java/org/apache/poi/hssf/record/CFRuleRecord.java +++ b/src/java/org/apache/poi/hssf/record/CFRuleRecord.java @@ -31,8 +31,7 @@ import org.apache.poi.util.LittleEndian; * Conditional Formatting Rule Record. * @author Dmitriy Kumshayev */ -public final class CFRuleRecord extends Record -{ +public final class CFRuleRecord extends Record { public static final short sid = 0x01B1; diff --git a/src/java/org/apache/poi/hssf/record/CategorySeriesAxisRecord.java b/src/java/org/apache/poi/hssf/record/CategorySeriesAxisRecord.java index 7e38d6f6e6..0521ea709c 100644 --- a/src/java/org/apache/poi/hssf/record/CategorySeriesAxisRecord.java +++ b/src/java/org/apache/poi/hssf/record/CategorySeriesAxisRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * This record refers to a category or series axis and is used to specify label/tickmark frequency. @@ -30,17 +29,17 @@ import org.apache.poi.util.*; * @author Glen Stampoultzis (glens at apache.org) */ -public class CategorySeriesAxisRecord - extends Record -{ - public final static short sid = 0x1020; +public final class CategorySeriesAxisRecord extends Record { + public final static short sid = 0x1020; + + private static final BitField valueAxisCrossing = BitFieldFactory.getInstance(0x1); + private static final BitField crossesFarRight = BitFieldFactory.getInstance(0x2); + private static final BitField reversed = BitFieldFactory.getInstance(0x4); + private short field_1_crossingPoint; private short field_2_labelFrequency; private short field_3_tickMarkFrequency; private short field_4_options; - private BitField valueAxisCrossing = BitFieldFactory.getInstance(0x1); - private BitField crossesFarRight = BitFieldFactory.getInstance(0x2); - private BitField reversed = BitFieldFactory.getInstance(0x4); public CategorySeriesAxisRecord() @@ -268,10 +267,4 @@ public class CategorySeriesAxisRecord { return reversed.isSet(field_4_options); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/ChartFormatRecord.java b/src/java/org/apache/poi/hssf/record/ChartFormatRecord.java index 7a36914903..f5fd1d9530 100644 --- a/src/java/org/apache/poi/hssf/record/ChartFormatRecord.java +++ b/src/java/org/apache/poi/hssf/record/ChartFormatRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; -import org.apache.poi.util.LittleEndian; import org.apache.poi.util.BitField; import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.LittleEndian; /** * Class ChartFormatRecord @@ -30,19 +28,17 @@ import org.apache.poi.util.BitFieldFactory; * @author Glen Stampoultzis (glens at apache.org) * @version %I%, %G% */ - -public class ChartFormatRecord - extends Record -{ +public final class ChartFormatRecord extends Record { public static final short sid = 0x1014; + private static final BitField varyDisplayPattern = BitFieldFactory.getInstance(0x01); + // ignored? private int field1_x_position; // lower left private int field2_y_position; // lower left private int field3_width; private int field4_height; private short field5_grbit; - private BitField varyDisplayPattern = BitFieldFactory.getInstance(0x01); public ChartFormatRecord() { diff --git a/src/java/org/apache/poi/hssf/record/CommonObjectDataSubRecord.java b/src/java/org/apache/poi/hssf/record/CommonObjectDataSubRecord.java index c4768ab0c7..dd29f0d65c 100644 --- a/src/java/org/apache/poi/hssf/record/CommonObjectDataSubRecord.java +++ b/src/java/org/apache/poi/hssf/record/CommonObjectDataSubRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,63 +14,64 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * The common object data record is used to store all common preferences for an excel object. * NOTE: This source is automatically generated please do not modify this file. Either subclass or * remove the record in src/records/definitions. - + * * @author Glen Stampoultzis (glens at apache.org) */ -public class CommonObjectDataSubRecord - extends SubRecord -{ - public final static short sid = 0x15; +public final class CommonObjectDataSubRecord extends SubRecord { + public final static short sid = 0x0015; + + private static final BitField locked = BitFieldFactory.getInstance(0x0001); + private static final BitField printable = BitFieldFactory.getInstance(0x0010); + private static final BitField autofill = BitFieldFactory.getInstance(0x2000); + private static final BitField autoline = BitFieldFactory.getInstance(0x4000); + + public final static short OBJECT_TYPE_GROUP = 0; + public final static short OBJECT_TYPE_LINE = 1; + public final static short OBJECT_TYPE_RECTANGLE = 2; + public final static short OBJECT_TYPE_OVAL = 3; + public final static short OBJECT_TYPE_ARC = 4; + public final static short OBJECT_TYPE_CHART = 5; + public final static short OBJECT_TYPE_TEXT = 6; + public final static short OBJECT_TYPE_BUTTON = 7; + public final static short OBJECT_TYPE_PICTURE = 8; + public final static short OBJECT_TYPE_POLYGON = 9; + public final static short OBJECT_TYPE_RESERVED1 = 10; + public final static short OBJECT_TYPE_CHECKBOX = 11; + public final static short OBJECT_TYPE_OPTION_BUTTON = 12; + public final static short OBJECT_TYPE_EDIT_BOX = 13; + public final static short OBJECT_TYPE_LABEL = 14; + public final static short OBJECT_TYPE_DIALOG_BOX = 15; + public final static short OBJECT_TYPE_SPINNER = 16; + public final static short OBJECT_TYPE_SCROLL_BAR = 17; + public final static short OBJECT_TYPE_LIST_BOX = 18; + public final static short OBJECT_TYPE_GROUP_BOX = 19; + public final static short OBJECT_TYPE_COMBO_BOX = 20; + public final static short OBJECT_TYPE_RESERVED2 = 21; + public final static short OBJECT_TYPE_RESERVED3 = 22; + public final static short OBJECT_TYPE_RESERVED4 = 23; + public final static short OBJECT_TYPE_RESERVED5 = 24; + public final static short OBJECT_TYPE_COMMENT = 25; + public final static short OBJECT_TYPE_RESERVED6 = 26; + public final static short OBJECT_TYPE_RESERVED7 = 27; + public final static short OBJECT_TYPE_RESERVED8 = 28; + public final static short OBJECT_TYPE_RESERVED9 = 29; + public final static short OBJECT_TYPE_MICROSOFT_OFFICE_DRAWING = 30; + private short field_1_objectType; - public final static short OBJECT_TYPE_GROUP = 0; - public final static short OBJECT_TYPE_LINE = 1; - public final static short OBJECT_TYPE_RECTANGLE = 2; - public final static short OBJECT_TYPE_OVAL = 3; - public final static short OBJECT_TYPE_ARC = 4; - public final static short OBJECT_TYPE_CHART = 5; - public final static short OBJECT_TYPE_TEXT = 6; - public final static short OBJECT_TYPE_BUTTON = 7; - public final static short OBJECT_TYPE_PICTURE = 8; - public final static short OBJECT_TYPE_POLYGON = 9; - public final static short OBJECT_TYPE_RESERVED1 = 10; - public final static short OBJECT_TYPE_CHECKBOX = 11; - public final static short OBJECT_TYPE_OPTION_BUTTON = 12; - public final static short OBJECT_TYPE_EDIT_BOX = 13; - public final static short OBJECT_TYPE_LABEL = 14; - public final static short OBJECT_TYPE_DIALOG_BOX = 15; - public final static short OBJECT_TYPE_SPINNER = 16; - public final static short OBJECT_TYPE_SCROLL_BAR = 17; - public final static short OBJECT_TYPE_LIST_BOX = 18; - public final static short OBJECT_TYPE_GROUP_BOX = 19; - public final static short OBJECT_TYPE_COMBO_BOX = 20; - public final static short OBJECT_TYPE_RESERVED2 = 21; - public final static short OBJECT_TYPE_RESERVED3 = 22; - public final static short OBJECT_TYPE_RESERVED4 = 23; - public final static short OBJECT_TYPE_RESERVED5 = 24; - public final static short OBJECT_TYPE_COMMENT = 25; - public final static short OBJECT_TYPE_RESERVED6 = 26; - public final static short OBJECT_TYPE_RESERVED7 = 27; - public final static short OBJECT_TYPE_RESERVED8 = 28; - public final static short OBJECT_TYPE_RESERVED9 = 29; - public final static short OBJECT_TYPE_MICROSOFT_OFFICE_DRAWING = 30; private short field_2_objectId; private short field_3_option; - private BitField locked = BitFieldFactory.getInstance(0x1); - private BitField printable = BitFieldFactory.getInstance(0x10); - private BitField autofill = BitFieldFactory.getInstance(0x2000); - private BitField autoline = BitFieldFactory.getInstance(0x4000); private int field_4_reserved1; private int field_5_reserved2; private int field_6_reserved3; @@ -431,8 +431,4 @@ public class CommonObjectDataSubRecord { return autoline.isSet(field_3_option); } - - -} // END OF CLASS - - +} diff --git a/src/java/org/apache/poi/hssf/record/DatRecord.java b/src/java/org/apache/poi/hssf/record/DatRecord.java index 1045996916..476b13291b 100644 --- a/src/java/org/apache/poi/hssf/record/DatRecord.java +++ b/src/java/org/apache/poi/hssf/record/DatRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * The dat record is used to store options for the chart. @@ -30,15 +29,15 @@ import org.apache.poi.util.*; * @author Glen Stampoultzis (glens at apache.org) */ -public class DatRecord - extends Record -{ - public final static short sid = 0x1063; +public final class DatRecord extends Record { + public final static short sid = 0x1063; + + private static final BitField horizontalBorder = BitFieldFactory.getInstance(0x1); + private static final BitField verticalBorder = BitFieldFactory.getInstance(0x2); + private static final BitField border = BitFieldFactory.getInstance(0x4); + private static final BitField showSeriesKey = BitFieldFactory.getInstance(0x8); + private short field_1_options; - private BitField horizontalBorder = BitFieldFactory.getInstance(0x1); - private BitField verticalBorder = BitFieldFactory.getInstance(0x2); - private BitField border = BitFieldFactory.getInstance(0x4); - private BitField showSeriesKey = BitFieldFactory.getInstance(0x8); public DatRecord() @@ -216,10 +215,4 @@ public class DatRecord { return showSeriesKey.isSet(field_1_options); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/DataFormatRecord.java b/src/java/org/apache/poi/hssf/record/DataFormatRecord.java index 027e0c1afd..f86834daae 100644 --- a/src/java/org/apache/poi/hssf/record/DataFormatRecord.java +++ b/src/java/org/apache/poi/hssf/record/DataFormatRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,30 +14,30 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * The data format record is used to index into a series. * NOTE: This source is automatically generated please do not modify this file. Either subclass or * remove the record in src/records/definitions. - + * * @author Glen Stampoultzis (glens at apache.org) */ -public class DataFormatRecord - extends Record -{ - public final static short sid = 0x1006; - private short field_1_pointNumber; - private short field_2_seriesIndex; - private short field_3_seriesNumber; - private short field_4_formatFlags; - private BitField useExcel4Colors = BitFieldFactory.getInstance(0x1); +public final class DataFormatRecord extends Record { + public final static short sid = 0x1006; + + private static final BitField useExcel4Colors = BitFieldFactory.getInstance(0x1); + + private short field_1_pointNumber; + private short field_2_seriesIndex; + private short field_3_seriesNumber; + private short field_4_formatFlags; public DataFormatRecord() @@ -228,10 +227,4 @@ public class DataFormatRecord { return useExcel4Colors.isSet(field_4_formatFlags); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/FormulaRecord.java b/src/java/org/apache/poi/hssf/record/FormulaRecord.java index 1583aa039b..1aaa155a23 100644 --- a/src/java/org/apache/poi/hssf/record/FormulaRecord.java +++ b/src/java/org/apache/poi/hssf/record/FormulaRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - -/* - * FormulaRecord.java - * - * Created on October 28, 2001, 5:44 PM - */ package org.apache.poi.hssf.record; import java.util.List; @@ -39,24 +32,22 @@ import org.apache.poi.util.LittleEndian; * @author Jason Height (jheight at chariot dot net dot au) * @version 2.0-pre */ - public final class FormulaRecord extends Record implements CellValueRecordInterface, Comparable { - public static final short sid = - 0x06; // docs say 406...because of a bug Microsoft support site article #Q184647) - - //private short field_1_row; + public static final short sid = 0x0006; // docs say 406...because of a bug Microsoft support site article #Q184647) + + private static final BitField alwaysCalc = BitFieldFactory.getInstance(0x0001); + private static final BitField calcOnLoad = BitFieldFactory.getInstance(0x0002); + private static final BitField sharedFormula = BitFieldFactory.getInstance(0x0008); + private int field_1_row; private short field_2_column; private short field_3_xf; private double field_4_value; private short field_5_options; - private BitField alwaysCalc = BitFieldFactory.getInstance(0x0001); - private BitField calcOnLoad = BitFieldFactory.getInstance(0x0002); - private BitField sharedFormula = BitFieldFactory.getInstance(0x0008); private int field_6_zero; private short field_7_expression_len; private Stack field_8_parsed_expr; diff --git a/src/java/org/apache/poi/hssf/record/FrameRecord.java b/src/java/org/apache/poi/hssf/record/FrameRecord.java index 19ef9e0c62..e4a2bf6c3a 100644 --- a/src/java/org/apache/poi/hssf/record/FrameRecord.java +++ b/src/java/org/apache/poi/hssf/record/FrameRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * The frame record indicates whether there is a border around the displayed text of a chart. @@ -30,16 +29,16 @@ import org.apache.poi.util.*; * @author Glen Stampoultzis (glens at apache.org) */ -public class FrameRecord - extends Record -{ - public final static short sid = 0x1032; +public final class FrameRecord extends Record { + public final static short sid = 0x1032; + + private static final BitField autoSize = BitFieldFactory.getInstance(0x1); + private static final BitField autoPosition = BitFieldFactory.getInstance(0x2); + private short field_1_borderType; public final static short BORDER_TYPE_REGULAR = 0; public final static short BORDER_TYPE_SHADOW = 1; private short field_2_options; - private BitField autoSize = BitFieldFactory.getInstance(0x1); - private BitField autoPosition = BitFieldFactory.getInstance(0x2); public FrameRecord() @@ -211,10 +210,4 @@ public class FrameRecord { return autoPosition.isSet(field_2_options); } - - -} // END OF CLASS - - - - +} \ No newline at end of file diff --git a/src/java/org/apache/poi/hssf/record/LegendRecord.java b/src/java/org/apache/poi/hssf/record/LegendRecord.java index 40ddb887c2..e9c529ea3c 100644 --- a/src/java/org/apache/poi/hssf/record/LegendRecord.java +++ b/src/java/org/apache/poi/hssf/record/LegendRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * Defines a legend for a chart. @@ -30,10 +29,16 @@ import org.apache.poi.util.*; * @author Andrew C. Oliver (acoliver at apache.org) */ -public class LegendRecord - extends Record -{ - public final static short sid = 0x1015; +public final class LegendRecord extends Record { + public final static short sid = 0x1015; + + private static final BitField autoPosition = BitFieldFactory.getInstance(0x01); + private static final BitField autoSeries = BitFieldFactory.getInstance(0x02); + private static final BitField autoXPositioning = BitFieldFactory.getInstance(0x04); + private static final BitField autoYPositioning = BitFieldFactory.getInstance(0x08); + private static final BitField vertical = BitFieldFactory.getInstance(0x10); + private static final BitField dataTable = BitFieldFactory.getInstance(0x20); + private int field_1_xAxisUpperLeft; private int field_2_yAxisUpperLeft; private int field_3_xSize; @@ -50,12 +55,6 @@ public class LegendRecord public final static byte SPACING_MEDIUM = 1; public final static byte SPACING_OPEN = 2; private short field_7_options; - private BitField autoPosition = BitFieldFactory.getInstance(0x1); - private BitField autoSeries = BitFieldFactory.getInstance(0x2); - private BitField autoXPositioning = BitFieldFactory.getInstance(0x4); - private BitField autoYPositioning = BitFieldFactory.getInstance(0x8); - private BitField vertical = BitFieldFactory.getInstance(0x10); - private BitField dataTable = BitFieldFactory.getInstance(0x20); public LegendRecord() @@ -437,10 +436,4 @@ public class LegendRecord { return dataTable.isSet(field_7_options); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/LineFormatRecord.java b/src/java/org/apache/poi/hssf/record/LineFormatRecord.java index 5e359ab828..8caa8e4a4b 100644 --- a/src/java/org/apache/poi/hssf/record/LineFormatRecord.java +++ b/src/java/org/apache/poi/hssf/record/LineFormatRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * Describes a line format record. The line format record controls how a line on a chart appears. @@ -30,10 +29,13 @@ import org.apache.poi.util.*; * @author Glen Stampoultzis (glens at apache.org) */ -public class LineFormatRecord - extends Record -{ - public final static short sid = 0x1007; +public final class LineFormatRecord extends Record { + public final static short sid = 0x1007; + + private static final BitField auto = BitFieldFactory.getInstance(0x1); + private static final BitField drawTicks = BitFieldFactory.getInstance(0x4); + private static final BitField unknown = BitFieldFactory.getInstance(0x4); + private int field_1_lineColor; private short field_2_linePattern; public final static short LINE_PATTERN_SOLID = 0; @@ -51,9 +53,6 @@ public class LineFormatRecord public final static short WEIGHT_MEDIUM = 1; public final static short WEIGHT_WIDE = 2; private short field_4_format; - private BitField auto = BitFieldFactory.getInstance(0x1); - private BitField drawTicks = BitFieldFactory.getInstance(0x4); - private BitField unknown = BitFieldFactory.getInstance(0x4); private short field_5_colourPaletteIndex; @@ -342,10 +341,4 @@ public class LineFormatRecord { return unknown.isSet(field_4_format); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/LinkedDataRecord.java b/src/java/org/apache/poi/hssf/record/LinkedDataRecord.java index 46d52bf094..093c1a86cb 100644 --- a/src/java/org/apache/poi/hssf/record/LinkedDataRecord.java +++ b/src/java/org/apache/poi/hssf/record/LinkedDataRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * Describes a linked data record. This record referes to the series data or text. @@ -30,10 +29,11 @@ import org.apache.poi.util.*; * @author Glen Stampoultzis (glens at apache.org) */ -public class LinkedDataRecord - extends Record -{ - public final static short sid = 0x1051; +public final class LinkedDataRecord extends Record { + public final static short sid = 0x1051; + + private static final BitField customNumberFormat= BitFieldFactory.getInstance(0x1); + private byte field_1_linkType; public final static byte LINK_TYPE_TITLE_OR_TEXT = 0; public final static byte LINK_TYPE_VALUES = 1; @@ -45,7 +45,6 @@ public class LinkedDataRecord public final static byte REFERENCE_TYPE_NOT_USED = 3; public final static byte REFERENCE_TYPE_ERROR_REPORTED = 4; private short field_3_options; - private BitField customNumberFormat = BitFieldFactory.getInstance(0x1); private short field_4_indexNumberFmtRecord; private LinkedDataFormulaField field_5_formulaOfLink; @@ -86,7 +85,7 @@ public class LinkedDataRecord field_2_referenceType = in.readByte(); field_3_options = in.readShort(); field_4_indexNumberFmtRecord = in.readShort(); - field_5_formulaOfLink = new org.apache.poi.hssf.record.LinkedDataFormulaField(); + field_5_formulaOfLink = new LinkedDataFormulaField(); field_5_formulaOfLink.fillField(in); } @@ -156,7 +155,7 @@ public class LinkedDataRecord 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());; + rec.field_5_formulaOfLink = ((LinkedDataFormulaField)field_5_formulaOfLink.clone());; return rec; } @@ -286,10 +285,4 @@ public class LinkedDataRecord { return customNumberFormat.isSet(field_3_options); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/SeriesLabelsRecord.java b/src/java/org/apache/poi/hssf/record/SeriesLabelsRecord.java index e2066b8b0b..e18ae4be83 100644 --- a/src/java/org/apache/poi/hssf/record/SeriesLabelsRecord.java +++ b/src/java/org/apache/poi/hssf/record/SeriesLabelsRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * The series label record defines the type of label associated with the data format record. @@ -30,18 +29,17 @@ import org.apache.poi.util.*; * @author Glen Stampoultzis (glens at apache.org) */ -public class SeriesLabelsRecord - extends Record -{ - public final static short sid = 0x100c; - private short field_1_formatFlags; - private BitField showActual = BitFieldFactory.getInstance(0x1); - private BitField showPercent = BitFieldFactory.getInstance(0x2); - private BitField labelAsPercentage = BitFieldFactory.getInstance(0x4); - private BitField smoothedLine = BitFieldFactory.getInstance(0x8); - private BitField showLabel = BitFieldFactory.getInstance(0x10); - private BitField showBubbleSizes = BitFieldFactory.getInstance(0x20); +public final class SeriesLabelsRecord extends Record { + public final static short sid = 0x100c; + + private static final BitField showActual = BitFieldFactory.getInstance(0x01); + private static final BitField showPercent = BitFieldFactory.getInstance(0x02); + private static final BitField labelAsPercentage = BitFieldFactory.getInstance(0x04); + private static final BitField smoothedLine = BitFieldFactory.getInstance(0x08); + private static final BitField showLabel = BitFieldFactory.getInstance(0x10); + private static final BitField showBubbleSizes = BitFieldFactory.getInstance(0x20); + private short field_1_formatFlags; public SeriesLabelsRecord() { @@ -256,10 +254,4 @@ public class SeriesLabelsRecord { return showBubbleSizes.isSet(field_1_formatFlags); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/SheetPropertiesRecord.java b/src/java/org/apache/poi/hssf/record/SheetPropertiesRecord.java index 84fc3efc10..c919278b42 100644 --- a/src/java/org/apache/poi/hssf/record/SheetPropertiesRecord.java +++ b/src/java/org/apache/poi/hssf/record/SheetPropertiesRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * Describes a chart sheet properties record. @@ -30,16 +29,16 @@ import org.apache.poi.util.*; * @author Glen Stampoultzis (glens at apache.org) */ -public class SheetPropertiesRecord - extends Record -{ - public final static short sid = 0x1044; +public final class SheetPropertiesRecord extends Record { + public final static short sid = 0x1044; + + private static final BitField chartTypeManuallyFormatted = BitFieldFactory.getInstance(0x01); + private static final BitField plotVisibleOnly = BitFieldFactory.getInstance(0x02); + private static final BitField doNotSizeWithWindow = BitFieldFactory.getInstance(0x04); + private static final BitField defaultPlotDimensions = BitFieldFactory.getInstance(0x08); + private static final BitField autoPlotArea = BitFieldFactory.getInstance(0x10); + private short field_1_flags; - private BitField chartTypeManuallyFormatted = BitFieldFactory.getInstance(0x1); - private BitField plotVisibleOnly = BitFieldFactory.getInstance(0x2); - private BitField doNotSizeWithWindow = BitFieldFactory.getInstance(0x4); - private BitField defaultPlotDimensions = BitFieldFactory.getInstance(0x8); - private BitField autoPlotArea = BitFieldFactory.getInstance(0x10); private byte field_2_empty; public final static byte EMPTY_NOT_PLOTTED = 0; public final static byte EMPTY_ZERO = 1; @@ -274,10 +273,4 @@ public class SheetPropertiesRecord { return autoPlotArea.isSet(field_1_flags); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/StyleRecord.java b/src/java/org/apache/poi/hssf/record/StyleRecord.java index 65ca23cf34..6990a5efdc 100644 --- a/src/java/org/apache/poi/hssf/record/StyleRecord.java +++ b/src/java/org/apache/poi/hssf/record/StyleRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,14 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; -import org.apache.poi.util.LittleEndian; -import org.apache.poi.util.StringUtil; import org.apache.poi.util.BitField; import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.LittleEndian; +import org.apache.poi.util.StringUtil; /** * Title: Style Record

@@ -32,11 +30,11 @@ import org.apache.poi.util.BitFieldFactory; * @author aviks : string fixes for UserDefined Style * @version 2.0-pre */ +public final class StyleRecord extends Record { + public final static short sid = 0x0293; + + private static final BitField fHighByte = BitFieldFactory.getInstance(0x01); -public class StyleRecord - extends Record -{ - public final static short sid = 0x293; public final static short STYLE_USER_DEFINED = 0; public final static short STYLE_BUILT_IN = 1; @@ -50,7 +48,6 @@ public class StyleRecord // only for user defined styles private short field_2_name_length; //OO doc says 16 bit length, so we believe private byte field_3_string_options; - private BitField fHighByte; private String field_4_name; public StyleRecord() @@ -77,8 +74,6 @@ public class StyleRecord protected void fillFields(RecordInputStream in) { - fHighByte = BitFieldFactory.getInstance(0x01); //have to init here, since we are being called - //from super, and class level init hasnt been done. field_1_xf_index = in.readShort(); if (getType() == STYLE_BUILT_IN) { diff --git a/src/java/org/apache/poi/hssf/record/TableRecord.java b/src/java/org/apache/poi/hssf/record/TableRecord.java index 7a48e5e0e7..237b2cb40e 100644 --- a/src/java/org/apache/poi/hssf/record/TableRecord.java +++ b/src/java/org/apache/poi/hssf/record/TableRecord.java @@ -14,8 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - +package org.apache.poi.hssf.record; + +import org.apache.poi.hssf.record.formula.TblPtg; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.LittleEndian; /** * TableRecord - The record specifies a data table. * This record is preceded by a single Formula record that @@ -24,15 +29,18 @@ * * See p536 of the June 08 binary docs */ -package org.apache.poi.hssf.record; - -import org.apache.poi.hssf.record.formula.TblPtg; -import org.apache.poi.util.BitField; -import org.apache.poi.util.BitFieldFactory; -import org.apache.poi.util.LittleEndian; - -public class TableRecord extends Record { +public final class TableRecord extends Record { public static final short sid = 566; + + private static final BitField alwaysCalc = BitFieldFactory.getInstance(0x0001); + private static final BitField reserved1 = BitFieldFactory.getInstance(0x0002); + private static final BitField rowOrColInpCell = BitFieldFactory.getInstance(0x0004); + private static final BitField oneOrTwoVar = BitFieldFactory.getInstance(0x0008); + private static final BitField rowDeleted = BitFieldFactory.getInstance(0x0010); + private static final BitField colDeleted = BitFieldFactory.getInstance(0x0020); + private static final BitField reserved2 = BitFieldFactory.getInstance(0x0040); + private static final BitField reserved3 = BitFieldFactory.getInstance(0x0080); + private short field_1_ref_rowFirst; private short field_2_ref_rowLast; private short field_3_ref_colFirst; @@ -45,14 +53,6 @@ public class TableRecord extends Record { private short field_9_rowInputCol; private short field_10_colInputCol; - private BitField alwaysCalc = BitFieldFactory.getInstance(0x0001); - private BitField reserved1 = BitFieldFactory.getInstance(0x0002); - private BitField rowOrColInpCell = BitFieldFactory.getInstance(0x0004); - private BitField oneOrTwoVar = BitFieldFactory.getInstance(0x0008); - private BitField rowDeleted = BitFieldFactory.getInstance(0x0010); - private BitField colDeleted = BitFieldFactory.getInstance(0x0020); - private BitField reserved2 = BitFieldFactory.getInstance(0x0040); - private BitField reserved3 = BitFieldFactory.getInstance(0x0080); protected void fillFields(RecordInputStream in) { field_1_ref_rowFirst = in.readShort(); diff --git a/src/java/org/apache/poi/hssf/record/TextObjectBaseRecord.java b/src/java/org/apache/poi/hssf/record/TextObjectBaseRecord.java index 4d3dbb43b1..2d649247b5 100644 --- a/src/java/org/apache/poi/hssf/record/TextObjectBaseRecord.java +++ b/src/java/org/apache/poi/hssf/record/TextObjectBaseRecord.java @@ -32,25 +32,25 @@ import org.apache.poi.util.*; * @author Glen Stampoultzis (glens at apache.org) */ -public class TextObjectBaseRecord - extends Record -{ +public class TextObjectBaseRecord extends Record { public final static short sid = 0x1B6; + + private static final BitField reserved1 = BitFieldFactory.getInstance(0x0001); + private static final BitField HorizontalTextAlignment = BitFieldFactory.getInstance(0x000E); + private static final BitField VerticalTextAlignment = BitFieldFactory.getInstance(0x0070); + private static final BitField reserved2 = BitFieldFactory.getInstance(0x0180); + private static final BitField textLocked = BitFieldFactory.getInstance(0x0200); + private static final BitField reserved3 = BitFieldFactory.getInstance(0xFC00); + private short field_1_options; - private BitField reserved1 = BitFieldFactory.getInstance(0x1); - private BitField HorizontalTextAlignment = BitFieldFactory.getInstance(0x000E); public final static short HORIZONTAL_TEXT_ALIGNMENT_LEFT_ALIGNED = 1; public final static short HORIZONTAL_TEXT_ALIGNMENT_CENTERED = 2; public final static short HORIZONTAL_TEXT_ALIGNMENT_RIGHT_ALIGNED = 3; public final static short HORIZONTAL_TEXT_ALIGNMENT_JUSTIFIED = 4; - private BitField VerticalTextAlignment = BitFieldFactory.getInstance(0x0070); public final static short VERTICAL_TEXT_ALIGNMENT_TOP = 1; public final static short VERTICAL_TEXT_ALIGNMENT_CENTER = 2; public final static short VERTICAL_TEXT_ALIGNMENT_BOTTOM = 3; public final static short VERTICAL_TEXT_ALIGNMENT_JUSTIFY = 4; - private BitField reserved2 = BitFieldFactory.getInstance(0x0180); - private BitField textLocked = BitFieldFactory.getInstance(0x200); - private BitField reserved3 = BitFieldFactory.getInstance(0xFC00); private short field_2_textOrientation; public final static short TEXT_ORIENTATION_NONE = 0; public final static short TEXT_ORIENTATION_TOP_TO_BOTTOM = 1; @@ -452,10 +452,4 @@ public class TextObjectBaseRecord { return reserved3.getShortValue(field_1_options); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/TextRecord.java b/src/java/org/apache/poi/hssf/record/TextRecord.java index 702dfbe163..0840fe1932 100644 --- a/src/java/org/apache/poi/hssf/record/TextRecord.java +++ b/src/java/org/apache/poi/hssf/record/TextRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * The text record is used to define text stored on a chart. @@ -30,10 +29,26 @@ import org.apache.poi.util.*; * @author Glen Stampoultzis (glens at apache.org) */ -public class TextRecord - extends Record -{ +public final class TextRecord extends Record { public final static short sid = 0x1025; + + private static final BitField dataLabelPlacement = BitFieldFactory.getInstance(0x000F); + private static final BitField autoColor = BitFieldFactory.getInstance(0x0001); + private static final BitField showKey = BitFieldFactory.getInstance(0x0002); + private static final BitField showValue = BitFieldFactory.getInstance(0x0004); + private static final BitField vertical = BitFieldFactory.getInstance(0x0008); + private static final BitField autoGeneratedText = BitFieldFactory.getInstance(0x0010); + private static final BitField generated = BitFieldFactory.getInstance(0x0020); + private static final BitField autoLabelDeleted = BitFieldFactory.getInstance(0x0040); + private static final BitField autoBackground = BitFieldFactory.getInstance(0x0080); + private static final BitField rotation = BitFieldFactory.getInstance(0x0700); + + private static final BitField showCategoryLabelAsPercentage = BitFieldFactory.getInstance(0x0800); + private static final BitField showValueAsPercentage = BitFieldFactory.getInstance(0x1000); + private static final BitField showBubbleSizes = BitFieldFactory.getInstance(0x2000); + private static final BitField showLabel = BitFieldFactory.getInstance(0x4000); + + private byte field_1_horizontalAlignment; public final static byte HORIZONTAL_ALIGNMENT_LEFT = 1; public final static byte HORIZONTAL_ALIGNMENT_CENTER = 2; @@ -53,26 +68,12 @@ public class TextRecord private int field_7_width; private int field_8_height; private short field_9_options1; - private BitField autoColor = BitFieldFactory.getInstance(0x1); - private BitField showKey = BitFieldFactory.getInstance(0x2); - private BitField showValue = BitFieldFactory.getInstance(0x4); - private BitField vertical = BitFieldFactory.getInstance(0x8); - private BitField autoGeneratedText = BitFieldFactory.getInstance(0x10); - private BitField generated = BitFieldFactory.getInstance(0x20); - private BitField autoLabelDeleted = BitFieldFactory.getInstance(0x40); - private BitField autoBackground = BitFieldFactory.getInstance(0x80); - private BitField rotation = BitFieldFactory.getInstance(0x0700); public final static short ROTATION_NONE = 0; public final static short ROTATION_TOP_TO_BOTTOM = 1; public final static short ROTATION_ROTATED_90_DEGREES = 2; public final static short ROTATION_ROTATED_90_DEGREES_CLOCKWISE = 3; - private BitField showCategoryLabelAsPercentage = BitFieldFactory.getInstance(0x800); - private BitField showValueAsPercentage = BitFieldFactory.getInstance(0x1000); - private BitField showBubbleSizes = BitFieldFactory.getInstance(0x2000); - private BitField showLabel = BitFieldFactory.getInstance(0x4000); private short field_10_indexOfColorValue; private short field_11_options2; - private BitField dataLabelPlacement = BitFieldFactory.getInstance(0x000F); public final static short DATA_LABEL_PLACEMENT_CHART_DEPENDENT = 0; public final static short DATA_LABEL_PLACEMENT_OUTSIDE = 1; public final static short DATA_LABEL_PLACEMENT_INSIDE = 2; @@ -740,10 +741,4 @@ public class TextRecord { return dataLabelPlacement.getShortValue(field_11_options2); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/TickRecord.java b/src/java/org/apache/poi/hssf/record/TickRecord.java index 325dffc40c..1b950e3ed4 100644 --- a/src/java/org/apache/poi/hssf/record/TickRecord.java +++ b/src/java/org/apache/poi/hssf/record/TickRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * The Tick record defines how tick marks and label positioning/formatting @@ -30,10 +29,14 @@ import org.apache.poi.util.*; * @author Andrew C. Oliver(acoliver at apache.org) */ -public class TickRecord - extends Record -{ - public final static short sid = 0x101e; +public final class TickRecord extends Record { + public final static short sid = 0x101E; + + private static final BitField autoTextColor = BitFieldFactory.getInstance(0x1); + private static final BitField autoTextBackground = BitFieldFactory.getInstance(0x2); + private static final BitField rotation = BitFieldFactory.getInstance(0x1c); + private static final BitField autorotate = BitFieldFactory.getInstance(0x20); + private byte field_1_majorTickType; private byte field_2_minorTickType; private byte field_3_labelPosition; @@ -44,10 +47,6 @@ public class TickRecord private int field_8_zero3; private int field_9_zero4; private short field_10_options; - private BitField autoTextColor = BitFieldFactory.getInstance(0x1); - private BitField autoTextBackground = BitFieldFactory.getInstance(0x2); - private BitField rotation = BitFieldFactory.getInstance(0x1c); - private BitField autorotate = BitFieldFactory.getInstance(0x20); private short field_11_tickColor; private short field_12_zero5; @@ -442,10 +441,4 @@ public class TickRecord { return autorotate.isSet(field_10_options); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/ValueRangeRecord.java b/src/java/org/apache/poi/hssf/record/ValueRangeRecord.java index 44b26659e4..6c94c5c54c 100644 --- a/src/java/org/apache/poi/hssf/record/ValueRangeRecord.java +++ b/src/java/org/apache/poi/hssf/record/ValueRangeRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; - - -import org.apache.poi.util.*; +import org.apache.poi.util.BitField; +import org.apache.poi.util.BitFieldFactory; +import org.apache.poi.util.HexDump; +import org.apache.poi.util.LittleEndian; /** * The value range record defines the range of the value axis. @@ -30,25 +29,25 @@ import org.apache.poi.util.*; * @author Glen Stampoultzis (glens at apache.org) */ -public class ValueRangeRecord - extends Record -{ - public final static short sid = 0x101f; +public final class ValueRangeRecord extends Record { + public final static short sid = 0x101f; + + private static final BitField automaticMinimum = BitFieldFactory.getInstance(0x0001); + private static final BitField automaticMaximum = BitFieldFactory.getInstance(0x0002); + private static final BitField automaticMajor = BitFieldFactory.getInstance(0x0004); + private static final BitField automaticMinor = BitFieldFactory.getInstance(0x0008); + private static final BitField automaticCategoryCrossing = BitFieldFactory.getInstance(0x0010); + private static final BitField logarithmicScale = BitFieldFactory.getInstance(0x0020); + private static final BitField valuesInReverse = BitFieldFactory.getInstance(0x0040); + private static final BitField crossCategoryAxisAtMaximum = BitFieldFactory.getInstance(0x0080); + private static final BitField reserved = BitFieldFactory.getInstance(0x0100); + private double field_1_minimumAxisValue; private double field_2_maximumAxisValue; private double field_3_majorIncrement; private double field_4_minorIncrement; private double field_5_categoryAxisCross; private short field_6_options; - private BitField automaticMinimum = BitFieldFactory.getInstance(0x1); - private BitField automaticMaximum = BitFieldFactory.getInstance(0x2); - private BitField automaticMajor = BitFieldFactory.getInstance(0x4); - private BitField automaticMinor = BitFieldFactory.getInstance(0x8); - private BitField automaticCategoryCrossing = BitFieldFactory.getInstance(0x10); - private BitField logarithmicScale = BitFieldFactory.getInstance(0x20); - private BitField valuesInReverse = BitFieldFactory.getInstance(0x40); - private BitField crossCategoryAxisAtMaximum = BitFieldFactory.getInstance(0x80); - private BitField reserved = BitFieldFactory.getInstance(0x100); public ValueRangeRecord() @@ -432,10 +431,4 @@ public class ValueRangeRecord { return reserved.isSet(field_6_options); } - - -} // END OF CLASS - - - - +} diff --git a/src/java/org/apache/poi/hssf/record/WindowTwoRecord.java b/src/java/org/apache/poi/hssf/record/WindowTwoRecord.java index e2bb6d5609..6e60ef41a6 100644 --- a/src/java/org/apache/poi/hssf/record/WindowTwoRecord.java +++ b/src/java/org/apache/poi/hssf/record/WindowTwoRecord.java @@ -1,4 +1,3 @@ - /* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with @@ -15,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ - package org.apache.poi.hssf.record; @@ -31,34 +29,27 @@ import org.apache.poi.util.LittleEndian; * @author Jason Height (jheight at chariot dot net dot au) * @version 2.0-pre */ - -public class WindowTwoRecord - extends Record -{ - public final static short sid = 0x23e; - private short field_1_options; +public final class WindowTwoRecord extends Record { + public final static short sid = 0x023E; // bitfields - private BitField displayFormulas = BitFieldFactory.getInstance(0x01); - private BitField displayGridlines = BitFieldFactory.getInstance(0x02); - private BitField displayRowColHeadings = BitFieldFactory.getInstance(0x04); - private BitField freezePanes = BitFieldFactory.getInstance(0x08); - private BitField displayZeros = BitFieldFactory.getInstance(0x10); - private BitField defaultHeader = - BitFieldFactory.getInstance(0x20); // if false use color in field 4 - - // if true use default foreground - // for headers - private BitField arabic = - BitFieldFactory.getInstance(0x40); // for our desert dwelling friends - private BitField displayGuts = BitFieldFactory.getInstance(0x80); - private BitField freezePanesNoSplit = BitFieldFactory.getInstance(0x100); - private BitField selected = BitFieldFactory.getInstance(0x200); - private BitField active = BitFieldFactory.getInstance(0x400); - private BitField savedInPageBreakPreview = BitFieldFactory.getInstance(0x800); - + private static final BitField displayFormulas = BitFieldFactory.getInstance(0x01); + private static final BitField displayGridlines = BitFieldFactory.getInstance(0x02); + private static final BitField displayRowColHeadings = BitFieldFactory.getInstance(0x04); + private static final BitField freezePanes = BitFieldFactory.getInstance(0x08); + private static final BitField displayZeros = BitFieldFactory.getInstance(0x10); + /** if false use color in field 4 if true use default foreground for headers */ + private static final BitField defaultHeader = BitFieldFactory.getInstance(0x20); + private static final BitField arabic = BitFieldFactory.getInstance(0x040); + private static final BitField displayGuts = BitFieldFactory.getInstance(0x080); + private static final BitField freezePanesNoSplit = BitFieldFactory.getInstance(0x100); + private static final BitField selected = BitFieldFactory.getInstance(0x200); + private static final BitField active = BitFieldFactory.getInstance(0x400); + private static final BitField savedInPageBreakPreview = BitFieldFactory.getInstance(0x800); // 4-7 reserved // end bitfields + + private short field_1_options; private short field_2_top_row; private short field_3_left_col; private int field_4_header_color; diff --git a/src/java/org/apache/poi/hssf/record/formula/Area3DPtg.java b/src/java/org/apache/poi/hssf/record/formula/Area3DPtg.java index dded3cd393..1ccebd0a72 100644 --- a/src/java/org/apache/poi/hssf/record/formula/Area3DPtg.java +++ b/src/java/org/apache/poi/hssf/record/formula/Area3DPtg.java @@ -25,7 +25,6 @@ import org.apache.poi.util.BitField; import org.apache.poi.util.BitFieldFactory; import org.apache.poi.util.LittleEndian; - /** * Title: Area 3D Ptg - 3D reference (Sheet + Area)

* Description: Defined a area in Extern Sheet.

@@ -38,14 +37,16 @@ import org.apache.poi.util.LittleEndian; public final class Area3DPtg extends OperandPtg implements AreaI { public final static byte sid = 0x3b; private final static int SIZE = 11; // 10 + 1 for Ptg + + private static final BitField rowRelative = BitFieldFactory.getInstance(0x8000); + private static final BitField colRelative = BitFieldFactory.getInstance(0x4000); + private short field_1_index_extern_sheet; private int field_2_first_row; private int field_3_last_row; private int field_4_first_column; private int field_5_last_column; - private BitField rowRelative = BitFieldFactory.getInstance( 0x8000 ); - private BitField colRelative = BitFieldFactory.getInstance( 0x4000 ); /** Creates new AreaPtg */ public Area3DPtg() diff --git a/src/java/org/apache/poi/hssf/record/formula/Ref3DPtg.java b/src/java/org/apache/poi/hssf/record/formula/Ref3DPtg.java index 8e21e1e977..69c7f18306 100644 --- a/src/java/org/apache/poi/hssf/record/formula/Ref3DPtg.java +++ b/src/java/org/apache/poi/hssf/record/formula/Ref3DPtg.java @@ -36,6 +36,10 @@ import org.apache.poi.util.LittleEndian; */ public final class Ref3DPtg extends OperandPtg { public final static byte sid = 0x3a; + + private static final BitField rowRelative = BitFieldFactory.getInstance(0x8000); + private static final BitField colRelative = BitFieldFactory.getInstance(0x4000); + private final static int SIZE = 7; // 6 + 1 for Ptg private short field_1_index_extern_sheet; /** The row index - zero based unsigned 16 bit value */ @@ -46,8 +50,6 @@ public final class Ref3DPtg extends OperandPtg { * - bit 15 - isColumnRelative */ private int field_3_column; - private BitField rowRelative = BitFieldFactory.getInstance(0x8000); - private BitField colRelative = BitFieldFactory.getInstance(0x4000); /** Creates new AreaPtg */ public Ref3DPtg() {} -- 2.39.5