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.
Method Summary
|
static int
|
drawTabbedText(Segment s,
int x,
int y,
Graphics g,
TabExpander e,
int startOffset)
Draws the given text, expanding any tabs that are contained
using the given tab expansion technique.
|
static int
|
getTabbedTextOffset(Segment s,
FontMetrics metrics,
int x0,
int x,
TabExpander e,
int startOffset)
Determines the relative offset into the given text that
best represents the given span in the view coordinate
system.
|
static int
|
getTabbedTextWidth(Segment s,
FontMetrics metrics,
int x,
TabExpander e,
int startOffset)
Determines the width of the given segment of text taking tabs
into consideration.
|
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
drawTabbedText
public static final int drawTabbedText(Segment s,
int x,
int y,
Graphics g,
TabExpander e,
int startOffset)
- 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
startOffset
- starting offset in the document of the text
getTabbedTextWidth
public static final int getTabbedTextWidth(Segment s,
FontMetrics metrics,
int x,
TabExpander e,
int startOffset)
- Determines 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
metrics
- the font metrics to use for the calculation
x
- the X origin
e
- how to expand the tabs
startOffset
- starting offset in the document of the text
getTabbedTextOffset
public static final int getTabbedTextOffset(Segment s,
FontMetrics metrics,
int x0,
int x,
TabExpander e,
int startOffset)
- Determines 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
metrics
- the font metrics to use for the calculation
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
startOffset
- starting offset in the document of the text
Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.