Class MessageCellRenderer

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----javax.swing.JComponent
                           |
                           +----javax.swing.JLabel
                                   |
                                   +----MessageCellRenderer

public class MessageCellRenderer
extends JLabel
implements ListCellRenderer
MessageCellRenderer - Class built to handle the implementation of the renderer for UserName data objects. This allows the data objects to be rendered into a list format convenient for making selectios from.

Author:
Jayme Manning, Paul Kronenwetter

Constructor Index

 o MessageCellRenderer(JList)
MessageCellRenderer - Constructor used to setup the data objects for our class.
 o MessageCellRenderer(JList, Color, Color, Color, Color)
MessageCellRenderer - Constructor used to setup the data objects for our class.

Method Index

 o getListCellRendererComponent(JList, Object, int, boolean, boolean)
getListCellRendererComponent - Method used to return the ListCellRenderer for this list.

Constructors

 o MessageCellRenderer
 public MessageCellRenderer(JList newBox)
MessageCellRenderer - Constructor used to setup the data objects for our class.

Parameters:
newBox - JList to render the cells to.
 o MessageCellRenderer
 public MessageCellRenderer(JList newBox,
                            Color sb1,
                            Color sf1,
                            Color db1,
                            Color df1)
MessageCellRenderer - Constructor used to setup the data objects for our class.

Parameters:
newBox - JList to render the cells to.
sb1 - Color to render the selected background as.
sf1 - Color to render the selected foreground as.
db1 - Color to render the default background as.
df1 - Color to render the default foreground as.

Methods

 o getListCellRendererComponent
 public Component getListCellRendererComponent(JList listbox,
                                               Object value,
                                               int index,
                                               boolean isSelected,
                                               boolean cellHasFocus)
getListCellRendererComponent - Method used to return the ListCellRenderer for this list.

Parameters:
listbox - The JList to be rendered to.
value - The object that will be rendered.
index - Where we are in the list.
isSelected - Is this object currently selected.
cellHasFocus - Does this object currently have the focus.
Returns:
Component - The renderable component.