Source Code Cross Referenced for LengthPairProperty.java in  » Graphic-Library » fop » org » apache » fop » fo » properties » 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 » Graphic Library » fop » org.apache.fop.fo.properties 
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:        /* $Id: LengthPairProperty.java 426576 2006-07-28 15:44:37Z jeremias $ */
019:
020:        package org.apache.fop.fo.properties;
021:
022:        import org.apache.fop.datatypes.CompoundDatatype;
023:        import org.apache.fop.fo.FObj;
024:        import org.apache.fop.fo.PropertyList;
025:        import org.apache.fop.fo.expr.PropertyException;
026:
027:        /**
028:         * Superclass for properties wrapping a LengthPair value
029:         */
030:        public class LengthPairProperty extends Property implements 
031:                CompoundDatatype {
032:            private Property ipd;
033:            private Property bpd;
034:
035:            /**
036:             * Inner class for creating instances of LengthPairProperty
037:             */
038:            public static class Maker extends CompoundPropertyMaker {
039:
040:                /**
041:                 * @param propId name of property for which this Maker should be created
042:                 */
043:                public Maker(int propId) {
044:                    super (propId);
045:                }
046:
047:                /**
048:                 * Create a new empty instance of LengthPairProperty.
049:                 * @return the new instance. 
050:                 */
051:                public Property makeNewProperty() {
052:                    return new LengthPairProperty();
053:                }
054:
055:                /**
056:                 * @see CompoundPropertyMaker#convertProperty
057:                 */
058:                public Property convertProperty(Property p,
059:                        PropertyList propertyList, FObj fo)
060:                        throws PropertyException {
061:                    if (p instanceof  LengthPairProperty) {
062:                        return p;
063:                    }
064:                    return super .convertProperty(p, propertyList, fo);
065:                }
066:            }
067:
068:            /**
069:             * Creates a new LengthPairProperty with empty values.
070:             */
071:            public LengthPairProperty() {
072:                super ();
073:            }
074:
075:            /**
076:             * Creates a new LengthPairProperty.
077:             * @param ipd inline-progression-dimension
078:             * @param bpd block-progression-dimension
079:             */
080:            public LengthPairProperty(Property ipd, Property bpd) {
081:                this ();
082:                this .ipd = ipd;
083:                this .bpd = bpd;
084:            }
085:
086:            /**
087:             * Creates a new LengthPairProperty which sets both bpd and ipd to the
088:             * same value.
089:             * @param len length for both dimensions
090:             */
091:            public LengthPairProperty(Property len) {
092:                this (len, len);
093:            }
094:
095:            /**
096:             * @see org.apache.fop.datatypes.CompoundDatatype#setComponent(int, Property, boolean)
097:             */
098:            public void setComponent(int cmpId, Property cmpnValue,
099:                    boolean bIsDefault) {
100:                if (cmpId == CP_BLOCK_PROGRESSION_DIRECTION) {
101:                    bpd = cmpnValue;
102:                } else if (cmpId == CP_INLINE_PROGRESSION_DIRECTION) {
103:                    ipd = cmpnValue;
104:                }
105:            }
106:
107:            /**
108:             * @see org.apache.fop.datatypes.CompoundDatatype#getComponent(int)
109:             */
110:            public Property getComponent(int cmpId) {
111:                if (cmpId == CP_BLOCK_PROGRESSION_DIRECTION) {
112:                    return getBPD();
113:                } else if (cmpId == CP_INLINE_PROGRESSION_DIRECTION) {
114:                    return getIPD();
115:                } else {
116:                    return null; // SHOULDN'T HAPPEN
117:                }
118:            }
119:
120:            /**
121:             * @return Property holding the ipd length
122:             */
123:            public Property getIPD() {
124:                return this .ipd;
125:            }
126:
127:            /**
128:             * @return Property holding the bpd length
129:             */
130:            public Property getBPD() {
131:                return this .bpd;
132:            }
133:
134:            /** @see java.lang.Object#toString() */
135:            public String toString() {
136:                return "LengthPair[" + "ipd:" + getIPD().getObject() + ", bpd:"
137:                        + getBPD().getObject() + "]";
138:            }
139:
140:            /**
141:             * @return this.lengthPair
142:             */
143:            public LengthPairProperty getLengthPair() {
144:                return this ;
145:            }
146:
147:            /**
148:             * @return this.lengthPair cast as an Object
149:             */
150:            public Object getObject() {
151:                return this;
152:            }
153:
154:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.