|
SIP Communicator: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
net.java.sip.communicator.impl.gui.main.contactlist.ContactListCellRenderer
public class ContactListCellRenderer
The ContactListCellRenderer is the custom cell renderer used in the SIP-Communicator's ContactList. It extends JPanel instead of JLabel, which allows adding different buttons and icons to the contact cell. The cell border and background are repainted.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected Color |
contactForegroundColor
The foreground color for contacts. |
protected int |
index
The index of the current cell. |
protected boolean |
isLeaf
Indicates if the current cell contains a leaf or a group. |
protected boolean |
isSelected
Indicates if the current list cell is selected. |
protected JLabel |
nameLabel
The component showing the name of the contact or group. |
protected JLabel |
rightLabel
The component showing the avatar or the contact count in the case of groups. |
protected ImageIcon |
statusIcon
The icon showing the contact status. |
protected JLabel |
statusMessageLabel
The status message label. |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ContactListCellRenderer()
Initializes the panel containing the node. |
|
| Method Summary | |
|---|---|
int |
getIconHeight()
Returns the height of this icon. |
int |
getIconWidth()
Returns the width of this icon. |
Component |
getListCellRendererComponent(JList list,
Object value,
int index,
boolean isSelected,
boolean cellHasFocus)
Implements the ListCellRenderer method. |
protected void |
paintComponent(Graphics g)
Paints a customized background. |
void |
paintIcon(Component c,
Graphics g,
int x,
int y)
Draw the icon at the specified location. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Color contactForegroundColor
protected final JLabel nameLabel
protected final JLabel statusMessageLabel
protected final JLabel rightLabel
protected final ImageIcon statusIcon
protected boolean isSelected
protected int index
protected boolean isLeaf
| Constructor Detail |
|---|
public ContactListCellRenderer()
| Method Detail |
|---|
public Component getListCellRendererComponent(JList list,
Object value,
int index,
boolean isSelected,
boolean cellHasFocus)
getListCellRendererComponent in interface ListCellRendererlist - the source listvalue - the value of the current cellindex - the index of the current cell in the source listisSelected - indicates if this cell is selectedcellHasFocus - indicates if this cell is focused
protected void paintComponent(Graphics g)
paintComponent in class JComponentg - the Graphics object through which we paintpublic int getIconHeight()
getIconHeight in interface Iconpublic int getIconWidth()
getIconWidth in interface Icon
public void paintIcon(Component c,
Graphics g,
int x,
int y)
paintIcon in interface Iconc - the component which can be used as observerg - the Graphics object used for paintingx - the position on the X coordinatey - the position on the Y coordinate
|
SIP Communicator: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||