Source Code Cross Referenced for Character.java in  » Graphic-Library » fop » org » apache » fop » fo » flow » 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.flow 
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: Character.java 567294 2007-08-18 17:00:50Z vhennebert $ */
019:
020:        package org.apache.fop.fo.flow;
021:
022:        import java.awt.Color;
023:
024:        import org.apache.fop.apps.FOPException;
025:        import org.apache.fop.datatypes.Length;
026:        import org.apache.fop.fo.CharIterator;
027:        import org.apache.fop.fo.FONode;
028:        import org.apache.fop.fo.FObj;
029:        import org.apache.fop.fo.PropertyList;
030:        import org.apache.fop.fo.ValidationException;
031:        import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
032:        import org.apache.fop.fo.properties.CommonFont;
033:        import org.apache.fop.fo.properties.CommonHyphenation;
034:        import org.apache.fop.fo.properties.CommonTextDecoration;
035:        import org.apache.fop.fo.properties.Property;
036:        import org.apache.fop.fo.properties.SpaceProperty;
037:        import org.xml.sax.Locator;
038:
039:        /**
040:         * This class represents the flow object 'fo:character'. Its use is defined by
041:         * the spec: "The fo:character flow object represents a character that is mapped to
042:         * a glyph for presentation. It is an atomic unit to the formatter.
043:         * When the result tree is interpreted as a tree of formatting objects,
044:         * a character in the result tree is treated as if it were an empty
045:         * element of type fo:character with a character attribute
046:         * equal to the Unicode representation of the character.
047:         * The semantics of an "auto" value for character properties, which is
048:         * typically their initial value,  are based on the Unicode codepoint.
049:         * Overrides may be specified in an implementation-specific manner." (6.6.3)
050:         *
051:         */
052:        public class Character extends FObj {
053:            // The value of properties relevant for fo:character.
054:            private CommonBorderPaddingBackground commonBorderPaddingBackground;
055:            private CommonFont commonFont;
056:            private CommonHyphenation commonHyphenation;
057:            private Length alignmentAdjust;
058:            private int alignmentBaseline;
059:            private Length baselineShift;
060:            /** Holds the character value */
061:            protected char character;
062:            private Color color;
063:            private int dominantBaseline;
064:            // private ToBeImplementedProperty glyphOrientationHorizontal;
065:            // private ToBeImplementedProperty glyphOrientationVertical;
066:            private Property letterSpacing;
067:            private SpaceProperty lineHeight;
068:            /** Holds the text decoration values. May be null */
069:            private CommonTextDecoration textDecoration;
070:            // private ToBeImplementedProperty textShadow;
071:            private Property wordSpacing;
072:            // Unused but valid items, commented out for performance:
073:            //     private CommonAural commonAural;
074:            //     private CommonMarginInline commonMarginInline;
075:            //     private CommonRelativePosition commonRelativePosition;
076:            //     private int treatAsWordSpace;
077:            //     private Length textDepth;
078:            //     private Length textAltitude;
079:            //     private KeepProperty keepWithNext;
080:            //     private KeepProperty keepWithPrevious;
081:            //     private int scoreSpaces;
082:            //     private int suppressAtLineBreak;
083:            //     private int textTransform;
084:            //     private int visibility;
085:            // End of property values
086:
087:            /** constant indicating that the character is OK */
088:            public static final int OK = 0;
089:            /** constant indicating that the character does not fit */
090:            public static final int DOESNOT_FIT = 1;
091:
092:            /**
093:             * @param parent FONode that is the parent of this object
094:             */
095:            public Character(FONode parent) {
096:                super (parent);
097:            }
098:
099:            /**
100:             * {@inheritDoc}
101:             */
102:            public void bind(PropertyList pList) throws FOPException {
103:                super .bind(pList);
104:                commonBorderPaddingBackground = pList
105:                        .getBorderPaddingBackgroundProps();
106:                commonFont = pList.getFontProps();
107:                commonHyphenation = pList.getHyphenationProps();
108:
109:                alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST).getLength();
110:                alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE).getEnum();
111:                baselineShift = pList.get(PR_BASELINE_SHIFT).getLength();
112:                character = pList.get(PR_CHARACTER).getCharacter();
113:                color = pList.get(PR_COLOR).getColor(getUserAgent());
114:                dominantBaseline = pList.get(PR_DOMINANT_BASELINE).getEnum();
115:                // glyphOrientationHorizontal = pList.get(PR_GLYPH_ORIENTATION_HORIZONTAL);
116:                // glyphOrientationVertical = pList.get(PR_GLYPH_ORIENTATION_VERTICAL);
117:                letterSpacing = pList.get(PR_LETTER_SPACING);
118:                lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
119:                textDecoration = pList.getTextDecorationProps();
120:                // textShadow = pList.get(PR_TEXT_SHADOW);
121:                wordSpacing = pList.get(PR_WORD_SPACING);
122:            }
123:
124:            /**
125:             * {@inheritDoc}
126:             */
127:            protected void startOfNode() throws FOPException {
128:                super .startOfNode();
129:                getFOEventHandler().character(this );
130:            }
131:
132:            /**
133:             * {@inheritDoc}
134:             */
135:            protected void validateChildNode(Locator loc, String nsURI,
136:                    String localName) throws ValidationException {
137:                invalidChildError(loc, nsURI, localName);
138:            }
139:
140:            /**
141:             * {@inheritDoc}
142:             */
143:            public CharIterator charIterator() {
144:                return new FOCharIterator(this );
145:            }
146:
147:            /**
148:             * @return the Common Border, Padding, and Background Properties.
149:             */
150:            public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
151:                return commonBorderPaddingBackground;
152:            }
153:
154:            /**
155:             * @return the Common Font Properties.
156:             */
157:            public CommonFont getCommonFont() {
158:                return commonFont;
159:            }
160:
161:            /**
162:             * @return the Common Hyphenation Properties.
163:             */
164:            public CommonHyphenation getCommonHyphenation() {
165:                return commonHyphenation;
166:            }
167:
168:            /**
169:             * @return the "character" property.
170:             */
171:            public char getCharacter() {
172:                return character;
173:            }
174:
175:            /**
176:             * @return the "color" property.
177:             */
178:            public Color getColor() {
179:                return color;
180:            }
181:
182:            /**
183:             * @return the "alignment-adjust" property
184:             */
185:            public Length getAlignmentAdjust() {
186:                return alignmentAdjust;
187:            }
188:
189:            /**
190:             * @return the "alignment-baseline" property
191:             */
192:            public int getAlignmentBaseline() {
193:                return alignmentBaseline;
194:            }
195:
196:            /**
197:             * @return the "baseline-shift" property
198:             */
199:            public Length getBaselineShift() {
200:                return baselineShift;
201:            }
202:
203:            /**
204:             * @return the "dominant-baseline" property
205:             */
206:            public int getDominantBaseline() {
207:                return dominantBaseline;
208:            }
209:
210:            /**
211:             * @return the "letter-spacing" property.
212:             */
213:            public Property getLetterSpacing() {
214:                return letterSpacing;
215:            }
216:
217:            /**
218:             * @return the "line-height" property.
219:             */
220:            public SpaceProperty getLineHeight() {
221:                return lineHeight;
222:            }
223:
224:            /** @return the "text-decoration" property. */
225:            public CommonTextDecoration getTextDecoration() {
226:                return textDecoration;
227:            }
228:
229:            /**
230:             * @return the "word-spacing" property.
231:             */
232:            public Property getWordSpacing() {
233:                return wordSpacing;
234:            }
235:
236:            /**
237:             * {@inheritDoc}
238:             */
239:            public String getLocalName() {
240:                return "character";
241:            }
242:
243:            /**
244:             * {@inheritDoc}
245:             */
246:            public int getNameId() {
247:                return FO_CHARACTER;
248:            }
249:
250:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.