Package snap.text

Class TextLineStyle

java.lang.Object
snap.props.PropObject
snap.text.TextLineStyle
All Implemented Interfaces:
Cloneable, PropChange.DoChange, XMLArchiver.Archivable

public class TextLineStyle extends PropObject 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.
    • copyForAlign

      public TextLineStyle copyForAlign(HPos anObj)
      Returns a copy with given align value.
    • copyForPropKeyValue

      public TextLineStyle copyForPropKeyValue(String aKey, Object aValue)
      Returns a copy with given value for given property name.
    • copyForIndents

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

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

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

      protected void initProps(PropSet aPropSet)
      Initialize Props. Override to provide custom defaults.
      Overrides:
      initProps in class PropObject
    • getPropValue

      public Object getPropValue(String aPropName)
      Returns the value for given prop name.
      Overrides:
      getPropValue in class PropObject
    • setPropValue

      public void setPropValue(String aPropName, Object aValue)
      Sets the value for given prop name.
      Overrides:
      setPropValue in class PropObject
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class PropObject
    • 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