Source Code Cross Referenced for LineFormatRecord.java in  » Collaboration » poi-3.0.2-beta2 » org » apache » poi » hssf » record » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Collaboration » poi 3.0.2 beta2 » org.apache.poi.hssf.record 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* ====================================================================
002:         Licensed to the Apache Software Foundation (ASF) under one or more
003:         contributor license agreements.  See the NOTICE file distributed with
004:         this work for additional information regarding copyright ownership.
005:         The ASF licenses this file to You under the Apache License, Version 2.0
006:         (the "License"); you may not use this file except in compliance with
007:         the License.  You may obtain a copy of the License at
008:
009:         http://www.apache.org/licenses/LICENSE-2.0
010:
011:         Unless required by applicable law or agreed to in writing, software
012:         distributed under the License is distributed on an "AS IS" BASIS,
013:         WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         See the License for the specific language governing permissions and
015:         limitations under the License.
016:         ==================================================================== */
017:
018:        package org.apache.poi.hssf.record;
019:
020:        import org.apache.poi.util.*;
021:
022:        /**
023:         * Describes a line format record.  The line format record controls how a line on a chart appears.
024:         * NOTE: This source is automatically generated please do not modify this file.  Either subclass or
025:         *       remove the record in src/records/definitions.
026:
027:         * @author Glen Stampoultzis (glens at apache.org)
028:         */
029:        public class LineFormatRecord extends Record {
030:            public final static short sid = 0x1007;
031:            private int field_1_lineColor;
032:            private short field_2_linePattern;
033:            public final static short LINE_PATTERN_SOLID = 0;
034:            public final static short LINE_PATTERN_DASH = 1;
035:            public final static short LINE_PATTERN_DOT = 2;
036:            public final static short LINE_PATTERN_DASH_DOT = 3;
037:            public final static short LINE_PATTERN_DASH_DOT_DOT = 4;
038:            public final static short LINE_PATTERN_NONE = 5;
039:            public final static short LINE_PATTERN_DARK_GRAY_PATTERN = 6;
040:            public final static short LINE_PATTERN_MEDIUM_GRAY_PATTERN = 7;
041:            public final static short LINE_PATTERN_LIGHT_GRAY_PATTERN = 8;
042:            private short field_3_weight;
043:            public final static short WEIGHT_HAIRLINE = -1;
044:            public final static short WEIGHT_NARROW = 0;
045:            public final static short WEIGHT_MEDIUM = 1;
046:            public final static short WEIGHT_WIDE = 2;
047:            private short field_4_format;
048:            private BitField auto = BitFieldFactory.getInstance(0x1);
049:            private BitField drawTicks = BitFieldFactory.getInstance(0x4);
050:            private BitField unknown = BitFieldFactory.getInstance(0x4);
051:            private short field_5_colourPaletteIndex;
052:
053:            public LineFormatRecord() {
054:
055:            }
056:
057:            /**
058:             * Constructs a LineFormat record and sets its fields appropriately.
059:             *
060:             * @param in the RecordInputstream to read the record from
061:             */
062:
063:            public LineFormatRecord(RecordInputStream in) {
064:                super (in);
065:
066:            }
067:
068:            /**
069:             * Checks the sid matches the expected side for this record
070:             *
071:             * @param id   the expected sid.
072:             */
073:            protected void validateSid(short id) {
074:                if (id != sid) {
075:                    throw new RecordFormatException("Not a LineFormat record");
076:                }
077:            }
078:
079:            protected void fillFields(RecordInputStream in) {
080:                field_1_lineColor = in.readInt();
081:                field_2_linePattern = in.readShort();
082:                field_3_weight = in.readShort();
083:                field_4_format = in.readShort();
084:                field_5_colourPaletteIndex = in.readShort();
085:
086:            }
087:
088:            public String toString() {
089:                StringBuffer buffer = new StringBuffer();
090:
091:                buffer.append("[LINEFORMAT]\n");
092:                buffer.append("    .lineColor            = ").append("0x")
093:                        .append(HexDump.toHex(getLineColor())).append(" (")
094:                        .append(getLineColor()).append(" )");
095:                buffer.append(System.getProperty("line.separator"));
096:                buffer.append("    .linePattern          = ").append("0x")
097:                        .append(HexDump.toHex(getLinePattern())).append(" (")
098:                        .append(getLinePattern()).append(" )");
099:                buffer.append(System.getProperty("line.separator"));
100:                buffer.append("    .weight               = ").append("0x")
101:                        .append(HexDump.toHex(getWeight())).append(" (")
102:                        .append(getWeight()).append(" )");
103:                buffer.append(System.getProperty("line.separator"));
104:                buffer.append("    .format               = ").append("0x")
105:                        .append(HexDump.toHex(getFormat())).append(" (")
106:                        .append(getFormat()).append(" )");
107:                buffer.append(System.getProperty("line.separator"));
108:                buffer.append("         .auto                     = ").append(
109:                        isAuto()).append('\n');
110:                buffer.append("         .drawTicks                = ").append(
111:                        isDrawTicks()).append('\n');
112:                buffer.append("         .unknown                  = ").append(
113:                        isUnknown()).append('\n');
114:                buffer.append("    .colourPaletteIndex   = ").append("0x")
115:                        .append(HexDump.toHex(getColourPaletteIndex())).append(
116:                                " (").append(getColourPaletteIndex()).append(
117:                                " )");
118:                buffer.append(System.getProperty("line.separator"));
119:
120:                buffer.append("[/LINEFORMAT]\n");
121:                return buffer.toString();
122:            }
123:
124:            public int serialize(int offset, byte[] data) {
125:                int pos = 0;
126:
127:                LittleEndian.putShort(data, 0 + offset, sid);
128:                LittleEndian.putShort(data, 2 + offset,
129:                        (short) (getRecordSize() - 4));
130:
131:                LittleEndian.putInt(data, 4 + offset + pos, field_1_lineColor);
132:                LittleEndian.putShort(data, 8 + offset + pos,
133:                        field_2_linePattern);
134:                LittleEndian.putShort(data, 10 + offset + pos, field_3_weight);
135:                LittleEndian.putShort(data, 12 + offset + pos, field_4_format);
136:                LittleEndian.putShort(data, 14 + offset + pos,
137:                        field_5_colourPaletteIndex);
138:
139:                return getRecordSize();
140:            }
141:
142:            /**
143:             * Size of record (exluding 4 byte header)
144:             */
145:            public int getRecordSize() {
146:                return 4 + 4 + 2 + 2 + 2 + 2;
147:            }
148:
149:            public short getSid() {
150:                return sid;
151:            }
152:
153:            public Object clone() {
154:                LineFormatRecord rec = new LineFormatRecord();
155:
156:                rec.field_1_lineColor = field_1_lineColor;
157:                rec.field_2_linePattern = field_2_linePattern;
158:                rec.field_3_weight = field_3_weight;
159:                rec.field_4_format = field_4_format;
160:                rec.field_5_colourPaletteIndex = field_5_colourPaletteIndex;
161:                return rec;
162:            }
163:
164:            /**
165:             * Get the line color field for the LineFormat record.
166:             */
167:            public int getLineColor() {
168:                return field_1_lineColor;
169:            }
170:
171:            /**
172:             * Set the line color field for the LineFormat record.
173:             */
174:            public void setLineColor(int field_1_lineColor) {
175:                this .field_1_lineColor = field_1_lineColor;
176:            }
177:
178:            /**
179:             * Get the line pattern field for the LineFormat record.
180:             *
181:             * @return  One of 
182:             *        LINE_PATTERN_SOLID
183:             *        LINE_PATTERN_DASH
184:             *        LINE_PATTERN_DOT
185:             *        LINE_PATTERN_DASH_DOT
186:             *        LINE_PATTERN_DASH_DOT_DOT
187:             *        LINE_PATTERN_NONE
188:             *        LINE_PATTERN_DARK_GRAY_PATTERN
189:             *        LINE_PATTERN_MEDIUM_GRAY_PATTERN
190:             *        LINE_PATTERN_LIGHT_GRAY_PATTERN
191:             */
192:            public short getLinePattern() {
193:                return field_2_linePattern;
194:            }
195:
196:            /**
197:             * Set the line pattern field for the LineFormat record.
198:             *
199:             * @param field_2_linePattern
200:             *        One of 
201:             *        LINE_PATTERN_SOLID
202:             *        LINE_PATTERN_DASH
203:             *        LINE_PATTERN_DOT
204:             *        LINE_PATTERN_DASH_DOT
205:             *        LINE_PATTERN_DASH_DOT_DOT
206:             *        LINE_PATTERN_NONE
207:             *        LINE_PATTERN_DARK_GRAY_PATTERN
208:             *        LINE_PATTERN_MEDIUM_GRAY_PATTERN
209:             *        LINE_PATTERN_LIGHT_GRAY_PATTERN
210:             */
211:            public void setLinePattern(short field_2_linePattern) {
212:                this .field_2_linePattern = field_2_linePattern;
213:            }
214:
215:            /**
216:             * Get the weight field for the LineFormat record.
217:             *
218:             * @return  One of 
219:             *        WEIGHT_HAIRLINE
220:             *        WEIGHT_NARROW
221:             *        WEIGHT_MEDIUM
222:             *        WEIGHT_WIDE
223:             */
224:            public short getWeight() {
225:                return field_3_weight;
226:            }
227:
228:            /**
229:             * Set the weight field for the LineFormat record.
230:             *
231:             * @param field_3_weight
232:             *        One of 
233:             *        WEIGHT_HAIRLINE
234:             *        WEIGHT_NARROW
235:             *        WEIGHT_MEDIUM
236:             *        WEIGHT_WIDE
237:             */
238:            public void setWeight(short field_3_weight) {
239:                this .field_3_weight = field_3_weight;
240:            }
241:
242:            /**
243:             * Get the format field for the LineFormat record.
244:             */
245:            public short getFormat() {
246:                return field_4_format;
247:            }
248:
249:            /**
250:             * Set the format field for the LineFormat record.
251:             */
252:            public void setFormat(short field_4_format) {
253:                this .field_4_format = field_4_format;
254:            }
255:
256:            /**
257:             * Get the colour palette index field for the LineFormat record.
258:             */
259:            public short getColourPaletteIndex() {
260:                return field_5_colourPaletteIndex;
261:            }
262:
263:            /**
264:             * Set the colour palette index field for the LineFormat record.
265:             */
266:            public void setColourPaletteIndex(short field_5_colourPaletteIndex) {
267:                this .field_5_colourPaletteIndex = field_5_colourPaletteIndex;
268:            }
269:
270:            /**
271:             * Sets the auto field value.
272:             * automatic format
273:             */
274:            public void setAuto(boolean value) {
275:                field_4_format = auto.setShortBoolean(field_4_format, value);
276:            }
277:
278:            /**
279:             * automatic format
280:             * @return  the auto field value.
281:             */
282:            public boolean isAuto() {
283:                return auto.isSet(field_4_format);
284:            }
285:
286:            /**
287:             * Sets the draw ticks field value.
288:             * draw tick marks
289:             */
290:            public void setDrawTicks(boolean value) {
291:                field_4_format = drawTicks.setShortBoolean(field_4_format,
292:                        value);
293:            }
294:
295:            /**
296:             * draw tick marks
297:             * @return  the draw ticks field value.
298:             */
299:            public boolean isDrawTicks() {
300:                return drawTicks.isSet(field_4_format);
301:            }
302:
303:            /**
304:             * Sets the unknown field value.
305:             * book marks this as reserved = 0 but it seems to do something
306:             */
307:            public void setUnknown(boolean value) {
308:                field_4_format = unknown.setShortBoolean(field_4_format, value);
309:            }
310:
311:            /**
312:             * book marks this as reserved = 0 but it seems to do something
313:             * @return  the unknown field value.
314:             */
315:            public boolean isUnknown() {
316:                return unknown.isSet(field_4_format);
317:            }
318:
319:        } // END OF CLASS
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.