Package com.reportmill.text
Class RMTextLine
- java.lang.Object
- 
- com.reportmill.base.RMObject
- 
- com.reportmill.text.RMTextLine
 
 
- 
- All Implemented Interfaces:
- RMArchiver.Archiving,- java.lang.Cloneable
 
 public class RMTextLine extends RMObject This class represents a line of characters in a text layout. It is made up of frags.
- 
- 
Constructor SummaryConstructors Constructor Description RMTextLine(RMTextLayout aLayout, RMTextLine aLastLine)Creates an empty line object for a given layout.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description RMTextFragaddFrag()Adds an empty frag to the line.char[]chars()Returns a char array of the chars in the line.voidfragAddEnd()Called after we added frags.voidfragAddStart()Called before we start adding frags.intgetCharForX(float x)Returns the character index of the character at the given x position.intgetEnd()Returns the end character index of the line.booleangetEndsWithNewline()Returns whether line ends with newline.RMTextFraggetFrag(int anIndex)Returns the text frag at the given index.intgetFragCount()Returns the number of frags in this line.RMTextFraggetFragLast()Returns the last text frag of this line.floatgetHeight()Returns the max height of the chars in this line.floatgetHeight(boolean includeGap)Returns the max height of the chars in this line.floatgetHitMaxX()Returns the max x position possible for layout's path.floatgetIndent()Returns the indent for this line.intgetLastWordStart()Returns the index of the last word break character in the line.RMTextLayoutgetLayout()Returns the layout that this line is associated with.floatgetLeading()Returns the max leading of the chars in this line.floatgetMaxAscent()Returns the max ascent of the chars in this line.floatgetMaxDescent()Returns the max descent of the chars in this line.floatgetMaxX()Returns the maxX position for this line (in same coords as the layout frame).floatgetMaxY()Returns the maxY position for this line (in same coords as the layout frame).floatgetMaxY(boolean includeGap)Returns the maxY position for this line (in same coords as the layout frame).floatgetNextLineX()Returns what this line thinks is the next line's x.intgetStart()Returns the start character index of the line.floatgetUnderlineStroke()Returns the max stroke width of any underlined chars in this line.floatgetUnderlineY()Returns the Y position of any underlined chars in this line.floatgetWidth()Returns the width of this line of chars.floatgetX()Returns the x position for this line (in same coords as the layout frame).floatgetY()Returns the maxY position for this line (in same coords as the layout frame).floatgetYBaseline()Returns the y position for this line (in same coords as the layout frame).booleanhasTab()Returns whether line has a tab.booleanisEmpty()Returns whether line has nothing in it.voidlineAddEnd()voidperformTabShift()If line has any non-left tabs this method adjusts the width of the tab frags (and the positions of successive frags to correct for shift of these tabs).voidreset()Resets the line ivars (so that it can be reused).voidstrip(int start)Strips all characters after the given index from this line.java.lang.StringtoString()Returns the line as a string.- 
Methods inherited from class com.reportmill.base.RMObjectclone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
 
- 
 
- 
- 
- 
Constructor Detail- 
RMTextLinepublic RMTextLine(RMTextLayout aLayout, RMTextLine aLastLine) Creates an empty line object for a given layout.
 
- 
 - 
Method Detail- 
getLayoutpublic RMTextLayout getLayout() Returns the layout that this line is associated with.
 - 
getStartpublic int getStart() Returns the start character index of the line.
 - 
getEndpublic int getEnd() Returns the end character index of the line.
 - 
isEmptypublic boolean isEmpty() Returns whether line has nothing in it.
 - 
getXpublic float getX() Returns the x position for this line (in same coords as the layout frame).
 - 
getYpublic float getY() Returns the maxY position for this line (in same coords as the layout frame).
 - 
getWidthpublic float getWidth() Returns the width of this line of chars.
 - 
getHeightpublic float getHeight() Returns the max height of the chars in this line.
 - 
getHeightpublic float getHeight(boolean includeGap) Returns the max height of the chars in this line.
 - 
getYBaselinepublic float getYBaseline() Returns the y position for this line (in same coords as the layout frame).
 - 
getMaxXpublic float getMaxX() Returns the maxX position for this line (in same coords as the layout frame).
 - 
getMaxYpublic float getMaxY() Returns the maxY position for this line (in same coords as the layout frame).
 - 
getMaxYpublic float getMaxY(boolean includeGap) Returns the maxY position for this line (in same coords as the layout frame).
 - 
getHitMaxXpublic float getHitMaxX() Returns the max x position possible for layout's path.
 - 
getNextLineXpublic float getNextLineX() Returns what this line thinks is the next line's x.
 - 
getMaxAscentpublic float getMaxAscent() Returns the max ascent of the chars in this line.
 - 
getMaxDescentpublic float getMaxDescent() Returns the max descent of the chars in this line.
 - 
getLeadingpublic float getLeading() Returns the max leading of the chars in this line.
 - 
getIndentpublic float getIndent() Returns the indent for this line.
 - 
getUnderlineStrokepublic float getUnderlineStroke() Returns the max stroke width of any underlined chars in this line.
 - 
getUnderlineYpublic float getUnderlineY() Returns the Y position of any underlined chars in this line.
 - 
getLastWordStartpublic int getLastWordStart() Returns the index of the last word break character in the line.
 - 
strippublic void strip(int start) Strips all characters after the given index from this line.
 - 
getCharForXpublic int getCharForX(float x) Returns the character index of the character at the given x position.
 - 
getFragCountpublic int getFragCount() Returns the number of frags in this line.
 - 
getFragpublic RMTextFrag getFrag(int anIndex) Returns the text frag at the given index.
 - 
getFragLastpublic RMTextFrag getFragLast() Returns the last text frag of this line.
 - 
addFragpublic RMTextFrag addFrag() Adds an empty frag to the line.
 - 
getEndsWithNewlinepublic boolean getEndsWithNewline() Returns whether line ends with newline.
 - 
hasTabpublic boolean hasTab() Returns whether line has a tab.
 - 
performTabShiftpublic void performTabShift() If line has any non-left tabs this method adjusts the width of the tab frags (and the positions of successive frags to correct for shift of these tabs).
 - 
fragAddStartpublic void fragAddStart() Called before we start adding frags.
 - 
fragAddEndpublic void fragAddEnd() Called after we added frags.
 - 
lineAddEndpublic void lineAddEnd() 
 - 
resetpublic void reset() Resets the line ivars (so that it can be reused).
 - 
charspublic char[] chars() Returns a char array of the chars in the line.
 - 
toStringpublic java.lang.String toString() Returns the line as a string.- Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-