com.ibm.richtext.styledtext
Class StandardTabRuler

java.lang.Object
  |
  +--com.ibm.richtext.styledtext.MTabRuler
        |
        +--com.ibm.richtext.styledtext.StandardTabRuler
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public final class StandardTabRuler
extends MTabRuler
implements java.io.Externalizable

This class is a standard implementation of MTabRuler. It can have a finite number of client-specified TabStops. After the client-specified TabStops, all TabStops have type TabStop.kAuto and are at the autospace intervals.

See Also:
TabStop, Serialized Form

Constructor Summary
StandardTabRuler()
          Create a StandardTabRuler with only auto tabs, with spacing of 36.
StandardTabRuler(int autoSpacing)
          Create a StandardTabRuler with only auto tabs, with the given autoSpacing.
StandardTabRuler(TabStop[] tabs, int autoSpacing)
          Create a StandardTabRuler.
 
Method Summary
 int autoSpacing()
          Return the interval for autotabs.
 boolean equals(java.lang.Object o)
          Compare this to another Object.
 TabStop firstTab()
          Return first tab in the ruler.
 TabStop nextTab(int position)
          Return the first tab in the ruler with fPosition > position.
 void readExternal(java.io.ObjectInput in)
           
 java.lang.String toString()
          Return debug information about this tab ruler.
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class com.ibm.richtext.styledtext.MTabRuler
addTab, containsTab, hashCode, moveTab, removeTab
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StandardTabRuler

public StandardTabRuler()
Create a StandardTabRuler with only auto tabs, with spacing of 36.

StandardTabRuler

public StandardTabRuler(int autoSpacing)
Create a StandardTabRuler with only auto tabs, with the given autoSpacing.
Parameters:
autoSpacing - the autoSpacing for this tab ruler

StandardTabRuler

public StandardTabRuler(TabStop[] tabs,
                        int autoSpacing)
Create a StandardTabRuler. The first TabStops on the ruler will be the TabStops in the tabs array. After these tabs all tabs are auto tabs.
Parameters:
tabs - an array of TabStops. The TabStops in the array must be in strictly increasing order (of positions), and cannot have type TabStop.kAuto.
autoSpacing - the autoSpacing interval to use after the last client-specified tab.
Method Detail

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable

firstTab

public TabStop firstTab()
Return first tab in the ruler. If an autoTab, it is at position zero, and all subsequent tabs will be autotabs at autoSpacing intervals.
Overrides:
firstTab in class MTabRuler

nextTab

public TabStop nextTab(int position)
Return the first tab in the ruler with fPosition > position. If it is an autotab, it is at an increment of autoSpacing, and all subsequent tabs will be autotabs at autoSpacing intervals.
Overrides:
nextTab in class MTabRuler
Parameters:
position - the position of the TabStop returned will be greater than this parameter

autoSpacing

public int autoSpacing()
Return the interval for autotabs.
Overrides:
autoSpacing in class MTabRuler

equals

public boolean equals(java.lang.Object o)
Compare this to another Object. Returns true if the object is an MTabRuler with the same autoSpacing and tabs.
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Return debug information about this tab ruler.
Overrides:
toString in class java.lang.Object


Copyright (c) 2001 IBM Corporation and others.