Source Code Cross Referenced for HSSFShapeGroup.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.List;
022:        import java.util.Iterator;
023:
024:        /**
025:         * A shape group may contain other shapes.  It was no actual form on the
026:         * sheet.
027:         *
028:         * @author Glen Stampoultzis (glens at apache.org)
029:         */
030:        public class HSSFShapeGroup extends HSSFShape implements 
031:                HSSFShapeContainer {
032:            List shapes = new ArrayList();
033:            int x1 = 0;
034:            int y1 = 0;
035:            int x2 = 1023;
036:            int y2 = 255;
037:
038:            public HSSFShapeGroup(HSSFShape parent, HSSFAnchor anchor) {
039:                super (parent, anchor);
040:            }
041:
042:            /**
043:             * Create another group under this group.
044:             * @param anchor    the position of the new group.
045:             * @return  the group
046:             */
047:            public HSSFShapeGroup createGroup(HSSFChildAnchor anchor) {
048:                HSSFShapeGroup group = new HSSFShapeGroup(this , anchor);
049:                group.anchor = anchor;
050:                shapes.add(group);
051:                return group;
052:            }
053:
054:            /**
055:             * Create a new simple shape under this group.
056:             * @param anchor    the position of the shape.
057:             * @return  the shape
058:             */
059:            public HSSFSimpleShape createShape(HSSFChildAnchor anchor) {
060:                HSSFSimpleShape shape = new HSSFSimpleShape(this , anchor);
061:                shape.anchor = anchor;
062:                shapes.add(shape);
063:                return shape;
064:            }
065:
066:            /**
067:             * Create a new textbox under this group.
068:             * @param anchor    the position of the shape.
069:             * @return  the textbox
070:             */
071:            public HSSFTextbox createTextbox(HSSFChildAnchor anchor) {
072:                HSSFTextbox shape = new HSSFTextbox(this , anchor);
073:                shape.anchor = anchor;
074:                shapes.add(shape);
075:                return shape;
076:            }
077:
078:            /**
079:             * Creates a polygon
080:             *
081:             * @param anchor    the client anchor describes how this group is attached
082:             *                  to the sheet.
083:             * @return  the newly created shape.
084:             */
085:            public HSSFPolygon createPolygon(HSSFChildAnchor anchor) {
086:                HSSFPolygon shape = new HSSFPolygon(this , anchor);
087:                shape.anchor = anchor;
088:                shapes.add(shape);
089:                return shape;
090:            }
091:
092:            /**
093:             * Creates a picture.
094:             *
095:             * @param anchor    the client anchor describes how this group is attached
096:             *                  to the sheet.
097:             * @return  the newly created shape.
098:             */
099:            public HSSFPicture createPicture(HSSFChildAnchor anchor,
100:                    int pictureIndex) {
101:                HSSFPicture shape = new HSSFPicture(this , anchor);
102:                shape.anchor = anchor;
103:                shape.setPictureIndex(pictureIndex);
104:                shapes.add(shape);
105:                return shape;
106:            }
107:
108:            /**
109:             * Return all children contained by this shape.
110:             */
111:            public List getChildren() {
112:                return shapes;
113:            }
114:
115:            /**
116:             * Sets the coordinate space of this group.  All children are contrained
117:             * to these coordinates.
118:             */
119:            public void setCoordinates(int x1, int y1, int x2, int y2) {
120:                this .x1 = x1;
121:                this .y1 = y1;
122:                this .x2 = x2;
123:                this .y2 = y2;
124:            }
125:
126:            /**
127:             * The top left x coordinate of this group.
128:             */
129:            public int getX1() {
130:                return x1;
131:            }
132:
133:            /**
134:             * The top left y coordinate of this group.
135:             */
136:            public int getY1() {
137:                return y1;
138:            }
139:
140:            /**
141:             * The bottom right x coordinate of this group.
142:             */
143:            public int getX2() {
144:                return x2;
145:            }
146:
147:            /**
148:             * The bottom right y coordinate of this group.
149:             */
150:            public int getY2() {
151:                return y2;
152:            }
153:
154:            /**
155:             * Count of all children and their childrens children.
156:             */
157:            public int countOfAllChildren() {
158:                int count = shapes.size();
159:                for (Iterator iterator = shapes.iterator(); iterator.hasNext();) {
160:                    HSSFShape shape = (HSSFShape) iterator.next();
161:                    count += shape.countOfAllChildren();
162:                }
163:                return count;
164:            }
165:
166:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.