All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.swing.text.Utilities

java.lang.Object
    |
    +----java.awt.swing.text.Utilities

public class Utilities
extends Object
A collection of methods to deal with various text related activities.


Constructor Index

 o Utilities()

Method Index

 o drawTabbedText(Segment, int, int, Graphics, TabExpander)
Draws the given text, expanding any tabs that are contained using the given tab expansion technique.
 o getTabbedTextOffset(Segment, FontMetrics, int, int, TabExpander)
Determine the relative offset into the given text that best represents the given span in the view coordinate system.
 o getTabbedTextWidth(Segment, FontMetrics, int, TabExpander)
Determine the width of the given segment of text taking tabs into consideration.

Constructors

 o Utilities
public Utilities()

Methods

 o drawTabbedText
public static final int drawTabbedText(Segment s,
                                       int x,
                                       int y,
                                       Graphics g,
                                       TabExpander e)
Draws the given text, expanding any tabs that are contained using the given tab expansion technique. This particular implementation renders in a 1.1 style coordinate system where ints are used and 72dpi is assumed.

Parameters:
s - the source of the text
x - the X origin
y - the Y origin
g - the graphics context
e - how to expand the tabs
 o getTabbedTextWidth
public static final int getTabbedTextWidth(Segment s,
                                           FontMetrics metrics,
                                           int x,
                                           TabExpander e)
Determine the width of the given segment of text taking tabs into consideration. This is implemented in a 1.1 style coordinate system where ints are used and 72dpi is assumed.

Parameters:
s - the source of the text
x - the X origin
e - how to expand the tabs
metrics - the font metrics to use for the calculation
 o getTabbedTextOffset
public static final int getTabbedTextOffset(Segment s,
                                            FontMetrics metrics,
                                            int x0,
                                            int x,
                                            TabExpander e)
Determine the relative offset into the given text that best represents the given span in the view coordinate system. This is implemented in a 1.1 style coordinate system where ints are used and 72dpi is assumed.

Parameters:
s - the source of the text
x0 - the starting view location representing the start of the given text.
x - the target view location to translate to an offset into the text.
e - how to expand the tabs
metrics - the font metrics to use for the calculation

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature