KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2
3    Copyright 2002-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.geom.Point2D JavaDoc;
21 import java.text.AttributedCharacterIterator JavaDoc;
22
23 import org.apache.batik.gvt.font.GVTGlyphVector;
24
25 /**
26  * This class encapsulates the layout information about a single line
27  * in a multi-line flow.
28  */

29 public class LineInfo {
30
31     Point2D.Float JavaDoc loc;
32     AttributedCharacterIterator JavaDoc aci;
33     GVTGlyphVector gv;
34     int startIdx;
35     int endIdx;
36     float advance;
37     float visualAdvance;
38     float lastCharWidth;
39     float lineWidth;
40     boolean partial;
41     Point2D.Float JavaDoc verticalAlignOffset;
42
43     /**
44      *
45      */

46     public LineInfo(Point2D.Float JavaDoc loc,
47                     AttributedCharacterIterator JavaDoc aci,
48                     GVTGlyphVector gv,
49                     int startIdx, int endIdx,
50                     float advance,
51                     float visualAdvance,
52                     float lastCharWidth,
53                     float lineWidth,
54                     boolean partial,
55                     Point2D.Float JavaDoc verticalAlignOffset) {
56         this.loc = loc;
57         this.aci = aci;
58         this.gv = gv;
59         this.startIdx = startIdx;
60         this.endIdx = endIdx;
61         this.advance = advance;
62         this.visualAdvance = visualAdvance;
63         this.lastCharWidth = lastCharWidth;
64         this.lineWidth = lineWidth;
65         this.partial = partial;
66         this.verticalAlignOffset = verticalAlignOffset;
67     }
68
69     public Point2D.Float JavaDoc getLocation() { return loc; }
70     public AttributedCharacterIterator JavaDoc getACI() { return aci; }
71     public GVTGlyphVector getGlyphVector() { return gv; }
72     public int getStartIdx() { return startIdx; }
73     public int getEndIdx() { return endIdx; }
74     public float getAdvance() { return advance; }
75     public float getVisualAdvance() { return visualAdvance; }
76     public float getLastCharWidth() { return lastCharWidth; }
77     public float getLineWidth() { return lineWidth; }
78     public boolean isPartialLine() { return partial; }
79     public Point2D.Float JavaDoc getVerticalAlignOffset() { return verticalAlignOffset; }
80
81     public String JavaDoc toString() {
82         return ("[LineInfo loc: " + loc +
83                 " [" + startIdx + "," + endIdx + "] " +
84                 " LWidth: " + lineWidth +
85                 " Adv: " + advance + " VAdv: " + visualAdvance +
86                 " LCW: " + lastCharWidth +
87                 " Partial: " + partial +
88                 " verticalAlignOffset: " + verticalAlignOffset);
89     }
90
91 }
92
Popular Tags