Source Code Cross Referenced for ColumnLocation.java in  » J2EE » wicket » org » apache » wicket » extensions » markup » html » tree » table » 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 » J2EE » wicket » org.apache.wicket.extensions.markup.html.tree.table 
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:        package org.apache.wicket.extensions.markup.html.tree.table;
018:
019:        import org.apache.wicket.IClusterable;
020:        import org.apache.wicket.util.lang.EnumeratedType;
021:
022:        /**
023:         * This class represents location of a column in tree table.
024:         * <p>
025:         * First attribute of location is <b>alignment</b>. Alignment specifies,
026:         * whether the column is located on the left side of the table, on the right
027:         * side, or in the middle. Columns in the middle of the table take all space
028:         * between columns on the left and columns on the right.
029:         * <p>
030:         * Next two attributes are <b>size</b> and <b>unit</b>:
031:         * <ul>
032:         * <li> For columns aligned to the left and to the right, the <b>size</b>
033:         * represents the actual width of the column, according to chosen unit. Possible
034:         * units for left and right aligned columns are <em>PX</em>, <em>EM</em>
035:         * and <em>PERCENT</em>. </li>
036:         * <li> For columns in the middle, the only valid unit is <em>PROPORTIONAL</em>.
037:         * These columns take all available space between columns on the left and
038:         * columns on the right. How this space is divided between middle columns is
039:         * determined by the <b>size</b>. In this case the size can be understand as
040:         * weight. Columns with bigger size take more space than columns with smaller
041:         * size. For example, if there are three columns and their sizes are 2, 1, 1,
042:         * the first column thakes 50% of the space and the second two columns take 25%
043:         * each. </li>
044:         * </ul>
045:         * 
046:         * @author Matej Knopp
047:         */
048:        public class ColumnLocation implements  IClusterable {
049:            /**
050:             * Alignment of the column.
051:             */
052:            public static final class Alignment extends EnumeratedType {
053:                /** Align left. */
054:                public static final Alignment LEFT = new Alignment("LEFT");
055:
056:                /** Align middle. */
057:                public static final Alignment MIDDLE = new Alignment("MIDDLE");
058:
059:                /** Align right. */
060:                public static final Alignment RIGHT = new Alignment("RIGHT");
061:
062:                private static final long serialVersionUID = 1L;
063:
064:                /**
065:                 * Construct.
066:                 * 
067:                 * @param name
068:                 */
069:                public Alignment(String name) {
070:                    super (name);
071:                }
072:            }
073:
074:            /**
075:             * Units.
076:             */
077:            public static final class Unit extends EnumeratedType {
078:
079:                /** Size of letter M in the current font. */
080:                public static Unit EM = new Unit("EM");
081:
082:                /** Percentage. */
083:                public static Unit PERCENT = new Unit("PERCENT");
084:
085:                /** Proportional. */
086:                public static Unit PROPORTIONAL = new Unit("PROPORTIONAL");
087:
088:                /** Pixels. */
089:                public static Unit PX = new Unit("PX");
090:
091:                private static final long serialVersionUID = 1L;
092:
093:                /**
094:                 * Construct.
095:                 * 
096:                 * @param name
097:                 */
098:                public Unit(String name) {
099:                    super (name);
100:                }
101:            };
102:
103:            private static final long serialVersionUID = 1L;;
104:
105:            private Alignment alignment;
106:            private int size;
107:            private Unit unit;
108:
109:            /**
110:             * Constructs the ColumnLocation object.
111:             * 
112:             * @param alignment
113:             *            The column alignment
114:             * @param size
115:             *            The column size in expressed in the provided unit
116:             * @param unit
117:             *            The unit that the size argument is expressed in
118:             * @throws IllegalArgumentException
119:             *             if the unit does not matche the alignment
120:             */
121:            public ColumnLocation(Alignment alignment, int size, Unit unit) {
122:                this .alignment = alignment;
123:                this .size = size;
124:                this .unit = unit;
125:
126:                if (alignment == Alignment.MIDDLE && unit != Unit.PROPORTIONAL) {
127:                    throw new IllegalArgumentException(
128:                            "For alignment MIDDLE the specified unit must be PROPORTIONAL.");
129:                } else if (alignment != Alignment.MIDDLE
130:                        && unit == Unit.PROPORTIONAL) {
131:                    throw new IllegalArgumentException(
132:                            "Unit PROPORTIONAL can be specified only for columns with alignment MIDDLE.");
133:                }
134:            }
135:
136:            /**
137:             * Returns the allignment of this column.
138:             * 
139:             * @return The alignment of this column
140:             */
141:            public Alignment getAlignment() {
142:                return alignment;
143:            }
144:
145:            /**
146:             * Returns the size of this column.
147:             * 
148:             * @return The size of this column
149:             */
150:            public int getSize() {
151:                return size;
152:            }
153:
154:            /**
155:             * Returns the unit of a column.
156:             * 
157:             * @return The unit of this column
158:             */
159:            public Unit getUnit() {
160:                return unit;
161:            }
162:        }
w_w__w_.j___a___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.