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:
javax.swing.SwingConstants,javax.swing.text.TabExpander
- Enclosing class:
- RadiancePasswordFieldUI
private static class RadiancePasswordFieldUI.RadiancePasswordView extends javax.swing.text.FieldViewCustom password view.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JPasswordFieldfieldThe associated password field.
-
Constructor Summary
Constructors Modifier Constructor Description privateRadiancePasswordView(javax.swing.JPasswordField field, javax.swing.text.Element element)Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private floatdrawEchoCharacter(java.awt.Graphics g, float x, float y, boolean isSelected)Draws the echo character(s) for a single password field character.protected floatdrawSelectedText(java.awt.Graphics2D g, float x, float y, int p0, int p1)protected floatdrawUnselectedText(java.awt.Graphics2D g, float x, float y, int p0, int p1)private intgetEchoCharAdvance()Returns the advance of a single password field character.floatgetPreferredSpan(int axis)java.awt.ShapemodelToView(int pos, java.awt.Shape a, javax.swing.text.Position.Bias b)intviewToModel(float fx, float fy, java.awt.Shape a, javax.swing.text.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
-
-
-
-
Method Detail
-
drawEchoCharacter
private float drawEchoCharacter(java.awt.Graphics g, float x, float y, boolean isSelected)Draws the echo character(s) for a single password field character. The number of echo characters is defined byRadianceSynapse.PASSWORD_ECHO_PER_CHARclient 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:
RadianceSynapse.PASSWORD_ECHO_PER_CHAR
-
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_CHARcan 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(java.awt.Graphics2D g, float x, float y, int p0, int p1) throws javax.swing.text.BadLocationException- Overrides:
drawSelectedTextin classjavax.swing.text.PlainView- Throws:
javax.swing.text.BadLocationException
-
drawUnselectedText
protected float drawUnselectedText(java.awt.Graphics2D g, float x, float y, int p0, int p1) throws javax.swing.text.BadLocationException- Overrides:
drawUnselectedTextin classjavax.swing.text.PlainView- Throws:
javax.swing.text.BadLocationException
-
modelToView
public java.awt.Shape modelToView(int pos, java.awt.Shape a, javax.swing.text.Position.Bias b) throws javax.swing.text.BadLocationException- Overrides:
modelToViewin classjavax.swing.text.FieldView- Throws:
javax.swing.text.BadLocationException
-
viewToModel
public int viewToModel(float fx, float fy, java.awt.Shape a, javax.swing.text.Position.Bias[] bias)- Overrides:
viewToModelin classjavax.swing.text.FieldView
-
getPreferredSpan
public float getPreferredSpan(int axis)
- Overrides:
getPreferredSpanin classjavax.swing.text.FieldView
-
-