Implements a View suitable for use in JPasswordField
UI implementations. This is basically a field ui that
renders its contents as the echo character specified
in the associated component (if it can narrow the
component to a JPasswordField).
Renders the given range in the model as normal unselected
text. This sets the foreground color and echos the characters
using the value returned by getEchoChar().
Renders the given range in the model as selected text. This
is implemented to render the text in the color specified in
the hosting component. It assumes the highlighter will render
the selected background. Uses the result of getEchoChar() to
display the characters.
Renders the given range in the model as selected text. This
is implemented to render the text in the color specified in
the hosting component. It assumes the highlighter will render
the selected background.
Renders the echo character, or whatever graphic should be used
to display the password characters. The color in the Graphics
object is set to the appropriate foreground color for selected
or unselected text.
Parameters:
g - the graphics context
x - the starting X coordinate >= 0
y - the starting Y coordinate >= 0
c - the echo character
Returns:
the updated X position >= 0
drawEchoCharacter
protected float drawEchoCharacter(Graphics2D g,
float x,
float y,
char c)
Renders the echo character, or whatever graphic should be used
to display the password characters. The color in the Graphics
object is set to the appropriate foreground color for selected
or unselected text.
b - the bias toward the previous character or the
next character represented by the offset, in case the
position is a boundary of two views; b will have one
of these values:
Position.Bias.Forward
Position.Bias.Backward
Returns:
the bounding box of the given position
Throws:
BadLocationException - if the given position does not
represent a valid location in the associated document
the span the view would like to be rendered into >= 0.
Typically the view is told to render into the span
that is returned, although there is no guarantee.
The parent may choose to resize or break the view.