Package net.atthegate.server.service.pdf
Class CompositeTextLine
java.lang.Object
net.atthegate.server.service.pdf.CompositeTextLine
- All Implemented Interfaces:
Drawable
Used to create composite text line objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addComponent
(TextLine component) Add a new text line.float[]
Draws this line on the specified page.float
Gets the font size.float
Returns the height of this CompositeTextLine.float[]
Returns the vertical coordinates of the top left and bottom right corners of the bounding box of this composite text line.int
Returns the number of text lines.float[]
Return the position of this composite text line.float
Gets the subscript factor for this text line.float
Gets the subscript position for this text line.float
Gets the superscript factor for this text line.float
Gets the superscript position for this text line.getTextLine
(int index) Return the nth entry in the TextLine array.float
getWidth()
Returns the width of this CompositeTextLine.void
setFontSize
(float fontSize) Sets the font size.void
setLocation
(float x, float y) Loop through all the text lines and reset their location based on the new location set here.void
setPosition
(double x, double y) Loop through all the text lines and reset their position based on the new position set here.void
setPosition
(float x, float y) Loop through all the text lines and reset their position based on the new position set here.void
setSubscriptFactor
(float subscript) Sets the subscript factor for this composite text line.void
setSubscriptPosition
(float subscript_position) Sets the subscript position for this composite text line.void
setSuperscriptFactor
(float superscript) Sets the superscript factor for this composite text line.void
setSuperscriptPosition
(float superscript_position) Sets the superscript position for this composite text line.
-
Constructor Details
-
CompositeTextLine
public CompositeTextLine(float x, float y)
-
-
Method Details
-
setFontSize
public void setFontSize(float fontSize) Sets the font size.- Parameters:
fontSize
- the font size.
-
getFontSize
public float getFontSize()Gets the font size.- Returns:
- fontSize the font size.
-
setSuperscriptFactor
public void setSuperscriptFactor(float superscript) Sets the superscript factor for this composite text line.- Parameters:
superscript
- the superscript size factor.
-
getSuperscriptFactor
public float getSuperscriptFactor()Gets the superscript factor for this text line.- Returns:
- superscript the superscript size factor.
-
setSubscriptFactor
public void setSubscriptFactor(float subscript) Sets the subscript factor for this composite text line.- Parameters:
subscript
- the subscript size factor.
-
getSubscriptFactor
public float getSubscriptFactor()Gets the subscript factor for this text line.- Returns:
- subscript the subscript size factor.
-
setSuperscriptPosition
public void setSuperscriptPosition(float superscript_position) Sets the superscript position for this composite text line.- Parameters:
superscript_position
- the superscript position.
-
getSuperscriptPosition
public float getSuperscriptPosition()Gets the superscript position for this text line.- Returns:
- superscript_position the superscript position.
-
setSubscriptPosition
public void setSubscriptPosition(float subscript_position) Sets the subscript position for this composite text line.- Parameters:
subscript_position
- the subscript position.
-
getSubscriptPosition
public float getSubscriptPosition()Gets the subscript position for this text line.- Returns:
- subscript_position the subscript position.
-
addComponent
Add a new text line. Find the current font, current size and effects (normal, super or subscript) Set the position of the component to the starting stored as current position Set the size and offset based on effects Set the new current position- Parameters:
component
- the component.
-
setPosition
public void setPosition(double x, double y) Loop through all the text lines and reset their position based on the new position set here.- Parameters:
x
- the x coordinate.y
- the y coordinate.
-
setPosition
public void setPosition(float x, float y) Loop through all the text lines and reset their position based on the new position set here.- Parameters:
x
- the x coordinate.y
- the y coordinate.
-
setLocation
public void setLocation(float x, float y) Loop through all the text lines and reset their location based on the new location set here.- Parameters:
x
- the x coordinate.y
- the y coordinate.
-
getPosition
public float[] getPosition()Return the position of this composite text line.- Returns:
- the position of this composite text line.
-
getTextLine
Return the nth entry in the TextLine array.- Parameters:
index
- the index of the nth element.- Returns:
- the text line at the specified index.
-
getNumberOfTextLines
public int getNumberOfTextLines()Returns the number of text lines.- Returns:
- the number of text lines.
-
getMinMax
public float[] getMinMax()Returns the vertical coordinates of the top left and bottom right corners of the bounding box of this composite text line.- Returns:
- the an array containing the vertical coordinates.
-
getHeight
public float getHeight()Returns the height of this CompositeTextLine.- Returns:
- the height.
-
getWidth
public float getWidth()Returns the width of this CompositeTextLine.- Returns:
- the width.
-
drawOn
Draws this line on the specified page.
-