KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > extension > svg > FlowExtTextLayoutFactory


1 /*
2
3    Copyright 2001,2003 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.extension.svg;
19
20 import java.awt.font.FontRenderContext JavaDoc;
21 import java.awt.geom.Point2D JavaDoc;
22 import java.text.AttributedCharacterIterator JavaDoc;
23
24 import org.apache.batik.gvt.text.TextLayoutFactory;
25 import org.apache.batik.gvt.text.TextSpanLayout;
26 /**
27  * Factory instance that returns TextSpanLayouts appropriate to
28  * FlowRoot instances.
29  *
30  * @see org.apache.batik.gvt.text.TextSpanLayout
31  * @author <a HREF="mailto:dewese@apache.org">Thomas DeWeese</a>
32  * @version $Id: FlowExtTextLayoutFactory.java,v 1.2 2005/03/27 08:58:33 cam Exp $
33  */

34 public class FlowExtTextLayoutFactory implements TextLayoutFactory {
35
36     /**
37      * Returns an instance of TextSpanLayout suitable for rendering the
38      * AttributedCharacterIterator.
39      *
40      * @param aci The character iterator to be laid out
41      * @param charMap Indicates how chars in aci map to original
42      * text char array.
43      * @param offset The offset position for the text layout.
44      * @param frc The font render context to use when creating the text layout.
45      */

46     public TextSpanLayout createTextLayout(AttributedCharacterIterator JavaDoc aci,
47                                            int [] charMap,
48                                            Point2D JavaDoc offset,
49                                            FontRenderContext JavaDoc frc) {
50         return new FlowExtGlyphLayout(aci, charMap, offset, frc);
51     }
52 }
53
54
55
Popular Tags