KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pdfbox > afmtypes > CharMetric


1 /**
2  * Copyright (c) 2003, www.pdfbox.org
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  * 3. Neither the name of pdfbox; nor the names of its
14  * contributors may be used to endorse or promote products derived from this
15  * software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  * http://www.pdfbox.org
29  *
30  */

31 package org.pdfbox.afmtypes;
32
33 import java.util.ArrayList JavaDoc;
34 import java.util.List JavaDoc;
35
36 import org.pdfbox.util.BoundingBox;
37
38 /**
39  * This class represents a single character metric.
40  *
41  * @author Ben Litchfield (ben@csh.rit.edu)
42  * @version $Revision: 1.4 $
43  */

44 public class CharMetric
45 {
46     private int characterCode;
47
48     private float wx;
49     private float w0x;
50     private float w1x;
51
52     private float wy;
53     private float w0y;
54     private float w1y;
55
56     private float[] w;
57     private float[] w0;
58     private float[] w1;
59     private float[] vv;
60
61     private String JavaDoc name;
62     private BoundingBox boundingBox;
63     private List JavaDoc ligatures = new ArrayList JavaDoc();
64
65     /** Getter for property boundingBox.
66      * @return Value of property boundingBox.
67      */

68     public BoundingBox getBoundingBox()
69     {
70         return boundingBox;
71     }
72
73     /** Setter for property boundingBox.
74      * @param bBox New value of property boundingBox.
75      */

76     public void setBoundingBox(BoundingBox bBox)
77     {
78         boundingBox = bBox;
79     }
80
81     /** Getter for property characterCode.
82      * @return Value of property characterCode.
83      */

84     public int getCharacterCode()
85     {
86         return characterCode;
87     }
88
89     /** Setter for property characterCode.
90      * @param cCode New value of property characterCode.
91      */

92     public void setCharacterCode(int cCode)
93     {
94         characterCode = cCode;
95     }
96
97     /**
98      * This will add an entry to the list of ligatures.
99      *
100      * @param ligature The ligature to add.
101      */

102     public void addLigature( Ligature ligature )
103     {
104         ligatures.add( ligature );
105     }
106
107     /** Getter for property ligatures.
108      * @return Value of property ligatures.
109      */

110     public List JavaDoc getLigatures()
111     {
112         return ligatures;
113     }
114
115     /** Setter for property ligatures.
116      * @param lig New value of property ligatures.
117      */

118     public void setLigatures(List JavaDoc lig)
119     {
120         this.ligatures = lig;
121     }
122
123     /** Getter for property name.
124      * @return Value of property name.
125      */

126     public String JavaDoc getName()
127     {
128         return name;
129     }
130
131     /** Setter for property name.
132      * @param n New value of property name.
133      */

134     public void setName(String JavaDoc n)
135     {
136         this.name = n;
137     }
138
139     /** Getter for property vv.
140      * @return Value of property vv.
141      */

142     public float[] getVv()
143     {
144         return this.vv;
145     }
146
147     /** Setter for property vv.
148      * @param vvValue New value of property vv.
149      */

150     public void setVv(float[] vvValue)
151     {
152         this.vv = vvValue;
153     }
154
155     /** Getter for property w.
156      * @return Value of property w.
157      */

158     public float[] getW()
159     {
160         return this.w;
161     }
162
163     /** Setter for property w.
164      * @param wValue New value of property w.
165      */

166     public void setW(float[] wValue)
167     {
168         this.w = wValue;
169     }
170
171     /** Getter for property w0.
172      * @return Value of property w0.
173      */

174     public float[] getW0()
175     {
176         return this.w0;
177     }
178
179     /** Setter for property w0.
180      * @param w0Value New value of property w0.
181      */

182     public void setW0(float[] w0Value)
183     {
184         w0 = w0Value;
185     }
186
187     /** Getter for property w0x.
188      * @return Value of property w0x.
189      */

190     public float getW0x()
191     {
192         return w0x;
193     }
194
195     /** Setter for property w0x.
196      * @param w0xValue New value of property w0x.
197      */

198     public void setW0x(float w0xValue)
199     {
200         w0x = w0xValue;
201     }
202
203     /** Getter for property w0y.
204      * @return Value of property w0y.
205      */

206     public float getW0y()
207     {
208         return w0y;
209     }
210
211     /** Setter for property w0y.
212      * @param w0yValue New value of property w0y.
213      */

214     public void setW0y(float w0yValue)
215     {
216         w0y = w0yValue;
217     }
218
219     /** Getter for property w1.
220      * @return Value of property w1.
221      */

222     public float[] getW1()
223     {
224         return this.w1;
225     }
226
227     /** Setter for property w1.
228      * @param w1Value New value of property w1.
229      */

230     public void setW1(float[] w1Value)
231     {
232         w1 = w1Value;
233     }
234
235     /** Getter for property w1x.
236      * @return Value of property w1x.
237      */

238     public float getW1x()
239     {
240         return w1x;
241     }
242
243     /** Setter for property w1x.
244      * @param w1xValue New value of property w1x.
245      */

246     public void setW1x(float w1xValue)
247     {
248         w1x = w1xValue;
249     }
250
251     /** Getter for property w1y.
252      * @return Value of property w1y.
253      */

254     public float getW1y()
255     {
256         return w1y;
257     }
258
259     /** Setter for property w1y.
260      * @param w1yValue New value of property w1y.
261      */

262     public void setW1y(float w1yValue)
263     {
264         w1y = w1yValue;
265     }
266
267     /** Getter for property wx.
268      * @return Value of property wx.
269      */

270     public float getWx()
271     {
272         return wx;
273     }
274
275     /** Setter for property wx.
276      * @param wxValue New value of property wx.
277      */

278     public void setWx(float wxValue)
279     {
280         wx = wxValue;
281     }
282
283     /** Getter for property wy.
284      * @return Value of property wy.
285      */

286     public float getWy()
287     {
288         return wy;
289     }
290
291     /** Setter for property wy.
292      * @param wyValue New value of property wy.
293      */

294     public void setWy(float wyValue)
295     {
296         this.wy = wyValue;
297     }
298
299 }
Popular Tags