APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.text

public Class TabStop

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Annotations
@SuppressWarnings:serial
Imports
java.io.Serializable

This class encapsulates a single tab stop (basically as tab stops are thought of by RTF). A tab stop is at a specified distance from the left margin, aligns text in a specified way, and has a specified leader. TabStops are immutable, and usually contained in TabSets.

Warning

Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package. Please see java.beans.XMLEncoder.

Field Summary

Modifier and TypeField and Description
public static final int
ALIGN_BAR

Align bar

public static final int
ALIGN_CENTER

Characters following tab are positioned such that all following characters up to next tab/newline are centered around the tabs location.

public static final int
ALIGN_DECIMAL

Characters following tab are aligned such that next decimal/tab/newline is at the tab location, very similar to RIGHT_TAB, just includes decimal as additional character to look for.

public static final int
ALIGN_LEFT

Character following tab is positioned at location.

public static final int
ALIGN_RIGHT

Characters following tab are positioned such that all following characters up to next tab/newline end at location.

private int
alignment

Tab type.

public static final int
LEAD_DOTS

Lead dots

public static final int
LEAD_EQUALS

Lead equals

public static final int
LEAD_HYPHENS

Lead hyphens

public static final int
LEAD_NONE

Lead none

public static final int
LEAD_THICKLINE

Lead thickline

public static final int
LEAD_UNDERLINE

Lead underline

private int
private float
position

Location, from the left margin, that tab is at.

Constructor Summary

AccessConstructor and Description
public
TabStop(float
position of the tab
pos
)

Creates a tab at position pos with a default alignment and default leader.

public
TabStop(float
position of the tab
pos
,
int
alignment of the tab
align
,
int
leader of the tab
leader
)

Creates a tab with the specified position pos, alignment align and leader leader.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the tabs are equal, otherwise false
equals
(Object other)

Overrides java.lang.Object.equals.

Returns true if the tabs are equal.

public int

Returns:

the alignment of the tab
getAlignment
()

Returns the alignment, as an integer, of the tab.

public int

Returns:

the leader of the tab
getLeader
()

Returns the leader of the tab.

public float

Returns:

the position of the tab
getPosition
()

Returns the position, as a float, of the tab.

public int

Returns:

the hashCode for the object
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hashCode for the object.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

ALIGN_BARback to summary
public static final int ALIGN_BAR

Align bar

ALIGN_CENTERback to summary
public static final int ALIGN_CENTER

Characters following tab are positioned such that all following characters up to next tab/newline are centered around the tabs location.

ALIGN_DECIMALback to summary
public static final int ALIGN_DECIMAL

Characters following tab are aligned such that next decimal/tab/newline is at the tab location, very similar to RIGHT_TAB, just includes decimal as additional character to look for.

ALIGN_LEFTback to summary
public static final int ALIGN_LEFT

Character following tab is positioned at location.

ALIGN_RIGHTback to summary
public static final int ALIGN_RIGHT

Characters following tab are positioned such that all following characters up to next tab/newline end at location.

alignmentback to summary
private int alignment

Tab type.

LEAD_DOTSback to summary
public static final int LEAD_DOTS

Lead dots

LEAD_EQUALSback to summary
public static final int LEAD_EQUALS

Lead equals

LEAD_HYPHENSback to summary
public static final int LEAD_HYPHENS

Lead hyphens

LEAD_NONEback to summary
public static final int LEAD_NONE

Lead none

LEAD_THICKLINEback to summary
public static final int LEAD_THICKLINE

Lead thickline

LEAD_UNDERLINEback to summary
public static final int LEAD_UNDERLINE

Lead underline

leaderback to summary
private int leader
positionback to summary
private float position

Location, from the left margin, that tab is at.

Constructor Detail

TabStopback to summary
public TabStop(float pos)

Creates a tab at position pos with a default alignment and default leader.

Parameters
pos:float

position of the tab

TabStopback to summary
public TabStop(float pos, int align, int leader)

Creates a tab with the specified position pos, alignment align and leader leader.

Parameters
pos:float

position of the tab

align:int

alignment of the tab

leader:int

leader of the tab

Method Detail

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Returns true if the tabs are equal.

Returns:boolean

true if the tabs are equal, otherwise false

getAlignmentback to summary
public int getAlignment()

Returns the alignment, as an integer, of the tab.

Returns:int

the alignment of the tab

getLeaderback to summary
public int getLeader()

Returns the leader of the tab.

Returns:int

the leader of the tab

getPositionback to summary
public float getPosition()

Returns the position, as a float, of the tab.

Returns:float

the position of the tab

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hashCode for the object. This must be defined here to ensure 100% pure.

Returns:int

the hashCode for the object

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.