zhao
2021-07-02 081df17b8cc4a6e7e4f4e1e1887f24810e3ec2f9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
 
/* ====================================================================
   Licensed to the Apache Software Foundation (ASF) Under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for Additional information regarding copyright ownership.
   The ASF licenses this file to You Under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
 
       http://www.apache.org/licenses/LICENSE-2.0
 
   Unless required by applicable law or agreed to in writing, software
   distributed Under the License is distributed on an "AS Is" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations Under the License.
==================================================================== */
 
 
namespace HH.WMS.Utils.NPOI.HSSF.Record.Chart
{
 
    using System;
    using System.Text;
    using System.Collections;
    using HH.WMS.Utils.NPOI.Util;
 
 
    /**
     * Defines a legend for a chart.
     * NOTE: This source is automatically generated please do not modify this file.  Either subclass or
     *       Remove the record in src/records/definitions.
 
     * @author Andrew C. Oliver (acoliver at apache.org)
     */
    public class LegendRecord
       : StandardRecord
    {
        public const short sid = 0x1015;
        private int field_1_xAxisUpperLeft;
        private int field_2_yAxisUpperLeft;
        private int field_3_xSize;
        private int field_4_ySize;
        private byte field_5_type;
        public static byte TYPE_BOTTOM = 0;
        public static byte TYPE_CORNER = 1;
        public static byte TYPE_TOP = 2;
        public static byte TYPE_RIGHT = 3;
        public static byte TYPE_LEFT = 4;
        public static byte TYPE_UNDOCKED = 7;
        private byte field_6_spacing;
        public static byte SPACING_CLOSE = 0;
        public static byte SPACING_MEDIUM = 1;
        public 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()
        {
 
        }
 
        /**
         * Constructs a Legend record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */
 
        public LegendRecord(RecordInputStream in1)
        {
            field_1_xAxisUpperLeft = in1.ReadInt();
            field_2_yAxisUpperLeft = in1.ReadInt();
            field_3_xSize = in1.ReadInt();
            field_4_ySize = in1.ReadInt();
            field_5_type = (byte)in1.ReadByte();
            field_6_spacing = (byte)in1.ReadByte();
            field_7_options = in1.ReadShort();
 
        }
 
        public override String ToString()
        {
            StringBuilder buffer = new StringBuilder();
 
            buffer.Append("[LEGEND]\n");
            buffer.Append("    .xAxisUpperLeft       = ")
                .Append("0x").Append(HexDump.ToHex(XAxisUpperLeft))
                .Append(" (").Append(XAxisUpperLeft).Append(" )");
            buffer.Append(Environment.NewLine);
            buffer.Append("    .yAxisUpperLeft       = ")
                .Append("0x").Append(HexDump.ToHex(YAxisUpperLeft))
                .Append(" (").Append(YAxisUpperLeft).Append(" )");
            buffer.Append(Environment.NewLine);
            buffer.Append("    .xSize                = ")
                .Append("0x").Append(HexDump.ToHex(XSize))
                .Append(" (").Append(XSize).Append(" )");
            buffer.Append(Environment.NewLine);
            buffer.Append("    .ySize                = ")
                .Append("0x").Append(HexDump.ToHex(YSize))
                .Append(" (").Append(YSize).Append(" )");
            buffer.Append(Environment.NewLine);
            buffer.Append("    .type                 = ")
                .Append("0x").Append(HexDump.ToHex(Type))
                .Append(" (").Append(Type).Append(" )");
            buffer.Append(Environment.NewLine);
            buffer.Append("    .spacing              = ")
                .Append("0x").Append(HexDump.ToHex(Spacing))
                .Append(" (").Append(Spacing).Append(" )");
            buffer.Append(Environment.NewLine);
            buffer.Append("    .options              = ")
                .Append("0x").Append(HexDump.ToHex(Options))
                .Append(" (").Append(Options).Append(" )");
            buffer.Append(Environment.NewLine);
            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 override void Serialize(ILittleEndianOutput out1)
        {
            out1.WriteInt(field_1_xAxisUpperLeft);
            out1.WriteInt(field_2_yAxisUpperLeft);
            out1.WriteInt(field_3_xSize);
            out1.WriteInt(field_4_ySize);
            out1.WriteByte(field_5_type);
            out1.WriteByte(field_6_spacing);
            out1.WriteShort(field_7_options);
        }
 
        /**
         * Size of record (exluding 4 byte header)
         */
        protected override int DataSize
        {
            get { return 4 + 4 + 4 + 4 + 1 + 1 + 2; }
        }
 
        public override short Sid
        {
            get { return sid; }
        }
 
        public override 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;
        }
 
 
 
 
        /**
         * Get the x axis upper left field for the Legend record.
         */
        public int XAxisUpperLeft
        {
            get
            {
                return field_1_xAxisUpperLeft;
            }
            set 
            {
                field_1_xAxisUpperLeft = value;
            }
        }
 
        /**
         * Get the y axis upper left field for the Legend record.
         */
        public int YAxisUpperLeft
        {
            get
            {
                return field_2_yAxisUpperLeft;
            }
            set 
            {
                field_2_yAxisUpperLeft = value;
            }
        }
 
        /**
         * Get the x size field for the Legend record.
         */
        public int XSize
        {
            get { return field_3_xSize; }
            set { this.field_3_xSize = value; }
        }
 
        /**
         * Get the y size field for the Legend record.
         */
        public int YSize
        {
            get { return field_4_ySize; }
            set { this.field_4_ySize = value; }
        }
        /**
         * Get the type field for the Legend record.
         *
         * @return  One of 
         *        TYPE_BOTTOM
         *        TYPE_CORNER
         *        TYPE_TOP
         *        TYPE_RIGHT
         *        TYPE_LEFT
         *        TYPE_UNDOCKED
         */
        public byte Type
        {
            get { return field_5_type; }
            set { this.field_5_type = value; }
        }
 
        /**
         * Get the spacing field for the Legend record.
         *
         * @return  One of 
         *        SPACING_CLOSE
         *        SPACING_MEDIUM
         *        SPACING_OPEN
         */
        public byte Spacing
        {
            get { return field_6_spacing; }
            set { this.field_6_spacing = value; }
        }
 
 
        /**
         * Get the options field for the Legend record.
         */
        public short Options
        {
            get { return field_7_options; }
            set { this.field_7_options = value; }
        }
 
        /**
         * automatic positioning (1=docked)
         * @return  the auto position field value.
         */
        public bool IsAutoPosition
        {
            get { return autoPosition.IsSet(field_7_options); }
            set { field_7_options = autoPosition.SetShortBoolean(field_7_options, value); }
        }
 
        /**
         * excel 5 only (true)
         * @return  the auto series field value.
         */
        public bool IsAutoSeries
        {
            get { return autoSeries.IsSet(field_7_options); }
            set { field_7_options = autoSeries.SetShortBoolean(field_7_options, value); }
        }
 
 
        /**
         * position of legend on the x axis is automatic
         * @return  the auto x positioning field value.
         */
        public bool IsAutoXPositioning
        {
            get{return autoXPositioning.IsSet(field_7_options);}
            set { field_7_options = autoXPositioning.SetShortBoolean(field_7_options, value); }
        }
 
        /**
         * position of legend on the y axis is automatic
         * @return  the auto y positioning field value.
         */
        public bool IsAutoYPositioning
        {
            get{return autoYPositioning.IsSet(field_7_options);}
            set{field_7_options = autoYPositioning.SetShortBoolean(field_7_options, value);}
        }
 
        /**
         * vertical or horizontal legend (1 or 0 respectively).  Always 0 if not automatic.
         * @return  the vertical field value.
         */
        public bool IsVertical
        {
            get { return vertical.IsSet(field_7_options); }
            set { field_7_options = vertical.SetShortBoolean(field_7_options, value); }
        }
 
 
        /**
         * 1 if chart Contains data table
         * @return  the data table field value.
         */
        public bool IsDataTable
        {
            get{return dataTable.IsSet(field_7_options);}
            set { field_7_options = dataTable.SetShortBoolean(field_7_options, value); }
        }
 
 
    }
}