public class TextTab extends Object
In left-to-right (LTR) text, tab offsets measure from the left-hand side. In right-to-left (RTL) text, tab offsets measure from the right-hand side and the meanings of the left and right types are inverted.
For more information, please see the extenral documentation.
| Modifier and Type | Field and Description |
|---|---|
static TextTab |
DEFAULT_TAB |
static int |
TYPE_ALIGN_AFTER |
static int |
TYPE_ALIGN_BEFORE |
static int |
TYPE_CENTRE |
static int |
TYPE_DECIMAL |
static int |
TYPE_LEFT |
static int |
TYPE_RIGHT |
static TextTab |
ZERO_TAB |
| Constructor and Description |
|---|
TextTab()
Default constructor.
|
TextTab(double fNewStop,
int eNewType) |
TextTab(TextTab oSource)
Copy constructor.
|
TextTab(UnitSpan oNewStop,
int eNewType)
Constructor with offset and optional type.
|
| Modifier and Type | Method and Description |
|---|---|
TextTab |
copyFrom(TextTab oSource)
Assignment operator.
|
void |
debug() |
boolean |
equals(Object object)
Equality comparison.
|
boolean |
equals(UnitSpan oCompare)
Equality comparison with measurement.
|
boolean |
greaterThan(TextTab oCompare)
Greater than comparison.
|
boolean |
greaterThanOrEqual(TextTab oCompare)
Greater than or equal to comparison.
|
boolean |
gt(UnitSpan oCompare)
Greater than comparison with measurement.
|
boolean |
gte(UnitSpan oCompare)
Greater than or equal to comparison with measurement.
|
int |
hashCode() |
boolean |
lessThan(TextTab oCompare)
Less than comparison.
|
boolean |
lessThanOrEqual(TextTab oCompare)
Less than or equal to comparison.
|
boolean |
lt(UnitSpan oCompare)
Less than comparison with measurement.
|
boolean |
lte(UnitSpan oCompare)
Less than or equal to comparison with measurement.
|
boolean |
notEqual(TextTab oCompare)
Inequality comparison.
|
boolean |
notEqual(UnitSpan oCompare)
Inequality comparison with measurement.
|
static int |
resolveType(int eSource,
boolean bRTL,
boolean bLayout)
Resolve the tab type, based on text direction.
|
UnitSpan |
tabStop()
Obtain the tab stop offset.
|
void |
tabStop(UnitSpan oNewStop)
Change the tab stop's offset.
|
int |
tabType()
Optain the tab stop's current type.
|
void |
tabType(int eNewType)
Change the tab stop's type.
|
int |
value()
Obtain the numeric offset value.
|
public static final int TYPE_LEFT
public static final int TYPE_CENTRE
public static final int TYPE_RIGHT
public static final int TYPE_DECIMAL
public static final int TYPE_ALIGN_AFTER
public static final int TYPE_ALIGN_BEFORE
public static final TextTab DEFAULT_TAB
public static final TextTab ZERO_TAB
public TextTab()
The offset is initialized to zero and the tab has an initial type of left.
public TextTab(TextTab oSource)
Copy both the offset and the type from the source tab stop object.
oSource - - Source tab stop to copy.public TextTab(UnitSpan oNewStop, int eNewType)
oNewStop - - Offset value for the tab stop object.eNewType - - (optional) Initial tab type. Default is left.public TextTab(double fNewStop,
int eNewType)
public int tabType()
public void tabType(int eNewType)
eNewType - - New tab type.public UnitSpan tabStop()
public void tabStop(UnitSpan oNewStop)
oNewStop - - New offset value for the tab stop.public int value()
This method returns the value portion of the tab offset measurement. It is meant as a short-cut for sero comparisons only. For example, you can say oTab.Value() rather than oTab.TabStop().Value(). Big deal.
public static int resolveType(int eSource,
boolean bRTL,
boolean bLayout)
Given a tab type and text direction, this method returns a resolved type. The behaviour of the resolution also depends on whether it is occuring for layout.
General (non-layout) resolution: For LTR text, TYPE_ALIGN_AFTER resolves to TYPE_LEFT and TYPE_ALIGN_BEFORE resolves to TYPE_RIGHT. For RTL text, TYPE_ALIGN_AFTER resolves to TYPE_RIGHT and TYPE_ALIGN_BEFORE resolves to TYPE_LEFT. All other types do not change.
Layout resoultion: For LTR text, TYPE_LEFT resolves to TYPE_ALIGN_AFTER and TYPE_RIGHT resolves to TYPE_ALIGN_BEFORE. For RTL text, TYPE_LEFT resolves to TYPE_ALIGN_BEFORE and TYPE_RIGHT resolves to TYPE_ALIGN_AFTER.
eSource - - Source type code to resolve.bRTL - - True for RTL text; false for LTR text;bLayout - - (optional) True if this resolution is for layout;
false (default) for general resolution.public TextTab copyFrom(TextTab oSource)
Copies both the offset and type from the source tab stop object.
oSource - - Source tab stop object to copy.public boolean equals(Object object)
Two tab stops are considered equal if their offsets compare as equal and they have the same type.
public boolean notEqual(TextTab oCompare)
Two tab stops are considered unequal if either their offsets are not equal or they have different types.
oCompare - - Tab stop object to compare against.public boolean lessThan(TextTab oCompare)
Compare the offset values only; ignores the tab stops' types.
oCompare - - Tab stop object to compare against.public boolean lessThanOrEqual(TextTab oCompare)
Compare the offset values only; ignores the tab stops' types.
oCompare - - Tab stop object to compare against.public boolean greaterThan(TextTab oCompare)
Compare the offset values only; ignores the tab stops' types.
oCompare - - Tab stop object to compare against.public boolean greaterThanOrEqual(TextTab oCompare)
Compare the offset values only; ignores the tab stops' types.
oCompare - - Tab stop object to compare against.public boolean equals(UnitSpan oCompare)
Compare the tab stop's offset against a measurement (jfUnitSpan) for equality. The tab stop type is ignored.
oCompare - - Measurement to compare against.public boolean notEqual(UnitSpan oCompare)
Compare the tab stop's offset against a measurement (jfUnitSpan) for inequality. The tab stop type is ignored.
oCompare - - Measurement to compare against.public boolean lt(UnitSpan oCompare)
Compare the tab stop's offset against a measurement (jfUnitSpan). The tab stop type is ignored.
oCompare - - Measurement to compare against.public boolean lte(UnitSpan oCompare)
Compare the tab stop's offset against a measurement (jfUnitSpan). The tab stop type is ignored.
oCompare - - Measurement to compare against.public boolean gt(UnitSpan oCompare)
Compare the tab stop's offset against a measurement (jfUnitSpan). The tab stop type is ignored.
oCompare - - Measurement to compare against.public boolean gte(UnitSpan oCompare)
Compare the tab stop's offset against a measurement (jfUnitSpan). The tab stop type is ignored.
oCompare - - Measurement to compare against.public void debug()
Copyright © 2010 - 2020 Adobe. All Rights Reserved