public class SIPCommTextFieldUI extends javax.swing.plaf.metal.MetalTextFieldUI implements Skinnable, java.awt.event.MouseMotionListener, java.awt.event.MouseListener
Modifier and Type | Field and Description |
---|---|
protected static int |
BUTTON_GAP
The gap between the delete button and the text in the field.
|
protected SIPCommButton |
deleteButton
The delete text button shown on the right of the field.
|
protected boolean |
isDeleteMouseOver
Indicates if the mouse is currently over the delete button.
|
protected boolean |
isDeleteMousePressed
Indicates if the mouse is currently pressed on the delete button.
|
Constructor and Description |
---|
SIPCommTextFieldUI()
Creates a SIPCommTextFieldUI.
|
Modifier and Type | Method and Description |
---|---|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c)
Creates a UI for a SIPCommTextFieldUI.
|
protected void |
customPaintBackground(java.awt.Graphics g)
Paints the background of the associated component.
|
protected java.awt.Rectangle |
getDeleteButtonRect()
Calculates the delete button rectangle.
|
protected java.awt.Rectangle |
getVisibleEditorRect()
If we are in the case of disabled delete button, we simply call the
parent implementation of this method, otherwise we recalculate the editor
rectangle in order to leave place for the delete button.
|
protected void |
installListeners()
Adds the custom mouse listeners defined in this class to the installed
listeners.
|
boolean |
isDeleteButtonEnabled()
Returns
true if the delete buttons is enabled and false -
otherwise. |
void |
loadSkin()
Reloads skin information.
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Updates the delete icon when the mouse was clicked.
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Updates the delete icon when the mouse is dragged over.
|
void |
mouseEntered(java.awt.event.MouseEvent e)
Updates the delete icon when the mouse is enters the component area.
|
void |
mouseExited(java.awt.event.MouseEvent e)
Updates the delete icon when the mouse exits the component area.
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Updates the delete icon when the mouse is moved over.
|
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
void |
setBgBorderEndColor(java.awt.Color bgBorderEndColor) |
void |
setBgBorderStartColor(java.awt.Color bgBorderStartColor) |
void |
setBgEndColor(java.awt.Color bgEndColor) |
void |
setBgStartColor(java.awt.Color bgStartColor) |
void |
setDeleteButtonEnabled(boolean isDeleteButtonEnabled)
Updates the isDeleteButtonEnabled field.
|
protected void |
uninstallListeners()
Uninstalls listeners for the UI.
|
protected void |
updateDeleteIcon(java.awt.event.MouseEvent evt)
Updates the delete icon, changes the cursor and deletes the content of
the associated text component when the mouse is pressed over the delete
icon.
|
create, getBaseline, getBaselineResizeBehavior, getPropertyPrefix
create, createCaret, createHighlighter, createKeymap, damageRange, damageRange, getComponent, getEditorKit, getKeymapName, getMaximumSize, getMinimumSize, getNextVisualPositionFrom, getPreferredSize, getRootView, getToolTipText, installDefaults, installKeyboardActions, installUI, modelChanged, modelToView, modelToView, paint, paintBackground, paintSafely, setView, uninstallDefaults, uninstallKeyboardActions, uninstallUI, update, viewToModel, viewToModel
protected boolean isDeleteMouseOver
protected boolean isDeleteMousePressed
protected static int BUTTON_GAP
protected SIPCommButton deleteButton
public boolean isDeleteButtonEnabled()
true
if the delete buttons is enabled and false -
otherwise.true
if the delete buttons is enabled and false -
otherwisepublic void setDeleteButtonEnabled(boolean isDeleteButtonEnabled)
isDeleteButtonEnabled
- indicates if the delete buttons is enabled
or notprotected void installListeners()
installListeners
in class javax.swing.plaf.basic.BasicTextUI
protected void uninstallListeners()
uninstallListeners
in class javax.swing.plaf.basic.BasicTextUI
protected void customPaintBackground(java.awt.Graphics g)
g
- the Graphics object used for paintingprotected void updateDeleteIcon(java.awt.event.MouseEvent evt)
evt
- the mouse event that has prompted us to update the delete
icon.protected java.awt.Rectangle getDeleteButtonRect()
protected java.awt.Rectangle getVisibleEditorRect()
getVisibleEditorRect
in class javax.swing.plaf.basic.BasicTextUI
public void setBgStartColor(java.awt.Color bgStartColor)
bgStartColor
- the bgStartColor to setpublic void setBgEndColor(java.awt.Color bgEndColor)
bgEndColor
- the bgEndColor to setpublic void setBgBorderStartColor(java.awt.Color bgBorderStartColor)
bgBorderStartColor
- the bgBorderStartColor to setpublic void setBgBorderEndColor(java.awt.Color bgBorderEndColor)
bgBorderEndColor
- the bgBorderEndColor to setpublic void loadSkin()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
e
- the MouseEvent that notified us of the clickpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
e
- the MouseEvent that notified uspublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
e
- the MouseEvent that notified uspublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
e
- the MouseEvent that notified uspublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
e
- the MouseEvent that notified uspublic static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
c
- the text field
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.