Class RMTextFrag

java.lang.Object
com.reportmill.base.RMObject
com.reportmill.text.RMTextFrag
All Implemented Interfaces:
RMArchiver.Archiving, 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 Details

    • RMTextFrag

      public RMTextFrag(RMTextLine aLine)
      Creates an empty text frag for a given layout and line.
  • Method Details

    • getLayout

      public RMTextLayout getLayout()
      Returns the layout for this frag.
    • getLine

      public RMTextLine getLine()
      Returns the line for this frag.
    • chars

      public char[] chars()
      Returns the original layout char array.
    • charAt

      public char charAt(int anIndex)
      Returns an individual char at the given index.
    • getStart

      public int getStart()
      Returns the start char index for this frag.
    • getEnd

      public int getEnd()
      Returns the end char index for this frag.
    • length

      public int length()
      Returns the number of chars in this frag.
    • getX

      public float getX()
      Returns the x position for this frag (in the same coords as the layout frame).
    • getY

      public float getY()
      Returns the minY position for this frag (in the same coords as the layout frame).
    • getYBaseline

      public float getYBaseline()
      Returns the y position for this frag (in the same coords as the layout frame).
    • getWidth

      public float getWidth()
      Returns the width for this frag.
    • getHeight

      public float getHeight()
      Returns the height for this frag.
    • getMaxX

      public float getMaxX()
      Returns the maxX position for this frag (in the same coords as the layout frame).
    • getFont

      public RMFont getFont()
      Returns the font for this frag.
    • getColor

      public RMColor getColor()
      Returns the color for this frag.
    • isFontChanged

      public boolean isFontChanged()
      Returns whether the font for this frag has changed from the last one.
    • isColorChanged

      public boolean isColorChanged()
      Returns whether the color for this frag has changed from the last one.
    • isUnderlined

      public boolean isUnderlined()
      Returns whether the frag is underlined.
    • getUnderlineStroke

      public float getUnderlineStroke()
      Returns the stroke width for the underline.
    • getUnderlineY

      public float getUnderlineY()
      Returns the Y position for the underline.
    • getOutline

      public RMXString.Outline getOutline()
      Returns whether the frag should be outline.
    • getCharSpacing

      public float getCharSpacing()
      Returns the frag's char spacing.
    • getHyphenated

      public boolean getHyphenated()
      Returns whether this frag has a hyphen at the end.
    • setHyphenated

      public void setHyphenated(boolean aFlag)
      Sets whether this frag has a hyphen at the end.
    • strip

      public void strip(int start)
      Strips characters after the given index from the frag.
    • getXForChar

      public float getXForChar(int charpos)
      Returns the x position of the given character index.
    • getCharForX

      public int getCharForX(float xOrigin)
      Returns the character for the given x position.
    • isTab

      public boolean isTab()
      Returns whether frag is just a tab.
    • getTab

      public float getTab()
      Returns the tab location if this frag is a tab.
    • getTabType

      public char getTabType()
      Returns tab type if this frag is a tab.
    • glyphVector

      public GlyphVector glyphVector(Graphics2D g)
      Returns the glyph vector for the frag.
    • toString

      public String toString()
      Returns the frag chars as a string.
      Overrides:
      toString in class Object