Class RadiancePasswordFieldUI.RadiancePasswordView
java.lang.Object
javax.swing.text.View
javax.swing.text.PlainView
javax.swing.text.FieldView
org.pushingpixels.radiance.theming.internal.ui.RadiancePasswordFieldUI.RadiancePasswordView
- All Implemented Interfaces:
SwingConstants
,TabExpander
- Enclosing class:
RadiancePasswordFieldUI
Custom password view.
-
Field Summary
FieldsFields inherited from class javax.swing.text.View
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
RadiancePasswordView
(JPasswordField field, Element element) Simple constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate float
drawEchoCharacter
(Graphics g, float x, float y, boolean isSelected) Draws the echo character(s) for a single password field character.protected float
drawSelectedText
(Graphics2D g, float x, float y, int p0, int p1) protected float
drawUnselectedText
(Graphics2D g, float x, float y, int p0, int p1) private int
Returns the advance of a single password field character.float
getPreferredSpan
(int axis) modelToView
(int pos, Shape a, Position.Bias b) int
viewToModel
(float fx, float fy, Shape a, Position.Bias[] bias) Methods inherited from class javax.swing.text.FieldView
adjustAllocation, getFontMetrics, getResizeWeight, insertUpdate, paint, removeUpdate
Methods inherited from class javax.swing.text.PlainView
changedUpdate, damageLineRange, drawLine, drawLine, drawSelectedText, drawUnselectedText, getLineBuffer, getTabSize, lineToRect, nextTabStop, setSize, updateDamage, updateMetrics
Methods inherited from class javax.swing.text.View
append, breakView, createFragment, forwardUpdate, forwardUpdateToView, getAlignment, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getMaximumSpan, getMinimumSpan, getNextVisualPositionFrom, getParent, getStartOffset, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, replace, setParent, updateChildren, updateLayout, viewToModel
-
Field Details
-
field
The associated password field.
-
-
Constructor Details
-
RadiancePasswordView
Simple constructor.- Parameters:
field
- The associated password field.element
- The element
-
-
Method Details
-
drawEchoCharacter
Draws the echo character(s) for a single password field character. The number of echo characters is defined byRadianceSynapse.PASSWORD_ECHO_PER_CHAR
client property.- Parameters:
g
- Graphics contextx
- X coordinate of the first echo character to draw.y
- Y coordinate of the first echo character to draw.isSelected
- Indicates whether the password field character is selected.- Returns:
- The X location of the next echo character.
- See Also:
-
getEchoCharAdvance
private int getEchoCharAdvance()Returns the advance of a single password field character. The advance is the pixel distance between first echo characters of consecutive password field characters. TheRadianceSynapse.PASSWORD_ECHO_PER_CHAR
can be used to specify that more than one echo character is used for each password field character.- Returns:
- The advance of a single password field character
-
drawSelectedText
protected float drawSelectedText(Graphics2D g, float x, float y, int p0, int p1) throws BadLocationException - Overrides:
drawSelectedText
in classPlainView
- Throws:
BadLocationException
-
drawUnselectedText
protected float drawUnselectedText(Graphics2D g, float x, float y, int p0, int p1) throws BadLocationException - Overrides:
drawUnselectedText
in classPlainView
- Throws:
BadLocationException
-
modelToView
- Overrides:
modelToView
in classFieldView
- Throws:
BadLocationException
-
viewToModel
- Overrides:
viewToModel
in classFieldView
-
getPreferredSpan
public float getPreferredSpan(int axis) - Overrides:
getPreferredSpan
in classFieldView
-