Source Code Cross Referenced for SGridLayout.java in  » Swing-Library » wings3 » org » wings » 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 » Swing Library » wings3 » org.wings 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2000,2005 wingS development team.
003:         *
004:         * This file is part of wingS (http://wingsframework.org).
005:         *
006:         * wingS is free software; you can redistribute it and/or modify
007:         * it under the terms of the GNU Lesser General Public License
008:         * as published by the Free Software Foundation; either version 2.1
009:         * of the License, or (at your option) any later version.
010:         *
011:         * Please see COPYING for the complete licence.
012:         */
013:        package org.wings;
014:
015:        import java.util.ArrayList;
016:        import java.util.List;
017:
018:        /**
019:         * Swing-like grid layout.
020:         *
021:         * @author <a href="mailto:haaf@mercatis.de">Armin Haaf</a>
022:         */
023:        public class SGridLayout extends SAbstractLayoutManager {
024:            protected ArrayList components = new ArrayList(2);
025:            protected int rows = 1;
026:            protected int cols = 1;
027:            protected int border = 0;
028:            protected boolean renderFirstLineAsHeader = false;
029:
030:            /**
031:             * The horizontal gap (in pixels) specifiying the space
032:             * between columns.  They can be changed at any time.
033:             * This should be a non-negative integer.
034:             */
035:            protected int hgap = 0;
036:
037:            /**
038:             * The vertical gap (in pixels) which specifiying the space
039:             * between rows.  They can be changed at any time.
040:             * This should be a non negative integer.
041:             */
042:            protected int vgap = 0;
043:
044:            /**
045:             * creates a new grid layout with 1 row and 1 column extent
046:             */
047:            public SGridLayout() {
048:            }
049:
050:            /**
051:             * creats a new grid layout with the given number of columns
052:             *
053:             * @param cols number of columns
054:             */
055:            public SGridLayout(int cols) {
056:                this ();
057:                setColumns(cols);
058:            }
059:
060:            /**
061:             * creats a new grid layout with the given number of columns and rows
062:             *
063:             * @param rows number of rows
064:             * @param cols number of columns
065:             */
066:            public SGridLayout(int rows, int cols) {
067:                this (cols);
068:                setRows(rows);
069:            }
070:
071:            /**
072:             * creats a new grid layout with the given number of columns and rows and the given gaps
073:             *
074:             * @param rows number of rows
075:             * @param cols number of columns
076:             * @param hgap horizontal gap
077:             * @param vgap vertical gap
078:             */
079:            public SGridLayout(int rows, int cols, int hgap, int vgap) {
080:                this (rows, cols);
081:                setHgap(hgap);
082:                setVgap(vgap);
083:            }
084:
085:            /**
086:             * sets the number of columns
087:             *
088:             * @param c number of columns
089:             */
090:            public void setColumns(int c) {
091:                cols = c;
092:            }
093:
094:            /**
095:             * returns the number of columns
096:             *
097:             * @return number of columns
098:             */
099:            public int getColumns() {
100:                return cols;
101:            }
102:
103:            /**
104:             * sets the number of rows
105:             *
106:             * @param r number of rows
107:             */
108:            public void setRows(int r) {
109:                rows = r;
110:            }
111:
112:            /**
113:             * returns the number of rows
114:             *
115:             * @return number of rows
116:             */
117:            public int getRows() {
118:                return rows;
119:            }
120:
121:            public void addComponent(SComponent c, Object constraint, int index) {
122:                components.add(index, c);
123:            }
124:
125:            public void removeComponent(SComponent c) {
126:                components.remove(c);
127:            }
128:
129:            /**
130:             * returns a list of all components
131:             *
132:             * @return all components
133:             */
134:            public List getComponents() {
135:                return components;
136:            }
137:
138:            /**
139:             * Gets the horizontal gap between components in pixel. Rendered half as margin left and margin right
140:             * Some PLAFs might ignore this property.
141:             *
142:             * @return the horizontal gap between components
143:             */
144:            public int getHgap() {
145:                return hgap;
146:            }
147:
148:            /**
149:             * Sets the horizontal gap between components to the specified value in pixe. Rendered half as margin left and margin right
150:             * Some PLAFs might ignore this property.
151:             *
152:             * @param hgap the horizontal gap between components
153:             */
154:            public void setHgap(int hgap) {
155:                this .hgap = hgap;
156:            }
157:
158:            /**
159:             * Gets the vertical gap between components in pixel. Rendered half as margin top and margin bottom
160:             * Some PLAFs might ignore this property.
161:             *
162:             * @return the vertical gap between components
163:             */
164:            public int getVgap() {
165:                return vgap;
166:            }
167:
168:            /**
169:             * Sets the vertical gap between components to the specified value in pixel.
170:             * Rendered half as margin top and margin bottom. Some PLAFs might ignore this property.
171:             *
172:             * @param vgap the vertical gap between components
173:             */
174:            public void setVgap(int vgap) {
175:                this .vgap = vgap;
176:            }
177:
178:            //    /**
179:            //     * The paddding between the layout cells in pixel. Some PLAFs might ignore this property.
180:            //     * @param cellPadding cell padding in pixel
181:            //     */
182:            //    public void setCellPadding(int cellPadding) {
183:            //        this.cellPadding = cellPadding;
184:            //    }
185:            //
186:            //    /**
187:            //     * The paddding between the layout cells in pixel. Some PLAFs might ignore this property.
188:            //     * @return cell padding in pixel
189:            //     */
190:            //    public int getCellPadding() {
191:            //        return cellPadding;
192:            //    }
193:            //
194:            //    /**
195:            //     * The paddding between the layout cells in pixel. Some PLAFs might ignore this property.
196:            //     * @param cellSpacing The spacing between the layout cells. pixel
197:            //     */
198:            //    public void setCellSpacing(int cellSpacing) {
199:            //        this.cellSpacing = cellSpacing;
200:            //    }
201:            //
202:            //    /**
203:            //     * The paddding between the layout cells in pixel. Some PLAFs might ignore this property.
204:            //     * @return The spacing between the layout cells. pixel
205:            //     */
206:            //    public int getCellSpacing() {
207:            //        return cellSpacing;
208:            //    }
209:
210:            /**
211:             * Typical PLAFs will render this layout as invisible table (border = 0). Use this property to make it visible
212:             *
213:             * @param borderWidth The rendered border with in pixel
214:             */
215:            public void setBorder(int borderWidth) {
216:                border = borderWidth;
217:            }
218:
219:            /**
220:             * Typical PLAFs will render this layout as invisible table (border = 0). Use this property to make it visible
221:             *
222:             * @return The rendered border with in pixel
223:             */
224:            public int getBorder() {
225:                return border;
226:            }
227:
228:            /**
229:             * Renders the first line as HTML <code>&lt;th&gt;</code> instead regular <code>&lt;tr&gt;</code>.
230:             *
231:             * @param renderAsTH true if first line should be rendered as header
232:             */
233:            public void setRenderFirstLineAsHeader(boolean renderAsTH) {
234:                renderFirstLineAsHeader = renderAsTH;
235:            }
236:
237:            /**
238:             * {@link #setRenderFirstLineAsHeader(boolean)}
239:             */
240:            public boolean getRenderFirstLineAsHeader() {
241:                return renderFirstLineAsHeader;
242:            }
243:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.