Package uk.ac.starlink.topcat
Class ColumnCellRenderer
- java.lang.Object
-
- uk.ac.starlink.topcat.ColumnCellRenderer
-
- All Implemented Interfaces:
javax.swing.ListCellRenderer
public class ColumnCellRenderer extends java.lang.Object implements javax.swing.ListCellRenderer
List cell renderer which will render StarTableColumn objects sensibly.- Since:
- 20 Feb 2004
- Author:
- Mark Taylor (Starlink)
-
-
Constructor Summary
Constructors Constructor Description ColumnCellRenderer()
Constructs a default renderer.ColumnCellRenderer(javax.swing.JComboBox comboBox)
Sets up a ColumnCellRenderer for a given combo box.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Component
getListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean hasFocus)
java.lang.Object
mapValue(java.lang.Object value)
Provides the representation (to be displayed in the combo box) for an object in the box's model.void
setNullRepresentation(java.lang.Object nullRep)
Sets the representation for the null item.
-
-
-
Constructor Detail
-
ColumnCellRenderer
public ColumnCellRenderer(javax.swing.JComboBox comboBox)
Sets up a ColumnCellRenderer for a given combo box. The only use of the combo box is that its tooltip text will be set to that of the description of the selected column (if there is one).- Parameters:
comboBox
- box to watch
-
ColumnCellRenderer
public ColumnCellRenderer()
Constructs a default renderer.
-
-
Method Detail
-
getListCellRendererComponent
public java.awt.Component getListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean hasFocus)
- Specified by:
getListCellRendererComponent
in interfacejavax.swing.ListCellRenderer
-
mapValue
public java.lang.Object mapValue(java.lang.Object value)
Provides the representation (to be displayed in the combo box) for an object in the box's model.- Parameters:
value
- input value- Returns:
- to which value is mapped
-
setNullRepresentation
public void setNullRepresentation(java.lang.Object nullRep)
Sets the representation for the null item.- Parameters:
nullRep
- null representation object to appear in combo box
-
-