Source Code Cross Referenced for GBCF.java in  » Installer » AntInstaller » org » tp23 » gui » 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 » Installer » AntInstaller » org.tp23.gui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * Copyright 2005 Paul Hinds
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         * http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package org.tp23.gui;
017:
018:        import java.awt.GridBagConstraints;
019:        import java.awt.Insets;
020:
021:        /**
022:         * GBCF  Grib Bag Constraints Factory.  This class exists mostly
023:         * for tidying up code that used the exsivly verbose GridBagConstraints
024:         * object, hence the shortened class name.
025:         * By default a two column equal with table is assumed, to support other
026:         * column layouts use the constructor that take an array of column wieghts
027:         * Factory class for generating constraints for a equal width column table.
028:         * the table is similar to the following table rendered in HTML
029:         * <table border="2">
030:         *   <tr>
031:         *     <td>data</td><td>data</td>
032:         *   </tr>
033:         *   <tr>
034:         *     <td colspan="2">data</td>
035:         *   </tr>
036:         *   <tr>
037:         *     <td>data</td><td>data</td>
038:         *   </tr>
039:         *   <tr>
040:         *     <td>data</td><td>data</td>
041:         *   </tr>
042:         * <table>
043:         * @author not attributable
044:         * @version 1.0
045:         */
046:        public class GBCF {
047:
048:            protected Insets insets = new Insets(1, 4, 1, 4);
049:            protected Insets noinsets = new Insets(0, 0, 0, 0);
050:            protected double[] columnWeights = new double[] { 0.5, 0.5 };
051:
052:            public GBCF() {
053:
054:            }
055:
056:            /**
057:             * to support more than two columns or vary the column wieghtings
058:             * @param columnWeights double[]
059:             */
060:            public GBCF(double[] columnWeights) {
061:                this .columnWeights = columnWeights;
062:            }
063:
064:            /**
065:             *
066:             * @param row int the 0 indexed row
067:             * @param col int the 0 indexed column
068:             * @param span boolean does cell span both columns
069:             * @return GridBagConstraints
070:             */
071:            public GridBagConstraints getCell(int row, int col) {
072:                return new GridBagConstraints(col, //gridx
073:                        row, //gridy
074:                        1, //gridwidth
075:                        1, //gridheight
076:                        columnWeights[col],//weightx
077:                        0.0, //weithty
078:                        GridBagConstraints.WEST, // anchor
079:                        GridBagConstraints.NONE, //fill
080:                        insets, // insets
081:                        1, //ipadx
082:                        1 //ipady
083:                );
084:            }
085:
086:            /**
087:             *
088:             * @param row int the 0 indexed row
089:             * @param first boolean is this the first column or the second
090:             * @param span boolean does cell span both columns
091:             * @return GridBagConstraints
092:             */
093:            public GridBagConstraints getSpan(int row) {
094:                return new GridBagConstraints(0, //gridx
095:                        row, //gridy
096:                        2, //gridwidth
097:                        1, //gridheight
098:                        columnWeights[0],//weightx
099:                        0.0, //weithty
100:                        GridBagConstraints.WEST, // anchor
101:                        GridBagConstraints.NONE, //fill
102:                        insets, // insets
103:                        1, //ipadx
104:                        1 //ipady
105:                );
106:            }
107:
108:            public GridBagConstraints getVertGlue(int row) {
109:                return new GridBagConstraints(0, //gridx
110:                        row, //gridy
111:                        2, //gridwidth
112:                        1, //gridheight
113:                        columnWeights[0],//weightx
114:                        1.0, //weithty
115:                        GridBagConstraints.NORTHWEST, // anchor
116:                        GridBagConstraints.NONE, //fill
117:                        noinsets, // insets
118:                        0, //ipadx
119:                        0 //ipady
120:                );
121:            }
122:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.