|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.lowagie.text.pdf.PdfChunk
A PdfChunk is the PDF translation of a Chunk.
A PdfChunk is a PdfString in a certain
PdfFont and Color.
PdfString,
PdfFont,
Chunk,
Font| Field Summary | |
protected HashMap |
attributes
Metric attributes. |
protected BaseFont |
baseFont
|
protected boolean |
changeLeading
Indicates if the height and offset of the Image has to be taken into account |
protected String |
encoding
The encoding. |
protected PdfFont |
font
The font for this PdfChunk. |
protected Image |
image
The image in this PdfChunk, if it has one |
private static float |
ITALIC_ANGLE
|
private static HashMap |
keysAttributes
The allowed attributes in variable attributes. |
private static HashMap |
keysNoStroke
The allowed attributes in variable noStroke. |
protected boolean |
newlineSplit
true if the chunk split was cause by a newline. |
protected HashMap |
noStroke
Non metric attributes. |
protected float |
offsetX
The offset in the x direction for the image |
protected float |
offsetY
The offset in the y direction for the image |
protected SplitCharacter |
splitCharacter
|
protected String |
value
The value of this object. |
| Constructor Summary | |
(package private) |
PdfChunk(Chunk chunk,
PdfAction action)
Constructs a PdfChunk-object. |
(package private) |
PdfChunk(String string,
PdfChunk other)
Constructs a PdfChunk-object. |
| Method Summary | |
boolean |
changeLeading()
|
(package private) Color |
color()
Returns the color of this Chunk. |
(package private) PdfFont |
font()
Returns the font of this Chunk. |
(package private) Object |
getAttribute(String name)
Gets an attribute. |
(package private) float |
getCharWidth(char c)
|
(package private) String |
getEncoding()
Gets the encoding of this string. |
(package private) Image |
getImage()
Gets the image in the PdfChunk. |
(package private) float |
getImageOffsetX()
Gets the image offset in the x direction |
(package private) float |
getImageOffsetY()
Gets the image offset in the y direction |
char |
getUnicodeEquivalent(char c)
|
float |
getWidthCorrected(float charSpacing,
float wordSpacing)
Gets the width of the PdfChunk taking into account the
extra character and word spacing. |
protected int |
getWord(String text,
int start)
|
(package private) boolean |
isAttribute(String name)
Checks if the attribute exists. |
(package private) boolean |
isExtSplitCharacter(char c)
|
(package private) boolean |
isImage()
Checks if there is an image in the PdfChunk. |
boolean |
isNewlineSplit()
Checks if the PdfChunk split was caused by a newline. |
(package private) boolean |
isSpecialEncoding()
Tells you if this string is in Chinese, Japanese, Korean or Identity-H. |
boolean |
isSplitCharacter(char c)
Checks if a character can be used to split a PdfString.
|
(package private) boolean |
isStroked()
Checks if this PdfChunk needs some special metrics handling. |
(package private) int |
length()
|
static boolean |
noPrint(char c)
|
(package private) void |
setImageOffsetX(float offsetX)
Sets the image offset in the x direction |
(package private) void |
setImageOffsetY(float offsetY)
Sets the image offset in the y direction |
(package private) void |
setValue(String value)
sets the value. |
(package private) PdfChunk |
split(float width)
Splits this PdfChunk if it's too long for the given width.
|
String |
toString()
|
(package private) String |
trim(String string)
Removes all the ' ' and '-'-characters on the right of a String.
|
float |
trimLastSpace()
Trims the last space. |
(package private) PdfChunk |
truncate(float width)
Truncates this PdfChunk if it's too long for the given width.
|
(package private) float |
width()
Returns the width of this PdfChunk. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private static final float ITALIC_ANGLE
private static final HashMap keysAttributes
attributes.
private static final HashMap keysNoStroke
noStroke.
protected String value
protected String encoding
protected PdfFont font
PdfChunk.
protected BaseFont baseFont
protected SplitCharacter splitCharacter
protected HashMap attributes
This attributes require the mesurement of characters widths when rendering such as underline.
protected HashMap noStroke
This attributes do not require the mesurement of characters widths when rendering such as Color.
protected boolean newlineSplit
true if the chunk split was cause by a newline.
protected Image image
PdfChunk, if it has one
protected float offsetX
protected float offsetY
protected boolean changeLeading
| Constructor Detail |
PdfChunk(String string,
PdfChunk other)
PdfChunk-object.
string - the content of the PdfChunk-object
PdfChunk(Chunk chunk,
PdfAction action)
PdfChunk-object.
chunk - the original Chunk-objectaction - the PdfAction if the Chunk comes from an Anchor| Method Detail |
public char getUnicodeEquivalent(char c)
protected int getWord(String text,
int start)
PdfChunk split(float width)
PdfChunk if it's too long for the given width.
Returns null if the PdfChunk wasn't truncated.
width - a given width
PdfChunk that doesn't fit into the width.PdfChunk truncate(float width)
PdfChunk if it's too long for the given width.
Returns null if the PdfChunk wasn't truncated.
width - a given width
PdfChunk that doesn't fit into the width.PdfFont font()
Chunk.
PdfFontColor color()
Chunk.
Colorfloat width()
PdfChunk.
public boolean isNewlineSplit()
PdfChunk split was caused by a newline.
true if the PdfChunk split was caused by a newline.
public float getWidthCorrected(float charSpacing,
float wordSpacing)
PdfChunk taking into account the
extra character and word spacing.
charSpacing - the extra character spacingwordSpacing - the extra word spacing
public float trimLastSpace()
Object getAttribute(String name)
attributes
and noStroke.
name - the attribute key
boolean isAttribute(String name)
name - the attribute key
true if the attribute existsboolean isStroked()
PdfChunk needs some special metrics handling.
true if this PdfChunk needs some special metrics handling.boolean isImage()
PdfChunk.
true if an image is presentImage getImage()
PdfChunk.
nullvoid setImageOffsetX(float offsetX)
offsetX - the image offset in the x directionfloat getImageOffsetX()
void setImageOffsetY(float offsetY)
offsetY - the image offset in the y directionfloat getImageOffsetY()
void setValue(String value)
public String toString()
boolean isSpecialEncoding()
String getEncoding()
Stringint length()
public boolean isSplitCharacter(char c)
PdfString.
for the moment every character less than or equal to SPACE and the character '-' are 'splitCharacters'.
isSplitCharacter in interface SplitCharacterc - the character that has to be checked
true if the character can be used to split a string, false otherwiseboolean isExtSplitCharacter(char c)
String trim(String string)
String.
string - the String that has to be trimmed.
- Returns:
- the trimmed
String public boolean changeLeading()
float getCharWidth(char c)
public static boolean noPrint(char c)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||