javax.swing.plaf
Class TextUI

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.swing.plaf.ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI 
      extended by javax.swing.plaf.TextUI
Direct Known Subclasses:
BasicTextUI sample code for javax.swing.plaf.basic.BasicTextUI definition code for javax.swing.plaf.basic.BasicTextUI , MultiTextUI sample code for javax.swing.plaf.multi.MultiTextUI definition code for javax.swing.plaf.multi.MultiTextUI

public abstract class TextUI
extends ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI

Text editor user interface


Constructor Summary
TextUI sample code for javax.swing.plaf.TextUI.TextUI() definition code for javax.swing.plaf.TextUI.TextUI() ()
           
 
Method Summary
abstract  void damageRange sample code for javax.swing.plaf.TextUI.damageRange(javax.swing.text.JTextComponent, int, int) definition code for javax.swing.plaf.TextUI.damageRange(javax.swing.text.JTextComponent, int, int) (JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t, int p0, int p1)
          Causes the portion of the view responsible for the given part of the model to be repainted.
abstract  void damageRange sample code for javax.swing.plaf.TextUI.damageRange(javax.swing.text.JTextComponent, int, int, javax.swing.text.Position.Bias, javax.swing.text.Position.Bias) definition code for javax.swing.plaf.TextUI.damageRange(javax.swing.text.JTextComponent, int, int, javax.swing.text.Position.Bias, javax.swing.text.Position.Bias) (JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t, int p0, int p1, Position.Bias sample code for javax.swing.text.Position.Bias definition code for javax.swing.text.Position.Bias  firstBias, Position.Bias sample code for javax.swing.text.Position.Bias definition code for javax.swing.text.Position.Bias  secondBias)
          Causes the portion of the view responsible for the given part of the model to be repainted.
abstract  EditorKit sample code for javax.swing.text.EditorKit definition code for javax.swing.text.EditorKit getEditorKit sample code for javax.swing.plaf.TextUI.getEditorKit(javax.swing.text.JTextComponent) definition code for javax.swing.plaf.TextUI.getEditorKit(javax.swing.text.JTextComponent) (JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t)
          Fetches the binding of services that set a policy for the type of document being edited.
abstract  int getNextVisualPositionFrom sample code for javax.swing.plaf.TextUI.getNextVisualPositionFrom(javax.swing.text.JTextComponent, int, javax.swing.text.Position.Bias, int, javax.swing.text.Position.Bias[]) definition code for javax.swing.plaf.TextUI.getNextVisualPositionFrom(javax.swing.text.JTextComponent, int, javax.swing.text.Position.Bias, int, javax.swing.text.Position.Bias[]) (JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t, int pos, Position.Bias sample code for javax.swing.text.Position.Bias definition code for javax.swing.text.Position.Bias  b, int direction, Position.Bias sample code for javax.swing.text.Position.Bias definition code for javax.swing.text.Position.Bias [] biasRet)
          Provides a way to determine the next visually represented model location that one might place a caret.
