Package net.atthegate.server.service.pdf
Class TextLine
java.lang.Object
net.atthegate.server.service.pdf.TextLine
- All Implemented Interfaces:
Drawable
Used to create text line objects.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat[]
Draws this text line on the specified page.protected float[]
Draws this text line on the specified page if the draw parameter is true.int
getColor()
Returns the text line color.float
Returns the y coordinate of the destination.Returns the fallback font.getFont()
Gets the font to use for this text line.Returns the GoTo action string.float
Returns the height of this TextLine.boolean
Returns the strikeout flag.getText()
Returns the text.int
Returns the text direction.int
Returns the text effect.boolean
Returns the trailing space.boolean
Returns the underline flag.Returns the action URI.float
Returns the vertical text offset.float
getWidth()
Returns the width of this TextLine.float
getY()
Returns the y coordinate of the destination.Places this text line in the specified box.Places this text line in the box at the specified offset.Places this text line in the box at the specified offset.setActualText
(String actualText) Sets the actual text for this text line.setAltDescription
(String altDescription) Sets the alternate description of this text line.setColor
(int color) Sets the color for this text line.setColor
(int[] color) Sets the pen color.setFallbackFont
(Font fallbackFont) Sets the fallback font.setFallbackFontSize
(float fallbackFontSize) Sets the fallback font size to use for this text line.Sets the font to use for this text line.setFontSize
(float fontSize) Sets the font size to use for this text line.setGoToAction
(String key) Sets the destination key for the action.setLanguage
(String language) setLocation
(float x, float y) Sets the location where this text line will be drawn on the page.setPosition
(double x, double y) Sets the position where this text line will be drawn on the page.setPosition
(float x, float y) Sets the position where this text line will be drawn on the page.setStrikeout
(boolean strikeout) Sets the strike variable.Sets the text.setTextDirection
(int degrees) Sets the direction in which to draw the text.setTextEffect
(int textEffect) Sets the text effect.setTrailingSpace
(boolean trailingSpace) Sets the trailing space after this text line when used in paragraph.setUnderline
(boolean underline) Sets the underline variable.setURIAction
(String uri) Sets the URI for the "click text line" action.setURIActualText
(String uriActualText) setURIAltDescription
(String uriAltDescription) setURILanguage
(String uriLanguage) setVerticalOffset
(float verticalOffset) Sets the vertical offset of the text.
-
Field Details
-
x
protected float x -
y
protected float y -
font
-
fallbackFont
-
str
-
trailingSpace
protected boolean trailingSpace
-
-
Constructor Details
-
TextLine
Constructor for creating text line objects.- Parameters:
font
- the font to use.
-
TextLine
Constructor for creating text line objects.- Parameters:
font
- the font to use.text
- the text.
-
-
Method Details
-
setText
Sets the text.- Parameters:
text
- the text.- Returns:
- this TextLine.
-
getText
Returns the text.- Returns:
- the text.
-
setPosition
Sets the position where this text line will be drawn on the page.- Parameters:
x
- the x coordinate of the text line.y
- the y coordinate of the text line.- Returns:
- this TextLine.
-
setPosition
Sets the position where this text line will be drawn on the page.- Parameters:
x
- the x coordinate of the text line.y
- the y coordinate of the text line.- Returns:
- this TextLine.
-
setLocation
Sets the location where this text line will be drawn on the page.- Parameters:
x
- the x coordinate of the text line.y
- the y coordinate of the text line.- Returns:
- this TextLine.
-
setFont
Sets the font to use for this text line.- Parameters:
font
- the font to use.- Returns:
- this TextLine.
-
getFont
Gets the font to use for this text line.- Returns:
- font the font to use.
-
setFontSize
Sets the font size to use for this text line.- Parameters:
fontSize
- the fontSize to use.- Returns:
- this TextLine.
-
setFallbackFont
Sets the fallback font.- Parameters:
fallbackFont
- the fallback font.- Returns:
- this TextLine.
-
setFallbackFontSize
Sets the fallback font size to use for this text line.- Parameters:
fallbackFontSize
- the fallback font size.- Returns:
- this TextLine.
-
getFallbackFont
Returns the fallback font.- Returns:
- the fallback font.
-
setColor
Sets the color for this text line.- Parameters:
color
- the color is specified as an integer.- Returns:
- this TextLine.
-
setColor
Sets the pen color.- Parameters:
color
- the color. See the Color class for predefined values or define your own using 0x00RRGGBB packed integers.- Returns:
- this TextLine.
-
getColor
public int getColor()Returns the text line color.- Returns:
- the text line color.
-
getDestinationY
public float getDestinationY()Returns the y coordinate of the destination.- Returns:
- the y coordinate of the destination.
-
getY
public float getY()Returns the y coordinate of the destination.- Returns:
- the y coordinate of the destination.
-
getWidth
public float getWidth()Returns the width of this TextLine.- Returns:
- the width.
-
getHeight
public float getHeight()Returns the height of this TextLine.- Returns:
- the height.
-
setURIAction
Sets the URI for the "click text line" action.- Parameters:
uri
- the URI- Returns:
- this TextLine.
-
getURIAction
Returns the action URI.- Returns:
- the action URI.
-
setGoToAction
Sets the destination key for the action.- Parameters:
key
- the destination name.- Returns:
- this TextLine.
-
getGoToAction
Returns the GoTo action string.- Returns:
- the GoTo action string.
-
setUnderline
Sets the underline variable. If the value of the underline variable is 'true' - the text is underlined.- Parameters:
underline
- the underline flag.- Returns:
- this TextLine.
-
getUnderline
public boolean getUnderline()Returns the underline flag.- Returns:
- the underline flag.
-
setStrikeout
Sets the strike variable. If the value of the strike variable is 'true' - a strike line is drawn through the text.- Parameters:
strikeout
- the strikeout flag.- Returns:
- this TextLine.
-
getStrikeout
public boolean getStrikeout()Returns the strikeout flag.- Returns:
- the strikeout flag.
-
setTextDirection
Sets the direction in which to draw the text.- Parameters:
degrees
- the number of degrees.- Returns:
- this TextLine.
-
getTextDirection
public int getTextDirection()Returns the text direction.- Returns:
- the text direction.
-
setTextEffect
Sets the text effect.- Parameters:
textEffect
- Effect.NORMAL, Effect.SUBSCRIPT or Effect.SUPERSCRIPT.- Returns:
- this TextLine.
-
getTextEffect
public int getTextEffect()Returns the text effect.- Returns:
- the text effect.
-
setVerticalOffset
Sets the vertical offset of the text.- Parameters:
verticalOffset
- the vertical offset.- Returns:
- this TextLine.
-
getVerticalOffset
public float getVerticalOffset()Returns the vertical text offset.- Returns:
- the vertical text offset.
-
setTrailingSpace
Sets the trailing space after this text line when used in paragraph.- Parameters:
trailingSpace
- the trailing space.- Returns:
- this TextLine.
-
getTrailingSpace
public boolean getTrailingSpace()Returns the trailing space.- Returns:
- the trailing space.
-
setLanguage
-
getLanguage
-
setAltDescription
Sets the alternate description of this text line.- Parameters:
altDescription
- the alternate description of the text line.- Returns:
- this TextLine.
-
getAltDescription
-
setActualText
Sets the actual text for this text line.- Parameters:
actualText
- the actual text for the text line.- Returns:
- this TextLine.
-
getActualText
-
setURILanguage
-
setURIAltDescription
-
setURIActualText
-
placeIn
Places this text line in the specified box.- Parameters:
box
- the specified box.- Returns:
- this TextLine.
- Throws:
Exception
-
placeIn
Places this text line in the box at the specified offset.- Parameters:
box
- the specified box.x_offset
- the x offset from the top left corner of the box.y_offset
- the y offset from the top left corner of the box.- Returns:
- this TextLine.
- Throws:
Exception
-
placeIn
Places this text line in the box at the specified offset.- Parameters:
box
- the specified box.x_offset
- the x offset from the top left corner of the box.y_offset
- the y offset from the top left corner of the box.- Returns:
- this TextLine.
- Throws:
Exception
-
drawOn
Draws this text line on the specified page. -
drawOn
Draws this text line on the specified page if the draw parameter is true.- Parameters:
page
- the page to draw this text line on.draw
- if draw is false - no action is performed.- Throws:
Exception
-