Home » openjdk-7 » javax » swing » text » [javadoc | source]
abstract class: TextInterval [javadoc | source]

All Implemented Interfaces:

Direct Known Subclasses:
    SelectedTextInterval, UnselectedTextInterval, ComposedTextInterval

Represents a basic interval of text. There are three non-abstract implementations:
  1. UnselectedTextInterval,
  2. SelectedTextInterval,
  3. ComposedTextInterval.
Nested Class Summary:
interface  TextInterval.TextIntervalPainter  Defines how text is actually painted. 
Field Summary
protected  int start    Start of the interval. 
protected  int end    End of the interval. 
protected final  TextIntervalPainter painter    Painter to do actual text painting. 
 public TextInterval(int start,
    int end,
    TextIntervalPainter painter) 
    Creates a text interval.
    start - the start of the interval.
    end - the end of the interval.
    painter - the painter to use.
Method from javax.swing.text.TextInterval Summary:
create,   dissect,   dissect,   dissect,   getType,   intersects,   isEmpty,   paint,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.TextInterval Detail:
 public final TextInterval create(int start,
    int end) 
    Creates a copy of the interval with new start and end.
 abstract public TextInterval[] dissect(TextInterval another)
    Returns dissection of this interval and another.
 static TextInterval[] dissect(SelectedTextInterval selected,
    ComposedTextInterval composed) 
    Dissects selected and composed text intervals.

    This method is meant for internal usage only.

 static TextInterval[] dissect(UnselectedTextInterval ordinary,
    TextInterval selectedOrComposed) 
    Dissects unselected and selected or composed text intervals.

    This method is meant for internal usage only.

 abstract public String getType()
    Returns the string type of the interval. It is used in toString method.
 public final boolean intersects(TextInterval another) 
    Checks whether two intervals intersect.
 public final boolean isEmpty() 
    Checks whether this interval is empty.
 abstract public int paint(Graphics g,
    int x,
    int y) throws BadLocationException
    Paints text which falls in this interval.
 public String toString() 
    Converts interval to a string.