2
* JasperReports - Free Java Reporting Library.
3
* Copyright (C) 2001 - 2009 Jaspersoft Corporation. All rights reserved.
4
* http://www.jaspersoft.com
6
* Unless you have purchased a commercial license agreement from Jaspersoft,
7
* the following license terms apply:
9
* This program is part of JasperReports.
11
* JasperReports is free software: you can redistribute it and/or modify
12
* it under the terms of the GNU Lesser General Public License as published by
13
* the Free Software Foundation, either version 3 of the License, or
14
* (at your option) any later version.
16
* JasperReports is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Lesser General Public License for more details.
21
* You should have received a copy of the GNU Lesser General Public License
22
* along with JasperReports. If not, see <http://www.gnu.org/licenses/>.
24
package net.sf.jasperreports.engine;
26
import net.sf.jasperreports.engine.type.LineSpacingEnum;
27
import net.sf.jasperreports.engine.type.RotationEnum;
28
import net.sf.jasperreports.engine.util.JRProperties;
32
* An abstract representation of a report text element. It provides basic functionality for static texts and text fields.
34
* @author Teodor Danciu (teodord@users.sourceforge.net)
35
* @version $Id: JRTextElement.java 3585 2010-03-12 12:58:24Z shertage $
37
public interface JRTextElement extends JRElement, JRAlignment, JRBox, JRFont, JRCommonText
41
* Property used to determine whether the fill process must preserve the original text
42
* for text elements that are not able to fit their entire contents.
45
* When this property is set, the engine saves the original text in the
46
* {@link JRPrintText print text object} along with the index at which the
47
* text is to be truncated by the print object.
51
* This property can be set at the following levels (listed in the order of precedence):
53
* <li>at {@link JRTextElement text element} level</li>
54
* <li>at {@link JRReport report} level</li>
55
* <li>globally in jasperreports.properties or via {@link JRProperties}</li>
59
* @see JRPrintText#getFullText()
60
* @see JRPrintText#getText()
61
* @see JRPrintText#getTextTruncateIndex()
63
public static final String PROPERTY_PRINT_KEEP_FULL_TEXT = JRProperties.PROPERTY_PREFIX + "print.keep.full.text";
66
* Boolean property that determines whether text elements are to be truncated
67
* at the last character that fits.
70
* By default, when the entire text of a text element does not fit the element's area,
71
* the text is truncated at the last word that fits the area.
72
* This property can instruct the engine to truncate the text at the last character
77
* The property can be set at the same levels as {@link #PROPERTY_PRINT_KEEP_FULL_TEXT}.
80
public static final String PROPERTY_TRUNCATE_AT_CHAR = JRProperties.PROPERTY_PREFIX + "text.truncate.at.char";
83
* Property whose value is used as a suffix for the truncated text.
86
* The suffix is appended to the text when truncation occurs.
87
* If the property is not defined or empty (which is the case by default),
88
* no suffix will be used when the text is truncated.
92
* The property can be set at the same levels as {@link #PROPERTY_PRINT_KEEP_FULL_TEXT}.
95
public static final String PROPERTY_TRUNCATE_SUFFIX = JRProperties.PROPERTY_PREFIX + "text.truncate.suffix";
98
* Boolean property that determines whether the positions where text line
99
* break occurs are to be saved during report fill in oder to be used at
103
* At report fill time, each text element is measured in order to determine
104
* how long it needs to stretch or where it needs to be truncated.
105
* During this measurement, the text wraps at certain positions in order to
106
* fit the text element defined width.
109
* Setting this property to true instructs the engine to save the positions
110
* at which line breaks occur in the generated print element.
111
* The positions can be used by report exporters that want to enforce line
112
* breaks to occur at exactly the same position as they did during text
113
* measurement at fill time.
116
* Currently, the HTML exporter will make use of the saved line break
117
* positions by introducing explicit line breaks.
120
* The property can be set globally, at report level or at text element level.
122
* @see JRPrintText#getLineBreakOffsets()
124
public static final String PROPERTY_SAVE_LINE_BREAKS = JRProperties.PROPERTY_PREFIX
125
+ "text.save.line.breaks";
128
* @deprecated Replaced by {@link JRAlignment#HORIZONTAL_ALIGN_LEFT}.
130
public static final byte TEXT_ALIGN_LEFT = HORIZONTAL_ALIGN_LEFT;
132
* @deprecated Replaced by {@link JRAlignment#HORIZONTAL_ALIGN_CENTER}.
134
public static final byte TEXT_ALIGN_CENTER = HORIZONTAL_ALIGN_CENTER;
136
* @deprecated Replaced by {@link JRAlignment#HORIZONTAL_ALIGN_RIGHT}.
138
public static final byte TEXT_ALIGN_RIGHT = HORIZONTAL_ALIGN_RIGHT;
140
* @deprecated Replaced by {@link JRAlignment#HORIZONTAL_ALIGN_JUSTIFIED}.
142
public static final byte TEXT_ALIGN_JUSTIFIED = HORIZONTAL_ALIGN_JUSTIFIED;
145
* @deprecated Replaced by {@link RotationEnum#NONE}.
147
public static final byte ROTATION_NONE = 0;
150
* @deprecated Replaced by {@link RotationEnum#LEFT}.
152
public static final byte ROTATION_LEFT = 1;
155
* @deprecated Replaced by {@link RotationEnum#RIGHT}.
157
public static final byte ROTATION_RIGHT = 2;
160
* @deprecated Replaced by {@link RotationEnum#UPSIDE_DOWN}.
162
public static final byte ROTATION_UPSIDE_DOWN = 3;
165
* @deprecated Replaced by {@link LineSpacingEnum#SINGLE}.
167
public static final byte LINE_SPACING_SINGLE = 0;
170
* @deprecated Replaced by {@link LineSpacingEnum#ONE_AND_HALF}.
172
public static final byte LINE_SPACING_1_1_2 = 1;
175
* @deprecated Replaced by {@link LineSpacingEnum#DOUBLE}.
177
public static final byte LINE_SPACING_DOUBLE = 2;
181
* Gets the text horizontal alignment.
182
* @return a value representing one of the horizontal alignment constants in {@link JRAlignment}
183
* @deprecated Replaced by {@link #getHorizontalAlignment()}.
185
public byte getTextAlignment();
188
* Sets the text horizontal alignment.
189
* @param horizontalAlignment a value representing one of the horizontal alignment constants in {@link JRAlignment}
190
* @deprecated Replaced by {@link #setHorizontalAlignment(byte)}.
192
public void setTextAlignment(byte horizontalAlignment);
195
* Specifies whether the text can contain style tags.
196
* @deprecated Replaced by {@link #setMarkup(String)}.
198
public void setStyledText(boolean isStyledText);
201
* @deprecated Replaced by {@link #setMarkup(String)}.
203
public void setStyledText(Boolean isStyledText);
206
* Returns an object containing all border and padding properties for this text element
207
* @deprecated Replaced by {@link JRBoxContainer#getLineBox()}
209
public JRBox getBox();
212
* Returns an object containing all font properties for this text element
215
public JRFont getFont();