Package snap.text
Class TextLineStyle
java.lang.Object
snap.text.TextLineStyle
- All Implemented Interfaces:
Cloneable
,XMLArchiver.Archivable
A class to represent a line of text (for each newline) in RichText.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final TextLineStyle
static final TextLineStyle
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final char
static final char
static final char
static final char
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Standard clone implementation.Returns a clone with the new given value.Returns a clone with the new given value.copyForIndents
(double firstIndent, double leftIndent, double rightIndent) Returns a paragraph identical to the receiver, but with the given indentation values.boolean
Standard equals implementation.fromXML
(XMLArchiver anArchiver, XMLElement anElement) XML unarchival.getAlign()
Returns the alignment associated with this paragraph.double
Returns the indentation of first line in paragraph (this can be set different than successive lines).double
Returns the left side indentation of this paragraph.double
Returns the maximum line height in printer points associated with this paragraph.double
Returns the minimum line height in printer points associated with this paragraph.double
Returns the spacing between paragraphs in printer points associated with this paragraph.double
Returns the right side indentation of this paragraph.double
Returns the spacing between lines expressed as a constant amount in points.double
Returns the spacing of lines expressed as a factor of a given line's height.double
getTab
(int anIndex) Returns the specific tab value for the given index in printer points.int
Returns the number of tabs associated with this paragraph.int
getTabIndexForX
(double aX) Returns the tab index for the given location.double[]
getTabs()
Returns the raw tab arrayReturns the values of all the tabs associated with this paragraph as a comma separated string.char
getTabType
(int anIndex) Returns the type of tab at the given index.char[]
Returns the raw tab type arraydouble
getXForTabForX
(double aX) Returns the tab location for given location.boolean
Returns whether text in line should be justified.protected void
setTabsString
(String aString) Sets the value of tabs from the given tabs string.protected void
Sets a value for given key.toString()
Standard toString implementation.toXML
(XMLArchiver anArchiver) XML archival.
-
Field Details
-
TAB_LEFT
public static final char TAB_LEFT- See Also:
-
TAB_RIGHT
public static final char TAB_RIGHT- See Also:
-
TAB_CENTER
public static final char TAB_CENTER- See Also:
-
TAB_DECIMAL
public static final char TAB_DECIMAL- See Also:
-
ALIGN_KEY
- See Also:
-
JUSTIFY_KEY
- See Also:
-
FIRST_INDENT_KEY
- See Also:
-
LEFT_INDENT_KEY
- See Also:
-
RIGHT_INDENT_KEY
- See Also:
-
SPACING_KEY
- See Also:
-
SPACING_FACTOR_KEY
- See Also:
-
NEWLINE_SPACING_KEY
- See Also:
-
MIN_HEIGHT_KEY
- See Also:
-
MAX_HEIGHT_KEY
- See Also:
-
DEFAULT
-
DEFAULT_CENTERED
-
-
Constructor Details
-
TextLineStyle
public TextLineStyle()Constructor.
-
-
Method Details
-
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
Returns the values of all the tabs associated with this paragraph as a comma separated string. -
setTabsString
Sets the value of tabs from the given tabs string. -
copyFor
Returns a clone with the new given value. -
copyFor
Returns a clone with the new given value. -
copyForIndents
Returns a paragraph identical to the receiver, but with the given indentation values. -
setValue
Sets a value for given key. -
clone
Standard clone implementation. -
equals
Standard equals implementation. -
toString
Standard toString implementation. -
toXML
XML archival.- Specified by:
toXML
in interfaceXMLArchiver.Archivable
-
fromXML
XML unarchival.- Specified by:
fromXML
in interfaceXMLArchiver.Archivable
-