com.pdfjet
Class CompositeTextLine

java.lang.Object
  extended by com.pdfjet.CompositeTextLine
All Implemented Interfaces:
Drawable

public class CompositeTextLine
extends java.lang.Object
implements Drawable

Used to create composite text line objects.


Constructor Summary
CompositeTextLine(float x, float y)
           
 
Method Summary
 void addComponent(TextLine component)
          Add a new text line.
 float[] drawOn(Page page)
          Draws this line on the specified page.
 float getFontSize()
          Gets the font size.
 float getHeight()
          Returns the height of this CompositeTextLine.
 float[] getMinMax()
          Returns the vertical coordinates of the top left and bottom right corners of the bounding box of this composite text line.
 int getNumberOfTextLines()
          Returns the number of text lines.
 float[] getPosition()
          Return the position of this composite text line.
 float getSubscriptFactor()
          Gets the subscript factor for this text line.
 float getSubscriptPosition()
          Gets the subscript position for this text line.
 float getSuperscriptFactor()
          Gets the superscript factor for this text line.
 float getSuperscriptPosition()
          Gets the superscript position for this text line.
 TextLine 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeTextLine

public CompositeTextLine(float x,
                         float y)
Method Detail

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

public void addComponent(TextLine component)
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

public TextLine getTextLine(int index)
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

public float[] drawOn(Page page)
               throws java.lang.Exception
Draws this line on the specified page.

Specified by:
drawOn in interface Drawable
Parameters:
page - the page to draw this line on.
Returns:
x and y coordinates of the bottom right corner of this component.
Throws:
java.lang.Exception