Source Code Cross Referenced for BarRecord.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:         * The bar record is used to define a bar chart.
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 BarRecord extends Record {
030:            public final static short sid = 0x1017;
031:            private short field_1_barSpace;
032:            private short field_2_categorySpace;
033:            private short field_3_formatFlags;
034:            private BitField horizontal = BitFieldFactory.getInstance(0x1);
035:            private BitField stacked = BitFieldFactory.getInstance(0x2);
036:            private BitField displayAsPercentage = BitFieldFactory
037:                    .getInstance(0x4);
038:            private BitField shadow = BitFieldFactory.getInstance(0x8);
039:
040:            public BarRecord() {
041:
042:            }
043:
044:            /**
045:             * Constructs a Bar record and sets its fields appropriately.
046:             *
047:             * @param in the RecordInputstream to read the record from
048:             */
049:
050:            public BarRecord(RecordInputStream in) {
051:                super (in);
052:
053:            }
054:
055:            /**
056:             * Checks the sid matches the expected side for this record
057:             *
058:             * @param id   the expected sid.
059:             */
060:            protected void validateSid(short id) {
061:                if (id != sid) {
062:                    throw new RecordFormatException("Not a Bar record");
063:                }
064:            }
065:
066:            protected void fillFields(RecordInputStream in) {
067:                field_1_barSpace = in.readShort();
068:                field_2_categorySpace = in.readShort();
069:                field_3_formatFlags = in.readShort();
070:            }
071:
072:            public String toString() {
073:                StringBuffer buffer = new StringBuffer();
074:
075:                buffer.append("[BAR]\n");
076:                buffer.append("    .barSpace             = ").append("0x")
077:                        .append(HexDump.toHex(getBarSpace())).append(" (")
078:                        .append(getBarSpace()).append(" )");
079:                buffer.append(System.getProperty("line.separator"));
080:                buffer.append("    .categorySpace        = ").append("0x")
081:                        .append(HexDump.toHex(getCategorySpace())).append(" (")
082:                        .append(getCategorySpace()).append(" )");
083:                buffer.append(System.getProperty("line.separator"));
084:                buffer.append("    .formatFlags          = ").append("0x")
085:                        .append(HexDump.toHex(getFormatFlags())).append(" (")
086:                        .append(getFormatFlags()).append(" )");
087:                buffer.append(System.getProperty("line.separator"));
088:                buffer.append("         .horizontal               = ").append(
089:                        isHorizontal()).append('\n');
090:                buffer.append("         .stacked                  = ").append(
091:                        isStacked()).append('\n');
092:                buffer.append("         .displayAsPercentage      = ").append(
093:                        isDisplayAsPercentage()).append('\n');
094:                buffer.append("         .shadow                   = ").append(
095:                        isShadow()).append('\n');
096:
097:                buffer.append("[/BAR]\n");
098:                return buffer.toString();
099:            }
100:
101:            public int serialize(int offset, byte[] data) {
102:                int pos = 0;
103:
104:                LittleEndian.putShort(data, 0 + offset, sid);
105:                LittleEndian.putShort(data, 2 + offset,
106:                        (short) (getRecordSize() - 4));
107:
108:                LittleEndian.putShort(data, 4 + offset + pos, field_1_barSpace);
109:                LittleEndian.putShort(data, 6 + offset + pos,
110:                        field_2_categorySpace);
111:                LittleEndian.putShort(data, 8 + offset + pos,
112:                        field_3_formatFlags);
113:
114:                return getRecordSize();
115:            }
116:
117:            /**
118:             * Size of record (exluding 4 byte header)
119:             */
120:            public int getRecordSize() {
121:                return 4 + 2 + 2 + 2;
122:            }
123:
124:            public short getSid() {
125:                return sid;
126:            }
127:
128:            public Object clone() {
129:                BarRecord rec = new BarRecord();
130:
131:                rec.field_1_barSpace = field_1_barSpace;
132:                rec.field_2_categorySpace = field_2_categorySpace;
133:                rec.field_3_formatFlags = field_3_formatFlags;
134:                return rec;
135:            }
136:
137:            /**
138:             * Get the bar space field for the Bar record.
139:             */
140:            public short getBarSpace() {
141:                return field_1_barSpace;
142:            }
143:
144:            /**
145:             * Set the bar space field for the Bar record.
146:             */
147:            public void setBarSpace(short field_1_barSpace) {
148:                this .field_1_barSpace = field_1_barSpace;
149:            }
150:
151:            /**
152:             * Get the category space field for the Bar record.
153:             */
154:            public short getCategorySpace() {
155:                return field_2_categorySpace;
156:            }
157:
158:            /**
159:             * Set the category space field for the Bar record.
160:             */
161:            public void setCategorySpace(short field_2_categorySpace) {
162:                this .field_2_categorySpace = field_2_categorySpace;
163:            }
164:
165:            /**
166:             * Get the format flags field for the Bar record.
167:             */
168:            public short getFormatFlags() {
169:                return field_3_formatFlags;
170:            }
171:
172:            /**
173:             * Set the format flags field for the Bar record.
174:             */
175:            public void setFormatFlags(short field_3_formatFlags) {
176:                this .field_3_formatFlags = field_3_formatFlags;
177:            }
178:
179:            /**
180:             * Sets the horizontal field value.
181:             * true to display horizontal bar charts, false for vertical
182:             */
183:            public void setHorizontal(boolean value) {
184:                field_3_formatFlags = horizontal.setShortBoolean(
185:                        field_3_formatFlags, value);
186:            }
187:
188:            /**
189:             * true to display horizontal bar charts, false for vertical
190:             * @return  the horizontal field value.
191:             */
192:            public boolean isHorizontal() {
193:                return horizontal.isSet(field_3_formatFlags);
194:            }
195:
196:            /**
197:             * Sets the stacked field value.
198:             * stack displayed values
199:             */
200:            public void setStacked(boolean value) {
201:                field_3_formatFlags = stacked.setShortBoolean(
202:                        field_3_formatFlags, value);
203:            }
204:
205:            /**
206:             * stack displayed values
207:             * @return  the stacked field value.
208:             */
209:            public boolean isStacked() {
210:                return stacked.isSet(field_3_formatFlags);
211:            }
212:
213:            /**
214:             * Sets the display as percentage field value.
215:             * display chart values as a percentage
216:             */
217:            public void setDisplayAsPercentage(boolean value) {
218:                field_3_formatFlags = displayAsPercentage.setShortBoolean(
219:                        field_3_formatFlags, value);
220:            }
221:
222:            /**
223:             * display chart values as a percentage
224:             * @return  the display as percentage field value.
225:             */
226:            public boolean isDisplayAsPercentage() {
227:                return displayAsPercentage.isSet(field_3_formatFlags);
228:            }
229:
230:            /**
231:             * Sets the shadow field value.
232:             * display a shadow for the chart
233:             */
234:            public void setShadow(boolean value) {
235:                field_3_formatFlags = shadow.setShortBoolean(
236:                        field_3_formatFlags, value);
237:            }
238:
239:            /**
240:             * display a shadow for the chart
241:             * @return  the shadow field value.
242:             */
243:            public boolean isShadow() {
244:                return shadow.isSet(field_3_formatFlags);
245:            }
246:
247:        } // 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.