Source Code Cross Referenced for TextSpanLayout.java in  » Graphic-Library » batik » org » apache » batik » gvt » text » 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 » batik » org.apache.batik.gvt.text 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:           Licensed to the Apache Software Foundation (ASF) under one or more
004:           contributor license agreements.  See the NOTICE file distributed with
005:           this work for additional information regarding copyright ownership.
006:           The ASF licenses this file to You under the Apache License, Version 2.0
007:           (the "License"); you may not use this file except in compliance with
008:           the License.  You may obtain a copy of the License at
009:
010:               http://www.apache.org/licenses/LICENSE-2.0
011:
012:           Unless required by applicable law or agreed to in writing, software
013:           distributed under the License is distributed on an "AS IS" BASIS,
014:           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:           See the License for the specific language governing permissions and
016:           limitations under the License.
017:
018:         */
019:
020:        package org.apache.batik.gvt.text;
021:
022:        import java.awt.Graphics2D;
023:        import java.awt.Shape;
024:        import java.awt.geom.Point2D;
025:        import java.awt.geom.Rectangle2D;
026:
027:        import org.apache.batik.gvt.font.GVTGlyphMetrics;
028:        import org.apache.batik.gvt.font.GVTGlyphVector;
029:        import org.apache.batik.gvt.font.GVTLineMetrics;
030:
031:        /**
032:         * Class that performs layout of attributed text strings into
033:         * glyph sets paintable by TextPainter instances.
034:         * Similar to java.awt.font.TextLayout in function and purpose.
035:         * Note that while this utility interface is provided for the convenience of
036:         * <tt>TextPainter</tt> implementations, conforming <tt>TextPainter</tt>s
037:         * are not required to use this class.
038:         * @see java.awt.font.TextLayout
039:         * @see org.apache.batik.gvt.TextPainter
040:         *
041:         * @author <a href="mailto:bill.haneman@ireland.sun.com">Bill Haneman</a>
042:         * @version $Id: TextSpanLayout.java 478188 2006-11-22 15:19:17Z dvholten $
043:         */
044:        public interface TextSpanLayout {
045:
046:            int DECORATION_UNDERLINE = 0x1;
047:            int DECORATION_STRIKETHROUGH = 0x2;
048:            int DECORATION_OVERLINE = 0x4;
049:            int DECORATION_ALL = DECORATION_UNDERLINE | DECORATION_OVERLINE
050:                    | DECORATION_STRIKETHROUGH;
051:
052:            /**
053:             * Paints the specified text layout using the
054:             * specified Graphics2D and rendering context.
055:             * @param g2d the Graphics2D to use
056:             */
057:            void draw(Graphics2D g2d);
058:
059:            /**
060:             * Returns the outline of the specified decorations on the glyphs,
061:             * transformed by an AffineTransform.
062:             * @param decorationType an integer indicating the type(s) of decorations
063:             *     included in this shape.  May be the result of "OR-ing" several
064:             *     values together:
065:             * e.g. <tt>DECORATION_UNDERLINE | DECORATION_STRIKETHROUGH</tt>
066:             */
067:            Shape getDecorationOutline(int decorationType);
068:
069:            /**
070:             * Returns the rectangular bounds of the completed glyph layout.
071:             * This includes stroking information, this does not include
072:             * deocrations.
073:             */
074:            Rectangle2D getBounds2D();
075:
076:            /**
077:             * Returns the bounds of the geometry (this is always the bounds
078:             * of the outline).
079:             */
080:            Rectangle2D getGeometricBounds();
081:
082:            /**
083:             * Returns the outline of the completed glyph layout, transformed
084:             * by an AffineTransform.
085:             */
086:            Shape getOutline();
087:
088:            /**
089:             * Returns the current text position at the completion
090:             * of glyph layout.
091:             * (This is the position that should be used for positioning
092:             * adjacent layouts.)
093:             */
094:            Point2D getAdvance2D();
095:
096:            /**
097:             * Returns the advance between each glyph in text progression direction.
098:             */
099:            float[] getGlyphAdvances();
100:
101:            /**
102:             * Returns the Metrics for a particular glyph.
103:             */
104:            GVTGlyphMetrics getGlyphMetrics(int glyphIndex);
105:
106:            /**
107:             * Returns the Line metrics for this text span.
108:             */
109:            GVTLineMetrics getLineMetrics();
110:
111:            Point2D getTextPathAdvance();
112:
113:            /**
114:             * Returns the current text position at the completion beginning
115:             * of glyph layout, before the application of explicit
116:             * glyph positioning attributes.
117:             */
118:            Point2D getOffset();
119:
120:            /**
121:             * Sets the scaling factor to use for string.  if ajdSpacing is
122:             * true then only the spacing between glyphs will be adjusted
123:             * otherwise the glyphs and the spaces between them will be
124:             * adjusted.
125:             * @param xScale Scale factor to apply in X direction.
126:             * @param yScale Scale factor to apply in Y direction.
127:             * @param adjSpacing True if only spaces should be adjusted.
128:             */
129:            void setScale(float xScale, float yScale, boolean adjSpacing);
130:
131:            /**
132:             * Sets the text position used for the implicit origin
133:             * of glyph layout. Ignored if multiple explicit glyph
134:             * positioning attributes are present in ACI
135:             * (e.g. if the aci has multiple X or Y values).
136:             */
137:            void setOffset(Point2D offset);
138:
139:            /**
140:             * Returns a Shape which encloses the currently selected glyphs
141:             * as specified by glyph indices <tt>begin</tt> and <tt>end</tt>.
142:             * @param beginCharIndex the index of the first glyph in the contiguous
143:             *                       selection.
144:             * @param endCharIndex the index of the last glyph in the contiguous
145:             *                     selection.
146:             */
147:            Shape getHighlightShape(int beginCharIndex, int endCharIndex);
148:
149:            /**
150:             * Perform hit testing for coordinate at x, y.
151:             * @return a TextHit object encapsulating the character index for
152:             *     successful hits and whether the hit is on the character
153:             *     leading edge.
154:             * @param x the x coordinate of the point to be tested.
155:             * @param y the y coordinate of the point to be tested.
156:             */
157:            TextHit hitTestChar(float x, float y);
158:
159:            /**
160:             * Returns true if the advance direction of this text is vertical.
161:             */
162:            boolean isVertical();
163:
164:            /**
165:             * Returns true if this layout in on a text path.
166:             */
167:            boolean isOnATextPath();
168:
169:            /**
170:             * Returns the number of glyphs in this layout.
171:             */
172:            int getGlyphCount();
173:
174:            /**
175:             * Returns the number of chars represented by the glyphs within the
176:             * specified range.
177:             * @param startGlyphIndex The index of the first glyph in the range.
178:             * @param endGlyphIndex The index of the last glyph in the range.
179:             * @return The number of chars.
180:             */
181:            int getCharacterCount(int startGlyphIndex, int endGlyphIndex);
182:
183:            /**
184:             * Returns the glyph index of the glyph that has the specified char index.
185:             *
186:             * @param charIndex The original index of the character in the text node's
187:             * text string.
188:             * @return The index of the matching glyph in this layout's glyph vector,
189:             *         or -1 if a matching glyph could not be found.
190:             */
191:            int getGlyphIndex(int charIndex);
192:
193:            /**
194:             * Returns true if the text direction in this layout is from left to right.
195:             */
196:            boolean isLeftToRight();
197:
198:            /**
199:             * Return true is the character index is represented by glyphs
200:             * in this layout.
201:             *
202:             * @param index index of the character in the ACI.
203:             * @return true if the layout represents that character.
204:             */
205:            boolean hasCharacterIndex(int index);
206:
207:            /**
208:             * Return the glyph vector asociated to this layout.
209:             *
210:             * @return glyph vector
211:             */
212:            GVTGlyphVector getGlyphVector();
213:
214:            /**
215:             * Return the rotation angle applied to the
216:             * character.
217:             *
218:             * @param index index of the character in the ACI
219:             * @return rotation angle
220:             */
221:            double getComputedOrientationAngle(int index);
222:
223:            /**
224:             * Return true if this text run represents
225:             * an alt glyph.
226:             */
227:            boolean isAltGlyph();
228:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.