com.sas.swing.visuals
Class CheckBoxListCellRenderer

com.sas.swing.visuals.CheckBoxListCellRenderer
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.swing.ListCellRenderer
Direct Known Subclasses:
TriStateCheckBoxListCellRenderer

public class CheckBoxListCellRenderer
implements javax.swing.ListCellRenderer

Renders an item in a CheckBoxList. Instead of the cells being labels as in regular lists, CheckBoxList cells have a checkbox to change the state of the cell.

See Also:
CheckBoxList, Serialized Form

Field Summary
protected  javax.swing.JCheckBox checkBox
          checkBox to appear in the cell
 
Constructor Summary
CheckBoxListCellRenderer()
          create the default components of the cell
 
Method Summary
protected  void createCheckBox()
          create the checkBox and add it to the cell
 java.awt.Component getListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean cellHasFocus)
          Return a component that has been configured to display the specified value.
 boolean isBorderPaintedFlat()
          Returns whether the border is painted flat.
 void setBorderPaintedFlat(boolean b)
          Sets whether the border should be painted flat.
 

Field Detail

checkBox

protected javax.swing.JCheckBox checkBox
checkBox to appear in the cell

Constructor Detail

CheckBoxListCellRenderer

public CheckBoxListCellRenderer()
create the default components of the cell

Method Detail

createCheckBox

protected void createCheckBox()
create the checkBox and add it to the cell


getListCellRendererComponent

public java.awt.Component getListCellRendererComponent(javax.swing.JList list,
                                                       java.lang.Object value,
                                                       int index,
                                                       boolean isSelected,
                                                       boolean cellHasFocus)
Return a component that has been configured to display the specified value.

Specified by:
getListCellRendererComponent in interface javax.swing.ListCellRenderer
Parameters:
list - The JList to paint
value - The value returned by list.getModel().getElementAt(index)
index - The cell's index
isSelected - True if the specified cell was selected
cellHasFocus - True if the specified cell has the focus
Returns:
A component whose paint() method will render the specified value

setBorderPaintedFlat

public void setBorderPaintedFlat(boolean b)
Sets whether the border should be painted flat.

Parameters:
b - if true, the border is painted flat.

isBorderPaintedFlat

public boolean isBorderPaintedFlat()
Returns whether the border is painted flat.




Copyright © 2009 SAS Institute Inc. All Rights Reserved.