Source Code Cross Referenced for EPRowInfo.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » components » elementprocessor » impl » poi » hssf » elements » 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 » Content Management System » apache lenya 2.0 » org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements 
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.cocoon.components.elementprocessor.impl.poi.hssf.elements;
019:
020:        import org.apache.cocoon.components.elementprocessor.types.Attribute;
021:        import org.apache.cocoon.components.elementprocessor.types.BooleanConverter;
022:        import org.apache.cocoon.components.elementprocessor.types.BooleanResult;
023:        import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
024:        import org.apache.cocoon.components.elementprocessor.types.NumericResult;
025:        import org.apache.cocoon.components.elementprocessor.types.Validator;
026:
027:        import java.io.IOException;
028:
029:        /**
030:         * No-op implementation of ElementProcessor to handle the "RowInfo"
031:         * tag
032:         *
033:         * This element has several attributes and has no content
034:         *
035:         * @author Marc Johnson (marc_johnson27591@hotmail.com)
036:         * @version CVS $Id: EPRowInfo.java 433543 2006-08-22 06:22:54Z crossley $
037:         */
038:        public class EPRowInfo extends BaseElementProcessor {
039:
040:            // row number
041:            private NumericResult _no;
042:
043:            // size, in points
044:            private NumericResult _unit;
045:
046:            // left margin, in points
047:            private NumericResult _margin_a;
048:
049:            // right margin, in points
050:            private NumericResult _margin_b;
051:
052:            // true if size is explicitly set
053:            private BooleanResult _hard_size;
054:
055:            // true if row is hidden
056:            private BooleanResult _hidden;
057:
058:            // true if row is collapsed
059:            private BooleanResult _collapsed;
060:
061:            // outline level
062:            private NumericResult _outline_level;
063:
064:            // rle count
065:            private NumericResult _count;
066:            private static final String _no_attribute = "No";
067:            private static final String _unit_attribute = "Unit";
068:            private static final String _margin_a_attribute = "MarginA";
069:            private static final String _margin_b_attribute = "MarginB";
070:            private static final String _hard_size_attribute = "HardSize";
071:            private static final String _hidden_attribute = "Hidden";
072:            private static final String _collapsed_attribute = "Collapsed";
073:            private static final String _outline_level_attribute = "OutlineLevel";
074:            private static final String _count_attribute = "Count";
075:            private static final Validator _margin_validator = new Validator() {
076:                public IOException validate(final Number number) {
077:                    int val = number.intValue();
078:
079:                    return (val >= 0 && val <= 7) ? null : new IOException("\""
080:                            + number + "\" is not a legal value");
081:                }
082:            };
083:            private static final Attribute[] _implied_attributes = {
084:                    new Attribute(_hard_size_attribute, "0"),
085:                    new Attribute(_hidden_attribute, "0"),
086:                    new Attribute(_collapsed_attribute, "0"),
087:                    new Attribute(_outline_level_attribute, "0"),
088:                    new Attribute(_count_attribute, "1") };
089:
090:            /**
091:             * constructor
092:             */
093:            public EPRowInfo() {
094:                super (_implied_attributes);
095:                _no = null;
096:                _unit = null;
097:                _margin_a = null;
098:                _margin_b = null;
099:                _hard_size = null;
100:                _hidden = null;
101:                _collapsed = null;
102:                _outline_level = null;
103:                _count = null;
104:            }
105:
106:            /**
107:             * @return row number
108:             * @exception IOException
109:             */
110:            public int getRowNo() throws IOException {
111:                if (_no == null) {
112:                    _no = NumericConverter
113:                            .extractNonNegativeInteger(getValue(_no_attribute));
114:                }
115:                return _no.intValue();
116:            }
117:
118:            /**
119:             * @return row size in points
120:             * @exception IOException
121:             */
122:            public double getPoints() throws IOException {
123:                if (_unit == null) {
124:                    _unit = NumericConverter
125:                            .extractDouble(getValue(_unit_attribute));
126:                }
127:                return _unit.doubleValue();
128:            }
129:
130:            /**
131:             * @return left margin
132:             * @exception IOException
133:             */
134:            public int getLeftMargin() throws IOException {
135:                if (_margin_a == null) {
136:                    _margin_a = NumericConverter.extractInteger(
137:                            getValue(_margin_a_attribute), _margin_validator);
138:                }
139:                return _margin_a.intValue();
140:            }
141:
142:            /**
143:             * @return right margin
144:             * @exception IOException
145:             */
146:            public int getRightMargin() throws IOException {
147:                if (_margin_b == null) {
148:                    _margin_b = NumericConverter.extractInteger(
149:                            getValue(_margin_b_attribute), _margin_validator);
150:                }
151:                return _margin_b.intValue();
152:            }
153:
154:            /**
155:             * @return hard size
156:             * @exception IOException
157:             */
158:            public boolean getHardSize() throws IOException {
159:                if (_hard_size == null) {
160:                    _hard_size = BooleanConverter
161:                            .extractBoolean(getValue(_hard_size_attribute));
162:                }
163:                return _hard_size.booleanValue();
164:            }
165:
166:            /**
167:             * @return hidden state
168:             * @exception IOException
169:             */
170:            public boolean getHidden() throws IOException {
171:                if (_hidden == null) {
172:                    _hidden = BooleanConverter
173:                            .extractBoolean(getValue(_hidden_attribute));
174:                }
175:                return _hidden.booleanValue();
176:            }
177:
178:            /**
179:             * @return collapsed state
180:             * @exception IOException
181:             */
182:            public boolean getCollapsed() throws IOException {
183:                if (_collapsed == null) {
184:                    _collapsed = BooleanConverter
185:                            .extractBoolean(getValue(_collapsed_attribute));
186:                }
187:                return _collapsed.booleanValue();
188:            }
189:
190:            /**
191:             * @return outline level
192:             * @exception IOException
193:             */
194:            public int getOutlineLevel() throws IOException {
195:                if (_outline_level == null) {
196:                    _outline_level = NumericConverter
197:                            .extractInteger(getValue(_outline_level_attribute));
198:                }
199:                return _outline_level.intValue();
200:            }
201:
202:            /**
203:             * @return rle count
204:             * @exception IOException
205:             */
206:            public int getRLECount() throws IOException {
207:                if (_count == null) {
208:                    _count = NumericConverter
209:                            .extractInteger(getValue(_count_attribute));
210:                }
211:                return _count.intValue();
212:            }
213:
214:            /**
215:             * Set this row's height
216:             * @exception IOException
217:             */
218:            public void endProcessing() throws IOException {
219:                int row = getRowNo();
220:
221:                if (row > Short.MAX_VALUE) {
222:                    throw new IOException("Illegal row value: " + row);
223:                }
224:                getSheet().getRow(row).setHeight(getPoints());
225:            }
226:        } // end public class EPRowInfo
w_w_w.ja__v___a_2_s__.c_o___m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.