1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements.  See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License.  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 /* $Id: AFPTextDataInfo.java 1297404 2012-03-06 10:17:54Z vhennebert $ */
19 
20 package org.apache.fop.afp;
21 
22 import java.awt.Color;
23 
24 /**
25  * Text data information
26  */
27 public class AFPTextDataInfo {
28 
29     /** the text font reference */
30     private int fontReference;
31 
32     /** the text x coordinate position */
33     private int x;
34 
35     /** the text y coordinate position */
36     private int y;
37 
38     /** the text color */
39     private Color color;
40 
41     /** the text variable space adjustment */
42     private int variableSpaceCharacterIncrement;
43 
44     /** the text inter character adjustment */
45     private int interCharacterAdjustment;
46 
47     /** the text orientation */
48     private int rotation;
49 
50     /** the text encoding */
51     private String textEncoding;
52 
53     /** the text string */
54     private String textString;
55 
56     /**
57      * Returns the font reference
58      *
59      * @return the font reference
60      */
getFontReference()61     public int getFontReference() {
62         return fontReference;
63     }
64 
65     /**
66      * Sets the font reference
67      *
68      * @param fontReference the font reference
69      */
setFontReference(int fontReference)70     public void setFontReference(int fontReference) {
71         this.fontReference = fontReference;
72     }
73 
74     /**
75      * Returns the x coordinate
76      *
77      * @return the x coordinate
78      */
getX()79     public int getX() {
80         return x;
81     }
82 
83     /**
84      * Sets the X coordinate
85      *
86      * @param x the X coordinate
87      */
setX(int x)88     public void setX(int x) {
89         this.x = x;
90     }
91 
92     /**
93      * Returns the y coordinate
94      *
95      * @return the y coordinate
96      */
getY()97     public int getY() {
98         return y;
99     }
100 
101     /**
102      * Sets the Y coordinate
103      *
104      * @param y the Y coordinate
105      */
setY(int y)106     public void setY(int y) {
107         this.y = y;
108     }
109 
110     /**
111      * Returns the color
112      *
113      * @return the color
114      */
getColor()115     public Color getColor() {
116         return color;
117     }
118 
119     /**
120      * Sets the color
121      *
122      * @param color the color
123      */
setColor(Color color)124     public void setColor(Color color) {
125         this.color = color;
126     }
127 
128     /**
129      * Return the variable space character increment
130      *
131      * @return the variable space character increment
132      */
getVariableSpaceCharacterIncrement()133     public int getVariableSpaceCharacterIncrement() {
134         return variableSpaceCharacterIncrement;
135     }
136 
137     /**
138      * Sets the variable space character increment
139      *
140      * @param variableSpaceCharacterIncrement the variable space character increment
141      */
setVariableSpaceCharacterIncrement( int variableSpaceCharacterIncrement)142     public void setVariableSpaceCharacterIncrement(
143             int variableSpaceCharacterIncrement) {
144         this.variableSpaceCharacterIncrement = variableSpaceCharacterIncrement;
145     }
146 
147     /**
148      * Return the inter character adjustment
149      *
150      * @return the inter character adjustment
151      */
getInterCharacterAdjustment()152     public int getInterCharacterAdjustment() {
153         return interCharacterAdjustment;
154     }
155 
156     /**
157      * Sets the inter character adjustment
158      *
159      * @param interCharacterAdjustment the inter character adjustment
160      */
setInterCharacterAdjustment(int interCharacterAdjustment)161     public void setInterCharacterAdjustment(int interCharacterAdjustment) {
162         this.interCharacterAdjustment = interCharacterAdjustment;
163     }
164 
165     /**
166      * Sets the text orientation
167      *
168      * @param rotation the text rotation
169      */
setRotation(int rotation)170     public void setRotation(int rotation) {
171         this.rotation = rotation;
172     }
173 
174     /**
175      * Returns the text rotation
176      *
177      * @return the text rotation
178      */
getRotation()179     public int getRotation() {
180         return this.rotation;
181     }
182 
183     /**
184      * Sets the text encoding
185      *
186      * @param textEncoding the text encoding
187      */
setEncoding(String textEncoding)188     public void setEncoding(String textEncoding) {
189         this.textEncoding = textEncoding;
190     }
191 
192     /**
193      * Returns the text encoding
194      *
195      * @return the text encoding
196      */
getEncoding()197     public String getEncoding() {
198         return this.textEncoding;
199     }
200 
201     /**
202      * Sets the text string
203      *
204      * @param textString the text string
205      */
setString(String textString)206     public void setString(String textString) {
207         this.textString = textString;
208     }
209 
210     /**
211      * Returns the text string
212      *
213      * @return the text string
214      */
getString()215     public String getString() {
216         return this.textString;
217     }
218 
219     /** {@inheritDoc} */
toString()220     public String toString() {
221         return "TextDataInfo{fontReference=" + fontReference
222         + ", x=" + x
223         + ", y=" + y
224         + ", color=" + color
225         + ", vsci=" + variableSpaceCharacterIncrement
226         + ", ica=" + interCharacterAdjustment
227         + ", orientation=" + rotation
228         + ", textString=" + textString
229         + ", textEncoding=" + textEncoding
230         + "}";
231     }
232 }
233