API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.text. Utilities View Source
Author(s)
Timothy Prinzing
Since
Version
1.52 03/01/06
Serial
Hierarchy
 Object
      Utilities
Implements
Subclasses
Description
public class Utilities
A collection of methods to deal with various text related activities.
See also:   
Constructors
public Utilities ()
Methods
Hide/Show inherited methods
pack-privatestatic int drawComposedText (View view, AttributeSet attr, Graphics g, int x, int y, int p0, int p1) throws BadLocationException
  Draws the given composed text passed from an input method.
publicfinalstatic 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.
pack-privatefinalstatic int drawTabbedText (View view, 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.
pack-privatefinalstatic int drawTabbedText (View view, Segment s, int x, int y, Graphics g, TabExpander e, int startOffset, int[] justificationData)
publicfinalstatic int getBreakLocation (Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset)
  Determine where to break the given text to fit within the given span.
pack-privatestatic JComponent getJComponent (View view)
If view's container is a JComponent it is returned, after casting.
pack-privatestatic int getNextVisualPositionFrom (View v, int pos, Bias b, Shape alloc, int direction, Bias biasRet) throws BadLocationException
  Provides a way to determine the next visually represented model location that one might place a caret.
publicfinalstatic int getNextWord (JTextComponent c, int offs) throws BadLocationException
  Determines the start of the next word for the given location.
pack-privatestatic int getNextWordInParagraph (JTextComponent c, Element line, int offs, boolean first) throws BadLocationException
  Finds the next word in the given elements text.
publicfinalstatic Element getParagraphElement (JTextComponent c, int offs)
  Determines the element to use for a paragraph/line.
publicfinalstatic int getPositionAbove (JTextComponent c, int offs, int x) throws BadLocationException
  Determines the position in the model that is closest to the given view location in the row above.
publicfinalstatic int getPositionBelow (JTextComponent c, int offs, int x) throws BadLocationException
  Determines the position in the model that is closest to the given view location in the row below.
publicfinalstatic int getPreviousWord (JTextComponent c, int offs) throws BadLocationException
  Determine the start of the prev word for the given location.
pack-privatestatic int getPrevWordInParagraph (JTextComponent c, Element line, int offs) throws BadLocationException
  Finds the previous word in the given elements text.
publicfinalstatic int getRowEnd (JTextComponent c, int offs) throws BadLocationException
  Determines the ending row model position of the row that contains the specified model position.
publicfinalstatic int getRowStart (JTextComponent c, int offs) throws BadLocationException
  Determines the starting row model position of the row that contains the specified model position.
publicfinalstatic 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.
publicfinalstatic int getTabbedTextOffset (Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset, boolean round)
pack-privatefinalstatic int getTabbedTextOffset (View view, Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset, boolean round, int[] justificationData)
pack-privatefinalstatic int getTabbedTextOffset (View view, Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset, int[] justificationData)
publicfinalstatic 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.
pack-privatefinalstatic int getTabbedTextWidth (View view, Segment s, FontMetrics metrics, int x, TabExpander e, int startOffset, int[] justificationData)
publicfinalstatic int getWordEnd (JTextComponent c, int offs) throws BadLocationException
  Determines the end of a word for the given location.
publicfinalstatic int getWordStart (JTextComponent c, int offs) throws BadLocationException
  Determines the start of a word for the given model location.
pack-privatestatic boolean isComposedTextAttributeDefined (AttributeSet as)
pack-privatestatic boolean isComposedTextElement (Document doc, int offset)
pack-privatestatic boolean isComposedTextElement (Element elem)
pack-privatestatic boolean isLeftToRight (Component c)
pack-privatestatic void paintComposedText (Graphics g, Rectangle alloc, GlyphView v)
Paints the composed text in a GlyphView
Fields
Hide/Show inherited fields
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar