Source Code Cross Referenced for HSSFPatriarch.java in  » Collaboration » poi-3.0.2-beta2 » org » apache » poi » hssf » usermodel » 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.usermodel 
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.usermodel;
019:
020:        import java.util.ArrayList;
021:        import java.util.Iterator;
022:        import java.util.List;
023:
024:        /**
025:         * The patriarch is the toplevel container for shapes in a sheet.  It does
026:         * little other than act as a container for other shapes and groups.
027:         *
028:         * @author Glen Stampoultzis (glens at apache.org)
029:         */
030:        public class HSSFPatriarch implements  HSSFShapeContainer {
031:            List shapes = new ArrayList();
032:            HSSFSheet sheet;
033:            int x1 = 0;
034:            int y1 = 0;
035:            int x2 = 1023;
036:            int y2 = 255;
037:
038:            /**
039:             * Creates the patriarch.
040:             *
041:             * @param sheet     the sheet this patriarch is stored in.
042:             */
043:            HSSFPatriarch(HSSFSheet sheet) {
044:                this .sheet = sheet;
045:            }
046:
047:            /**
048:             * Creates a new group record stored under this patriarch.
049:             *
050:             * @param anchor    the client anchor describes how this group is attached
051:             *                  to the sheet.
052:             * @return  the newly created group.
053:             */
054:            public HSSFShapeGroup createGroup(HSSFClientAnchor anchor) {
055:                HSSFShapeGroup group = new HSSFShapeGroup(null, anchor);
056:                group.anchor = anchor;
057:                shapes.add(group);
058:                return group;
059:            }
060:
061:            /**
062:             * Creates a simple shape.  This includes such shapes as lines, rectangles,
063:             * and ovals.
064:             *
065:             * @param anchor    the client anchor describes how this group is attached
066:             *                  to the sheet.
067:             * @return  the newly created shape.
068:             */
069:            public HSSFSimpleShape createSimpleShape(HSSFClientAnchor anchor) {
070:                HSSFSimpleShape shape = new HSSFSimpleShape(null, anchor);
071:                shape.anchor = anchor;
072:                shapes.add(shape);
073:                return shape;
074:            }
075:
076:            /**
077:             * Creates a picture.
078:             *
079:             * @param anchor    the client anchor describes how this group is attached
080:             *                  to the sheet.
081:             * @return  the newly created shape.
082:             */
083:            public HSSFPicture createPicture(HSSFClientAnchor anchor,
084:                    int pictureIndex) {
085:                HSSFPicture shape = new HSSFPicture(null, anchor);
086:                shape.setPictureIndex(pictureIndex);
087:                shape.anchor = anchor;
088:                shape.patriarch = this ;
089:                shapes.add(shape);
090:                return shape;
091:            }
092:
093:            /**
094:             * Creates a polygon
095:             *
096:             * @param anchor    the client anchor describes how this group is attached
097:             *                  to the sheet.
098:             * @return  the newly created shape.
099:             */
100:            public HSSFPolygon createPolygon(HSSFClientAnchor anchor) {
101:                HSSFPolygon shape = new HSSFPolygon(null, anchor);
102:                shape.anchor = anchor;
103:                shapes.add(shape);
104:                return shape;
105:            }
106:
107:            /**
108:             * Constructs a textbox under the patriarch.
109:             *
110:             * @param anchor    the client anchor describes how this group is attached
111:             *                  to the sheet.
112:             * @return      the newly created textbox.
113:             */
114:            public HSSFTextbox createTextbox(HSSFClientAnchor anchor) {
115:                HSSFTextbox shape = new HSSFTextbox(null, anchor);
116:                shape.anchor = anchor;
117:                shapes.add(shape);
118:                return shape;
119:            }
120:
121:            /**
122:             * Constructs a cell comment.
123:             *
124:             * @param anchor    the client anchor describes how this comment is attached
125:             *                  to the sheet.
126:             * @return      the newly created comment.
127:             */
128:            public HSSFComment createComment(HSSFAnchor anchor) {
129:                HSSFComment shape = new HSSFComment(null, anchor);
130:                shape.anchor = anchor;
131:                shapes.add(shape);
132:                return shape;
133:            }
134:
135:            /**
136:             * Returns a list of all shapes contained by the patriarch.
137:             */
138:            public List getChildren() {
139:                return shapes;
140:            }
141:
142:            /**
143:             * Total count of all children and their children's children.
144:             */
145:            public int countOfAllChildren() {
146:                int count = shapes.size();
147:                for (Iterator iterator = shapes.iterator(); iterator.hasNext();) {
148:                    HSSFShape shape = (HSSFShape) iterator.next();
149:                    count += shape.countOfAllChildren();
150:                }
151:                return count;
152:            }
153:
154:            /**
155:             * Sets the coordinate space of this group.  All children are contrained
156:             * to these coordinates.
157:             */
158:            public void setCoordinates(int x1, int y1, int x2, int y2) {
159:                this .x1 = x1;
160:                this .y1 = y1;
161:                this .x2 = x2;
162:                this .y2 = y2;
163:            }
164:
165:            /**
166:             * The top left x coordinate of this group.
167:             */
168:            public int getX1() {
169:                return x1;
170:            }
171:
172:            /**
173:             * The top left y coordinate of this group.
174:             */
175:            public int getY1() {
176:                return y1;
177:            }
178:
179:            /**
180:             * The bottom right x coordinate of this group.
181:             */
182:            public int getX2() {
183:                return x2;
184:            }
185:
186:            /**
187:             * The bottom right y coordinate of this group.
188:             */
189:            public int getY2() {
190:                return y2;
191:            }
192:
193:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.