Package snap.text

Class TextLineStyle

java.lang.Object
snap.text.TextLineStyle
All Implemented Interfaces:
Cloneable, XMLArchiver.Archivable

public class TextLineStyle extends Object implements Cloneable, XMLArchiver.Archivable
A class to represent a line of text (for each newline) in RichText.
  • Field Details

  • Constructor Details

    • TextLineStyle

      public TextLineStyle()
      Constructor.
  • Method Details

    • getAlign

      public HPos getAlign()
      Returns the alignment associated with this paragraph.
    • isJustify

      public boolean isJustify()
      Returns whether text in line should be justified.
    • getFirstIndent

      public double getFirstIndent()
      Returns the indentation of first line in paragraph (this can be set different than successive lines).
    • getLeftIndent

      public double getLeftIndent()
      Returns the left side indentation of this paragraph.
    • getRightIndent

      public double getRightIndent()
      Returns the right side indentation of this paragraph.
    • getSpacing

      public double getSpacing()
      Returns the spacing between lines expressed as a constant amount in points.
    • getSpacingFactor

      public double getSpacingFactor()
      Returns the spacing of lines expressed as a factor of a given line's height.
    • getNewlineSpacing

      public double getNewlineSpacing()
      Returns the spacing between paragraphs in printer points associated with this paragraph.
    • getMinHeight

      public double getMinHeight()
      Returns the minimum line height in printer points associated with this paragraph.
    • getMaxHeight

      public double getMaxHeight()
      Returns the maximum line height in printer points associated with this paragraph.
    • getTabCount

      public int getTabCount()
      Returns the number of tabs associated with this paragraph.
    • getTab

      public double getTab(int anIndex)
      Returns the specific tab value for the given index in printer points.
    • getTabType

      public char getTabType(int anIndex)
      Returns the type of tab at the given index.
    • getTabs

      public double[] getTabs()
      Returns the raw tab array
    • getTabTypes

      public char[] getTabTypes()
      Returns the raw tab type array
    • getXForTabForX

      public double getXForTabForX(double aX)
      Returns the tab location for given location.
    • getTabIndexForX

      public int getTabIndexForX(double aX)
      Returns the tab index for the given location.
    • getTabsString

      public String getTabsString()
      Returns the values of all the tabs associated with this paragraph as a comma separated string.
    • setTabsString

      protected void setTabsString(String aString)
      Sets the value of tabs from the given tabs string.
    • copyFor

      public TextLineStyle copyFor(Object anObj)
      Returns a clone with the new given value.
    • copyFor

      public TextLineStyle copyFor(String aKey, Object aValue)
      Returns a clone with the new given value.
    • copyForIndents

      public TextLineStyle copyForIndents(double firstIndent, double leftIndent, double rightIndent)
      Returns a paragraph identical to the receiver, but with the given indentation values.
    • setValue

      protected void setValue(String aKey, Object aValue)
      Sets a value for given key.
    • clone

      public TextLineStyle clone()
      Standard clone implementation.
      Overrides:
      clone in class Object
    • equals

      public boolean equals(Object anObj)
      Standard equals implementation.
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class Object
    • toXML

      public XMLElement toXML(XMLArchiver anArchiver)
      XML archival.
      Specified by:
      toXML in interface XMLArchiver.Archivable
    • fromXML

      public TextLineStyle fromXML(XMLArchiver anArchiver, XMLElement anElement)
      XML unarchival.
      Specified by:
      fromXML in interface XMLArchiver.Archivable