public class TextTabList extends Object
A tab list consists of a set of zero or more individual tab stops, as well as an optional uniform tab stop definition.
Individual tab stops are ultimately set by the user. They may have different types, and their offsets are chosen for visual layout, not typically by algorithmic rule. Irrespective of the order individual tab stops are added to a tab list, AXTE can infer a graphic order from the tab stops' offset values, starting with the smallest and ending with the largest.
Uniform tab stops kick in after the last individual tab, and are offset at regular intervals, theoretically up to infinity. The uniform tab stop definition defines that interval through its offset and it also defines the tab type for all uniform tabs. Note that uniform tab stops are gridded relative to the start of the line, not the last individual tab stop.
Because the uniform tab stop definition, the application may enable or disable it. When enabled, the tab list object effectively presents an infinit set of tab stops, starting with the ordered individual tab stops, and followed by an ongoing sequence of manufactured uniform tab stops. When disabled, the last tab stop in the list is the last individual stop.
For more information, please see the external documentation.
| Modifier and Type | Field and Description |
|---|---|
static TextTabList |
DEFAULT_TAB_LIST |
| Constructor and Description |
|---|
TextTabList()
Default constructor.
|
TextTabList(TextTabList oSource)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear(TextTab oClear)
Clear one tab stop.
|
void |
clearAll()
Clear all tabs.
|
void |
copyFrom(TextTabList oSource)
Assignment operator.
|
void |
debug() |
boolean |
equals(Object object)
Equality comparison.
|
int |
hashCode() |
TextTab |
next(UnitSpan oPosition)
Obtain the next tab.
|
boolean |
notEqual(TextTabList oCompare)
Inequality comparison.
|
boolean |
noUniform()
Query whether the uniform tab stop definition is disabled.
|
void |
noUniform(boolean bNoUniform)
Enable/disable the uniform tab stop definition.
|
TextTab |
prev(UnitSpan oPosition)
Obtain the previous tab.
|
void |
set(TextTab oSet)
Set a new tab stop.
|
int |
size()
Obtain the number of individual tab stops.
|
TextTab |
tabAt(int nIndex)
Tab stop indexing.
|
TextTab |
uniform()
Obtain the uniform tab stop definition.
|
void |
uniform(TextTab oNewUniform)
Change the uniform tab stop definition.
|
public static final TextTabList DEFAULT_TAB_LIST
public TextTabList()
Construct a tab list object with an initially empty set of individual tabs and a uniform tab definition of 0.5", left aligned.
public TextTabList(TextTabList oSource)
Copy the source tab list, including the complete set of individual tab stops and the uniform tab stop definition.
oSource - - Source tab list to copy.public TextTab uniform()
public void uniform(TextTab oNewUniform)
oNewUniform - - New uniform tab stop definition. The call is
ignored if this has a zero or negative value.public boolean noUniform()
public void noUniform(boolean bNoUniform)
bNoUniform - - TRUE if the uniform tab stop definition is to be
disabled; FALSE to enable it.public void set(TextTab oSet)
This method adds a new tab stop to the set of individual tabs. The new tab stop can then be retrieved in correct sequence with the Next() and Prev() methods. Note that there may not be two tab stops at the same offset. If the list already contains a tab stop at the new tab's offset, the existing tab is replaced.
oSet - - New individual tab to add to the set.public void clear(TextTab oClear)
If the list contains an individual tab at the offset of the parameter passed in, remove it from the list. Otherwise, the call is ignored. One cannot clear uniform tab stop instances.
oClear - - Tab stop to clear. Only the offset is examined; the
type is ignored.public void clearAll()
Remove all individual tabs and set the uniform tab stop back to its initial definition (0.5" left).
public int size()
public TextTab next(UnitSpan oPosition)
Given an offset measurement, this method returns the next tab from the list. Note that a tab exactly at the given offset is not a suitable candidate. If uniform tabs are enabled and the offset is beyond the last individual tab stop, the appropriate uniform tab stop is returned. If the offset is beyond the last individual tab stop and uniform tabs are disabled, a tab with a zero offset is returned.
oPosition - - Offset to start the search from.public TextTab prev(UnitSpan oPosition)
Given an offset measurement, this method returns the previous tab from the list. Note that a tab exactly at the given offset is not a suitable candidate. If uniform tabs are enabled and the offset is far enough beyond the last individual tab stop, the appropriate uniform tab stop is returned. If the offset is beyond the last individual tab stop and uniform tabs are disabled, the last individual tab stop is returned.
oPosition - - Offset to start the search from.public void copyFrom(TextTabList oSource)
Copy the source tab list, including the complete set of individual tab stops and the uniform tab stop definition.
oSource - - Source tab list to copy.public boolean equals(Object object)
Two tab lists are considered equal if they have the same sets of tab stops and the same uniform tab stop definition. Tab stops are compared by both offset and type. The uniform tab stop definitions are equal if they are both disabled or they are both enabled and represent the same tab stop.
public boolean notEqual(TextTabList oCompare)
Two tab lists are considered unequal if they have different sets of tab stops or different uniform tab stop definitions. Tab stops are compared by both offset and type. The uniform tab stop definitions are unequal if their enabled/disabled states don't match or they are both enabled and represent different tab stops.
oCompare - - Tab list to compare against.public TextTab tabAt(int nIndex)
Return one tab stop from the list, accessed by index number. This method treats the tab list as an ordered list of individual tab stops followed by an open-ended list of uniform tabs, if enabled. The caller can request any tab stop from this view.
nIndex - - Index number of desired tab stop.public void debug()
Copyright © 2010 - 2020 Adobe. All Rights Reserved