Package com.reportmill.text
Class RMTextFrag
- java.lang.Object
- 
- com.reportmill.base.RMObject
- 
- com.reportmill.text.RMTextFrag
 
 
- 
- All Implemented Interfaces:
- RMArchiver.Archiving,- java.lang.Cloneable
 
 public class RMTextFrag extends RMObject This class represents a group of characters in a text line that all share the same text attributes and are simply spaced apart by their char widths.
- 
- 
Constructor SummaryConstructors Constructor Description RMTextFrag(RMTextLine aLine)Creates an empty text frag for a given layout and line.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description charcharAt(int anIndex)Returns an individual char at the given index.char[]chars()Returns the original layout char array.intgetCharForX(float xOrigin)Returns the character for the given x position.floatgetCharSpacing()Returns the frag's char spacing.RMColorgetColor()Returns the color for this frag.intgetEnd()Returns the end char index for this frag.RMFontgetFont()Returns the font for this frag.floatgetHeight()Returns the height for this frag.booleangetHyphenated()Returns whether this frag has a hyphen at the end.RMTextLayoutgetLayout()Returns the layout for this frag.RMTextLinegetLine()Returns the line for this frag.floatgetMaxX()Returns the maxX position for this frag (in the same coords as the layout frame).RMXString.OutlinegetOutline()Returns whether the frag should be outline.intgetStart()Returns the start char index for this frag.floatgetTab()Returns the tab location if this frag is a tab.chargetTabType()Returns tab type if this frag is a tab.floatgetUnderlineStroke()Returns the stroke width for the underline.floatgetUnderlineY()Returns the Y position for the underline.floatgetWidth()Returns the width for this frag.floatgetX()Returns the x position for this frag (in the same coords as the layout frame).floatgetXForChar(int charpos)Returns the x position of the given character index.floatgetY()Returns the minY position for this frag (in the same coords as the layout frame).floatgetYBaseline()Returns the y position for this frag (in the same coords as the layout frame).java.awt.font.GlyphVectorglyphVector(java.awt.Graphics2D g)Returns the glyph vector for the frag.booleanisColorChanged()Returns whether the color for this frag has changed from the last one.booleanisFontChanged()Returns whether the font for this frag has changed from the last one.booleanisTab()Returns whether frag is just a tab.booleanisUnderlined()Returns whether the frag is underlined.intlength()Returns the number of chars in this frag.voidsetHyphenated(boolean aFlag)Sets whether this frag has a hyphen at the end.voidstrip(int start)Strips characters after the given index from the frag.java.lang.StringtoString()Returns the frag chars as a string.- 
Methods inherited from class com.reportmill.base.RMObjectclone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
 
- 
 
- 
- 
- 
Constructor Detail- 
RMTextFragpublic RMTextFrag(RMTextLine aLine) Creates an empty text frag for a given layout and line.
 
- 
 - 
Method Detail- 
getLayoutpublic RMTextLayout getLayout() Returns the layout for this frag.
 - 
getLinepublic RMTextLine getLine() Returns the line for this frag.
 - 
charspublic char[] chars() Returns the original layout char array.
 - 
charAtpublic char charAt(int anIndex) Returns an individual char at the given index.
 - 
getStartpublic int getStart() Returns the start char index for this frag.
 - 
getEndpublic int getEnd() Returns the end char index for this frag.
 - 
lengthpublic int length() Returns the number of chars in this frag.
 - 
getXpublic float getX() Returns the x position for this frag (in the same coords as the layout frame).
 - 
getYpublic float getY() Returns the minY position for this frag (in the same coords as the layout frame).
 - 
getYBaselinepublic float getYBaseline() Returns the y position for this frag (in the same coords as the layout frame).
 - 
getWidthpublic float getWidth() Returns the width for this frag.
 - 
getHeightpublic float getHeight() Returns the height for this frag.
 - 
getMaxXpublic float getMaxX() Returns the maxX position for this frag (in the same coords as the layout frame).
 - 
getFontpublic RMFont getFont() Returns the font for this frag.
 - 
getColorpublic RMColor getColor() Returns the color for this frag.
 - 
isFontChangedpublic boolean isFontChanged() Returns whether the font for this frag has changed from the last one.
 - 
isColorChangedpublic boolean isColorChanged() Returns whether the color for this frag has changed from the last one.
 - 
isUnderlinedpublic boolean isUnderlined() Returns whether the frag is underlined.
 - 
getUnderlineStrokepublic float getUnderlineStroke() Returns the stroke width for the underline.
 - 
getUnderlineYpublic float getUnderlineY() Returns the Y position for the underline.
 - 
getOutlinepublic RMXString.Outline getOutline() Returns whether the frag should be outline.
 - 
getCharSpacingpublic float getCharSpacing() Returns the frag's char spacing.
 - 
getHyphenatedpublic boolean getHyphenated() Returns whether this frag has a hyphen at the end.
 - 
setHyphenatedpublic void setHyphenated(boolean aFlag) Sets whether this frag has a hyphen at the end.
 - 
strippublic void strip(int start) Strips characters after the given index from the frag.
 - 
getXForCharpublic float getXForChar(int charpos) Returns the x position of the given character index.
 - 
getCharForXpublic int getCharForX(float xOrigin) Returns the character for the given x position.
 - 
isTabpublic boolean isTab() Returns whether frag is just a tab.
 - 
getTabpublic float getTab() Returns the tab location if this frag is a tab.
 - 
getTabTypepublic char getTabType() Returns tab type if this frag is a tab.
 - 
glyphVectorpublic java.awt.font.GlyphVector glyphVector(java.awt.Graphics2D g) Returns the glyph vector for the frag.
 - 
toStringpublic java.lang.String toString() Returns the frag chars as a string.- Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-