abstract  View sample code for javax.swing.text.View definition code for javax.swing.text.View getRootView sample code for javax.swing.plaf.TextUI.getRootView(javax.swing.text.JTextComponent) definition code for javax.swing.plaf.TextUI.getRootView(javax.swing.text.JTextComponent) (JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t)
          Fetches a View with the allocation of the associated text component (i.e.
 String sample code for java.lang.String definition code for java.lang.String getToolTipText sample code for javax.swing.plaf.TextUI.getToolTipText(javax.swing.text.JTextComponent, java.awt.Point) definition code for javax.swing.plaf.TextUI.getToolTipText(javax.swing.text.JTextComponent, java.awt.Point) (JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t, Point sample code for java.awt.Point definition code for java.awt.Point  pt)
          Returns the string to be used as the tooltip at the passed in location.
abstract  Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle modelToView sample code for javax.swing.plaf.TextUI.modelToView(javax.swing.text.JTextComponent, int) definition code for javax.swing.plaf.TextUI.modelToView(javax.swing.text.JTextComponent, int) (JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t, int pos)
          Converts the given location in the model to a place in the view coordinate system.
abstract  Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle modelToView sample code for javax.swing.plaf.TextUI.modelToView(javax.swing.text.JTextComponent, int, javax.swing.text.Position.Bias) definition code for javax.swing.plaf.TextUI.modelToView(javax.swing.text.JTextComponent, int, javax.swing.text.Position.Bias) (JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t, int pos, Position.Bias sample code for javax.swing.text.Position.Bias definition code for javax.swing.text.Position.Bias  bias)
          Converts the given location in the model to a place in the view coordinate system.
abstract  int viewToModel sample code for javax.swing.plaf.TextUI.viewToModel(javax.swing.text.JTextComponent, java.awt.Point) definition code for javax.swing.plaf.TextUI.viewToModel(javax.swing.text.JTextComponent, java.awt.Point) (JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t, Point sample code for java.awt.Point definition code for java.awt.Point  pt)
          Converts the given place in the view coordinate system to the nearest representative location in the model.
abstract  int viewToModel sample code for javax.swing.plaf.TextUI.viewToModel(javax.swing.text.JTextComponent, java.awt.Point, javax.swing.text.Position.Bias[]) definition code for javax.swing.plaf.TextUI.viewToModel(javax.swing.text.JTextComponent, java.awt.Point, javax.swing.text.Position.Bias[]) (JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t, Point sample code for java.awt.Point definition code for java.awt.Point  pt, Position.Bias sample code for javax.swing.text.Position.Bias definition code for javax.swing.text.Position.Bias [] biasReturn)
          Provides a mapping from the view coordinate space to the logical coordinate space of the model.
 
Methods inherited from class javax.swing.plaf.ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI
contains sample code for javax.swing.plaf.ComponentUI.contains(javax.swing.JComponent, int, int) definition code for javax.swing.plaf.ComponentUI.contains(javax.swing.JComponent, int, int) , createUI sample code for javax.swing.plaf.ComponentUI.createUI(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.createUI(javax.swing.JComponent) , getAccessibleChild sample code for javax.swing.plaf.ComponentUI.getAccessibleChild(javax.swing.JComponent, int) definition code for javax.swing.plaf.ComponentUI.getAccessibleChild(javax.swing.JComponent, int) , getAccessibleChildrenCount sample code for javax.swing.plaf.ComponentUI.getAccessibleChildrenCount(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.getAccessibleChildrenCount(javax.swing.JComponent) , getMaximumSize sample code for javax.swing.plaf.ComponentUI.getMaximumSize(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.getMaximumSize(javax.swing.JComponent) , getMinimumSize sample code for javax.swing.plaf.ComponentUI.getMinimumSize(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.getMinimumSize(javax.swing.JComponent) , getPreferredSize sample code for javax.swing.plaf.ComponentUI.getPreferredSize(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.getPreferredSize(javax.swing.JComponent) , installUI sample code for javax.swing.plaf.ComponentUI.installUI(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.installUI(javax.swing.JComponent) , paint sample code for javax.swing.plaf.ComponentUI.paint(java.awt.Graphics, javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.paint(java.awt.Graphics, javax.swing.JComponent) , uninstallUI sample code for javax.swing.plaf.ComponentUI.uninstallUI(javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.uninstallUI(javax.swing.JComponent) , update sample code for javax.swing.plaf.ComponentUI.update(java.awt.Graphics, javax.swing.JComponent) definition code for javax.swing.plaf.ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

TextUI sample code for javax.swing.plaf.TextUI() definition code for javax.swing.plaf.TextUI()

public TextUI()
Method Detail

modelToView sample code for javax.swing.plaf.TextUI.modelToView(javax.swing.text.JTextComponent, int) definition code for javax.swing.plaf.TextUI.modelToView(javax.swing.text.JTextComponent, int)

public abstract Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  modelToView(JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t,
                                      int pos)
                               throws BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException 
Converts the given location in the model to a place in the view coordinate system.

Parameters:
pos - the local location in the model to translate >= 0
Returns:
the coordinates as a rectangle
Throws:
BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException - if the given position does not represent a valid location in the associated document

modelToView sample code for javax.swing.plaf.TextUI.modelToView(javax.swing.text.JTextComponent, int, javax.swing.text.Position.Bias) definition code for javax.swing.plaf.TextUI.modelToView(javax.swing.text.JTextComponent, int, javax.swing.text.Position.Bias)

public abstract Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  modelToView(JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t,
                                      int pos,
                                      Position.Bias sample code for javax.swing.text.Position.Bias definition code for javax.swing.text.Position.Bias  bias)
                               throws BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException 
Converts the given location in the model to a place in the view coordinate system.

Parameters:
pos - the local location in the model to translate >= 0
Returns:
the coordinates as a rectangle
Throws:
BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException - if the given position does not represent a valid location in the associated document

viewToModel sample code for javax.swing.plaf.TextUI.viewToModel(javax.swing.text.JTextComponent, java.awt.Point) definition code for javax.swing.plaf.TextUI.viewToModel(javax.swing.text.JTextComponent, java.awt.Point)

public abstract int viewToModel(JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t,
                                Point sample code for java.awt.Point definition code for java.awt.Point  pt)
Converts the given place in the view coordinate system to the nearest representative location in the model.

Parameters:
pt - the location in the view to translate. This should be in the same coordinate system as the mouse events.
Returns:
the offset from the start of the document >= 0

viewToModel sample code for javax.swing.plaf.TextUI.viewToModel(javax.swing.text.JTextComponent, java.awt.Point, javax.swing.text.Position.Bias[]) definition code for javax.swing.plaf.TextUI.viewToModel(javax.swing.text.JTextComponent, java.awt.Point, javax.swing.text.Position.Bias[])

public abstract int viewToModel(JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t,
                                Point sample code for java.awt.Point definition code for java.awt.Point  pt,
                                Position.Bias sample code for javax.swing.text.Position.Bias definition code for javax.swing.text.Position.Bias [] biasReturn)
Provides a mapping from the view coordinate space to the logical coordinate space of the model.

Parameters:
pt - the location in the view to translate. This should be in the same coordinate system as the mouse events.
biasReturn - filled in by this method to indicate whether the point given is closer to the previous or the next character in the model
Returns:
the location within the model that best represents the given point in the view >= 0

getNextVisualPositionFrom sample code for javax.swing.plaf.TextUI.getNextVisualPositionFrom(javax.swing.text.JTextComponent, int, javax.swing.text.Position.Bias, int, javax.swing.text.Position.Bias[]) definition code for javax.swing.plaf.TextUI.getNextVisualPositionFrom(javax.swing.text.JTextComponent, int, javax.swing.text.Position.Bias, int, javax.swing.text.Position.Bias[])

public abstract int getNextVisualPositionFrom(JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t,
                                              int pos,
                                              Position.Bias sample code for javax.swing.text.Position.Bias definition code for javax.swing.text.Position.Bias  b,
                                              int direction,
                                              Position.Bias sample code for javax.swing.text.Position.Bias definition code for javax.swing.text.Position.Bias [] biasRet)
                                       throws BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException 
Provides a way to determine the next visually represented model location that one might place a caret. Some views may not be visible, they might not be in the same order found in the model, or they just might not allow access to some of the locations in the model.

Parameters:
pos - the position to convert >= 0
a - the allocated region to render into
direction - the direction from the current position that can be thought of as the arrow keys typically found on a keyboard. This may be SwingConstants.WEST, SwingConstants.EAST, SwingConstants.NORTH, or SwingConstants.SOUTH.
Returns:
the location within the model that best represents the next location visual position.
Throws:
BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - for an invalid direction

damageRange sample code for javax.swing.plaf.TextUI.damageRange(javax.swing.text.JTextComponent, int, int) definition code for javax.swing.plaf.TextUI.damageRange(javax.swing.text.JTextComponent, int, int)

public abstract void damageRange(JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t,
                                 int p0,
                                 int p1)
Causes the portion of the view responsible for the given part of the model to be repainted.

Parameters:
p0 - the beginning of the range >= 0
p1 - the end of the range >= p0

damageRange sample code for javax.swing.plaf.TextUI.damageRange(javax.swing.text.JTextComponent, int, int, javax.swing.text.Position.Bias, javax.swing.text.Position.Bias) definition code for javax.swing.plaf.TextUI.damageRange(javax.swing.text.JTextComponent, int, int, javax.swing.text.Position.Bias, javax.swing.text.Position.Bias)

public abstract void damageRange(JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t,
                                 int p0,
                                 int p1,
                                 Position.Bias sample code for javax.swing.text.Position.Bias definition code for javax.swing.text.Position.Bias  firstBias,
                                 Position.Bias sample code for javax.swing.text.Position.Bias definition code for javax.swing.text.Position.Bias  secondBias)
Causes the portion of the view responsible for the given part of the model to be repainted.

Parameters:
p0 - the beginning of the range >= 0
p1 - the end of the range >= p0

getEditorKit sample code for javax.swing.plaf.TextUI.getEditorKit(javax.swing.text.JTextComponent) definition code for javax.swing.plaf.TextUI.getEditorKit(javax.swing.text.JTextComponent)

public abstract EditorKit sample code for javax.swing.text.EditorKit definition code for javax.swing.text.EditorKit  getEditorKit(JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t)
Fetches the binding of services that set a policy for the type of document being edited. This contains things like the commands available, stream readers and writers, etc.

Returns:
the editor kit binding

getRootView sample code for javax.swing.plaf.TextUI.getRootView(javax.swing.text.JTextComponent) definition code for javax.swing.plaf.TextUI.getRootView(javax.swing.text.JTextComponent)

public abstract View sample code for javax.swing.text.View definition code for javax.swing.text.View  getRootView(JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t)
Fetches a View with the allocation of the associated text component (i.e. the root of the hierarchy) that can be traversed to determine how the model is being represented spatially.

Returns:
the view

getToolTipText sample code for javax.swing.plaf.TextUI.getToolTipText(javax.swing.text.JTextComponent, java.awt.Point) definition code for javax.swing.plaf.TextUI.getToolTipText(javax.swing.text.JTextComponent, java.awt.Point)

public String sample code for java.lang.String definition code for java.lang.String  getToolTipText(JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent  t,
                             Point sample code for java.awt.Point definition code for java.awt.Point  pt)
Returns the string to be used as the tooltip at the passed in location.

Since:
1.4
See Also:
JTextComponent.getToolTipText(java.awt.event.MouseEvent) sample code for javax.swing.text.JTextComponent.getToolTipText(java.awt.event.MouseEvent) definition code for javax.swing.text.JTextComponent.getToolTipText(java.awt.event.MouseEvent)